1. 22 4月, 2017 22 次提交
    • A
      net: dsa: LAN9303: add I2C dependency · 239c599a
      Arnd Bergmann 提交于
      With CONFIG_I2C=m and NET_DSA_SMSC_LAN9303=y, we run into a link error:
      
      drivers/base/regmap/regmap-i2c.o: In function `regmap_smbus_byte_reg_read':
      regmap-i2c.c:(.text.regmap_smbus_byte_reg_read+0x18): undefined reference to `i2c_smbus_read_byte_data'
      drivers/base/regmap/regmap-i2c.o: In function `regmap_smbus_byte_reg_write':
      regmap-i2c.c:(.text.regmap_smbus_byte_reg_write+0x18): undefined reference to `i2c_smbus_write_byte_data'
      drivers/base/regmap/regmap-i2c.o: In function `regmap_smbus_word_reg_read':
      regmap-i2c.c:(.text.regmap_smbus_word_reg_read+0x18): undefined reference to `i2c_smbus_read_word_data'
      drivers/base/regmap/regmap-i2c.o: In function `regmap_smbus_word_read_swapped':
      regmap-i2c.c:(.text.regmap_smbus_word_read_swapped+0x18): undefined reference to `i2c_smbus_read_word_data'
      drivers/base/regmap/regmap-i2c.o: In function `regmap_smbus_word_write_swapped':
      
      This adds a Kconfig dependency to avoid the broken configuration.
      
      Fixes: be4e119f ("net: dsa: LAN9303: add I2C managed mode support")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      239c599a
    • M
      bonding: fix wq initialization for links created via netlink · ea8ffc08
      Mahesh Bandewar 提交于
      Earlier patch 4493b81b ("bonding: initialize work-queues during
      creation of bond") moved the work-queue initialization from bond_open()
      to bond_create(). However this caused the link those are created using
      netlink 'create bond option' (ip link add bondX type bond); create the
      new trunk without initializing work-queues. Prior to the above mentioned
      change, ndo_open was in both paths and things worked correctly. The
      consequence is visible in the report shared by Joe Stringer -
      
      I've noticed that this patch breaks bonding within namespaces if
      you're not careful to perform device cleanup correctly.
      
      Here's my repro script, you can run on any net-next with this patch
      and you'll start seeing some weird behaviour:
      
      ip netns add foo
      ip li add veth0 type veth peer name veth0+ netns foo
      ip li add veth1 type veth peer name veth1+ netns foo
      ip netns exec foo ip li add bond0 type bond
      ip netns exec foo ip li set dev veth0+ master bond0
      ip netns exec foo ip li set dev veth1+ master bond0
      ip netns exec foo ip addr add dev bond0 192.168.0.1/24
      ip netns exec foo ip li set dev bond0 up
      ip li del dev veth0
      ip li del dev veth1
      
      The second to last command segfaults, last command hangs. rtnl is now
      permanently locked. It's not a problem if you take bond0 down before
      deleting veths, or delete bond0 before deleting veths. If you delete
      either end of the veth pair as per above, either inside or outside the
      namespace, it hits this problem.
      
      Here's some kernel logs:
      [ 1221.801610] bond0: Enslaving veth0+ as an active interface with an up link
      [ 1224.449581] bond0: Enslaving veth1+ as an active interface with an up link
      [ 1281.193863] bond0: Releasing backup interface veth0+
      [ 1281.193866] bond0: the permanent HWaddr of veth0+ -
      16:bf:fb:e0:b8:43 - is still in use by bond0 - set the HWaddr of
      veth0+ to a different address to avoid conflicts
      [ 1281.193867] ------------[ cut here ]------------
      [ 1281.193873] WARNING: CPU: 0 PID: 2024 at kernel/workqueue.c:1511
      __queue_delayed_work+0x13f/0x150
      [ 1281.193873] Modules linked in: bonding veth openvswitch nf_nat_ipv6
      nf_nat_ipv4 nf_nat autofs4 nfsd auth_rpcgss nfs_acl binfmt_misc nfs
      lockd grace sunrpc fscache ppdev vmw_balloon coretemp psmouse
      serio_raw vmwgfx ttm drm_kms_helper vmw_vmci netconsole parport_pc
      configfs drm i2c_piix4 fb_sys_fops syscopyarea sysfillrect sysimgblt
      shpchp mac_hid nf_conntrack_ipv6 nf_defrag_ipv6 nf_conntrack_ipv4
      nf_defrag_ipv4 nf_conntrack libcrc32c lp parport hid_generic usbhid
      hid mptspi mptscsih e1000 mptbase ahci libahci
      [ 1281.193905] CPU: 0 PID: 2024 Comm: ip Tainted: G        W
      4.10.0-bisect-bond-v0.14 #37
      [ 1281.193906] Hardware name: VMware, Inc. VMware Virtual
      Platform/440BX Desktop Reference Platform, BIOS 6.00 09/30/2014
      [ 1281.193906] Call Trace:
      [ 1281.193912]  dump_stack+0x63/0x89
      [ 1281.193915]  __warn+0xd1/0xf0
      [ 1281.193917]  warn_slowpath_null+0x1d/0x20
      [ 1281.193918]  __queue_delayed_work+0x13f/0x150
      [ 1281.193920]  queue_delayed_work_on+0x27/0x40
      [ 1281.193929]  bond_change_active_slave+0x25b/0x670 [bonding]
      [ 1281.193932]  ? synchronize_rcu_expedited+0x27/0x30
      [ 1281.193935]  __bond_release_one+0x489/0x510 [bonding]
      [ 1281.193939]  ? addrconf_notify+0x1b7/0xab0
      [ 1281.193942]  bond_netdev_event+0x2c5/0x2e0 [bonding]
      [ 1281.193944]  ? netconsole_netdev_event+0x124/0x190 [netconsole]
      [ 1281.193947]  notifier_call_chain+0x49/0x70
      [ 1281.193948]  raw_notifier_call_chain+0x16/0x20
      [ 1281.193950]  call_netdevice_notifiers_info+0x35/0x60
      [ 1281.193951]  rollback_registered_many+0x23b/0x3e0
      [ 1281.193953]  unregister_netdevice_many+0x24/0xd0
      [ 1281.193955]  rtnl_delete_link+0x3c/0x50
      [ 1281.193956]  rtnl_dellink+0x8d/0x1b0
      [ 1281.193960]  rtnetlink_rcv_msg+0x95/0x220
      [ 1281.193962]  ? __kmalloc_node_track_caller+0x35/0x280
      [ 1281.193964]  ? __netlink_lookup+0xf1/0x110
      [ 1281.193966]  ? rtnl_newlink+0x830/0x830
      [ 1281.193967]  netlink_rcv_skb+0xa7/0xc0
      [ 1281.193969]  rtnetlink_rcv+0x28/0x30
      [ 1281.193970]  netlink_unicast+0x15b/0x210
      [ 1281.193971]  netlink_sendmsg+0x319/0x390
      [ 1281.193974]  sock_sendmsg+0x38/0x50
      [ 1281.193975]  ___sys_sendmsg+0x25c/0x270
      [ 1281.193978]  ? mem_cgroup_commit_charge+0x76/0xf0
      [ 1281.193981]  ? page_add_new_anon_rmap+0x89/0xc0
      [ 1281.193984]  ? lru_cache_add_active_or_unevictable+0x35/0xb0
      [ 1281.193985]  ? __handle_mm_fault+0x4e9/0x1170
      [ 1281.193987]  __sys_sendmsg+0x45/0x80
      [ 1281.193989]  SyS_sendmsg+0x12/0x20
      [ 1281.193991]  do_syscall_64+0x6e/0x180
      [ 1281.193993]  entry_SYSCALL64_slow_path+0x25/0x25
      [ 1281.193995] RIP: 0033:0x7f6ec122f5a0
      [ 1281.193995] RSP: 002b:00007ffe69e89c48 EFLAGS: 00000246 ORIG_RAX:
      000000000000002e
      [ 1281.193997] RAX: ffffffffffffffda RBX: 00007ffe69e8dd60 RCX: 00007f6ec122f5a0
      [ 1281.193997] RDX: 0000000000000000 RSI: 00007ffe69e89c90 RDI: 0000000000000003
      [ 1281.193998] RBP: 00007ffe69e89c90 R08: 0000000000000000 R09: 0000000000000003
      [ 1281.193999] R10: 00007ffe69e89a10 R11: 0000000000000246 R12: 0000000058f14b9f
      [ 1281.193999] R13: 0000000000000000 R14: 00000000006473a0 R15: 00007ffe69e8e450
      [ 1281.194001] ---[ end trace 713a77486cbfbfa3 ]---
      
      Fixes: 4493b81b ("bonding: initialize work-queues during creation of bond")
      Reported-by: NJoe Stringer <joe@ovn.org>
      Tested-by: NJoe Stringer <joe@ovn.org>
      Signed-off-by: NMahesh Bandewar <maheshb@google.com>
      Acked-by: NAndy Gospodarek <andy@greyhouse.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ea8ffc08
    • A
      net: arc_emac: switch to phy_start()/phy_stop() · b18b7453
      Alexander Kochetkov 提交于
      Currently driver use phy_start_aneg() in arc_emac_open() to bring
      up PHY. But phy_start() function is more appropriate for this purposes.
      Besides that it call phy_start_aneg() as part of PHY startup sequence
      it also can correctly bring up PHY from error and suspended states.
      So the patch replace phy_start_aneg() to phy_start().
      
      Also the patch add call to phy_stop() to arc_emac_stop() to allow
      the PHY device to be fully suspended when the interface is unused.
      Signed-off-by: NAlexander Kochetkov <al.kochet@gmail.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b18b7453
    • S
      netvsc: fix use after free on module removal · 76bb5db5
      stephen hemminger 提交于
      The NAPI data structure is embedded in the netvsc_device structure
      and is freed when device is closed. There is still a reference
      (in NAPI list) to this which causes a crash in netif_napi_del
      when device is removed. Fix by managing NAPI instances correctly.
      Signed-off-by: NStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      76bb5db5
    • K
      netvsc: Deal with rescinded channels correctly · 73e64fa4
      K. Y. Srinivasan 提交于
      We will not be able to send packets over a channel that has been
      rescinded. Make necessary adjustments so we can properly cleanup
      even when the channel is rescinded. This issue can be trigerred
      in the NIC hot-remove path.
      Signed-off-by: NK. Y. Srinivasan <kys@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      73e64fa4
    • N
      ibmvnic: Remove unused bouce buffer · d76e0fec
      Nathan Fontenot 提交于
      The bounce buffer is not used in the ibmvnic driver, just
      get rid of it.
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d76e0fec
    • N
      ibmvnic: Allocate zero-filled memory for sub crqs · 7f7adc50
      Nathan Fontenot 提交于
      Update the allocation of memory for the sub crq structs and their
      associated pages to allocate zero-filled memory.
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7f7adc50
    • B
      ibmvnic: Disable irq prior to close · dd9c20fa
      Brian King 提交于
          Add some code to call disable_irq on all the vnic interface's irqs.
          This fixes a crash observed when closing an active interface, as
          seen in the oops below when we try to access a buffer in the interrupt
          handler which we've already freed.
      
          Unable to handle kernel paging request for data at address 0x00000001
          Faulting instruction address: 0xd000000003886824
          Oops: Kernel access of bad area, sig: 11 [#1]
          SMP NR_CPUS=2048 NUMA pSeries
          Modules linked in: ibmvnic(OEN) rpadlpar_io(X) rpaphp(X) tcp_diag udp_diag inet_diag unix_diag af_packet_diag netlink_diag rpcsec_
          Supported: No, Unsupported modules are loaded
          CPU: 8 PID: 0 Comm: swapper/8 Tainted: G           OE   NX 4.4.49-92.11-default #1
          task: c00000007f990110 ti: c0000000fffa0000 task.ti: c00000007f9b8000
          NIP: d000000003886824 LR: d000000003886824 CTR: c0000000007eff60
          REGS: c0000000fffa3a70 TRAP: 0300   Tainted: G           OE   NX  (4.4.49-92.11-default)
          MSR: 8000000000009033 <SF,EE,ME,IR,DR,RI,LE>  CR: 22008042  XER: 20000008
          CFAR: c000000000008468 DAR: 0000000000000001 DSISR: 40000000 SOFTE: 0
          GPR00: d000000003886824 c0000000fffa3cf0 d000000003894118 0000000000000000
          GPR04: 0000000000000000 0000000000000000 c000000001249da0 0000000000000000
          GPR08: 000000000000000e 0000000000000000 c0000000ccb00000 d000000003889180
          GPR12: c0000000007eff60 c000000007af4c00 0000000000000001 c0000000010def30
          GPR16: c00000007f9b8000 c000000000b98c30 c00000007f9b8080 c000000000bab858
          GPR20: 0000000000000005 0000000000000000 c0000000ff5d7e80 c0000000f809f648
          GPR24: c0000000ff5d7ec8 0000000000000000 0000000000000000 c0000000ccb001a0
          GPR28: 000000000000000a c0000000f809f600 c0000000fd4cd900 c0000000f9cd5b00
          NIP [d000000003886824] ibmvnic_interrupt_tx+0x114/0x380 [ibmvnic]
          LR [d000000003886824] ibmvnic_interrupt_tx+0x114/0x380 [ibmvnic]
          Call Trace:
          [c0000000fffa3cf0] [d000000003886824] ibmvnic_interrupt_tx+0x114/0x380 [ibmvnic] (unreliable)
          [c0000000fffa3dd0] [c000000000132940] __handle_irq_event_percpu+0x90/0x2e0
          [c0000000fffa3e90] [c000000000132bcc] handle_irq_event_percpu+0x3c/0x90
          [c0000000fffa3ed0] [c000000000132c88] handle_irq_event+0x68/0xc0
          [c0000000fffa3f00] [c000000000137edc] handle_fasteoi_irq+0xec/0x250
          [c0000000fffa3f30] [c000000000131b04] generic_handle_irq+0x54/0x80
          [c0000000fffa3f60] [c000000000011190] __do_irq+0x80/0x1d0
          [c0000000fffa3f90] [c0000000000248d8] call_do_irq+0x14/0x24
          [c00000007f9bb9e0] [c000000000011380] do_IRQ+0xa0/0x120
          [c00000007f9bba40] [c000000000002594] hardware_interrupt_common+0x114/0x180
      Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dd9c20fa
    • N
      ibmvnic: Correct crq and resource releasing · 37489055
      Nathan Fontenot 提交于
      We should not be releasing the crq's when calling close for the
      adapter, these need to remain open to facilitate operations such
      as updating the mac address. The crq's should be released in the
      adpaters remove routine.
      
      Additionally, we need to call release_reources from remove. This
      corrects the scenario of trying to remove an adapter that has only
      been probed.
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      37489055
    • N
      ibmvnic: Remove inflight list · 661a2622
      Nathan Fontenot 提交于
      The inflight list used to track memory that is allocated for crq that are
      inflight is not needed. The one piece of the inflight list that does need
      to be cleaned at module exit is the error buffer list which is already
      attached to the adapter struct.
      
      This patch removes the inflight list and moves checking the error buffer
      list to ibmvnic_remove.
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      661a2622
    • B
      ibmvnic: Do not disable IRQ after scheduling tasklet · ed7ecbf7
      Brian King 提交于
      Since the primary CRQ is only used for service functions and
      not in the performance path, simplify the code a bit and avoid
      disabling the IRQ.
      Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ed7ecbf7
    • B
      ibmvnic: Fixup atomic API usage · 58c8c0c0
      Brian King 提交于
      Replace a couple of modifications of an atomic followed
      by a read of the atomic, which is no longer atomic, to
      use atomic_XX_return variants to avoid race conditions.
      Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      58c8c0c0
    • B
      ibmvnic: Unmap longer term buffer before free · 59af56c2
      Brian King 提交于
      Make sure we unregister long term buffers from the adapter
      prior to DMA unmapping it and freeing the buffer. Failure
      to do so could result in a DMA to a now invalid address.
      Signed-off-by: NBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      59af56c2
    • M
      ibmvnic: Fix ibmvnic_change_mac_addr struct format · 993a82b0
      Murilo Fossa Vicentini 提交于
      The ibmvnic_change_mac_addr struct alignment was not matching the defined
      format in PAPR+, it had the reserved and return code fields swapped. As a
      consequence, the CHANGE_MAC_ADDR_RSP commands were being improperly handled
      and executed even when the operation wasn't successfully completed by the
      system firmware.
      
      Also changing the endianness of the debug message to make it easier to
      parse the CRQ content.
      Signed-off-by: NMurilo Fossa Vicentini <muvic@linux.vnet.ibm.com>
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      993a82b0
    • T
      ibmvnic: Report errors when failing to release sub-crqs · ffa73855
      Thomas Falcon 提交于
      Add reporting of errors when releasing sub-crqs fails.
      Signed-off-by: NThomas Falcon <tlfalcon@us.ibm.com>
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ffa73855
    • A
      liquidio: remove unnecessary variable assignment · ca1cb28d
      Arnd Bergmann 提交于
      gcc points out an useless assignment that was added during code refactoring:
      
      drivers/net/ethernet/cavium/liquidio/lio_ethtool.c: In function 'octnet_intrmod_callback':
      drivers/net/ethernet/cavium/liquidio/lio_ethtool.c:1315:59: error: parameter 'oct_dev' set but not used [-Werror=unused-but-set-parameter]
      
      This is harmless but can clearly be remove to avoid the warning.
      
      Fixes: 50c0add5 ("liquidio: refactor interrupt moderation code")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ca1cb28d
    • E
      kaweth: use skb_cow_head() to deal with cloned skbs · 39fba783
      Eric Dumazet 提交于
      We can use skb_cow_head() to properly deal with clones,
      especially the ones coming from TCP stack that allow their head being
      modified. This avoids a copy.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: James Hughes <james.hughes@raspberrypi.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      39fba783
    • E
      ch9200: use skb_cow_head() to deal with cloned skbs · 6bc6895b
      Eric Dumazet 提交于
      We need to ensure there is enough headroom to push extra header,
      but we also need to check if we are allowed to change headers.
      
      skb_cow_head() is the proper helper to deal with this.
      
      Fixes: 4a476bd6 ("usbnet: New driver for QinHeng CH9200 devices")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: James Hughes <james.hughes@raspberrypi.org>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6bc6895b
    • E
      lan78xx: use skb_cow_head() to deal with cloned skbs · d4ca7359
      Eric Dumazet 提交于
      We need to ensure there is enough headroom to push extra header,
      but we also need to check if we are allowed to change headers.
      
      skb_cow_head() is the proper helper to deal with this.
      
      Fixes: 55d7de9d ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: James Hughes <james.hughes@raspberrypi.org>
      Cc: Woojung Huh <woojung.huh@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d4ca7359
    • E
      sr9700: use skb_cow_head() to deal with cloned skbs · d532c108
      Eric Dumazet 提交于
      We need to ensure there is enough headroom to push extra header,
      but we also need to check if we are allowed to change headers.
      
      skb_cow_head() is the proper helper to deal with this.
      
      Fixes: c9b37458 ("USB2NET : SR9700 : One chip USB 1.1 USB2NET SR9700Device Driver Support")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: James Hughes <james.hughes@raspberrypi.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d532c108
    • E
      cx82310_eth: use skb_cow_head() to deal with cloned skbs · a9e840a2
      Eric Dumazet 提交于
      We need to ensure there is enough headroom to push extra header,
      but we also need to check if we are allowed to change headers.
      
      skb_cow_head() is the proper helper to deal with this.
      
      Fixes: cc28a20e ("introduce cx82310_eth: Conexant CX82310-based ADSL router USB ethernet driver")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: James Hughes <james.hughes@raspberrypi.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a9e840a2
    • E
      smsc75xx: use skb_cow_head() to deal with cloned skbs · b7c6d267
      Eric Dumazet 提交于
      We need to ensure there is enough headroom to push extra header,
      but we also need to check if we are allowed to change headers.
      
      skb_cow_head() is the proper helper to deal with this.
      
      Fixes: d0cad871 ("smsc75xx: SMSC LAN75xx USB gigabit ethernet adapter driver")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: James Hughes <james.hughes@raspberrypi.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b7c6d267
  2. 21 4月, 2017 18 次提交