From: Greg Kroah-Hartman Date: Tue, 17 Jun 2025 15:04:13 +0000 (+0200) Subject: 6.12-stable patches X-Git-Tag: v6.6.94~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0f9f5157f31eedc96c2d226f59e9609187e82fb3;p=thirdparty%2Fkernel%2Fstable-queue.git 6.12-stable patches added patches: calipso-unlock-rcu-before-returning-eafnosupport.patch drm-meson-use-1000ull-when-operating-with-mode-clock.patch gfs2-don-t-clear-sb-s_fs_info-in-gfs2_sys_fs_add.patch net-usb-aqc111-debug-info-before-sanitation.patch overflow-introduce-__define_flex-for-having-no-initializer.patch regulator-dt-bindings-mt6357-drop-fixed-compatible-requirement.patch usb-misc-onboard_usb_dev-fix-build-warning-for-config_usb_onboard_dev_usb5744-n.patch --- diff --git a/queue-6.12/calipso-unlock-rcu-before-returning-eafnosupport.patch b/queue-6.12/calipso-unlock-rcu-before-returning-eafnosupport.patch new file mode 100644 index 0000000000..43dd7a065b --- /dev/null +++ b/queue-6.12/calipso-unlock-rcu-before-returning-eafnosupport.patch @@ -0,0 +1,41 @@ +From 3cae906e1a6184cdc9e4d260e4dbdf9a118d94ad Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Wed, 4 Jun 2025 13:38:26 +0000 +Subject: calipso: unlock rcu before returning -EAFNOSUPPORT + +From: Eric Dumazet + +commit 3cae906e1a6184cdc9e4d260e4dbdf9a118d94ad upstream. + +syzbot reported that a recent patch forgot to unlock rcu +in the error path. + +Adopt the convention that netlbl_conn_setattr() is already using. + +Fixes: 6e9f2df1c550 ("calipso: Don't call calipso functions for AF_INET sk.") +Reported-by: syzbot +Signed-off-by: Eric Dumazet +Cc: Kuniyuki Iwashima +Acked-by: Paul Moore +Link: https://patch.msgid.link/20250604133826.1667664-1-edumazet@google.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/netlabel/netlabel_kapi.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/net/netlabel/netlabel_kapi.c ++++ b/net/netlabel/netlabel_kapi.c +@@ -1165,8 +1165,10 @@ int netlbl_conn_setattr(struct sock *sk, + break; + #if IS_ENABLED(CONFIG_IPV6) + case AF_INET6: +- if (sk->sk_family != AF_INET6) +- return -EAFNOSUPPORT; ++ if (sk->sk_family != AF_INET6) { ++ ret_val = -EAFNOSUPPORT; ++ goto conn_setattr_return; ++ } + + addr6 = (struct sockaddr_in6 *)addr; + entry = netlbl_domhsh_getentry_af6(secattr->domain, diff --git a/queue-6.12/drm-meson-use-1000ull-when-operating-with-mode-clock.patch b/queue-6.12/drm-meson-use-1000ull-when-operating-with-mode-clock.patch new file mode 100644 index 0000000000..69e01af9ae --- /dev/null +++ b/queue-6.12/drm-meson-use-1000ull-when-operating-with-mode-clock.patch @@ -0,0 +1,44 @@ +From eb0851e14432f3b87c77b704c835ac376deda03a Mon Sep 17 00:00:00 2001 +From: I Hsin Cheng +Date: Tue, 6 May 2025 02:43:38 +0800 +Subject: drm/meson: Use 1000ULL when operating with mode->clock + +From: I Hsin Cheng + +commit eb0851e14432f3b87c77b704c835ac376deda03a upstream. + +Coverity scan reported the usage of "mode->clock * 1000" may lead to +integer overflow. Use "1000ULL" instead of "1000" +when utilizing it to avoid potential integer overflow issue. + +Link: https://scan5.scan.coverity.com/#/project-view/10074/10063?selectedIssue=1646759 +Signed-off-by: I Hsin Cheng +Reviewed-by: Martin Blumenstingl +Fixes: 1017560164b6 ("drm/meson: use unsigned long long / Hz for frequency types") +Link: https://lore.kernel.org/r/20250505184338.678540-1-richard120310@gmail.com +Signed-off-by: Neil Armstrong +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/meson/meson_encoder_hdmi.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/meson/meson_encoder_hdmi.c ++++ b/drivers/gpu/drm/meson/meson_encoder_hdmi.c +@@ -75,7 +75,7 @@ static void meson_encoder_hdmi_set_vclk( + unsigned long long venc_freq; + unsigned long long hdmi_freq; + +- vclk_freq = mode->clock * 1000; ++ vclk_freq = mode->clock * 1000ULL; + + /* For 420, pixel clock is half unlike venc clock */ + if (encoder_hdmi->output_bus_fmt == MEDIA_BUS_FMT_UYYVYY8_0_5X24) +@@ -123,7 +123,7 @@ static enum drm_mode_status meson_encode + struct meson_encoder_hdmi *encoder_hdmi = bridge_to_meson_encoder_hdmi(bridge); + struct meson_drm *priv = encoder_hdmi->priv; + bool is_hdmi2_sink = display_info->hdmi.scdc.supported; +- unsigned long long clock = mode->clock * 1000; ++ unsigned long long clock = mode->clock * 1000ULL; + unsigned long long phy_freq; + unsigned long long vclk_freq; + unsigned long long venc_freq; diff --git a/queue-6.12/gfs2-don-t-clear-sb-s_fs_info-in-gfs2_sys_fs_add.patch b/queue-6.12/gfs2-don-t-clear-sb-s_fs_info-in-gfs2_sys_fs_add.patch new file mode 100644 index 0000000000..6bf9c08c5d --- /dev/null +++ b/queue-6.12/gfs2-don-t-clear-sb-s_fs_info-in-gfs2_sys_fs_add.patch @@ -0,0 +1,65 @@ +From 9126d2754c5e5d1818765811a10af0a14cf1fa0a Mon Sep 17 00:00:00 2001 +From: Andrew Price +Date: Wed, 28 May 2025 16:02:37 +0100 +Subject: gfs2: Don't clear sb->s_fs_info in gfs2_sys_fs_add + +From: Andrew Price + +commit 9126d2754c5e5d1818765811a10af0a14cf1fa0a upstream. + +When gfs2_sys_fs_add() fails, it sets sb->s_fs_info to NULL on its error +path (see commit 0d515210b696 ("GFS2: Add kobject release method")). +The intention seems to be to prevent dereferencing sb->s_fs_info once +the object pointed to has been deallocated, but that would be better +achieved by setting the pointer to NULL in free_sbd(). + +As a consequence, when the call to gfs2_sys_fs_add() fails in +gfs2_fill_super(), sdp = GFS2_SB(inode) will evaluate to NULL in iput() +-> gfs2_drop_inode(), and accessing sdp->sd_flags will be a NULL pointer +dereference. + +Fix that by only setting sb->s_fs_info to NULL when actually freeing the +object pointed to in free_sbd(). + +Fixes: ae9f3bd8259a ("gfs2: replace sd_aspace with sd_inode") +Reported-by: syzbot+b12826218502df019f9d@syzkaller.appspotmail.com +Signed-off-by: Andrew Price +Signed-off-by: Andreas Gruenbacher +Signed-off-by: Greg Kroah-Hartman +--- + fs/gfs2/ops_fstype.c | 4 +++- + fs/gfs2/sys.c | 1 - + 2 files changed, 3 insertions(+), 2 deletions(-) + +--- a/fs/gfs2/ops_fstype.c ++++ b/fs/gfs2/ops_fstype.c +@@ -64,8 +64,11 @@ static void gfs2_tune_init(struct gfs2_t + + void free_sbd(struct gfs2_sbd *sdp) + { ++ struct super_block *sb = sdp->sd_vfs; ++ + if (sdp->sd_lkstats) + free_percpu(sdp->sd_lkstats); ++ sb->s_fs_info = NULL; + kfree(sdp); + } + +@@ -1316,7 +1319,6 @@ fail_iput: + iput(sdp->sd_inode); + fail_free: + free_sbd(sdp); +- sb->s_fs_info = NULL; + return error; + } + +--- a/fs/gfs2/sys.c ++++ b/fs/gfs2/sys.c +@@ -764,7 +764,6 @@ fail_reg: + fs_err(sdp, "error %d adding sysfs files\n", error); + kobject_put(&sdp->sd_kobj); + wait_for_completion(&sdp->sd_kobj_unregister); +- sb->s_fs_info = NULL; + return error; + } + diff --git a/queue-6.12/net-usb-aqc111-debug-info-before-sanitation.patch b/queue-6.12/net-usb-aqc111-debug-info-before-sanitation.patch new file mode 100644 index 0000000000..e91febb106 --- /dev/null +++ b/queue-6.12/net-usb-aqc111-debug-info-before-sanitation.patch @@ -0,0 +1,51 @@ +From d3faab9b5a6a0477d69c38bd11c43aa5e936f929 Mon Sep 17 00:00:00 2001 +From: Oliver Neukum +Date: Wed, 28 May 2025 13:03:54 +0200 +Subject: net: usb: aqc111: debug info before sanitation + +From: Oliver Neukum + +commit d3faab9b5a6a0477d69c38bd11c43aa5e936f929 upstream. + +If we sanitize error returns, the debug statements need +to come before that so that we don't lose information. + +Signed-off-by: Oliver Neukum +Fixes: 405b0d610745 ("net: usb: aqc111: fix error handling of usbnet read calls") +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/usb/aqc111.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/net/usb/aqc111.c ++++ b/drivers/net/usb/aqc111.c +@@ -31,11 +31,11 @@ static int aqc111_read_cmd_nopm(struct u + USB_RECIP_DEVICE, value, index, data, size); + + if (unlikely(ret < size)) { +- ret = ret < 0 ? ret : -ENODATA; +- + netdev_warn(dev->net, + "Failed to read(0x%x) reg index 0x%04x: %d\n", + cmd, index, ret); ++ ++ ret = ret < 0 ? ret : -ENODATA; + } + + return ret; +@@ -50,11 +50,11 @@ static int aqc111_read_cmd(struct usbnet + USB_RECIP_DEVICE, value, index, data, size); + + if (unlikely(ret < size)) { +- ret = ret < 0 ? ret : -ENODATA; +- + netdev_warn(dev->net, + "Failed to read(0x%x) reg index 0x%04x: %d\n", + cmd, index, ret); ++ ++ ret = ret < 0 ? ret : -ENODATA; + } + + return ret; diff --git a/queue-6.12/overflow-introduce-__define_flex-for-having-no-initializer.patch b/queue-6.12/overflow-introduce-__define_flex-for-having-no-initializer.patch new file mode 100644 index 0000000000..bf5067f3b5 --- /dev/null +++ b/queue-6.12/overflow-introduce-__define_flex-for-having-no-initializer.patch @@ -0,0 +1,80 @@ +From 5c78e793f78732b60276401f75cc1a101f9ad121 Mon Sep 17 00:00:00 2001 +From: Kees Cook +Date: Fri, 30 May 2025 12:06:47 -0700 +Subject: overflow: Introduce __DEFINE_FLEX for having no initializer + +From: Kees Cook + +commit 5c78e793f78732b60276401f75cc1a101f9ad121 upstream. + +While not yet in the tree, there is a proposed patch[1] that was +depending on the prior behavior of _DEFINE_FLEX, which did not have an +explicit initializer. Provide this via __DEFINE_FLEX now, which can also +have attributes applied (e.g. __uninitialized). + +Examples of the resulting initializer behaviors can be seen here: +https://godbolt.org/z/P7Go8Tr33 + +Link: https://lore.kernel.org/netdev/20250520205920.2134829-9-anthony.l.nguyen@intel.com [1] +Fixes: 47e36ed78406 ("overflow: Fix direct struct member initialization in _DEFINE_FLEX()") +Signed-off-by: Kees Cook +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/overflow.h | 25 +++++++++++++++++++------ + 1 file changed, 19 insertions(+), 6 deletions(-) + +--- a/include/linux/overflow.h ++++ b/include/linux/overflow.h +@@ -389,25 +389,38 @@ static inline size_t __must_check size_s + struct_size((type *)NULL, member, count) + + /** +- * _DEFINE_FLEX() - helper macro for DEFINE_FLEX() family. +- * Enables caller macro to pass (different) initializer. ++ * __DEFINE_FLEX() - helper macro for DEFINE_FLEX() family. ++ * Enables caller macro to pass arbitrary trailing expressions + * + * @type: structure type name, including "struct" keyword. + * @name: Name for a variable to define. + * @member: Name of the array member. + * @count: Number of elements in the array; must be compile-time const. +- * @initializer: Initializer expression (e.g., pass `= { }` at minimum). ++ * @trailer: Trailing expressions for attributes and/or initializers. + */ +-#define _DEFINE_FLEX(type, name, member, count, initializer...) \ ++#define __DEFINE_FLEX(type, name, member, count, trailer...) \ + _Static_assert(__builtin_constant_p(count), \ + "onstack flex array members require compile-time const count"); \ + union { \ + u8 bytes[struct_size_t(type, member, count)]; \ + type obj; \ +- } name##_u = { .obj initializer }; \ ++ } name##_u trailer; \ + type *name = (type *)&name##_u + + /** ++ * _DEFINE_FLEX() - helper macro for DEFINE_FLEX() family. ++ * Enables caller macro to pass (different) initializer. ++ * ++ * @type: structure type name, including "struct" keyword. ++ * @name: Name for a variable to define. ++ * @member: Name of the array member. ++ * @count: Number of elements in the array; must be compile-time const. ++ * @initializer: Initializer expression (e.g., pass `= { }` at minimum). ++ */ ++#define _DEFINE_FLEX(type, name, member, count, initializer...) \ ++ __DEFINE_FLEX(type, name, member, count, = { .obj initializer }) ++ ++/** + * DEFINE_RAW_FLEX() - Define an on-stack instance of structure with a trailing + * flexible array member, when it does not have a __counted_by annotation. + * +@@ -421,7 +434,7 @@ static inline size_t __must_check size_s + * Use __struct_size(@name) to get compile-time size of it afterwards. + */ + #define DEFINE_RAW_FLEX(type, name, member, count) \ +- _DEFINE_FLEX(type, name, member, count, = {}) ++ __DEFINE_FLEX(type, name, member, count, = { }) + + /** + * DEFINE_FLEX() - Define an on-stack instance of structure with a trailing diff --git a/queue-6.12/regulator-dt-bindings-mt6357-drop-fixed-compatible-requirement.patch b/queue-6.12/regulator-dt-bindings-mt6357-drop-fixed-compatible-requirement.patch new file mode 100644 index 0000000000..781143f7a6 --- /dev/null +++ b/queue-6.12/regulator-dt-bindings-mt6357-drop-fixed-compatible-requirement.patch @@ -0,0 +1,124 @@ +From 9cfdd7752ba5f8cc9b8191e8c9aeeec246241fa4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?N=C3=ADcolas=20F=2E=20R=2E=20A=2E=20Prado?= + +Date: Wed, 14 May 2025 08:36:06 -0400 +Subject: regulator: dt-bindings: mt6357: Drop fixed compatible requirement +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Nícolas F. R. A. Prado + +commit 9cfdd7752ba5f8cc9b8191e8c9aeeec246241fa4 upstream. + +Some of the regulators on the MT6357 PMIC currently reference the +fixed-regulator dt-binding, which enforces the presence of a +regulator-fixed compatible. However since all regulators on the MT6357 +PMIC are handled by a single mt6357-regulator driver, probed through +MFD, the compatibles don't serve any purpose. In fact they cause +failures in the DT kselftest since they aren't probed by the fixed +regulator driver as would be expected. Furthermore this is the only +dt-binding in this family like this: mt6359-regulator and +mt6358-regulator don't require those compatibles. + +Commit d77e89b7b03f ("arm64: dts: mediatek: mt6357: Drop regulator-fixed +compatibles") removed the compatibles from Devicetree, but missed +updating the binding, which still requires them, introducing dt-binding +errors. Remove the compatible requirement by referencing the plain +regulator dt-binding instead to fix the dt-binding errors. + +Fixes: d77e89b7b03f ("arm64: dts: mediatek: mt6357: Drop regulator-fixed compatibles") +Signed-off-by: Nícolas F. R. A. Prado +Link: https://patch.msgid.link/20250514-mt6357-regulator-fixed-compatibles-removal-bindings-v1-1-2421e9cc6cc7@collabora.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + Documentation/devicetree/bindings/regulator/mediatek,mt6357-regulator.yaml | 12 ---------- + 1 file changed, 1 insertion(+), 11 deletions(-) + +--- a/Documentation/devicetree/bindings/regulator/mediatek,mt6357-regulator.yaml ++++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6357-regulator.yaml +@@ -33,7 +33,7 @@ patternProperties: + + "^ldo-v(camio18|aud28|aux18|io18|io28|rf12|rf18|cn18|cn28|fe28)$": + type: object +- $ref: fixed-regulator.yaml# ++ $ref: regulator.yaml# + unevaluatedProperties: false + description: + Properties for single fixed LDO regulator. +@@ -112,7 +112,6 @@ examples: + regulator-enable-ramp-delay = <220>; + }; + mt6357_vfe28_reg: ldo-vfe28 { +- compatible = "regulator-fixed"; + regulator-name = "vfe28"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; +@@ -125,14 +124,12 @@ examples: + regulator-enable-ramp-delay = <110>; + }; + mt6357_vrf18_reg: ldo-vrf18 { +- compatible = "regulator-fixed"; + regulator-name = "vrf18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <110>; + }; + mt6357_vrf12_reg: ldo-vrf12 { +- compatible = "regulator-fixed"; + regulator-name = "vrf12"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; +@@ -157,14 +154,12 @@ examples: + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcn28_reg: ldo-vcn28 { +- compatible = "regulator-fixed"; + regulator-name = "vcn28"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcn18_reg: ldo-vcn18 { +- compatible = "regulator-fixed"; + regulator-name = "vcn18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; +@@ -183,7 +178,6 @@ examples: + regulator-enable-ramp-delay = <264>; + }; + mt6357_vcamio_reg: ldo-vcamio18 { +- compatible = "regulator-fixed"; + regulator-name = "vcamio"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; +@@ -212,28 +206,24 @@ examples: + regulator-always-on; + }; + mt6357_vaux18_reg: ldo-vaux18 { +- compatible = "regulator-fixed"; + regulator-name = "vaux18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vaud28_reg: ldo-vaud28 { +- compatible = "regulator-fixed"; + regulator-name = "vaud28"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vio28_reg: ldo-vio28 { +- compatible = "regulator-fixed"; + regulator-name = "vio28"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + regulator-enable-ramp-delay = <264>; + }; + mt6357_vio18_reg: ldo-vio18 { +- compatible = "regulator-fixed"; + regulator-name = "vio18"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; diff --git a/queue-6.12/serial-sh-sci-clean-sci_ports-0-after-at-earlycon-ex.patch b/queue-6.12/serial-sh-sci-clean-sci_ports-0-after-at-earlycon-ex.patch deleted file mode 100644 index 2b7633daa3..0000000000 --- a/queue-6.12/serial-sh-sci-clean-sci_ports-0-after-at-earlycon-ex.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 848409217e96d5afac6089bba4da9fc8dacfafca Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 16 Jan 2025 20:22:48 +0200 -Subject: serial: sh-sci: Clean sci_ports[0] after at earlycon exit - -From: Claudiu Beznea - -[ Upstream commit 3791ea69a4858b81e0277f695ca40f5aae40f312 ] - -The early_console_setup() function initializes the sci_ports[0].port with -an object of type struct uart_port obtained from the object of type -struct earlycon_device received as argument by the early_console_setup(). - -It may happen that later, when the rest of the serial ports are probed, -the serial port that was used as earlycon (e.g., port A) to be mapped to a -different position in sci_ports[] and the slot 0 to be used by a different -serial port (e.g., port B), as follows: - -sci_ports[0] = port A -sci_ports[X] = port B - -In this case, the new port mapped at index zero will have associated data -that was used for earlycon. - -In case this happens, after Linux boot, any access to the serial port that -maps on sci_ports[0] (port A) will block the serial port that was used as -earlycon (port B). - -To fix this, add early_console_exit() that clean the sci_ports[0] at -earlycon exit time. - -Fixes: 0b0cced19ab1 ("serial: sh-sci: Add CONFIG_SERIAL_EARLYCON support") -Cc: stable@vger.kernel.org -Signed-off-by: Claudiu Beznea -Link: https://lore.kernel.org/r/20241106120118.1719888-4-claudiu.beznea.uj@bp.renesas.com -Signed-off-by: Greg Kroah-Hartman -Signed-off-by: Sasha Levin ---- - drivers/tty/serial/sh-sci.c | 32 ++++++++++++++++++++++++++++++-- - 1 file changed, 30 insertions(+), 2 deletions(-) - -diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c -index aacbed76c7c54..519a48f89f20e 100644 ---- a/drivers/tty/serial/sh-sci.c -+++ b/drivers/tty/serial/sh-sci.c -@@ -183,6 +183,7 @@ static struct sci_port sci_ports[SCI_NPORTS]; - static unsigned long sci_ports_in_use; - static struct uart_driver sci_uart_driver; - static bool sci_uart_earlycon; -+static bool sci_uart_earlycon_dev_probing; - - static inline struct sci_port * - to_sci_port(struct uart_port *uart) -@@ -3404,7 +3405,8 @@ static struct plat_sci_port *sci_parse_dt(struct platform_device *pdev, - static int sci_probe_single(struct platform_device *dev, - unsigned int index, - struct plat_sci_port *p, -- struct sci_port *sciport) -+ struct sci_port *sciport, -+ struct resource *sci_res) - { - int ret; - -@@ -3451,6 +3453,14 @@ static int sci_probe_single(struct platform_device *dev, - sciport->port.flags |= UPF_HARD_FLOW; - } - -+ if (sci_uart_earlycon && sci_ports[0].port.mapbase == sci_res->start) { -+ /* -+ * Skip cleanup the sci_port[0] in early_console_exit(), this -+ * port is the same as the earlycon one. -+ */ -+ sci_uart_earlycon_dev_probing = true; -+ } -+ - return uart_add_one_port(&sci_uart_driver, &sciport->port); - } - -@@ -3509,7 +3519,7 @@ static int sci_probe(struct platform_device *dev) - - platform_set_drvdata(dev, sp); - -- ret = sci_probe_single(dev, dev_id, p, sp); -+ ret = sci_probe_single(dev, dev_id, p, sp, res); - if (ret) - return ret; - -@@ -3666,6 +3676,22 @@ sh_early_platform_init_buffer("earlyprintk", &sci_driver, - #ifdef CONFIG_SERIAL_SH_SCI_EARLYCON - static struct plat_sci_port port_cfg; - -+static int early_console_exit(struct console *co) -+{ -+ struct sci_port *sci_port = &sci_ports[0]; -+ -+ /* -+ * Clean the slot used by earlycon. A new SCI device might -+ * map to this slot. -+ */ -+ if (!sci_uart_earlycon_dev_probing) { -+ memset(sci_port, 0, sizeof(*sci_port)); -+ sci_uart_earlycon = false; -+ } -+ -+ return 0; -+} -+ - static int __init early_console_setup(struct earlycon_device *device, - int type) - { -@@ -3683,6 +3709,8 @@ static int __init early_console_setup(struct earlycon_device *device, - SCSCR_RE | SCSCR_TE | port_cfg.scscr); - - device->con->write = serial_console_write; -+ device->con->exit = early_console_exit; -+ - return 0; - } - static int __init sci_early_console_setup(struct earlycon_device *device, --- -2.39.5 - diff --git a/queue-6.12/serial-sh-sci-increment-the-runtime-usage-counter-fo.patch b/queue-6.12/serial-sh-sci-increment-the-runtime-usage-counter-fo.patch deleted file mode 100644 index 1598a09433..0000000000 --- a/queue-6.12/serial-sh-sci-increment-the-runtime-usage-counter-fo.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 44fc2adc5e237c2241c09bc469bdfd5d7484b647 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Thu, 16 Jan 2025 20:22:49 +0200 -Subject: serial: sh-sci: Increment the runtime usage counter for the earlycon - device - -From: Claudiu Beznea - -[ Upstream commit 651dee03696e1dfde6d9a7e8664bbdcd9a10ea7f ] - -In the sh-sci driver, serial ports are mapped to the sci_ports[] array, -with earlycon mapped at index zero. - -The uart_add_one_port() function eventually calls __device_attach(), -which, in turn, calls pm_request_idle(). The identified code path is as -follows: - -uart_add_one_port() -> - serial_ctrl_register_port() -> - serial_core_register_port() -> - serial_core_port_device_add() -> - serial_base_port_add() -> - device_add() -> - bus_probe_device() -> - device_initial_probe() -> - __device_attach() -> - // ... - if (dev->p->dead) { - // ... - } else if (dev->driver) { - // ... - } else { - // ... - pm_request_idle(dev); - // ... - } - -The earlycon device clocks are enabled by the bootloader. However, the -pm_request_idle() call in __device_attach() disables the SCI port clocks -while earlycon is still active. - -The earlycon write function, serial_console_write(), calls -sci_poll_put_char() via serial_console_putchar(). If the SCI port clocks -are disabled, writing to earlycon may sometimes cause the SR.TDFE bit to -remain unset indefinitely, causing the while loop in sci_poll_put_char() -to never exit. On single-core SoCs, this can result in the system being -blocked during boot when this issue occurs. - -To resolve this, increment the runtime PM usage counter for the earlycon -SCI device before registering the UART port. - -Fixes: 0b0cced19ab1 ("serial: sh-sci: Add CONFIG_SERIAL_EARLYCON support") -Cc: stable@vger.kernel.org -Signed-off-by: Claudiu Beznea -Link: https://lore.kernel.org/r/20250116182249.3828577-6-claudiu.beznea.uj@bp.renesas.com -Signed-off-by: Greg Kroah-Hartman -Signed-off-by: Sasha Levin ---- - drivers/tty/serial/sh-sci.c | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c -index 519a48f89f20e..53236e3e4fa47 100644 ---- a/drivers/tty/serial/sh-sci.c -+++ b/drivers/tty/serial/sh-sci.c -@@ -3454,6 +3454,22 @@ static int sci_probe_single(struct platform_device *dev, - } - - if (sci_uart_earlycon && sci_ports[0].port.mapbase == sci_res->start) { -+ /* -+ * In case: -+ * - this is the earlycon port (mapped on index 0 in sci_ports[]) and -+ * - it now maps to an alias other than zero and -+ * - the earlycon is still alive (e.g., "earlycon keep_bootcon" is -+ * available in bootargs) -+ * -+ * we need to avoid disabling clocks and PM domains through the runtime -+ * PM APIs called in __device_attach(). For this, increment the runtime -+ * PM reference counter (the clocks and PM domains were already enabled -+ * by the bootloader). Otherwise the earlycon may access the HW when it -+ * has no clocks enabled leading to failures (infinite loop in -+ * sci_poll_put_char()). -+ */ -+ pm_runtime_get_noresume(&dev->dev); -+ - /* - * Skip cleanup the sci_port[0] in early_console_exit(), this - * port is the same as the earlycon one. --- -2.39.5 - diff --git a/queue-6.12/serial-sh-sci-move-runtime-pm-enable-to-sci_probe_si.patch b/queue-6.12/serial-sh-sci-move-runtime-pm-enable-to-sci_probe_si.patch index 72e06e1a82..4e820e83db 100644 --- a/queue-6.12/serial-sh-sci-move-runtime-pm-enable-to-sci_probe_si.patch +++ b/queue-6.12/serial-sh-sci-move-runtime-pm-enable-to-sci_probe_si.patch @@ -21,14 +21,12 @@ Link: https://lore.kernel.org/r/20250116182249.3828577-3-claudiu.beznea.uj@bp.re Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- - drivers/tty/serial/sh-sci.c | 24 ++++++------------------ + drivers/tty/serial/sh-sci.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) -diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c -index 76cf177b040eb..aacbed76c7c54 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c -@@ -3074,10 +3074,6 @@ static int sci_init_single(struct platform_device *dev, +@@ -3074,10 +3074,6 @@ static int sci_init_single(struct platfo ret = sci_init_clocks(sci_port, &dev->dev); if (ret < 0) return ret; @@ -39,7 +37,7 @@ index 76cf177b040eb..aacbed76c7c54 100644 } port->type = p->type; -@@ -3104,11 +3100,6 @@ static int sci_init_single(struct platform_device *dev, +@@ -3104,11 +3100,6 @@ static int sci_init_single(struct platfo return 0; } @@ -51,7 +49,7 @@ index 76cf177b040eb..aacbed76c7c54 100644 #if defined(CONFIG_SERIAL_SH_SCI_CONSOLE) || \ defined(CONFIG_SERIAL_SH_SCI_EARLYCON) static void serial_console_putchar(struct uart_port *port, unsigned char ch) -@@ -3278,8 +3269,6 @@ static void sci_remove(struct platform_device *dev) +@@ -3278,8 +3269,6 @@ static void sci_remove(struct platform_d sci_ports_in_use &= ~BIT(port->port.line); uart_remove_one_port(&sci_uart_driver, &port->port); @@ -60,7 +58,7 @@ index 76cf177b040eb..aacbed76c7c54 100644 if (port->port.fifosize > 1) device_remove_file(&dev->dev, &dev_attr_rx_fifo_trigger); if (type == PORT_SCIFA || type == PORT_SCIFB || type == PORT_HSCIF) -@@ -3444,6 +3433,11 @@ static int sci_probe_single(struct platform_device *dev, +@@ -3444,6 +3433,11 @@ static int sci_probe_single(struct platf if (ret) return ret; @@ -72,7 +70,7 @@ index 76cf177b040eb..aacbed76c7c54 100644 sciport->gpios = mctrl_gpio_init(&sciport->port, 0); if (IS_ERR(sciport->gpios)) return PTR_ERR(sciport->gpios); -@@ -3457,13 +3451,7 @@ static int sci_probe_single(struct platform_device *dev, +@@ -3457,13 +3451,7 @@ static int sci_probe_single(struct platf sciport->port.flags |= UPF_HARD_FLOW; } @@ -87,6 +85,3 @@ index 76cf177b040eb..aacbed76c7c54 100644 } static int sci_probe(struct platform_device *dev) --- -2.39.5 - diff --git a/queue-6.12/series b/queue-6.12/series index a408d8ddae..6b71a38698 100644 --- a/queue-6.12/series +++ b/queue-6.12/series @@ -415,8 +415,6 @@ dt-bindings-pwm-adi-axi-pwmgen-increase-pwm-cells-to.patch dt-bindings-pwm-correct-indentation-and-style-in-dts.patch dt-bindings-pwm-adi-axi-pwmgen-fix-clocks.patch serial-sh-sci-move-runtime-pm-enable-to-sci_probe_si.patch -serial-sh-sci-clean-sci_ports-0-after-at-earlycon-ex.patch -serial-sh-sci-increment-the-runtime-usage-counter-fo.patch scsi-core-ufs-fix-a-hang-in-the-error-handler.patch bluetooth-hci_core-fix-list_for_each_entry_rcu-usage.patch bluetooth-btintel_pcie-fix-driver-not-posting-maximu.patch @@ -505,3 +503,10 @@ xfs-don-t-assume-perags-are-initialised-when-trimming-ags.patch xen-arm-call-uaccess_ttbr0_enable-for-dm_op-hypercall.patch x86-iopl-cure-tif_io_bitmap-inconsistencies.patch x86-fred-signal-prevent-immediate-repeat-of-single-step-trap-on-return-from-sigtrap-handler.patch +calipso-unlock-rcu-before-returning-eafnosupport.patch +regulator-dt-bindings-mt6357-drop-fixed-compatible-requirement.patch +usb-misc-onboard_usb_dev-fix-build-warning-for-config_usb_onboard_dev_usb5744-n.patch +net-usb-aqc111-debug-info-before-sanitation.patch +overflow-introduce-__define_flex-for-having-no-initializer.patch +gfs2-don-t-clear-sb-s_fs_info-in-gfs2_sys_fs_add.patch +drm-meson-use-1000ull-when-operating-with-mode-clock.patch diff --git a/queue-6.12/usb-misc-onboard_usb_dev-fix-build-warning-for-config_usb_onboard_dev_usb5744-n.patch b/queue-6.12/usb-misc-onboard_usb_dev-fix-build-warning-for-config_usb_onboard_dev_usb5744-n.patch new file mode 100644 index 0000000000..635ce0f52b --- /dev/null +++ b/queue-6.12/usb-misc-onboard_usb_dev-fix-build-warning-for-config_usb_onboard_dev_usb5744-n.patch @@ -0,0 +1,65 @@ +From 662a9ece32add94469138ae66999ee16cb37a531 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Fri, 23 May 2025 14:09:43 +0200 +Subject: usb: misc: onboard_usb_dev: fix build warning for CONFIG_USB_ONBOARD_DEV_USB5744=n + +From: Arnd Bergmann + +commit 662a9ece32add94469138ae66999ee16cb37a531 upstream. + +When the USB5744 option is disabled, the onboard_usb driver warns about +unused functions: + +drivers/usb/misc/onboard_usb_dev.c:358:12: error: 'onboard_dev_5744_i2c_write_byte' defined but not used [-Werror=unused-function] + 358 | static int onboard_dev_5744_i2c_write_byte(struct i2c_client *client, u16 addr, u8 data) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +drivers/usb/misc/onboard_usb_dev.c:313:12: error: 'onboard_dev_5744_i2c_read_byte' defined but not used [-Werror=unused-function] + 313 | static int onboard_dev_5744_i2c_read_byte(struct i2c_client *client, u16 addr, u8 *data) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Extend the #ifdef block a little further to cover all of these functions. +Ideally we'd use use if(IS_ENABLED()) instead, but that doesn't currently +work because the i2c_transfer() and i2c_smbus_write_word_data() function +declarations are hidden when CONFIG_I2C is disabled. + +Fixes: 1143d41922c0 ("usb: misc: onboard_usb_dev: Fix usb5744 initialization sequence") +Signed-off-by: Arnd Bergmann +Link: https://lore.kernel.org/r/20250523120947.2170302-1-arnd@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/misc/onboard_usb_dev.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/drivers/usb/misc/onboard_usb_dev.c ++++ b/drivers/usb/misc/onboard_usb_dev.c +@@ -310,6 +310,7 @@ static void onboard_dev_attach_usb_drive + pr_err("Failed to attach USB driver: %pe\n", ERR_PTR(err)); + } + ++#if IS_ENABLED(CONFIG_USB_ONBOARD_DEV_USB5744) + static int onboard_dev_5744_i2c_read_byte(struct i2c_client *client, u16 addr, u8 *data) + { + struct i2c_msg msg[2]; +@@ -388,7 +389,6 @@ static int onboard_dev_5744_i2c_write_by + + static int onboard_dev_5744_i2c_init(struct i2c_client *client) + { +-#if IS_ENABLED(CONFIG_USB_ONBOARD_DEV_USB5744) + struct device *dev = &client->dev; + int ret; + u8 reg; +@@ -417,10 +417,13 @@ static int onboard_dev_5744_i2c_init(str + return dev_err_probe(dev, ret, "USB Attach with SMBus command failed\n"); + + return ret; ++} + #else ++static int onboard_dev_5744_i2c_init(struct i2c_client *client) ++{ + return -ENODEV; +-#endif + } ++#endif + + static int onboard_dev_probe(struct platform_device *pdev) + {