Compare commits

..

23 Commits

Author SHA1 Message Date
Anton Danilov
5774c8b316 mediatek: add Motorcomm PHY support to Cudy AP3000 v1
Newer Cudy AP3000 v1 routers feature a Motorcomm YT8821 PHY
instead of the Realtek PHY [1]. Support for the YT8821
was recently introduced for the Cudy WR3000H router [2].
On the AP3000, the changes allow the PHY to be autodetected.

[1]: https://forum.openwrt.org/t/cudy-ap3000-v1-indoor-wan-motorcomm-yt8821-support/245491
[2]: https://github.com/openwrt/openwrt/pull/21399

Signed-off-by: Anton Danilov <frimen.c@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21776
(cherry picked from commit 31f30f5a6c)
Link: https://github.com/openwrt/openwrt/pull/21915
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-09 00:36:27 +01:00
Jakub Vaněk
bed6f08c36 mediatek: fix PHY autodetection on Cudy WR3000H
Newer Cudy WR3000H units have a Motorcomm YT8821 PHY instead of a
Realtek PHY on the WAN port. Before this commit, the Motorcomm PHY
could not be autodetected by the kernel -- the PHY would show up as
just a generic clause 45 PHY and the proper driver would not be loaded.

The cause of the detection failure likely was that the YT8821 PHY was
held in reset during PHY detection. To fix this, move the reset GPIO
definition to the MDIO bus level. This reset line is deasserted before
the autodetection process, see also [1]. With this change, both Realtek
and Motorcomm PHYs can be supported with a single device tree.

[1]: https://lore.kernel.org/all/20251119134750.394655-1-horatiu.vultur@microchip.com/

Signed-off-by: Jakub Vaněk <linuxtardis@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21399
(cherry picked from commit 02f0efd60b)
Signed-off-by: Jakub Vaněk <linuxtardis@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21531
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-07 16:33:07 +01:00
Andrew MacIntyre
09e56437e8 mediatek: add Motorcomm PHY driver to Cudy WR3000H
Recent Cudy WR3000H v1 units have a Motorcomm YT8821 2.5G PHY for
the WAN interface instead of the RTL8221B PHY used in earlier units,
so add kmod-phy-motorcomm to be able to use it.

Signed-off-by: Andrew MacIntyre <andymac@pcug.org.au>
[linuxtardis@gmail.com: slightly reworded the commit description]
Signed-off-by: Jakub Vaněk <linuxtardis@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21399
(cherry picked from commit dbafbab876)
Signed-off-by: Jakub Vaněk <linuxtardis@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21531
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-07 16:33:07 +01:00
Andrew MacIntyre
194275c6f3 kernel: add kmod-phy-motorcomm
The Motorcomm YT8821 2.5G PHY is being used in some devices as an
alternative to devices like the RTL8221B.  Package it as a kmod
so it can be used as a device package rather than requiring changes
to the target kernel config.

Signed-off-by: Andrew MacIntyre <andymac@pcug.org.au>
Link: https://github.com/openwrt/openwrt/pull/21399
(cherry picked from commit 96a1337374)
Signed-off-by: Jakub Vaněk <linuxtardis@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21531
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-07 16:33:07 +01:00
Jakub Vaněk
f3de64751c generic: backport Motorcomm YT8821 PHY driver
A recently introduced hardware revision of the Cudy WR3000H
router uses the Motorcomm YT8821 PHY chip on its 2.5G WAN port.
Backport the YT8821 enablement patch to the 6.6 kernel to make
the new WR3000H supportable on OpenWrt 24.10.

Signed-off-by: Jakub Vaněk <linuxtardis@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21531
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-07 16:33:06 +01:00
Tim Harvey
7c22ba7b33 kernel: modules: Add tpm-tis-spi
Add a module for tpm-tis-spi for TCG TIS 1.3 TPM security chips
connected to a regular non-tcg SPI master.

Add imx target compatibility for kmod-tpm.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Link: https://github.com/openwrt/openwrt/pull/21726
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 92a94dc9b0)
Link: https://github.com/openwrt/openwrt/pull/21781
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-05 00:05:31 +01:00
Paweł Owoc
93d54b142e mac80211: ath11k: fix for unsupported 11ax EDCA
Currently publicly available firmware for ath11k does not support
the 11ax EDCA parameter.
Skipping sending this parameter allows the use of STA mode.

Fixes: https://github.com/openwrt/openwrt/issues/21555
Fixes: https://github.com/openwrt/openwrt/issues/20702
Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21563
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 5fc9296912)
Link: https://github.com/openwrt/openwrt/pull/21570
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-05 00:01:43 +01:00
Martin Schiller
9237dea49e openssl: update to version 3.0.19
OpenSSL 3.0.19 is a security patch release. The most severe CVE fixed
in this release is High.

This release incorporates the following bug fixes and mitigations:

 * Fixed Stack buffer overflow in CMS AuthEnvelopedData parsing.
   (CVE-2025-15467)

 * Fixed Heap out-of-bounds write in BIO_f_linebuffer on short writes.
   (CVE-2025-68160)

 * Fixed Unauthenticated/unencrypted trailing bytes with low-level OCB
   function calls. (CVE-2025-69418)

 * Fixed Out of bounds write in PKCS12_get_friendlyname() UTF-8
   conversion. (CVE-2025-69419)

 * Fixed Missing ASN1_TYPE validation in TS_RESP_verify_response()
   function. (CVE-2025-69420)

 * Fixed NULL Pointer Dereference in PKCS12_item_decrypt_d2i_ex()
   function. (CVE-2025-69421)

 * Fixed Missing ASN1_TYPE validation in PKCS#12 parsing.
   (CVE-2026-22795)

 * Fixed ASN1_TYPE Type Confusion in the PKCS7_digest_from_attributes()
   function. (CVE-2026-22796)

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
Link: https://github.com/openwrt/openwrt/pull/21831
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-04 23:57:41 +01:00
Hirokazu MORIKAWA
466d57ea24 kernel: revert ip6_tunnel use skb_vlan_inet_prepare() in __ip6_tnl_rcv()
Fixe Linux 6.12.67 broke ipip6 tunnel (DS-Lite) and MAP-E.

Upstream report: https://lists.openwall.net/netdev/2026/01/30/70
Fixes: https://github.com/openwrt/openwrt/issues/21737
Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21783
(cherry picked from commit ee0b160acc)
Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21801
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-04 23:56:04 +01:00
Goetz Goerisch
08106add9c kernel: bump 6.6 to 6.6.122
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.122

All patches autorefreshed

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21801
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-04 23:56:04 +01:00
Dmitry Mostovoy
8843108ff0 mediatek: add kmod-usb3 to default package set of WR3000P
Include XHCI USB drivers on the Cudy WR3000P v1 router, the drivers are
required to be able to use the USB port for USD devices.

Closes: https://github.com/openwrt/openwrt/issues/21231
Fixes: 04e9d154f2 ("mediatek: filogic: add support for Cudy WR3000P v1")
Signed-off-by: Dmitry Mostovoy <dmitry.mostovoy@ceifx.com>
Link: https://github.com/openwrt/openwrt/pull/21281
(cherry picked from commit 9da57e2f82)
Link: https://github.com/openwrt/openwrt/pull/21405
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-19 01:20:16 +01:00
Trix Taiclet
94a54a1e03 uboot-mediatek: fix build with swig 4.3.0
Swig 4.3.0 has changed SWIG_Python_AppendOutput, which now requires an
additional parameter `is_void`. SWIG_AppendOutput remains unchanged.
This was fixed upstream in u-boot/u-boot@a63456b

```
scripts/dtc/pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_next_node’:
scripts/dtc/pylibfdt/libfdt_wrap.c:5581:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’
 5581 |     resultobj = SWIG_Python_AppendOutput(resultobj, val);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
```

This is the same fix as applied in 363e07d and 71b5de6.

This commit is not part of the main branch, as the main branch has
already bumped past 2025.01, removing the need for this patch.
uboot-rockchip had the patch removed as part of 92814fe, which was the
bump to 2025.01.

Signed-off-by: Trix Taiclet <git@trix.moe>
Link: https://github.com/openwrt/openwrt/pull/21415
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-19 01:18:44 +01:00
Trix Taiclet
4327b82a7b uboot-d1: fix build with swig 4.3.0
Swig 4.3.0 has changed SWIG_Python_AppendOutput, which now requires an
additional parameter `is_void`. SWIG_AppendOutput remains unchanged.
This was fixed upstream in u-boot/u-boot@a63456b

```
scripts/dtc/pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_next_node’:
scripts/dtc/pylibfdt/libfdt_wrap.c:5581:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’
 5581 |     resultobj = SWIG_Python_AppendOutput(resultobj, val);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
```

This is the same fix as applied in 363e07d.

Fixes: #20619
Link: #20620
Signed-off-by: Trix Taiclet <trix@c3l.lu>
Link: https://github.com/openwrt/openwrt/pull/20620
(cherry picked from commit 71b5de61ae)
Signed-off-by: Trix Taiclet <git@trix.moe>
Link: https://github.com/openwrt/openwrt/pull/21415
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-19 01:18:44 +01:00
Hauke Mehrtens
23180fbfaa uboot-sifiveu: fix build with swig 4.3.0
Fixes the following error by backporting upstream update:
```
scripts/dtc/pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_next_node’:
scripts/dtc/pylibfdt/libfdt_wrap.c:5581:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’
 5581 |     resultobj = SWIG_Python_AppendOutput(resultobj, val);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
```

This is the same fix as applied in 4e68103c4e ("uboot-rockchip: fix build with swig 4.3.0")

Link: https://github.com/openwrt/openwrt/pull/20538
(cherry picked from commit 363e07dfa2)
Signed-off-by: Trix Taiclet <git@trix.moe>
Link: https://github.com/openwrt/openwrt/pull/21415
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-19 01:18:44 +01:00
Florian Maurer
6a11ba0fd6 mac80211: ath9k: Add RX inactivity detection and reset chip
Some ath9k chips can, seemingly at random, end up in a state which can
be described as "deaf". No or nearly no interrupts are generated anymore
for incoming packets. Existing links either break down after a while and
new links will not be established.

This is merged upstream in
https://patchwork.kernel.org/project/linux-wireless/patch/20241106-ath9k-deaf-detection-v1-1-736a150d2425@redhat.com/

Signed-off-by: Florian Maurer <f.maurer@outlook.de>
Link: https://github.com/openwrt/openwrt/pull/21487
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-19 01:16:27 +01:00
Goetz Goerisch
18771e11c9 kernel: bump 6.6 to 6.6.121
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.121

All patches autorefreshed

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21503
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-19 01:14:52 +01:00
Goetz Goerisch
67294cb751 kernel: bump 6.6 to 6.6.120
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.120

Removes upstreamed patches:
generic/backport-6.6/600-v6.10-net-Remove-conditional-threaded-NAPI-wakeup-based-on.patch [1]
generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch [2]

Manually rebase patches:
bcm27xx/patches-6.6/950-1396-i2c-designware-Add-support-for-bus-clear-feature.patch [3]
ipq40xx/patches-6.6/401-mmc-sdhci-msm-comment-unused-sdhci_msm_set_clock.patch [4]
mediatek/patches-6.6/733-01-net-phy-mediatek-Re-organize-MediaTek-ethernet-phy-d.patch [5]
qualcommax/patches-6.6/0113-remoteproc-qcom-Add-secure-PIL-support.patch [6]
qualcommax/patches-6.6/0116-remoteproc-qcom-Update-regmap-offsets-for-halt-regis.patch [6]

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.120&id=03765d5c18084eab40351fda09bc6fc1a343cd07
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.120&id=f3652768a89cfdaedbe2c9384299eea7ec435fef
[3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.120&id=62641daa93cb8b8ed975fad75fb07f9f9e3488cd
[4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.120&id=fe2ce8f925b09d819546feb5db52ab1db42cb0d4
[5] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.120&id=a902343f133154e438b772d3e7b538ed0b163acc
[6] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.120&id=61f371ade3b68dbb46e2d90882af993f73b489b5

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21503
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-01-19 01:14:52 +01:00
Steffen Förster
49862b1cf5 ramips: fix gmac definition for cudy ap1300 outdoor
The gmac definition has an offset of 1 at the moment. This leads to an
off by one error in downstream projects that rely on the package label mac.

Signed-off-by: Steffen Förster <nemesis@chemnitz.freifunk.net>
Link: https://github.com/openwrt/openwrt/pull/21543
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Link: https://github.com/openwrt/openwrt/pull/21561
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-01-18 17:01:18 +01:00
Maximilian Baumgartner
82f4ee5656 mediatek: fix gmac definition for cudy m3000
The gmac definition has an offset of 1 compared to the label MAC.
Fixes: a55ab9e134 ("mediatek: filogic: prevent faulty mac address assignment")

Signed-off-by: Maximilian Baumgartner <aufhaxer@googlemail.com>
Link: https://github.com/openwrt/openwrt/pull/21560
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 687a2535d5)
2026-01-18 11:37:52 +01:00
Eric Fahlgren
dcf11c832a mediatek: filogic: fix supported_devices list for gl-mt2500
The SUPPORTED_DEVICES sets for both Maxlinear (v1) and Airoha (v2)
devices were identical, so sysupgrade was unable to detect when an
incorrect image was being installed.  This caused "soft bricking" of
devices when a v1 image was installed on a v2 device, and vice versa.

Fix this by making the supported_devices distinct for each device
version, by renaming the devices with a version-specific name.
This is reflected in the file name and the image metadata.

Fixes: https://github.com/openwrt/openwrt/issues/20566
Fixes: https://github.com/openwrt/asu/issues/1525
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20632
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b71f4665cd)
2025-12-30 23:05:19 +01:00
Florian Maurer
b023a06cfb ath79: cf-ew71-v2: set label-mac-device to eth1
The EW71v2 has the WAN port configured at eth1.
The printed label-mac is configured on this iface in openwrt.

Signed-off-by: Florian Maurer <f.maurer@outlook.de>
(cherry picked from commit 7f3537ee2c)
2025-12-27 18:30:17 +01:00
Mikhail Kshevetskiy
2916275a3d mediatek: fix pwn fan settings for sinovoip bpi-r3 (v3)
backport upstream commit 095151b235 (mediatek: fix pwn fan settings for
sinovoip bpi-r3 (v3))

Popular cheap PWM fans for this machine, like the ones coming in
heatsink+fan combos will not work properly at the currently defined
medium speed. Trying different pwm setting using a command

  echo $value > /sys/devices/platform/pwm-fan/hwmon/hwmon1/pwm1

I found:

  pwm1 value     fan rotation speed   cpu temperature     notes
  -----------------------------------------------------------------
    0            maximal              31.5 Celsius        too noisy
   40            optimal              35.2 Celsius        no noise hearable
   95            minimal
   above 95      does not rotate      55.5 Celsius
  -----------------------------------------------------------------

Current cooling levels are:

	cooling-levels = <255 96 0>;

Thus only cpu-active-high and cpu-active-low modes are usable.
This patch fixes cpu-active-medium settings for bpi-r3 board.

This patch may not be enough. Users may wants to tweak their thermal_zone0
trip points, thus tuning fan rotation speed depending on cpu temperature.
That can be done on the base of the following example:

  === example =========
  # cpu temperature below 25 Celsius degrees, no rotation
  echo 25000 > /sys/class/thermal/thermal_zone0/trip_point_4_temp
  # cpu temperature in [25..32] Celsius degrees, normal rotation speed
  echo 32000 > /sys/class/thermal/thermal_zone0/trip_point_3_temp
  # cpu temperature above 50 Celsius degrees, max rotation speed
  echo 50000 > /sys/class/thermal/thermal_zone0/trip_point_2_temp
  =====================

Changes v2:
* put patch to a proper directory
* updated patch description
* tested with latest openwrt based on linux-6.6

Changes v3:
* use upstream linux patch
* update patch description

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21252
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-12-22 16:09:46 +01:00
Hauke Mehrtens
4919ffd4f7 OpenWrt v24.10.5: revert to branch defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-12-18 21:39:37 +01:00
177 changed files with 1970 additions and 920 deletions

View File

@@ -1,4 +1,4 @@
src-git packages https://git.openwrt.org/feed/packages.git^953b6d47b4e9f0ad3c39547c6d3f9a828f10e206
src-git luci https://git.openwrt.org/project/luci.git^d88390be4ec9722cb427fee03368fc8c8582627d
src-git routing https://git.openwrt.org/feed/routing.git^178a40d321d6c11f18528f34777f4e24ce62b19a
src-git telephony https://git.openwrt.org/feed/telephony.git^92892fa285360b8981f62bf4e0a097e6449e7e33
src-git packages https://git.openwrt.org/feed/packages.git;openwrt-24.10
src-git luci https://git.openwrt.org/project/luci.git;openwrt-24.10
src-git routing https://git.openwrt.org/feed/routing.git;openwrt-24.10
src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-24.10

View File

@@ -1,2 +1,2 @@
LINUX_VERSION-6.6 = .119
LINUX_KERNEL_HASH-6.6.119 = 3da09b980bb404cc28793479bb2d6c636522679215ffa65a04c893575253e5e8
LINUX_VERSION-6.6 = .122
LINUX_KERNEL_HASH-6.6.122 = d48e0d9de04bef2fb9740bdb0124548bcab8867cdca00ff9712c110282b299d6

View File

@@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10.5)
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10-SNAPSHOT)
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r29087-d9c5716d1d)
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10.5)
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10-SNAPSHOT)
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)

View File

@@ -190,7 +190,7 @@ if VERSIONOPT
config VERSION_REPO
string
prompt "Release repository"
default "https://downloads.openwrt.org/releases/24.10.5"
default "https://downloads.openwrt.org/releases/24.10-SNAPSHOT"
help
This is the repository address embedded in the image, it defaults
to the trunk snapshot repo; the url may contain the following placeholders:
@@ -266,7 +266,7 @@ if VERSIONOPT
config VERSION_CODE_FILENAMES
bool
prompt "Revision code in filenames"
default n
default y
help
Enable this to include the revision identifier or the configured
version code into the firmware image, SDK- and Image Builder archive

View File

@@ -0,0 +1,57 @@
From a63456b9191fae2fe49f4b121e025792022e3950 Mon Sep 17 00:00:00 2001
From: Markus Volk <f_l_k@t-online.de>
Date: Wed, 30 Oct 2024 06:07:16 +0100
Subject: [PATCH] scripts/dtc/pylibfdt/libfdt.i_shipped: Use SWIG_AppendOutput
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Swig has changed language specific AppendOutput functions. The helper
macro SWIG_AppendOutput remains unchanged. Use that instead
of SWIG_Python_AppendOutput, which would require an extra parameter
since swig 4.3.0.
/home/flk/poky/build-test/tmp/work/qemux86_64-poky-linux/u-boot/2024.10/git/arch/x86/cpu/u-boot-64.lds
| scripts/dtc/pylibfdt/libfdt_wrap.c: In function _wrap_fdt_next_node:
| scripts/dtc/pylibfdt/libfdt_wrap.c:5581:17: error: too few arguments to function SWIG_Python_AppendOutput
| 5581 | resultobj = SWIG_Python_AppendOutput(resultobj, val);
| | ^~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Markus Volk <f_l_k@t-online.de>
Reported-by: Rudi Heitbaum <rudi@heitbaum.com>
Link: https://github.com/dgibson/dtc/pull/154
---
scripts/dtc/pylibfdt/libfdt.i_shipped | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/dtc/pylibfdt/libfdt.i_shipped b/scripts/dtc/pylibfdt/libfdt.i_shipped
index 56cc5d48f4f9..e4659489a96a 100644
--- a/scripts/dtc/pylibfdt/libfdt.i_shipped
+++ b/scripts/dtc/pylibfdt/libfdt.i_shipped
@@ -1037,7 +1037,7 @@ typedef uint32_t fdt32_t;
fdt_string(fdt1, fdt32_to_cpu($1->nameoff)));
buff = PyByteArray_FromStringAndSize(
(const char *)($1 + 1), fdt32_to_cpu($1->len));
- resultobj = SWIG_Python_AppendOutput(resultobj, buff);
+ resultobj = SWIG_AppendOutput(resultobj, buff);
}
}
@@ -1076,7 +1076,7 @@ typedef uint32_t fdt32_t;
%typemap(argout) int *depth {
PyObject *val = Py_BuildValue("i", *arg$argnum);
- resultobj = SWIG_Python_AppendOutput(resultobj, val);
+ resultobj = SWIG_AppendOutput(resultobj, val);
}
%apply int *depth { int *depth };
@@ -1092,7 +1092,7 @@ typedef uint32_t fdt32_t;
if (PyTuple_GET_SIZE(resultobj) == 0)
resultobj = val;
else
- resultobj = SWIG_Python_AppendOutput(resultobj, val);
+ resultobj = SWIG_AppendOutput(resultobj, val);
}
}

View File

@@ -0,0 +1,55 @@
From a63456b9191fae2fe49f4b121e025792022e3950 Mon Sep 17 00:00:00 2001
From: Markus Volk <f_l_k@t-online.de>
Date: Wed, 30 Oct 2024 06:07:16 +0100
Subject: [PATCH] scripts/dtc/pylibfdt/libfdt.i_shipped: Use SWIG_AppendOutput
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Swig has changed language specific AppendOutput functions. The helper
macro SWIG_AppendOutput remains unchanged. Use that instead
of SWIG_Python_AppendOutput, which would require an extra parameter
since swig 4.3.0.
/home/flk/poky/build-test/tmp/work/qemux86_64-poky-linux/u-boot/2024.10/git/arch/x86/cpu/u-boot-64.lds
| scripts/dtc/pylibfdt/libfdt_wrap.c: In function _wrap_fdt_next_node:
| scripts/dtc/pylibfdt/libfdt_wrap.c:5581:17: error: too few arguments to function SWIG_Python_AppendOutput
| 5581 | resultobj = SWIG_Python_AppendOutput(resultobj, val);
| | ^~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Markus Volk <f_l_k@t-online.de>
Reported-by: Rudi Heitbaum <rudi@heitbaum.com>
Link: https://github.com/dgibson/dtc/pull/154
---
scripts/dtc/pylibfdt/libfdt.i_shipped | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/scripts/dtc/pylibfdt/libfdt.i_shipped
+++ b/scripts/dtc/pylibfdt/libfdt.i_shipped
@@ -1037,7 +1037,7 @@ typedef uint32_t fdt32_t;
fdt_string(fdt1, fdt32_to_cpu($1->nameoff)));
buff = PyByteArray_FromStringAndSize(
(const char *)($1 + 1), fdt32_to_cpu($1->len));
- resultobj = SWIG_Python_AppendOutput(resultobj, buff);
+ resultobj = SWIG_AppendOutput(resultobj, buff);
}
}
@@ -1076,7 +1076,7 @@ typedef uint32_t fdt32_t;
%typemap(argout) int *depth {
PyObject *val = Py_BuildValue("i", *arg$argnum);
- resultobj = SWIG_Python_AppendOutput(resultobj, val);
+ resultobj = SWIG_AppendOutput(resultobj, val);
}
%apply int *depth { int *depth };
@@ -1092,7 +1092,7 @@ typedef uint32_t fdt32_t;
if (PyTuple_GET_SIZE(resultobj) == 0)
resultobj = val;
else
- resultobj = SWIG_Python_AppendOutput(resultobj, val);
+ resultobj = SWIG_AppendOutput(resultobj, val);
}
}

View File

@@ -0,0 +1,55 @@
From a63456b9191fae2fe49f4b121e025792022e3950 Mon Sep 17 00:00:00 2001
From: Markus Volk <f_l_k@t-online.de>
Date: Wed, 30 Oct 2024 06:07:16 +0100
Subject: [PATCH] scripts/dtc/pylibfdt/libfdt.i_shipped: Use SWIG_AppendOutput
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Swig has changed language specific AppendOutput functions. The helper
macro SWIG_AppendOutput remains unchanged. Use that instead
of SWIG_Python_AppendOutput, which would require an extra parameter
since swig 4.3.0.
/home/flk/poky/build-test/tmp/work/qemux86_64-poky-linux/u-boot/2024.10/git/arch/x86/cpu/u-boot-64.lds
| scripts/dtc/pylibfdt/libfdt_wrap.c: In function _wrap_fdt_next_node:
| scripts/dtc/pylibfdt/libfdt_wrap.c:5581:17: error: too few arguments to function SWIG_Python_AppendOutput
| 5581 | resultobj = SWIG_Python_AppendOutput(resultobj, val);
| | ^~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Markus Volk <f_l_k@t-online.de>
Reported-by: Rudi Heitbaum <rudi@heitbaum.com>
Link: https://github.com/dgibson/dtc/pull/154
---
scripts/dtc/pylibfdt/libfdt.i_shipped | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/scripts/dtc/pylibfdt/libfdt.i_shipped
+++ b/scripts/dtc/pylibfdt/libfdt.i_shipped
@@ -1037,7 +1037,7 @@ typedef uint32_t fdt32_t;
fdt_string(fdt1, fdt32_to_cpu($1->nameoff)));
buff = PyByteArray_FromStringAndSize(
(const char *)($1 + 1), fdt32_to_cpu($1->len));
- resultobj = SWIG_Python_AppendOutput(resultobj, buff);
+ resultobj = SWIG_AppendOutput(resultobj, buff);
}
}
@@ -1076,7 +1076,7 @@ typedef uint32_t fdt32_t;
%typemap(argout) int *depth {
PyObject *val = Py_BuildValue("i", *arg$argnum);
- resultobj = SWIG_Python_AppendOutput(resultobj, val);
+ resultobj = SWIG_AppendOutput(resultobj, val);
}
%apply int *depth { int *depth };
@@ -1092,7 +1092,7 @@ typedef uint32_t fdt32_t;
if (PyTuple_GET_SIZE(resultobj) == 0)
resultobj = val;
else
- resultobj = SWIG_Python_AppendOutput(resultobj, val);
+ resultobj = SWIG_AppendOutput(resultobj, val);
}
}

View File

@@ -525,6 +525,23 @@ endef
$(eval $(call KernelPackage,phy-aquantia))
define KernelPackage/phy-motorcomm
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=Motorcomm Ethernet PHYs
DEPENDS:=+kmod-libphy
KCONFIG:=CONFIG_MOTORCOMM_PHY
FILES:=$(LINUX_DIR)/drivers/net/phy/motorcomm.ko
AUTOLOAD:=$(call AutoLoad,18,motorcomm,1)
endef
define KernelPackage/phy-motorcomm/description
Supports the Motorcomm 8511/8521/8531/8531S/8821 Ethernet PHYs
endef
$(eval $(call KernelPackage,phy-motorcomm))
define KernelPackage/dsa
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=Distributed Switch Architecture support

View File

@@ -1057,7 +1057,7 @@ $(eval $(call KernelPackage,tpm))
define KernelPackage/tpm-tis
SUBMENU:=$(OTHER_MENU)
TITLE:=TPM TIS 1.2 Interface / TPM 2.0 FIFO Interface
DEPENDS:= @TARGET_x86 +kmod-tpm
DEPENDS:= @(TARGET_x86||TARGET_imx) +kmod-tpm
KCONFIG:= CONFIG_TCG_TIS
FILES:= \
$(LINUX_DIR)/drivers/char/tpm/tpm_tis.ko \
@@ -1074,6 +1074,27 @@ endef
$(eval $(call KernelPackage,tpm-tis))
define KernelPackage/tpm-tis-spi
SUBMENU:=$(OTHER_MENU)
TITLE:=TPM TIS 1.3 Interface SPI Interface
DEPENDS:= +kmod-tpm-tis +kmod-spi-dev
KCONFIG:= CONFIG_TCG_TIS_SPI \
CONFIG_TCG_TIS_SPI_CR50=n
FILES:= \
$(LINUX_DIR)/drivers/char/tpm/tpm_tis_spi.ko
AUTOLOAD:=$(call AutoLoad,20,tpm_tis_spi,1)
endef
define KernelPackage/tpm-tis-spi/description
If you have a TPM security chip which is connected to a regular,
non-tcg SPI master that is compliant with the
TCG TIS 1.3 TPM specification (TPM1.2) or the TCG PTP FIFO
specification (TPM2.0) say Yes and it will be accessible from
within Linux.
endef
$(eval $(call KernelPackage,tpm-tis-spi))
define KernelPackage/tpm-i2c-atmel
SUBMENU:=$(OTHER_MENU)
TITLE:=TPM I2C Atmel Support

View File

@@ -0,0 +1,24 @@
From c420c1f66235b5ab4fc8d94da72bd5ae6397117f Mon Sep 17 00:00:00 2001
From: Gautham Kumar Senthilkumaran <gauthamk@qti.qualcomm.com>
Date: Mon, 19 Jan 2026 11:55:51 +0100
Subject: [PATCH] wifi: ath11k: Fix the WMM param type
Since FW does not support the 11ax EDCA parameter in WMI TLV command.
FW was crashing as host was sending this parameter, now changed the
WMM parameter type as default zero before sending to FW.
Fixes: b78c02f7c710 ("wifi: ath11k: add support for MU EDCA")
Signed-off-by: Gautham Kumar Senthilkumaran <gauthamk@qti.qualcomm.com>
Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -2682,7 +2682,7 @@ int ath11k_wmi_send_wmm_update_cmd_tlv(s
FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE);
cmd->vdev_id = vdev_id;
- cmd->wmm_param_type = wmm_param_type;
+ cmd->wmm_param_type = WMI_WMM_PARAM_TYPE_LEGACY;
for (ac = 0; ac < WME_NUM_AC; ac++) {
switch (ac) {

View File

@@ -0,0 +1,163 @@
From: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= <toke@toke.dk>
Date: Wed, 06 Nov 2024 13:41:44 +0100
Subject: [PATCH] ath9k: Add RX inactivity detection and reset chip when it
occurs
Some ath9k chips can, seemingly at random, end up in a state which can
be described as "deaf". No or nearly no interrupts are generated anymore
for incoming packets. Existing links either break down after a while and
new links will not be established.
The circumstances leading to this "deafness" is still unclear, but some
particular chips (especially 2-stream 11n SoCs, but also others) can go
'deaf' when running AP or mesh (or both) after some time. It's probably
a hardware issue, and doing a channel scan to trigger a chip
reset (which one normally can't do on an AP interface) recovers the
hardware.
The only way the driver can detect this state, is by detecting if there
has been no RX activity for a while. In this case we can proactively
reset the chip (which only takes a small number of milliseconds, so
shouldn't interrupt things too much if it has been idle for several
seconds), which functions as a workaround.
OpenWrt, and various derivatives, have been carrying versions of this
workaround for years, that were never upstreamed. One version[0],
written by Felix Fietkau, used a simple counter and only reset if there
was precisely zero RX activity for a long period of time. This had the
problem that in some cases a small number of interrupts would appear
even if the device was otherwise not responsive. For this reason,
another version[1], written by Simon Wunderlich and Sven Eckelmann, used
a time-based approach to calculate the average number of RX interrupts
over a longer (four-second) interval, and reset the chip when seeing
less than one interrupt per second over this period. However, that
version relied on debugfs counters to keep track of the number of
interrupts, which means it didn't work at all if debugfs was not
enabled.
This patch unifies the two versions: it uses the same approach as Felix'
patch to count the number of RX handler invocations, but uses the same
time-based windowing approach as Simon and Sven's patch to still handle
the case where occasional interrupts appear but the device is otherwise
deaf.
Since this is based on ideas by all three people, but not actually
directly derived from any of the patches, I'm including Suggested-by
tags from Simon, Sven and Felix below, which should hopefully serve as
proper credit.
[0] https://patchwork.kernel.org/project/linux-wireless/patch/20170125163654.66431-3-nbd@nbd.name/
[1] https://patchwork.kernel.org/project/linux-wireless/patch/20161117083614.19188-2-sven.eckelmann@open-mesh.com/
Suggested-by: Simon Wunderlich <sw@simonwunderlich.de>
Suggested-by: Sven Eckelmann <se@simonwunderlich.de>
Suggested-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Reviewed-by: Sven Eckelmann <se@simonwunderlich.de>
Acked-by: Simon Wunderlich <sw@simonwunderlich.de>
Tested-by: Issam Hamdi <ih@simonwunderlich.de>
Tested-by: Sven Eckelmann <se@simonwunderlich.de>
---
drivers/net/wireless/ath/ath9k/ath9k.h | 2 ++
drivers/net/wireless/ath/ath9k/debug.c | 1 +
drivers/net/wireless/ath/ath9k/debug.h | 1 +
drivers/net/wireless/ath/ath9k/link.c | 33 +++++++++++++++++++++++++++++++--
drivers/net/wireless/ath/ath9k/main.c | 1 +
5 files changed, 36 insertions(+), 2 deletions(-)
---
base-commit: c33f9c2728d0ccc7472e6239346c0fb3de556e0f
change-id: 20241105-ath9k-deaf-detection-0e26bb3243a6
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -1041,6 +1041,8 @@ struct ath_softc {
u8 gtt_cnt;
u32 intrstatus;
+ u32 rx_active_check_time;
+ u32 rx_active_count;
u16 ps_flags; /* PS_* */
bool ps_enabled;
bool ps_idle;
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -805,6 +805,7 @@ static int read_file_reset(struct seq_fi
[RESET_TYPE_CALIBRATION] = "Calibration error",
[RESET_TX_DMA_ERROR] = "Tx DMA stop error",
[RESET_RX_DMA_ERROR] = "Rx DMA stop error",
+ [RESET_TYPE_RX_INACTIVE] = "Rx path inactive",
};
int i;
--- a/drivers/net/wireless/ath/ath9k/debug.h
+++ b/drivers/net/wireless/ath/ath9k/debug.h
@@ -53,6 +53,7 @@ enum ath_reset_type {
RESET_TYPE_CALIBRATION,
RESET_TX_DMA_ERROR,
RESET_RX_DMA_ERROR,
+ RESET_TYPE_RX_INACTIVE,
__RESET_TYPE_MAX
};
--- a/drivers/net/wireless/ath/ath9k/link.c
+++ b/drivers/net/wireless/ath/ath9k/link.c
@@ -50,7 +50,36 @@ reset:
"tx hung, resetting the chip\n");
ath9k_queue_reset(sc, RESET_TYPE_TX_HANG);
return false;
+}
+
+#define RX_INACTIVE_CHECK_INTERVAL (4 * MSEC_PER_SEC)
+
+static bool ath_hw_rx_inactive_check(struct ath_softc *sc)
+{
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ u32 interval, count;
+
+ interval = jiffies_to_msecs(jiffies - sc->rx_active_check_time);
+ count = sc->rx_active_count;
+ if (interval < RX_INACTIVE_CHECK_INTERVAL)
+ return true; /* too soon to check */
+
+ sc->rx_active_count = 0;
+ sc->rx_active_check_time = jiffies;
+
+ /* Need at least one interrupt per second, and we should only react if
+ * we are within a factor two of the expected interval
+ */
+ if (interval > RX_INACTIVE_CHECK_INTERVAL * 2 ||
+ count >= interval / MSEC_PER_SEC)
+ return true;
+
+ ath_dbg(common, RESET,
+ "RX inactivity detected. Schedule chip reset\n");
+ ath9k_queue_reset(sc, RESET_TYPE_RX_INACTIVE);
+
+ return false;
}
void ath_hw_check_work(struct work_struct *work)
@@ -58,8 +87,8 @@ void ath_hw_check_work(struct work_struc
struct ath_softc *sc = container_of(work, struct ath_softc,
hw_check_work.work);
- if (!ath_hw_check(sc) ||
- !ath_tx_complete_check(sc))
+ if (!ath_hw_check(sc) || !ath_tx_complete_check(sc) ||
+ !ath_hw_rx_inactive_check(sc))
return;
ieee80211_queue_delayed_work(sc->hw, &sc->hw_check_work,
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -454,6 +454,7 @@ void ath9k_tasklet(struct tasklet_struct
ath_rx_tasklet(sc, 0, true);
ath_rx_tasklet(sc, 0, false);
+ sc->rx_active_count++;
}
if (status & ATH9K_INT_TX) {

View File

@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=openssl
PKG_VERSION:=3.0.18
PKG_VERSION:=3.0.19
PKG_RELEASE:=1
PKG_BUILD_FLAGS:=no-mips16 gc-sections no-lto
@@ -21,7 +21,7 @@ PKG_SOURCE_URL:= \
https://www.openssl.org/source/old/$(PKG_BASE)/ \
https://github.com/openssl/openssl/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
PKG_HASH:=d80c34f5cf902dccf1f1b5df5ebb86d0392e37049e5d73df1b3abae72e4ffe8b
PKG_HASH:=fa5a4143b8aae18be53ef2f3caf29a2e0747430b8bc74d32d88335b94ab63072
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE.txt

View File

@@ -16,9 +16,9 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
--- a/ssl/ssl_ciph.c
+++ b/ssl/ssl_ciph.c
@@ -1506,11 +1506,29 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
@@ -1490,11 +1490,29 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head,
&tail);
&tail);
+ /*
+ * If OPENSSL_PREFER_CHACHA_OVER_GCM is defined, ChaCha20_Poly1305
@@ -33,20 +33,20 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
+
+#ifdef OPENSSL_PREFER_CHACHA_OVER_GCM
+ ssl_cipher_apply_rule(0, 0, 0, SSL_CHACHA20, 0, 0, 0, CIPHER_ADD, -1,
+ &head, &tail);
+ &head, &tail);
+ ssl_cipher_apply_rule(0, 0, 0, SSL_AESGCM, 0, 0, 0, CIPHER_ADD, -1,
+ &head, &tail);
+ &head, &tail);
+#else
/* Within each strength group, we prefer GCM over CHACHA... */
ssl_cipher_apply_rule(0, 0, 0, SSL_AESGCM, 0, 0, 0, CIPHER_ADD, -1,
&head, &tail);
&head, &tail);
ssl_cipher_apply_rule(0, 0, 0, SSL_CHACHA20, 0, 0, 0, CIPHER_ADD, -1,
&head, &tail);
&head, &tail);
+#endif
/*
* ...and generally, our preferred cipher is AES.
@@ -1565,7 +1583,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
@@ -1549,7 +1567,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
* Within each group, ciphers remain sorted by strength and previous
* preference, i.e.,
* 1) ECDHE > DHE
@@ -55,7 +55,7 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
* 3) AES > rest
* 4) TLS 1.2 > legacy
*
@@ -2236,7 +2254,13 @@ const char *OSSL_default_cipher_list(voi
@@ -2222,7 +2240,13 @@ const char *OSSL_default_cipher_list(voi
*/
const char *OSSL_default_ciphersuites(void)
{
@@ -71,22 +71,20 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
}
--- a/include/openssl/ssl.h.in
+++ b/include/openssl/ssl.h.in
@@ -195,9 +195,15 @@ extern "C" {
@@ -197,10 +197,16 @@ extern "C" {
* DEPRECATED IN 3.0.0, in favor of OSSL_default_ciphersuites()
* Update both macro and function simultaneously
*/
-# define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
- "TLS_CHACHA20_POLY1305_SHA256:" \
- "TLS_AES_128_GCM_SHA256"
+# ifdef OPENSSL_PREFER_CHACHA_OVER_GCM
+# define TLS_DEFAULT_CIPHERSUITES "TLS_CHACHA20_POLY1305_SHA256:" \
+ "TLS_AES_256_GCM_SHA384:" \
+ "TLS_AES_128_GCM_SHA256"
+# else
+# define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
+ "TLS_CHACHA20_POLY1305_SHA256:" \
+ "TLS_AES_128_GCM_SHA256"
+# endif
# endif
+#ifdef OPENSSL_PREFER_CHACHA_OVER_GCM
+#define TLS_DEFAULT_CIPHERSUITES "TLS_CHACHA20_POLY1305_SHA256:" \
+ "TLS_AES_256_GCM_SHA384:" \
+ "TLS_AES_128_GCM_SHA256"
+#else
#define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
"TLS_CHACHA20_POLY1305_SHA256:" \
"TLS_AES_128_GCM_SHA256"
#endif
+#endif
/*
* As of OpenSSL 1.0.0, ssl_create_cipher_list() in ssl/ssl_ciph.c always
* starts with a reasonable order, and all we have to do for DEFAULT is

View File

@@ -21,21 +21,21 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
--- a/engines/e_devcrypto.c
+++ b/engines/e_devcrypto.c
@@ -905,7 +905,7 @@ static void prepare_digest_methods(void)
@@ -886,7 +886,7 @@ static void prepare_digest_methods(void)
for (i = 0, known_digest_nids_amount = 0; i < OSSL_NELEM(digest_data);
i++) {
i++) {
- selected_digests[i] = 1;
+ selected_digests[i] = 0;
/*
* Check that the digest is usable
@@ -1119,7 +1119,7 @@ static const ENGINE_CMD_DEFN devcrypto_c
@@ -1095,7 +1095,7 @@ static const ENGINE_CMD_DEFN devcrypto_c
#ifdef IMPLEMENT_DIGEST
{DEVCRYPTO_CMD_DIGESTS,
"DIGESTS",
- "either ALL, NONE, or a comma-separated list of digests to enable [default=ALL]",
+ "either ALL, NONE, or a comma-separated list of digests to enable [default=NONE]",
ENGINE_CMD_FLAG_STRING},
{ DEVCRYPTO_CMD_DIGESTS,
"DIGESTS",
- "either ALL, NONE, or a comma-separated list of digests to enable [default=ALL]",
+ "either ALL, NONE, or a comma-separated list of digests to enable [default=NONE]",
ENGINE_CMD_FLAG_STRING },
#endif

View File

@@ -10,12 +10,11 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
--- a/engines/e_devcrypto.c
+++ b/engines/e_devcrypto.c
@@ -211,9 +211,8 @@ static int cipher_init(EVP_CIPHER_CTX *c
@@ -210,8 +210,8 @@ static int cipher_init(EVP_CIPHER_CTX *c
int ret;
/* cleanup a previous session */
- if (cipher_ctx->sess.ses != 0 &&
- clean_devcrypto_session(&cipher_ctx->sess) == 0)
- if (cipher_ctx->sess.ses != 0 && clean_devcrypto_session(&cipher_ctx->sess) == 0)
- return 0;
+ if (cipher_ctx->sess.ses != 0)
+ clean_devcrypto_session(&cipher_ctx->sess);

View File

@@ -221,7 +221,7 @@ Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
+MODULE_LICENSE("GPL");
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -103,6 +103,8 @@ static const struct of_device_id allowli
@@ -104,6 +104,8 @@ static const struct of_device_id allowli
* platforms using "operating-points-v2" property.
*/
static const struct of_device_id blocklist[] __initconst = {

View File

@@ -25,7 +25,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
};
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -103,6 +103,7 @@ static const struct of_device_id allowli
@@ -104,6 +104,7 @@ static const struct of_device_id allowli
* platforms using "operating-points-v2" property.
*/
static const struct of_device_id blocklist[] __initconst = {

View File

@@ -15,6 +15,7 @@
led-boot = &led_wan;
led-failsafe = &led_wan;
led-upgrade = &led_wan;
label-mac-device = &eth1;
};
leds {

View File

@@ -24,7 +24,7 @@ We don't agree with upstream revert so undo it.
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -635,8 +635,11 @@ static int xhci_move_dequeue_past_td(str
@@ -633,8 +633,11 @@ static int xhci_move_dequeue_past_td(str
struct xhci_ring *ep_ring;
struct xhci_command *cmd;
struct xhci_segment *new_seg;
@@ -36,7 +36,7 @@ We don't agree with upstream revert so undo it.
dma_addr_t addr;
u64 hw_dequeue;
bool cycle_found = false;
@@ -674,7 +677,27 @@ static int xhci_move_dequeue_past_td(str
@@ -672,7 +675,27 @@ static int xhci_move_dequeue_past_td(str
hw_dequeue = xhci_get_hw_deq(xhci, dev, ep_index, stream_id);
new_seg = ep_ring->deq_seg;
new_deq = ep_ring->dequeue;

View File

@@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -200,6 +200,12 @@ static int __release_resource(struct res
@@ -205,6 +205,12 @@ static int __release_resource(struct res
{
struct resource *tmp, **p, *chd;

View File

@@ -17583,7 +17583,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
* For devices with more than one control interface, we assume the
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -2279,6 +2279,8 @@ static const struct usb_audio_quirk_flag
@@ -2293,6 +2293,8 @@ static const struct usb_audio_quirk_flag
QUIRK_FLAG_ALIGN_TRANSFER),
DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */
QUIRK_FLAG_ALIGN_TRANSFER),

View File

@@ -19,7 +19,7 @@ Reduces overhead when using X
module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644);
MODULE_PARM_DESC(mousepoll, "Polling interval of mice");
@@ -1115,7 +1115,9 @@ static int usbhid_start(struct hid_devic
@@ -1130,7 +1130,9 @@ static int usbhid_start(struct hid_devic
*/
switch (hid->collection->usage) {
case HID_GD_MOUSE:

View File

@@ -26,7 +26,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -740,9 +740,9 @@ deq_found:
@@ -738,9 +738,9 @@ deq_found:
}
if ((ep->ep_state & SET_DEQ_PENDING)) {

View File

@@ -13,7 +13,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -1129,6 +1129,7 @@ static int usbhid_start(struct hid_devic
@@ -1144,6 +1144,7 @@ static int usbhid_start(struct hid_devic
interval = hid_kbpoll_interval;
break;
}

View File

@@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
#define USB_VENDOR_ID_BELKIN 0x050d
#define USB_DEVICE_ID_FLIP_KVM 0x3201
@@ -1453,6 +1456,9 @@
@@ -1454,6 +1457,9 @@
#define USB_VENDOR_ID_XIAOMI 0x2717
#define USB_DEVICE_ID_MI_SILENT_MOUSE 0x5014

View File

@@ -18,7 +18,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -123,6 +123,7 @@
@@ -122,6 +122,7 @@
#define PCIE_MISC_HARD_PCIE_HARD_DEBUG_CLKREQ_DEBUG_ENABLE_MASK 0x2
#define PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK 0x08000000
#define PCIE_BMIPS_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK 0x00800000
@@ -26,7 +26,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
#define PCIE_INTR2_CPU_BASE 0x4300
@@ -252,6 +253,7 @@ struct brcm_pcie {
@@ -251,6 +252,7 @@ struct brcm_pcie {
struct clk *clk;
struct device_node *np;
bool ssc;
@@ -34,7 +34,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
int gen;
u64 msi_target_addr;
struct brcm_msi *msi;
@@ -1077,12 +1079,25 @@ static int brcm_pcie_start_link(struct b
@@ -1073,12 +1075,25 @@ static int brcm_pcie_start_link(struct b
pci_speed_string(pcie_link_speed[cls]), nlw,
ssc_good ? "(SSC)" : "(!SSC)");
@@ -65,7 +65,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
writel(tmp, base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
return 0;
@@ -1537,6 +1552,7 @@ static int brcm_pcie_probe(struct platfo
@@ -1533,6 +1548,7 @@ static int brcm_pcie_probe(struct platfo
pcie->gen = (ret < 0) ? 0 : ret;
pcie->ssc = of_property_read_bool(np, "brcm,enable-ssc");

View File

@@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -442,7 +442,7 @@ static struct irq_chip brcm_msi_irq_chip
@@ -441,7 +441,7 @@ static struct irq_chip brcm_msi_irq_chip
static struct msi_domain_info brcm_msi_domain_info = {
.flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |

View File

@@ -15,7 +15,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -3377,6 +3377,31 @@ static const struct panel_desc rocktech_
@@ -3378,6 +3378,31 @@ static const struct panel_desc rocktech_
.connector_type = DRM_MODE_CONNECTOR_DPI,
};
@@ -47,7 +47,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
static const struct display_timing rocktech_rk070er9427_timing = {
.pixelclock = { 26400000, 33300000, 46800000 },
.hactive = { 800, 800, 800 },
@@ -4453,6 +4478,9 @@ static const struct of_device_id platfor
@@ -4454,6 +4479,9 @@ static const struct of_device_id platfor
.compatible = "rocktech,rk043fn48h",
.data = &rocktech_rk043fn48h,
}, {

View File

@@ -13,7 +13,7 @@ Acked-by: Maxime Ripard <maxime@cerno.tech>
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -2036,6 +2036,32 @@ static const struct panel_desc friendlya
@@ -2037,6 +2037,32 @@ static const struct panel_desc friendlya
},
};
@@ -46,7 +46,7 @@ Acked-by: Maxime Ripard <maxime@cerno.tech>
static const struct drm_display_mode giantplus_gpg482739qs5_mode = {
.clock = 9000,
.hdisplay = 480,
@@ -4328,6 +4354,9 @@ static const struct of_device_id platfor
@@ -4329,6 +4355,9 @@ static const struct of_device_id platfor
.compatible = "friendlyarm,hd702e",
.data = &friendlyarm_hd702e,
}, {

View File

@@ -20,7 +20,7 @@ Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -204,6 +204,27 @@ EXPORT_SYMBOL(node_states);
@@ -231,6 +231,27 @@ EXPORT_SYMBOL(node_states);
gfp_t gfp_allowed_mask __read_mostly = GFP_BOOT_MASK;
@@ -48,7 +48,7 @@ Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
/*
* A cached value of the page's pageblock's migratetype, used when the page is
* put on a pcplist. Used to avoid the pageblock migratetype lookup when
@@ -2108,12 +2129,13 @@ __rmqueue(struct zone *zone, unsigned in
@@ -2135,12 +2156,13 @@ __rmqueue(struct zone *zone, unsigned in
if (IS_ENABLED(CONFIG_CMA)) {
/*
* Balance movable allocations between regular and CMA areas by

View File

@@ -126,7 +126,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
- MEDIA_BUS_FMT_RGB666_1X24_CPADHI
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -2242,6 +2242,38 @@ static const struct panel_desc innolux_a
@@ -2243,6 +2243,38 @@ static const struct panel_desc innolux_a
.bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
};
@@ -165,7 +165,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
static const struct drm_display_mode innolux_at070tn92_mode = {
.clock = 33333,
.hdisplay = 800,
@@ -4378,6 +4410,9 @@ static const struct of_device_id platfor
@@ -4379,6 +4411,9 @@ static const struct of_device_id platfor
.compatible = "innolux,at043tn24",
.data = &innolux_at043tn24,
}, {

View File

@@ -10,7 +10,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -1312,6 +1312,7 @@ static const struct of_device_id pca953x
@@ -1353,6 +1353,7 @@ static const struct of_device_id pca953x
{ .compatible = "ti,tca6424", .data = OF_953X(24, PCA_INT), },
{ .compatible = "ti,tca9538", .data = OF_953X( 8, PCA_INT), },
{ .compatible = "ti,tca9539", .data = OF_953X(16, PCA_INT), },

View File

@@ -34,7 +34,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -730,6 +730,15 @@ static int xhci_move_dequeue_past_td(str
@@ -728,6 +728,15 @@ static int xhci_move_dequeue_past_td(str
} while (!cycle_found || !td_last_trb_found);
deq_found:

View File

@@ -34,7 +34,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1407,6 +1407,7 @@ int xhci_endpoint_init(struct xhci_hcd *
@@ -1401,6 +1401,7 @@ int xhci_endpoint_init(struct xhci_hcd *
unsigned int ep_index;
struct xhci_ep_ctx *ep_ctx;
struct xhci_ring *ep_ring;
@@ -42,7 +42,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
unsigned int max_packet;
enum xhci_ring_type ring_type;
u32 max_esit_payload;
@@ -1416,6 +1417,8 @@ int xhci_endpoint_init(struct xhci_hcd *
@@ -1410,6 +1411,8 @@ int xhci_endpoint_init(struct xhci_hcd *
unsigned int mult;
unsigned int avg_trb_len;
unsigned int err_count = 0;
@@ -51,7 +51,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
ep_index = xhci_get_endpoint_index(&ep->desc);
ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index);
@@ -1451,9 +1454,35 @@ int xhci_endpoint_init(struct xhci_hcd *
@@ -1445,9 +1448,35 @@ int xhci_endpoint_init(struct xhci_hcd *
mult = xhci_get_endpoint_mult(udev, ep);
max_packet = usb_endpoint_maxp(&ep->desc);

View File

@@ -75,7 +75,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3733,6 +3733,48 @@ static int xhci_align_td(struct xhci_hcd
@@ -3729,6 +3729,48 @@ static int xhci_align_td(struct xhci_hcd
return 1;
}
@@ -124,7 +124,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
/* This is very similar to what ehci-q.c qtd_fill() does */
int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
struct urb *urb, int slot_id, unsigned int ep_index)
@@ -3889,6 +3931,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
@@ -3885,6 +3927,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
}
check_trb_math(urb, enqd_len);
@@ -133,7 +133,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id,
start_cycle, start_trb);
return 0;
@@ -4038,6 +4082,8 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
@@ -4034,6 +4078,8 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *
/* Event on completion */
field | TRB_IOC | TRB_TYPE(TRB_STATUS) | ep_ring->cycle_state);

View File

@@ -12,7 +12,7 @@ sdhci: remove PYA0_INTR_BUG quirk. Add quirks to disable some of the higher SDR
--- a/drivers/mmc/host/sdhci-of-dwcmshc.c
+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
@@ -376,7 +376,10 @@ static const struct sdhci_pltfm_data sdh
@@ -383,7 +383,10 @@ static const struct sdhci_pltfm_data sdh
.quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN |
SDHCI_QUIRK_BROKEN_TIMEOUT_VAL,
.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |

View File

@@ -191,7 +191,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
static void macb_init_buffers(struct macb *bp)
{
struct macb_queue *queue;
@@ -977,6 +993,7 @@ static int macb_mii_init(struct macb *bp
@@ -976,6 +992,7 @@ static int macb_mii_init(struct macb *bp
bp->mii_bus->write = &macb_mdio_write_c22;
bp->mii_bus->read_c45 = &macb_mdio_read_c45;
bp->mii_bus->write_c45 = &macb_mdio_write_c45;
@@ -199,7 +199,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
snprintf(bp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
bp->pdev->name, bp->pdev->id);
bp->mii_bus->priv = bp;
@@ -1642,6 +1659,11 @@ static int macb_rx(struct macb_queue *qu
@@ -1641,6 +1658,11 @@ static int macb_rx(struct macb_queue *qu
macb_init_rx_ring(queue);
queue_writel(queue, RBQP, queue->rx_ring_dma);
@@ -211,7 +211,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
macb_writel(bp, NCR, ctrl | MACB_BIT(RE));
@@ -1944,8 +1966,9 @@ static irqreturn_t macb_interrupt(int ir
@@ -1943,8 +1965,9 @@ static irqreturn_t macb_interrupt(int ir
queue_writel(queue, ISR, MACB_BIT(TCOMP) |
MACB_BIT(TXUBR));
@@ -222,7 +222,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
wmb(); // ensure softirq can see update
}
@@ -2401,6 +2424,11 @@ static netdev_tx_t macb_start_xmit(struc
@@ -2400,6 +2423,11 @@ static netdev_tx_t macb_start_xmit(struc
skb_tx_timestamp(skb);
spin_lock(&bp->lock);
@@ -234,7 +234,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(TSTART));
spin_unlock(&bp->lock);
@@ -2775,6 +2803,37 @@ static void macb_configure_dma(struct ma
@@ -2774,6 +2802,37 @@ static void macb_configure_dma(struct ma
}
}
@@ -272,7 +272,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
static void macb_init_hw(struct macb *bp)
{
u32 config;
@@ -2803,6 +2862,11 @@ static void macb_init_hw(struct macb *bp
@@ -2802,6 +2861,11 @@ static void macb_init_hw(struct macb *bp
if (bp->caps & MACB_CAPS_JUMBO)
bp->rx_frm_len_mask = MACB_RX_JFRMLEN_MASK;
@@ -284,7 +284,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
macb_configure_dma(bp);
/* Enable RX partial store and forward and set watermark */
@@ -3167,6 +3231,52 @@ static void gem_get_ethtool_strings(stru
@@ -3168,6 +3232,52 @@ static void gem_get_ethtool_strings(stru
}
}
@@ -337,7 +337,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
static struct net_device_stats *macb_get_stats(struct net_device *dev)
{
struct macb *bp = netdev_priv(dev);
@@ -3761,6 +3871,8 @@ static const struct ethtool_ops macb_eth
@@ -3762,6 +3872,8 @@ static const struct ethtool_ops macb_eth
};
static const struct ethtool_ops gem_ethtool_ops = {
@@ -346,7 +346,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
.get_regs_len = macb_get_regs_len,
.get_regs = macb_get_regs,
.get_wol = macb_get_wol,
@@ -3770,6 +3882,8 @@ static const struct ethtool_ops gem_etht
@@ -3771,6 +3883,8 @@ static const struct ethtool_ops gem_etht
.get_ethtool_stats = gem_get_ethtool_stats,
.get_strings = gem_get_ethtool_strings,
.get_sset_count = gem_get_sset_count,
@@ -355,7 +355,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
.get_link_ksettings = macb_get_link_ksettings,
.set_link_ksettings = macb_set_link_ksettings,
.get_ringparam = macb_get_ringparam,
@@ -5066,6 +5180,11 @@ static int macb_probe(struct platform_de
@@ -5067,6 +5181,11 @@ static int macb_probe(struct platform_de
}
}
}
@@ -367,7 +367,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
spin_lock_init(&bp->lock);
spin_lock_init(&bp->stats_lock);
@@ -5126,6 +5245,21 @@ static int macb_probe(struct platform_de
@@ -5127,6 +5246,21 @@ static int macb_probe(struct platform_de
else
bp->phy_interface = interface;
@@ -389,7 +389,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
/* IP specific init */
err = init(pdev);
if (err)
@@ -5202,6 +5336,19 @@ static int macb_remove(struct platform_d
@@ -5203,6 +5337,19 @@ static int macb_remove(struct platform_d
return 0;
}
@@ -409,7 +409,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
static int __maybe_unused macb_suspend(struct device *dev)
{
struct net_device *netdev = dev_get_drvdata(dev);
@@ -5416,6 +5563,7 @@ static const struct dev_pm_ops macb_pm_o
@@ -5417,6 +5564,7 @@ static const struct dev_pm_ops macb_pm_o
static struct platform_driver macb_driver = {
.probe = macb_probe,
.remove = macb_remove,

View File

@@ -160,9 +160,9 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
#include <linux/list.h>
#include <linux/log2.h>
#include <linux/module.h>
@@ -48,10 +49,23 @@
@@ -47,10 +48,23 @@
#define PCIE_RC_CFG_PRIV1_LINK_CAPABILITY 0x04dc
#define PCIE_RC_CFG_PRIV1_LINK_CAPABILITY_ASPM_SUPPORT_MASK 0xc00
+#define PCIE_RC_TL_VDM_CTL0 0x0a20
+#define PCIE_RC_TL_VDM_CTL0_VDM_ENABLED_MASK 0x10000
@@ -184,7 +184,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
#define PCIE_MISC_MISC_CTRL 0x4008
#define PCIE_MISC_MISC_CTRL_PCIE_RCB_64B_MODE_MASK 0x80
#define PCIE_MISC_MISC_CTRL_PCIE_RCB_MPS_MODE_MASK 0x400
@@ -74,6 +88,7 @@
@@ -73,6 +87,7 @@
#define PCIE_MISC_RC_BAR1_CONFIG_LO 0x402c
#define PCIE_MISC_RC_BAR1_CONFIG_LO_SIZE_MASK 0x1f
@@ -192,7 +192,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
#define PCIE_MISC_RC_BAR2_CONFIG_LO 0x4034
#define PCIE_MISC_RC_BAR2_CONFIG_LO_SIZE_MASK 0x1f
@@ -81,6 +96,7 @@
@@ -80,6 +95,7 @@
#define PCIE_MISC_RC_BAR3_CONFIG_LO 0x403c
#define PCIE_MISC_RC_BAR3_CONFIG_LO_SIZE_MASK 0x1f
@@ -200,7 +200,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
#define PCIE_MISC_MSI_BAR_CONFIG_LO 0x4044
#define PCIE_MISC_MSI_BAR_CONFIG_HI 0x4048
@@ -89,12 +105,15 @@
@@ -88,12 +104,15 @@
#define PCIE_MISC_MSI_DATA_CONFIG_VAL_32 0xffe06540
#define PCIE_MISC_MSI_DATA_CONFIG_VAL_8 0xfff86540
@@ -216,7 +216,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
#define PCIE_MISC_PCIE_STATUS_PCIE_DL_ACTIVE_MASK 0x20
#define PCIE_MISC_PCIE_STATUS_PCIE_PHYLINKUP_MASK 0x10
#define PCIE_MISC_PCIE_STATUS_PCIE_LINK_IN_L23_MASK 0x40
@@ -119,14 +138,73 @@
@@ -118,14 +137,73 @@
#define PCIE_MEM_WIN0_LIMIT_HI(win) \
PCIE_MISC_CPU_2_PCIE_MEM_WIN0_LIMIT_HI + ((win) * 8)
@@ -292,7 +292,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
#define PCIE_MSI_INTR2_BASE 0x4500
/* Offsets from PCIE_INTR2_CPU_BASE and PCIE_MSI_INTR2_BASE */
#define MSI_INT_STATUS 0x0
@@ -200,6 +278,8 @@ enum {
@@ -199,6 +277,8 @@ enum {
RGR1_SW_INIT_1,
EXT_CFG_INDEX,
EXT_CFG_DATA,
@@ -301,7 +301,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
};
enum {
@@ -214,6 +294,7 @@ enum pcie_type {
@@ -213,6 +293,7 @@ enum pcie_type {
BCM4908,
BCM7278,
BCM2711,
@@ -309,7 +309,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
};
struct pcie_cfg_data {
@@ -221,6 +302,7 @@ struct pcie_cfg_data {
@@ -220,6 +301,7 @@ struct pcie_cfg_data {
const enum pcie_type type;
void (*perst_set)(struct brcm_pcie *pcie, u32 val);
void (*bridge_sw_init_set)(struct brcm_pcie *pcie, u32 val);
@@ -317,7 +317,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
};
struct subdev_regulators {
@@ -237,7 +319,7 @@ struct brcm_msi {
@@ -236,7 +318,7 @@ struct brcm_msi {
struct mutex lock; /* guards the alloc/free operations */
u64 target_addr;
int irq;
@@ -326,7 +326,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
bool legacy;
/* Some chips have MSIs in bits [31..24] of a shared register. */
int legacy_shift;
@@ -261,11 +343,14 @@ struct brcm_pcie {
@@ -260,11 +342,14 @@ struct brcm_pcie {
enum pcie_type type;
struct reset_control *rescal;
struct reset_control *perst_reset;
@@ -341,7 +341,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
struct subdev_regulators *sr;
bool ep_wakeup_capable;
};
@@ -376,6 +461,35 @@ static int brcm_pcie_set_ssc(struct brcm
@@ -375,6 +460,35 @@ static int brcm_pcie_set_ssc(struct brcm
return ssc && pll ? 0 : -EIO;
}
@@ -377,7 +377,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
/* Limits operation to a specific generation (1, 2, or 3) */
static void brcm_pcie_set_gen(struct brcm_pcie *pcie, int gen)
{
@@ -433,6 +547,97 @@ static void brcm_pcie_set_outbound_win(s
@@ -432,6 +546,97 @@ static void brcm_pcie_set_outbound_win(s
writel(tmp, pcie->base + PCIE_MEM_WIN0_LIMIT_HI(win));
}
@@ -475,7 +475,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
static struct irq_chip brcm_msi_irq_chip = {
.name = "BRCM STB PCIe MSI",
.irq_ack = irq_chip_ack_parent,
@@ -449,7 +654,7 @@ static struct msi_domain_info brcm_msi_d
@@ -448,7 +653,7 @@ static struct msi_domain_info brcm_msi_d
static void brcm_pcie_msi_isr(struct irq_desc *desc)
{
struct irq_chip *chip = irq_desc_get_chip(desc);
@@ -484,7 +484,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
struct brcm_msi *msi;
struct device *dev;
u32 bit;
@@ -461,10 +666,22 @@ static void brcm_pcie_msi_isr(struct irq
@@ -460,10 +665,22 @@ static void brcm_pcie_msi_isr(struct irq
status = readl(msi->intr_base + MSI_INT_STATUS);
status >>= msi->legacy_shift;
@@ -511,7 +511,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
dev_dbg(dev, "unexpected MSI\n");
}
@@ -477,7 +694,7 @@ static void brcm_msi_compose_msi_msg(str
@@ -476,7 +693,7 @@ static void brcm_msi_compose_msi_msg(str
msg->address_lo = lower_32_bits(msi->target_addr);
msg->address_hi = upper_32_bits(msi->target_addr);
@@ -520,7 +520,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
}
static int brcm_msi_set_affinity(struct irq_data *irq_data,
@@ -489,7 +706,7 @@ static int brcm_msi_set_affinity(struct
@@ -488,7 +705,7 @@ static int brcm_msi_set_affinity(struct
static void brcm_msi_ack_irq(struct irq_data *data)
{
struct brcm_msi *msi = irq_data_get_irq_chip_data(data);
@@ -529,7 +529,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
writel(1 << shift_amt, msi->intr_base + MSI_INT_CLR);
}
@@ -650,7 +867,7 @@ static int brcm_pcie_enable_msi(struct b
@@ -649,7 +866,7 @@ static int brcm_pcie_enable_msi(struct b
msi->legacy_shift = 24;
} else {
msi->intr_base = msi->base + PCIE_MSI_INTR2_BASE;
@@ -538,7 +538,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
msi->legacy_shift = 0;
}
@@ -667,7 +884,7 @@ static int brcm_pcie_enable_msi(struct b
@@ -666,7 +883,7 @@ static int brcm_pcie_enable_msi(struct b
}
/* The controller is capable of serving in both RC and EP roles */
@@ -547,7 +547,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
{
void __iomem *base = pcie->base;
u32 val = readl(base + PCIE_MISC_PCIE_STATUS);
@@ -675,6 +892,14 @@ static bool brcm_pcie_rc_mode(struct brc
@@ -674,6 +891,14 @@ static bool brcm_pcie_rc_mode(struct brc
return !!FIELD_GET(PCIE_MISC_PCIE_STATUS_PCIE_PORT_MASK, val);
}
@@ -562,7 +562,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
static bool brcm_pcie_link_up(struct brcm_pcie *pcie)
{
u32 val = readl(pcie->base + PCIE_MISC_PCIE_STATUS);
@@ -746,6 +971,18 @@ static void brcm_pcie_bridge_sw_init_set
@@ -745,6 +970,18 @@ static void brcm_pcie_bridge_sw_init_set
writel(tmp, pcie->base + PCIE_RGR1_SW_INIT_1(pcie));
}
@@ -581,7 +581,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
static void brcm_pcie_perst_set_4908(struct brcm_pcie *pcie, u32 val)
{
if (WARN_ONCE(!pcie->perst_reset, "missing PERST# reset controller\n"))
@@ -767,6 +1004,16 @@ static void brcm_pcie_perst_set_7278(str
@@ -766,6 +1003,16 @@ static void brcm_pcie_perst_set_7278(str
writel(tmp, pcie->base + PCIE_MISC_PCIE_CTRL);
}
@@ -598,7 +598,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
static void brcm_pcie_perst_set_generic(struct brcm_pcie *pcie, u32 val)
{
u32 tmp;
@@ -793,6 +1040,8 @@ static int brcm_pcie_get_rc_bar2_size_an
@@ -792,6 +1039,8 @@ static int brcm_pcie_get_rc_bar2_size_an
size += entry->res->end - entry->res->start + 1;
if (pcie_beg < lowest_pcie_addr)
lowest_pcie_addr = pcie_beg;
@@ -607,7 +607,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
}
if (lowest_pcie_addr == ~(u64)0) {
@@ -863,6 +1112,30 @@ static int brcm_pcie_get_rc_bar2_size_an
@@ -862,6 +1111,30 @@ static int brcm_pcie_get_rc_bar2_size_an
return 0;
}
@@ -638,16 +638,16 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
static int brcm_pcie_setup(struct brcm_pcie *pcie)
{
u64 rc_bar2_offset, rc_bar2_size;
@@ -871,7 +1144,7 @@ static int brcm_pcie_setup(struct brcm_p
@@ -870,7 +1143,7 @@ static int brcm_pcie_setup(struct brcm_p
struct resource_entry *entry;
u32 tmp, burst, aspm_support;
u32 tmp, burst;
int num_out_wins = 0;
- int ret, memc;
+ int ret, memc, count, i;
/* Reset the bridge */
pcie->bridge_sw_init_set(pcie, 1);
@@ -894,6 +1167,17 @@ static int brcm_pcie_setup(struct brcm_p
@@ -893,6 +1166,17 @@ static int brcm_pcie_setup(struct brcm_p
/* Wait for SerDes to be stable */
usleep_range(100, 200);
@@ -665,7 +665,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
/*
* SCB_MAX_BURST_SIZE is a two bit field. For GENERIC chips it
* is encoded as 0=128, 1=256, 2=512, 3=Rsvd, for BCM7278 it
@@ -903,6 +1187,8 @@ static int brcm_pcie_setup(struct brcm_p
@@ -902,6 +1186,8 @@ static int brcm_pcie_setup(struct brcm_p
burst = 0x1; /* 256 bytes */
else if (pcie->type == BCM2711)
burst = 0x0; /* 128 bytes */
@@ -674,7 +674,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
else if (pcie->type == BCM7278)
burst = 0x3; /* 512 bytes */
else
@@ -920,6 +1206,8 @@ static int brcm_pcie_setup(struct brcm_p
@@ -919,6 +1205,8 @@ static int brcm_pcie_setup(struct brcm_p
u32p_replace_bits(&tmp, 1, PCIE_MISC_MISC_CTRL_PCIE_RCB_64B_MODE_MASK);
writel(tmp, base + PCIE_MISC_MISC_CTRL);
@@ -683,7 +683,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
ret = brcm_pcie_get_rc_bar2_size_and_offset(pcie, &rc_bar2_size,
&rc_bar2_offset);
if (ret)
@@ -932,7 +1220,11 @@ static int brcm_pcie_setup(struct brcm_p
@@ -931,7 +1219,11 @@ static int brcm_pcie_setup(struct brcm_p
writel(upper_32_bits(rc_bar2_offset),
base + PCIE_MISC_RC_BAR2_CONFIG_HI);
@@ -695,7 +695,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
for (memc = 0; memc < pcie->num_memc; memc++) {
u32 scb_size_val = ilog2(pcie->memc_size[memc]) - 15;
@@ -943,8 +1235,32 @@ static int brcm_pcie_setup(struct brcm_p
@@ -942,8 +1234,32 @@ static int brcm_pcie_setup(struct brcm_p
else if (memc == 2)
u32p_replace_bits(&tmp, scb_size_val, SCB_SIZE_MASK(2));
}
@@ -728,7 +728,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
/*
* We ideally want the MSI target address to be located in the 32bit
* addressable memory area. Some devices might depend on it. This is
@@ -957,7 +1273,7 @@ static int brcm_pcie_setup(struct brcm_p
@@ -956,7 +1272,7 @@ static int brcm_pcie_setup(struct brcm_p
else
pcie->msi_target_addr = BRCM_MSI_TARGET_ADDR_GT_4GB;
@@ -737,8 +737,8 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
dev_err(pcie->dev, "PCIe RC controller misconfigured as Endpoint\n");
return -EINVAL;
}
@@ -981,6 +1297,38 @@ static int brcm_pcie_setup(struct brcm_p
PCIE_RC_CFG_PRIV1_LINK_CAPABILITY_ASPM_SUPPORT_MASK);
@@ -977,6 +1293,38 @@ static int brcm_pcie_setup(struct brcm_p
tmp &= ~PCI_EXP_LNKCAP_ASPM_L0S;
writel(tmp, base + PCIE_RC_CFG_PRIV1_LINK_CAPABILITY);
+ /* program additional inbound windows (RC_BAR4..RC_BAR10) */
@@ -776,7 +776,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
/*
* For config space accesses on the RC, show the right class for
* a PCIe-PCIe bridge (the default setting is to be EP mode).
@@ -1036,7 +1384,6 @@ static int brcm_pcie_start_link(struct b
@@ -1032,7 +1380,6 @@ static int brcm_pcie_start_link(struct b
void __iomem *base = pcie->base;
u16 nlw, cls, lnksta;
bool ssc_good = false;
@@ -784,7 +784,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
int ret, i;
/* Unassert the fundamental reset */
@@ -1072,6 +1419,7 @@ static int brcm_pcie_start_link(struct b
@@ -1068,6 +1415,7 @@ static int brcm_pcie_start_link(struct b
dev_err(dev, "failed attempt to enter ssc mode\n");
}
@@ -792,7 +792,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
lnksta = readw(base + BRCM_PCIE_CAP_REGS + PCI_EXP_LNKSTA);
cls = FIELD_GET(PCI_EXP_LNKSTA_CLS, lnksta);
nlw = FIELD_GET(PCI_EXP_LNKSTA_NLW, lnksta);
@@ -1079,27 +1427,6 @@ static int brcm_pcie_start_link(struct b
@@ -1075,27 +1423,6 @@ static int brcm_pcie_start_link(struct b
pci_speed_string(pcie_link_speed[cls]), nlw,
ssc_good ? "(SSC)" : "(!SSC)");
@@ -820,7 +820,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
return 0;
}
@@ -1208,6 +1535,7 @@ static void brcm_pcie_enter_l23(struct b
@@ -1204,6 +1531,7 @@ static void brcm_pcie_enter_l23(struct b
static int brcm_phy_cntl(struct brcm_pcie *pcie, const int start)
{
@@ -828,7 +828,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
static const u32 shifts[PCIE_DVT_PMU_PCIE_PHY_CTRL_DAST_NFLDS] = {
PCIE_DVT_PMU_PCIE_PHY_CTRL_DAST_PWRDN_SHIFT,
PCIE_DVT_PMU_PCIE_PHY_CTRL_DAST_RESET_SHIFT,
@@ -1240,6 +1568,9 @@ static int brcm_phy_cntl(struct brcm_pci
@@ -1236,6 +1564,9 @@ static int brcm_phy_cntl(struct brcm_pci
dev_err(pcie->dev, "failed to %s phy\n", (start ? "start" : "stop"));
return ret;
@@ -838,7 +838,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
}
static inline int brcm_phy_start(struct brcm_pcie *pcie)
@@ -1272,6 +1603,12 @@ static void brcm_pcie_turn_off(struct br
@@ -1268,6 +1599,12 @@ static void brcm_pcie_turn_off(struct br
u32p_replace_bits(&tmp, 1, PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK);
writel(tmp, base + PCIE_MISC_HARD_PCIE_HARD_DEBUG);
@@ -851,7 +851,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
/* Shutdown PCIe bridge */
pcie->bridge_sw_init_set(pcie, 1);
}
@@ -1302,9 +1639,9 @@ static int brcm_pcie_suspend_noirq(struc
@@ -1298,9 +1635,9 @@ static int brcm_pcie_suspend_noirq(struc
if (brcm_phy_stop(pcie))
dev_err(dev, "Could not stop phy for suspend\n");
@@ -863,7 +863,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
return ret;
}
@@ -1399,7 +1736,7 @@ err_regulator:
@@ -1395,7 +1732,7 @@ err_regulator:
if (pcie->sr)
regulator_bulk_disable(pcie->sr->num_supplies, pcie->sr->supplies);
err_reset:
@@ -872,7 +872,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
err_disable_clk:
clk_disable_unprepare(pcie->clk);
return ret;
@@ -1411,8 +1748,8 @@ static void __brcm_pcie_remove(struct br
@@ -1407,8 +1744,8 @@ static void __brcm_pcie_remove(struct br
brcm_pcie_turn_off(pcie);
if (brcm_phy_stop(pcie))
dev_err(pcie->dev, "Could not stop phy\n");
@@ -883,7 +883,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
clk_disable_unprepare(pcie->clk);
}
@@ -1430,12 +1767,16 @@ static const int pcie_offsets[] = {
@@ -1426,12 +1763,16 @@ static const int pcie_offsets[] = {
[RGR1_SW_INIT_1] = 0x9210,
[EXT_CFG_INDEX] = 0x9000,
[EXT_CFG_DATA] = 0x9004,
@@ -900,7 +900,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
};
static const struct pcie_cfg_data generic_cfg = {
@@ -1443,6 +1784,7 @@ static const struct pcie_cfg_data generi
@@ -1439,6 +1780,7 @@ static const struct pcie_cfg_data generi
.type = GENERIC,
.perst_set = brcm_pcie_perst_set_generic,
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
@@ -908,7 +908,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
};
static const struct pcie_cfg_data bcm7425_cfg = {
@@ -1450,6 +1792,7 @@ static const struct pcie_cfg_data bcm742
@@ -1446,6 +1788,7 @@ static const struct pcie_cfg_data bcm742
.type = BCM7425,
.perst_set = brcm_pcie_perst_set_generic,
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
@@ -916,7 +916,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
};
static const struct pcie_cfg_data bcm7435_cfg = {
@@ -1464,12 +1807,15 @@ static const struct pcie_cfg_data bcm490
@@ -1460,12 +1803,15 @@ static const struct pcie_cfg_data bcm490
.type = BCM4908,
.perst_set = brcm_pcie_perst_set_4908,
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
@@ -932,7 +932,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
};
static const struct pcie_cfg_data bcm7278_cfg = {
@@ -1477,6 +1823,7 @@ static const struct pcie_cfg_data bcm727
@@ -1473,6 +1819,7 @@ static const struct pcie_cfg_data bcm727
.type = BCM7278,
.perst_set = brcm_pcie_perst_set_7278,
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_7278,
@@ -940,7 +940,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
};
static const struct pcie_cfg_data bcm2711_cfg = {
@@ -1484,10 +1831,27 @@ static const struct pcie_cfg_data bcm271
@@ -1480,10 +1827,27 @@ static const struct pcie_cfg_data bcm271
.type = BCM2711,
.perst_set = brcm_pcie_perst_set_generic,
.bridge_sw_init_set = brcm_pcie_bridge_sw_init_set_generic,
@@ -968,7 +968,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
{ .compatible = "brcm,bcm4908-pcie", .data = &bcm4908_cfg },
{ .compatible = "brcm,bcm7211-pcie", .data = &generic_cfg },
{ .compatible = "brcm,bcm7278-pcie", .data = &bcm7278_cfg },
@@ -1528,7 +1892,7 @@ static int brcm_pcie_probe(struct platfo
@@ -1524,7 +1888,7 @@ static int brcm_pcie_probe(struct platfo
data = of_device_get_match_data(&pdev->dev);
if (!data) {
@@ -977,7 +977,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
return -EINVAL;
}
@@ -1539,6 +1903,7 @@ static int brcm_pcie_probe(struct platfo
@@ -1535,6 +1899,7 @@ static int brcm_pcie_probe(struct platfo
pcie->type = data->type;
pcie->perst_set = data->perst_set;
pcie->bridge_sw_init_set = data->bridge_sw_init_set;
@@ -985,7 +985,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
pcie->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(pcie->base))
@@ -1569,14 +1934,20 @@ static int brcm_pcie_probe(struct platfo
@@ -1565,14 +1930,20 @@ static int brcm_pcie_probe(struct platfo
clk_disable_unprepare(pcie->clk);
return PTR_ERR(pcie->perst_reset);
}
@@ -1008,7 +1008,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
clk_disable_unprepare(pcie->clk);
return ret;
}
@@ -1595,8 +1966,38 @@ static int brcm_pcie_probe(struct platfo
@@ -1591,8 +1962,38 @@ static int brcm_pcie_probe(struct platfo
if (pci_msi_enabled()) {
struct device_node *msi_np = of_parse_phandle(pcie->np, "msi-parent", 0);
@@ -1048,7 +1048,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
of_node_put(msi_np);
@@ -1620,6 +2021,8 @@ static int brcm_pcie_probe(struct platfo
@@ -1616,6 +2017,8 @@ static int brcm_pcie_probe(struct platfo
return ret;
}

View File

@@ -12,7 +12,7 @@ Signed-off-by: Liam Fraser <liam@raspberrypi.com>
--- a/drivers/mmc/host/sdhci-of-dwcmshc.c
+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
@@ -343,6 +343,7 @@ static const struct sdhci_ops sdhci_dwcm
@@ -350,6 +350,7 @@ static const struct sdhci_ops sdhci_dwcm
.set_bus_width = sdhci_set_bus_width,
.set_uhs_signaling = dwcmshc_set_uhs_signaling,
.get_max_clock = dwcmshc_get_max_clock,
@@ -20,7 +20,7 @@ Signed-off-by: Liam Fraser <liam@raspberrypi.com>
.reset = sdhci_reset,
.adma_write_desc = dwcmshc_adma_write_desc,
};
@@ -514,6 +515,16 @@ static int dwcmshc_probe(struct platform
@@ -521,6 +522,16 @@ static int dwcmshc_probe(struct platform
clk_prepare_enable(priv->bus_clk);
}
@@ -37,7 +37,7 @@ Signed-off-by: Liam Fraser <liam@raspberrypi.com>
err = mmc_of_parse(host->mmc);
if (err)
goto err_clk;
@@ -578,6 +589,7 @@ err_rpm:
@@ -585,6 +596,7 @@ err_rpm:
pm_runtime_put_noidle(dev);
err_clk:
clk_disable_unprepare(pltfm_host->clk);

View File

@@ -36,7 +36,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
static unsigned int dwcmshc_get_max_clock(struct sdhci_host *host)
{
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -339,7 +351,7 @@ static void rk35xx_sdhci_reset(struct sd
@@ -346,7 +358,7 @@ static void rk35xx_sdhci_reset(struct sd
}
static const struct sdhci_ops sdhci_dwcmshc_ops = {
@@ -45,7 +45,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
.set_bus_width = sdhci_set_bus_width,
.set_uhs_signaling = dwcmshc_set_uhs_signaling,
.get_max_clock = dwcmshc_get_max_clock,
@@ -359,8 +371,10 @@ static const struct sdhci_ops sdhci_dwcm
@@ -366,8 +378,10 @@ static const struct sdhci_ops sdhci_dwcm
static const struct sdhci_pltfm_data sdhci_dwcmshc_pdata = {
.ops = &sdhci_dwcmshc_ops,
@@ -58,7 +58,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
};
#ifdef CONFIG_ACPI
@@ -513,6 +527,14 @@ static int dwcmshc_probe(struct platform
@@ -520,6 +534,14 @@ static int dwcmshc_probe(struct platform
priv->bus_clk = devm_clk_get(dev, "bus");
if (!IS_ERR(priv->bus_clk))
clk_prepare_enable(priv->bus_clk);
@@ -73,7 +73,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
}
pltfm_host->timeout_clk = devm_clk_get(&pdev->dev, "timeout");
@@ -530,6 +552,7 @@ static int dwcmshc_probe(struct platform
@@ -537,6 +559,7 @@ static int dwcmshc_probe(struct platform
goto err_clk;
sdhci_get_of_property(pdev);

View File

@@ -17,7 +17,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
--- a/drivers/i2c/busses/i2c-designware-core.h
+++ b/drivers/i2c/busses/i2c-designware-core.h
@@ -124,7 +124,9 @@
@@ -125,7 +125,9 @@
#define DW_IC_ERR_TX_ABRT 0x1
@@ -29,7 +29,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
#define DW_IC_COMP_PARAM_1_SPEED_MODE_MASK GENMASK(3, 2)
--- a/drivers/i2c/busses/i2c-designware-master.c
+++ b/drivers/i2c/busses/i2c-designware-master.c
@@ -229,6 +229,10 @@ static void i2c_dw_xfer_init(struct dw_i
@@ -236,6 +236,10 @@ static void i2c_dw_xfer_init(struct dw_i
ic_tar = DW_IC_TAR_10BITADDR_MASTER;
}
@@ -40,7 +40,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
regmap_update_bits(dev->map, DW_IC_CON, DW_IC_CON_10BITADDR_MASTER,
ic_con);
@@ -501,6 +505,14 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev)
@@ -508,6 +512,14 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev)
regmap_read(dev->map, DW_IC_RXFLR, &flr);
rx_limit = dev->rx_fifo_depth - flr;
@@ -55,7 +55,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
while (buf_len > 0 && tx_limit > 0 && rx_limit > 0) {
u32 cmd = 0;
@@ -782,7 +794,7 @@ static const struct i2c_algorithm i2c_dw
@@ -789,7 +801,7 @@ static const struct i2c_algorithm i2c_dw
};
static const struct i2c_adapter_quirks i2c_dw_quirks = {
@@ -64,7 +64,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
};
static u32 i2c_dw_read_clear_intrbits(struct dw_i2c_dev *dev)
@@ -915,7 +927,8 @@ void i2c_dw_configure_master(struct dw_i
@@ -922,7 +934,8 @@ void i2c_dw_configure_master(struct dw_i
{
struct i2c_timings *t = &dev->timings;

View File

@@ -53,7 +53,7 @@ Signed-off-by: Dom Cobley <popcornmix@gmail.com>
/* L2 intc private data structure */
struct brcmstb_l2_intc_data {
struct irq_domain *domain;
@@ -288,11 +298,18 @@ static int __init brcmstb_l2_lvl_intc_of
@@ -284,11 +294,18 @@ static int brcmstb_l2_lvl_intc_of_init(s
return brcmstb_l2_intc_of_init(np, parent, &l2_lvl_intc_init);
}

View File

@@ -16,7 +16,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -3439,11 +3439,11 @@ static const struct panel_desc rocktech_
@@ -3440,11 +3440,11 @@ static const struct panel_desc rocktech_
};
static const struct drm_display_mode raspberrypi_7inch_mode = {

View File

@@ -19,7 +19,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -336,6 +336,7 @@ struct brcm_pcie {
@@ -335,6 +335,7 @@ struct brcm_pcie {
struct device_node *np;
bool ssc;
bool l1ss;
@@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
int gen;
u64 msi_target_addr;
struct brcm_msi *msi;
@@ -1196,14 +1197,14 @@ static int brcm_pcie_setup(struct brcm_p
@@ -1195,14 +1196,14 @@ static int brcm_pcie_setup(struct brcm_p
/*
* Set SCB_MAX_BURST_SIZE, CFG_READ_UR_MODE, SCB_ACCESS_EN,
@@ -45,7 +45,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
writel(tmp, base + PCIE_MISC_MISC_CTRL);
brcm_pcie_set_tc_qos(pcie);
@@ -1918,6 +1919,7 @@ static int brcm_pcie_probe(struct platfo
@@ -1914,6 +1915,7 @@ static int brcm_pcie_probe(struct platfo
pcie->ssc = of_property_read_bool(np, "brcm,enable-ssc");
pcie->l1ss = of_property_read_bool(np, "brcm,enable-l1ss");

View File

@@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -140,6 +140,7 @@
@@ -139,6 +139,7 @@
#define PCIE_MISC_HARD_PCIE_HARD_DEBUG pcie->reg_offsets[PCIE_HARD_DEBUG]
#define PCIE_MISC_HARD_PCIE_HARD_DEBUG_CLKREQ_DEBUG_ENABLE_MASK 0x2
@@ -23,7 +23,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
#define PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK 0x08000000
#define PCIE_BMIPS_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK 0x00800000
#define PCIE_MISC_HARD_PCIE_HARD_DEBUG_CLKREQ_L1SS_ENABLE_MASK 0x00200000
@@ -354,6 +355,7 @@ struct brcm_pcie {
@@ -353,6 +354,7 @@ struct brcm_pcie {
bool (*rc_mode)(struct brcm_pcie *pcie);
struct subdev_regulators *sr;
bool ep_wakeup_capable;
@@ -31,7 +31,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
};
static inline bool is_bmips(const struct brcm_pcie *pcie)
@@ -1386,9 +1388,28 @@ static int brcm_pcie_start_link(struct b
@@ -1382,9 +1384,28 @@ static int brcm_pcie_start_link(struct b
u16 nlw, cls, lnksta;
bool ssc_good = false;
int ret, i;
@@ -61,7 +61,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
/*
* Wait for 100ms after PERST# deassertion; see PCIe CEM specification
@@ -1920,6 +1941,7 @@ static int brcm_pcie_probe(struct platfo
@@ -1916,6 +1937,7 @@ static int brcm_pcie_probe(struct platfo
pcie->ssc = of_property_read_bool(np, "brcm,enable-ssc");
pcie->l1ss = of_property_read_bool(np, "brcm,enable-l1ss");
pcie->rcb_mps_mode = of_property_read_bool(np, "brcm,enable-mps-rcb");

View File

@@ -13,7 +13,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/mmc/host/sdhci-of-dwcmshc.c
+++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
@@ -386,6 +386,15 @@ static const struct sdhci_pltfm_data sdh
@@ -393,6 +393,15 @@ static const struct sdhci_pltfm_data sdh
};
#endif
@@ -29,7 +29,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
static const struct sdhci_pltfm_data sdhci_dwcmshc_rk35xx_pdata = {
.ops = &sdhci_dwcmshc_rk35xx_ops,
.quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN |
@@ -454,6 +463,10 @@ static void dwcmshc_rk35xx_postinit(stru
@@ -461,6 +470,10 @@ static void dwcmshc_rk35xx_postinit(stru
static const struct of_device_id sdhci_dwcmshc_dt_ids[] = {
{

View File

@@ -23,7 +23,7 @@ Signed-off-by: Timon Skerutsch <kernel@diodes-delight.com>
/**
* struct panel_desc - Describes a simple panel.
@@ -4904,6 +4905,9 @@ static const struct panel_desc_dsi osd10
@@ -4905,6 +4906,9 @@ static const struct panel_desc_dsi osd10
.lanes = 4,
};
@@ -33,7 +33,7 @@ Signed-off-by: Timon Skerutsch <kernel@diodes-delight.com>
static const struct of_device_id dsi_of_match[] = {
{
.compatible = "auo,b080uan01",
@@ -4927,20 +4931,137 @@ static const struct of_device_id dsi_of_
@@ -4928,20 +4932,137 @@ static const struct of_device_id dsi_of_
.compatible = "osddisplays,osd101t2045-53ts",
.data = &osd101t2045_53ts
}, {

View File

@@ -16,7 +16,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1368,6 +1368,9 @@ static int dwc3_core_init(struct dwc3 *d
@@ -1370,6 +1370,9 @@ static int dwc3_core_init(struct dwc3 *d
if (dwc->parkmode_disable_hs_quirk)
reg |= DWC3_GUCTL1_PARKMODE_DISABLE_HS;
@@ -26,7 +26,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
if (DWC3_VER_IS_WITHIN(DWC3, 290A, ANY) &&
(dwc->maximum_speed == USB_SPEED_HIGH ||
dwc->maximum_speed == USB_SPEED_FULL))
@@ -1635,6 +1638,8 @@ static void dwc3_get_properties(struct d
@@ -1637,6 +1640,8 @@ static void dwc3_get_properties(struct d
"snps,parkmode-disable-ss-quirk");
dwc->parkmode_disable_hs_quirk = device_property_read_bool(dev,
"snps,parkmode-disable-hs-quirk");
@@ -62,7 +62,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
* @tx_de_emphasis_quirk: set if we enable Tx de-emphasis quirk
* @tx_de_emphasis: Tx de-emphasis value
* 0 - -6dB de-emphasis
@@ -1347,6 +1350,7 @@ struct dwc3 {
@@ -1348,6 +1351,7 @@ struct dwc3 {
unsigned ulpi_ext_vbus_drv:1;
unsigned parkmode_disable_ss_quirk:1;
unsigned parkmode_disable_hs_quirk:1;

View File

@@ -59,7 +59,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
--- a/drivers/i2c/busses/i2c-designware-core.h
+++ b/drivers/i2c/busses/i2c-designware-core.h
@@ -292,6 +292,7 @@ struct dw_i2c_dev {
@@ -293,6 +293,7 @@ struct dw_i2c_dev {
u16 fp_lcnt;
u16 hs_hcnt;
u16 hs_lcnt;

View File

@@ -21,7 +21,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -1385,7 +1385,7 @@ static int brcm_pcie_start_link(struct b
@@ -1381,7 +1381,7 @@ static int brcm_pcie_start_link(struct b
{
struct device *dev = pcie->dev;
void __iomem *base = pcie->base;
@@ -30,7 +30,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
bool ssc_good = false;
int ret, i;
u32 tmp;
@@ -1449,6 +1449,16 @@ static int brcm_pcie_start_link(struct b
@@ -1445,6 +1445,16 @@ static int brcm_pcie_start_link(struct b
pci_speed_string(pcie_link_speed[cls]), nlw,
ssc_good ? "(SSC)" : "(!SSC)");

View File

@@ -18,7 +18,7 @@ Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -199,6 +199,9 @@
@@ -198,6 +198,9 @@
#define VDM_PRIORITY_TO_QOS_MAP_MASK 0xf
#define PCIE_MISC_AXI_INTF_CTRL 0x416C
@@ -28,7 +28,7 @@ Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
#define AXI_REQFIFO_EN_QOS_PROPAGATION BIT(7)
#define AXI_BRIDGE_LOW_LATENCY_MODE BIT(6)
#define AXI_MASTER_MAX_OUTSTANDING_REQUESTS_MASK 0x3f
@@ -558,9 +561,11 @@ static void brcm_pcie_set_tc_qos(struct
@@ -557,9 +560,11 @@ static void brcm_pcie_set_tc_qos(struct
if (pcie->type != BCM2712)
return;

View File

@@ -26,7 +26,7 @@ Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
--- a/drivers/pwm/pwm-bcm2835.c
+++ b/drivers/pwm/pwm-bcm2835.c
@@ -147,39 +147,21 @@ static int bcm2835_pwm_probe(struct plat
@@ -125,39 +125,21 @@ static int bcm2835_pwm_probe(struct plat
if (IS_ERR(pc->base))
return PTR_ERR(pc->base);
@@ -70,7 +70,7 @@ Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
}
static const struct of_device_id bcm2835_pwm_of_match[] = {
@@ -194,7 +176,6 @@ static struct platform_driver bcm2835_pw
@@ -172,7 +154,6 @@ static struct platform_driver bcm2835_pw
.of_match_table = bcm2835_pwm_of_match,
},
.probe = bcm2835_pwm_probe,

View File

@@ -26,7 +26,7 @@ Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
};
static inline struct bcm2835_pwm *to_bcm2835_pwm(struct pwm_chip *chip)
@@ -63,17 +64,11 @@ static int bcm2835_pwm_apply(struct pwm_
@@ -40,17 +41,11 @@ static int bcm2835_pwm_apply(struct pwm_
{
struct bcm2835_pwm *pc = to_bcm2835_pwm(chip);
@@ -44,7 +44,7 @@ Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
/*
* period_cycles must be a 32 bit value, so period * rate / NSEC_PER_SEC
* must be <= U32_MAX. As U32_MAX * NSEC_PER_SEC < U64_MAX the
@@ -88,13 +83,13 @@ static int bcm2835_pwm_apply(struct pwm_
@@ -65,13 +60,13 @@ static int bcm2835_pwm_apply(struct pwm_
* <=> period < ((U32_MAX * NSEC_PER_SEC + NSEC_PER_SEC/2) / rate
* <=> period <= ceil((U32_MAX * NSEC_PER_SEC + NSEC_PER_SEC/2) / rate) - 1
*/
@@ -60,7 +60,7 @@ Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
/* don't accept a period that is too small */
if (period_cycles < PERIOD_MIN)
@@ -103,7 +98,7 @@ static int bcm2835_pwm_apply(struct pwm_
@@ -80,7 +75,7 @@ static int bcm2835_pwm_apply(struct pwm_
writel(period_cycles, pc->base + PERIOD(pwm->hwpwm));
/* set duty cycle */
@@ -69,7 +69,7 @@ Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
writel(val, pc->base + DUTY(pwm->hwpwm));
/* set polarity */
@@ -132,6 +127,13 @@ static const struct pwm_ops bcm2835_pwm_
@@ -110,6 +105,13 @@ static const struct pwm_ops bcm2835_pwm_
.owner = THIS_MODULE,
};
@@ -83,7 +83,7 @@ Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
static int bcm2835_pwm_probe(struct platform_device *pdev)
{
struct bcm2835_pwm *pc;
@@ -152,8 +154,26 @@ static int bcm2835_pwm_probe(struct plat
@@ -130,8 +132,26 @@ static int bcm2835_pwm_probe(struct plat
return dev_err_probe(&pdev->dev, PTR_ERR(pc->clk),
"clock not found\n");

View File

@@ -16,7 +16,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -3422,11 +3422,11 @@ static const struct drm_display_mode ras
@@ -3423,11 +3423,11 @@ static const struct drm_display_mode ras
.hdisplay = 800,
.hsync_start = 800 + 59,
.hsync_end = 800 + 59 + 2,

View File

@@ -21,7 +21,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -3418,11 +3418,11 @@ static const struct panel_desc rocktech_
@@ -3419,11 +3419,11 @@ static const struct panel_desc rocktech_
};
static const struct drm_display_mode raspberrypi_7inch_mode = {

View File

@@ -21,7 +21,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -568,6 +568,18 @@ static void brcm_pcie_set_tc_qos(struct
@@ -567,6 +567,18 @@ static void brcm_pcie_set_tc_qos(struct
AXI_DIS_QOS_GATING_IN_MASTER;
writel(reg, pcie->base + PCIE_MISC_AXI_INTF_CTRL);

View File

@@ -22,7 +22,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1362,6 +1362,12 @@ static int dwc3_core_init(struct dwc3 *d
@@ -1364,6 +1364,12 @@ static int dwc3_core_init(struct dwc3 *d
if (dwc->dis_tx_ipgap_linecheck_quirk)
reg |= DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS;
@@ -35,7 +35,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
if (dwc->parkmode_disable_ss_quirk)
reg |= DWC3_GUCTL1_PARKMODE_DISABLE_SS;
@@ -1634,6 +1640,10 @@ static void dwc3_get_properties(struct d
@@ -1636,6 +1642,10 @@ static void dwc3_get_properties(struct d
"snps,resume-hs-terminations");
dwc->ulpi_ext_vbus_drv = device_property_read_bool(dev,
"snps,ulpi-ext-vbus-drv");
@@ -66,7 +66,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
* @parkmode_disable_ss_quirk: If set, disable park mode feature for all
* Superspeed instances.
* @parkmode_disable_hs_quirk: If set, disable park mode feature for all
@@ -1348,6 +1352,8 @@ struct dwc3 {
@@ -1349,6 +1353,8 @@ struct dwc3 {
unsigned dis_tx_ipgap_linecheck_quirk:1;
unsigned resume_hs_terminations:1;
unsigned ulpi_ext_vbus_drv:1;

View File

@@ -28,7 +28,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -507,6 +507,19 @@ void xhci_ring_ep_doorbell(struct xhci_h
@@ -505,6 +505,19 @@ void xhci_ring_ep_doorbell(struct xhci_h
trace_xhci_ring_ep_doorbell(slot_id, DB_VALUE(ep_index, stream_id));

View File

@@ -28,7 +28,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -721,6 +721,14 @@ void xhci_setup_streams_ep_input_ctx(str
@@ -715,6 +715,14 @@ void xhci_setup_streams_ep_input_ctx(str
ep_ctx->ep_info &= cpu_to_le32(~EP_MAXPSTREAMS_MASK);
ep_ctx->ep_info |= cpu_to_le32(EP_MAXPSTREAMS(max_primary_streams)
| EP_HAS_LSA);

View File

@@ -61,10 +61,10 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
}
--- a/drivers/i2c/busses/i2c-designware-core.h
+++ b/drivers/i2c/busses/i2c-designware-core.h
@@ -79,9 +79,12 @@
#define DW_IC_TX_ABRT_SOURCE 0x80
@@ -80,9 +80,12 @@
#define DW_IC_ENABLE_STATUS 0x9c
#define DW_IC_CLR_RESTART_DET 0xa8
#define DW_IC_SMBUS_INTR_MASK 0xcc
+#define DW_IC_SCL_STUCK_AT_LOW_TIMEOUT 0xac
+#define DW_IC_SDA_STUCK_AT_LOW_TIMEOUT 0xb0
#define DW_IC_COMP_PARAM_1 0xf4
@@ -74,7 +74,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
#define DW_IC_COMP_TYPE 0xfc
#define DW_IC_COMP_TYPE_VALUE 0x44570140 /* "DW" + 0x0140 */
@@ -111,6 +114,7 @@
@@ -112,6 +115,7 @@
#define DW_IC_ENABLE_ENABLE BIT(0)
#define DW_IC_ENABLE_ABORT BIT(1)
@@ -82,7 +82,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
#define DW_IC_STATUS_ACTIVITY BIT(0)
#define DW_IC_STATUS_TFE BIT(2)
@@ -118,6 +122,7 @@
@@ -119,6 +123,7 @@
#define DW_IC_STATUS_MASTER_ACTIVITY BIT(5)
#define DW_IC_STATUS_SLAVE_ACTIVITY BIT(6)
#define DW_IC_STATUS_MASTER_HOLD_TX_FIFO_EMPTY BIT(7)
@@ -90,7 +90,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
#define DW_IC_SDA_HOLD_RX_SHIFT 16
#define DW_IC_SDA_HOLD_RX_MASK GENMASK(23, 16)
@@ -165,6 +170,7 @@
@@ -166,6 +171,7 @@
#define ABRT_SLAVE_FLUSH_TXFIFO 13
#define ABRT_SLAVE_ARBLOST 14
#define ABRT_SLAVE_RD_INTX 15
@@ -98,7 +98,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
#define DW_IC_TX_ABRT_7B_ADDR_NOACK BIT(ABRT_7B_ADDR_NOACK)
#define DW_IC_TX_ABRT_10ADDR1_NOACK BIT(ABRT_10ADDR1_NOACK)
@@ -180,6 +186,7 @@
@@ -181,6 +187,7 @@
#define DW_IC_RX_ABRT_SLAVE_RD_INTX BIT(ABRT_SLAVE_RD_INTX)
#define DW_IC_RX_ABRT_SLAVE_ARBLOST BIT(ABRT_SLAVE_ARBLOST)
#define DW_IC_RX_ABRT_SLAVE_FLUSH_TXFIFO BIT(ABRT_SLAVE_FLUSH_TXFIFO)
@@ -116,7 +116,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
int ret;
ret = i2c_dw_acquire_lock(dev);
@@ -238,6 +239,17 @@ static int i2c_dw_init_master(struct dw_
@@ -245,6 +246,17 @@ static int i2c_dw_init_master(struct dw_
regmap_write(dev->map, DW_IC_HS_SCL_LCNT, dev->hs_lcnt);
}
@@ -134,7 +134,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
/* Write SDA hold time if supported */
if (dev->sda_hold_time)
regmap_write(dev->map, DW_IC_SDA_HOLD, dev->sda_hold_time);
@@ -1050,6 +1062,7 @@ int i2c_dw_probe_master(struct dw_i2c_de
@@ -1057,6 +1069,7 @@ int i2c_dw_probe_master(struct dw_i2c_de
struct i2c_adapter *adap = &dev->adapter;
unsigned long irq_flags;
unsigned int ic_con;
@@ -142,7 +142,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
int ret;
init_completion(&dev->cmd_complete);
@@ -1084,7 +1097,11 @@ int i2c_dw_probe_master(struct dw_i2c_de
@@ -1091,7 +1104,11 @@ int i2c_dw_probe_master(struct dw_i2c_de
if (ret)
return ret;

View File

@@ -15,7 +15,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -5027,6 +5027,17 @@ static const struct macb_config versal_c
@@ -5028,6 +5028,17 @@ static const struct macb_config versal_c
.usrio = &macb_default_usrio,
};
@@ -33,7 +33,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
static const struct of_device_id macb_dt_ids[] = {
{ .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
{ .compatible = "cdns,macb" },
@@ -5047,6 +5058,7 @@ static const struct of_device_id macb_dt
@@ -5048,6 +5059,7 @@ static const struct of_device_id macb_dt
{ .compatible = "microchip,mpfs-macb", .data = &mpfs_config },
{ .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config },
{ .compatible = "microchip,sama7g5-emac", .data = &sama7g5_emac_config },

View File

@@ -18,7 +18,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -1970,6 +1970,7 @@ static void nvme_free_host_mem(struct nv
@@ -2008,6 +2008,7 @@ static void nvme_free_host_mem(struct nv
dev->nr_host_mem_descs = 0;
}
@@ -26,7 +26,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
static int __nvme_alloc_host_mem(struct nvme_dev *dev, u64 preferred,
u32 chunk_size)
{
@@ -2038,9 +2039,11 @@ out:
@@ -2076,9 +2077,11 @@ out:
dev->host_mem_descs = NULL;
return -ENOMEM;
}
@@ -38,7 +38,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
u64 min_chunk = min_t(u64, preferred, PAGE_SIZE * MAX_ORDER_NR_PAGES);
u64 hmminds = max_t(u32, dev->ctrl.hmminds * 4096, PAGE_SIZE * 2);
u64 chunk_size;
@@ -2053,6 +2056,7 @@ static int nvme_alloc_host_mem(struct nv
@@ -2091,6 +2094,7 @@ static int nvme_alloc_host_mem(struct nv
nvme_free_host_mem(dev);
}
}

View File

@@ -171,7 +171,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
},
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1224,6 +1224,24 @@ static void dwc3_config_threshold(struct
@@ -1226,6 +1226,24 @@ static void dwc3_config_threshold(struct
}
}
@@ -196,7 +196,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
/**
* dwc3_core_init - Low-level initialization of DWC3 Core
* @dwc: Pointer to our controller context structure
@@ -1289,6 +1307,8 @@ static int dwc3_core_init(struct dwc3 *d
@@ -1291,6 +1309,8 @@ static int dwc3_core_init(struct dwc3 *d
dwc3_set_incr_burst_type(dwc);
@@ -205,7 +205,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
ret = dwc3_phy_power_on(dwc);
if (ret)
goto err_exit_phy;
@@ -1387,6 +1407,24 @@ static int dwc3_core_init(struct dwc3 *d
@@ -1389,6 +1409,24 @@ static int dwc3_core_init(struct dwc3 *d
dwc3_config_threshold(dwc);
@@ -230,7 +230,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
return 0;
err_power_off_phy:
@@ -1530,6 +1568,7 @@ static void dwc3_get_properties(struct d
@@ -1532,6 +1570,7 @@ static void dwc3_get_properties(struct d
u8 tx_thr_num_pkt_prd = 0;
u8 tx_max_burst_prd = 0;
u8 tx_fifo_resize_max_num;
@@ -238,7 +238,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
/* default to highest possible threshold */
lpm_nyet_threshold = 0xf;
@@ -1550,6 +1589,9 @@ static void dwc3_get_properties(struct d
@@ -1552,6 +1591,9 @@ static void dwc3_get_properties(struct d
*/
tx_fifo_resize_max_num = 6;
@@ -248,7 +248,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
dwc->maximum_speed = usb_get_maximum_speed(dev);
dwc->max_ssp_rate = usb_get_maximum_ssp_rate(dev);
dwc->dr_mode = usb_get_dr_mode(dev);
@@ -1670,6 +1712,9 @@ static void dwc3_get_properties(struct d
@@ -1672,6 +1714,9 @@ static void dwc3_get_properties(struct d
dwc->dis_split_quirk = device_property_read_bool(dev,
"snps,dis-split-quirk");
@@ -258,7 +258,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
dwc->lpm_nyet_threshold = lpm_nyet_threshold;
dwc->tx_de_emphasis = tx_de_emphasis;
@@ -1687,6 +1732,8 @@ static void dwc3_get_properties(struct d
@@ -1689,6 +1734,8 @@ static void dwc3_get_properties(struct d
dwc->tx_thr_num_pkt_prd = tx_thr_num_pkt_prd;
dwc->tx_max_burst_prd = tx_max_burst_prd;
@@ -267,7 +267,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
dwc->tx_fifo_resize_max_num = tx_fifo_resize_max_num;
}
@@ -1979,6 +2026,12 @@ static int dwc3_probe(struct platform_de
@@ -1981,6 +2028,12 @@ static int dwc3_probe(struct platform_de
if (IS_ERR(dwc->usb_psy))
return dev_err_probe(dev, PTR_ERR(dwc->usb_psy), "couldn't get usb power supply\n");
@@ -300,7 +300,7 @@ This reverts commit 09dfdf6129532e19b2cfd4992d1d09e7119ccd48.
* @hsphy_interface: "utmi" or "ulpi"
* @connected: true when we're connected to a host, false otherwise
* @softconnect: true when gadget connect is called, false when disconnect runs
@@ -1311,6 +1315,7 @@ struct dwc3 {
@@ -1312,6 +1316,7 @@ struct dwc3 {
u8 tx_max_burst_prd;
u8 tx_fifo_resize_max_num;
u8 clear_stall_protocol;

View File

@@ -19,7 +19,7 @@ Subject: [PATCH 210/210] b44: register adm switch
#include <linux/uaccess.h>
#include <asm/io.h>
@@ -2227,6 +2229,69 @@ static void b44_adjust_link(struct net_d
@@ -2230,6 +2232,69 @@ static void b44_adjust_link(struct net_d
}
}
@@ -89,7 +89,7 @@ Subject: [PATCH 210/210] b44: register adm switch
static int b44_register_phy_one(struct b44 *bp)
{
__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
@@ -2263,6 +2328,9 @@ static int b44_register_phy_one(struct b
@@ -2266,6 +2331,9 @@ static int b44_register_phy_one(struct b
if (!mdiobus_is_registered_device(bp->mii_bus, bp->phy_addr) &&
(sprom->boardflags_lo & (B44_BOARDFLAG_ROBO | B44_BOARDFLAG_ADM))) {
@@ -99,7 +99,7 @@ Subject: [PATCH 210/210] b44: register adm switch
dev_info(sdev->dev,
"could not find PHY at %i, use fixed one\n",
bp->phy_addr);
@@ -2457,6 +2525,7 @@ static void b44_remove_one(struct ssb_de
@@ -2460,6 +2528,7 @@ static void b44_remove_one(struct ssb_de
unregister_netdev(dev);
if (bp->flags & B44_FLAG_EXTERNAL_PHY)
b44_unregister_phy_one(bp);

View File

@@ -43,7 +43,7 @@
if (bp->flags & B44_FLAG_EXTERNAL_PHY)
return 0;
@@ -2157,6 +2182,8 @@ static int b44_get_invariants(struct b44
@@ -2160,6 +2185,8 @@ static int b44_get_invariants(struct b44
* valid PHY address. */
bp->phy_addr &= 0x1F;

View File

@@ -13,7 +13,7 @@ Signed-off-by: Brandon Cheo Fusi <fusibrandon13@gmail.com>
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -104,6 +104,7 @@ static const struct of_device_id allowli
@@ -105,6 +105,7 @@ static const struct of_device_id allowli
*/
static const struct of_device_id blocklist[] __initconst = {
{ .compatible = "allwinner,sun50i-h6", },

View File

@@ -26,7 +26,7 @@ Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com>
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -145,6 +145,29 @@ static inline void __chk_io_ptr(const vo
@@ -158,6 +158,29 @@ static inline void __chk_io_ptr(const vo
#define __has_builtin(x) (0)
#endif

View File

@@ -1,75 +0,0 @@
From 56364c910691f6d10ba88c964c9041b9ab777bd6 Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Mon, 25 Mar 2024 08:40:28 +0100
Subject: [PATCH 1/4] net: Remove conditional threaded-NAPI wakeup based on
task state.
A NAPI thread is scheduled by first setting NAPI_STATE_SCHED bit. If
successful (the bit was not yet set) then the NAPI_STATE_SCHED_THREADED
is set but only if thread's state is not TASK_INTERRUPTIBLE (is
TASK_RUNNING) followed by task wakeup.
If the task is idle (TASK_INTERRUPTIBLE) then the
NAPI_STATE_SCHED_THREADED bit is not set. The thread is no relying on
the bit but always leaving the wait-loop after returning from schedule()
because there must have been a wakeup.
The smpboot-threads implementation for per-CPU threads requires an
explicit condition and does not support "if we get out of schedule()
then there must be something to do".
Removing this optimisation simplifies the following integration.
Set NAPI_STATE_SCHED_THREADED unconditionally on wakeup and rely on it
in the wait path by removing the `woken' condition.
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
net/core/dev.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4526,13 +4526,7 @@ static inline void ____napi_schedule(str
*/
thread = READ_ONCE(napi->thread);
if (thread) {
- /* Avoid doing set_bit() if the thread is in
- * INTERRUPTIBLE state, cause napi_thread_wait()
- * makes sure to proceed with napi polling
- * if the thread is explicitly woken from here.
- */
- if (READ_ONCE(thread->__state) != TASK_INTERRUPTIBLE)
- set_bit(NAPI_STATE_SCHED_THREADED, &napi->state);
+ set_bit(NAPI_STATE_SCHED_THREADED, &napi->state);
wake_up_process(thread);
return;
}
@@ -6688,8 +6682,6 @@ static int napi_poll(struct napi_struct
static int napi_thread_wait(struct napi_struct *napi)
{
- bool woken = false;
-
set_current_state(TASK_INTERRUPTIBLE);
while (!kthread_should_stop()) {
@@ -6698,15 +6690,13 @@ static int napi_thread_wait(struct napi_
* Testing SCHED bit is not enough because SCHED bit might be
* set by some other busy poll thread or by napi_disable().
*/
- if (test_bit(NAPI_STATE_SCHED_THREADED, &napi->state) || woken) {
+ if (test_bit(NAPI_STATE_SCHED_THREADED, &napi->state)) {
WARN_ON(!list_empty(&napi->poll_list));
__set_current_state(TASK_RUNNING);
return 0;
}
schedule();
- /* woken being true indicates this thread owns this napi. */
- woken = true;
set_current_state(TASK_INTERRUPTIBLE);
}
__set_current_state(TASK_RUNNING);

View File

@@ -1,330 +0,0 @@
From dad6b97702639fba27a2bd3e986982ad6f0db3a7 Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Mon, 25 Mar 2024 08:40:29 +0100
Subject: [PATCH 2/4] net: Allow to use SMP threads for backlog NAPI.
Backlog NAPI is a per-CPU NAPI struct only (with no device behind it)
used by drivers which don't do NAPI them self, RPS and parts of the
stack which need to avoid recursive deadlocks while processing a packet.
The non-NAPI driver use the CPU local backlog NAPI. If RPS is enabled
then a flow for the skb is computed and based on the flow the skb can be
enqueued on a remote CPU. Scheduling/ raising the softirq (for backlog's
NAPI) on the remote CPU isn't trivial because the softirq is only
scheduled on the local CPU and performed after the hardirq is done.
In order to schedule a softirq on the remote CPU, an IPI is sent to the
remote CPU which schedules the backlog-NAPI on the then local CPU.
On PREEMPT_RT interrupts are force-threaded. The soft interrupts are
raised within the interrupt thread and processed after the interrupt
handler completed still within the context of the interrupt thread. The
softirq is handled in the context where it originated.
With force-threaded interrupts enabled, ksoftirqd is woken up if a
softirq is raised from hardirq context. This is the case if it is raised
from an IPI. Additionally there is a warning on PREEMPT_RT if the
softirq is raised from the idle thread.
This was done for two reasons:
- With threaded interrupts the processing should happen in thread
context (where it originated) and ksoftirqd is the only thread for
this context if raised from hardirq. Using the currently running task
instead would "punish" a random task.
- Once ksoftirqd is active it consumes all further softirqs until it
stops running. This changed recently and is no longer the case.
Instead of keeping the backlog NAPI in ksoftirqd (in force-threaded/
PREEMPT_RT setups) I am proposing NAPI-threads for backlog.
The "proper" setup with threaded-NAPI is not doable because the threads
are not pinned to an individual CPU and can be modified by the user.
Additionally a dummy network device would have to be assigned. Also
CPU-hotplug has to be considered if additional CPUs show up.
All this can be probably done/ solved but the smpboot-threads already
provide this infrastructure.
Sending UDP packets over loopback expects that the packet is processed
within the call. Delaying it by handing it over to the thread hurts
performance. It is not beneficial to the outcome if the context switch
happens immediately after enqueue or after a while to process a few
packets in a batch.
There is no need to always use the thread if the backlog NAPI is
requested on the local CPU. This restores the loopback throuput. The
performance drops mostly to the same value after enabling RPS on the
loopback comparing the IPI and the tread result.
Create NAPI-threads for backlog if request during boot. The thread runs
the inner loop from napi_threaded_poll(), the wait part is different. It
checks for NAPI_STATE_SCHED (the backlog NAPI can not be disabled).
The NAPI threads for backlog are optional, it has to be enabled via the boot
argument "thread_backlog_napi". It is mandatory for PREEMPT_RT to avoid the
wakeup of ksoftirqd from the IPI.
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
net/core/dev.c | 148 +++++++++++++++++++++++++++++++++++++------------
1 file changed, 113 insertions(+), 35 deletions(-)
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -78,6 +78,7 @@
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/sched/mm.h>
+#include <linux/smpboot.h>
#include <linux/mutex.h>
#include <linux/rwsem.h>
#include <linux/string.h>
@@ -217,6 +218,31 @@ static inline struct hlist_head *dev_ind
return &net->dev_index_head[ifindex & (NETDEV_HASHENTRIES - 1)];
}
+#ifndef CONFIG_PREEMPT_RT
+
+static DEFINE_STATIC_KEY_FALSE(use_backlog_threads_key);
+
+static int __init setup_backlog_napi_threads(char *arg)
+{
+ static_branch_enable(&use_backlog_threads_key);
+ return 0;
+}
+early_param("thread_backlog_napi", setup_backlog_napi_threads);
+
+static bool use_backlog_threads(void)
+{
+ return static_branch_unlikely(&use_backlog_threads_key);
+}
+
+#else
+
+static bool use_backlog_threads(void)
+{
+ return true;
+}
+
+#endif
+
static inline void rps_lock_irqsave(struct softnet_data *sd,
unsigned long *flags)
{
@@ -4494,6 +4520,7 @@ EXPORT_SYMBOL(__dev_direct_xmit);
/*************************************************************************
* Receiver routines
*************************************************************************/
+static DEFINE_PER_CPU(struct task_struct *, backlog_napi);
int netdev_max_backlog __read_mostly = 1000;
EXPORT_SYMBOL(netdev_max_backlog);
@@ -4526,12 +4553,16 @@ static inline void ____napi_schedule(str
*/
thread = READ_ONCE(napi->thread);
if (thread) {
+ if (use_backlog_threads() && thread == raw_cpu_read(backlog_napi))
+ goto use_local_napi;
+
set_bit(NAPI_STATE_SCHED_THREADED, &napi->state);
wake_up_process(thread);
return;
}
}
+use_local_napi:
list_add_tail(&napi->poll_list, &sd->poll_list);
WRITE_ONCE(napi->list_owner, smp_processor_id());
/* If not called from net_rx_action()
@@ -4777,6 +4808,11 @@ static void napi_schedule_rps(struct sof
#ifdef CONFIG_RPS
if (sd != mysd) {
+ if (use_backlog_threads()) {
+ __napi_schedule_irqoff(&sd->backlog);
+ return;
+ }
+
sd->rps_ipi_next = mysd->rps_ipi_list;
mysd->rps_ipi_list = sd;
@@ -6000,7 +6036,7 @@ static void net_rps_action_and_irq_enabl
#ifdef CONFIG_RPS
struct softnet_data *remsd = sd->rps_ipi_list;
- if (remsd) {
+ if (!use_backlog_threads() && remsd) {
sd->rps_ipi_list = NULL;
local_irq_enable();
@@ -6015,7 +6051,7 @@ static void net_rps_action_and_irq_enabl
static bool sd_has_rps_ipi_waiting(struct softnet_data *sd)
{
#ifdef CONFIG_RPS
- return sd->rps_ipi_list != NULL;
+ return !use_backlog_threads() && sd->rps_ipi_list;
#else
return false;
#endif
@@ -6059,7 +6095,7 @@ static int process_backlog(struct napi_s
* We can use a plain write instead of clear_bit(),
* and we dont need an smp_mb() memory barrier.
*/
- napi->state = 0;
+ napi->state &= NAPIF_STATE_THREADED;
again = false;
} else {
skb_queue_splice_tail_init(&sd->input_pkt_queue,
@@ -6725,43 +6761,48 @@ static void skb_defer_free_flush(struct
}
}
-static int napi_threaded_poll(void *data)
+static void napi_threaded_poll_loop(struct napi_struct *napi)
{
- struct napi_struct *napi = data;
struct softnet_data *sd;
- void *have;
+ unsigned long last_qs = jiffies;
- while (!napi_thread_wait(napi)) {
- unsigned long last_qs = jiffies;
+ for (;;) {
+ bool repoll = false;
+ void *have;
- for (;;) {
- bool repoll = false;
+ local_bh_disable();
+ sd = this_cpu_ptr(&softnet_data);
+ sd->in_napi_threaded_poll = true;
- local_bh_disable();
- sd = this_cpu_ptr(&softnet_data);
- sd->in_napi_threaded_poll = true;
-
- have = netpoll_poll_lock(napi);
- __napi_poll(napi, &repoll);
- netpoll_poll_unlock(have);
-
- sd->in_napi_threaded_poll = false;
- barrier();
-
- if (sd_has_rps_ipi_waiting(sd)) {
- local_irq_disable();
- net_rps_action_and_irq_enable(sd);
- }
- skb_defer_free_flush(sd);
- local_bh_enable();
+ have = netpoll_poll_lock(napi);
+ __napi_poll(napi, &repoll);
+ netpoll_poll_unlock(have);
+
+ sd->in_napi_threaded_poll = false;
+ barrier();
+
+ if (sd_has_rps_ipi_waiting(sd)) {
+ local_irq_disable();
+ net_rps_action_and_irq_enable(sd);
+ }
+ skb_defer_free_flush(sd);
+ local_bh_enable();
- if (!repoll)
- break;
+ if (!repoll)
+ break;
- rcu_softirq_qs_periodic(last_qs);
- cond_resched();
- }
+ rcu_softirq_qs_periodic(last_qs);
+ cond_resched();
}
+}
+
+static int napi_threaded_poll(void *data)
+{
+ struct napi_struct *napi = data;
+
+ while (!napi_thread_wait(napi))
+ napi_threaded_poll_loop(napi);
+
return 0;
}
@@ -11346,7 +11387,7 @@ static int dev_cpu_dead(unsigned int old
list_del_init(&napi->poll_list);
if (napi->poll == process_backlog)
- napi->state = 0;
+ napi->state &= NAPIF_STATE_THREADED;
else
____napi_schedule(sd, napi);
}
@@ -11354,12 +11395,14 @@ static int dev_cpu_dead(unsigned int old
raise_softirq_irqoff(NET_TX_SOFTIRQ);
local_irq_enable();
+ if (!use_backlog_threads()) {
#ifdef CONFIG_RPS
- remsd = oldsd->rps_ipi_list;
- oldsd->rps_ipi_list = NULL;
+ remsd = oldsd->rps_ipi_list;
+ oldsd->rps_ipi_list = NULL;
#endif
- /* send out pending IPI's on offline CPU */
- net_rps_send_ipi(remsd);
+ /* send out pending IPI's on offline CPU */
+ net_rps_send_ipi(remsd);
+ }
/* Process offline CPU's input_pkt_queue */
while ((skb = __skb_dequeue(&oldsd->process_queue))) {
@@ -11622,6 +11665,38 @@ static struct pernet_operations __net_in
*
*/
+static int backlog_napi_should_run(unsigned int cpu)
+{
+ struct softnet_data *sd = per_cpu_ptr(&softnet_data, cpu);
+ struct napi_struct *napi = &sd->backlog;
+
+ return test_bit(NAPI_STATE_SCHED_THREADED, &napi->state);
+}
+
+static void run_backlog_napi(unsigned int cpu)
+{
+ struct softnet_data *sd = per_cpu_ptr(&softnet_data, cpu);
+
+ napi_threaded_poll_loop(&sd->backlog);
+}
+
+static void backlog_napi_setup(unsigned int cpu)
+{
+ struct softnet_data *sd = per_cpu_ptr(&softnet_data, cpu);
+ struct napi_struct *napi = &sd->backlog;
+
+ napi->thread = this_cpu_read(backlog_napi);
+ set_bit(NAPI_STATE_THREADED, &napi->state);
+}
+
+static struct smp_hotplug_thread backlog_threads = {
+ .store = &backlog_napi,
+ .thread_should_run = backlog_napi_should_run,
+ .thread_fn = run_backlog_napi,
+ .thread_comm = "backlog_napi/%u",
+ .setup = backlog_napi_setup,
+};
+
/*
* This is called single threaded during boot, so no need
* to take the rtnl semaphore.
@@ -11672,7 +11747,10 @@ static int __init net_dev_init(void)
init_gro_hash(&sd->backlog);
sd->backlog.poll = process_backlog;
sd->backlog.weight = weight_p;
+ INIT_LIST_HEAD(&sd->backlog.poll_list);
}
+ if (use_backlog_threads())
+ smpboot_register_percpu_thread(&backlog_threads);
dev_boot_phase = 0;

View File

@@ -82,7 +82,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
spin_unlock_irq(&sd->input_pkt_queue.lock);
else if (!IS_ENABLED(CONFIG_PREEMPT_RT))
local_irq_enable();
@@ -4827,6 +4827,23 @@ static void napi_schedule_rps(struct sof
@@ -4840,6 +4840,23 @@ static void napi_schedule_rps(struct sof
__napi_schedule_irqoff(&mysd->backlog);
}
@@ -108,7 +108,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
#endif
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -6867,8 +6867,8 @@ nodefer: __kfree_skb(skb);
@@ -6869,8 +6869,8 @@ nodefer: __kfree_skb(skb);
/* Make sure to trigger NET_RX_SOFTIRQ on the remote CPU
* if we are unlucky enough (this seems very unlikely).
*/

View File

@@ -67,7 +67,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
{
if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
spin_unlock_irq(&sd->input_pkt_queue.lock);
@@ -4832,12 +4832,12 @@ void kick_defer_list_purge(struct softne
@@ -4845,12 +4845,12 @@ void kick_defer_list_purge(struct softne
unsigned long flags;
if (use_backlog_threads()) {
@@ -82,7 +82,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
} else if (!cmpxchg(&sd->defer_ipi_scheduled, 0, 1)) {
smp_call_function_single_async(cpu, &sd->defer_csd);
@@ -4899,7 +4899,7 @@ static int enqueue_to_backlog(struct sk_
@@ -4912,7 +4912,7 @@ static int enqueue_to_backlog(struct sk_
reason = SKB_DROP_REASON_NOT_SPECIFIED;
sd = &per_cpu(softnet_data, cpu);
@@ -91,7 +91,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (!netif_running(skb->dev))
goto drop;
qlen = skb_queue_len(&sd->input_pkt_queue);
@@ -4908,7 +4908,7 @@ static int enqueue_to_backlog(struct sk_
@@ -4921,7 +4921,7 @@ static int enqueue_to_backlog(struct sk_
enqueue:
__skb_queue_tail(&sd->input_pkt_queue, skb);
input_queue_tail_incr_save(sd, qtail);
@@ -100,7 +100,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return NET_RX_SUCCESS;
}
@@ -4923,7 +4923,7 @@ enqueue:
@@ -4936,7 +4936,7 @@ enqueue:
drop:
sd->dropped++;
@@ -109,7 +109,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
dev_core_stats_rx_dropped_inc(skb->dev);
kfree_skb_reason(skb, reason);
@@ -5954,7 +5954,7 @@ static void flush_backlog(struct work_st
@@ -5967,7 +5967,7 @@ static void flush_backlog(struct work_st
local_bh_disable();
sd = this_cpu_ptr(&softnet_data);
@@ -118,7 +118,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) {
if (skb->dev->reg_state == NETREG_UNREGISTERING) {
__skb_unlink(skb, &sd->input_pkt_queue);
@@ -5962,7 +5962,7 @@ static void flush_backlog(struct work_st
@@ -5975,7 +5975,7 @@ static void flush_backlog(struct work_st
input_queue_head_incr(sd);
}
}
@@ -127,7 +127,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
skb_queue_walk_safe(&sd->process_queue, skb, tmp) {
if (skb->dev->reg_state == NETREG_UNREGISTERING) {
@@ -5980,14 +5980,14 @@ static bool flush_required(int cpu)
@@ -5993,14 +5993,14 @@ static bool flush_required(int cpu)
struct softnet_data *sd = &per_cpu(softnet_data, cpu);
bool do_flush;
@@ -144,7 +144,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return do_flush;
#endif
@@ -6102,7 +6102,7 @@ static int process_backlog(struct napi_s
@@ -6115,7 +6115,7 @@ static int process_backlog(struct napi_s
}
@@ -153,7 +153,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (skb_queue_empty(&sd->input_pkt_queue)) {
/*
* Inline a custom version of __napi_complete().
@@ -6118,7 +6118,7 @@ static int process_backlog(struct napi_s
@@ -6131,7 +6131,7 @@ static int process_backlog(struct napi_s
skb_queue_splice_tail_init(&sd->input_pkt_queue,
&sd->process_queue);
}

View File

@@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -9808,6 +9808,15 @@ static void netdev_sync_lower_features(s
@@ -9821,6 +9821,15 @@ static void netdev_sync_lower_features(s
}
}
@@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static netdev_features_t netdev_fix_features(struct net_device *dev,
netdev_features_t features)
{
@@ -9889,15 +9898,9 @@ static netdev_features_t netdev_fix_feat
@@ -9902,15 +9911,9 @@ static netdev_features_t netdev_fix_feat
features &= ~NETIF_F_LRO;
}
@@ -55,7 +55,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
if ((features & NETIF_F_HW_TLS_RX) && !(features & NETIF_F_RXCSUM)) {
@@ -9905,6 +9908,11 @@ static netdev_features_t netdev_fix_feat
@@ -9918,6 +9921,11 @@ static netdev_features_t netdev_fix_feat
features &= ~NETIF_F_HW_TLS_RX;
}

View File

@@ -18,7 +18,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -10715,6 +10715,8 @@ struct rtnl_link_stats64 *dev_get_stats(
@@ -10728,6 +10728,8 @@ struct rtnl_link_stats64 *dev_get_stats(
ops->ndo_get_stats64(dev, storage);
} else if (ops->ndo_get_stats) {
netdev_stats_to_stats64(storage, ops->ndo_get_stats(dev));

View File

@@ -162,7 +162,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (pool->p.init_callback)
pool->p.init_callback(page, pool->p.init_arg);
}
@@ -678,7 +686,7 @@ void page_pool_put_page_bulk(struct page
@@ -675,7 +683,7 @@ void page_pool_put_page_bulk(struct page
struct page *page = virt_to_head_page(data[i]);
/* It is not the last user for the page frag case */
@@ -171,7 +171,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
continue;
page = __page_pool_put_page(pool, page, -1, false);
@@ -754,8 +762,7 @@ struct page *page_pool_alloc_frag(struct
@@ -751,8 +759,7 @@ struct page *page_pool_alloc_frag(struct
unsigned int max_size = PAGE_SIZE << pool->p.order;
struct page *page = pool->frag_page;

View File

@@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
unsigned char name_assign_type,
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -10402,25 +10402,12 @@ err_free_name:
@@ -10415,25 +10415,12 @@ err_free_name:
}
EXPORT_SYMBOL(register_netdevice);
@@ -79,7 +79,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* make sure we BUG if trying to hit standard
* register/unregister code path
*/
@@ -10440,12 +10427,32 @@ int init_dummy_netdev(struct net_device
@@ -10453,12 +10440,32 @@ int init_dummy_netdev(struct net_device
* because users of this 'device' dont need to change
* its refcount.
*/
@@ -113,7 +113,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/**
* register_netdev - register a network device
* @dev: device to register
@@ -11039,6 +11046,19 @@ void free_netdev(struct net_device *dev)
@@ -11052,6 +11059,19 @@ void free_netdev(struct net_device *dev)
EXPORT_SYMBOL(free_netdev);
/**

View File

@@ -121,7 +121,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
u32 vsc85xx_csr_read(struct phy_device *phydev,
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1658,20 +1658,22 @@ EXPORT_SYMBOL_GPL(phy_driver_is_genphy_1
@@ -1684,20 +1684,22 @@ EXPORT_SYMBOL_GPL(phy_driver_is_genphy_1
/**
* phy_package_join - join a common PHY group
* @phydev: target phy_device struct
@@ -151,7 +151,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
*
* This will set the shared pointer of the phydev to the shared storage.
* If this is the first call for a this cookie the shared storage will be
@@ -1681,17 +1683,17 @@ EXPORT_SYMBOL_GPL(phy_driver_is_genphy_1
@@ -1707,17 +1709,17 @@ EXPORT_SYMBOL_GPL(phy_driver_is_genphy_1
* Returns < 1 on error, 0 on success. Esp. calling phy_package_join()
* with the same cookie but a different priv_size is an error.
*/
@@ -172,7 +172,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (!shared) {
ret = -ENOMEM;
shared = kzalloc(sizeof(*shared), GFP_KERNEL);
@@ -1703,9 +1705,9 @@ int phy_package_join(struct phy_device *
@@ -1729,9 +1731,9 @@ int phy_package_join(struct phy_device *
goto err_free;
shared->priv_size = priv_size;
}
@@ -184,7 +184,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
} else {
ret = -EINVAL;
if (priv_size && priv_size != shared->priv_size)
@@ -1743,7 +1745,7 @@ void phy_package_leave(struct phy_device
@@ -1769,7 +1771,7 @@ void phy_package_leave(struct phy_device
return;
if (refcount_dec_and_mutex_lock(&shared->refcnt, &bus->shared_lock)) {
@@ -193,7 +193,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
mutex_unlock(&bus->shared_lock);
kfree(shared->priv);
kfree(shared);
@@ -1762,7 +1764,8 @@ static void devm_phy_package_leave(struc
@@ -1788,7 +1790,8 @@ static void devm_phy_package_leave(struc
* devm_phy_package_join - resource managed phy_package_join()
* @dev: device that is registering this PHY package
* @phydev: target phy_device struct
@@ -203,7 +203,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
* @priv_size: if non-zero allocate this amount of bytes for private data
*
* Managed phy_package_join(). Shared storage fetched by this function,
@@ -1770,7 +1773,7 @@ static void devm_phy_package_leave(struc
@@ -1796,7 +1799,7 @@ static void devm_phy_package_leave(struc
* phy_package_join() for more information.
*/
int devm_phy_package_join(struct device *dev, struct phy_device *phydev,
@@ -212,7 +212,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
{
struct phy_device **ptr;
int ret;
@@ -1780,7 +1783,7 @@ int devm_phy_package_join(struct device
@@ -1806,7 +1809,7 @@ int devm_phy_package_join(struct device
if (!ptr)
return -ENOMEM;

View File

@@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1706,6 +1706,7 @@ int phy_package_join(struct phy_device *
@@ -1732,6 +1732,7 @@ int phy_package_join(struct phy_device *
shared->priv_size = priv_size;
}
shared->base_addr = base_addr;
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
refcount_set(&shared->refcnt, 1);
bus->shared[base_addr] = shared;
} else {
@@ -1729,6 +1730,63 @@ err_unlock:
@@ -1755,6 +1756,63 @@ err_unlock:
EXPORT_SYMBOL_GPL(phy_package_join);
/**
@@ -99,7 +99,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
* phy_package_leave - leave a common PHY group
* @phydev: target phy_device struct
*
@@ -1744,6 +1802,10 @@ void phy_package_leave(struct phy_device
@@ -1770,6 +1828,10 @@ void phy_package_leave(struct phy_device
if (!shared)
return;
@@ -110,7 +110,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (refcount_dec_and_mutex_lock(&shared->refcnt, &bus->shared_lock)) {
bus->shared[shared->base_addr] = NULL;
mutex_unlock(&bus->shared_lock);
@@ -1797,6 +1859,40 @@ int devm_phy_package_join(struct device
@@ -1823,6 +1885,40 @@ int devm_phy_package_join(struct device
EXPORT_SYMBOL_GPL(devm_phy_package_join);
/**

View File

@@ -41,7 +41,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -2617,12 +2617,15 @@ EXPORT_SYMBOL(genphy_read_status);
@@ -2645,12 +2645,15 @@ EXPORT_SYMBOL(genphy_read_status);
/**
* genphy_c37_read_status - check the link status and update current link state
* @phydev: target phy_device struct
@@ -58,7 +58,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
{
int lpa, err, old_link = phydev->link;
@@ -2632,9 +2635,13 @@ int genphy_c37_read_status(struct phy_de
@@ -2660,9 +2663,13 @@ int genphy_c37_read_status(struct phy_de
return err;
/* why bother the PHY if nothing can have changed */

View File

@@ -0,0 +1,180 @@
From 0c476157085fe2ad13b9bec70ea672e86647fa1a Mon Sep 17 00:00:00 2001
From: Oleksij Rempel <o.rempel@pengutronix.de>
Date: Tue, 12 Dec 2023 06:41:43 +0100
Subject: [PATCH] net: phy: c45: add genphy_c45_pma_read_ext_abilities()
function
Move part of the genphy_c45_pma_read_abilities() code to a separate
function.
Some PHYs do not implement PMA/PMD status 2 register (Register 1.8) but
do implement PMA/PMD extended ability register (Register 1.11). To make
use of it, we need to be able to access this part of code separately.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20231212054144.87527-2-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
drivers/net/phy/phy-c45.c | 129 ++++++++++++++++++++++----------------
include/linux/phy.h | 1 +
2 files changed, 75 insertions(+), 55 deletions(-)
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -920,6 +920,79 @@ int genphy_c45_pma_baset1_read_abilities
EXPORT_SYMBOL_GPL(genphy_c45_pma_baset1_read_abilities);
/**
+ * genphy_c45_pma_read_ext_abilities - read supported link modes from PMA
+ * @phydev: target phy_device struct
+ *
+ * Read the supported link modes from the PMA/PMD extended ability register
+ * (Register 1.11).
+ */
+int genphy_c45_pma_read_ext_abilities(struct phy_device *phydev)
+{
+ int val;
+
+ val = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_PMA_EXTABLE);
+ if (val < 0)
+ return val;
+
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT,
+ phydev->supported,
+ val & MDIO_PMA_EXTABLE_10GBLRM);
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
+ phydev->supported,
+ val & MDIO_PMA_EXTABLE_10GBT);
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT,
+ phydev->supported,
+ val & MDIO_PMA_EXTABLE_10GBKX4);
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_10000baseKR_Full_BIT,
+ phydev->supported,
+ val & MDIO_PMA_EXTABLE_10GBKR);
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
+ phydev->supported,
+ val & MDIO_PMA_EXTABLE_1000BT);
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseKX_Full_BIT,
+ phydev->supported,
+ val & MDIO_PMA_EXTABLE_1000BKX);
+
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT,
+ phydev->supported,
+ val & MDIO_PMA_EXTABLE_100BTX);
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT,
+ phydev->supported,
+ val & MDIO_PMA_EXTABLE_100BTX);
+
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT,
+ phydev->supported,
+ val & MDIO_PMA_EXTABLE_10BT);
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT,
+ phydev->supported,
+ val & MDIO_PMA_EXTABLE_10BT);
+
+ if (val & MDIO_PMA_EXTABLE_NBT) {
+ val = phy_read_mmd(phydev, MDIO_MMD_PMAPMD,
+ MDIO_PMA_NG_EXTABLE);
+ if (val < 0)
+ return val;
+
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
+ phydev->supported,
+ val & MDIO_PMA_NG_EXTABLE_2_5GBT);
+
+ linkmode_mod_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
+ phydev->supported,
+ val & MDIO_PMA_NG_EXTABLE_5GBT);
+ }
+
+ if (val & MDIO_PMA_EXTABLE_BT1) {
+ val = genphy_c45_pma_baset1_read_abilities(phydev);
+ if (val < 0)
+ return val;
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(genphy_c45_pma_read_ext_abilities);
+
+/**
* genphy_c45_pma_read_abilities - read supported link modes from PMA
* @phydev: target phy_device struct
*
@@ -962,63 +1035,9 @@ int genphy_c45_pma_read_abilities(struct
val & MDIO_PMA_STAT2_10GBER);
if (val & MDIO_PMA_STAT2_EXTABLE) {
- val = phy_read_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_PMA_EXTABLE);
+ val = genphy_c45_pma_read_ext_abilities(phydev);
if (val < 0)
return val;
-
- linkmode_mod_bit(ETHTOOL_LINK_MODE_10000baseLRM_Full_BIT,
- phydev->supported,
- val & MDIO_PMA_EXTABLE_10GBLRM);
- linkmode_mod_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
- phydev->supported,
- val & MDIO_PMA_EXTABLE_10GBT);
- linkmode_mod_bit(ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT,
- phydev->supported,
- val & MDIO_PMA_EXTABLE_10GBKX4);
- linkmode_mod_bit(ETHTOOL_LINK_MODE_10000baseKR_Full_BIT,
- phydev->supported,
- val & MDIO_PMA_EXTABLE_10GBKR);
- linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
- phydev->supported,
- val & MDIO_PMA_EXTABLE_1000BT);
- linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseKX_Full_BIT,
- phydev->supported,
- val & MDIO_PMA_EXTABLE_1000BKX);
-
- linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT,
- phydev->supported,
- val & MDIO_PMA_EXTABLE_100BTX);
- linkmode_mod_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT,
- phydev->supported,
- val & MDIO_PMA_EXTABLE_100BTX);
-
- linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT,
- phydev->supported,
- val & MDIO_PMA_EXTABLE_10BT);
- linkmode_mod_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT,
- phydev->supported,
- val & MDIO_PMA_EXTABLE_10BT);
-
- if (val & MDIO_PMA_EXTABLE_NBT) {
- val = phy_read_mmd(phydev, MDIO_MMD_PMAPMD,
- MDIO_PMA_NG_EXTABLE);
- if (val < 0)
- return val;
-
- linkmode_mod_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
- phydev->supported,
- val & MDIO_PMA_NG_EXTABLE_2_5GBT);
-
- linkmode_mod_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
- phydev->supported,
- val & MDIO_PMA_NG_EXTABLE_5GBT);
- }
-
- if (val & MDIO_PMA_EXTABLE_BT1) {
- val = genphy_c45_pma_baset1_read_abilities(phydev);
- if (val < 0)
- return val;
- }
}
/* This is optional functionality. If not supported, we may get an error
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1861,6 +1861,7 @@ int genphy_c45_an_config_aneg(struct phy
int genphy_c45_an_disable_aneg(struct phy_device *phydev);
int genphy_c45_read_mdix(struct phy_device *phydev);
int genphy_c45_pma_read_abilities(struct phy_device *phydev);
+int genphy_c45_pma_read_ext_abilities(struct phy_device *phydev);
int genphy_c45_pma_baset1_read_abilities(struct phy_device *phydev);
int genphy_c45_read_eee_abilities(struct phy_device *phydev);
int genphy_c45_pma_baset1_read_master_slave(struct phy_device *phydev);

View File

@@ -0,0 +1,47 @@
From 8d878c87b5c45ae64b0aecd4aac71e210d19173f Mon Sep 17 00:00:00 2001
From: Frank Sae <Frank.Sae@motor-comm.com>
Date: Sun, 1 Sep 2024 01:35:25 -0700
Subject: [PATCH] net: phy: Optimize phy speed mask to be compatible to yt8821
yt8521 and yt8531s as Gigabit transceiver use bit15:14(bit9 reserved
default 0) as phy speed mask, yt8821 as 2.5G transceiver uses bit9 bit15:14
as phy speed mask.
Be compatible to yt8821, reform phy speed mask and phy speed macro.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
drivers/net/phy/motorcomm.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
--- a/drivers/net/phy/motorcomm.c
+++ b/drivers/net/phy/motorcomm.c
@@ -46,12 +46,10 @@
/* Specific Status Register */
#define YTPHY_SPECIFIC_STATUS_REG 0x11
-#define YTPHY_SSR_SPEED_MODE_OFFSET 14
-
-#define YTPHY_SSR_SPEED_MODE_MASK (BIT(15) | BIT(14))
-#define YTPHY_SSR_SPEED_10M 0x0
-#define YTPHY_SSR_SPEED_100M 0x1
-#define YTPHY_SSR_SPEED_1000M 0x2
+#define YTPHY_SSR_SPEED_MASK ((0x3 << 14) | BIT(9))
+#define YTPHY_SSR_SPEED_10M ((0x0 << 14))
+#define YTPHY_SSR_SPEED_100M ((0x1 << 14))
+#define YTPHY_SSR_SPEED_1000M ((0x2 << 14))
#define YTPHY_SSR_DUPLEX_OFFSET 13
#define YTPHY_SSR_DUPLEX BIT(13)
#define YTPHY_SSR_PAGE_RECEIVED BIT(12)
@@ -1187,8 +1185,7 @@ static int yt8521_adjust_status(struct p
else
duplex = DUPLEX_FULL; /* for fiber, it always DUPLEX_FULL */
- speed_mode = (status & YTPHY_SSR_SPEED_MODE_MASK) >>
- YTPHY_SSR_SPEED_MODE_OFFSET;
+ speed_mode = status & YTPHY_SSR_SPEED_MASK;
switch (speed_mode) {
case YTPHY_SSR_SPEED_10M:

View File

@@ -0,0 +1,751 @@
From b671105b88c3bb9acc1fb61a3ee2ca0ece60cb8d Mon Sep 17 00:00:00 2001
From: Frank Sae <Frank.Sae@motor-comm.com>
Date: Sun, 1 Sep 2024 01:35:26 -0700
Subject: [PATCH] net: phy: Add driver for Motorcomm yt8821 2.5G ethernet phy
Add a driver for the motorcomm yt8821 2.5G ethernet phy. Verified the
driver on BPI-R3(with MediaTek MT7986(Filogic 830) SoC) development board,
which is developed by Guangdong Bipai Technology Co., Ltd..
yt8821 2.5G ethernet phy works in AUTO_BX2500_SGMII or FORCE_BX2500
interface, supports 2.5G/1000M/100M/10M speeds, and wol(magic package).
Signed-off-by: Frank Sae <Frank.Sae@motor-comm.com>
Reviewed-by: Sai Krishna <saikrishnag@marvell.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
drivers/net/phy/motorcomm.c | 671 +++++++++++++++++++++++++++++++++++-
1 file changed, 667 insertions(+), 4 deletions(-)
--- a/drivers/net/phy/motorcomm.c
+++ b/drivers/net/phy/motorcomm.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0+
/*
- * Motorcomm 8511/8521/8531/8531S PHY driver.
+ * Motorcomm 8511/8521/8531/8531S/8821 PHY driver.
*
* Author: Peter Geis <pgwipeout@gmail.com>
* Author: Frank <Frank.Sae@motor-comm.com>
@@ -16,8 +16,8 @@
#define PHY_ID_YT8521 0x0000011a
#define PHY_ID_YT8531 0x4f51e91b
#define PHY_ID_YT8531S 0x4f51e91a
-
-/* YT8521/YT8531S Register Overview
+#define PHY_ID_YT8821 0x4f51ea19
+/* YT8521/YT8531S/YT8821 Register Overview
* UTP Register space | FIBER Register space
* ------------------------------------------------------------
* | UTP MII | FIBER MII |
@@ -50,6 +50,8 @@
#define YTPHY_SSR_SPEED_10M ((0x0 << 14))
#define YTPHY_SSR_SPEED_100M ((0x1 << 14))
#define YTPHY_SSR_SPEED_1000M ((0x2 << 14))
+#define YTPHY_SSR_SPEED_10G ((0x3 << 14))
+#define YTPHY_SSR_SPEED_2500M ((0x0 << 14) | BIT(9))
#define YTPHY_SSR_DUPLEX_OFFSET 13
#define YTPHY_SSR_DUPLEX BIT(13)
#define YTPHY_SSR_PAGE_RECEIVED BIT(12)
@@ -268,12 +270,89 @@
#define YT8531_SCR_CLK_SRC_REF_25M 4
#define YT8531_SCR_CLK_SRC_SSC_25M 5
+#define YT8821_SDS_EXT_CSR_CTRL_REG 0x23
+#define YT8821_SDS_EXT_CSR_VCO_LDO_EN BIT(15)
+#define YT8821_SDS_EXT_CSR_VCO_BIAS_LPF_EN BIT(8)
+
+#define YT8821_UTP_EXT_PI_CTRL_REG 0x56
+#define YT8821_UTP_EXT_PI_RST_N_FIFO BIT(5)
+#define YT8821_UTP_EXT_PI_TX_CLK_SEL_AFE BIT(4)
+#define YT8821_UTP_EXT_PI_RX_CLK_3_SEL_AFE BIT(3)
+#define YT8821_UTP_EXT_PI_RX_CLK_2_SEL_AFE BIT(2)
+#define YT8821_UTP_EXT_PI_RX_CLK_1_SEL_AFE BIT(1)
+#define YT8821_UTP_EXT_PI_RX_CLK_0_SEL_AFE BIT(0)
+
+#define YT8821_UTP_EXT_VCT_CFG6_CTRL_REG 0x97
+#define YT8821_UTP_EXT_FECHO_AMP_TH_HUGE GENMASK(15, 8)
+
+#define YT8821_UTP_EXT_ECHO_CTRL_REG 0x336
+#define YT8821_UTP_EXT_TRACE_LNG_GAIN_THR_1000 GENMASK(14, 8)
+
+#define YT8821_UTP_EXT_GAIN_CTRL_REG 0x340
+#define YT8821_UTP_EXT_TRACE_MED_GAIN_THR_1000 GENMASK(6, 0)
+
+#define YT8821_UTP_EXT_RPDN_CTRL_REG 0x34E
+#define YT8821_UTP_EXT_RPDN_BP_FFE_LNG_2500 BIT(15)
+#define YT8821_UTP_EXT_RPDN_BP_FFE_SHT_2500 BIT(7)
+#define YT8821_UTP_EXT_RPDN_IPR_SHT_2500 GENMASK(6, 0)
+
+#define YT8821_UTP_EXT_TH_20DB_2500_CTRL_REG 0x36A
+#define YT8821_UTP_EXT_TH_20DB_2500 GENMASK(15, 0)
+
+#define YT8821_UTP_EXT_TRACE_CTRL_REG 0x372
+#define YT8821_UTP_EXT_TRACE_LNG_GAIN_THE_2500 GENMASK(14, 8)
+#define YT8821_UTP_EXT_TRACE_MED_GAIN_THE_2500 GENMASK(6, 0)
+
+#define YT8821_UTP_EXT_ALPHA_IPR_CTRL_REG 0x374
+#define YT8821_UTP_EXT_ALPHA_SHT_2500 GENMASK(14, 8)
+#define YT8821_UTP_EXT_IPR_LNG_2500 GENMASK(6, 0)
+
+#define YT8821_UTP_EXT_PLL_CTRL_REG 0x450
+#define YT8821_UTP_EXT_PLL_SPARE_CFG GENMASK(7, 0)
+
+#define YT8821_UTP_EXT_DAC_IMID_CH_2_3_CTRL_REG 0x466
+#define YT8821_UTP_EXT_DAC_IMID_CH_3_10_ORG GENMASK(14, 8)
+#define YT8821_UTP_EXT_DAC_IMID_CH_2_10_ORG GENMASK(6, 0)
+
+#define YT8821_UTP_EXT_DAC_IMID_CH_0_1_CTRL_REG 0x467
+#define YT8821_UTP_EXT_DAC_IMID_CH_1_10_ORG GENMASK(14, 8)
+#define YT8821_UTP_EXT_DAC_IMID_CH_0_10_ORG GENMASK(6, 0)
+
+#define YT8821_UTP_EXT_DAC_IMSB_CH_2_3_CTRL_REG 0x468
+#define YT8821_UTP_EXT_DAC_IMSB_CH_3_10_ORG GENMASK(14, 8)
+#define YT8821_UTP_EXT_DAC_IMSB_CH_2_10_ORG GENMASK(6, 0)
+
+#define YT8821_UTP_EXT_DAC_IMSB_CH_0_1_CTRL_REG 0x469
+#define YT8821_UTP_EXT_DAC_IMSB_CH_1_10_ORG GENMASK(14, 8)
+#define YT8821_UTP_EXT_DAC_IMSB_CH_0_10_ORG GENMASK(6, 0)
+
+#define YT8821_UTP_EXT_MU_COARSE_FR_CTRL_REG 0x4B3
+#define YT8821_UTP_EXT_MU_COARSE_FR_F_FFE GENMASK(14, 12)
+#define YT8821_UTP_EXT_MU_COARSE_FR_F_FBE GENMASK(10, 8)
+
+#define YT8821_UTP_EXT_MU_FINE_FR_CTRL_REG 0x4B5
+#define YT8821_UTP_EXT_MU_FINE_FR_F_FFE GENMASK(14, 12)
+#define YT8821_UTP_EXT_MU_FINE_FR_F_FBE GENMASK(10, 8)
+
+#define YT8821_UTP_EXT_VGA_LPF1_CAP_CTRL_REG 0x4D2
+#define YT8821_UTP_EXT_VGA_LPF1_CAP_OTHER GENMASK(7, 4)
+#define YT8821_UTP_EXT_VGA_LPF1_CAP_2500 GENMASK(3, 0)
+
+#define YT8821_UTP_EXT_VGA_LPF2_CAP_CTRL_REG 0x4D3
+#define YT8821_UTP_EXT_VGA_LPF2_CAP_OTHER GENMASK(7, 4)
+#define YT8821_UTP_EXT_VGA_LPF2_CAP_2500 GENMASK(3, 0)
+
+#define YT8821_UTP_EXT_TXGE_NFR_FR_THP_CTRL_REG 0x660
+#define YT8821_UTP_EXT_NFR_TX_ABILITY BIT(3)
/* Extended Register end */
#define YTPHY_DTS_OUTPUT_CLK_DIS 0
#define YTPHY_DTS_OUTPUT_CLK_25M 25000000
#define YTPHY_DTS_OUTPUT_CLK_125M 125000000
+#define YT8821_CHIP_MODE_AUTO_BX2500_SGMII 0
+#define YT8821_CHIP_MODE_FORCE_BX2500 1
+
struct yt8521_priv {
/* combo_advertising is used for case of YT8521 in combo mode,
* this means that yt8521 may work in utp or fiber mode which depends
@@ -2249,6 +2328,572 @@ static int yt8521_get_features(struct ph
return ret;
}
+/**
+ * yt8821_get_features - read mmd register to get 2.5G capability
+ * @phydev: target phy_device struct
+ *
+ * Returns: 0 or negative errno code
+ */
+static int yt8821_get_features(struct phy_device *phydev)
+{
+ int ret;
+
+ ret = genphy_c45_pma_read_ext_abilities(phydev);
+ if (ret < 0)
+ return ret;
+
+ return genphy_read_abilities(phydev);
+}
+
+/**
+ * yt8821_get_rate_matching - read register to get phy chip mode
+ * @phydev: target phy_device struct
+ * @iface: PHY data interface type
+ *
+ * Returns: rate matching type or negative errno code
+ */
+static int yt8821_get_rate_matching(struct phy_device *phydev,
+ phy_interface_t iface)
+{
+ int val;
+
+ val = ytphy_read_ext_with_lock(phydev, YT8521_CHIP_CONFIG_REG);
+ if (val < 0)
+ return val;
+
+ if (FIELD_GET(YT8521_CCR_MODE_SEL_MASK, val) ==
+ YT8821_CHIP_MODE_FORCE_BX2500)
+ return RATE_MATCH_PAUSE;
+
+ return RATE_MATCH_NONE;
+}
+
+/**
+ * yt8821_aneg_done() - determines the auto negotiation result
+ * @phydev: a pointer to a &struct phy_device
+ *
+ * Returns: 0(no link)or 1(utp link) or negative errno code
+ */
+static int yt8821_aneg_done(struct phy_device *phydev)
+{
+ return yt8521_aneg_done_paged(phydev, YT8521_RSSR_UTP_SPACE);
+}
+
+/**
+ * yt8821_serdes_init() - serdes init
+ * @phydev: a pointer to a &struct phy_device
+ *
+ * Returns: 0 or negative errno code
+ */
+static int yt8821_serdes_init(struct phy_device *phydev)
+{
+ int old_page;
+ int ret = 0;
+ u16 mask;
+ u16 set;
+
+ old_page = phy_select_page(phydev, YT8521_RSSR_FIBER_SPACE);
+ if (old_page < 0) {
+ phydev_err(phydev, "Failed to select page: %d\n",
+ old_page);
+ goto err_restore_page;
+ }
+
+ ret = __phy_modify(phydev, MII_BMCR, BMCR_ANENABLE, 0);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_SDS_EXT_CSR_VCO_LDO_EN |
+ YT8821_SDS_EXT_CSR_VCO_BIAS_LPF_EN;
+ set = YT8821_SDS_EXT_CSR_VCO_LDO_EN;
+ ret = ytphy_modify_ext(phydev, YT8821_SDS_EXT_CSR_CTRL_REG, mask,
+ set);
+
+err_restore_page:
+ return phy_restore_page(phydev, old_page, ret);
+}
+
+/**
+ * yt8821_utp_init() - utp init
+ * @phydev: a pointer to a &struct phy_device
+ *
+ * Returns: 0 or negative errno code
+ */
+static int yt8821_utp_init(struct phy_device *phydev)
+{
+ int old_page;
+ int ret = 0;
+ u16 mask;
+ u16 save;
+ u16 set;
+
+ old_page = phy_select_page(phydev, YT8521_RSSR_UTP_SPACE);
+ if (old_page < 0) {
+ phydev_err(phydev, "Failed to select page: %d\n",
+ old_page);
+ goto err_restore_page;
+ }
+
+ mask = YT8821_UTP_EXT_RPDN_BP_FFE_LNG_2500 |
+ YT8821_UTP_EXT_RPDN_BP_FFE_SHT_2500 |
+ YT8821_UTP_EXT_RPDN_IPR_SHT_2500;
+ set = YT8821_UTP_EXT_RPDN_BP_FFE_LNG_2500 |
+ YT8821_UTP_EXT_RPDN_BP_FFE_SHT_2500;
+ ret = ytphy_modify_ext(phydev, YT8821_UTP_EXT_RPDN_CTRL_REG,
+ mask, set);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_UTP_EXT_VGA_LPF1_CAP_OTHER |
+ YT8821_UTP_EXT_VGA_LPF1_CAP_2500;
+ ret = ytphy_modify_ext(phydev,
+ YT8821_UTP_EXT_VGA_LPF1_CAP_CTRL_REG,
+ mask, 0);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_UTP_EXT_VGA_LPF2_CAP_OTHER |
+ YT8821_UTP_EXT_VGA_LPF2_CAP_2500;
+ ret = ytphy_modify_ext(phydev,
+ YT8821_UTP_EXT_VGA_LPF2_CAP_CTRL_REG,
+ mask, 0);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_UTP_EXT_TRACE_LNG_GAIN_THE_2500 |
+ YT8821_UTP_EXT_TRACE_MED_GAIN_THE_2500;
+ set = FIELD_PREP(YT8821_UTP_EXT_TRACE_LNG_GAIN_THE_2500, 0x5a) |
+ FIELD_PREP(YT8821_UTP_EXT_TRACE_MED_GAIN_THE_2500, 0x3c);
+ ret = ytphy_modify_ext(phydev, YT8821_UTP_EXT_TRACE_CTRL_REG,
+ mask, set);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_UTP_EXT_IPR_LNG_2500;
+ set = FIELD_PREP(YT8821_UTP_EXT_IPR_LNG_2500, 0x6c);
+ ret = ytphy_modify_ext(phydev,
+ YT8821_UTP_EXT_ALPHA_IPR_CTRL_REG,
+ mask, set);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_UTP_EXT_TRACE_LNG_GAIN_THR_1000;
+ set = FIELD_PREP(YT8821_UTP_EXT_TRACE_LNG_GAIN_THR_1000, 0x2a);
+ ret = ytphy_modify_ext(phydev, YT8821_UTP_EXT_ECHO_CTRL_REG,
+ mask, set);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_UTP_EXT_TRACE_MED_GAIN_THR_1000;
+ set = FIELD_PREP(YT8821_UTP_EXT_TRACE_MED_GAIN_THR_1000, 0x22);
+ ret = ytphy_modify_ext(phydev, YT8821_UTP_EXT_GAIN_CTRL_REG,
+ mask, set);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_UTP_EXT_TH_20DB_2500;
+ set = FIELD_PREP(YT8821_UTP_EXT_TH_20DB_2500, 0x8000);
+ ret = ytphy_modify_ext(phydev,
+ YT8821_UTP_EXT_TH_20DB_2500_CTRL_REG,
+ mask, set);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_UTP_EXT_MU_COARSE_FR_F_FFE |
+ YT8821_UTP_EXT_MU_COARSE_FR_F_FBE;
+ set = FIELD_PREP(YT8821_UTP_EXT_MU_COARSE_FR_F_FFE, 0x7) |
+ FIELD_PREP(YT8821_UTP_EXT_MU_COARSE_FR_F_FBE, 0x7);
+ ret = ytphy_modify_ext(phydev,
+ YT8821_UTP_EXT_MU_COARSE_FR_CTRL_REG,
+ mask, set);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_UTP_EXT_MU_FINE_FR_F_FFE |
+ YT8821_UTP_EXT_MU_FINE_FR_F_FBE;
+ set = FIELD_PREP(YT8821_UTP_EXT_MU_FINE_FR_F_FFE, 0x2) |
+ FIELD_PREP(YT8821_UTP_EXT_MU_FINE_FR_F_FBE, 0x2);
+ ret = ytphy_modify_ext(phydev,
+ YT8821_UTP_EXT_MU_FINE_FR_CTRL_REG,
+ mask, set);
+ if (ret < 0)
+ goto err_restore_page;
+
+ /* save YT8821_UTP_EXT_PI_CTRL_REG's val for use later */
+ ret = ytphy_read_ext(phydev, YT8821_UTP_EXT_PI_CTRL_REG);
+ if (ret < 0)
+ goto err_restore_page;
+
+ save = ret;
+
+ mask = YT8821_UTP_EXT_PI_TX_CLK_SEL_AFE |
+ YT8821_UTP_EXT_PI_RX_CLK_3_SEL_AFE |
+ YT8821_UTP_EXT_PI_RX_CLK_2_SEL_AFE |
+ YT8821_UTP_EXT_PI_RX_CLK_1_SEL_AFE |
+ YT8821_UTP_EXT_PI_RX_CLK_0_SEL_AFE;
+ ret = ytphy_modify_ext(phydev, YT8821_UTP_EXT_PI_CTRL_REG,
+ mask, 0);
+ if (ret < 0)
+ goto err_restore_page;
+
+ /* restore YT8821_UTP_EXT_PI_CTRL_REG's val */
+ ret = ytphy_write_ext(phydev, YT8821_UTP_EXT_PI_CTRL_REG, save);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_UTP_EXT_FECHO_AMP_TH_HUGE;
+ set = FIELD_PREP(YT8821_UTP_EXT_FECHO_AMP_TH_HUGE, 0x38);
+ ret = ytphy_modify_ext(phydev, YT8821_UTP_EXT_VCT_CFG6_CTRL_REG,
+ mask, set);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_UTP_EXT_NFR_TX_ABILITY;
+ set = YT8821_UTP_EXT_NFR_TX_ABILITY;
+ ret = ytphy_modify_ext(phydev,
+ YT8821_UTP_EXT_TXGE_NFR_FR_THP_CTRL_REG,
+ mask, set);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_UTP_EXT_PLL_SPARE_CFG;
+ set = FIELD_PREP(YT8821_UTP_EXT_PLL_SPARE_CFG, 0xe9);
+ ret = ytphy_modify_ext(phydev, YT8821_UTP_EXT_PLL_CTRL_REG,
+ mask, set);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_UTP_EXT_DAC_IMID_CH_3_10_ORG |
+ YT8821_UTP_EXT_DAC_IMID_CH_2_10_ORG;
+ set = FIELD_PREP(YT8821_UTP_EXT_DAC_IMID_CH_3_10_ORG, 0x64) |
+ FIELD_PREP(YT8821_UTP_EXT_DAC_IMID_CH_2_10_ORG, 0x64);
+ ret = ytphy_modify_ext(phydev,
+ YT8821_UTP_EXT_DAC_IMID_CH_2_3_CTRL_REG,
+ mask, set);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_UTP_EXT_DAC_IMID_CH_1_10_ORG |
+ YT8821_UTP_EXT_DAC_IMID_CH_0_10_ORG;
+ set = FIELD_PREP(YT8821_UTP_EXT_DAC_IMID_CH_1_10_ORG, 0x64) |
+ FIELD_PREP(YT8821_UTP_EXT_DAC_IMID_CH_0_10_ORG, 0x64);
+ ret = ytphy_modify_ext(phydev,
+ YT8821_UTP_EXT_DAC_IMID_CH_0_1_CTRL_REG,
+ mask, set);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_UTP_EXT_DAC_IMSB_CH_3_10_ORG |
+ YT8821_UTP_EXT_DAC_IMSB_CH_2_10_ORG;
+ set = FIELD_PREP(YT8821_UTP_EXT_DAC_IMSB_CH_3_10_ORG, 0x64) |
+ FIELD_PREP(YT8821_UTP_EXT_DAC_IMSB_CH_2_10_ORG, 0x64);
+ ret = ytphy_modify_ext(phydev,
+ YT8821_UTP_EXT_DAC_IMSB_CH_2_3_CTRL_REG,
+ mask, set);
+ if (ret < 0)
+ goto err_restore_page;
+
+ mask = YT8821_UTP_EXT_DAC_IMSB_CH_1_10_ORG |
+ YT8821_UTP_EXT_DAC_IMSB_CH_0_10_ORG;
+ set = FIELD_PREP(YT8821_UTP_EXT_DAC_IMSB_CH_1_10_ORG, 0x64) |
+ FIELD_PREP(YT8821_UTP_EXT_DAC_IMSB_CH_0_10_ORG, 0x64);
+ ret = ytphy_modify_ext(phydev,
+ YT8821_UTP_EXT_DAC_IMSB_CH_0_1_CTRL_REG,
+ mask, set);
+
+err_restore_page:
+ return phy_restore_page(phydev, old_page, ret);
+}
+
+/**
+ * yt8821_auto_sleep_config() - phy auto sleep config
+ * @phydev: a pointer to a &struct phy_device
+ * @enable: true enable auto sleep, false disable auto sleep
+ *
+ * Returns: 0 or negative errno code
+ */
+static int yt8821_auto_sleep_config(struct phy_device *phydev,
+ bool enable)
+{
+ int old_page;
+ int ret = 0;
+
+ old_page = phy_select_page(phydev, YT8521_RSSR_UTP_SPACE);
+ if (old_page < 0) {
+ phydev_err(phydev, "Failed to select page: %d\n",
+ old_page);
+ goto err_restore_page;
+ }
+
+ ret = ytphy_modify_ext(phydev,
+ YT8521_EXTREG_SLEEP_CONTROL1_REG,
+ YT8521_ESC1R_SLEEP_SW,
+ enable ? 1 : 0);
+
+err_restore_page:
+ return phy_restore_page(phydev, old_page, ret);
+}
+
+/**
+ * yt8821_soft_reset() - soft reset utp and serdes
+ * @phydev: a pointer to a &struct phy_device
+ *
+ * Returns: 0 or negative errno code
+ */
+static int yt8821_soft_reset(struct phy_device *phydev)
+{
+ return ytphy_modify_ext_with_lock(phydev, YT8521_CHIP_CONFIG_REG,
+ YT8521_CCR_SW_RST, 0);
+}
+
+/**
+ * yt8821_config_init() - phy initializatioin
+ * @phydev: a pointer to a &struct phy_device
+ *
+ * Returns: 0 or negative errno code
+ */
+static int yt8821_config_init(struct phy_device *phydev)
+{
+ u8 mode = YT8821_CHIP_MODE_AUTO_BX2500_SGMII;
+ int ret;
+ u16 set;
+
+ if (phydev->interface == PHY_INTERFACE_MODE_2500BASEX)
+ mode = YT8821_CHIP_MODE_FORCE_BX2500;
+
+ set = FIELD_PREP(YT8521_CCR_MODE_SEL_MASK, mode);
+ ret = ytphy_modify_ext_with_lock(phydev,
+ YT8521_CHIP_CONFIG_REG,
+ YT8521_CCR_MODE_SEL_MASK,
+ set);
+ if (ret < 0)
+ return ret;
+
+ __set_bit(PHY_INTERFACE_MODE_2500BASEX,
+ phydev->possible_interfaces);
+
+ if (mode == YT8821_CHIP_MODE_AUTO_BX2500_SGMII) {
+ __set_bit(PHY_INTERFACE_MODE_SGMII,
+ phydev->possible_interfaces);
+
+ phydev->rate_matching = RATE_MATCH_NONE;
+ } else if (mode == YT8821_CHIP_MODE_FORCE_BX2500) {
+ phydev->rate_matching = RATE_MATCH_PAUSE;
+ }
+
+ ret = yt8821_serdes_init(phydev);
+ if (ret < 0)
+ return ret;
+
+ ret = yt8821_utp_init(phydev);
+ if (ret < 0)
+ return ret;
+
+ /* disable auto sleep */
+ ret = yt8821_auto_sleep_config(phydev, false);
+ if (ret < 0)
+ return ret;
+
+ /* soft reset */
+ return yt8821_soft_reset(phydev);
+}
+
+/**
+ * yt8821_adjust_status() - update speed and duplex to phydev
+ * @phydev: a pointer to a &struct phy_device
+ * @val: read from YTPHY_SPECIFIC_STATUS_REG
+ */
+static void yt8821_adjust_status(struct phy_device *phydev, int val)
+{
+ int speed, duplex;
+ int speed_mode;
+
+ duplex = FIELD_GET(YTPHY_SSR_DUPLEX, val);
+ speed_mode = val & YTPHY_SSR_SPEED_MASK;
+ switch (speed_mode) {
+ case YTPHY_SSR_SPEED_10M:
+ speed = SPEED_10;
+ break;
+ case YTPHY_SSR_SPEED_100M:
+ speed = SPEED_100;
+ break;
+ case YTPHY_SSR_SPEED_1000M:
+ speed = SPEED_1000;
+ break;
+ case YTPHY_SSR_SPEED_2500M:
+ speed = SPEED_2500;
+ break;
+ default:
+ speed = SPEED_UNKNOWN;
+ break;
+ }
+
+ phydev->speed = speed;
+ phydev->duplex = duplex;
+}
+
+/**
+ * yt8821_update_interface() - update interface per current speed
+ * @phydev: a pointer to a &struct phy_device
+ */
+static void yt8821_update_interface(struct phy_device *phydev)
+{
+ if (!phydev->link)
+ return;
+
+ switch (phydev->speed) {
+ case SPEED_2500:
+ phydev->interface = PHY_INTERFACE_MODE_2500BASEX;
+ break;
+ case SPEED_1000:
+ case SPEED_100:
+ case SPEED_10:
+ phydev->interface = PHY_INTERFACE_MODE_SGMII;
+ break;
+ default:
+ phydev_warn(phydev, "phy speed err :%d\n", phydev->speed);
+ break;
+ }
+}
+
+/**
+ * yt8821_read_status() - determines the negotiated speed and duplex
+ * @phydev: a pointer to a &struct phy_device
+ *
+ * Returns: 0 or negative errno code
+ */
+static int yt8821_read_status(struct phy_device *phydev)
+{
+ int link;
+ int ret;
+ int val;
+
+ ret = ytphy_write_ext_with_lock(phydev,
+ YT8521_REG_SPACE_SELECT_REG,
+ YT8521_RSSR_UTP_SPACE);
+ if (ret < 0)
+ return ret;
+
+ ret = genphy_read_status(phydev);
+ if (ret < 0)
+ return ret;
+
+ if (phydev->autoneg_complete) {
+ ret = genphy_c45_read_lpa(phydev);
+ if (ret < 0)
+ return ret;
+ }
+
+ ret = phy_read(phydev, YTPHY_SPECIFIC_STATUS_REG);
+ if (ret < 0)
+ return ret;
+
+ val = ret;
+
+ link = val & YTPHY_SSR_LINK;
+ if (link)
+ yt8821_adjust_status(phydev, val);
+
+ if (link) {
+ if (phydev->link == 0)
+ phydev_dbg(phydev,
+ "%s, phy addr: %d, link up\n",
+ __func__, phydev->mdio.addr);
+ phydev->link = 1;
+ } else {
+ if (phydev->link == 1)
+ phydev_dbg(phydev,
+ "%s, phy addr: %d, link down\n",
+ __func__, phydev->mdio.addr);
+ phydev->link = 0;
+ }
+
+ val = ytphy_read_ext_with_lock(phydev, YT8521_CHIP_CONFIG_REG);
+ if (val < 0)
+ return val;
+
+ if (FIELD_GET(YT8521_CCR_MODE_SEL_MASK, val) ==
+ YT8821_CHIP_MODE_AUTO_BX2500_SGMII)
+ yt8821_update_interface(phydev);
+
+ return 0;
+}
+
+/**
+ * yt8821_modify_utp_fiber_bmcr - bits modify a PHY's BMCR register
+ * @phydev: the phy_device struct
+ * @mask: bit mask of bits to clear
+ * @set: bit mask of bits to set
+ *
+ * NOTE: Convenience function which allows a PHY's BMCR register to be
+ * modified as new register value = (old register value & ~mask) | set.
+ *
+ * Returns: 0 or negative errno code
+ */
+static int yt8821_modify_utp_fiber_bmcr(struct phy_device *phydev,
+ u16 mask, u16 set)
+{
+ int ret;
+
+ ret = yt8521_modify_bmcr_paged(phydev, YT8521_RSSR_UTP_SPACE,
+ mask, set);
+ if (ret < 0)
+ return ret;
+
+ return yt8521_modify_bmcr_paged(phydev, YT8521_RSSR_FIBER_SPACE,
+ mask, set);
+}
+
+/**
+ * yt8821_suspend() - suspend the hardware
+ * @phydev: a pointer to a &struct phy_device
+ *
+ * Returns: 0 or negative errno code
+ */
+static int yt8821_suspend(struct phy_device *phydev)
+{
+ int wol_config;
+
+ wol_config = ytphy_read_ext_with_lock(phydev,
+ YTPHY_WOL_CONFIG_REG);
+ if (wol_config < 0)
+ return wol_config;
+
+ /* if wol enable, do nothing */
+ if (wol_config & YTPHY_WCR_ENABLE)
+ return 0;
+
+ return yt8821_modify_utp_fiber_bmcr(phydev, 0, BMCR_PDOWN);
+}
+
+/**
+ * yt8821_resume() - resume the hardware
+ * @phydev: a pointer to a &struct phy_device
+ *
+ * Returns: 0 or negative errno code
+ */
+static int yt8821_resume(struct phy_device *phydev)
+{
+ int wol_config;
+ int ret;
+
+ /* disable auto sleep */
+ ret = yt8821_auto_sleep_config(phydev, false);
+ if (ret < 0)
+ return ret;
+
+ wol_config = ytphy_read_ext_with_lock(phydev,
+ YTPHY_WOL_CONFIG_REG);
+ if (wol_config < 0)
+ return wol_config;
+
+ /* if wol enable, do nothing */
+ if (wol_config & YTPHY_WCR_ENABLE)
+ return 0;
+
+ return yt8821_modify_utp_fiber_bmcr(phydev, BMCR_PDOWN, 0);
+}
+
static struct phy_driver motorcomm_phy_drvs[] = {
{
PHY_ID_MATCH_EXACT(PHY_ID_YT8511),
@@ -2304,11 +2949,28 @@ static struct phy_driver motorcomm_phy_d
.suspend = yt8521_suspend,
.resume = yt8521_resume,
},
+ {
+ PHY_ID_MATCH_EXACT(PHY_ID_YT8821),
+ .name = "YT8821 2.5Gbps PHY",
+ .get_features = yt8821_get_features,
+ .read_page = yt8521_read_page,
+ .write_page = yt8521_write_page,
+ .get_wol = ytphy_get_wol,
+ .set_wol = ytphy_set_wol,
+ .config_aneg = genphy_config_aneg,
+ .aneg_done = yt8821_aneg_done,
+ .config_init = yt8821_config_init,
+ .get_rate_matching = yt8821_get_rate_matching,
+ .read_status = yt8821_read_status,
+ .soft_reset = yt8821_soft_reset,
+ .suspend = yt8821_suspend,
+ .resume = yt8821_resume,
+ },
};
module_phy_driver(motorcomm_phy_drvs);
-MODULE_DESCRIPTION("Motorcomm 8511/8521/8531/8531S PHY driver");
+MODULE_DESCRIPTION("Motorcomm 8511/8521/8531/8531S/8821 PHY driver");
MODULE_AUTHOR("Peter Geis");
MODULE_AUTHOR("Frank");
MODULE_LICENSE("GPL");
@@ -2318,6 +2980,7 @@ static const struct mdio_device_id __may
{ PHY_ID_MATCH_EXACT(PHY_ID_YT8521) },
{ PHY_ID_MATCH_EXACT(PHY_ID_YT8531) },
{ PHY_ID_MATCH_EXACT(PHY_ID_YT8531S) },
+ { PHY_ID_MATCH_EXACT(PHY_ID_YT8821) },
{ /* sentinel */ }
};

View File

@@ -85,7 +85,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/**
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6655,7 +6655,7 @@ static int __napi_poll(struct napi_struc
@@ -6668,7 +6668,7 @@ static int __napi_poll(struct napi_struc
* accidentally calling ->poll() when NAPI is not scheduled.
*/
work = 0;

View File

@@ -46,7 +46,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2994,13 +2994,25 @@ static void stmmac_tx_timer_arm(struct s
@@ -2995,13 +2995,25 @@ static void stmmac_tx_timer_arm(struct s
{
struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue];
u32 tx_coal_timer = priv->tx_coal_timer[queue];

View File

@@ -18,7 +18,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2542,9 +2542,13 @@ static void stmmac_bump_dma_threshold(st
@@ -2543,9 +2543,13 @@ static void stmmac_bump_dma_threshold(st
* @priv: driver private structure
* @budget: napi budget limiting this functions packet handling
* @queue: TX queue index
@@ -33,7 +33,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
{
struct stmmac_tx_queue *tx_q = &priv->dma_conf.tx_queue[queue];
struct stmmac_txq_stats *txq_stats = &priv->xstats.txq_stats[queue];
@@ -2704,7 +2708,7 @@ static int stmmac_tx_clean(struct stmmac
@@ -2705,7 +2709,7 @@ static int stmmac_tx_clean(struct stmmac
/* We still have pending packets, let's call for a new scheduling */
if (tx_q->dirty_tx != tx_q->cur_tx)
@@ -42,7 +42,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
u64_stats_update_begin(&txq_stats->napi_syncp);
u64_stats_add(&txq_stats->napi.tx_packets, tx_packets);
@@ -5609,6 +5613,7 @@ static int stmmac_napi_poll_tx(struct na
@@ -5622,6 +5626,7 @@ static int stmmac_napi_poll_tx(struct na
container_of(napi, struct stmmac_channel, tx_napi);
struct stmmac_priv *priv = ch->priv_data;
struct stmmac_txq_stats *txq_stats;
@@ -50,7 +50,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
u32 chan = ch->index;
int work_done;
@@ -5617,7 +5622,7 @@ static int stmmac_napi_poll_tx(struct na
@@ -5630,7 +5635,7 @@ static int stmmac_napi_poll_tx(struct na
u64_stats_inc(&txq_stats->napi.poll);
u64_stats_update_end(&txq_stats->napi_syncp);
@@ -59,7 +59,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
work_done = min(work_done, budget);
if (work_done < budget && napi_complete_done(napi, work_done)) {
@@ -5628,6 +5633,10 @@ static int stmmac_napi_poll_tx(struct na
@@ -5641,6 +5646,10 @@ static int stmmac_napi_poll_tx(struct na
spin_unlock_irqrestore(&ch->lock, flags);
}
@@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return work_done;
}
@@ -5636,6 +5645,7 @@ static int stmmac_napi_poll_rxtx(struct
@@ -5649,6 +5658,7 @@ static int stmmac_napi_poll_rxtx(struct
struct stmmac_channel *ch =
container_of(napi, struct stmmac_channel, rxtx_napi);
struct stmmac_priv *priv = ch->priv_data;
@@ -78,7 +78,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
int rx_done, tx_done, rxtx_done;
struct stmmac_rxq_stats *rxq_stats;
struct stmmac_txq_stats *txq_stats;
@@ -5651,7 +5661,7 @@ static int stmmac_napi_poll_rxtx(struct
@@ -5664,7 +5674,7 @@ static int stmmac_napi_poll_rxtx(struct
u64_stats_inc(&txq_stats->napi.poll);
u64_stats_update_end(&txq_stats->napi_syncp);
@@ -87,7 +87,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tx_done = min(tx_done, budget);
rx_done = stmmac_rx_zc(priv, budget, chan);
@@ -5676,6 +5686,10 @@ static int stmmac_napi_poll_rxtx(struct
@@ -5689,6 +5699,10 @@ static int stmmac_napi_poll_rxtx(struct
spin_unlock_irqrestore(&ch->lock, flags);
}

View File

@@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -3156,6 +3156,33 @@ static void rtl_hw_start_8168g_2(struct
@@ -3153,6 +3153,33 @@ static void rtl_hw_start_8168g_2(struct
rtl_ephy_init(tp, e_info_8168g_2);
}
@@ -52,7 +52,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void rtl_hw_start_8411_2(struct rtl8169_private *tp)
{
static const struct ephy_info e_info_8411_2[] = {
@@ -3189,117 +3216,7 @@ static void rtl_hw_start_8411_2(struct r
@@ -3186,117 +3213,7 @@ static void rtl_hw_start_8411_2(struct r
mdelay(3);
r8168_mac_ocp_write(tp, 0xFC26, 0x0000);

View File

@@ -35,7 +35,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
#define TX_DMA_BURST 7 /* Maximum PCI burst, '7' is unlimited */
#define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */
@@ -2653,8 +2649,7 @@ static void rtl_set_rx_mode(struct net_d
@@ -2650,8 +2646,7 @@ static void rtl_set_rx_mode(struct net_d
rx_mode |= AcceptAllPhys;
} else if (!(dev->flags & IFF_MULTICAST)) {
rx_mode &= ~AcceptMulticast;

View File

@@ -29,7 +29,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
set_bit(flag, tp->wk.flags);
schedule_work(&tp->wk.work);
}
@@ -4526,8 +4529,7 @@ static void rtl_task(struct work_struct
@@ -4523,8 +4526,7 @@ static void rtl_task(struct work_struct
rtnl_lock();

View File

@@ -296,7 +296,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void r8168fp_adjust_ocp_cmd(struct rtl8169_private *tp, u32 *cmd, int type)
{
/* based on RTL8168FP_OOBMAC_BASE in vendor driver */
@@ -5205,6 +5263,7 @@ static int rtl_init_one(struct pci_dev *
@@ -5202,6 +5260,7 @@ static int rtl_init_one(struct pci_dev *
raw_spin_lock_init(&tp->cfg9346_usage_lock);
raw_spin_lock_init(&tp->config25_lock);
raw_spin_lock_init(&tp->mac_ocp_lock);
@@ -304,7 +304,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
dev->tstats = devm_netdev_alloc_pcpu_stats(&pdev->dev,
struct pcpu_sw_netstats);
@@ -5361,6 +5420,12 @@ static int rtl_init_one(struct pci_dev *
@@ -5358,6 +5417,12 @@ static int rtl_init_one(struct pci_dev *
if (rc)
return rc;

View File

@@ -59,7 +59,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
obj-$(CONFIG_R8169) += r8169.o
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5420,11 +5420,10 @@ static int rtl_init_one(struct pci_dev *
@@ -5417,11 +5417,10 @@ static int rtl_init_one(struct pci_dev *
if (rc)
return rc;

View File

@@ -75,7 +75,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
genphy_soft_reset(tp->phydev);
}
@@ -5122,7 +5097,9 @@ static int r8169_mdio_register(struct rt
@@ -5119,7 +5094,9 @@ static int r8169_mdio_register(struct rt
}
tp->phydev->mac_managed_pm = true;
@@ -86,7 +86,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
phy_support_asym_pause(tp->phydev);
/* PHY will be woken up in rtl_open() */
@@ -5257,7 +5234,6 @@ static int rtl_init_one(struct pci_dev *
@@ -5254,7 +5231,6 @@ static int rtl_init_one(struct pci_dev *
tp->dev = dev;
tp->pci_dev = pdev;
tp->supports_gmii = ent->driver_data == RTL_CFG_NO_GBIT ? 0 : 1;

View File

@@ -128,7 +128,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
RTL_W8(tp, ChipCmd, RTL_R8(tp, ChipCmd) | StopReq);
rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond, 100, 42);
rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond_2, 100, 42);
@@ -2822,7 +2833,7 @@ static void rtl_enable_exit_l1(struct rt
@@ -2819,7 +2830,7 @@ static void rtl_enable_exit_l1(struct rt
case RTL_GIGA_MAC_VER_37 ... RTL_GIGA_MAC_VER_38:
rtl_eri_set_bits(tp, 0xd4, 0x0c00);
break;
@@ -137,7 +137,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
r8168_mac_ocp_modify(tp, 0xc0ac, 0, 0x1f80);
break;
default:
@@ -2836,7 +2847,7 @@ static void rtl_disable_exit_l1(struct r
@@ -2833,7 +2844,7 @@ static void rtl_disable_exit_l1(struct r
case RTL_GIGA_MAC_VER_34 ... RTL_GIGA_MAC_VER_38:
rtl_eri_clear_bits(tp, 0xd4, 0x1f00);
break;
@@ -146,7 +146,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
r8168_mac_ocp_modify(tp, 0xc0ac, 0x1f80, 0);
break;
default:
@@ -2846,6 +2857,8 @@ static void rtl_disable_exit_l1(struct r
@@ -2843,6 +2854,8 @@ static void rtl_disable_exit_l1(struct r
static void rtl_hw_aspm_clkreq_enable(struct rtl8169_private *tp, bool enable)
{
@@ -155,7 +155,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (tp->mac_version < RTL_GIGA_MAC_VER_32)
return;
@@ -2859,11 +2872,19 @@ static void rtl_hw_aspm_clkreq_enable(st
@@ -2856,11 +2869,19 @@ static void rtl_hw_aspm_clkreq_enable(st
return;
rtl_mod_config5(tp, 0, ASPM_en);
@@ -177,7 +177,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
/* reset ephy tx/rx disable timer */
r8168_mac_ocp_modify(tp, 0xe094, 0xff00, 0);
/* chip can trigger L1.2 */
@@ -2875,14 +2896,22 @@ static void rtl_hw_aspm_clkreq_enable(st
@@ -2872,14 +2893,22 @@ static void rtl_hw_aspm_clkreq_enable(st
} else {
switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_46 ... RTL_GIGA_MAC_VER_48:
@@ -202,7 +202,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
rtl_mod_config5(tp, ASPM_en, 0);
}
}
@@ -3595,10 +3624,15 @@ static void rtl_hw_start_8125_common(str
@@ -3592,10 +3621,15 @@ static void rtl_hw_start_8125_common(str
/* disable new tx descriptor format */
r8168_mac_ocp_modify(tp, 0xeb58, 0x0001, 0x0000);
@@ -220,7 +220,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
if (tp->mac_version == RTL_GIGA_MAC_VER_63)
r8168_mac_ocp_modify(tp, 0xe63e, 0x0c30, 0x0000);
@@ -3611,6 +3645,10 @@ static void rtl_hw_start_8125_common(str
@@ -3608,6 +3642,10 @@ static void rtl_hw_start_8125_common(str
r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0000);
r8168_mac_ocp_modify(tp, 0xe040, 0x1000, 0x0000);
r8168_mac_ocp_modify(tp, 0xea1c, 0x0003, 0x0001);
@@ -231,7 +231,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
r8168_mac_ocp_modify(tp, 0xe0c0, 0x4f0f, 0x4403);
r8168_mac_ocp_modify(tp, 0xe052, 0x0080, 0x0068);
r8168_mac_ocp_modify(tp, 0xd430, 0x0fff, 0x047f);
@@ -3625,10 +3663,10 @@ static void rtl_hw_start_8125_common(str
@@ -3622,10 +3660,10 @@ static void rtl_hw_start_8125_common(str
rtl_loop_wait_low(tp, &rtl_mac_ocp_e00e_cond, 1000, 10);
@@ -245,7 +245,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
rtl_disable_rxdvgate(tp);
}
@@ -3672,6 +3710,12 @@ static void rtl_hw_start_8125b(struct rt
@@ -3669,6 +3707,12 @@ static void rtl_hw_start_8125b(struct rt
rtl_hw_start_8125_common(tp);
}
@@ -258,7 +258,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
static void rtl_hw_config(struct rtl8169_private *tp)
{
static const rtl_generic_fct hw_configs[] = {
@@ -3714,6 +3758,7 @@ static void rtl_hw_config(struct rtl8169
@@ -3711,6 +3755,7 @@ static void rtl_hw_config(struct rtl8169
[RTL_GIGA_MAC_VER_53] = rtl_hw_start_8117,
[RTL_GIGA_MAC_VER_61] = rtl_hw_start_8125a_2,
[RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b,
@@ -266,7 +266,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
};
if (hw_configs[tp->mac_version])
@@ -3724,9 +3769,23 @@ static void rtl_hw_start_8125(struct rtl
@@ -3721,9 +3766,23 @@ static void rtl_hw_start_8125(struct rtl
{
int i;
@@ -292,7 +292,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
rtl_hw_config(tp);
}
@@ -3804,8 +3863,7 @@ static int rtl8169_change_mtu(struct net
@@ -3801,8 +3860,7 @@ static int rtl8169_change_mtu(struct net
rtl_jumbo_config(tp);
switch (tp->mac_version) {
@@ -302,7 +302,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
rtl8125_set_eee_txidle_timer(tp);
break;
default:
@@ -3954,7 +4012,7 @@ static void rtl8169_cleanup(struct rtl81
@@ -3951,7 +4009,7 @@ static void rtl8169_cleanup(struct rtl81
RTL_W8(tp, ChipCmd, RTL_R8(tp, ChipCmd) | StopReq);
rtl_loop_wait_high(tp, &rtl_txcfg_empty_cond, 100, 666);
break;
@@ -311,7 +311,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
rtl_enable_rxdvgate(tp);
fsleep(2000);
break;
@@ -4111,8 +4169,7 @@ static unsigned int rtl_quirk_packet_pad
@@ -4108,8 +4166,7 @@ static unsigned int rtl_quirk_packet_pad
switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_34:
@@ -321,7 +321,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
padto = max_t(unsigned int, padto, ETH_ZLEN);
break;
default:
@@ -5149,7 +5206,7 @@ static void rtl_hw_initialize(struct rtl
@@ -5146,7 +5203,7 @@ static void rtl_hw_initialize(struct rtl
case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_48:
rtl_hw_init_8168g(tp);
break;

View File

@@ -16,7 +16,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5298,11 +5298,6 @@ static int rtl_init_one(struct pci_dev *
@@ -5295,11 +5295,6 @@ static int rtl_init_one(struct pci_dev *
raw_spin_lock_init(&tp->mac_ocp_lock);
mutex_init(&tp->led_lock);
@@ -28,7 +28,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* Get the *optional* external "ether_clk" used on some boards */
tp->clk = devm_clk_get_optional_enabled(&pdev->dev, "ether_clk");
if (IS_ERR(tp->clk))
@@ -5417,6 +5412,8 @@ static int rtl_init_one(struct pci_dev *
@@ -5414,6 +5409,8 @@ static int rtl_init_one(struct pci_dev *
dev->hw_features |= NETIF_F_RXALL;
dev->hw_features |= NETIF_F_RXFCS;

View File

@@ -225,7 +225,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
void r8169_get_led_name(struct rtl8169_private *tp, int idx,
char *buf, int buf_len)
{
@@ -5450,10 +5501,12 @@ static int rtl_init_one(struct pci_dev *
@@ -5447,10 +5498,12 @@ static int rtl_init_one(struct pci_dev *
if (rc)
return rc;

View File

@@ -64,7 +64,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8168_mac_ocp_modify(tp, 0xe040, 0, BIT(1) | BIT(0));
}
@@ -3879,6 +3890,8 @@ static void rtl_hw_start(struct rtl8169
@@ -3876,6 +3887,8 @@ static void rtl_hw_start(struct rtl8169
rtl_hw_aspm_clkreq_enable(tp, false);
RTL_W16(tp, CPlusCmd, tp->cp_cmd);
@@ -73,7 +73,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (tp->mac_version <= RTL_GIGA_MAC_VER_06)
rtl_hw_start_8169(tp);
else if (rtl_is_8125(tp))
@@ -3912,14 +3925,7 @@ static int rtl8169_change_mtu(struct net
@@ -3909,14 +3922,7 @@ static int rtl8169_change_mtu(struct net
dev->mtu = new_mtu;
netdev_update_features(dev);
rtl_jumbo_config(tp);

View File

@@ -124,7 +124,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
u32 ocp_base;
};
@@ -5076,6 +5078,8 @@ static void rtl_remove_one(struct pci_de
@@ -5073,6 +5075,8 @@ static void rtl_remove_one(struct pci_de
cancel_work_sync(&tp->wk.work);
@@ -133,7 +133,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
unregister_netdev(tp->dev);
if (tp->dash_type != RTL_DASH_NONE)
@@ -5535,9 +5539,9 @@ static int rtl_init_one(struct pci_dev *
@@ -5532,9 +5536,9 @@ static int rtl_init_one(struct pci_dev *
if (IS_ENABLED(CONFIG_R8169_LEDS)) {
if (rtl_is_8125(tp))

View File

@@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5078,7 +5078,8 @@ static void rtl_remove_one(struct pci_de
@@ -5075,7 +5075,8 @@ static void rtl_remove_one(struct pci_de
cancel_work_sync(&tp->wk.work);

View File

@@ -49,7 +49,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
}
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -3952,7 +3952,7 @@ static int rtl8169_change_mtu(struct net
@@ -3949,7 +3949,7 @@ static int rtl8169_change_mtu(struct net
{
struct rtl8169_private *tp = netdev_priv(dev);

View File

@@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5119,12 +5119,10 @@ static void rtl_set_irq_mask(struct rtl8
@@ -5116,12 +5116,10 @@ static void rtl_set_irq_mask(struct rtl8
tp->irq_mask = RxOK | RxErr | TxOK | TxErr | LinkChg;
if (tp->mac_version <= RTL_GIGA_MAC_VER_06)

View File

@@ -113,7 +113,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
RTL_W8(tp, ChipCmd, RTL_R8(tp, ChipCmd) | StopReq);
rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond, 100, 42);
rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond_2, 100, 42);
@@ -2927,7 +2932,7 @@ static void rtl_enable_exit_l1(struct rt
@@ -2924,7 +2929,7 @@ static void rtl_enable_exit_l1(struct rt
case RTL_GIGA_MAC_VER_37 ... RTL_GIGA_MAC_VER_38:
rtl_eri_set_bits(tp, 0xd4, 0x0c00);
break;
@@ -122,7 +122,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8168_mac_ocp_modify(tp, 0xc0ac, 0, 0x1f80);
break;
default:
@@ -2941,7 +2946,7 @@ static void rtl_disable_exit_l1(struct r
@@ -2938,7 +2943,7 @@ static void rtl_disable_exit_l1(struct r
case RTL_GIGA_MAC_VER_34 ... RTL_GIGA_MAC_VER_38:
rtl_eri_clear_bits(tp, 0xd4, 0x1f00);
break;
@@ -131,7 +131,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8168_mac_ocp_modify(tp, 0xc0ac, 0x1f80, 0);
break;
default:
@@ -2968,6 +2973,7 @@ static void rtl_hw_aspm_clkreq_enable(st
@@ -2965,6 +2970,7 @@ static void rtl_hw_aspm_clkreq_enable(st
rtl_mod_config5(tp, 0, ASPM_en);
switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_65:
@@ -139,7 +139,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
val8 = RTL_R8(tp, INT_CFG0_8125) | INT_CFG0_CLKREQEN;
RTL_W8(tp, INT_CFG0_8125, val8);
break;
@@ -2978,7 +2984,7 @@ static void rtl_hw_aspm_clkreq_enable(st
@@ -2975,7 +2981,7 @@ static void rtl_hw_aspm_clkreq_enable(st
switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_46 ... RTL_GIGA_MAC_VER_48:
@@ -148,7 +148,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* reset ephy tx/rx disable timer */
r8168_mac_ocp_modify(tp, 0xe094, 0xff00, 0);
/* chip can trigger L1.2 */
@@ -2990,7 +2996,7 @@ static void rtl_hw_aspm_clkreq_enable(st
@@ -2987,7 +2993,7 @@ static void rtl_hw_aspm_clkreq_enable(st
} else {
switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_46 ... RTL_GIGA_MAC_VER_48:
@@ -157,7 +157,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8168_mac_ocp_modify(tp, 0xe092, 0x00ff, 0);
break;
default:
@@ -2999,6 +3005,7 @@ static void rtl_hw_aspm_clkreq_enable(st
@@ -2996,6 +3002,7 @@ static void rtl_hw_aspm_clkreq_enable(st
switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_65:
@@ -165,7 +165,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
val8 = RTL_R8(tp, INT_CFG0_8125) & ~INT_CFG0_CLKREQEN;
RTL_W8(tp, INT_CFG0_8125, val8);
break;
@@ -3718,10 +3725,12 @@ static void rtl_hw_start_8125_common(str
@@ -3715,10 +3722,12 @@ static void rtl_hw_start_8125_common(str
/* disable new tx descriptor format */
r8168_mac_ocp_modify(tp, 0xeb58, 0x0001, 0x0000);
@@ -180,7 +180,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0400);
else if (tp->mac_version == RTL_GIGA_MAC_VER_63)
r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0200);
@@ -3739,7 +3748,8 @@ static void rtl_hw_start_8125_common(str
@@ -3736,7 +3745,8 @@ static void rtl_hw_start_8125_common(str
r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0000);
r8168_mac_ocp_modify(tp, 0xe040, 0x1000, 0x0000);
r8168_mac_ocp_modify(tp, 0xea1c, 0x0003, 0x0001);
@@ -190,7 +190,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
r8168_mac_ocp_modify(tp, 0xea1c, 0x0300, 0x0000);
else
r8168_mac_ocp_modify(tp, 0xea1c, 0x0004, 0x0000);
@@ -3853,6 +3863,7 @@ static void rtl_hw_config(struct rtl8169
@@ -3850,6 +3860,7 @@ static void rtl_hw_config(struct rtl8169
[RTL_GIGA_MAC_VER_61] = rtl_hw_start_8125a_2,
[RTL_GIGA_MAC_VER_63] = rtl_hw_start_8125b,
[RTL_GIGA_MAC_VER_65] = rtl_hw_start_8126a,
@@ -198,7 +198,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
};
if (hw_configs[tp->mac_version])
@@ -3873,6 +3884,7 @@ static void rtl_hw_start_8125(struct rtl
@@ -3870,6 +3881,7 @@ static void rtl_hw_start_8125(struct rtl
break;
case RTL_GIGA_MAC_VER_63:
case RTL_GIGA_MAC_VER_65:
@@ -206,7 +206,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
for (i = 0xa00; i < 0xa80; i += 4)
RTL_W32(tp, i, 0);
RTL_W16(tp, INT_CFG1_8125, 0x0000);
@@ -4101,7 +4113,7 @@ static void rtl8169_cleanup(struct rtl81
@@ -4098,7 +4110,7 @@ static void rtl8169_cleanup(struct rtl81
RTL_W8(tp, ChipCmd, RTL_R8(tp, ChipCmd) | StopReq);
rtl_loop_wait_high(tp, &rtl_txcfg_empty_cond, 100, 666);
break;
@@ -215,7 +215,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
rtl_enable_rxdvgate(tp);
fsleep(2000);
break;
@@ -4258,7 +4270,7 @@ static unsigned int rtl_quirk_packet_pad
@@ -4255,7 +4267,7 @@ static unsigned int rtl_quirk_packet_pad
switch (tp->mac_version) {
case RTL_GIGA_MAC_VER_34:
@@ -224,7 +224,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
padto = max_t(unsigned int, padto, ETH_ZLEN);
break;
default:
@@ -5296,7 +5308,7 @@ static void rtl_hw_initialize(struct rtl
@@ -5293,7 +5305,7 @@ static void rtl_hw_initialize(struct rtl
case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_48:
rtl_hw_init_8168g(tp);
break;

View File

@@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4778,11 +4778,7 @@ static void r8169_phylink_handler(struct
@@ -4775,11 +4775,7 @@ static void r8169_phylink_handler(struct
if (netif_carrier_ok(ndev)) {
rtl_link_chg_patch(tp);
pm_request_resume(d);

Some files were not shown because too many files have changed in this diff Show More