Skip to content

Commit

Permalink
Merge remote-tracking branch 'op/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
breeze303 committed Apr 7, 2024
2 parents 10597dd + 449b570 commit cffe6aa
Show file tree
Hide file tree
Showing 30 changed files with 186 additions and 28 deletions.
2 changes: 1 addition & 1 deletion package/boot/apex/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/linusw/apex.git
PKG_SOURCE_VERSION:=483e18aa133d5e25866570c29b124530b2d1e0d3
PKG_MIRROR_HASH:=42230bb436f5590447ca55e8befb8927e6ea74c1e6953c043bbbef986c411704
PKG_MIRROR_HASH:=75e0be55e779a6c1f582bf12f5f98ac175404be9172750c1c1015ad78aa8aa3d

PKG_TARGETS:=bin
PKG_FLAGS:=nonshared
Expand Down
2 changes: 1 addition & 1 deletion package/boot/arm-trusted-firmware-bcm63xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/bcm63xx/atf.git
PKG_SOURCE_DATE:=2021-12-24
PKG_SOURCE_VERSION:=e6d46baf3fae79f693f90bf34f7284c3dfc64aef
PKG_MIRROR_HASH:=9d5d04f572b1b6ddc6eb3064b9cb09f5fe982e82d350790041d35316349af124
PKG_MIRROR_HASH:=5646abc01152210a8181455151f01145001d61b3fb09619b1cee48008e36b0fa

PKG_MAINTAINER:=Rafał Miłecki <rafal@milecki.pl>

Expand Down
2 changes: 1 addition & 1 deletion package/boot/arm-trusted-firmware-mediatek/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/mtk-openwrt/arm-trusted-firmware.git
PKG_SOURCE_DATE:=2023-10-13
PKG_SOURCE_VERSION:=0ea67d76ae8be127c91caa3fcdf449b1fe533175
PKG_MIRROR_HASH:=ad538e7304f8fae280491104b2128d9b7626c5da49216149a25921905590cb62
PKG_MIRROR_HASH:=22579fae08de942e0d5a420cfaa0b1d310dc9431e85b7e28a3c3ef08331a199d

PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>

Expand Down
2 changes: 1 addition & 1 deletion package/boot/at91bootstrap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=at91bootstrap
PKG_VERSION:=v4.0.3
PKG_MIRROR_HASH:=1ecdc31a13350fcdcaa3f77ed8ad73906f79fc668dbb2f337e1d5dd877bf9882
PKG_MIRROR_HASH:=9c1d42337294b549e6c229ae4c9996efd21e00ae5f968bd780d352e054e24cb7
PKG_SOURCE_VERSION:=1d9e673698d9db4a4f2301559f481274de2e75ae
BINARIES_DIR:=build/binaries
PKG_CPE_ID:=cpe:/a:linux4sam:at91bootstrap
Expand Down
2 changes: 1 addition & 1 deletion package/boot/opensbi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/riscv/opensbi
PKG_SOURCE_DATE:=2022-12-24
PKG_SOURCE_VERSION:=6b5188ca14e59ce7bf71afe4e7d3d557c3d31bf8
PKG_MIRROR_HASH:=72096b51297b0fa9375500dab2e85e42fe32127b041dee073ecd14eb13906465
PKG_MIRROR_HASH:=5939a3225cb37c1dde0b5b9f28f9980c0712533676774ae244d6d84bb09a1439

PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)

Expand Down
2 changes: 1 addition & 1 deletion package/boot/rkbin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/rockchip-linux/rkbin.git
PKG_SOURCE_DATE:=2023-07-26
PKG_SOURCE_VERSION:=b4558da0860ca48bf1a571dd33ccba580b9abe23
PKG_MIRROR_HASH:=8c6259c64ee53f596ac15dbedd0541ca9af40cdf3951d40f030ea00b94379009
PKG_MIRROR_HASH:=7cd2cb8357fa850eb4eef94db49a2c46cf910bfe4e673eff9071413bb002afc9

PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
Expand Down
2 changes: 1 addition & 1 deletion package/boot/tfa-layerscape/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/nxp-qoriq/atf
PKG_SOURCE_VERSION:=lf-6.1.1-1.0.0
PKG_MIRROR_HASH:=c0e3c7d0cc9ee5f9ae68cd705ce7f07f714c4fe3fd4a5a79de5699e7865b759f
PKG_MIRROR_HASH:=e109ca87a0f432529ab4d1fcd019adc0cd0d3684c96cdf770aac113f9bbe4bd6
PKG_BUILD_DEPENDS:=tfa-layerscape/host

include $(INCLUDE_DIR)/host-build.mk
Expand Down
2 changes: 1 addition & 1 deletion package/boot/uboot-at91/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PKG_RELEASE:=3

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/linux4sam/u-boot-at91.git
PKG_MIRROR_HASH:=56bbac45f71aaf39b365661db2a76c6c8415e27f7147b27bb58312b12756c8f3
PKG_MIRROR_HASH:=82229503800d9a624bb8de5f8d7a84cb35fd512a1550c6f1d46958cd47d4807b
PKG_SOURCE_VERSION:=7b59654a486d39dc8e0343e2554699b8a79c7a54

include $(INCLUDE_DIR)/u-boot.mk
Expand Down
2 changes: 1 addition & 1 deletion package/boot/uboot-bcm4908/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://git.openwrt.org/project/bcm63xx/u-boot.git
PKG_SOURCE_DATE:=2022-12-08
PKG_SOURCE_VERSION:=4435700d18a791dca0d8d767e5414dfac9df4451
PKG_MIRROR_HASH:=a05c13451cd311f3b32c734cfc341e76007c8c6ed1eeb27aee7b0651609b7be3
PKG_MIRROR_HASH:=80de483c11938cca9fdd0f35931cce1921c8166d9c1c146da56bf155394842cb

include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
Expand Down
2 changes: 1 addition & 1 deletion package/boot/uboot-fritz4040/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PKG_SOURCE_URL:=https://github.com/chunkeey/FritzBox-4040-UBOOT
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=9d89013f9cc963eca25856c61fa066091d35f8de
PKG_SOURCE_DATE:=2022-05-01
PKG_MIRROR_HASH:=7c60ca967b607c9b43f54dd75e6126f63935e21e330bbf80f07d210889bb6c2d
PKG_MIRROR_HASH:=4e8106a7877ae6aa8da44bf95401b860d11f7d51417cc5a61ce59a353d4ee866

PKG_RELEASE:=5

Expand Down
2 changes: 1 addition & 1 deletion package/boot/uboot-layerscape/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/nxp-qoriq/u-boot
PKG_SOURCE_VERSION:=lf-6.1.1-1.0.0
PKG_MIRROR_HASH:=f4a3a262fd8923af72dede0348a512c05b756e3925279553eaf1c6667b186fb4
PKG_MIRROR_HASH:=6cb3cd569f11f582375eb3af475a2a0d77fe602813337b64883ef01344be7bf6

include $(INCLUDE_DIR)/u-boot.mk
include $(INCLUDE_DIR)/package.mk
Expand Down
2 changes: 1 addition & 1 deletion package/firmware/layerscape/fman-ucode/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/nxp-qoriq/qoriq-fm-ucode
PKG_SOURCE_VERSION:=lf-6.1.1-1.0.0
PKG_MIRROR_HASH:=3614200837945460374570a48822a3efb96a64b93724e7f973e61008baeccf3a
PKG_MIRROR_HASH:=d69792e0b03f2fd00cb9d69325d9817b43fb14dd1b27e41018b3ea69b25c55a5

PKG_FLAGS:=nonshared

Expand Down
2 changes: 1 addition & 1 deletion package/firmware/layerscape/ls-ddr-phy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/NXP/ddr-phy-binary.git
PKG_SOURCE_VERSION:=LSDK-21.08
PKG_MIRROR_HASH:=0fb35c697f4b4274577cce63223198f5c7715164a2c5d09a55c46ef17639ed4b
PKG_MIRROR_HASH:=2f9bf4f6b2410e436e4e606f981c71919b1896e4da4f204de483d9f7677a064d
PKG_BUILD_DEPENDS:=tfa-layerscape/host

PKG_LICENSE:=EULA
Expand Down
2 changes: 1 addition & 1 deletion package/firmware/layerscape/ls-dpl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/nxp-qoriq/mc-utils
PKG_SOURCE_VERSION:=mc_release_10.38.0
PKG_MIRROR_HASH:=c5032ad73a04cf7fa23a2afeee85108677e665871a6c48ca352f415eea9b6390
PKG_MIRROR_HASH:=9ada83ac4cc259cdf2ea2ebfc2328292f7dace701bfac2b5514749bd9f8315f0

PKG_FLAGS:=nonshared

Expand Down
2 changes: 1 addition & 1 deletion package/firmware/layerscape/ls-mc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/NXP/qoriq-mc-binary.git
PKG_SOURCE_VERSION:=mc_release_10.38.0
PKG_MIRROR_HASH:=b4482690246f9bd6a8728c482fd391ccf9b25a104b02f08add6e5c5d43a5ad75
PKG_MIRROR_HASH:=4bd0eab4b600d6dee67b4c5b32624a92fd84e6c93f506e46a4fe52217e2d1593

PKG_FLAGS:=nonshared

Expand Down
2 changes: 1 addition & 1 deletion package/firmware/layerscape/ls-rcw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/nxp-qoriq/rcw
PKG_SOURCE_VERSION:=lf-6.1.1-1.0.0
PKG_MIRROR_HASH:=3127285549a0a7dd3cded20c2fbfb67b06943faa8dab529f61936dc1bea177db
PKG_MIRROR_HASH:=6d505c1a60046a79c91b69cd6e26a2ef3515d7cb2999bdc9defcb664a1a5aef9

PKG_FLAGS:=nonshared

Expand Down
2 changes: 1 addition & 1 deletion package/firmware/layerscape/ppfe-firmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/nxp-qoriq/qoriq-engine-pfe-bin
PKG_SOURCE_VERSION:=lf-6.1.1-1.0.0
PKG_MIRROR_HASH:=eb1e3efe08980e70594060c84c1620a1dde53e00e96bae63d15dceb236c0bfa8
PKG_MIRROR_HASH:=59f5660f1b93314e3e073053195719eab7361f07d1a9e02896f9356b1a615873

PKG_FLAGS:=nonshared

Expand Down
2 changes: 1 addition & 1 deletion package/kernel/bcm63xx-cfe/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PKG_SOURCE_URL:=https://github.com/openwrt/bcm63xx-cfe.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2021-06-22
PKG_SOURCE_VERSION:=e5050f37150b34deb547b50feccd0e7439cb5bd7
PKG_MIRROR_HASH:=a3e255903e398aa5627ab3a4b5fb2576f07e130a236e74f19d8b9830fe0d58f0
PKG_MIRROR_HASH:=3b53abf21790e42707e20c73aff23fc32db9fdaf010da6f459a20a9e8f8feae6

PKG_FLAGS:=nonshared

Expand Down
2 changes: 1 addition & 1 deletion package/kernel/lantiq/ltq-vectoring/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://gitlab.com/prpl-foundation/intel/ppa_drv.git
PKG_SOURCE_DATE:=2019-05-20
PKG_SOURCE_VERSION:=4fa7ac30fcc8ec4eddae9debba5f4230981f469f
PKG_MIRROR_HASH:=444eb823dd9ddd25453976bf7a3230955e4148b8bf92f35f165ecffee32c4555
PKG_MIRROR_HASH:=53ae72a929db598202a4e9c3df43b65fa0778cd165c1ec2ddf9361993795b930
PKG_LICENSE:=GPL-2.0 BSD-2-Clause

MAKE_PATH:=src/vectoring
Expand Down
2 changes: 1 addition & 1 deletion package/kernel/mwlwifi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2023-11-29
PKG_SOURCE_VERSION:=ebf3167445f108346dcff9a31a708534c0bd7cc5
PKG_MIRROR_HASH:=402ca0023f03c631b1dcefb15345cdc0eb92a3359912bc0ee46e06f0c9ebbac1
PKG_MIRROR_HASH:=6dffc08208305366b9c25133b74693d5c2e544c1076b7b4ed846628c66be56c1

PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
PKG_BUILD_PARALLEL:=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,19 @@ function iface_start(wdev)
wdev_config.macaddr = phydev.macaddr_next();
wdev_create(phy, ifname, wdev_config);
wdev_set_up(ifname, true);
let htmode = wdev.htmode || "NOHT";
if (wdev.freq)
system(`iw dev ${ifname} set freq ${wdev.freq} ${wdev.htmode}`);
system(`iw dev ${ifname} set freq ${wdev.freq} ${htmode}`);
if (wdev.mode == "adhoc") {
let cmd = ["iw", "dev", ifname, "ibss", "join", wdev.ssid, wdev.freq, wdev.htmode, "fixed-freq" ];
let cmd = ["iw", "dev", ifname, "ibss", "join", wdev.ssid, wdev.freq, htmode, "fixed-freq" ];
if (wdev.bssid)
push(cmd, wdev.bssid);
for (let key in [ "beacon-interval", "basic-rates", "mcast-rate", "keys" ])
if (wdev[key])
push(cmd, key, wdev[key]);
system(cmd);
} else if (wdev.mode == "mesh") {
let cmd = [ "iw", "dev", ifname, "mesh", "join", wdev.ssid, "freq", wdev.freq, wdev.htmode ];
let cmd = [ "iw", "dev", ifname, "mesh", "join", wdev.ssid, "freq", wdev.freq, htmode ];
for (let key in [ "mcast-rate", "beacon-interval" ])
if (wdev[key])
push(cmd, key, wdev[key]);
Expand Down
2 changes: 1 addition & 1 deletion package/network/utils/layerscape/restool/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ PKG_RELEASE:=4
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/nxp-qoriq/restool
PKG_SOURCE_VERSION:=LSDK-21.08
PKG_MIRROR_HASH:=0396644927b8f3da20183227562f695c8063d3d4c6bb606e8f31dda450e962e4
PKG_MIRROR_HASH:=3c289e6c9adc2c61445473ecd8b1b1a7b6dfd19a66d3c65f3b83b669e4c3e25b

PKG_FLAGS:=nonshared

Expand Down
2 changes: 1 addition & 1 deletion package/system/gpio-cdev/nu801/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/chunkeey/nu801.git
PKG_SOURCE_VERSION:=f623879a393d0315f29095fe46b19cd2246d10d7
PKG_MIRROR_HASH:=d2080fa74901fcd9c2576784adaa84792b577167576a45326b478192cb157eba
PKG_MIRROR_HASH:=8bf2de78e078b7305178577530ff51e7373f94d39629653ea7efc8e485d0fdbd
PKG_MAINTAINER:=Christian Lamparter <chunkeey@gmail.com>
PKG_LICENSE:=GPL-3.0-or-later
PKG_LICENSE_FILES:=LICENSE
Expand Down
2 changes: 1 addition & 1 deletion package/utils/bcm27xx-utils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/raspberrypi/utils.git
PKG_SOURCE_VERSION:=e65f5ec102e74218cda7da9fdc8b1caa0fd1127d
PKG_MIRROR_HASH:=14f4aa1a8115240d702251bc399b53cbfa0928813f70a73ca27b22da94b696d2
PKG_MIRROR_HASH:=ea946fc4a86875c5d1efc35b2bc80f6b5482afc3d1ea13853b69abc2b4a2eee6

PKG_FLAGS:=nonshared
PKG_BUILD_FLAGS:=no-lto
Expand Down
2 changes: 1 addition & 1 deletion package/utils/debugcc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/linux-msm/debugcc.git
PKG_SOURCE_DATE:=2023-11-10
PKG_SOURCE_VERSION:=d15bea7c05f224a85dd1fcec24b0f153dbad9f6e
PKG_MIRROR_HASH:=b6bd181db4992cf429343cd7d0fdde0f937a8f1811f5fe9e7855a0d76b0d88a0
PKG_MIRROR_HASH:=4cd7a770a05db28f496a60eb9fe015a4af677bba05053b4d4be21adcf95e52e5

PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
Expand Down
2 changes: 1 addition & 1 deletion package/utils/firmware-utils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git
PKG_SOURCE_DATE:=2024-03-23
PKG_SOURCE_VERSION:=6b242991a995c41769977efb010dc9f4e4ec3da2
PKG_MIRROR_HASH:=f8d84868487ec51ea4119fb5a48a181025ca272d8eb5b714068d0eec8db88d87
PKG_MIRROR_HASH:=00ff2661fda2eb299ccbfaa07dff8fbcf46b3441a6e9f6f46eaa119e66dbe142

PKG_BUILD_DEPENDS:=openssl zlib

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From 6a4aee277740d04ac0fd54cfa17cc28261932ddc Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Mon, 25 Mar 2024 20:06:19 +0100
Subject: [PATCH] net: phy: qcom: at803x: fix kernel panic with at8031_probe

On reworking and splitting the at803x driver, in splitting function of
at803x PHYs it was added a NULL dereference bug where priv is referenced
before it's actually allocated and then is tried to write to for the
is_1000basex and is_fiber variables in the case of at8031, writing on
the wrong address.

Fix this by correctly setting priv local variable only after
at803x_probe is called and actually allocates priv in the phydev struct.

Reported-by: William Wortel <wwortel@dorpstraat.com>
Cc: <stable@vger.kernel.org>
Fixes: 25d2ba94005f ("net: phy: at803x: move specific at8031 probe mode check to dedicated probe")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20240325190621.2665-1-ansuelsmth@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
drivers/net/phy/qcom/at803x.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/net/phy/qcom/at803x.c
+++ b/drivers/net/phy/qcom/at803x.c
@@ -797,7 +797,7 @@ static int at8031_parse_dt(struct phy_de

static int at8031_probe(struct phy_device *phydev)
{
- struct at803x_priv *priv = phydev->priv;
+ struct at803x_priv *priv;
int mode_cfg;
int ccr;
int ret;
@@ -806,6 +806,8 @@ static int at8031_probe(struct phy_devic
if (ret)
return ret;

+ priv = phydev->priv;
+
/* Only supported on AR8031/AR8033, the AR8030/AR8035 use strapping
* options.
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
From 65033574ade97afccba074d837fd269903a83a9a Mon Sep 17 00:00:00 2001
From: Catalin Marinas <catalin.marinas@arm.com>
Date: Thu, 5 Oct 2023 16:40:30 +0100
Subject: [PATCH] arm64: swiotlb: Reduce the default size if no ZONE_DMA
bouncing needed

With CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC enabled, the arm64 kernel still
allocates the default SWIOTLB buffer (64MB) even if ZONE_DMA is disabled
or all the RAM fits into this zone. However, this potentially wastes a
non-negligible amount of memory on platforms with little RAM.

Reduce the SWIOTLB size to 1MB per 1GB of RAM if only needed for
kmalloc() buffer bouncing.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Suggested-by: Ross Burton <ross.burton@arm.com>
Cc: Ross Burton <ross.burton@arm.com>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
---
arch/arm64/mm/init.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -16,6 +16,7 @@
#include <linux/nodemask.h>
#include <linux/initrd.h>
#include <linux/gfp.h>
+#include <linux/math.h>
#include <linux/memblock.h>
#include <linux/sort.h>
#include <linux/of.h>
@@ -493,8 +494,16 @@ void __init mem_init(void)
{
bool swiotlb = max_pfn > PFN_DOWN(arm64_dma_phys_limit);

- if (IS_ENABLED(CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC))
+ if (IS_ENABLED(CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC) && !swiotlb) {
+ /*
+ * If no bouncing needed for ZONE_DMA, reduce the swiotlb
+ * buffer for kmalloc() bouncing to 1MB per 1GB of RAM.
+ */
+ unsigned long size =
+ DIV_ROUND_UP(memblock_phys_mem_size(), 1024);
+ swiotlb_adjust_size(min(swiotlb_size_or_default(), size));
swiotlb = true;
+ }

swiotlb_init(swiotlb, SWIOTLB_VERBOSE);

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From 6a4aee277740d04ac0fd54cfa17cc28261932ddc Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Mon, 25 Mar 2024 20:06:19 +0100
Subject: [PATCH] net: phy: qcom: at803x: fix kernel panic with at8031_probe

On reworking and splitting the at803x driver, in splitting function of
at803x PHYs it was added a NULL dereference bug where priv is referenced
before it's actually allocated and then is tried to write to for the
is_1000basex and is_fiber variables in the case of at8031, writing on
the wrong address.

Fix this by correctly setting priv local variable only after
at803x_probe is called and actually allocates priv in the phydev struct.

Reported-by: William Wortel <wwortel@dorpstraat.com>
Cc: <stable@vger.kernel.org>
Fixes: 25d2ba94005f ("net: phy: at803x: move specific at8031 probe mode check to dedicated probe")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20240325190621.2665-1-ansuelsmth@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
drivers/net/phy/qcom/at803x.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/net/phy/qcom/at803x.c
+++ b/drivers/net/phy/qcom/at803x.c
@@ -797,7 +797,7 @@ static int at8031_parse_dt(struct phy_de

static int at8031_probe(struct phy_device *phydev)
{
- struct at803x_priv *priv = phydev->priv;
+ struct at803x_priv *priv;
int mode_cfg;
int ccr;
int ret;
@@ -806,6 +806,8 @@ static int at8031_probe(struct phy_devic
if (ret)
return ret;

+ priv = phydev->priv;
+
/* Only supported on AR8031/AR8033, the AR8030/AR8035 use strapping
* options.
*/
Loading

0 comments on commit cffe6aa

Please sign in to comment.