Commit graph

3342 commits

Author SHA1 Message Date
Diogo Silva
7b0cca4552 net: phy: ti: add PHY_RST_AFTER_CLK_EN flag
[ Upstream commit 256748d5480bb3c4b731236c6d6fc86a8e2815d8 ]

DP83848	datasheet (section 4.7.2) indicates that the reset pin should be
toggled after the clocks are running. Add the PHY_RST_AFTER_CLK_EN to
make sure that this indication is respected.

In my experience not having this flag enabled would lead to, on some
boots, the wrong MII mode being selected if the PHY was initialized on
the bootloader and was receiving data during Linux boot.

Signed-off-by: Diogo Silva <diogompaissilva@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Fixes: 34e45ad9378c ("net: phy: dp83848: Add TI DP83848 Ethernet PHY")
Link: https://patch.msgid.link/20241102151504.811306-1-paissilva@ld-100007.ds1.internal
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:22 +01:00
Ioana Ciornei
a2b6d0907f net: phy: ti: implement generic .handle_interrupt() callback
[ Upstream commit 1d1ae3c6ca3ff49843d73852bb2a8153ce16f432 ]

In an attempt to actually support shared IRQs in phylib, we now move the
responsibility of triggering the phylib state machine or just returning
IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
3 different IRQ handling callbacks (.handle_interrupt(),
.did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
driver implement directly an IRQ handler like any other device driver.
Make this driver follow the new convention.

Cc: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 256748d5480b ("net: phy: ti: add PHY_RST_AFTER_CLK_EN flag")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:22 +01:00
Ioana Ciornei
b1c86072e8 net: phy: export phy_error and phy_trigger_machine
[ Upstream commit 293e9a3d950dfebc76d9fa6931e6f91ef856b9ab ]

These functions are currently used by phy_interrupt() to either signal
an error condition or to trigger the link state machine. In an attempt
to actually support shared PHY IRQs, export these two functions so that
the actual PHY drivers can use them.

Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>
Cc: Andre Edich <andre.edich@microchip.com>
Cc: Antoine Tenart <atenart@kernel.org>
Cc: Baruch Siach <baruch@tkos.co.il>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Dan Murphy <dmurphy@ti.com>
Cc: Divya Koppera <Divya.Koppera@microchip.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>
Cc: Kavya Sree Kotagiri <kavyasree.kotagiri@microchip.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Marco Felsch <m.felsch@pengutronix.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Mathias Kresin <dev@kresin.me>
Cc: Maxim Kochetkov <fido_max@inbox.ru>
Cc: Michael Walle <michael@walle.cc>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Nisar Sayed <Nisar.Sayed@microchip.com>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Philippe Schenker <philippe.schenker@toradex.com>
Cc: Willy Liu <willy.liu@realtek.com>
Cc: Yuiko Oshino <yuiko.oshino@microchip.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 256748d5480b ("net: phy: ti: add PHY_RST_AFTER_CLK_EN flag")
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
Dario Binacchi
d16db102d1 can: c_can: fix {rx,tx}_errors statistics
[ Upstream commit 4d6d26537940f3b3e17138987ed9e4a334780bf7 ]

The c_can_handle_bus_err() function was incorrectly incrementing only the
receive error counter, even in cases of bit or acknowledgment errors that
occur during transmission. The patch fixes the issue by incrementing the
appropriate counter based on the type of error.

Fixes: 881ff67ad450 ("can: c_can: Added support for Bosch C_CAN controller")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://patch.msgid.link/20241014135319.2009782-1-dario.binacchi@amarulasolutions.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
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
Jiri Kosina
47a69493d1 HID: core: zero-initialize the report buffer
[ Upstream commit 177f25d1292c7e16e1199b39c85480f7f8815552 ]

Since the report buffer is used by all kinds of drivers in various ways, let's
zero-initialize it during allocation to make sure that it can't be ever used
to leak kernel memory via specially-crafted report.

Fixes: 27ce405039bf ("HID: fix data access in implement()")
Reported-by: Benoît Sevens <bsevens@google.com>
Acked-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-30 02:33:21 +01:00
Karan
f11cfb0398 driver: pwm: Implement .apply() callback
To eventually get rid of all legacy drivers convert this driver to the
modern world implementing .apply(). The commit which brings these
changes is `5ec803edcb703fe379836f13560b79dfac79b01d` on the uplink
kernel.

Bug: 332793240
Change-Id: I385f487c474ca2d52a9f3bb4e8afc3843eb4d9f8
Signed-off-by: Karan Bhagoji <karan.rb@samsung.com>
Signed-off-by: Hyunki Koo <hyunki00.koo@samsung.com>
2024-11-30 02:19:17 +01:00
Woody Lin
f887b383c2 watchdog: s3c2410_wdt: Assign s3c_wdt[] until probe complete
Assigns device data to `s3c_wdt[cluster_index]` only when probe function
completes. Several functions of s3c2410_wdt use the existence of
`s3c_wdt[*]` to decide whether the device data is ready to be accessed.
This causes an invalid access issue as long as the probe function puts
device data to `s3c_wdt[cluster_index]` before completely preparing the
content. Fixes the issue by rearranging the assignment order.

Bug: 342585125
Change-Id: Idb4c3b71fb2e0518725c697db01e708aa0c7c86b
Signed-off-by: Woody Lin <woodylin@google.com>
(cherry picked from commit d7bd15571d51e658a081d98dfbcc17e3aa104585)
2024-11-30 02:18:58 +01:00
Secondarian
9c6c01a0bd zram: Set default compressor to zstd 2024-11-30 02:02:54 +01:00
Ksawlii
f9e1f3fa3a Revert "exynos_gpu: Don't allow userspace to control freqs"
This reverts commit fdef7b54c3.
2024-11-24 19:22:36 +01:00
Ksawlii
0f4d6c3c29 Revert "gpu/exynos: Make 'gpu_mm_min_clock' readonly too"
This reverts commit 9e6b7e114f.
2024-11-24 19:16:08 +01:00
Ksawlii
895709a281 drivers: samsung: scsc: Adapt scsc_wlbtd.c for Linux 5.10.229 2024-11-24 00:42:20 +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
bfbdef95a1 Revert "wifi: virt_wifi: avoid reporting connection success with wrong SSID"
This reverts commit 1c786f1067.
2024-11-24 00:23:56 +01:00
Ksawlii
4f9bfbe9f1 Revert "wifi: virt_wifi: don't use strlen() in const context"
This reverts commit 8df54fa66a.
2024-11-24 00:23:56 +01:00
Ksawlii
683ecba589 Revert "net: dsa: mv88e6xxx: Limit chip-wide frame size config to CPU ports"
This reverts commit 4324f66a7a.
2024-11-24 00:23:56 +01:00
Ksawlii
2e56e9f4fd Revert "net: dsa: b53: Limit chip-wide jumbo frame config to CPU ports"
This reverts commit 23d58869be.
2024-11-24 00:23:56 +01:00
Ksawlii
d3f5815f54 Revert "wifi: mwifiex: Fix interface type change"
This reverts commit 64663028ab.
2024-11-24 00:23:56 +01:00
Ksawlii
fa72cb31d6 Revert "net: bonding: correctly annotate RCU in bond_should_notify_peers()"
This reverts commit 7dc1b04912.
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
9b5b6a7525 Revert "net: usb: qmi_wwan: fix memory leak for not ip packets"
This reverts commit 3789fee8a8.
2024-11-24 00:23:55 +01:00
Ksawlii
97133e2e2e Revert "net: dsa: bcm_sf2: Fix a possible memory leak in bcm_sf2_mdio_register()"
This reverts commit be9d7e8db2.
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
4ec03bf3d0 Revert "media: uvcvideo: Use entity get_cur in uvc_ctrl_set"
This reverts commit db35ac122f.
2024-11-24 00:23:54 +01:00
Ksawlii
d8a23d1e51 Revert "nvme/pci: Add APST quirk for Lenovo N60z laptop"
This reverts commit c748a1f324.
2024-11-24 00:23:54 +01:00
Ksawlii
e89ee38649 Revert "media: Revert "media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()""
This reverts commit bc158d0b3a.
2024-11-24 00:23:54 +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
7dd6e87cff Revert "net: dsa: vsc73xx: pass value in phy_write operation"
This reverts commit 3c0fd5c577.
2024-11-24 00:23:53 +01:00
Ksawlii
f4d0eedded Revert "net: dsa: vsc73xx: use read_poll_timeout instead delay loop"
This reverts commit 98c55bf660.
2024-11-24 00:23:53 +01:00
Ksawlii
36bbae2b95 Revert "net: dsa: vsc73xx: check busy flag in MDIO operations"
This reverts commit 509fc0dcd1.
2024-11-24 00:23:53 +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
038863cd84 Revert "wifi: cw1200: Avoid processing an invalid TIM IE"
This reverts commit 045e1a3f2e.
2024-11-24 00:23:53 +01:00
Ksawlii
911ea2912e Revert "wifi: iwlwifi: abort scan when rfkill on but device enabled"
This reverts commit a2e13a5078.
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
c3c4efe7b0 Revert "media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c)"
This reverts commit 0e0829bf72.
2024-11-24 00:23:52 +01:00
Ksawlii
68834d1c47 Revert "bonding: fix bond_ipsec_offload_ok return type"
This reverts commit 38a3a70b3e.
2024-11-24 00:23:51 +01:00
Ksawlii
6de0889cec Revert "bonding: fix null pointer deref in bond_ipsec_offload_ok"
This reverts commit 4552f9f0ae.
2024-11-24 00:23:51 +01:00
Ksawlii
0f85dd45e4 Revert "bonding: fix xfrm real_dev null pointer dereference"
This reverts commit 9fa8811d1a.
2024-11-24 00:23:51 +01:00
Ksawlii
b4e9e5b37a Revert "bonding: fix xfrm state handling when clearing active slave"
This reverts commit 08a3b787ac.
2024-11-24 00:23:51 +01:00
Ksawlii
5036a90d21 Revert "ice: fix ICE_LAST_OFFSET formula"
This reverts commit 9a98cb967c.
2024-11-24 00:23:51 +01:00
Ksawlii
091e8249c6 Revert "net: dsa: mv88e6xxx: read FID when handling ATU violations"
This reverts commit 6fad67a4c7.
2024-11-24 00:23:51 +01:00
Ksawlii
c346f9c457 Revert "net: dsa: mv88e6xxx: replace ATU violation prints with trace points"
This reverts commit f634cf4b40.
2024-11-24 00:23:51 +01:00
Ksawlii
6c2054cc66 Revert "net: dsa: mv88e6xxx: Fix out-of-bound access"
This reverts commit 2230f96d6c.
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