Commit graph

304 commits

Author SHA1 Message Date
Johan Jonker
062aa38d5b net: arc: fix the device for dma_map_single/dma_unmap_single
[ Upstream commit 71803c1dfa29e0d13b99e48fda11107cc8caebc7 ]

The ndev->dev and pdev->dev aren't the same device, use ndev->dev.parent
which has dma_mask, ndev->dev.parent is just pdev->dev.
Or it would cause the following issue:

[   39.933526] ------------[ cut here ]------------
[   39.938414] WARNING: CPU: 1 PID: 501 at kernel/dma/mapping.c:149 dma_map_page_attrs+0x90/0x1f8

Fixes: f959dcd6ddfd ("dma-direct: Fix potential NULL pointer dereference")
Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:22 +01:00
Peiyang Wang
4152c38410 net: hns3: fix kernel crash when uninstalling driver
[ Upstream commit df3dff8ab6d79edc942464999d06fbaedf8cdd18 ]

When the driver is uninstalled and the VF is disabled concurrently, a
kernel crash occurs. The reason is that the two actions call function
pci_disable_sriov(). The num_VFs is checked to determine whether to
release the corresponding resources. During the second calling, num_VFs
is not 0 and the resource release function is called. However, the
corresponding resource has been released during the first invoking.
Therefore, the problem occurs:

[15277.839633][T50670] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000020
...
[15278.131557][T50670] Call trace:
[15278.134686][T50670]  klist_put+0x28/0x12c
[15278.138682][T50670]  klist_del+0x14/0x20
[15278.142592][T50670]  device_del+0xbc/0x3c0
[15278.146676][T50670]  pci_remove_bus_device+0x84/0x120
[15278.151714][T50670]  pci_stop_and_remove_bus_device+0x6c/0x80
[15278.157447][T50670]  pci_iov_remove_virtfn+0xb4/0x12c
[15278.162485][T50670]  sriov_disable+0x50/0x11c
[15278.166829][T50670]  pci_disable_sriov+0x24/0x30
[15278.171433][T50670]  hnae3_unregister_ae_algo_prepare+0x60/0x90 [hnae3]
[15278.178039][T50670]  hclge_exit+0x28/0xd0 [hclge]
[15278.182730][T50670]  __se_sys_delete_module.isra.0+0x164/0x230
[15278.188550][T50670]  __arm64_sys_delete_module+0x1c/0x30
[15278.193848][T50670]  invoke_syscall+0x50/0x11c
[15278.198278][T50670]  el0_svc_common.constprop.0+0x158/0x164
[15278.203837][T50670]  do_el0_svc+0x34/0xcc
[15278.207834][T50670]  el0_svc+0x20/0x30

For details, see the following figure.

     rmmod hclge              disable VFs
----------------------------------------------------
hclge_exit()            sriov_numvfs_store()
  ...                     device_lock()
  pci_disable_sriov()     hns3_pci_sriov_configure()
                            pci_disable_sriov()
                              sriov_disable()
    sriov_disable()             if !num_VFs :
      if !num_VFs :               return;
        return;                 sriov_del_vfs()
      sriov_del_vfs()             ...
        ...                       klist_put()
        klist_put()               ...
        ...                     num_VFs = 0;
      num_VFs = 0;        device_unlock();

In this patch, when driver is removing, we get the device_lock()
to protect num_VFs, just like sriov_numvfs_store().

Fixes: 0dd8a25f355b ("net: hns3: disable sriov before unload hclge layer")
Signed-off-by: Peiyang Wang <wangpeiyang1@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20241101091507.3644584-1-shaojijie@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:22 +01:00
Wei Fang
a704919ef0 net: enetc: set MAC address to the VF net_device
[ Upstream commit badccd49b93bb945bf4e5cc8707db67cdc5e27e5 ]

The MAC address of VF can be configured through the mailbox mechanism of
ENETC, but the previous implementation forgot to set the MAC address in
net_device, resulting in the SMAC of the sent frames still being the old
MAC address. Since the MAC address in the hardware has been changed, Rx
cannot receive frames with the DMAC address as the new MAC address. The
most obvious phenomenon is that after changing the MAC address, we can
see that the MAC address of eno0vf0 has not changed through the "ifconfig
eno0vf0" command and the IP address cannot be obtained .

root@ls1028ardb:~# ifconfig eno0vf0 down
root@ls1028ardb:~# ifconfig eno0vf0 hw ether 00:04:9f:3a:4d:56 up
root@ls1028ardb:~# ifconfig eno0vf0
eno0vf0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 66:36:2c:3b:87:76  txqueuelen 1000  (Ethernet)
        RX packets 794  bytes 69239 (69.2 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 11  bytes 2226 (2.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Fixes: beb74ac878c8 ("enetc: Add vf to pf messaging support")
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Link: https://patch.msgid.link/20241029090406.841836-1-wei.fang@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:22 +01:00
Ksawlii
a5b7b870fc Revert "net: fec: Refactor: #define magic constants"
This reverts commit 64636f4e88.
2024-11-24 00:23:56 +01:00
Ksawlii
e7b1ec68bc Revert "net: fec: Fix FEC_ECR_EN1588 being cleared on link-down"
This reverts commit 132969266d.
2024-11-24 00:23:56 +01:00
Ksawlii
32d9b82df9 Revert "net: stmmac: Correct byte order of perfect_match"
This reverts commit 4e35d4a08d.
2024-11-24 00:23:55 +01:00
Ksawlii
eb36756b64 Revert "net/mlx5e: Add a check for the return value from mlx5_port_set_eth_ptys"
This reverts commit babb23917f.
2024-11-24 00:23:55 +01:00
Ksawlii
5c2a1132c9 Revert "net: fec: Stop PPS on driver remove"
This reverts commit e328279c90.
2024-11-24 00:23:55 +01:00
Ksawlii
0b80835234 Revert "net/mlx5e: Correctly report errors for ethtool rx flows"
This reverts commit a1624526b7.
2024-11-24 00:23:54 +01:00
Ksawlii
11596bfd09 Revert "net: axienet: Fix register defines comment description"
This reverts commit fd86cc6597.
2024-11-24 00:23:54 +01:00
Ksawlii
29c857027d Revert "net: hns3: fix wrong use of semaphore up"
This reverts commit deb6d455f4.
2024-11-24 00:23:53 +01:00
Ksawlii
39f88f5bf8 Revert "net: hns3: fix a deadlock problem when config TC during resetting"
This reverts commit 26a0b43c4b.
2024-11-24 00:23:53 +01:00
Ksawlii
52f4f64489 Revert "net/sun3_82586: Avoid reading past buffer in debug output"
This reverts commit 70d98df8ea.
2024-11-24 00:23:52 +01:00
Ksawlii
0eeaf7577a Revert "net: hns3: add checking for vf id of mailbox"
This reverts commit 7e18329b75.
2024-11-24 00:23:52 +01:00
Ksawlii
5036a90d21 Revert "ice: fix ICE_LAST_OFFSET formula"
This reverts commit 9a98cb967c.
2024-11-24 00:23:51 +01:00
Ksawlii
6fe606a02b Revert "net: xilinx: axienet: Always disable promiscuous mode"
This reverts commit a7875446c0.
2024-11-24 00:23:51 +01:00
Ksawlii
09bc706e3c Revert "net: xilinx: axienet: Fix dangling multicast addresses"
This reverts commit ae9628b4fa.
2024-11-24 00:23:50 +01:00
Ksawlii
35b8c8834d Revert "igb: Fix not clearing TimeSync interrupts for 82580"
This reverts commit 11b7218c81.
2024-11-24 00:23:42 +01:00
Ksawlii
a4bc5ebe94 Revert "igc: Unlock on error in igc_io_resume()"
This reverts commit d0a818c297.
2024-11-24 00:23:42 +01:00
Ksawlii
279241fa19 Revert "net: dpaa: avoid on-stack arrays of NR_CPUS elements"
This reverts commit a0e5358edc.
2024-11-24 00:23:39 +01:00
Ksawlii
13a9224eff Revert "net: ethernet: use ip_hdrlen() instead of bit shift"
This reverts commit e9c6237f35.
2024-11-24 00:23:36 +01:00
Ksawlii
1ba1b1e7b3 Revert "ice: fix accounting for filters shared by multiple VSIs"
This reverts commit 14c7602518.
2024-11-24 00:23:35 +01:00
Ksawlii
4f4fca3a0f Revert "net/mlx5: Update the list of the PCI supported devices"
This reverts commit 5faf98b4ac.
2024-11-24 00:23:34 +01:00
Ksawlii
551674c42e Revert "net/mlx5e: Add missing link modes to ptys2ethtool_map"
This reverts commit e25fd0c3e1.
2024-11-24 00:23:34 +01:00
Ksawlii
d85c07139d Revert "net: ftgmac100: Enable TX interrupt to avoid TX timeout"
This reverts commit eb248351db.
2024-11-24 00:23:34 +01:00
Ksawlii
b73b428f1d Revert "net: dpaa: Pad packets to ETH_ZLEN"
This reverts commit 3ad5828caa.
2024-11-24 00:23:34 +01:00
Ksawlii
d4c68e1fc4 Revert "net: ftgmac100: Ensure tx descriptor updates are visible"
This reverts commit f48cec25ee.
2024-11-24 00:23:33 +01:00
Ksawlii
1107016b02 Revert "net: enetc: Use IRQF_NO_AUTOEN flag in request_irq()"
This reverts commit e356dcea7c.
2024-11-24 00:23:29 +01:00
Ksawlii
cb6b405833 Revert "r8169: disable ALDPS per default for RTL8125"
This reverts commit b64d3334b9.
2024-11-24 00:23:29 +01:00
Ksawlii
cca2e810e8 Revert "net: seeq: Fix use after free vulnerability in ether3 Driver Due to Race Condition"
This reverts commit 2168093ef8.
2024-11-24 00:23:18 +01:00
Ksawlii
ade1083a2d Revert "net/mlx5: Fix error path in multi-packet WQE transmit"
This reverts commit 270ecc4364.
2024-11-24 00:23:12 +01:00
Ksawlii
318078984c Revert "net/mlx5: Added cond_resched() to crdump collection"
This reverts commit 4d839c06f8.
2024-11-24 00:23:12 +01:00
Ksawlii
d422a0435b Revert "net: ethernet: lantiq_etop: fix memory disclosure"
This reverts commit 9274ce290d.
2024-11-24 00:23:12 +01:00
Ksawlii
5a67c02dd6 Revert "ice: Adjust over allocation of memory in ice_sched_add_root_node() and ice_sched_add_node()"
This reverts commit 30705ece9d.
2024-11-24 00:23:10 +01:00
Ksawlii
312c6c6837 Revert "net: hisilicon: hip04: fix OF node leak in probe()"
This reverts commit 894592fa8b.
2024-11-24 00:23:10 +01:00
Ksawlii
fae39e1046 Revert "net: hisilicon: hns_dsaf_mac: fix OF node leak in hns_mac_get_info()"
This reverts commit 93ae0df7e7.
2024-11-24 00:23:10 +01:00
Ksawlii
c8ed470e75 Revert "net: hisilicon: hns_mdio: fix OF node leak in probe()"
This reverts commit 63949269ce.
2024-11-24 00:23:10 +01:00
Ksawlii
1dfd99890d Revert "net: mvpp2: Increase size of queue_name buffer"
This reverts commit 421ea3a3fa.
2024-11-24 00:23:08 +01:00
Ksawlii
bb3f1c8add Revert "net: atlantic: Avoid warning about potential string truncation"
This reverts commit f7cf43b465.
2024-11-24 00:23:08 +01:00
Ksawlii
2f697a70d6 Revert "nfp: Use IRQF_NO_AUTOEN flag in request_irq()"
This reverts commit 62e93957d0.
2024-11-24 00:23:07 +01:00
Ksawlii
26d9380b53 Revert "net: stmmac: Fix zero-division error when disabling tc cbs"
This reverts commit 9f91978b91.
2024-11-24 00:23:01 +01:00
Ksawlii
2415f05839 Revert "r8169: Fix spelling mistake: "tx_underun" -> "tx_underrun""
This reverts commit 9a5c8049a7.
2024-11-24 00:23:00 +01:00
Ksawlii
d43e90556a Revert "r8169: add tally counter fields added with RTL8125"
This reverts commit b57e5dc84b.
2024-11-24 00:23:00 +01:00
Ksawlii
d95116a19d Revert "net: ethernet: cortina: Drop TSO support"
This reverts commit 5a37f561e7.
2024-11-24 00:23:00 +01:00
Ksawlii
f19c17b06d Revert "ice: fix VLAN replay after reset"
This reverts commit 6bb154f4ac.
2024-11-24 00:22:57 +01:00
Ksawlii
81da5daf84 Revert "igb: Do not bring the device up after non-fatal error"
This reverts commit e28819c79a.
2024-11-24 00:22:56 +01:00
Ksawlii
e0175afaa9 Revert "net: ibm: emac: mal: fix wrong goto"
This reverts commit c04c8e56b9.
2024-11-24 00:22:56 +01:00
Ksawlii
11b289f4f9 Revert "net: macb: Avoid 20s boot delay by skipping MDIO bus registration for fixed-link PHY"
This reverts commit f93e3153c5.
2024-11-24 00:22:53 +01:00
Daniel Palmer
d69778df1a net: amd: mvme147: Fix probe banner message
[ Upstream commit 82c5b53140faf89c31ea2b3a0985a2f291694169 ]

Currently this driver prints this line with what looks like
a rogue format specifier when the device is probed:
[    2.840000] eth%d: MVME147 at 0xfffe1800, irq 12, Hardware Address xx:xx:xx:xx:xx:xx

Change the printk() for netdev_info() and move it after the
registration has completed so it prints out the name of the
interface properly.

Signed-off-by: Daniel Palmer <daniel@0x0f.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:22:04 +01:00
Heiner Kallweit
fd0a3436e4 r8169: avoid unsolicited interrupts
[ Upstream commit 10ce0db787004875f4dba068ea952207d1d8abeb ]

It was reported that after resume from suspend a PCI error is logged
and connectivity is broken. Error message is:
PCI error (cmd = 0x0407, status_errs = 0x0000)
The message seems to be a red herring as none of the error bits is set,
and the PCI command register value also is normal. Exception handling
for a PCI error includes a chip reset what apparently brakes connectivity
here. The interrupt status bit triggering the PCI error handling isn't
actually used on PCIe chip versions, so it's not clear why this bit is
set by the chip. Fix this by ignoring this bit on PCIe chip versions.

Fixes: 0e4851502f84 ("r8169: merge with version 8.001.00 of Realtek's r8168 driver")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219388
Tested-by: Atlas Yu <atlas.yu@canonical.com>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/78e2f535-438f-4212-ad94-a77637ac6c9c@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:22:01 +01:00