1. 18 12月, 2020 10 次提交
  2. 17 12月, 2020 25 次提交
    • G
      mptcp: clear use_ack and use_map when dropping other suboptions · 3ae32c07
      Geliang Tang 提交于
      This patch cleared use_ack and use_map when dropping other suboptions to
      fix the following syzkaller BUG:
      
      [   15.223006] BUG: unable to handle page fault for address: 0000000000223b10
      [   15.223700] #PF: supervisor read access in kernel mode
      [   15.224209] #PF: error_code(0x0000) - not-present page
      [   15.224724] PGD b8d5067 P4D b8d5067 PUD c0a5067 PMD 0
      [   15.225237] Oops: 0000 [#1] SMP
      [   15.225556] CPU: 0 PID: 7747 Comm: syz-executor Not tainted 5.10.0-rc6+ #24
      [   15.226281] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
      [   15.227292] RIP: 0010:skb_release_data+0x89/0x1e0
      [   15.227816] Code: 5b 5d 41 5c 41 5d 41 5e 41 5f e9 02 06 8a ff e8 fd 05 8a ff 45 31 ed 80 7d 02 00 4c 8d 65 30 74 55 e8 eb 05 8a ff 49 8b 1c 24 <4c> 8b 7b 08 41 f6 c7 01 0f 85 18 01 00 00 e8 d4 05 8a ff 8b 43 34
      [   15.229669] RSP: 0018:ffffc900019c7c08 EFLAGS: 00010293
      [   15.230188] RAX: ffff88800daad900 RBX: 0000000000223b08 RCX: 0000000000000006
      [   15.230895] RDX: 0000000000000000 RSI: ffffffff818e06c5 RDI: ffff88807f6dc700
      [   15.231593] RBP: ffff88807f71a4c0 R08: 0000000000000001 R09: 0000000000000001
      [   15.232299] R10: ffffc900019c7c18 R11: 0000000000000000 R12: ffff88807f71a4f0
      [   15.233007] R13: 0000000000000000 R14: ffff88807f6dc700 R15: 0000000000000002
      [   15.233714] FS:  00007f65d9b5f700(0000) GS:ffff88807c400000(0000) knlGS:0000000000000000
      [   15.234509] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   15.235081] CR2: 0000000000223b10 CR3: 000000000b883000 CR4: 00000000000006f0
      [   15.235788] Call Trace:
      [   15.236042]  skb_release_all+0x28/0x30
      [   15.236419]  __kfree_skb+0x11/0x20
      [   15.236768]  tcp_data_queue+0x270/0x1240
      [   15.237161]  ? tcp_urg+0x50/0x2a0
      [   15.237496]  tcp_rcv_established+0x39a/0x890
      [   15.237997]  ? mark_held_locks+0x49/0x70
      [   15.238467]  tcp_v4_do_rcv+0xb9/0x270
      [   15.238915]  __release_sock+0x8a/0x160
      [   15.239365]  release_sock+0x32/0xd0
      [   15.239793]  __inet_stream_connect+0x1d2/0x400
      [   15.240313]  ? do_wait_intr_irq+0x80/0x80
      [   15.240791]  inet_stream_connect+0x36/0x50
      [   15.241275]  mptcp_stream_connect+0x69/0x1b0
      [   15.241787]  __sys_connect+0x122/0x140
      [   15.242236]  ? syscall_enter_from_user_mode+0x17/0x50
      [   15.242836]  ? lockdep_hardirqs_on_prepare+0xd4/0x170
      [   15.243436]  __x64_sys_connect+0x1a/0x20
      [   15.243924]  do_syscall_64+0x33/0x40
      [   15.244313]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [   15.244821] RIP: 0033:0x7f65d946e469
      [   15.245183] Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ff 49 2b 00 f7 d8 64 89 01 48
      [   15.247019] RSP: 002b:00007f65d9b5eda8 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
      [   15.247770] RAX: ffffffffffffffda RBX: 000000000049bf00 RCX: 00007f65d946e469
      [   15.248471] RDX: 0000000000000010 RSI: 00000000200000c0 RDI: 0000000000000005
      [   15.249205] RBP: 000000000049bf00 R08: 0000000000000000 R09: 0000000000000000
      [   15.249908] R10: 0000000000000000 R11: 0000000000000246 R12: 000000000049bf0c
      [   15.250603] R13: 00007fffe8a25cef R14: 00007f65d9b3f000 R15: 0000000000000003
      [   15.251312] Modules linked in:
      [   15.251626] CR2: 0000000000223b10
      [   15.251965] BUG: kernel NULL pointer dereference, address: 0000000000000048
      [   15.252005] ---[ end trace f5c51fe19123c773 ]---
      [   15.252822] #PF: supervisor read access in kernel mode
      [   15.252823] #PF: error_code(0x0000) - not-present page
      [   15.252825] PGD c6c6067 P4D c6c6067 PUD c0d8067
      [   15.253294] RIP: 0010:skb_release_data+0x89/0x1e0
      [   15.253910] PMD 0
      [   15.253914] Oops: 0000 [#2] SMP
      [   15.253917] CPU: 1 PID: 7746 Comm: syz-executor Tainted: G      D           5.10.0-rc6+ #24
      [   15.253920] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
      [   15.254435] Code: 5b 5d 41 5c 41 5d 41 5e 41 5f e9 02 06 8a ff e8 fd 05 8a ff 45 31 ed 80 7d 02 00 4c 8d 65 30 74 55 e8 eb 05 8a ff 49 8b 1c 24 <4c> 8b 7b 08 41 f6 c7 01 0f 85 18 01 00 00 e8 d4 05 8a ff 8b 43 34
      [   15.254899] RIP: 0010:skb_release_data+0x89/0x1e0
      [   15.254902] Code: 5b 5d 41 5c 41 5d 41 5e 41 5f e9 02 06 8a ff e8 fd 05 8a ff 45 31 ed 80 7d 02 00 4c 8d 65 30 74 55 e8 eb 05 8a ff 49 8b 1c 24 <4c> 8b 7b 08 41 f6 c7 01 0f 85 18 01 00 00 e8 d4 05 8a ff 8b 43 34
      [   15.254905] RSP: 0018:ffffc900019bfc08 EFLAGS: 00010293
      [   15.255376] RSP: 0018:ffffc900019c7c08 EFLAGS: 00010293
      [   15.255580]
      [   15.255583] RAX: ffff888004a7ac80 RBX: 0000000000000040 RCX: 0000000000000000
      [   15.255912]
      [   15.256724] RDX: 0000000000000000 RSI: ffffffff818e06c5 RDI: ffff88807f6ddd00
      [   15.257620] RAX: ffff88800daad900 RBX: 0000000000223b08 RCX: 0000000000000006
      [   15.259817] RBP: ffff88800e9006c0 R08: 0000000000000000 R09: 0000000000000000
      [   15.259818] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88800e9006f0
      [   15.259820] R13: 0000000000000000 R14: ffff88807f6ddd00 R15: 0000000000000002
      [   15.259822] FS:  00007fae4a60a700(0000) GS:ffff88807c500000(0000) knlGS:0000000000000000
      [   15.259826] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   15.260296] RDX: 0000000000000000 RSI: ffffffff818e06c5 RDI: ffff88807f6dc700
      [   15.262514] CR2: 0000000000000048 CR3: 000000000b89c000 CR4: 00000000000006e0
      [   15.262515] Call Trace:
      [   15.262519]  skb_release_all+0x28/0x30
      [   15.262523]  __kfree_skb+0x11/0x20
      [   15.263054] RBP: ffff88807f71a4c0 R08: 0000000000000001 R09: 0000000000000001
      [   15.263680]  tcp_data_queue+0x270/0x1240
      [   15.263843] R10: ffffc900019c7c18 R11: 0000000000000000 R12: ffff88807f71a4f0
      [   15.264693]  ? tcp_urg+0x50/0x2a0
      [   15.264856] R13: 0000000000000000 R14: ffff88807f6dc700 R15: 0000000000000002
      [   15.265720]  tcp_rcv_established+0x39a/0x890
      [   15.266438] FS:  00007f65d9b5f700(0000) GS:ffff88807c400000(0000) knlGS:0000000000000000
      [   15.267283]  ? __schedule+0x3fa/0x880
      [   15.267287]  tcp_v4_do_rcv+0xb9/0x270
      [   15.267290]  __release_sock+0x8a/0x160
      [   15.268049] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   15.268788]  release_sock+0x32/0xd0
      [   15.268791]  __inet_stream_connect+0x1d2/0x400
      [   15.268795]  ? do_wait_intr_irq+0x80/0x80
      [   15.269593] CR2: 0000000000223b10 CR3: 000000000b883000 CR4: 00000000000006f0
      [   15.270246]  inet_stream_connect+0x36/0x50
      [   15.270250]  mptcp_stream_connect+0x69/0x1b0
      [   15.270253]  __sys_connect+0x122/0x140
      [   15.271097] Kernel panic - not syncing: Fatal exception
      [   15.271820]  ? syscall_enter_from_user_mode+0x17/0x50
      [   15.283542]  ? lockdep_hardirqs_on_prepare+0xd4/0x170
      [   15.284275]  __x64_sys_connect+0x1a/0x20
      [   15.284853]  do_syscall_64+0x33/0x40
      [   15.285369]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [   15.286105] RIP: 0033:0x7fae49f19469
      [   15.286638] Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ff 49 2b 00 f7 d8 64 89 01 48
      [   15.289295] RSP: 002b:00007fae4a609da8 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
      [   15.290375] RAX: ffffffffffffffda RBX: 000000000049bf00 RCX: 00007fae49f19469
      [   15.291403] RDX: 0000000000000010 RSI: 00000000200000c0 RDI: 0000000000000005
      [   15.292437] RBP: 000000000049bf00 R08: 0000000000000000 R09: 0000000000000000
      [   15.293456] R10: 0000000000000000 R11: 0000000000000246 R12: 000000000049bf0c
      [   15.294473] R13: 00007fff0004b6bf R14: 00007fae4a5ea000 R15: 0000000000000003
      [   15.295492] Modules linked in:
      [   15.295944] CR2: 0000000000000048
      [   15.296567] Kernel Offset: disabled
      [   15.296941] ---[ end Kernel panic - not syncing: Fatal exception ]---
      Reported-by: NChristoph Paasch <cpaasch@apple.com>
      Fixes: 84dfe367 (mptcp: send out dedicated ADD_ADDR packet)
      Signed-off-by: NGeliang Tang <geliangtang@gmail.com>
      Reviewed-by: NMat Martineau <mathew.j.martineau@linux.intel.com>
      Link: https://lore.kernel.org/r/ccca4e8f01457a1b495c5d612ed16c5f7a585706.1608010058.git.geliangtang@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      3ae32c07
    • T
      devlink: use _BITUL() macro instead of BIT() in the UAPI header · 75f4d454
      Tobias Klauser 提交于
      The BIT() macro is not available for the UAPI headers. Moreover, it can
      be defined differently in user space headers. Thus, replace its usage
      with the _BITUL() macro which is already used in other macro definitions
      in <linux/devlink.h>.
      
      Fixes: dc64cc7c ("devlink: Add devlink reload limit option")
      Signed-off-by: NTobias Klauser <tklauser@distanz.ch>
      Link: https://lore.kernel.org/r/20201215102531.16958-1-tklauser@distanz.chSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      75f4d454
    • V
      net: korina: fix return value · 7eb000bd
      Vincent Stehlé 提交于
      The ndo_start_xmit() method must not attempt to free the skb to transmit
      when returning NETDEV_TX_BUSY. Therefore, make sure the
      korina_send_packet() function returns NETDEV_TX_OK when it frees a packet.
      
      Fixes: ef11291b ("Add support the Korina (IDT RC32434) Ethernet MAC")
      Suggested-by: NJakub Kicinski <kuba@kernel.org>
      Signed-off-by: NVincent Stehlé <vincent.stehle@laposte.net>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Link: https://lore.kernel.org/r/20201214220952.19935-1-vincent.stehle@laposte.netSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      7eb000bd
    • K
      net/smc: fix access to parent of an ib device · 995433b7
      Karsten Graul 提交于
      The parent of an ib device is used to retrieve the PCI device
      attributes. It turns out that there are possible cases when an ib device
      has no parent set in the device structure, which may lead to page
      faults when trying to access this memory.
      Fix that by checking the parent pointer and consolidate the pci device
      specific processing in a new function.
      
      Fixes: a3db10ef ("net/smc: Add support for obtaining SMCR device list")
      Reported-by: syzbot+600fef7c414ee7e2d71b@syzkaller.appspotmail.com
      Signed-off-by: NKarsten Graul <kgraul@linux.ibm.com>
      Link: https://lore.kernel.org/r/20201215091058.49354-2-kgraul@linux.ibm.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      995433b7
    • I
      ethtool: fix error paths in ethnl_set_channels() · ef72cd3c
      Ivan Vecera 提交于
      Fix two error paths in ethnl_set_channels() to avoid lock-up caused
      but unreleased RTNL.
      
      Fixes: e19c591e ("ethtool: set device channel counts with CHANNELS_SET request")
      Reported-by: NLiLiang <liali@redhat.com>
      Signed-off-by: NIvan Vecera <ivecera@redhat.com>
      Reviewed-by: NMichal Kubecek <mkubecek@suse.cz>
      Link: https://lore.kernel.org/r/20201215090810.801777-1-ivecera@redhat.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      ef72cd3c
    • J
      Merge branch 'nfc-s3fwrn5-refactor-the-s3fwrn5-module' · 5277d1ca
      Jakub Kicinski 提交于
      Bongsu Jeon says:
      
      ====================
      nfc: s3fwrn5: Refactor the s3fwrn5 module
      
      Refactor the s3fwrn5 module.
      
      1/2 is to remove the unneeded delay for NFC sleep.
      2/2 is to remove the unused NCI prop commands.
      ====================
      
      Link: https://lore.kernel.org/r/20201215065401.3220-1-bongsu.jeon@samsung.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      5277d1ca
    • B
      nfc: s3fwrn5: Remove unused NCI prop commands · e2138e3f
      Bongsu Jeon 提交于
      Remove the unused NCI prop commands that s3fwrn5 driver doesn't use.
      Signed-off-by: NBongsu Jeon <bongsu.jeon@samsung.com>
      Reviewed-by: NKrzysztof Kozlowski <krzk@kernel.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      e2138e3f
    • B
      nfc: s3fwrn5: Remove the delay for NFC sleep · 7ec27c9e
      Bongsu Jeon 提交于
      Remove the delay for NFC sleep because the delay is only needed to
      guarantee that the NFC is awake.
      Signed-off-by: NBongsu Jeon <bongsu.jeon@samsung.com>
      Reviewed-by: NKrzysztof Kozlowski <krzk@kernel.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      7ec27c9e
    • J
      phy: fix kdoc warning · 767143a1
      Jakub Kicinski 提交于
      Kdoc does not like it when multiline comment follows the networking
      style of starting right on the first line:
      
      include/linux/phy.h:869: warning: Function parameter or member 'config_intr' not described in 'phy_driver'
      
      Link: https://lore.kernel.org/r/20201215063750.3120976-1-kuba@kernel.orgSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      767143a1
    • H
      tipc: do sanity check payload of a netlink message · c32c928d
      Hoang Le 提交于
      When we initialize nlmsghdr with no payload inside tipc_nl_compat_dumpit()
      the parsing function returns -EINVAL. We fix it by making the parsing call
      conditional.
      Acked-by: NJon Maloy <jmaloy@redhat.com>
      Signed-off-by: NHoang Le <hoang.h.le@dektech.com.au>
      Link: https://lore.kernel.org/r/20201215033151.76139-1-hoang.h.le@dektech.com.auSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      c32c928d
    • J
      Merge branch 'locked-version-of-netdev_notify_peers' · 023cae85
      Jakub Kicinski 提交于
      Lijun Pan says:
      
      ====================
      add a locked version of netdev_notify_peers
      
      This series introduce the lockless version of netdev_notify_peers
      and then apply it to the relevant drivers.
      
      In v1, a more appropriate name __netdev_notify_peers is used;
      netdev_notify_peers is converted to call the new helper.
      In v2, patch 3 calls the new helper where notify variable used
      to be set true.
      ====================
      
      Link: https://lore.kernel.org/r/20201214211930.80778-1-ljp@linux.ibm.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      023cae85
    • L
      use __netdev_notify_peers in hyperv · 935d8a0a
      Lijun Pan 提交于
      Start to use the lockless version of netdev_notify_peers.
      Call the helper where notify variable used to be set true.
      Remove the notify bool variable and sort the variables
      in reverse Christmas tree order.
      
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: NLijun Pan <ljp@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      935d8a0a
    • L
      use __netdev_notify_peers in ibmvnic · 6be46662
      Lijun Pan 提交于
      Start to use the lockless version of netdev_notify_peers.
      Signed-off-by: NLijun Pan <ljp@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      6be46662
    • L
      net: core: introduce __netdev_notify_peers · 7061eb8c
      Lijun Pan 提交于
      There are some use cases for netdev_notify_peers in the context
      when rtnl lock is already held. Introduce lockless version
      of netdev_notify_peers call to save the extra code to call
      	call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, dev);
      	call_netdevice_notifiers(NETDEV_RESEND_IGMP, dev);
      After that, convert netdev_notify_peers to call the new helper.
      Suggested-by: NNathan Lynch <nathanl@linux.ibm.com>
      Signed-off-by: NLijun Pan <ljp@linux.ibm.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      7061eb8c
    • C
      net: allwinner: Fix some resources leak in the error handling path of the... · 322e53d1
      Christophe JAILLET 提交于
      net: allwinner: Fix some resources leak in the error handling path of the probe and in the remove function
      
      'irq_of_parse_and_map()' should be balanced by a corresponding
      'irq_dispose_mapping()' call. Otherwise, there is some resources leaks.
      
      Add such a call in the error handling path of the probe function and in the
      remove function.
      
      Fixes: 49220505 ("net: Add EMAC ethernet driver found on Allwinner A10 SoC's")
      Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Link: https://lore.kernel.org/r/20201214202117.146293-1-christophe.jaillet@wanadoo.frSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      322e53d1
    • M
      ethtool: fix string set id check · efb796f5
      Michal Kubecek 提交于
      Syzbot reported a shift of a u32 by more than 31 in strset_parse_request()
      which is undefined behavior. This is caused by range check of string set id
      using variable ret (which is always 0 at this point) instead of id (string
      set id from request).
      
      Fixes: 71921690 ("ethtool: provide string sets with STRSET_GET request")
      Reported-by: syzbot+96523fb438937cd01220@syzkaller.appspotmail.com
      Signed-off-by: NMichal Kubecek <mkubecek@suse.cz>
      Link: https://lore.kernel.org/r/b54ed5c5fd972a59afea3e1badfb36d86df68799.1607952208.git.mkubecek@suse.czSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      efb796f5
    • C
      net: mscc: ocelot: Fix a resource leak in the error handling path of the probe function · f87675b8
      Christophe JAILLET 提交于
      In case of error after calling 'ocelot_init()', it must be undone by a
      corresponding 'ocelot_deinit()' call, as already done in the remove
      function.
      
      Fixes: a556c76a ("net: mscc: Add initial Ocelot switch support")
      Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Acked-by: NAlexandre Belloni <alexandre.belloni@bootlin.com>
      Link: https://lore.kernel.org/r/20201213114838.126922-1-christophe.jaillet@wanadoo.frSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      f87675b8
    • G
      net/connector: Add const qualifier to cb_id · c18e6869
      Geoff Levand 提交于
      The connector driver never modifies any cb_id passed to it, so add a const
      qualifier to those arguments so callers can declare their struct cb_id as a
      constant object.
      
      Fixes build warnings like these when passing a constant struct cb_id:
      
        warning: passing argument 1 of ‘cn_add_callback’ discards ‘const’ qualifier from pointer target
      Signed-off-by: NGeoff Levand <geoff@infradead.org>
      Link: https://lore.kernel.org/r/a9e49c9e-67fa-16e7-0a6b-72f6bd30c58a@infradead.orgSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      c18e6869
    • C
      net: bcmgenet: Fix a resource leak in an error handling path in the probe functin · 4375ada0
      Christophe JAILLET 提交于
      If the 'register_netdev()' call fails, we must undo a previous
      'bcmgenet_mii_init()' call.
      
      Fixes: 1c1008c7 ("net: bcmgenet: add main driver file")
      Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Link: https://lore.kernel.org/r/20201212182005.120437-1-christophe.jaillet@wanadoo.frSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      4375ada0
    • I
      dpaa2-eth: fix the size of the mapped SGT buffer · 54a57d1c
      Ioana Ciornei 提交于
      This patch fixes an error condition triggered when the code path which
      transmits a S/G frame descriptor when the skb's headroom is not enough
      for DPAA2's needs.
      
      We are greated with a splat like the one below when a SGT structure is
      recycled and that is because even though a dma_unmap is performed on the
      Tx confirmation path, the unmap is not done with the proper size.
      
      [  714.464927] WARNING: CPU: 13 PID: 0 at drivers/iommu/io-pgtable-arm.c:281 __arm_lpae_map+0x2d4/0x30c
      (...)
      [  714.465343] Call trace:
      [  714.465348]  __arm_lpae_map+0x2d4/0x30c
      [  714.465353]  __arm_lpae_map+0x114/0x30c
      [  714.465357]  __arm_lpae_map+0x114/0x30c
      [  714.465362]  __arm_lpae_map+0x114/0x30c
      [  714.465366]  arm_lpae_map+0xf4/0x180
      [  714.465373]  arm_smmu_map+0x4c/0xc0
      [  714.465379]  __iommu_map+0x100/0x2bc
      [  714.465385]  iommu_map_atomic+0x20/0x30
      [  714.465391]  __iommu_dma_map+0xb0/0x110
      [  714.465397]  iommu_dma_map_page+0xb8/0x120
      [  714.465404]  dma_map_page_attrs+0x1a8/0x210
      [  714.465413]  __dpaa2_eth_tx+0x384/0xbd0 [fsl_dpaa2_eth]
      [  714.465421]  dpaa2_eth_tx+0x84/0x134 [fsl_dpaa2_eth]
      [  714.465427]  dev_hard_start_xmit+0x10c/0x2b0
      [  714.465433]  sch_direct_xmit+0x1a0/0x550
      (...)
      
      The dpaa2-eth driver uses an area of software annotations to transmit
      necessary information from the Tx path to the Tx confirmation one. This
      SWA structure has a different layout for each kind of frame that we are
      dealing with: linear, S/G or XDP.
      
      The commit referenced was incorrectly setting up the 'sgt_size' field
      for the S/G type of SWA even though we are dealing with a linear skb
      here.
      
      Fixes: d70446ee ("dpaa2-eth: send a scatter-gather FD instead of realloc-ing")
      Reported-by: NDaniel Thompson <daniel.thompson@linaro.org>
      Tested-by: NDaniel Thompson <daniel.thompson@linaro.org>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Link: https://lore.kernel.org/r/20201211171607.108034-1-ciorneiioana@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      54a57d1c
    • O
      net: dsa: qca: ar9331: fix sleeping function called from invalid context bug · 3e47495f
      Oleksij Rempel 提交于
      With lockdep enabled, we will get following warning:
      
       ar9331_switch ethernet.1:10 lan0 (uninitialized): PHY [!ahb!ethernet@1a000000!mdio!switch@10:00] driver [Qualcomm Atheros AR9331 built-in PHY] (irq=13)
       BUG: sleeping function called from invalid context at kernel/locking/mutex.c:935
       in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 18, name: kworker/0:1
       INFO: lockdep is turned off.
       irq event stamp: 602
       hardirqs last  enabled at (601): [<8073fde0>] _raw_spin_unlock_irq+0x3c/0x80
       hardirqs last disabled at (602): [<8073a4f4>] __schedule+0x184/0x800
       softirqs last  enabled at (0): [<80080f60>] copy_process+0x578/0x14c8
       softirqs last disabled at (0): [<00000000>] 0x0
       CPU: 0 PID: 18 Comm: kworker/0:1 Not tainted 5.10.0-rc3-ar9331-00734-g7d644991df0c #31
       Workqueue: events deferred_probe_work_func
       Stack : 80980000 80980000 8089ef70 80890000 804b5414 80980000 00000002 80b53728
               00000000 800d1268 804b5414 ffffffde 00000017 800afe08 81943860 0f5bfc32
               00000000 00000000 8089ef70 819436c0 ffffffea 00000000 00000000 00000000
               8194390c 808e353c 0000000f 66657272 80980000 00000000 00000000 80890000
               804b5414 80980000 00000002 80b53728 00000000 00000000 00000000 80d40000
               ...
       Call Trace:
       [<80069ce0>] show_stack+0x9c/0x140
       [<800afe08>] ___might_sleep+0x220/0x244
       [<8073bfb0>] __mutex_lock+0x70/0x374
       [<8073c2e0>] mutex_lock_nested+0x2c/0x38
       [<804b5414>] regmap_update_bits_base+0x38/0x8c
       [<804ee584>] regmap_update_bits+0x1c/0x28
       [<804ee714>] ar9331_sw_unmask_irq+0x34/0x60
       [<800d91f0>] unmask_irq+0x48/0x70
       [<800d93d4>] irq_startup+0x114/0x11c
       [<800d65b4>] __setup_irq+0x4f4/0x6d0
       [<800d68a0>] request_threaded_irq+0x110/0x190
       [<804e3ef0>] phy_request_interrupt+0x4c/0xe4
       [<804df508>] phylink_bringup_phy+0x2c0/0x37c
       [<804df7bc>] phylink_of_phy_connect+0x118/0x130
       [<806c1a64>] dsa_slave_create+0x3d0/0x578
       [<806bc4ec>] dsa_register_switch+0x934/0xa20
       [<804eef98>] ar9331_sw_probe+0x34c/0x364
       [<804eb48c>] mdio_probe+0x44/0x70
       [<8049e3b4>] really_probe+0x30c/0x4f4
       [<8049ea10>] driver_probe_device+0x264/0x26c
       [<8049bc10>] bus_for_each_drv+0xb4/0xd8
       [<8049e684>] __device_attach+0xe8/0x18c
       [<8049ce58>] bus_probe_device+0x48/0xc4
       [<8049db70>] deferred_probe_work_func+0xdc/0xf8
       [<8009ff64>] process_one_work+0x2e4/0x4a0
       [<800a0770>] worker_thread+0x2a8/0x354
       [<800a774c>] kthread+0x16c/0x174
       [<8006306c>] ret_from_kernel_thread+0x14/0x1c
      
       ar9331_switch ethernet.1:10 lan1 (uninitialized): PHY [!ahb!ethernet@1a000000!mdio!switch@10:02] driver [Qualcomm Atheros AR9331 built-in PHY] (irq=13)
       DSA: tree 0 setup
      
      To fix it, it is better to move access to MDIO register to the .irq_bus_sync_unlock
      call back.
      
      Fixes: ec6698c2 ("net: dsa: add support for Atheros AR9331 built-in switch")
      Signed-off-by: NOleksij Rempel <o.rempel@pengutronix.de>
      Reviewed-by: NVladimir Oltean <olteanv@gmail.com>
      Link: https://lore.kernel.org/r/20201211110317.17061-1-o.rempel@pengutronix.deSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      3e47495f
    • J
      Merge branch 'i40e-ice-af_xdp-zc-fixes' · ec58c75a
      Jakub Kicinski 提交于
      Björn Töpel says:
      
      ====================
      i40e/ice AF_XDP ZC fixes
      
      This series address two crashes in the AF_XDP zero-copy mode for ice
      and i40e. More details in each individual the commit message.
      ====================
      
      Link: https://lore.kernel.org/r/20201211145712.72957-1-bjorn.topel@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      ec58c75a
    • B
      i40e, xsk: clear the status bits for the next_to_use descriptor · 64050b5b
      Björn Töpel 提交于
      On the Rx side, the next_to_use index points to the next item in the
      HW ring to be refilled/allocated, and next_to_clean points to the next
      item to potentially be processed.
      
      When the HW Rx ring is fully refilled, i.e. no packets has been
      processed, the next_to_use will be next_to_clean - 1. When the ring is
      fully processed next_to_clean will be equal to next_to_use. The latter
      case is where a bug is triggered.
      
      If the next_to_use bits are not cleared, and the "fully processed"
      state is entered, a stale descriptor can be processed.
      
      The skb-path correctly clear the status bit for the next_to_use
      descriptor, but the AF_XDP zero-copy path did not do that.
      
      This change adds the status bits clearing of the next_to_use
      descriptor.
      
      Fixes: 3b4f0b66 ("i40e, xsk: Migrate to new MEM_TYPE_XSK_BUFF_POOL")
      Signed-off-by: NBjörn Töpel <bjorn.topel@intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      64050b5b
    • B
      ice, xsk: clear the status bits for the next_to_use descriptor · 8d14768a
      Björn Töpel 提交于
      On the Rx side, the next_to_use index points to the next item in the
      HW ring to be refilled/allocated, and next_to_clean points to the next
      item to potentially be processed.
      
      When the HW Rx ring is fully refilled, i.e. no packets has been
      processed, the next_to_use will be next_to_clean - 1. When the ring is
      fully processed next_to_clean will be equal to next_to_use. The latter
      case is where a bug is triggered.
      
      If the next_to_use bits are not cleared, and the "fully processed"
      state is entered, a stale descriptor can be processed.
      
      The skb-path correctly clear the status bit for the next_to_use
      descriptor, but the AF_XDP zero-copy path did not do that.
      
      This change adds the status bits clearing of the next_to_use
      descriptor.
      
      Fixes: 2d4238f5 ("ice: Add support for AF_XDP")
      Signed-off-by: NBjörn Töpel <bjorn.topel@intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      8d14768a
    • S
      lan743x: fix rx_napi_poll/interrupt ping-pong · 57030a0b
      Sven Van Asbroeck 提交于
      Even if there is more rx data waiting on the chip, the rx napi poll fn
      will never run more than once - it will always read a few buffers, then
      bail out and re-arm interrupts. Which results in ping-pong between napi
      and interrupt.
      
      This defeats the purpose of napi, and is bad for performance.
      
      Fix by making the rx napi poll behave identically to other ethernet
      drivers:
      1. initialize rx napi polling with an arbitrary budget (64).
      2. in the polling fn, return full weight if rx queue is not depleted,
         this tells the napi core to "keep polling".
      3. update the rx tail ("ring the doorbell") once for every 8 processed
         rx ring buffers.
      
      Thanks to Jakub Kicinski, Eric Dumazet and Andrew Lunn for their expert
      opinions and suggestions.
      
      Tested with 20 seconds of full bandwidth receive (iperf3):
              rx irqs      softirqs(NET_RX)
              -----------------------------
      before  23827        33620
      after   129          4081
      
      Tested-by: Sven Van Asbroeck <thesven73@gmail.com> # lan7430
      Fixes: 23f0703c ("lan743x: Add main source files for new lan743x driver")
      Signed-off-by: NSven Van Asbroeck <thesven73@gmail.com>
      Link: https://lore.kernel.org/r/20201215161954.5950-1-TheSven73@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      57030a0b
  3. 16 12月, 2020 5 次提交
    • L
      Merge tag 'staging-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 3db1a3fa
      Linus Torvalds 提交于
      Pull staging / IIO driver updates from Greg KH:
       "Here is the big staging and IIO driver pull request for 5.11-rc1
      
        Lots of different things in here:
      
         - loads of driver updates
      
         - so many coding style cleanups
      
         - new IIO drivers
      
         - Android ION code is finally removed from the tree
      
         - wimax drivers are moved to staging on their way out of the kernel
      
        Nothing really exciting, just the constant grind of kernel development :)
      
        All have been in linux-next for a while with no reported issues"
      
      * tag 'staging-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (341 commits)
        staging: olpc_dcon: Do not call platform_device_unregister() in dcon_probe()
        staging: most: Fix spelling mistake "tranceiver" -> "transceiver"
        staging: qlge: remove duplicate word in comment
        staging: comedi: mf6x4: Fix AI end-of-conversion detection
        staging: greybus: Add TODO item about modernizing the pwm code
        pinctrl: ralink: add a pinctrl driver for the rt2880 family
        dt-bindings: pinctrl: rt2880: add binding document
        staging: rtl8723bs: remove ELEMENT_ID enum
        staging: rtl8723bs: remove unused macros
        staging: rtl8723bs: replace EID_EXTCapability
        staging: rtl8723bs: replace EID_BSSIntolerantChlReport
        staging: rtl8723bs: replace EID_BSSCoexistence
        staging: rtl8723bs: replace _MME_IE_
        staging: rtl8723bs: replace _WAPI_IE_
        staging: rtl8723bs: replace _EXT_SUPPORTEDRATES_IE_
        staging: rtl8723bs: replace _ERPINFO_IE_
        staging: rtl8723bs: replace _CHLGETXT_IE_
        staging: rtl8723bs: replace _COUNTRY_IE_
        staging: rtl8723bs: replace _IBSS_PARA_IE_
        staging: rtl8723bs: replace _TIM_IE_
        ...
      3db1a3fa
    • L
      Merge tag 'char-misc-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 2911ed9f
      Linus Torvalds 提交于
      Pull char / misc driver updates from Greg KH:
       "Here is the big char/misc driver update for 5.11-rc1.
      
        Continuing the tradition of previous -rc1 pulls, there seems to be
        more and more tiny driver subsystems flowing through this tree.
      
        Lots of different things, all of which have been in linux-next for a
        while with no reported issues:
      
         - extcon driver updates
      
         - habannalab driver updates
      
         - mei driver updates
      
         - uio driver updates
      
         - binder fixes and features added
      
         - soundwire driver updates
      
         - mhi bus driver updates
      
         - phy driver updates
      
         - coresight driver updates
      
         - fpga driver updates
      
         - speakup driver updates
      
         - slimbus driver updates
      
         - various small char and misc driver updates"
      
      * tag 'char-misc-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (305 commits)
        extcon: max77693: Fix modalias string
        extcon: fsa9480: Support TI TSU6111 variant
        extcon: fsa9480: Rewrite bindings in YAML and extend
        dt-bindings: extcon: add binding for TUSB320
        extcon: Add driver for TI TUSB320
        slimbus: qcom: fix potential NULL dereference in qcom_slim_prg_slew()
        siox: Make remove callback return void
        siox: Use bus_type functions for probe, remove and shutdown
        spmi: Add driver shutdown support
        spmi: fix some coding style issues at the spmi core
        spmi: get rid of a warning when built with W=1
        uio: uio_hv_generic: use devm_kzalloc() for private data alloc
        uio: uio_fsl_elbc_gpcm: use device-managed allocators
        uio: uio_aec: use devm_kzalloc() for uio_info object
        uio: uio_cif: use devm_kzalloc() for uio_info object
        uio: uio_netx: use devm_kzalloc() for or uio_info object
        uio: uio_mf624: use devm_kzalloc() for uio_info object
        uio: uio_sercos3: use device-managed functions for simple allocs
        uio: uio_dmem_genirq: finalize conversion of probe to devm_ handlers
        uio: uio_dmem_genirq: convert simple allocations to device-managed
        ...
      2911ed9f
    • L
      Merge tag 'driver-core-5.11-rc1' of... · 7240153a
      Linus Torvalds 提交于
      Merge tag 'driver-core-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core updates from Greg KH:
       "Here is the big driver core updates for 5.11-rc1
      
        This time there was a lot of different work happening here for some
        reason:
      
         - redo of the fwnode link logic, speeding it up greatly
      
         - auxiliary bus added (this was a tag that will be pulled in from
           other trees/maintainers this merge window as well, as driver
           subsystems started to rely on it)
      
         - platform driver core cleanups on the way to fixing some long-time
           api updates in future releases
      
         - minor fixes and tweaks.
      
        All have been in linux-next with no (finally) reported issues. Testing
        there did helped in shaking issues out a lot :)"
      
      * tag 'driver-core-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (39 commits)
        driver core: platform: don't oops in platform_shutdown() on unbound devices
        ACPI: Use fwnode_init() to set up fwnode
        misc: pvpanic: Replace OF headers by mod_devicetable.h
        misc: pvpanic: Combine ACPI and platform drivers
        usb: host: sl811: Switch to use platform_get_mem_or_io()
        vfio: platform: Switch to use platform_get_mem_or_io()
        driver core: platform: Introduce platform_get_mem_or_io()
        dyndbg: fix use before null check
        soc: fix comment for freeing soc_dev_attr
        driver core: platform: use bus_type functions
        driver core: platform: change logic implementing platform_driver_probe
        driver core: platform: reorder functions
        driver core: make driver_probe_device() static
        driver core: Fix a couple of typos
        driver core: Reorder devices on successful probe
        driver core: Delete pointless parameter in fwnode_operations.add_links
        driver core: Refactor fw_devlink feature
        efi: Update implementation of add_links() to create fwnode links
        of: property: Update implementation of add_links() to create fwnode links
        driver core: Use device's fwnode to check if it is waiting for suppliers
        ...
      7240153a
    • L
      Merge tag 'tty-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 157f8098
      Linus Torvalds 提交于
      Pull tty / serial updates from Greg KH:
       "Here is the "large" set of tty and serial patches for 5.11-rc1.
      
        Nothing major at all, some cleanups and some driver removals, always a
        nice sign:
      
         - build warning cleanups
      
         - vt locking and logic unwinding and cleanups
      
         - tiny serial driver fixes and updates
      
         - removal of the synclink serial driver as it's no longer needed
      
         - removal of dead termiox code
      
        All of this has been in linux-next for a while with no reported issues"
      
      * tag 'tty-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (89 commits)
        serial: 8250_pci: Drop bogus __refdata annotation
        tty: serial: meson: enable console as module
        serial: 8250_omap: Avoid FIFO corruption caused by MDR1 access
        serial: imx: Move imx_uart_probe_dt() content into probe()
        serial: imx: Remove unneeded of_device_get_match_data() NULL check
        tty: Fix whitespace inconsistencies in vt_io_ioctl
        serial_core: Check for port state when tty is in error state
        dt-bindings: serial: Update DT binding docs to support SiFive FU740 SoC
        tty: use const parameters in port-flag accessors
        tty: use assign_bit() in port-flag accessors
        earlycon: drop semicolon from earlycon macro
        tty: Remove dead termiox code
        tty/serial/imx: Enable TXEN bit in imx_poll_init().
        tty : serial: jsm: Fixed file by adding spacing
        tty: serial: uartlite: Support probe deferral
        earlycon: simplify earlycon-table implementation
        tty: serial: bcm63xx: lower driver dependencies
        serial: mxs-auart: Remove unneeded platform_device_id
        serial: 8250-mtk: Fix reference leak in mtk8250_probe
        serial: imx: Remove unused .id_table support
        ...
      157f8098
    • L
      Merge tag 'usb-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 0cee54c8
      Linus Torvalds 提交于
      Pull USB / Thunderbolt updates from Greg KH:
       "Here is the big USB and thunderbolt pull request for 5.11-rc1.
      
        Nothing major in here, just the grind of constant development to
        support new hardware and fix old issues:
      
         - thunderbolt updates for new USB4 hardware
      
         - cdns3 major driver updates
      
         - lots of typec updates and additions as more hardware is available
      
         - usb serial driver updates and fixes
      
         - other tiny USB driver updates
      
        All have been in linux-next with no reported issues"
      
      * tag 'usb-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (172 commits)
        usb: phy: convert comma to semicolon
        usb: ucsi: convert comma to semicolon
        usb: typec: tcpm: convert comma to semicolon
        usb: typec: tcpm: Update vbus_vsafe0v on init
        usb: typec: tcpci: Enable bleed discharge when auto discharge is enabled
        usb: typec: Add class for plug alt mode device
        USB: typec: tcpci: Add Bleed discharge to POWER_CONTROL definition
        USB: typec: tcpm: Add a 30ms room for tPSSourceOn in PR_SWAP
        USB: typec: tcpm: Fix PR_SWAP error handling
        USB: typec: tcpm: Hard Reset after not receiving a Request
        USB: gadget: f_fs: remove likely/unlikely
        usb: gadget: f_fs: Re-use SS descriptors for SuperSpeedPlus
        USB: gadget: f_midi: setup SuperSpeed Plus descriptors
        USB: gadget: f_acm: add support for SuperSpeed Plus
        USB: gadget: f_rndis: fix bitrate for SuperSpeed and above
        usb: typec: intel_pmc_mux: Configure cable generation value for USB4
        MAINTAINERS: Add myself as a reviewer for CADENCE USB3 DRD IP DRIVER
        usb: chipidea: ci_hdrc_imx: Use of_device_get_match_data()
        usb: chipidea: usbmisc_imx: Use of_device_get_match_data()
        usb: cdns3: fix NULL pointer dereference on no platform data
        ...
      0cee54c8