1. 13 10月, 2017 1 次提交
    • B
      ath10k: fix core PCI suspend when WoWLAN is supported but disabled · 96378bd2
      Brian Norris 提交于
      For devices where the FW supports WoWLAN but user-space has not
      configured it, we don't do any PCI-specific suspend/resume operations,
      because mac80211 doesn't call drv_suspend() when !wowlan. This has
      particularly bad effects for some platforms, because we don't stop the
      power-save timer, and if this timer goes off after the PCI controller
      has suspended the link, Bad Things will happen.
      
      Commit 32faa3f0 ("ath10k: add the PCI PM core suspend/resume ops")
      got some of this right, in that it understood there was a problem on
      non-WoWLAN firmware. But it forgot the $subject case.
      
      Fix this by moving all the PCI driver suspend/resume logic exclusively
      into the driver PM hooks. This shouldn't affect WoWLAN support much
      (this just gets executed later on).
      
      I would just as well kill the entirety of ath10k_hif_suspend(), as it's
      not even implemented on the USB or SDIO drivers. I expect that we don't
      need the callback, except to return "supported" (i.e., 0) or "not
      supported" (i.e., -EOPNOTSUPP).
      
      Fixes: 32faa3f0 ("ath10k: add the PCI PM core suspend/resume ops")
      Fixes: 77258d40 ("ath10k: enable pci soc powersaving")
      Signed-off-by: NBrian Norris <briannorris@chromium.org>
      Cc: Ryan Hsu <ryanhsu@qti.qualcomm.com>
      Cc: Kalle Valo <kvalo@qca.qualcomm.com>
      Cc: Michal Kazior <michal.kazior@tieto.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      96378bd2
  2. 04 10月, 2017 1 次提交
  3. 25 9月, 2017 5 次提交
    • L
      wcn36xx: Disable 5GHz for wcn3620 · fd52bdae
      Loic Poulain 提交于
      wcn3620 can only operate on 2.4GHz band due to RF limitation.
      If wcn36xx digital block is associated with an external IRIS
      RF module, retrieve the id and disable 5GHz band in case of
      wcn3620 id.
      Signed-off-by: NLoic Poulain <loic.poulain@linaro.org>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      fd52bdae
    • V
      ath9k: Avoid a potential deadlock · ba24d63d
      Ville Syrjälä 提交于
      Lockdep warns us that sc_pm_lock and cc_lock can cause a deadlock when
      cc_lock is acquired by itself with interrupts enabled. Disable irqs
      whenever taking cc_lock to avoid this.
      
      [   19.094524] kworker/u2:0/5 just changed the state of lock:
      [   19.094578]  (&(&sc->sc_pm_lock)->rlock){-.-...}, at: [<f836c00e>] ath_isr+0x15e/0x200 [ath9k]
      [   19.094674] but this lock took another, HARDIRQ-unsafe lock in the past:
      [   19.094731]  (&(&common->cc_lock)->rlock){+.-...}
      [   19.094741]
      
                     and interrupts could create inverse lock ordering between them.
      
      [   19.094866]
                     other info that might help us debug this:
      [   19.094926]  Possible interrupt unsafe locking scenario:
      
      [   19.094985]        CPU0                    CPU1
      [   19.095036]        ----                    ----
      [   19.095086]   lock(&(&common->cc_lock)->rlock);
      [   19.095197]                                local_irq_disable();
      [   19.095305]                                lock(&(&sc->sc_pm_lock)->rlock);
      [   19.095423]                                lock(&(&common->cc_lock)->rlock);
      [   19.095539]   <Interrupt>
      [   19.095636]     lock(&(&sc->sc_pm_lock)->rlock);
      [   19.095745]
                      *** DEADLOCK ***
      
      [   19.095965] 3 locks held by kworker/u2:0/5:
      [   19.096067]  #0:  ("%s"wiphy_name(local->hw.wiphy)){.+.+.+}, at: [<c1067f37>] process_one_work+0x127/0x580
      [   19.096260]  #1:  ((&local->dynamic_ps_enable_work)){+.+...}, at: [<c1067f37>] process_one_work+0x127/0x580
      [   19.096447]  #2:  (&sc->mutex){+.+...}, at: [<f836b8b0>] ath9k_config+0x30/0x1d0 [ath9k]
      [   19.096639]
                     the shortest dependencies between 2nd lock and 1st lock:
      [   19.096813]  -> (&(&common->cc_lock)->rlock){+.-...} ops: 38 {
      [   19.096816]     HARDIRQ-ON-W at:
      [   19.096816]                       __lock_acquire+0x57e/0x1260
      [   19.096816]                       lock_acquire+0xb1/0x1c0
      [   19.096816]                       _raw_spin_lock_bh+0x3f/0x50
      [   19.096816]                       ath_chanctx_set_channel+0xb6/0x2c0 [ath9k]
      [   19.096816]                       ath9k_config+0xa8/0x1d0 [ath9k]
      [   19.096816]                       ieee80211_hw_config+0xa8/0x5f0 [mac80211]
      [   19.096816]                       ieee80211_do_open+0x67a/0x920 [mac80211]
      [   19.096816]                       ieee80211_open+0x41/0x50 [mac80211]
      [   19.096816]                       __dev_open+0xab/0x140
      [   19.096816]                       __dev_change_flags+0x89/0x150
      [   19.096816]                       dev_change_flags+0x28/0x60
      [   19.096816]                       do_setlink+0x290/0x890
      [   19.096816]                       rtnl_newlink+0x7cf/0x8e0
      [   19.096816]                       rtnetlink_rcv_msg+0xbf/0x1f0
      [   19.096816]                       netlink_rcv_skb+0xb9/0xe0
      [   19.096816]                       rtnetlink_rcv+0x1e/0x30
      [   19.096816]                       netlink_unicast+0x13a/0x2c0
      [   19.096816]                       netlink_sendmsg+0x290/0x380
      [   19.096816]                       ___sys_sendmsg+0x1e2/0x280
      [   19.096816]                       __sys_sendmsg+0x3f/0x80
      [   19.096816]                       SyS_socketcall+0x58c/0x6b0
      [   19.096816]                       do_fast_syscall_32+0x96/0x1d0
      [   19.096816]                       entry_SYSENTER_32+0x4c/0x7b
      [   19.096816]     IN-SOFTIRQ-W at:
      [   19.096816]                       __lock_acquire+0x55a/0x1260
      [   19.096816]                       lock_acquire+0xb1/0x1c0
      [   19.096816]                       _raw_spin_lock+0x3c/0x50
      [   19.096816]                       ath_ps_full_sleep+0x24/0x70 [ath9k]
      [   19.096816]                       call_timer_fn+0xa4/0x300
      [   19.096816]                       run_timer_softirq+0x1b1/0x560
      [   19.096816]                       __do_softirq+0xb0/0x430
      [   19.096816]                       do_softirq_own_stack+0x33/0x40
      [   19.096816]                       irq_exit+0xad/0xc0
      [   19.096816]                       smp_apic_timer_interrupt+0x31/0x40
      [   19.096816]                       apic_timer_interrupt+0x37/0x3c
      [   19.096816]                       wp_page_copy+0xb8/0x580
      [   19.096816]                       do_wp_page+0x64/0x420
      [   19.096816]                       handle_mm_fault+0x430/0x990
      [   19.096816]                       __do_page_fault+0x18b/0x430
      [   19.096816]                       do_page_fault+0xb/0x10
      [   19.096816]                       common_exception+0x62/0x6a
      [   19.096816]     INITIAL USE at:
      [   19.096816]                      __lock_acquire+0x204/0x1260
      [   19.096816]                      lock_acquire+0xb1/0x1c0
      [   19.096816]                      _raw_spin_lock_bh+0x3f/0x50
      [   19.096816]                      ath_chanctx_set_channel+0xb6/0x2c0 [ath9k]
      [   19.096816]                      ath9k_config+0xa8/0x1d0 [ath9k]
      [   19.096816]                      ieee80211_hw_config+0xa8/0x5f0 [mac80211]
      [   19.096816]                      ieee80211_do_open+0x67a/0x920 [mac80211]
      [   19.096816]                      ieee80211_open+0x41/0x50 [mac80211]
      [   19.096816]                      __dev_open+0xab/0x140
      [   19.096816]                      __dev_change_flags+0x89/0x150
      [   19.096816]                      dev_change_flags+0x28/0x60
      [   19.096816]                      do_setlink+0x290/0x890
      [   19.096816]                      rtnl_newlink+0x7cf/0x8e0
      [   19.096816]                      rtnetlink_rcv_msg+0xbf/0x1f0
      [   19.096816]                      netlink_rcv_skb+0xb9/0xe0
      [   19.096816]                      rtnetlink_rcv+0x1e/0x30
      [   19.096816]                      netlink_unicast+0x13a/0x2c0
      [   19.096816]                      netlink_sendmsg+0x290/0x380
      [   19.096816]                      ___sys_sendmsg+0x1e2/0x280
      [   19.096816]                      __sys_sendmsg+0x3f/0x80
      [   19.096816]                      SyS_socketcall+0x58c/0x6b0
      [   19.096816]                      do_fast_syscall_32+0x96/0x1d0
      [   19.096816]                      entry_SYSENTER_32+0x4c/0x7b
      [   19.096816]   }
      [   19.096816]   ... key      at: [<f837b694>] __key.61991+0x0/0xffffc96c [ath9k]
      [   19.096816]   ... acquired at:
      [   19.096816]    lock_acquire+0xb1/0x1c0
      [   19.096816]    _raw_spin_lock+0x3c/0x50
      [   19.096816]    ath9k_ps_wakeup+0x85/0xe0 [ath9k]
      [   19.096816]    ath9k_bss_info_changed+0x2a/0x1b0 [ath9k]
      [   19.096816]    ieee80211_bss_info_change_notify+0xf3/0x360 [mac80211]
      [   19.096816]    ieee80211_recalc_txpower+0x33/0x40 [mac80211]
      [   19.096816]    ieee80211_set_tx_power+0x45/0x1d0 [mac80211]
      [   19.096816]    cfg80211_wext_siwtxpower+0xd3/0x350 [cfg80211]
      [   19.096816]    ioctl_standard_call+0x4e/0x400
      [   19.096816]    wext_handle_ioctl+0xf4/0x190
      [   19.096816]    dev_ioctl+0xb7/0x630
      [   19.096816]    sock_ioctl+0x13e/0x2d0
      [   19.096816]    do_vfs_ioctl+0x84/0x750
      [   19.096816]    SyS_ioctl+0x34/0x60
      [   19.096816]    do_fast_syscall_32+0x96/0x1d0
      [   19.096816]    entry_SYSENTER_32+0x4c/0x7b
      
      [   19.096816] -> (&(&sc->sc_pm_lock)->rlock){-.-...} ops: 597 {
      [   19.096816]    IN-HARDIRQ-W at:
      [   19.096816]                     __lock_acquire+0x6ae/0x1260
      [   19.096816]                     lock_acquire+0xb1/0x1c0
      [   19.096816]                     _raw_spin_lock_irqsave+0x45/0x60
      [   19.096816]                     ath_isr+0x15e/0x200 [ath9k]
      [   19.096816]                     __handle_irq_event_percpu+0x44/0x340
      [   19.096816]                     handle_irq_event_percpu+0x1d/0x50
      [   19.096816]                     handle_irq_event+0x32/0x60
      [   19.096816]                     handle_level_irq+0x81/0x100
      [   19.096816]                     handle_irq+0x9c/0xd0
      [   19.096816]                     do_IRQ+0x5c/0x120
      [   19.096816]                     common_interrupt+0x36/0x3c
      [   19.096816]                     _raw_spin_unlock_irqrestore+0x57/0x70
      [   19.096816]                     ath9k_config+0x16a/0x1d0 [ath9k]
      [   19.096816]                     ieee80211_hw_config+0xa8/0x5f0 [mac80211]
      [   19.096816]                     ieee80211_dynamic_ps_enable_work+0x1c3/0x680 [mac80211]
      [   19.096816]                     process_one_work+0x1d1/0x580
      [   19.096816]                     worker_thread+0x31/0x380
      [   19.096816]                     kthread+0xd9/0x110
      [   19.096816]                     ret_from_fork+0x19/0x24
      [   19.096816]    IN-SOFTIRQ-W at:
      [   19.096816]                     __lock_acquire+0x55a/0x1260
      [   19.096816]                     lock_acquire+0xb1/0x1c0
      [   19.096816]                     _raw_spin_lock_irqsave+0x45/0x60
      [   19.096816]                     ath9k_ps_wakeup+0x24/0xe0 [ath9k]
      [   19.096816]                     ath9k_tasklet+0x42/0x260 [ath9k]
      [   19.096816]                     tasklet_action+0x196/0x1e0
      [   19.096816]                     __do_softirq+0xb0/0x430
      [   19.096816]                     do_softirq_own_stack+0x33/0x40
      [   19.096816]                     irq_exit+0xad/0xc0
      [   19.096816]                     do_IRQ+0x65/0x120
      [   19.096816]                     common_interrupt+0x36/0x3c
      [   19.096816]                     get_page_from_freelist+0x20a/0x970
      [   19.096816]                     __alloc_pages_nodemask+0xca/0xed0
      [   19.096816]                     __get_free_pages+0x14/0x30
      [   19.096816]                     pgd_alloc+0x1d/0x160
      [   19.096816]                     mm_init.isra.47+0x13a/0x1b0
      [   19.096816]                     copy_process.part.54+0xb55/0x1700
      [   19.096816]                     _do_fork+0xd4/0x6a0
      [   19.096816]                     SyS_clone+0x27/0x30
      [   19.096816]                     do_fast_syscall_32+0x96/0x1d0
      [   19.096816]                     entry_SYSENTER_32+0x4c/0x7b
      [   19.096816]    INITIAL USE at:
      [   19.096816]                    __lock_acquire+0x204/0x1260
      [   19.096816]                    lock_acquire+0xb1/0x1c0
      [   19.096816]                    _raw_spin_lock_irqsave+0x45/0x60
      [   19.096816]                    ath9k_ps_wakeup+0x24/0xe0 [ath9k]
      [   19.096816]                    ath9k_start+0x29/0x1f0 [ath9k]
      [   19.096816]                    drv_start+0x71/0x270 [mac80211]
      [   19.096816]                    ieee80211_do_open+0x31f/0x920 [mac80211]
      [   19.096816]                    ieee80211_open+0x41/0x50 [mac80211]
      [   19.096816]                    __dev_open+0xab/0x140
      [   19.096816]                    __dev_change_flags+0x89/0x150
      [   19.096816]                    dev_change_flags+0x28/0x60
      [   19.096816]                    do_setlink+0x290/0x890
      [   19.096816]                    rtnl_newlink+0x7cf/0x8e0
      [   19.096816]                    rtnetlink_rcv_msg+0xbf/0x1f0
      [   19.096816]                    netlink_rcv_skb+0xb9/0xe0
      [   19.096816]                    rtnetlink_rcv+0x1e/0x30
      [   19.096816]                    netlink_unicast+0x13a/0x2c0
      [   19.096816]                    netlink_sendmsg+0x290/0x380
      [   19.096816]                    ___sys_sendmsg+0x1e2/0x280
      [   19.096816]                    __sys_sendmsg+0x3f/0x80
      [   19.096816]                    SyS_socketcall+0x58c/0x6b0
      [   19.096816]                    do_fast_syscall_32+0x96/0x1d0
      [   19.096816]                    entry_SYSENTER_32+0x4c/0x7b
      [   19.096816]  }
      [   19.096816]  ... key      at: [<f837b67c>] __key.61994+0x0/0xffffc984 [ath9k]
      [   19.096816]  ... acquired at:
      [   19.096816]    check_usage_forwards+0x118/0x120
      [   19.096816]    mark_lock+0x2e4/0x590
      [   19.096816]    __lock_acquire+0x6ae/0x1260
      [   19.096816]    lock_acquire+0xb1/0x1c0
      [   19.096816]    _raw_spin_lock_irqsave+0x45/0x60
      [   19.096816]    ath_isr+0x15e/0x200 [ath9k]
      [   19.096816]    __handle_irq_event_percpu+0x44/0x340
      [   19.096816]    handle_irq_event_percpu+0x1d/0x50
      [   19.096816]    handle_irq_event+0x32/0x60
      [   19.096816]    handle_level_irq+0x81/0x100
      [   19.096816]    handle_irq+0x9c/0xd0
      [   19.096816]    do_IRQ+0x5c/0x120
      [   19.096816]    common_interrupt+0x36/0x3c
      [   19.096816]    _raw_spin_unlock_irqrestore+0x57/0x70
      [   19.096816]    ath9k_config+0x16a/0x1d0 [ath9k]
      [   19.096816]    ieee80211_hw_config+0xa8/0x5f0 [mac80211]
      [   19.096816]    ieee80211_dynamic_ps_enable_work+0x1c3/0x680 [mac80211]
      [   19.096816]    process_one_work+0x1d1/0x580
      [   19.096816]    worker_thread+0x31/0x380
      [   19.096816]    kthread+0xd9/0x110
      [   19.096816]    ret_from_fork+0x19/0x24
      
      [   19.096816]
                     stack backtrace:
      [   19.096816] CPU: 0 PID: 5 Comm: kworker/u2:0 Not tainted 4.13.0-mgm-ovl+ #51
      [   19.096816] Hardware name: FUJITSU SIEMENS LIFEBOOK S6120/FJNB16C, BIOS Version 1.26  05/10/2004
      [   19.096816] Workqueue: phy0 ieee80211_dynamic_ps_enable_work [mac80211]
      [   19.096816] Call Trace:
      [   19.096816]  <IRQ>
      [   19.096816]  dump_stack+0x16/0x19
      [   19.096816]  print_irq_inversion_bug.part.37+0x16c/0x179
      [   19.096816]  check_usage_forwards+0x118/0x120
      [   19.096816]  ? ret_from_fork+0x19/0x24
      [   19.096816]  ? print_shortest_lock_dependencies+0x1a0/0x1a0
      [   19.096816]  mark_lock+0x2e4/0x590
      [   19.096816]  ? print_shortest_lock_dependencies+0x1a0/0x1a0
      [   19.096816]  __lock_acquire+0x6ae/0x1260
      [   19.096816]  lock_acquire+0xb1/0x1c0
      [   19.096816]  ? ath_isr+0x15e/0x200 [ath9k]
      [   19.096816]  _raw_spin_lock_irqsave+0x45/0x60
      [   19.096816]  ? ath_isr+0x15e/0x200 [ath9k]
      [   19.096816]  ath_isr+0x15e/0x200 [ath9k]
      [   19.096816]  __handle_irq_event_percpu+0x44/0x340
      [   19.096816]  handle_irq_event_percpu+0x1d/0x50
      [   19.096816]  handle_irq_event+0x32/0x60
      [   19.096816]  ? handle_nested_irq+0x100/0x100
      [   19.096816]  handle_level_irq+0x81/0x100
      [   19.096816]  handle_irq+0x9c/0xd0
      [   19.096816]  </IRQ>
      [   19.096816]  do_IRQ+0x5c/0x120
      [   19.096816]  common_interrupt+0x36/0x3c
      [   19.096816] EIP: _raw_spin_unlock_irqrestore+0x57/0x70
      [   19.096816] EFLAGS: 00000286 CPU: 0
      [   19.096816] EAX: f60a3600 EBX: 00000286 ECX: 00000006 EDX: 00000001
      [   19.096816] ESI: f46c9e68 EDI: f46c8620 EBP: f60b5e8c ESP: f60b5e84
      [   19.096816]  DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
      [   19.096816]  ath9k_config+0x16a/0x1d0 [ath9k]
      [   19.096816]  ieee80211_hw_config+0xa8/0x5f0 [mac80211]
      [   19.096816]  ? ieee80211_hw_config+0x1db/0x5f0 [mac80211]
      [   19.096816]  ieee80211_dynamic_ps_enable_work+0x1c3/0x680 [mac80211]
      [   19.096816]  ? process_one_work+0x127/0x580
      [   19.096816]  ? process_one_work+0x127/0x580
      [   19.096816]  process_one_work+0x1d1/0x580
      [   19.096816]  ? process_one_work+0x127/0x580
      [   19.096816]  worker_thread+0x31/0x380
      [   19.096816]  kthread+0xd9/0x110
      [   19.096816]  ? process_one_work+0x580/0x580
      [   19.096816]  ? kthread_create_on_node+0x30/0x30
      [   19.096816]  ret_from_fork+0x19/0x24
      
      Cc: QCA ath9k Development <ath9k-devel@qca.qualcomm.com>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Cc: netdev@vger.kernel.org
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      ba24d63d
    • B
      ath10k: make ath10k_hw_ce_regs const · 496cbf3e
      Bhumika Goyal 提交于
      Make them const as they are not modified in the file referencing
      them. They are only stored in the const field 'hw_ce_reg' of an ath10k
      structure. Also, make the declarations in the header const.
      Signed-off-by: NBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      496cbf3e
    • T
      ath9k: Use ARRAY_SIZE macro · 896cbefa
      Thomas Meyer 提交于
      Use ARRAY_SIZE macro, rather than explicitly coding some variant of it
      yourself.
      Found with: find -type f -name "*.c" -o -name "*.h" | xargs perl -p -i -e
      's/\bsizeof\s*\(\s*(\w+)\s*\)\s*\ /\s*sizeof\s*\(\s*\1\s*\[\s*0\s*\]\s*\)
      /ARRAY_SIZE(\1)/g' and manual check/verification.
      Signed-off-by: NThomas Meyer <thomas@m3y3r.de>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      896cbefa
    • H
      ath9k: remove cast to void pointer · 50c8cd44
      Himanshu Jha 提交于
      casting to void pointer from any pointer type and vice-versa is done
      implicitly and therefore casting is not needed in such a case.
      
      Done using Coccinellle.
      Semantic Patch used :
      
      @r@
      expression x;
      void* e;
      type T;
      identifier f;
      @@
      
      (
        *((T *)e)
      |
        ((T *)x)[...]
      |
        ((T *)x)->f
      |
      - (T *)
        e
      )
      Signed-off-by: NHimanshu Jha <himanshujha199640@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@qca.qualcomm.com>
      50c8cd44
  4. 17 9月, 2017 2 次提交
  5. 16 9月, 2017 6 次提交
    • S
      netvsc: increase default receive buffer size · 5023a6db
      Stephen Hemminger 提交于
      The default receive buffer size was reduced by recent change
      to a value which was appropriate for 10G and Windows Server 2016.
      But the value is too small for full performance with 40G on Azure.
      Increase the default back to maximum supported by host.
      
      Fixes: 8b532797 ("netvsc: allow controlling send/recv buffer size")
      Signed-off-by: NStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5023a6db
    • G
      net: smsc911x: Quieten netif during suspend · 2aa70f86
      Geert Uytterhoeven 提交于
      If the network interface is kept running during suspend, the net core
      may call net_device_ops.ndo_start_xmit() while the Ethernet device is
      still suspended, which may lead to a system crash.
      
      E.g. on sh73a0/kzm9g and r8a73a4/ape6evm, the external Ethernet chip is
      driven by a PM controlled clock.  If the Ethernet registers are accessed
      while the clock is not running, the system will crash with an imprecise
      external abort.
      
      As this is a race condition with a small time window, it is not so easy
      to trigger at will.  Using pm_test may increase your chances:
      
          # echo 0 > /sys/module/printk/parameters/console_suspend
          # echo platform > /sys/power/pm_test
          # echo mem > /sys/power/state
      
      To fix this, make sure the network interface is quietened during
      suspend.
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2aa70f86
    • F
      net: systemport: Fix 64-bit stats deadlock · 7095c973
      Florian Fainelli 提交于
      We can enter a deadlock situation because there is no sufficient protection
      when ndo_get_stats64() runs in process context to guard against RX or TX NAPI
      contexts running in softirq, this can lead to the following lockdep splat and
      actual deadlock was experienced as well with an iperf session in the background
      and a while loop doing ifconfig + ethtool.
      
      [    5.780350] ================================
      [    5.784679] WARNING: inconsistent lock state
      [    5.789011] 4.13.0-rc7-02179-g32fae27c725d #70 Not tainted
      [    5.794561] --------------------------------
      [    5.798890] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
      [    5.804971] swapper/0/0 [HC0[0]:SC1[1]:HE0:SE0] takes:
      [    5.810175]  (&syncp->seq#2){+.?...}, at: [<c0768a28>] bcm_sysport_tx_reclaim+0x30/0x54
      [    5.818327] {SOFTIRQ-ON-W} state was registered at:
      [    5.823278]   bcm_sysport_get_stats64+0x17c/0x258
      [    5.828053]   dev_get_stats+0x38/0xac
      [    5.831776]   rtnl_fill_stats+0x30/0x118
      [    5.835761]   rtnl_fill_ifinfo+0x538/0xe24
      [    5.839921]   rtmsg_ifinfo_build_skb+0x6c/0xd8
      [    5.844430]   rtmsg_ifinfo_event.part.5+0x14/0x44
      [    5.849201]   rtmsg_ifinfo+0x20/0x28
      [    5.852837]   register_netdevice+0x628/0x6b8
      [    5.857171]   register_netdev+0x14/0x24
      [    5.861051]   bcm_sysport_probe+0x30c/0x438
      [    5.865280]   platform_drv_probe+0x50/0xb0
      [    5.869418]   driver_probe_device+0x2e8/0x450
      [    5.873817]   __driver_attach+0x104/0x120
      [    5.877871]   bus_for_each_dev+0x7c/0xc0
      [    5.881834]   bus_add_driver+0x1b0/0x270
      [    5.885797]   driver_register+0x78/0xf4
      [    5.889675]   do_one_initcall+0x54/0x190
      [    5.893646]   kernel_init_freeable+0x144/0x1d0
      [    5.898135]   kernel_init+0x8/0x110
      [    5.901665]   ret_from_fork+0x14/0x2c
      [    5.905363] irq event stamp: 24263
      [    5.908804] hardirqs last  enabled at (24262): [<c08eecf0>] net_rx_action+0xc4/0x4e4
      [    5.916624] hardirqs last disabled at (24263): [<c0a7da00>] _raw_spin_lock_irqsave+0x1c/0x98
      [    5.925143] softirqs last  enabled at (24258): [<c022a7fc>] irq_enter+0x84/0x98
      [    5.932524] softirqs last disabled at (24259): [<c022a918>] irq_exit+0x108/0x16c
      [    5.939985]
      [    5.939985] other info that might help us debug this:
      [    5.946576]  Possible unsafe locking scenario:
      [    5.946576]
      [    5.952556]        CPU0
      [    5.955031]        ----
      [    5.957506]   lock(&syncp->seq#2);
      [    5.960955]   <Interrupt>
      [    5.963604]     lock(&syncp->seq#2);
      [    5.967227]
      [    5.967227]  *** DEADLOCK ***
      [    5.967227]
      [    5.973222] 1 lock held by swapper/0/0:
      [    5.977092]  #0:  (&(&ring->lock)->rlock){..-...}, at: [<c0768a18>] bcm_sysport_tx_reclaim+0x20/0x54
      
      So just remove the u64_stats_update_begin()/end() pair in ndo_get_stats64()
      since it does not appear to be useful for anything. No inconsistency was
      observed with either ifconfig or ethtool, global TX counts equal the sum of
      per-queue TX counts on a 32-bit architecture.
      
      Fixes: 10377ba7 ("net: systemport: Support 64bit statistics")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7095c973
    • A
      net: vrf: avoid gcc-4.6 warning · ecf09117
      Arnd Bergmann 提交于
      When building an allmodconfig kernel with gcc-4.6, we get a rather
      odd warning:
      
      drivers/net/vrf.c: In function ‘vrf_ip6_input_dst’:
      drivers/net/vrf.c:964:3: error: initialized field with side-effects overwritten [-Werror]
      drivers/net/vrf.c:964:3: error: (near initialization for ‘fl6’) [-Werror]
      
      I have no idea what this warning is even trying to say, but it does
      seem like a false positive. Reordering the initialization in to match
      the structure definition gets rid of the warning, and might also avoid
      whatever gcc thinks is wrong here.
      
      Fixes: 9ff74384 ("net: vrf: Handle ipv6 multicast and link-local addresses")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ecf09117
    • H
      qed: remove unnecessary call to memset · 4739df62
      Himanshu Jha 提交于
      call to memset to assign 0 value immediately after allocating
      memory with kzalloc is unnecesaary as kzalloc allocates the memory
      filled with 0 value.
      
      Semantic patch used to resolve this issue:
      
      @@
      expression e,e2; constant c;
      statement S;
      @@
      
        e = kzalloc(e2, c);
        if(e == NULL) S
      - memset(e, 0, e2);
      Signed-off-by: NHimanshu Jha <himanshujha199640@gmail.com>
      Signed-off-by: NHimanshu Jha <himanshujha199640@gmail.com>
      Acked-by: NSudarsana Kalluru <sudarsana.kalluru@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4739df62
    • K
      Input: i8042 - add Gigabyte P57 to the keyboard reset table · 697c5d8a
      Kai-Heng Feng 提交于
      Similar to other Gigabyte laptops, the touchpad on P57 requires a
      keyboard reset to detect Elantech touchpad correctly.
      
      BugLink: https://bugs.launchpad.net/bugs/1594214Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      697c5d8a
  6. 15 9月, 2017 2 次提交
    • B
      Revert "PCI: Avoid race while enabling upstream bridges" · 0f50a49e
      Bjorn Helgaas 提交于
      This reverts commit 40f11adc.
      
      Jens found that iwlwifi firmware loading failed on a Lenovo X1 Carbon,
      gen4:
      
        iwlwifi 0000:04:00.0: Direct firmware load for iwlwifi-8000C-34.ucode failed with error -2
        iwlwifi 0000:04:00.0: Direct firmware load for iwlwifi-8000C-33.ucode failed with error -2
        iwlwifi 0000:04:00.0: Direct firmware load for iwlwifi-8000C-32.ucode failed with error -2
        iwlwifi 0000:04:00.0: loaded firmware version 31.532993.0 op_mode iwlmvm
        iwlwifi 0000:04:00.0: Detected Intel(R) Dual Band Wireless AC 8260, REV=0x208
        ...
        iwlwifi 0000:04:00.0: Failed to load firmware chunk!
        iwlwifi 0000:04:00.0: Could not load the [0] uCode section
        iwlwifi 0000:04:00.0: Failed to start INIT ucode: -110
        iwlwifi 0000:04:00.0: Failed to run INIT ucode: -110
      
      He bisected it to 40f11adc ("PCI: Avoid race while enabling upstream
      bridges").  Revert that commit to fix the regression.
      
      Link: http://lkml.kernel.org/r/4bcbcbc1-7c79-09f0-5071-bc2f53bf6574@kernel.dk
      Fixes: 40f11adc ("PCI: Avoid race while enabling upstream bridges")
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      CC: Srinath Mannam <srinath.mannam@broadcom.com>
      CC: Jens Axboe <axboe@kernel.dk>
      CC: Luca Coelho <luca@coelho.fi>
      CC: Johannes Berg <johannes@sipsolutions.net>
      CC: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
      0f50a49e
    • C
      tg3: clean up redundant initialization of tnapi · 23f48222
      Colin Ian King 提交于
      tnapi is being initialized and then immediately updated and
      hence the initialiation is redundant.  Clean up the warning
      by moving the declaration and initialization to the inside
      of the for-loop.
      
      Cleans up clang scan-build warning:
      warning: Value stored to 'tnapi' during its initialization is never read
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      23f48222
  7. 14 9月, 2017 16 次提交
  8. 13 9月, 2017 6 次提交
  9. 12 9月, 2017 1 次提交
    • D
      pinctrl/amd: save pin registers over suspend/resume · 79d2c8be
      Daniel Drake 提交于
      The touchpad in the Asus laptop models X505BA/BP and X542BA/BP is
      unresponsive after suspend/resume. The following error appears during
      resume:
      
        i2c_hid i2c-ELAN1300:00: failed to reset device.
      
      The problem here is that i2c_hid does not notice the interrupt being
      generated at this point, because the GPIO is no longer configured
      for interrupts.
      
      Fix this by saving pinctrl-amd pin registers during suspend and
      restoring them at resume time.
      
      Based on code from pinctrl-intel.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Drake <drake@endlessm.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      79d2c8be