1. 19 Oct, 2016 3 commits
    • Ido Schimmel's avatar
      switchdev: Execute bridge ndos only for bridge ports · 97c24290
      Ido Schimmel authored
      We recently got the following warning after setting up a vlan device on
      top of an offloaded bridge and executing 'bridge link':
      
      WARNING: CPU: 0 PID: 18566 at drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c:81 mlxsw_sp_port_orig_get.part.9+0x55/0x70 [mlxsw_spectrum]
      [...]
       CPU: 0 PID: 18566 Comm: bridge Not tainted 4.8.0-rc7 #1
       Hardware name: Mellanox Technologies Ltd. Mellanox switch/Mellanox switch, BIOS 4.6.5 05/21/2015
        0000000000000286 00000000e64ab94f ffff880406e6f8f0 ffffffff8135eaa3
        0000000000000000 0000000000000000 ffff880406e6f930 ffffffff8108c43b
        0000005106e6f988 ffff8803df398840 ffff880403c60108 ffff880406e6f990
       Call Trace:
        [<ffffffff8135eaa3>] dump_stack+0x63/0x90
        [<ffffffff8108c43b>] __warn+0xcb/0xf0
        [<ffffffff8108c56d>] warn_slowpath_null+0x1d/0x20
        [<ffffffffa01420d5>] mlxsw_sp_port_orig_get.part.9+0x55/0x70 [mlxsw_spectrum]
        [<ffffffffa0142195>] mlxsw_sp_port_attr_get+0xa5/0xb0 [mlxsw_spectrum]
        [<ffffffff816f151f>] switchdev_port_attr_get+0x4f/0x140
        [<ffffffff816f15d0>] switchdev_port_attr_get+0x100/0x140
        [<ffffffff816f15d0>] switchdev_port_attr_get+0x100/0x140
        [<ffffffff816f1d6b>] switchdev_port_bridge_getlink+0x5b/0xc0
        [<ffffffff816f2680>] ? switchdev_port_fdb_dump+0x90/0x90
        [<ffffffff815f5427>] rtnl_bridge_getlink+0xe7/0x190
        [<ffffffff8161a1b2>] netlink_dump+0x122/0x290
        [<ffffffff8161b0df>] __netlink_dump_start+0x15f/0x190
        [<ffffffff815f5340>] ? rtnl_bridge_dellink+0x230/0x230
        [<ffffffff815fab46>] rtnetlink_rcv_msg+0x1a6/0x220
        [<ffffffff81208118>] ? __kmalloc_node_track_caller+0x208/0x2c0
        [<ffffffff815f5340>] ? rtnl_bridge_dellink+0x230/0x230
        [<ffffffff815fa9a0>] ? rtnl_newlink+0x890/0x890
        [<ffffffff8161cf54>] netlink_rcv_skb+0xa4/0xc0
        [<ffffffff815f56f8>] rtnetlink_rcv+0x28/0x30
        [<ffffffff8161c92c>] netlink_unicast+0x18c/0x240
        [<ffffffff8161ccdb>] netlink_sendmsg+0x2fb/0x3a0
        [<ffffffff815c5a48>] sock_sendmsg+0x38/0x50
        [<ffffffff815c6031>] SYSC_sendto+0x101/0x190
        [<ffffffff815c7111>] ? __sys_recvmsg+0x51/0x90
        [<ffffffff815c6b6e>] SyS_sendto+0xe/0x10
        [<ffffffff817017f2>] entry_SYSCALL_64_fastpath+0x1a/0xa4
      
      The problem is that the 8021q module propagates the call to
      ndo_bridge_getlink() via switchdev ops, but the switch driver doesn't
      recognize the netdev, as it's not offloaded.
      
      While we can ignore calls being made to non-bridge ports inside the
      driver, a better fix would be to push this check up to the switchdev
      layer.
      
      Note that these ndos can be called for non-bridged netdev, but this only
      happens in certain PF drivers which don't call the corresponding
      switchdev functions anyway.
      
      Fixes: 99f44bb3 ("mlxsw: spectrum: Enable L3 interfaces on top of bridge devices")
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Reported-by: default avatarTamir Winetroub <tamirw@mellanox.com>
      Tested-by: default avatarTamir Winetroub <tamirw@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      97c24290
    • Ido Schimmel's avatar
      net: core: Correctly iterate over lower adjacency list · e4961b07
      Ido Schimmel authored
      Tamir reported the following trace when processing ARP requests received
      via a vlan device on top of a VLAN-aware bridge:
      
       NMI watchdog: BUG: soft lockup - CPU#1 stuck for 22s! [swapper/1:0]
      [...]
       CPU: 1 PID: 0 Comm: swapper/1 Tainted: G        W       4.8.0-rc7 #1
       Hardware name: Mellanox Technologies Ltd. "MSN2100-CB2F"/"SA001017", BIOS 5.6.5 06/07/2016
       task: ffff88017edfea40 task.stack: ffff88017ee10000
       RIP: 0010:[<ffffffff815dcc73>]  [<ffffffff815dcc73>] netdev_all_lower_get_next_rcu+0x33/0x60
      [...]
       Call Trace:
        <IRQ>
        [<ffffffffa015de0a>] mlxsw_sp_port_lower_dev_hold+0x5a/0xa0 [mlxsw_spectrum]
        [<ffffffffa016f1b0>] mlxsw_sp_router_netevent_event+0x80/0x150 [mlxsw_spectrum]
        [<ffffffff810ad07a>] notifier_call_chain+0x4a/0x70
        [<ffffffff810ad13a>] atomic_notifier_call_chain+0x1a/0x20
        [<ffffffff815ee77b>] call_netevent_notifiers+0x1b/0x20
        [<ffffffff815f2eb6>] neigh_update+0x306/0x740
        [<ffffffff815f38ce>] neigh_event_ns+0x4e/0xb0
        [<ffffffff8165ea3f>] arp_process+0x66f/0x700
        [<ffffffff8170214c>] ? common_interrupt+0x8c/0x8c
        [<ffffffff8165ec29>] arp_rcv+0x139/0x1d0
        [<ffffffff816e505a>] ? vlan_do_receive+0xda/0x320
        [<ffffffff815e3794>] __netif_receive_skb_core+0x524/0xab0
        [<ffffffff815e6830>] ? dev_queue_xmit+0x10/0x20
        [<ffffffffa06d612d>] ? br_forward_finish+0x3d/0xc0 [bridge]
        [<ffffffffa06e5796>] ? br_handle_vlan+0xf6/0x1b0 [bridge]
        [<ffffffff815e3d38>] __netif_receive_skb+0x18/0x60
        [<ffffffff815e3dc0>] netif_receive_skb_internal+0x40/0xb0
        [<ffffffff815e3e4c>] netif_receive_skb+0x1c/0x70
        [<ffffffffa06d7856>] br_pass_frame_up+0xc6/0x160 [bridge]
        [<ffffffffa06d63d7>] ? deliver_clone+0x37/0x50 [bridge]
        [<ffffffffa06d656c>] ? br_flood+0xcc/0x160 [bridge]
        [<ffffffffa06d7b14>] br_handle_frame_finish+0x224/0x4f0 [bridge]
        [<ffffffffa06d7f94>] br_handle_frame+0x174/0x300 [bridge]
        [<ffffffff815e3599>] __netif_receive_skb_core+0x329/0xab0
        [<ffffffff81374815>] ? find_next_bit+0x15/0x20
        [<ffffffff8135e802>] ? cpumask_next_and+0x32/0x50
        [<ffffffff810c9968>] ? load_balance+0x178/0x9b0
        [<ffffffff815e3d38>] __netif_receive_skb+0x18/0x60
        [<ffffffff815e3dc0>] netif_receive_skb_internal+0x40/0xb0
        [<ffffffff815e3e4c>] netif_receive_skb+0x1c/0x70
        [<ffffffffa01544a1>] mlxsw_sp_rx_listener_func+0x61/0xb0 [mlxsw_spectrum]
        [<ffffffffa005c9f7>] mlxsw_core_skb_receive+0x187/0x200 [mlxsw_core]
        [<ffffffffa007332a>] mlxsw_pci_cq_tasklet+0x63a/0x9b0 [mlxsw_pci]
        [<ffffffff81091986>] tasklet_action+0xf6/0x110
        [<ffffffff81704556>] __do_softirq+0xf6/0x280
        [<ffffffff8109213f>] irq_exit+0xdf/0xf0
        [<ffffffff817042b4>] do_IRQ+0x54/0xd0
        [<ffffffff8170214c>] common_interrupt+0x8c/0x8c
      
      The problem is that netdev_all_lower_get_next_rcu() never advances the
      iterator, thereby causing the loop over the lower adjacency list to run
      forever.
      
      Fix this by advancing the iterator and avoid the infinite loop.
      
      Fixes: 7ce856aa ("mlxsw: spectrum: Add couple of lower device helper functions")
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Reported-by: default avatarTamir Winetroub <tamirw@mellanox.com>
      Reviewed-by: default avatarJiri Pirko <jiri@mellanox.com>
      Acked-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e4961b07
    • Eric Garver's avatar
      flow_dissector: Check skb for VLAN only if skb specified. · 3805a938
      Eric Garver authored
      Fixes a panic when calling eth_get_headlen(). Noticed on i40e driver.
      
      Fixes: d5709f7a ("flow_dissector: For stripped vlan, get vlan info from skb->vlan_tci")
      Signed-off-by: default avatarEric Garver <e@erig.me>
      Reviewed-by: default avatarJakub Sitnicki <jkbs@redhat.com>
      Acked-by: default avatarAmir Vadai <amir@vadai.me>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3805a938
  2. 18 Oct, 2016 17 commits
  3. 17 Oct, 2016 12 commits
    • David S. Miller's avatar
      Merge branch 'net-driver-autoload' · 3dfcb4f5
      David S. Miller authored
      Javier Martinez Canillas says:
      
      ====================
      net: Fix module autoload for several platform drivers
      
      I noticed that module autoload won't be working in a bunch of platform
      drivers in the net subsystem and this patch series contains the fixes.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3dfcb4f5
    • Javier Martinez Canillas's avatar
      net: dsa: bcm_sf2: Fix module autoload for OF registration · 0822b43e
      Javier Martinez Canillas authored
      If the driver is built as a module, autoload won't work because the module
      alias information is not filled. So user-space can't match the registered
      device with the corresponding module.
      
      Export the module alias information using the MODULE_DEVICE_TABLE() macro.
      
      Before this patch:
      
      $ modinfo drivers/net/dsa/bcm_sf2.ko | grep alias
      alias:          platform:brcm-sf2
      
      After this patch:
      
      $ modinfo drivers/net/dsa/bcm_sf2.ko | grep alias
      alias:          platform:brcm-sf2
      alias:          of:N*T*Cbrcm,bcm7445-switch-v4.0C*
      alias:          of:N*T*Cbrcm,bcm7445-switch-v4.0
      Signed-off-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0822b43e
    • Javier Martinez Canillas's avatar
      net: dsa: b53: Fix module autoload · 03eaae52
      Javier Martinez Canillas authored
      If the driver is built as a module, autoload won't work because the module
      alias information is not filled. So user-space can't match the registered
      device with the corresponding module.
      
      Export the module alias information using the MODULE_DEVICE_TABLE() macro.
      
      Before this patch:
      
      $ modinfo drivers/net/dsa/b53/b53_mmap.ko  | grep alias
      $
      
      After this patch:
      
      $ modinfo drivers/net/dsa/b53/b53_mmap.ko  | grep alias
      alias:          of:N*T*Cbrcm,bcm63xx-switchC*
      alias:          of:N*T*Cbrcm,bcm63xx-switch
      alias:          of:N*T*Cbrcm,bcm6368-switchC*
      alias:          of:N*T*Cbrcm,bcm6368-switch
      alias:          of:N*T*Cbrcm,bcm6328-switchC*
      alias:          of:N*T*Cbrcm,bcm6328-switch
      alias:          of:N*T*Cbrcm,bcm3384-switchC*
      alias:          of:N*T*Cbrcm,bcm3384-switch
      Signed-off-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      03eaae52
    • Javier Martinez Canillas's avatar
      net: hisilicon: Fix hns_mdio module autoload for OF registration · af40097e
      Javier Martinez Canillas authored
      If the driver is built as a module, autoload won't work because the module
      alias information is not filled. So user-space can't match the registered
      device with the corresponding module.
      
      Export the module alias information using the MODULE_DEVICE_TABLE() macro.
      
      Before this patch:
      
      $ modinfo drivers/net/ethernet/hisilicon//hns_mdio.ko | grep alias
      alias:          platform:Hi-HNS_MDIO
      alias:          acpi*:HISI0141:*
      
      After this patch:
      
      $ modinfo drivers/net/ethernet/hisilicon//hns_mdio.ko | grep alias
      alias:          platform:Hi-HNS_MDIO
      alias:          of:N*T*Chisilicon,hns-mdioC*
      alias:          of:N*T*Chisilicon,hns-mdio
      alias:          of:N*T*Chisilicon,mdioC*
      alias:          of:N*T*Chisilicon,mdio
      alias:          acpi*:HISI0141:*
      Signed-off-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      af40097e
    • Javier Martinez Canillas's avatar
      net: qcom/emac: Fix module autoload for OF registration · 70972685
      Javier Martinez Canillas authored
      If the driver is built as a module, autoload won't work because the module
      alias information is not filled. So user-space can't match the registered
      device with the corresponding module.
      
      Export the module alias information using the MODULE_DEVICE_TABLE() macro.
      
      Before this patch:
      
      $ modinfo drivers/net/ethernet/qualcomm/emac/qcom-emac.ko | grep alias
      alias:          platform:qcom-emac
      
      After this patch:
      
      $ modinfo drivers/net/ethernet/qualcomm/emac/qcom-emac.ko | grep alias
      alias:          platform:qcom-emac
      alias:          of:N*T*Cqcom,fsm9900-emacC*
      alias:          of:N*T*Cqcom,fsm9900-emac
      Signed-off-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
      Acked-by: default avatarTimur Tabi <timur@codeaurora.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      70972685
    • Javier Martinez Canillas's avatar
      net: hns: Fix hns_dsaf module autoload for OF registration · a7deb924
      Javier Martinez Canillas authored
      If the driver is built as a module, autoload won't work because the module
      alias information is not filled. So user-space can't match the registered
      device with the corresponding module.
      
      Export the module alias information using the MODULE_DEVICE_TABLE() macro.
      
      Before this patch:
      
      $ modinfo drivers/net/ethernet/hisilicon/hns/hns_dsaf.ko | grep alias
      alias:          acpi*:HISI00B2:*
      alias:          acpi*:HISI00B1:*
      
      After this patch:
      
      $ modinfo drivers/net/ethernet/hisilicon/hns/hns_dsaf.ko | grep alias
      alias:          acpi*:HISI00B2:*
      alias:          acpi*:HISI00B1:*
      alias:          of:N*T*Chisilicon,hns-dsaf-v2C*
      alias:          of:N*T*Chisilicon,hns-dsaf-v2
      alias:          of:N*T*Chisilicon,hns-dsaf-v1C*
      alias:          of:N*T*Chisilicon,hns-dsaf-v1
      Signed-off-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a7deb924
    • Javier Martinez Canillas's avatar
      net: ethernet: nb8800: Fix module autoload · 2fa3e317
      Javier Martinez Canillas authored
      If the driver is built as a module, autoload won't work because the module
      alias information is not filled. So user-space can't match the registered
      device with the corresponding module.
      
      Export the module alias information using the MODULE_DEVICE_TABLE() macro.
      
      Before this patch:
      
      $ $ modinfo drivers/net/ethernet/aurora/nb8800.ko | grep alias
      $
      
      After this patch:
      
      $ modinfo drivers/net/ethernet/aurora/nb8800.ko | grep alias
      alias:          of:N*T*Csigma,smp8734-ethernetC*
      alias:          of:N*T*Csigma,smp8734-ethernet
      alias:          of:N*T*Csigma,smp8642-ethernetC*
      alias:          of:N*T*Csigma,smp8642-ethernet
      alias:          of:N*T*Caurora,nb8800C*
      alias:          of:N*T*Caurora,nb8800
      Signed-off-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
      Acked-by: default avatarMans Rullgard <mans@mansr.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2fa3e317
    • Javier Martinez Canillas's avatar
      net: nps_enet: Fix module autoload · fc971a2f
      Javier Martinez Canillas authored
      If the driver is built as a module, autoload won't work because the module
      alias information is not filled. So user-space can't match the registered
      device with the corresponding module.
      
      Export the module alias information using the MODULE_DEVICE_TABLE() macro.
      
      Before this patch:
      
      $ modinfo drivers/net/ethernet/ezchip/nps_enet.ko | grep alias
      $
      
      After this patch:
      
      $ modinfo drivers/net/ethernet/ezchip/nps_enet.ko | grep alias
      alias:          of:N*T*Cezchip,nps-mgt-enetC*
      alias:          of:N*T*Cezchip,nps-mgt-enet
      Signed-off-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fc971a2f
    • Colin Ian King's avatar
      cxgb4: fix memory leak of qe on error exit path · 67b11e2e
      Colin Ian King authored
      A memory leak of qe occurs when t4_sched_queue_unbind fails,
      so fix this by free'ing qe on the error exit path.
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      67b11e2e
    • Eric Dumazet's avatar
      net: pktgen: remove rcu locking in pktgen_change_name() · 9a0b1e8b
      Eric Dumazet authored
      After Jesper commit back in linux-3.18, we trigger a lockdep
      splat in proc_create_data() while allocating memory from
      pktgen_change_name().
      
      This patch converts t->if_lock to a mutex, since it is now only
      used from control path, and adds proper locking to pktgen_change_name()
      
      1) pktgen_thread_lock to protect the outer loop (iterating threads)
      2) t->if_lock to protect the inner loop (iterating devices)
      
      Note that before Jesper patch, pktgen_change_name() was lacking proper
      protection, but lockdep was not able to detect the problem.
      
      Fixes: 8788370a ("pktgen: RCU-ify "if_list" to remove lock in next_to_run()")
      Reported-by: default avatarJohn Sperbeck <jsperbeck@google.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Jesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9a0b1e8b
    • David Ahern's avatar
      net: Require exact match for TCP socket lookups if dif is l3mdev · a04a480d
      David Ahern authored
      Currently, socket lookups for l3mdev (vrf) use cases can match a socket
      that is bound to a port but not a device (ie., a global socket). If the
      sysctl tcp_l3mdev_accept is not set this leads to ack packets going out
      based on the main table even though the packet came in from an L3 domain.
      The end result is that the connection does not establish creating
      confusion for users since the service is running and a socket shows in
      ss output. Fix by requiring an exact dif to sk_bound_dev_if match if the
      skb came through an interface enslaved to an l3mdev device and the
      tcp_l3mdev_accept is not set.
      
      skb's through an l3mdev interface are marked by setting a flag in
      inet{6}_skb_parm. The IPv6 variant is already set; this patch adds the
      flag for IPv4. Using an skb flag avoids a device lookup on the dif. The
      flag is set in the VRF driver using the IP{6}CB macros. For IPv4, the
      inet_skb_parm struct is moved in the cb per commit 971f10ec, so the
      match function in the TCP stack needs to use TCP_SKB_CB. For IPv6, the
      move is done after the socket lookup, so IP6CB is used.
      
      The flags field in inet_skb_parm struct needs to be increased to add
      another flag. There is currently a 1-byte hole following the flags,
      so it can be expanded to u16 without increasing the size of the struct.
      
      Fixes: 193125db ("net: Introduce VRF device driver")
      Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a04a480d
    • Ard Biesheuvel's avatar
      mac80211: move struct aead_req off the stack · f4a067f9
      Ard Biesheuvel authored
      Some crypto implementations (such as the generic CCM wrapper in crypto/)
      use scatterlists to map fields of private data in their struct aead_req.
      This means these data structures cannot live in the vmalloc area, which
      means that they cannot live on the stack (with CONFIG_VMAP_STACK.)
      
      This currently occurs only with the generic software implementation, but
      the private data and usage is implementation specific, so move the whole
      data structures off the stack into heap by allocating every time we need
      to use them.
      
      In addition, take care not to put any of our own stack allocations into
      scatterlists. This involves reserving some extra room when allocating the
      aead_request structures, and referring to those allocations in the scatter-
      lists (while copying the data from the stack before the crypto operation)
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      f4a067f9
  4. 15 Oct, 2016 4 commits
  5. 14 Oct, 2016 4 commits
    • David S. Miller's avatar
      Merge tag 'wireless-drivers-for-davem-2016-10-14' of... · 9e55d0f9
      David S. Miller authored
      Merge tag 'wireless-drivers-for-davem-2016-10-14' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
      
      Kalle Valo says:
      
      ====================
      wireless-drivers fixes for 4.9
      
      wlcore
      
      * fix a double free regression causing hard to track crashes
      
      rtl8xxxu
      
      * fix driver reload issues, a memory leak and an endian bug
      
      rtlwifi
      
      * fix a major regression introduced in 4.9 with firmware loading on
        certain hardware
      
      ath10k
      
      * fix regression about broken cal_data debugfs file (since 4.7)
      
      ath9k
      
      * revert temperature compensation for AR9003+ devices, it was causing
        too much problems
      
      ath6kl
      
      * add Dell OEM SDIO I/O for the Venue 8 Pro
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9e55d0f9
    • Guenter Roeck's avatar
      net: asix: Avoid looping when the device does not respond · 610df1d2
      Guenter Roeck authored
      Check answers from USB stack and avoid re-sending the request
      multiple times if the device does not respond.
      
      This fixes the following problem, observed with a probably flaky adapter.
      
      [62108.732707] usb 1-3: new high-speed USB device number 5 using xhci_hcd
      [62108.914421] usb 1-3: New USB device found, idVendor=0b95, idProduct=7720
      [62108.914463] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      [62108.914476] usb 1-3: Product: AX88x72A
      [62108.914486] usb 1-3: Manufacturer: ASIX Elec. Corp.
      [62108.914495] usb 1-3: SerialNumber: 000001
      [62114.109109] asix 1-3:1.0 (unnamed net_device) (uninitialized):
      	Failed to write reg index 0x0000: -110
      [62114.109139] asix 1-3:1.0 (unnamed net_device) (uninitialized):
      	Failed to send software reset: ffffff92
      [62119.109048] asix 1-3:1.0 (unnamed net_device) (uninitialized):
      	Failed to write reg index 0x0000: -110
      ...
      
      Since the USB timeout is 5 seconds, and the operation is retried 30 times,
      this results in
      
      [62278.180353] INFO: task mtpd:1725 blocked for more than 120 seconds.
      [62278.180373]       Tainted: G        W      3.18.0-13298-g94ace9e #1
      [62278.180383] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
      ...
      [62278.180957] kworker/2:0     D 0000000000000000     0  5744      2 0x00000000
      [62278.180978] Workqueue: usb_hub_wq hub_event
      [62278.181029]  ffff880177f833b8 0000000000000046 ffff88017fd00000 ffff88017b126d80
      [62278.181048]  ffff880177f83fd8 ffff880065a71b60 0000000000013340 ffff880065a71b60
      [62278.181065]  0000000000000286 0000000103b1c199 0000000000001388 0000000000000002
      [62278.181081] Call Trace:
      [62278.181092]  [<ffffffff8e0971fd>] ? console_conditional_schedule+0x2c/0x2c
      [62278.181105]  [<ffffffff8e094f7b>] schedule+0x69/0x6b
      [62278.181117]  [<ffffffff8e0972e0>] schedule_timeout+0xe3/0x11d
      [62278.181133]  [<ffffffff8daadb1b>] ? trace_timer_start+0x51/0x51
      [62278.181146]  [<ffffffff8e095a05>] do_wait_for_common+0x12f/0x16c
      [62278.181162]  [<ffffffff8da856a7>] ? wake_up_process+0x39/0x39
      [62278.181174]  [<ffffffff8e095aee>] wait_for_common+0x52/0x6d
      [62278.181187]  [<ffffffff8e095b3b>] wait_for_completion_timeout+0x13/0x15
      [62278.181201]  [<ffffffff8de676ce>] usb_start_wait_urb+0x93/0xf1
      [62278.181214]  [<ffffffff8de6780d>] usb_control_msg+0xe1/0x11d
      [62278.181230]  [<ffffffffc037d629>] usbnet_write_cmd+0x9c/0xc6 [usbnet]
      [62278.181286]  [<ffffffffc03af793>] asix_write_cmd+0x4e/0x7e [asix]
      [62278.181300]  [<ffffffffc03afb41>] asix_set_sw_mii+0x25/0x4e [asix]
      [62278.181314]  [<ffffffffc03b001d>] asix_mdio_read+0x51/0x109 [asix]
      ...
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      610df1d2
    • Jesse Brandeburg's avatar
      ethtool: silence warning on bit loss · 85a62440
      Jesse Brandeburg authored
      Sparse was complaining when we went to prototype some code
      using ethtool_cmd_speed_set and SPEED_100000, which uses
      the upper 16 bits of __u32 speed for the first time.
      
      CHECK
      ...
      .../uapi/linux/ethtool.h:123:28: warning:
        cast truncates bits from constant value (186a0 becomes 86a0)
      
      The warning is actually bogus, as no bits are really lost, but
      we can get rid of the sparse warning with this one small change.
      Reported-by: default avatarPreethi Banala <preethi.banala@intel.com>
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      85a62440
    • Brenden Blanco's avatar
      net/mlx4_en: fixup xdp tx irq to match rx · 958b3d39
      Brenden Blanco authored
      In cases where the number of tx rings is not a multiple of the number of
      rx rings, the tx completion event will be handled on a different core
      from the transmit and population of the ring. Races on the ring will
      lead to a double-free of the page, and possibly other corruption.
      
      The rings are initialized by default with a valid multiple of rings,
      based on the number of cpus, therefore an invalid configuration requires
      ethtool to change the ring layout. For instance 'ethtool -L eth0 rx 9 tx
      8' will cause packets received on rx0, and XDP_TX'd to tx48, to be
      completed on cpu3 (48 % 9 == 3).
      
      Resolve this discrepancy by shifting the irq for the xdp tx queues to
      start again from 0, modulo rx_ring_num.
      
      Fixes: 9ecc2d86 ("net/mlx4_en: add xdp forwarding and data write support")
      Reported-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: default avatarBrenden Blanco <bblanco@plumgrid.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      958b3d39