1. 04 5月, 2019 9 次提交
    • H
      net: macb: Add null check for PCLK and HCLK · b435a79e
      Harini Katakam 提交于
      [ Upstream commit cd5afa91f078c0787be0a62b5ef90301c00b0271 ]
      
      Both PCLK and HCLK are "required" clocks according to macb devicetree
      documentation. There is a chance that devm_clk_get doesn't return a
      negative error but just a NULL clock structure instead. In such a case
      the driver proceeds as usual and uses pclk value 0 to calculate MDC
      divisor which is incorrect. Hence fix the same in clock initialization.
      Signed-off-by: NHarini Katakam <harini.katakam@xilinx.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin (Microsoft) <sashal@kernel.org>
      b435a79e
    • L
      net: ks8851: Set initial carrier state to down · bfa4cd06
      Lukas Wunner 提交于
      [ Upstream commit 9624bafa5f6418b9ca5b3f66d1f6a6a2e8bf6d4c ]
      
      The ks8851 chip's initial carrier state is down. A Link Change Interrupt
      is signaled once interrupts are enabled if the carrier is up.
      
      The ks8851 driver has it backwards by assuming that the initial carrier
      state is up. The state is therefore misrepresented if the interface is
      opened with no cable attached. Fix it.
      
      The Link Change interrupt is sometimes not signaled unless the P1MBSR
      register (which contains the Link Status bit) is read on ->ndo_open().
      This might be a hardware erratum. Read the register by calling
      mii_check_link(), which has the desirable side effect of setting the
      carrier state to down if the cable was detached while the interface was
      closed.
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Cc: Frank Pavlic <f.pavlic@kunbus.de>
      Cc: Ben Dooks <ben.dooks@codethink.co.uk>
      Cc: Tristram Ha <Tristram.Ha@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin (Microsoft) <sashal@kernel.org>
      bfa4cd06
    • L
      net: ks8851: Delay requesting IRQ until opened · 3796ab48
      Lukas Wunner 提交于
      [ Upstream commit d268f31552794abf5b6aa5af31021643411f25f5 ]
      
      The ks8851 driver currently requests the IRQ before registering the
      net_device.  Because the net_device name is used as IRQ name and is
      still "eth%d" when the IRQ is requested, it's impossibe to tell IRQs
      apart if multiple ks8851 chips are present.  Most other drivers delay
      requesting the IRQ until the net_device is opened.  Do the same.
      
      The driver doesn't enable interrupts on the chip before opening the
      net_device and disables them when closing it, so there doesn't seem to
      be a need to request the IRQ already on probe.
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Cc: Frank Pavlic <f.pavlic@kunbus.de>
      Cc: Ben Dooks <ben.dooks@codethink.co.uk>
      Cc: Tristram Ha <Tristram.Ha@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin (Microsoft) <sashal@kernel.org>
      3796ab48
    • L
      net: ks8851: Reassert reset pin if chip ID check fails · 3005509f
      Lukas Wunner 提交于
      [ Upstream commit 761cfa979a0c177d6c2d93ef5585cd79ae49a7d5 ]
      
      Commit 73fdeb82 ("net: ks8851: Add optional vdd_io regulator and
      reset gpio") amended the ks8851 driver to briefly assert the chip's
      reset pin on probe. It also amended the probe routine's error path to
      reassert the reset pin if a subsequent initialization step fails.
      
      However the commit misplaced reassertion of the reset pin in the error
      path such that it is not performed if the check of the Chip ID and
      Enable Register (CIDER) fails. The error path is therefore slightly
      asymmetrical to the probe routine's body. Fix it.
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Cc: Frank Pavlic <f.pavlic@kunbus.de>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Nishanth Menon <nm@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin (Microsoft) <sashal@kernel.org>
      3005509f
    • L
      net: ks8851: Dequeue RX packets explicitly · fb6ca157
      Lukas Wunner 提交于
      [ Upstream commit 536d3680fd2dab5c39857d62a3e084198fc74ff9 ]
      
      The ks8851 driver lets the chip auto-dequeue received packets once they
      have been read in full. It achieves that by setting the ADRFE flag in
      the RXQCR register ("Auto-Dequeue RXQ Frame Enable").
      
      However if allocation of a packet's socket buffer or retrieval of the
      packet over the SPI bus fails, the packet will not have been read in
      full and is not auto-dequeued. Such partial retrieval of a packet
      confuses the chip's RX queue management:  On the next RX interrupt,
      the first packet read from the queue will be the one left there
      previously and this one can be retrieved without issues. But for any
      newly received packets, the frame header status and byte count registers
      (RXFHSR and RXFHBCR) contain bogus values, preventing their retrieval.
      
      The chip allows explicitly dequeueing a packet from the RX queue by
      setting the RRXEF flag in the RXQCR register ("Release RX Error Frame").
      This could be used to dequeue the packet in case of an error, but if
      that error is a failed SPI transfer, it is unknown if the packet was
      transferred in full and was auto-dequeued or if it was only transferred
      in part and requires an explicit dequeue. The safest approach is thus
      to always dequeue packets explicitly and forgo auto-dequeueing.
      
      Without this change, I've witnessed packet retrieval break completely
      when an SPI DMA transfer fails, requiring a chip reset. Explicit
      dequeueing magically fixes this and makes packet retrieval absolutely
      robust for me.
      
      The chip's documentation suggests auto-dequeuing and uses the RRXEF
      flag only to dequeue error frames which the driver doesn't want to
      retrieve. But that seems to be a fair-weather approach.
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Cc: Frank Pavlic <f.pavlic@kunbus.de>
      Cc: Ben Dooks <ben.dooks@codethink.co.uk>
      Cc: Tristram Ha <Tristram.Ha@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin (Microsoft) <sashal@kernel.org>
      fb6ca157
    • A
      qlcnic: Avoid potential NULL pointer dereference · fc055dff
      Aditya Pakki 提交于
      [ Upstream commit 5bf7295fe34a5251b1d241b9736af4697b590670 ]
      
      netdev_alloc_skb can fail and return a NULL pointer which is
      dereferenced without a check. The patch avoids such a scenario.
      Signed-off-by: NAditya Pakki <pakki001@umn.edu>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin (Microsoft) <sashal@kernel.org>
      fc055dff
    • A
      net: stmmac: don't set own bit too early for jumbo frames · 98650508
      Aaro Koskinen 提交于
      [ Upstream commit 80acbed9f8fca1db3fbe915540b756f048aa0fd7 ]
      
      Commit 0e80bdc9 ("stmmac: first frame prep at the end of xmit
      routine") overlooked jumbo frames when re-ordering the code, and as a
      result the own bit was not getting set anymore for the first jumbo frame
      descriptor. Commit 487e2e22ab79 ("net: stmmac: Set OWN bit for jumbo
      frames") tried to fix this, but now the bit is getting set too early and
      the DMA may start while we are still setting up the remaining descriptors.
      And with the chain mode the own bit remains still unset.
      
      Fix by setting the own bit at the end of xmit also with jumbo frames.
      
      Fixes: 0e80bdc9 ("stmmac: first frame prep at the end of xmit routine")
      Fixes: 487e2e22ab79 ("net: stmmac: Set OWN bit for jumbo frames")
      Signed-off-by: NAaro Koskinen <aaro.koskinen@nokia.com>
      Acked-by: NJose Abreu <joabreu@synopsys.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin (Microsoft) <sashal@kernel.org>
      98650508
    • L
      ieee802154: hwsim: propagate genlmsg_reply return code · 24a46cad
      Li RongQing 提交于
      [ Upstream commit 19b39a25388e71390e059906c979f87be4ef0c71 ]
      
      genlmsg_reply can fail, so propagate its return code
      Signed-off-by: NLi RongQing <lirongqing@baidu.com>
      Signed-off-by: NStefan Schmidt <stefan@datenfreihafen.org>
      Signed-off-by: NSasha Levin (Microsoft) <sashal@kernel.org>
      24a46cad
    • K
      net: ieee802154: fix a potential NULL pointer dereference · f722b778
      Kangjie Lu 提交于
      [ Upstream commit 2795e8c251614ac0784c9d41008551109f665716 ]
      
      In case alloc_ordered_workqueue fails, the fix releases
      sources and returns -ENOMEM to avoid NULL pointer dereference.
      Signed-off-by: NKangjie Lu <kjlu@umn.edu>
      Acked-by: NMichael Hennerich <michael.hennerich@analog.com>
      Signed-off-by: NStefan Schmidt <stefan@datenfreihafen.org>
      Signed-off-by: NSasha Levin (Microsoft) <sashal@kernel.org>
      f722b778
  2. 02 5月, 2019 15 次提交
  3. 27 4月, 2019 9 次提交
  4. 20 4月, 2019 2 次提交
    • T
      net: stmmac: Set OWN bit for jumbo frames · fc34758d
      Thor Thayer 提交于
      [ Upstream commit 487e2e22ab7968f2c0c82f37b5ca5883efd1a354 ]
      
      Ping with Jumbo packet does not reply and get a watchdog timeout
      
      [   46.059616] ------------[ cut here ]------------
      [   46.064268] NETDEV WATCHDOG: eth0 (socfpga-dwmac): transmit queue 0 timed out
      [   46.071471] WARNING: CPU: 1 PID: 0 at net/sched/sch_generic.c:461 dev_watchdog+0x2cc/0x2d8
      [   46.079708] Modules linked in:
      [   46.082761] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.18.0-00115-gc262be665854-dirty #264
      [   46.091082] Hardware name: SoCFPGA Stratix 10 SoCDK (DT)
      [   46.096377] pstate: 20000005 (nzCv daif -PAN -UAO)
      [   46.101152] pc : dev_watchdog+0x2cc/0x2d8
      [   46.105149] lr : dev_watchdog+0x2cc/0x2d8
      [   46.109144] sp : ffff00000800bd80
      [   46.112447] x29: ffff00000800bd80 x28: ffff80007a9b4940
      [   46.117744] x27: 00000000ffffffff x26: ffff80007aa183b0
      [   46.123040] x25: 0000000000000001 x24: 0000000000000140
      [   46.128336] x23: ffff80007aa1839c x22: ffff80007aa17fb0
      [   46.133632] x21: ffff80007aa18000 x20: ffff0000091a7000
      [   46.138927] x19: 0000000000000000 x18: ffffffffffffffff
      [   46.144223] x17: 0000000000000000 x16: 0000000000000000
      [   46.149519] x15: ffff0000091a96c8 x14: 07740775076f0720
      [   46.154814] x13: 07640765076d0769 x12: 0774072007300720
      [   46.160110] x11: 0765077507650775 x10: 0771072007740769
      [   46.165406] x9 : 076d0773076e0761 x8 : 077207740720073a
      [   46.170702] x7 : 072907630761076d x6 : ffff80007ff9a0c0
      [   46.175997] x5 : ffff80007ff9a0c0 x4 : 0000000000000002
      [   46.181293] x3 : 0000000000000000 x2 : ffff0000091ac180
      [   46.186589] x1 : e6a742ebe628e800 x0 : 0000000000000000
      [   46.191885] Call trace:
      [   46.194326]  dev_watchdog+0x2cc/0x2d8
      [   46.197980]  call_timer_fn+0x20/0x78
      [   46.201544]  expire_timers+0xa4/0xb0
      [   46.205108]  run_timer_softirq+0xe4/0x198
      [   46.209107]  __do_softirq+0x114/0x210
      [   46.212760]  irq_exit+0xd0/0xd8
      [   46.215895]  __handle_domain_irq+0x60/0xb0
      [   46.219977]  gic_handle_irq+0x58/0xa8
      [   46.223628]  el1_irq+0xb0/0x128
      [   46.226761]  arch_cpu_idle+0x10/0x18
      [   46.230326]  do_idle+0x1d4/0x288
      [   46.233544]  cpu_startup_entry+0x24/0x28
      [   46.237457]  secondary_start_kernel+0x17c/0x1c0
      [   46.241971] ---[ end trace 57048cd1372cd828 ]---
      
      Inspection of queue showed Jumbo packets were not sent out.
      The ring Jumbo packet function needs to set the OWN bit so
      the packet is sent.
      Signed-off-by: NThor Thayer <thor.thayer@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      fc34758d
    • S
      rsi: improve kernel thread handling to fix kernel panic · de1fd69b
      Siva Rebbagondla 提交于
      [ Upstream commit 4c62764d0fc21a34ffc44eec1210038c3a2e4473 ]
      
      While running regressions, observed below kernel panic when sdio disconnect
      called. This is because of, kthread_stop() is taking care of
      wait_for_completion() by default. When wait_for_completion triggered
      in kthread_stop and as it was done already, giving kernel panic.
      Hence, removing redundant wait_for_completion() from rsi_kill_thread().
      
      ... skipping ...
      BUG: unable to handle kernel NULL pointer dereference at           (null)
      IP: [<ffffffff810a63df>] exit_creds+0x1f/0x50
      PGD 0
      Oops: 0002 [#1] SMP
      CPU: 0 PID: 6502 Comm: rmmod Tainted: G  OE   4.15.9-Generic #154-Ubuntu
      Hardware name: Dell Inc. Edge Gateway 3003/ , BIOS 01.00.00 04/17/2017
      Stack:
      ffff88007392e600 ffff880075847dc0 ffffffff8108160a 0000000000000000
      ffff88007392e600 ffff880075847de8 ffffffff810a484b ffff880076127000
      ffff88003cd3a800 ffff880074f12a00 ffff880075847e28 ffffffffc09bed15
      Call Trace:
      [<ffffffff8108160a>] __put_task_struct+0x5a/0x140
      [<ffffffff810a484b>] kthread_stop+0x10b/0x110
      [<ffffffffc09bed15>] rsi_disconnect+0x2f5/0x300 [ven_rsi_sdio]
      [<ffffffff81578bcb>] ? __pm_runtime_resume+0x5b/0x80
      [<ffffffff816f0918>] sdio_bus_remove+0x38/0x100
      [<ffffffff8156cc64>] __device_release_driver+0xa4/0x150
      [<ffffffff8156d7a5>] driver_detach+0xb5/0xc0
      [<ffffffff8156c6c5>] bus_remove_driver+0x55/0xd0
      [<ffffffff8156dfbc>] driver_unregister+0x2c/0x50
      [<ffffffff816f0b8a>] sdio_unregister_driver+0x1a/0x20
      [<ffffffffc09bf0f5>] rsi_module_exit+0x15/0x30 [ven_rsi_sdio]
      [<ffffffff8110cad8>] SyS_delete_module+0x1b8/0x210
      [<ffffffff81851dc8>] entry_SYSCALL_64_fastpath+0x1c/0xbb
      Signed-off-by: NSiva Rebbagondla <siva.rebbagondla@redpinesignals.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      de1fd69b
  5. 17 4月, 2019 5 次提交