5.15.226-rc1 review
Subsystems (7)
Greg Kroah-Hartman
maintainerPATCH 1459/2214 Kbuild: use -Wdeclaration-after-statement
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit 4d94f910e79a349b00a4f8aab6f3ae87129d8c5a ]
The kernel is moving from using -std=gnu89 to -std=gnu11, permitting the use of additional C11 features such as for-loop initial declarations.
One contentious aspect of C99 is that it permits mixed declarations and code, and for now at least, it seems preferable to enforce that declarations must come first.
These warnings were already enabled in the kernel itself, but not for KBUILD_USERCFLAGS or the compat VDSO on arch/arm64, which uses a separate set of CFLAGS.
This patch fixes an existing violation in modpost.c, which is not reported because of the missing flag in KBUILD_USERCFLAGS:
| scripts/mod/modpost.c: In function ‘match’: | scripts/mod/modpost.c:837:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] | 837 | const char *endp = p + strlen(p) - 1; | | ^~~~~
Stable-dep-of: e6b49f8016ee ("dmaengine: dw-axi-dmac: Fix LLI dump out-of-bounds access")
--- Makefile | 3 ++- arch/arm64/kernel/vdso32/Makefile | 1 + scripts/mod/modpost.c | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-)
Makefile +2 -1
@@ -440,7 +440,8 @@ endif HOSTPKG_CONFIG = pkg-config export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \ - -O2 -fomit-frame-pointer -std=gnu89 + -O2 -fomit-frame-pointer -std=gnu89 \ + -Wdeclaration-after-statement export KBUILD_USERLDFLAGS := KBUILD_HOSTCFLAGS := $(KBUILD_USERCFLAGS) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS)
arch/arm64/kernel/vdso32/Makefile +1 -0
@@ -76,6 +76,7 @@ VDSO_CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common \ -Werror-implicit-function-declaration \ -Wno-format-security \ + -Wdeclaration-after-statement \ -std=gnu89 VDSO_CFLAGS += -O2 # Some useful compiler-dependent flags from top-level Makefile
scripts/mod/modpost.c +3 -1
@@ -837,8 +837,10 @@ static int match(const char *sym, const char * const pat[]) {const char *p;while (*pat) { +const char *endp; + p = *pat++; -const char *endp = p +strlen (p) -1 ; + endp = p +strlen (p) -1 ;/* "*foo*" */ if (*p =='*' && *endp =='*' ) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1460/2214 Kbuild: move to -std=gnu11
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit e8c07082a810fbb9db303a2b66b66b8d7e588b53 ]
During a patch discussion, Linus brought up the option of changing the C standard version from gnu89 to gnu99, which allows using variable declaration inside of a for() loop. While the C99, C11 and later standards introduce many other features, most of these are already available in gnu89 as GNU extensions as well.
An earlier attempt to do this when gcc-5 started defaulting to -std=gnu11 failed because at the time that caused warnings about designated initializers with older compilers. Now that gcc-5.1 is the minimum compiler version used for building kernels, that is no longer a concern. Similarly, the behavior of 'inline' functions changes between gnu89 using gnu_inline behavior and gnu11 using standard c99+ behavior, but this was taken care of by defining 'inline' to include __attribute__((gnu_inline)) in order to allow building with clang a while ago.
Nathan Chancellor reported a new -Wdeclaration-after-statement warning that appears in a system header on arm, this still needs a workaround.
The differences between gnu99, gnu11, gnu1x and gnu17 are fairly minimal and mainly impact warnings at the -Wpedantic level that the kernel never enables. Between these, gnu11 is the newest version that is supported by all supported compiler versions, though it is only the default on gcc-5, while all other supported versions of gcc or clang default to gnu1x/gnu17.
Stable-dep-of: e6b49f8016ee ("dmaengine: dw-axi-dmac: Fix LLI dump out-of-bounds access")
--- Documentation/process/programming-language.rst | 6 +++--- .../translations/it_IT/process/programming-language.rst | 4 ++-- .../translations/zh_CN/process/programming-language.rst | 3 +-- .../translations/zh_TW/process/programming-language.rst | 3 +-- Makefile | 4 ++-- arch/arm64/kernel/vdso32/Makefile | 2 +- 6 files changed, 10 insertions(+), 12 deletions(-)
Documentation/process/programming-language.rst +3 -3
@@ -5,9 +5,9 @@ Programming Language The kernel is written in the C programming language [c-language]_. More precisely, the kernel is typically compiled with ``gcc`` [gcc]_ -under ``-std=gnu89`` [gcc-c-dialect-options]_: the GNU dialect of ISO C90 -(including some C99 features). ``clang`` [clang]_ is also supported, see -docs on :ref:`Building Linux with Clang/LLVM <kbuild_llvm>`. +under ``-std=gnu11`` [gcc-c-dialect-options]_: the GNU dialect of ISO C11. +``clang`` [clang]_ is also supported, see docs on +:ref:`Building Linux with Clang/LLVM <kbuild_llvm>`. This dialect contains many extensions to the language [gnu-extensions]_, and many of them are used within the kernel as a matter of course.
Documentation/translations/it_IT/process/programming-language.rst +2 -2
@@ -10,8 +10,8 @@ Linguaggio di programmazione Il kernel è scritto nel linguaggio di programmazione C [it-c-language]_. Più precisamente, il kernel viene compilato con ``gcc`` [it-gcc]_ usando -l'opzione ``-std=gnu89`` [it-gcc-c-dialect-options]_: il dialetto GNU -dello standard ISO C90 (con l'aggiunta di alcune funzionalità da C99). +l'opzione ``-std=gnu11`` [it-gcc-c-dialect-options]_: il dialetto GNU +dello standard ISO C11. Linux supporta anche ``clang`` [it-clang]_, leggete la documentazione :ref:`Building Linux with Clang/LLVM <kbuild_llvm>`.
Documentation/translations/zh_CN/process/programming-language.rst +1 -2
@@ -9,8 +9,7 @@ ============ 内核是用C语言 :ref:`c-language <cn_c-language>` 编写的。更准确地说,内核通常是用 :ref:`gcc <cn_gcc>` -在 ``-std=gnu89`` :ref:`gcc-c-dialect-options <cn_gcc-c-dialect-options>` 下编译的:ISO C90的 GNU 方言( -包括一些C99特性) +在 ``-std=gnu11`` :ref:`gcc-c-dialect-options <cn_gcc-c-dialect-options>` 下编译的:ISO C11的 GNU 方言 这种方言包含对语言 :ref:`gnu-extensions <cn_gnu-extensions>` 的许多扩展,当然,它们许多都在内核中使用。
Documentation/translations/zh_TW/process/programming-language.rst +1 -2
@@ -12,8 +12,7 @@ ============ 內核是用C語言 :ref:`c-language <tw_c-language>` 編寫的。更準確地說,內核通常是用 :ref:`gcc <tw_gcc>` -在 ``-std=gnu89`` :ref:`gcc-c-dialect-options <tw_gcc-c-dialect-options>` 下編譯的:ISO C90的 GNU 方言( -包括一些C99特性) +在 ``-std=gnu11`` :ref:`gcc-c-dialect-options <tw_gcc-c-dialect-options>` 下編譯的:ISO C11的 GNU 方言 這種方言包含對語言 :ref:`gnu-extensions <tw_gnu-extensions>` 的許多擴展,當然,它們許多都在內核中使用。
Makefile +2 -2
@@ -524,7 +524,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \ -Werror=implicit-function-declaration -Werror=implicit-int \ -Werror=return-type -Wno-format-security \ - -std=gnu89 + -std=gnu11 KBUILD_CPPFLAGS := -D__KERNEL__ KBUILD_AFLAGS_KERNEL := KBUILD_CFLAGS_KERNEL :=
@@ -808,7 +808,7 @@ KBUILD_CFLAGS-$(CONFIG_WERROR) += -Werror ifdef CONFIG_CC_IS_CLANG KBUILD_CPPFLAGS += -Qunused-arguments -# The kernel builds with '-std=gnu89' so use of GNU extensions is acceptable. +# The kernel builds with '-std=gnu11' so use of GNU extensions is acceptable. KBUILD_CFLAGS += -Wno-gnu # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, as the # source of a reference will be _MergedGlobals and not on of the whitelisted names.
arch/arm64/kernel/vdso32/Makefile +1 -1
@@ -77,7 +77,7 @@ VDSO_CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -Werror-implicit-function-declaration \ -Wno-format-security \ -Wdeclaration-after-statement \ - -std=gnu89 + -std=gnu11 VDSO_CFLAGS += -O2 # Some useful compiler-dependent flags from top-level Makefile VDSO_CFLAGS += $(call cc32-option,-Wdeclaration-after-statement,)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1461/2214 dmaengine: dw-axi-dmac: Fix LLI dump out-of-bounds access
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jia Wang <[email protected]>
[ Upstream commit e6b49f8016ee8b642e8e495d1704342ee0b35d72 ]
axi_chan_list_dump_lli() uses the channel-wide descs_allocated count to walk the hw_desc[] array of a single transaction. If multiple transactions have allocated LLIs, the channel count can exceed the transaction-local nr_hw_descs and make the DMA error path read past the end of hw_desc[].
Use the descriptor-local nr_hw_descs count when dumping LLIs.
--- drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +1 -4
@@ -1001,10 +1001,7 @@ static void axi_chan_dump_lli(struct axi_dma_chan *chan,static void axi_chan_list_dump_lli (struct axi_dma_chan *chan,struct axi_dma_desc *desc_head) { -int count =atomic_read (&chan->descs_allocated); -int i; - -for (i =0 ; i < count; i++) +for (unsigned int i =0 ; i < desc_head->nr_hw_descs; i++)axi_chan_dump_lli (chan, &desc_head->hw_desc[i]); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1462/2214 dmaengine: dw-axi-dmac: Fix CH_CFG2 channel priority position
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jia Wang <[email protected]>
[ Upstream commit 2a9013c20c46216b92ff09e2283b5244a91c59da ]
The CH_CFG2 channel priority field occupies bits 51:47 of the 64-bit channel configuration register, corresponding to bits 19:15 of CH_CFG2_H.
The driver currently shifts the priority value by 20, programming the wrong bits. Use bit 15 as the field position.
--- drivers/dma/dw-axi-dmac/dw-axi-dmac.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/dw-axi-dmac/dw-axi-dmac.h +1 -1
@@ -321,7 +321,7 @@ enum {#define CH_CFG2_H_TT_FC_POS 0#define CH_CFG2_H_HS_SEL_SRC_POS 3#define CH_CFG2_H_HS_SEL_DST_POS 4 -#define CH_CFG2_H_PRIORITY_POS 20 +#define CH_CFG2_H_PRIORITY_POS 15/** * DW AXI DMA channel interrupts
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1463/2214 PCI: endpoint: pci-epf-vntb: Serialize virtual PCI bus scan
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Koichiro Den <[email protected]>
[ Upstream commit 84c3520c9e8c14b09a5cf645cc4fa7c6d9d61127 ]
The virtual PCI bus is scanned without holding the PCI rescan/remove lock. This can race with other PCI topology changes.
Hold the lock across the bus scan and device addition.
--- drivers/pci/endpoint/functions/pci-epf-vntb.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/pci/endpoint/functions/pci-epf-vntb.c +5 -0
@@ -977,14 +977,19 @@ static int vpci_scan_bus(void *sysdata)struct pci_bus *vpci_bus;struct epf_ntb *ndev = sysdata; +pci_lock_rescan_remove (); + vpci_bus =pci_scan_bus (ndev->vbus_number, &vpci_ops, sysdata);if (!vpci_bus) {pr_err ("create pci bus failed\n" ); +pci_unlock_rescan_remove ();return -EINVAL ; }pci_bus_add_devices (vpci_bus); +pci_unlock_rescan_remove (); +return 0 ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1464/2214 regulator: ab8500: Fix AB8505 VANA voltage selectors
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
[ Upstream commit dfdfda2a95843706428a9d95ab546cb10983e684 ]
The AB8505 VANA voltage table assumes selector 0 represents 1.05 V and all eight selectors increase linearly. Selector 0 actually represents 1.2 V. Selectors 1 through 6 cover 1.05 V through 1.175 V, and selector 7 represents 1.225 V.
Correct the table so each selector reports and programs the documented voltage.
Reference: AB8505 User Manual, DM00046744 Rev 3, p. 257
--- drivers/regulator/ab8500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/ab8500.c +1 -1
@@ -265,13 +265,13 @@ static const unsigned int fixed_2050000_voltage[] = { };static const unsigned int ldo_vana_voltages[] = { +1200000 ,1050000 ,1075000 ,1100000 ,1125000 ,1150000 ,1175000 , -1200000 ,1225000 , };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1465/2214 regulator: ab8500: Remove stale expand_register kernel-doc entry
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Babanpreet Singh <[email protected]>
[ Upstream commit 0991f3b4624ed713d1d5eb56520c1c9b2deaab7a ]
Commit aeee55b76bfd ("regulator: ab8500: Remove unused embedded struct expand_register") deleted the expand_register member from struct ab8500_regulator_info and, in the same hunk, added an empty "@expand_register:" line to the kernel-doc block. That traded one W=1 warning for another:
drivers/regulator/ab8500.c:196 Excess struct member 'expand_register' description in 'ab8500_regulator_info'
Drop the leftover line; the remaining @member entries all match the struct.
No functional changes.
Stable-dep-of: ac72c091a981 ("regulator: ab8500: Add AB8505 VAUX3 3.05 V setting")
--- drivers/regulator/ab8500.c | 1 - 1 file changed, 1 deletion(-)
drivers/regulator/ab8500.c +0 -1
@@ -173,7 +173,6 @@ struct ab8500_shared_mode {* @voltage_bank: bank to control regulator voltage * @voltage_reg: register to control regulator voltage * @voltage_mask: mask to control regulator voltage -* @expand_register: */ struct ab8500_regulator_info {struct device *dev;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1466/2214 regulator: ab8500: Add AB8505 VAUX3 3.05 V setting
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
[ Upstream commit ac72c091a9810493ccd9209414d4f859276727ab ]
AB8505 has an additional VAUX3 voltage setting which is not encoded in the normal three-bit selector. ArmRegu2.Vaux3Sel3 overrides that selector and selects 3.05 V.
Add the missing voltage and use the override bit as an extended selector. Program the ordinary selector before clearing the override so VAUX3 does not briefly switch to a stale voltage.
Reference: AB8505 User Manual, DM00046744 Rev 3, pp. 229 and 254
--- drivers/regulator/ab8500.c | 101 +++++++++++++++++++++++++++++++++++-- 1 file changed, 98 insertions(+), 3 deletions(-)
drivers/regulator/ab8500.c +98 -3
@@ -173,6 +173,7 @@ struct ab8500_shared_mode {* @voltage_bank: bank to control regulator voltage * @voltage_reg: register to control regulator voltage * @voltage_mask: mask to control regulator voltage +* @expand_register: additional register used to select an extra voltage */ struct ab8500_regulator_info {struct device *dev;
@@ -193,6 +194,12 @@ struct ab8500_regulator_info {u8 voltage_bank;u8 voltage_reg;u8 voltage_mask; +struct { +u8 voltage_limit; +u8 voltage_bank; +u8 voltage_reg; +u8 voltage_mask; + } expand_register; };/* voltage tables for the vauxn/vintcore supplies */
@@ -226,6 +233,18 @@ static const unsigned int ldo_vaux3_voltages[] = { 2910000, }; +static const unsigned int ldo_vaux3_ab8505_voltages[] = { +1200000 , +1500000 , +1800000 , +2100000 , +2500000 , +2750000 , +2790000 , +2910000 , +3050000 , +}; +static const unsigned int ldo_vaux56_voltages[] = {1800000 ,1050000 ,
@@ -593,6 +612,64 @@ static int ab8500_regulator_set_voltage_sel(struct regulator_dev *rdev,return ret; } +static int ab8500_regulator_get_voltage_sel_expand (struct regulator_dev *rdev) +{ +struct ab8500_regulator_info *info =rdev_get_drvdata (rdev); +u8 regval; +int ret; + +if (!info) +return -EINVAL ; + + ret =abx500_get_register_interruptible (info->dev, + info->expand_register.voltage_bank, + info->expand_register.voltage_reg, ®val); +if (ret <0 ) { +dev_err (rdev_get_dev (rdev), +"couldn't read voltage expand reg for regulator\n" ); +return ret; + } + +if (regval & info->expand_register.voltage_mask) +return info->expand_register.voltage_limit; + +return ab8500_regulator_get_voltage_sel (rdev); +} + +static int ab8500_regulator_set_voltage_sel_expand (struct regulator_dev *rdev, +unsigned int selector) +{ +struct ab8500_regulator_info *info =rdev_get_drvdata (rdev); +u8 regval; +int ret; + +if (!info) +return -EINVAL ; + +if (selector > info->expand_register.voltage_limit) +return -EINVAL ; + +if (selector < info->expand_register.voltage_limit) { + ret =ab8500_regulator_set_voltage_sel (rdev, selector); +if (ret <0 ) +return ret; + + regval =0 ; + }else { + regval = info->expand_register.voltage_mask; + } + + ret =abx500_mask_and_set_register_interruptible (info->dev, + info->expand_register.voltage_bank, + info->expand_register.voltage_reg, + info->expand_register.voltage_mask, regval); +if (ret <0 ) +dev_err (rdev_get_dev (rdev), +"couldn't set voltage expand reg for regulator\n" ); + +return ret; +} +static const struct regulator_ops ab8500_regulator_volt_mode_ops = { .enable = ab8500_regulator_enable, .disable = ab8500_regulator_disable,
@@ -605,6 +682,18 @@ static const struct regulator_ops ab8500_regulator_volt_mode_ops = { .list_voltage = regulator_list_voltage_table, }; +static const struct regulator_ops ab8500_regulator_volt_mode_expand_ops = { + .enable = ab8500_regulator_enable, + .disable = ab8500_regulator_disable, + .is_enabled = ab8500_regulator_is_enabled, + .get_optimum_mode = ab8500_regulator_get_optimum_mode, + .set_mode = ab8500_regulator_set_mode, + .get_mode = ab8500_regulator_get_mode, + .get_voltage_sel = ab8500_regulator_get_voltage_sel_expand, + .set_voltage_sel = ab8500_regulator_set_voltage_sel_expand, + .list_voltage = regulator_list_voltage_table, +}; +static const struct regulator_ops ab8500_regulator_volt_ops = { .enable = ab8500_regulator_enable, .disable = ab8500_regulator_disable,
@@ -908,12 +997,12 @@ static struct ab8500_regulator_info [AB8505_LDO_AUX3] = { .desc = { .name = "LDO-AUX3", - .ops = &ab8500_regulator_volt_mode_ops, + .ops = &ab8500_regulator_volt_mode_expand_ops, .type = REGULATOR_VOLTAGE, .id = AB8505_LDO_AUX3, .owner = THIS_MODULE, - .n_voltages = ARRAY_SIZE(ldo_vaux3_voltages), - .volt_table = ldo_vaux3_voltages, + .n_voltages = ARRAY_SIZE(ldo_vaux3_ab8505_voltages), + .volt_table = ldo_vaux3_ab8505_voltages, }, .load_lp_uA = 5000, .update_bank = 0x04,
@@ -925,6 +1014,12 @@ static struct ab8500_regulator_info .voltage_bank = 0x04, .voltage_reg = 0x21, .voltage_mask = 0x07, + .expand_register = { + .voltage_limit = 8, + .voltage_bank = 0x04, + .voltage_reg = 0x01, + .voltage_mask = 0x10, + }, }, [AB8505_LDO_AUX4] = { .desc = {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1467/2214 regulator: ab8500: Handle AB8505 VINTCORE selector 7
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
[ Upstream commit 4ec4df7e54182edb6955caace37684e535e462dc ]
The AB8505 VINTCORE table exposes only selectors 0 through 6. The hardware also accepts selector 7 and maps it to 1.35 V, just like selector 6. Omitting it can make an OTP-programmed selector 7 appear invalid to the regulator core.
Give AB8505 its own eight-entry selector table while leaving the AB8500 table unchanged.
Reference: AB8505 User Manual, DM00046744 Rev 3, p. 223
--- drivers/regulator/ab8500.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/regulator/ab8500.c +13 -2
@@ -266,6 +266,17 @@ static const unsigned int ldo_vintcore_voltages[] = { 1350000, }; +static const unsigned int ldo_vintcore_ab8505_voltages[] = { +1200000 , +1225000 , +1250000 , +1275000 , +1300000 , +1325000 , +1350000 , +1350000 , +}; +static const unsigned int fixed_1200000_voltage[] = {1200000 , };
@@ -1095,8 +1106,8 @@ static struct ab8500_regulator_info .type = REGULATOR_VOLTAGE, .id = AB8505_LDO_INTCORE, .owner = THIS_MODULE, - .n_voltages = ARRAY_SIZE(ldo_vintcore_voltages), - .volt_table = ldo_vintcore_voltages, + .n_voltages = ARRAY_SIZE(ldo_vintcore_ab8505_voltages), + .volt_table = ldo_vintcore_ab8505_voltages, }, .load_lp_uA = 5000, .update_bank = 0x03,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1468/2214 regulator: ab8500: Treat cut 1.0 VAUX3 as fixed
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
[ Upstream commit b9fc8a8d31b914b09329240f532ff0e9c00cd727 ]
The early-cut workaround currently gives AB8500 cut 1.0 the 16 programmable VAUX3 settings introduced with cut 1.1. On cut 1.0 the selector is not programmable and VAUX3 is fixed at 1.2 V.
Register VAUX3 as a fixed-voltage regulator on cut 1.0 and retain the 16-value workaround only for cut 1.1.
Reference: AB8500 User Manual, UM0836 Rev 3, p. 240
--- drivers/regulator/ab8500.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/regulator/ab8500.c +8 -3
@@ -1783,9 +1783,14 @@ static int ab8500_regulator_register(struct platform_device *pdev, config.driver_data = info; config.of_node = np; -/* fix for hardware before ab8500v2.0 */ -if (is_ab8500_1p1_or_earlier (ab8500)) { -if (info->desc.id ==AB8500_LDO_AUX3 ) { +/* Handle the different VAUX3 implementations in early AB8500 cuts. */ +if (info->desc.id ==AB8500_LDO_AUX3 ) { +if (is_ab8500_1p0_or_earlier (ab8500)) { + info->desc.ops = &ab8500_regulator_mode_ops; + info->desc.n_voltages =1 ; + info->desc.volt_table = fixed_1200000_voltage; + info->voltage_mask =0 ; + }else if (is_ab8500_1p1_or_earlier (ab8500)) { info->desc.n_voltages =ARRAY_SIZE (ldo_vauxn_voltages); info->desc.volt_table = ldo_vauxn_voltages;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1469/2214 regulator: ab8500: Test dedicated enable bits only
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
[ Upstream commit a5ee78846015512b4d3d32f8aa463024a23234ce ]
Some regulator control registers have independent enable and low-power bits. is_enabled() currently tests their combined update mask, so an off regulator with its low-power bit set is incorrectly reported as enabled.
Add an optional enable mask and use it for VINTCORE, AB8500 TVOUT, AB8505 ADC, and AB8505 VAUX5/6. Regulators whose two-bit field encodes the complete operating state continue to test the full update mask.
References: AB8500 User Manual, UM0836 Rev 3, p. 214; AB8505 User Manual, DM00046744 Rev 3, pp. 171-172 and 223
--- drivers/regulator/ab8500.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/regulator/ab8500.c +13 -2
@@ -162,6 +162,7 @@ struct ab8500_shared_mode {* @update_bank: bank to control on/off * @update_reg: register to control on/off * @update_mask: mask to enable/disable and set mode of regulator +* @enable_mask: optional mask for an enable bit separate from the mode bit * @update_val: bits holding the regulator current mode * @update_val_idle: bits to enable the regulator in idle (low power) mode * @update_val_normal: bits to enable the regulator in normal (high power) mode
@@ -183,6 +184,7 @@ struct ab8500_regulator_info {u8 update_bank;u8 update_reg;u8 update_mask; +u8 enable_mask;u8 update_val;u8 update_val_idle;u8 update_val_normal;
@@ -377,6 +379,7 @@ static int ab8500_regulator_is_enabled(struct regulator_dev *rdev) {int ret;struct ab8500_regulator_info *info =rdev_get_drvdata (rdev); +u8 enable_mask;u8 regval;if (info ==NULL ) {
@@ -392,13 +395,15 @@ static int ab8500_regulator_is_enabled(struct regulator_dev *rdev)return ret; } + enable_mask = info->enable_mask ? info->enable_mask : info->update_mask; +dev_vdbg (rdev_get_dev (rdev),"%s-is_enabled (bank, reg, mask, value): 0x%x, 0x%x, 0x%x," " 0x%x\n" , info->desc.name, info->update_bank, info->update_reg, - info->update_mask, regval); + enable_mask, regval); -if (regval & info->update_mask) +if (regval & enable_mask)return 1 ;else return 0 ;
@@ -833,6 +838,7 @@ static struct ab8500_regulator_info .update_bank = 0x03, .update_reg = 0x80, .update_mask = 0x44, + .enable_mask = 0x04, .update_val = 0x44, .update_val_idle = 0x44, .update_val_normal = 0x04,
@@ -861,6 +867,7 @@ static struct ab8500_regulator_info .update_bank = 0x03, .update_reg = 0x80, .update_mask = 0x82, + .enable_mask = 0x02, .update_val = 0x02, .update_val_idle = 0x82, .update_val_normal = 0x02,
@@ -1070,6 +1077,7 @@ static struct ab8500_regulator_info .update_bank = 0x01, .update_reg = 0x55, .update_mask = 0x18, + .enable_mask = 0x10, .update_val = 0x10, .update_val_idle = 0x18, .update_val_normal = 0x10,
@@ -1092,6 +1100,7 @@ static struct ab8500_regulator_info .update_bank = 0x01, .update_reg = 0x56, .update_mask = 0x18, + .enable_mask = 0x10, .update_val = 0x10, .update_val_idle = 0x18, .update_val_normal = 0x10,
@@ -1113,6 +1122,7 @@ static struct ab8500_regulator_info .update_bank = 0x03, .update_reg = 0x80, .update_mask = 0x44, + .enable_mask = 0x04, .update_val = 0x04, .update_val_idle = 0x44, .update_val_normal = 0x04,
@@ -1141,6 +1151,7 @@ static struct ab8500_regulator_info .update_bank = 0x03, .update_reg = 0x80, .update_mask = 0x82, + .enable_mask = 0x02, .update_val = 0x02, .update_val_idle = 0x82, .update_val_normal = 0x02,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1470/2214 regulator: ab8500: Propagate mode enable read errors
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
[ Upstream commit 71ac8878573058e2b85210760ccaeaac90796c35 ]
For regulators whose enable and mode share a state field, set_mode() first reads that field so changing the requested mode does not enable a disabled rail. A register read error is currently treated as true and the driver proceeds to write the new mode, potentially enabling a rail whose state is unknown.
Return the read error without changing the register or cached mode.
References: AB8500 User Manual, UM0836 Rev 3, p. 227; AB8505 User Manual, DM00046744 Rev 3, p. 237
--- drivers/regulator/ab8500.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/regulator/ab8500.c +12 -2
@@ -433,7 +433,7 @@ static unsigned int ab8500_regulator_get_optimum_mode(static int ab8500_regulator_set_mode (struct regulator_dev *rdev,unsigned int mode) { -int ret =0 ; +int enabled, ret =0 ;u8 bank, reg, mask, val;bool lp_mode_req = false;struct ab8500_regulator_info *info =rdev_get_drvdata (rdev);
@@ -490,7 +490,17 @@ static int ab8500_regulator_set_mode(struct regulator_dev *rdev, goto out_unlock; } -if (info->mode_mask ||ab8500_regulator_is_enabled (rdev)) { +if (info->mode_mask) { + enabled =1 ; + }else { + enabled =ab8500_regulator_is_enabled (rdev); +if (enabled <0 ) { + ret = enabled; + goto out_unlock; + } + } + +if (enabled) { ret =abx500_mask_and_set_register_interruptible (info->dev, bank, reg, mask, val);if (ret <0 ) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1471/2214 sit: fix UAF in ipip6_tunnel_del_prl()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 5145bb6a2c2683d541828f86d5321e0565f2e30c ]
When flushing all potential router list (PRL) entries, ipip6_tunnel_del_prl() called call_rcu(&x->rcu_head, prl_list_destroy_rcu) before clearing t->prl.
A concurrent reader in isatap_chksrc() could enter an RCU read-side critical section after call_rcu() but before t->prl is set to NULL, allowing prl_list_destroy_rcu() to free nodes while the reader traverses them.
Clear t->prl using RCU_INIT_POINTER() before invoking call_rcu(). Also use rcu_assign_pointer() when unlinking individual entries.
--- net/ipv6/sit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv6/sit.c +2 -2
@@ -432,7 +432,7 @@ ipip6_tunnel_del_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a) (x =rtnl_dereference (*p)) !=NULL ; p = &x->next) {if (x->addr == a->addr) { - *p = x->next; +rcu_assign_pointer (*p,rtnl_dereference (x->next));kfree_rcu (x, rcu_head); t->prl_count--; goto out;
@@ -443,8 +443,8 @@ ipip6_tunnel_del_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a) x =rtnl_dereference (t->prl);if (x) { t->prl_count =0 ; +RCU_INIT_POINTER (t->prl,NULL );call_rcu (&x->rcu_head, prl_list_destroy_rcu); - t->prl =NULL ; } } out:
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1472/2214 ip_tunnel: use WRITE_ONCE in ip_tunnel_encap_setup
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 88b84cae6b94087d3a9679845fe28ad19c7bef8b ]
Update ip_tunnel_encap_setup() to use WRITE_ONCE() when writing to encap fields (type, sport, dport, flags) and hlen fields. This ensures that concurrent lockless readers (like fill_info) do not see torn writes.
Also remove the unsafe memset() on t->encap which could cause concurrent readers to transiently see zeroed fields. Removing it also fixes a bug where t->encap was left cleared even if ip_encap_hlen() failed, resulting in partial configuration.
--- net/ipv4/ip_tunnel.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
net/ipv4/ip_tunnel.c +6 -8
@@ -476,19 +476,17 @@ int ip_tunnel_encap_setup(struct ip_tunnel *t, {int hlen; -memset (&t->encap,0 ,sizeof (t->encap)); - hlen =ip_encap_hlen (ipencap);if (hlen <0 )return hlen; - t->encap.type = ipencap->type; - t->encap.sport = ipencap->sport; - t->encap.dport = ipencap->dport; - t->encap.flags = ipencap->flags; +WRITE_ONCE (t->encap.type, ipencap->type); +WRITE_ONCE (t->encap.sport, ipencap->sport); +WRITE_ONCE (t->encap.dport, ipencap->dport); +WRITE_ONCE (t->encap.flags, ipencap->flags); - t->encap_hlen = hlen; - t->hlen = t->encap_hlen + t->tun_hlen; +WRITE_ONCE (t->encap_hlen, hlen); +WRITE_ONCE (t->hlen, hlen + t->tun_hlen);return 0 ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1473/2214 crypto: amlogic - Fix dma_map_sg error check
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jack Wang <[email protected]>
[ Upstream commit 45fa321e7de604146603e24ee5bf3c0b766efe46 ]
dma_map_sg return 0 on error.
Stable-dep-of: 6c2373dd818b ("crypto: amlogic - Fix DMA memory leak in cipher error path")
--- drivers/crypto/amlogic/amlogic-gxl-cipher.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/crypto/amlogic/amlogic-gxl-cipher.c +3 -3
@@ -177,7 +177,7 @@ static int meson_cipher(struct skcipher_request *areq)if (areq->src == areq->dst) { nr_sgs =dma_map_sg (mc->dev, areq->src,sg_nents (areq->src),DMA_BIDIRECTIONAL ); -if (nr_sgs <0 ) { +if (!nr_sgs) {dev_err (mc->dev,"Invalid SG count %d\n" , nr_sgs); err = -EINVAL ; goto theend;
@@ -186,14 +186,14 @@ static int meson_cipher(struct skcipher_request *areq) }else { nr_sgs =dma_map_sg (mc->dev, areq->src,sg_nents (areq->src),DMA_TO_DEVICE ); -if (nr_sgs <0 || nr_sgs >MAXDESC -3 ) { +if (!nr_sgs || nr_sgs >MAXDESC -3 ) {dev_err (mc->dev,"Invalid SG count %d\n" , nr_sgs); err = -EINVAL ; goto theend; } nr_sgd =dma_map_sg (mc->dev, areq->dst,sg_nents (areq->dst),DMA_FROM_DEVICE ); -if (nr_sgd <0 || nr_sgd >MAXDESC -3 ) { +if (!nr_sgd || nr_sgd >MAXDESC -3 ) {dev_err (mc->dev,"Invalid SG count %d\n" , nr_sgd); err = -EINVAL ; goto theend;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1474/2214 crypto: amlogic - Fix DMA memory leak in cipher error path
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mohamad Raizudeen <[email protected]>
[ Upstream commit 6c2373dd818b777d0a81eb02acebc03940552dcd ]
A DMA memory leak occurs in meson_cipher() on the mapping error paths. The driver jumps to the end of the function without unmapping the previously mapped source scatterlist and key/IV buffer when the destination apping fails.
Additionally, a memory leak occurs when a scatterlist mapping succeeds but the returned count exceeds the driver's MAXDESC limit. In this case, the driver rejects the mapping without unmapping it. The BIDIRECTIONAL mapping branch also lacks the required 'MAXDESC -3' upper bound check.
Fix this by introducing proper error labels, error_src and error_keyiv and unmap resources immediately inside the calidation checks to ensure all successfully mapped resources are cleaned up before returning the error.
--- drivers/crypto/amlogic/amlogic-gxl-cipher.c | 25 ++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-)
drivers/crypto/amlogic/amlogic-gxl-cipher.c +20 -5
@@ -177,10 +177,13 @@ static int meson_cipher(struct skcipher_request *areq)if (areq->src == areq->dst) { nr_sgs =dma_map_sg (mc->dev, areq->src,sg_nents (areq->src),DMA_BIDIRECTIONAL ); -if (!nr_sgs) { -dev_err (mc->dev,"Invalid SG count %d\n" , nr_sgs); +if (!nr_sgs || nr_sgs >MAXDESC -3 ) { +dev_err (mc->dev,"Invalid BIDIR SG count %d\n" , nr_sgs); err = -EINVAL ; - goto theend; + +if (nr_sgs) +dma_unmap_sg (mc->dev, areq->src,sg_nents (areq->src),DMA_BIDIRECTIONAL ); + goto error_keyiv; } nr_sgd = nr_sgs; }else {
@@ -189,14 +192,20 @@ static int meson_cipher(struct skcipher_request *areq)if (!nr_sgs || nr_sgs >MAXDESC -3 ) {dev_err (mc->dev,"Invalid SG count %d\n" , nr_sgs); err = -EINVAL ; - goto theend; + +if (nr_sgs) +dma_unmap_sg (mc->dev, areq->src,sg_nents (areq->src),DMA_TO_DEVICE ); + goto error_keyiv; } nr_sgd =dma_map_sg (mc->dev, areq->dst,sg_nents (areq->dst),DMA_FROM_DEVICE );if (!nr_sgd || nr_sgd >MAXDESC -3 ) {dev_err (mc->dev,"Invalid SG count %d\n" , nr_sgd); err = -EINVAL ; - goto theend; + +if (nr_sgd) +dma_unmap_sg (mc->dev, areq->dst,sg_nents (areq->dst),DMA_FROM_DEVICE ); + goto error_src; } }
@@ -251,6 +260,12 @@ static int meson_cipher(struct skcipher_request *areq) ivsize, 0); } } + goto theend; + +error_src: +dma_unmap_sg (mc->dev, areq->src,sg_nents (areq->src),DMA_TO_DEVICE ); +error_keyiv: +dma_unmap_single (mc->dev, phykeyiv, keyivlen,DMA_TO_DEVICE ); theend:kfree_sensitive (bkeyiv);kfree_sensitive (backup_iv);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1475/2214 crypto: qat - avoid OOB read when stripping RSA leading zeros
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ahsan Atta <[email protected]>
[ Upstream commit ac508238898058f0b09b18a7891fb31279617781 ]
The logical AND operator uses short-circuit evaluation: the first operand is always evaluated, while the second is evaluated only if the first is true. Because the first operand dereferences a pointer, it may cause an out-of-bounds access before the bounds check in the second operand is evaluated.
Resolve this by checking the vlen prior to the pointer being dereferenced.
--- drivers/crypto/qat/qat_common/qat_asym_algs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/crypto/qat/qat_common/qat_asym_algs.c +4 -4
@@ -934,7 +934,7 @@ static int qat_rsa_set_n(struct qat_rsa_ctx *ctx, const char *value,const char *ptr = value;int ret; -while (!*ptr && vlen) { +while (vlen && !*ptr) { ptr++; vlen--; }
@@ -965,7 +965,7 @@ static int qat_rsa_set_e(struct qat_rsa_ctx *ctx, const char *value,struct device *dev = &GET_DEV (inst->accel_dev);const char *ptr = value; -while (!*ptr && vlen) { +while (vlen && !*ptr) { ptr++; vlen--; }
@@ -991,7 +991,7 @@ static int qat_rsa_set_d(struct qat_rsa_ctx *ctx, const char *value,const char *ptr = value;int ret; -while (!*ptr && vlen) { +while (vlen && !*ptr) { ptr++; vlen--; }
@@ -1014,7 +1014,7 @@ static int qat_rsa_set_d(struct qat_rsa_ctx *ctx, const char *value,static void qat_rsa_drop_leading_zeros (const char **ptr,unsigned int *len) { -while (!**ptr && *len) { +while (*len && !**ptr) { (*ptr)++; (*len)--; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1476/2214 memory: exynos5422-dmc: handle clock enable failures
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiawen Liu <[email protected]>
[ Upstream commit cce46902ea9fcd585cd200fffa3166f63bc571f1 ]
Check the return values of clk_prepare_enable() for fout_bpll and mout_bpll.
If enabling fout_bpll fails, propagate the error. If enabling mout_bpll fails, disable fout_bpll before returning. This keeps the clock enable count balanced on probe error paths.
--- drivers/memory/samsung/exynos5422-dmc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/memory/samsung/exynos5422-dmc.c +9 -2
@@ -1304,8 +1304,15 @@ static int exynos5_dmc_init_clks(struct exynos5_dmc *dmc)if (ret)return ret; -clk_prepare_enable (dmc->fout_bpll); -clk_prepare_enable (dmc->mout_bpll); + ret =clk_prepare_enable (dmc->fout_bpll); +if (ret) +return ret; + + ret =clk_prepare_enable (dmc->mout_bpll); +if (ret) { +clk_disable_unprepare (dmc->fout_bpll); +return ret; + }/* * Some bootloaders do not set clock routes correctly.
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1477/2214 gfs2: Fix journaled truncate range end offset
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
[ Upstream commit a52652efd8f985397e87669f505af83f06e335cf ]
The third argument to truncate_pagecache_range() is the inclusive end offset, but gfs2_journaled_truncate_range() passes the length of each chunk. A hole punch at an offset larger than its length therefore creates an inverted range.
Commit 86066914edff ("gfs2: Don't support fallocate on jdata files") disables fallocate for jdata files. Otherwise, the following bug could occur:
The MM truncation path then underflows the unsigned partial-folio length and passes an oversized range to folio_zero_range(), triggering a BUG. Pass the last byte of the chunk so page-cache invalidation covers the intended range.
--- fs/gfs2/bmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/bmap.c +1 -1
@@ -2387,7 +2387,7 @@ static int gfs2_journaled_truncate_range(struct inode *inode, loff_t offset,if (offs && chunk >PAGE_SIZE ) chunk = offs + ((chunk - offs) &PAGE_MASK ); -truncate_pagecache_range (inode, offset, chunk); +truncate_pagecache_range (inode, offset, offset + chunk -1 ); offset += chunk; length -= chunk;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1478/2214 ACPI: glue: Fix up and adjust acpi_unbind_one()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
[ Upstream commit 693546852656075e0247ac637b05625ead134eff ]
Since none of the acpi_unbind_one() callers check its return value and it always returns 0 anyway, make it void.
Also notice that unlocking physical_node_lock for the given ACPI device should be carried out before dropping the reference to it in case that reference is the last one (highly unlikely), so rearrange the code to make that happen.
--- drivers/acpi/glue.c | 10 ++++++---- include/acpi/acpi_bus.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-)
drivers/acpi/glue.c +6 -4
@@ -252,13 +252,13 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev) }EXPORT_SYMBOL_GPL (acpi_bind_one); -int acpi_unbind_one (struct device *dev) +void acpi_unbind_one (struct device *dev) {struct acpi_device *acpi_dev =ACPI_COMPANION (dev);struct acpi_device_physical_node *entry;if (!acpi_dev) -return 0 ; +return ;mutex_lock (&acpi_dev->physical_node_lock);
@@ -273,15 +273,17 @@ int acpi_unbind_one(struct device *dev)sysfs_remove_link (&acpi_dev->dev.kobj, physnode_name);sysfs_remove_link (&dev->kobj,"firmware_node" );ACPI_COMPANION_SET (dev,NULL ); + +mutex_unlock (&acpi_dev->physical_node_lock); +/* Drop references taken by acpi_bind_one(). */ put_device (dev);acpi_dev_put (acpi_dev);kfree (entry); -break ; +return ; }mutex_unlock (&acpi_dev->physical_node_lock); -return 0 ; }EXPORT_SYMBOL_GPL (acpi_unbind_one);
include/acpi/acpi_bus.h +1 -1
@@ -576,7 +576,7 @@ struct acpi_bus_type {int register_acpi_bus_type (struct acpi_bus_type *);int unregister_acpi_bus_type (struct acpi_bus_type *);int acpi_bind_one (struct device *dev,struct acpi_device *adev); -int acpi_unbind_one (struct device *dev); +void acpi_unbind_one (struct device *dev);struct acpi_pci_root {struct acpi_device * device;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1479/2214 firewire: cdev: Fix FW_CDEV_IOC_CREATE_ISO_CONTEXT references in kernel-doc
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <[email protected]>
[ Upstream commit 0a6cf2b7adcbd362039e9d282f73aff3f24022ca ]
The fw_cdev_event_iso_interrupt and fw_cdev_event_iso_interrupt_mc comments refer to FW_CDEV_CREATE_ISO_CONTEXT, but the ioctl is named FW_CDEV_IOC_CREATE_ISO_CONTEXT.
Correct both references. The misspellings were introduced separately with the userspace interface documentation and multichannel reception support.
--- include/uapi/linux/firewire-cdev.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/uapi/linux/firewire-cdev.h +2 -2
@@ -211,7 +211,7 @@ struct fw_cdev_event_request2 {/** * struct fw_cdev_event_iso_interrupt - Sent when an iso packet was completed * @closure: See &fw_cdev_event_common; -* set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl +* set by %FW_CDEV_IOC_CREATE_ISO_CONTEXT ioctl * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_ISO_INTERRUPT * @cycle: Cycle counter of the last completed packet * @header_length: Total length of following headers, in bytes
@@ -271,7 +271,7 @@ struct fw_cdev_event_iso_interrupt {/** * struct fw_cdev_event_iso_interrupt_mc - An iso buffer chunk was completed * @closure: See &fw_cdev_event_common; -* set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl +* set by %FW_CDEV_IOC_CREATE_ISO_CONTEXT ioctl * @type: %FW_CDEV_EVENT_ISO_INTERRUPT_MULTICHANNEL * @completed: Offset into the receive buffer; data before this offset is valid *
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1480/2214 firewire: core: remove unused link field in fw_packet structure
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Sakamoto <[email protected]>
[ Upstream commit 00d4d31e4fdfe51312f0184f8d162b8d4de172dc ]
The link field in fw_packet structure has never been used since it was added.
--- include/linux/firewire.h | 1 - 1 file changed, 1 deletion(-)
include/linux/firewire.h +0 -1
@@ -309,7 +309,6 @@ struct fw_packet {*/ fw_packet_callback_t callback;int ack; -struct list_head link;void *driver_data; };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1481/2214 cpuidle: menu: Remove incorrect unlikely() annotation
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Leitao <[email protected]>
[ Upstream commit fcbd7897b871e157ee5c595e950c8466d86c0cd5 ]
The unlikely() annotation on the early-return condition in menu_select() is incorrect on systems with only one idle state (e.g., ARM64 servers with a single ACPI LPI state). Branch profiling shows 100% misprediction on such systems since drv->state_count <= 1 is always true.
On platforms where only state0 is available, this path is the common case, not an unlikely edge case. Remove the misleading annotation to let the branch predictor learn the actual behavior.
Stable-dep-of: d594187cafd5 ("cpuidle: menu: Do not return a disabled idle state")
--- drivers/cpuidle/governors/menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpuidle/governors/menu.c +1 -1
@@ -314,7 +314,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev, nr_iowaiters =nr_iowait_cpu (dev->cpu); data->bucket =which_bucket (data->next_timer_ns, nr_iowaiters); -if (unlikely (drv->state_count <=1 || latency_req ==0 ) || +if (drv->state_count <=1 || latency_req ==0 || ((data->next_timer_ns < drv->states[1 ].target_residency_ns || latency_req < drv->states[1 ].exit_latency_ns) && !dev->states_usage[0 ].disable)) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1482/2214 cpuidle: menu: Remove single state handling
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Loehle <[email protected]>
[ Upstream commit 93983a9f3beea791c21d77c2425488ad327d4fda ]
cpuidle systems where the governor has no choice because there's only a single idle state are now handled by cpuidle core and bypass the governor, so remove the related handling.
Stable-dep-of: d594187cafd5 ("cpuidle: menu: Do not return a disabled idle state")
--- drivers/cpuidle/governors/menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpuidle/governors/menu.c +1 -1
@@ -314,7 +314,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev, nr_iowaiters =nr_iowait_cpu (dev->cpu); data->bucket =which_bucket (data->next_timer_ns, nr_iowaiters); -if (drv->state_count <=1 || latency_req ==0 || +if (latency_req ==0 || ((data->next_timer_ns < drv->states[1 ].target_residency_ns || latency_req < drv->states[1 ].exit_latency_ns) && !dev->states_usage[0 ].disable)) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1483/2214 cpuidle: menu: Do not return a disabled idle state
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xueqin Luo <[email protected]>
[ Upstream commit d594187cafd5ad65afc5f00242f8fa20e1d8c0f1 ]
When idle state 0 is disabled and the PM QoS latency constraint is zero (latency_req == 0), the first branch of the || in the early-return condition of menu_select() is taken immediately, so state 0 is returned regardless of its disable flag.
Address this by making the !disable check a prerequisite for the entire early-return condition, so that when state 0 is disabled the normal state selection loop is used instead, which already skips disabled states.
--- drivers/cpuidle/governors/menu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/cpuidle/governors/menu.c +4 -4
@@ -314,10 +314,10 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev, nr_iowaiters =nr_iowait_cpu (dev->cpu); data->bucket =which_bucket (data->next_timer_ns, nr_iowaiters); -if (latency_req ==0 || - ((data->next_timer_ns < drv->states[1 ].target_residency_ns || - latency_req < drv->states[1 ].exit_latency_ns) && - !dev->states_usage[0 ].disable)) { +if (!dev->states_usage[0 ].disable && + (latency_req ==0 || + data->next_timer_ns < drv->states[1 ].target_residency_ns || + latency_req < drv->states[1 ].exit_latency_ns)) {/* * In this case state[0] will be used no matter what, so return * it right away and keep the tick running if state[0] is a
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1484/2214 ARM: dts: stm32: lxa-mc1: change stdout-path baud rate from 9600 to 115200
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ahmad Fatoum <[email protected]>
[ Upstream commit fc3c0ffefc169719316eddb8c36e2427e11ce713 ]
The default baud rate when none is specified is up to the DT consumer.
In the case of the Linux STM32 serial driver, it defaults to 9600 baud, which differs from the 115200 baud that this board's barebox bootloader configured.
This went unnoticed, because barebox automatically fixes up a console= command-line option that looks like this on the LXA boards:
console=ttySTM0,115200n8
This had precedence over the 9600 fallback baud rate.
But when EFI booting a kernel via GRUB, we run into this issue, because the barebox-provided command-line is disregarded by GRUB.
Fix this by explicitly setting the baud rate to the correct 115200.
--- arch/arm/boot/dts/stm32mp157c-lxa-mc1.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/stm32mp157c-lxa-mc1.dts +1 -1
@@ -33,7 +33,7 @@ backlight: backlight { }; chosen { - stdout-path = &uart4; + stdout-path = "serial0:115200n8"; }; led-controller-0 {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1485/2214 cpuidle: teo: Do not return a disabled idle state
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xueqin Luo <[email protected]>
[ Upstream commit 60d5fca628f94f8f23398ad62d80aa284dae6571 ]
If idle state 0 is disabled and none of the enabled idle states satisfies the PM QoS latency constraint, constraint_idx in teo_select() stays at its initial value of 0, because the loop that updates it starts at state 1, and so the candidate state index is capped at state 0, which is disabled, and that state is returned to the caller.
The cpuidle core does not validate the returned state index against the per-state disable flags, so the CPU ends up entering the disabled state 0.
To address this, ensure that constraint_idx is at least equal to the index of the first enabled idle state (idx0), so that the candidate state is never capped to a disabled one.
--- drivers/cpuidle/governors/teo.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/cpuidle/governors/teo.c +11 -0
@@ -445,6 +445,17 @@ static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev, } } +/* +* If the latency constraint does not allow any of the enabled idle +* states to be used, the candidate state index will be capped to 0 +* by the check below, but state 0 may be disabled. To prevent the +* selection of a disabled state in that case, ensure that +* constraint_idx is at least equal to the index of the first +* enabled idle state. +*/ +if (constraint_idx < idx0) + constraint_idx = idx0; +/* * If there is a latency constraint, it may be necessary to select an * idle state shallower than the current candidate one.
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1486/2214 ARM: dts: stm32: Drop bias-disable from STM32MP15xx DHCOM SoM sdmmc1_b4_pins_a
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <[email protected]>
[ Upstream commit 3572825773791f4258b553391f4e2187df321731 ]
Drop bias-disable property from STM32MP15xx DHCOM SoM sdmmc1_b4_pins_a to fix the following DT checker warning. The bias-pull-up property is the only bias-related property that has to be present in those pinctrl node subnodes.
"arch/arm/boot/dts/st/stm32mp153c-dhcom-drc02.dtb: pinctrl@50002000 (st,stm32mp157-pinctrl): sdmmc1-b4-0:pins1: {'pinmux': [10253, 10509, 10765, 11021, 12813], 'slew-rate': 1, 'drive-push-pull': True, 'bias-disable': True, 'bias-pull-up': True} is valid under each of {'required': ['bias-pull-up']}, {'required': ['bias-disable']} "
--- arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi +2 -0
@@ -481,9 +481,11 @@ &sdmmc1_b4_pins_a { * - mandatory on SoMs without SD voltage translator */ pins1 { + /delete-property/ bias-disable; bias-pull-up; }; pins2 { + /delete-property/ bias-disable; bias-pull-up; }; };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1487/2214 ARM: dts: imx7-tqma7: add SPI-NOR flash
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthias Schiffer <[email protected]>
[ Upstream commit 61b2f7b15839f5d6b4838a44b6faaff9957e98e7 ]
The SPI-NOR flash on the SoM was missing from the device tree.
The TQMa7 as a designated QSPI_RESET# pin, however depending on the hardware configuration the pin may be unconnected, or be used for a different purpose. With this in mind, we mux the pin as a pullup and define an input hog for it, but keep it a separate pin group, so that it is easy for dependent Device Trees to modify the configuration.
Stable-dep-of: f322f8f68c2c ("ARM: dts: imx7-tqma7: correctly specify PMIC voltage constraints")
--- arch/arm/boot/dts/imx7-tqma7.dtsi | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+)
arch/arm/boot/dts/imx7-tqma7.dtsi +43 -0
@@ -19,6 +19,16 @@ &cpu0 { cpu-supply = <&sw1a_reg>; }; +&gpio2 { + /* Configured as pullup by QSPI pin group */ + qspi-reset-hog { + gpio-hog; + gpios = <4 GPIO_ACTIVE_LOW>; + input; + line-name = "qspi-reset"; + }; +}; + &i2c1 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c1>;
@@ -160,6 +170,25 @@ MX7D_PAD_SD2_RESET_B__GPIO5_IO11 0x4000005C >; }; + pinctrl_qspi: qspigrp { + fsl,pins = < + MX7D_PAD_EPDC_DATA00__QSPI_A_DATA0 0x5A + MX7D_PAD_EPDC_DATA01__QSPI_A_DATA1 0x5A + MX7D_PAD_EPDC_DATA02__QSPI_A_DATA2 0x5A + MX7D_PAD_EPDC_DATA03__QSPI_A_DATA3 0x5A + MX7D_PAD_EPDC_DATA05__QSPI_A_SCLK 0x11 + MX7D_PAD_EPDC_DATA06__QSPI_A_SS0_B 0x54 + MX7D_PAD_EPDC_DATA07__QSPI_A_SS1_B 0x54 + >; + }; + + pinctrl_qspi_reset: qspi_resetgrp { + fsl,pins = < + /* #QSPI_RESET */ + MX7D_PAD_EPDC_DATA04__GPIO2_IO4 0x52 + >; + }; + pinctrl_usdhc3: usdhc3grp { fsl,pins = < MX7D_PAD_SD3_CMD__SD3_CMD 0x59
@@ -217,6 +246,20 @@ MX7D_PAD_LPSR_GPIO1_IO00__WDOG1_WDOG_B 0x30 }; }; +&qspi { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_qspi &pinctrl_qspi_reset>; + status = "okay"; + + flash0: flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <29000000>; + spi-rx-bus-width = <4>; + spi-tx-bus-width = <4>; + }; +}; + &sdma { status = "okay"; };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1488/2214 ARM: dts: imx7-tqma7: correctly specify PMIC voltage constraints
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nora Schiffer <[email protected]>
[ Upstream commit f322f8f68c2c3291633ead663effa3b25c18f7b1 ]
regulator-(min|max)-microvolt refer to the supported voltages according to board design, not the possible range of the regulators themselves. Update the configuration for the TQMa7x's PMIC and also add a comment regarding the PMIC's VCC_SD switching feature.
--- arch/arm/boot/dts/imx7-tqma7.dtsi | 40 ++++++++++++++++++------------- 1 file changed, 23 insertions(+), 17 deletions(-)
arch/arm/boot/dts/imx7-tqma7.dtsi +23 -17
@@ -43,8 +43,8 @@ pfuze3000: pmic@8 { regulators { sw1a_reg: sw1a { - regulator-min-microvolt = <700000>; - regulator-max-microvolt = <3300000>; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1225000>; regulator-boot-on; regulator-always-on; regulator-ramp-delay = <6250>;
@@ -52,34 +52,33 @@ sw1a_reg: sw1a { /* use sw1c_reg to align with pfuze100/pfuze200 */ sw1c_reg: sw1b { - regulator-min-microvolt = <700000>; - regulator-max-microvolt = <1475000>; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1000000>; regulator-boot-on; regulator-always-on; regulator-ramp-delay = <6250>; }; sw2_reg: sw2 { - regulator-min-microvolt = <1500000>; - regulator-max-microvolt = <1850000>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; regulator-boot-on; regulator-always-on; }; sw3a_reg: sw3 { - regulator-min-microvolt = <900000>; - regulator-max-microvolt = <1650000>; + regulator-min-microvolt = <1350000>; + regulator-max-microvolt = <1350000>; regulator-boot-on; regulator-always-on; }; swbst_reg: swbst { - regulator-min-microvolt = <5000000>; - regulator-max-microvolt = <5150000>; + /* Not connected and left unconfigured */ }; snvs_reg: vsnvs { - regulator-min-microvolt = <1000000>; + regulator-min-microvolt = <3000000>; regulator-max-microvolt = <3000000>; regulator-boot-on; regulator-always-on;
@@ -92,18 +91,25 @@ vref_reg: vrefddr { vgen1_reg: vldo1 { regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3300000>; + regulator-max-microvolt = <1800000>; regulator-always-on; }; vgen2_reg: vldo2 { - regulator-min-microvolt = <800000>; - regulator-max-microvolt = <1550000>; + regulator-min-microvolt = <1500000>; + regulator-max-microvolt = <1500000>; regulator-always-on; }; vgen3_reg: vccsd { - regulator-min-microvolt = <2850000>; + /* + * Specified values refer to 3.3V operation; voltage for 1.8V + * operation is derived from this. + * + * The base board should usually mux GPIO1_IO08 to SD1_VSELECT for + * automatic switching of SD card IO voltage. + */ + regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-always-on; };
@@ -115,13 +121,13 @@ vgen4_reg: v33 { }; vgen5_reg: vldo3 { - regulator-min-microvolt = <1800000>; + regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-always-on; }; vgen6_reg: vldo4 { - regulator-min-microvolt = <1800000>; + regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-always-on; };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1489/2214 x86/svm: Avoid sign extension of SVM_EVTINJ_VALID in 64-bit expressions
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chaithanya Lagisetty <[email protected]>
[ Upstream commit c5991239b148d40d4981901968b3a6a838ff517b ]
SVM_EVTINJ_VALID is defined as (1 << 31), i.e. as an int with the sign bit set. Whenever it is used in a 64-bit expression the int is sign extended, so bits 63:32 end up set as well. Two 64-bit users are affected.
verify_exception_info() uses the macro as a mask against a 64-bit value when it sanity checks hypervisor supplied exception information:
u64 info = ghcb->save.sw_exit_info_2; ... if ((info & SVM_EVTINJ_VALID) &&
The mask is 0xffffffff80000000, so the check also passes when any bit of the error code in 63:32 is set while the valid bit itself is clear.
svm_vmgexit_inject_exception() builds the value that KVM hands to an SEV-ES guest in GHCB SW_EXITINFO2:
u64 data = SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_EXEPT | vector;
For vector == X86_TRAP_GP this yields 0xffffffff8000030d instead of 0x000000008000030d. The field uses the EVENTINJ format, which holds the error code in bits 63:32, so KVM asks the guest to inject #GP with an error code of 0xffffffff. Linux guests only consume the error code when SVM_EVTINJ_VALID_ERR is set, which it is not here, so they are not affected in practice, but the value KVM writes is not the one it intends.
Use BIT() instead, as is already done for most single bit definitions in this header. Every other user applies the macro to a u32, where the resulting bits are unchanged.
Opportunistically give SVM_EVTINJ_VALID_ERR the same treatment, there's zero reason to open code BIT().
--- arch/x86/include/asm/svm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/svm.h +2 -2
@@ -372,8 +372,8 @@ struct vmcb {#define SVM_EVTINJ_TYPE_EXEPT (3 << SVM_EVTINJ_TYPE_SHIFT)#define SVM_EVTINJ_TYPE_SOFT (4 << SVM_EVTINJ_TYPE_SHIFT) -#define SVM_EVTINJ_VALID (1 << 31) -#define SVM_EVTINJ_VALID_ERR (1 << 11) +#define SVM_EVTINJ_VALID BIT(31) +#define SVM_EVTINJ_VALID_ERR BIT(11)#define SVM_EXITINTINFO_VEC_MASK SVM_EVTINJ_VEC_MASK#define SVM_EXITINTINFO_TYPE_MASK SVM_EVTINJ_TYPE_MASK
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1490/2214 spi: Fix the return value in spi_new_ancillary_device() kernel-doc
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <[email protected]>
[ Upstream commit 3742867ce96539100ed5f4c754f04273d8aa00d7 ]
spi_new_ancillary_device() returns the new struct spi_device, or an ERR_PTR() on failure, but its kernel-doc says "0 on success; negative errno on failure", which was never true. Describe the pointer.
--- drivers/spi/spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi.c +1 -1
@@ -2230,7 +2230,7 @@ static void of_register_spi_devices(struct spi_controller *ctlr) { }* * This may only be called from main SPI device's probe routine. * -* Return: 0 on success; negative errno on failure +* Return: the new device on success; an ERR_PTR() on failure */ struct spi_device *spi_new_ancillary_device (struct spi_device *spi,u8 chip_select)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1491/2214 ata: libata-scsi: Fix ata_scsi_hotplug() reference in kernel-doc
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <[email protected]>
[ Upstream commit 5915ab523e33057224a0240e27b88c6c2798b919 ]
The ata_scsi_remove_dev() comment misspells its caller as ata_eh_scsi_hotplug(). The caller is ata_scsi_hotplug(). Correct the reference, which predates libata's move from drivers/scsi to drivers/ata.
--- drivers/ata/libata-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/libata-scsi.c +1 -1
@@ -4413,7 +4413,7 @@ int ata_scsi_offline_dev(struct ata_device *dev)* ata_scsi_remove_dev - remove attached SCSI device * @dev: ATA device to remove attached SCSI device for * -* This function is called from ata_eh_scsi_hotplug() and +* This function is called from ata_scsi_hotplug() and * responsible for removing the SCSI device attached to @dev. * * LOCKING:
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1492/2214 gfs2: Fix the return value in gfs2_get_link() kernel-doc
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <[email protected]>
[ Upstream commit 700a0a6892f7c0c541d5d23837cfab98cc744d17 ]
gfs2_get_link() returns the link target or an error pointer, but its kernel-doc still describes an integer status. The mismatch dates back to when gfs2_readlink() was replaced by generic_readlink() and persisted across the removal of nd_set_link().
Describe the returned pointer and error value.
--- fs/gfs2/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/inode.c +1 -1
@@ -1783,7 +1783,7 @@ static int gfs2_rename2(struct user_namespace *mnt_userns, struct inode *odir,* * This can handle symlinks of any size. * -* Returns: 0 on success or error code +* Returns: the link target on success, an ERR_PTR() on failure */ static const char *gfs2_get_link(struct dentry *dentry,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1493/2214 ALSA: control: Fix virtual master creation reference in kernel-doc
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <[email protected]>
[ Upstream commit a347cc458d97ecd8adb5462b91559682a70aced6 ]
The snd_ctl_add_follower() comment refers to snd_ctl_create_virtual_master(), but virtual master controls are created with snd_ctl_make_virtual_master(). Correct the helper name.
--- include/sound/control.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/sound/control.h +1 -1
@@ -218,7 +218,7 @@ int _snd_ctl_add_follower(struct snd_kcontrol *master,* @follower: follower element to add * * Add a virtual follower control to the given master element created via -* snd_ctl_create_virtual_master() beforehand. +* snd_ctl_make_virtual_master() beforehand. * * All followers must be the same type (returning the same information * via info callback). The function doesn't check it, so it's your
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1494/2214 ACPI: video: Fix backlight unregistration ordering
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
[ Upstream commit 46577d36611953d1b99e86493289cfc824116ad2 ]
In acpi_video_dev_unregister_backlight(), the sysfs interface of the cooling class device may access the brightness object under the backlight device's ACPI companion, so that object cannot be freed before unregistering the cooling class device.
Adjust the code to take that into account.
--- drivers/acpi/acpi_video.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/acpi/acpi_video.c +6 -6
@@ -1916,6 +1916,12 @@ static int acpi_video_bus_register_backlight(struct acpi_video_bus *video)static void acpi_video_dev_unregister_backlight (struct acpi_video_device *device) { +if (device->cooling_dev) { +sysfs_remove_link (&device->dev->dev.kobj,"thermal_cooling" ); +sysfs_remove_link (&device->cooling_dev->device.kobj,"device" ); +thermal_cooling_device_unregister (device->cooling_dev); + device->cooling_dev =NULL ; + }if (device->backlight) {backlight_device_unregister (device->backlight); device->backlight =NULL ;
@@ -1925,12 +1931,6 @@ static void acpi_video_dev_unregister_backlight(struct acpi_video_device *devicekfree (device->brightness); device->brightness =NULL ; } -if (device->cooling_dev) { -sysfs_remove_link (&device->dev->dev.kobj,"thermal_cooling" ); -sysfs_remove_link (&device->cooling_dev->device.kobj,"device" ); -thermal_cooling_device_unregister (device->cooling_dev); - device->cooling_dev =NULL ; - } }static int acpi_video_bus_unregister_backlight (struct acpi_video_bus *video)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1495/2214 perf header: Fix potential memory corruption in cpu_cache_level__read
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ian Rogers <[email protected]>
[ Upstream commit d964ffba01f5d0935dd6bc850029958a62c74491 ]
strim() may advance the pointer assigned to cache->size which causes later frees to crash.
Fix by performing the strim and then memmove-ing the potentially shifted string back over the original string.
The bug was introduced by the transition from rtrim() to strim(), as rtrim() wouldn't move on the left.
--- tools/perf/util/header.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
tools/perf/util/header.c +15 -3
@@ -1126,7 +1126,11 @@ static int cpu_cache_level__read(struct cpu_cache_level *cache, u32 cpu, u16 levreturn -1 ; cache->type[len] =0 ; - cache->type =strim (cache->type); + { +char *trimmed =strim (cache->type); + +memmove (cache->type, trimmed,strlen (trimmed) +1 ); + }scnprintf (file,PATH_MAX ,"%s/size" , path);if (sysfs__read_str (file, &cache->size, &len)) {
@@ -1135,7 +1139,11 @@ static int cpu_cache_level__read(struct cpu_cache_level *cache, u32 cpu, u16 lev } cache->size[len] =0 ; - cache->size =strim (cache->size); + { +char *trimmed =strim (cache->size); + +memmove (cache->size, trimmed,strlen (trimmed) +1 ); + }scnprintf (file,PATH_MAX ,"%s/shared_cpu_list" , path);if (sysfs__read_str (file, &cache->map, &len)) {
@@ -1145,7 +1153,11 @@ static int cpu_cache_level__read(struct cpu_cache_level *cache, u32 cpu, u16 lev } cache->map[len] =0 ; - cache->map =strim (cache->map); + { +char *trimmed =strim (cache->map); + +memmove (cache->map, trimmed,strlen (trimmed) +1 ); + }return 0 ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1496/2214 ntfs3: Remove calls to set/clear the error flag
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Wilcox (Oracle) <[email protected]>
[ Upstream commit 326a6fd9600c52016c3c18c1aeafca2fab254146 ]
Nobody checks the error flag on ntfs3 folios, so stop setting and clearing it.
Stable-dep-of: a32e893a077a ("fs/ntfs3: zero frame pages on read error")
--- fs/ntfs3/frecord.c | 4 ---- 1 file changed, 4 deletions(-)
fs/ntfs3/frecord.c +0 -4
@@ -2122,9 +2122,6 @@ int ni_readpage_cmpr(struct ntfs_inode *ni, struct page *page) err =ni_read_frame (ni, frame_vbo, pages, pages_per_frame); out1: -if (err) -SetPageError (page); -for (i =0 ; i < pages_per_frame; i++) { pg = pages[i];if (i == idx || !pg)
@@ -2708,7 +2705,6 @@ int ni_read_frame(struct ntfs_inode *ni, u64 frame_vbo, struct page **pages,for (i =0 ; i < pages_per_frame; i++) { pg = pages[i];kunmap (pg); -ClearPageError (pg);SetPageUptodate (pg); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1497/2214 ntfs: Do not kmap page cache pages for compression
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Wilcox (Oracle) <[email protected]>
[ Upstream commit 953b79a7a124c3dae86544cea581a5bc7655aa13 ]
These pages are accessed through vmap; they are not accessed by calling page_address(), so they do not need to be kmapped.
Stable-dep-of: a32e893a077a ("fs/ntfs3: zero frame pages on read error")
--- fs/ntfs3/frecord.c | 11 ----------- 1 file changed, 11 deletions(-)
fs/ntfs3/frecord.c +0 -11
@@ -2446,9 +2446,6 @@ int ni_read_frame(struct ntfs_inode *ni, u64 frame_vbo, struct page **pages,* To simplify decompress algorithm do vmap for source * and target pages. */ -for (i =0 ; i < pages_per_frame; i++) -kmap (pages[i]); - frame_size = pages_per_frame <<PAGE_SHIFT ; frame_mem =vmap (pages, pages_per_frame,VM_MAP ,PAGE_KERNEL );if (!frame_mem) {
@@ -2704,7 +2701,6 @@ int ni_read_frame(struct ntfs_inode *ni, u64 frame_vbo, struct page **pages, out:for (i =0 ; i < pages_per_frame; i++) { pg = pages[i]; -kunmap (pg);SetPageUptodate (pg); }
@@ -2791,9 +2787,6 @@ int ni_write_frame(struct ntfs_inode *ni, struct page **pages, goto out1; } -for (i =0 ; i < pages_per_frame; i++) -kmap (pages[i]); -/* Map in-memory frame for read-only. */ frame_mem =vmap (pages, pages_per_frame,VM_MAP ,PAGE_KERNEL_RO );if (!frame_mem) {
@@ -2859,11 +2852,7 @@ int ni_write_frame(struct ntfs_inode *ni, struct page **pages, out3:vunmap (frame_mem); - out2: -for (i =0 ; i < pages_per_frame; i++) -kunmap (pages[i]); -vunmap (frame_ondisk); out1:for (i =0 ; i < pages_per_frame; i++) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1498/2214 fs/ntfs3: zero frame pages on read error
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weiming Shi <[email protected]>
[ Upstream commit a32e893a077a4b0d3b04c86cb7f69e354a187995 ]
ni_read_frame() marks every frame page uptodate at the 'out:' label regardless of the return value. The pages come from ntfs_lock_new_page() and are not zeroed, and several error paths reach 'out:' before anything is written to them (e.g. a failed decompress_lznt()/decompress_lzx_xpress() on a corrupted chunk, or an allocation failure).
A page marked uptodate is served directly from the page cache, so a later read() of the file returns the uninitialized page contents to userspace. On a crafted compressed image this leaks kernel memory, including pointers.
Zero each page on the error path before marking it uptodate. The success path is unchanged.
--- fs/ntfs3/frecord.c | 2 ++ 1 file changed, 2 insertions(+)
fs/ntfs3/frecord.c +2 -0
@@ -2701,6 +2701,8 @@ int ni_read_frame(struct ntfs_inode *ni, u64 frame_vbo, struct page **pages, out:for (i =0 ; i < pages_per_frame; i++) { pg = pages[i]; +if (err) +clear_highpage (pg);SetPageUptodate (pg); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1499/2214 microblaze: uaccess: Zero out destination on failed get_user()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Weißschuh <[email protected]>
[ Upstream commit 54c35131e628e1a18f02365495a24a73a1fb515e ]
On failure get_user() is supposed to zero out the destination variable. This is documented in the kdoc of the microblaze get_user() implementation and validated in lib/tests/usercopy_kunit.c.
Currently that zeroing is missing.
Add it.
--- arch/microblaze/include/asm/uaccess.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/microblaze/include/asm/uaccess.h +2 -1
@@ -125,7 +125,8 @@ extern long __user_bad(void);#define get_user (x, ptr) ({ \ const typeof(*(ptr)) __user *__gu_ptr = (ptr); \ access_ok(__gu_ptr, sizeof(*__gu_ptr)) ? \ - __get_user(x, __gu_ptr) : -EFAULT; \ + __get_user(x, __gu_ptr) : \ + ((x) = 0, -EFAULT); \ })#define __get_user (x, ptr) \
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1500/2214 microblaze: Pass -m{big,little}-endian through KBUILD_CPPFLAGS
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Weißschuh <[email protected]>
[ Upstream commit b9eababe8c0b9f71ce7f35f903879a7fcb6daebe ]
These parameters are also necessary for preprocessed files which do not contain code. One example is arch/microblaze/kernel/vmlinux.lds.S which inspects __MICROBLAZEEL__ for the definition of 'jiffies_64'. As currently the endianness is not passed from the build system for this file, the preprocessor will instead use the default endianness of the toolchain. When a default big-endian toolchain is used to build a little-endian kernel, that kernel will hang during delay calibration as 'jiffies' never changes.
Make sure all preprocessor invocations know about the correct endianness by passing it through KBUILD_CPPFLAGS. This will also be inherited by CFLAGS and AFLAGS.
--- arch/microblaze/Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
arch/microblaze/Makefile +2 -4
@@ -34,12 +34,10 @@ CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_BARREL) += -mxl-barrel-shift CPUFLAGS-$(CONFIG_XILINX_MICROBLAZE0_USE_PCMP_INSTR) += -mxl-pattern-compare ifdef CONFIG_CPU_BIG_ENDIAN -KBUILD_CFLAGS += -mbig-endian -KBUILD_AFLAGS += -mbig-endian +KBUILD_CPPFLAGS += -mbig-endian KBUILD_LDFLAGS += -EB else -KBUILD_CFLAGS += -mlittle-endian -KBUILD_AFLAGS += -mlittle-endian +KBUILD_CPPFLAGS += -mlittle-endian KBUILD_LDFLAGS += -EL endif
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1501/2214 wifi: mac80211: Fix the return value in mesh_path_add() kernel-doc
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <[email protected]>
[ Upstream commit 5c7b043cb1ef4bca9aa2e793dab862c0989d59c3 ]
mesh_path_add() has returned the new (or the already existing) struct mesh_path, or an ERR_PTR(), since commit ae76eef027f7 ("mac80211: return new mpath from mesh_path_add()"), but its kernel-doc still says "Returns: 0 on success". Describe the pointer.
--- net/mac80211/mesh_pathtbl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/mesh_pathtbl.c +1 -1
@@ -386,7 +386,7 @@ struct mesh_path *mesh_path_new(struct ieee80211_sub_if_data *sdata,* @dst: destination address of the path (ETH_ALEN length) * @sdata: local subif * -* Returns: 0 on success +* Returns: the new or the existing path on success, an ERR_PTR() on failure * * State: the initial state of the new path is set to 0 */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1502/2214 firmware: imx: dsp: fix mailbox channel leak on kasprintf failure
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linkai Gong <[email protected]>
[ Upstream commit e3631d0242842940f9e902afaea98202e56277e8 ]
If kasprintf() fails while setting up mailbox channels, already requested channels from earlier iterations were never freed. Route the failure through the existing cleanup path.
--- drivers/firmware/imx/imx-dsp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/firmware/imx/imx-dsp.c +4 -2
@@ -100,8 +100,10 @@ static int imx_dsp_setup_channels(struct imx_dsp_ipc *dsp_ipc)else chan_name =kasprintf (GFP_KERNEL ,"rxdb%d" , i -2 ); -if (!chan_name) -return -ENOMEM ; +if (!chan_name) { + ret = -ENOMEM ; + goto out; + } dsp_chan = &dsp_ipc->chans[i]; dsp_chan->name = chan_name;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1503/2214 phy: cadence: Sierra: Do not modify register when getting parent clock
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gregory CLEMENT <[email protected]>
[ Upstream commit 955e68eb3067842067b7b5395a3f8c278428802a ]
The get_parent() callback for the PLL_CMNLC1 clock was incorrectly writing to the register while determining the parent clock index. This unintended register access forces the PHY back into training mode. If the PHY is already configured, this unexpected change prevents it from exiting training mode.
Remove the register write operation to ensure the PHY remains stable during the get_parent() callback.
--- drivers/phy/cadence/phy-cadence-sierra.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/phy/cadence/phy-cadence-sierra.c +2 -9
@@ -439,23 +439,16 @@ static const struct phy_ops ops = {static u8 cdns_sierra_pll_mux_get_parent (struct clk_hw *hw) {struct cdns_sierra_pll_mux *mux =to_cdns_sierra_pll_mux (hw); -struct regmap_field *plllc1en_field = mux->plllc1en_field; -struct regmap_field *termen_field = mux->termen_field;struct regmap_field *field = mux->pfdclk_sel_preg;unsigned int val;int index;regmap_field_read (field, &val); -if (strstr (clk_hw_get_name (hw), clk_names[CDNS_SIERRA_PLL_CMNLC1 ])) { +if (strstr (clk_hw_get_name (hw), clk_names[CDNS_SIERRA_PLL_CMNLC1 ])) index =clk_mux_val_to_index (hw, cdns_sierra_pll_mux_table[CMN_PLLLC1 ],0 , val); -if (index ==1 ) { -regmap_field_write (plllc1en_field,1 ); -regmap_field_write (termen_field,1 ); - } - }else { +else index =clk_mux_val_to_index (hw, cdns_sierra_pll_mux_table[CMN_PLLLC ],0 , val); - }return index; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1504/2214 memory: emif: Convert to platform remove callback returning void
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uwe Kleine-König <[email protected]>
[ Upstream commit c8a53461990cb697ca494d6671fab9e196d20ce4 ]
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Stable-dep-of: 314ef67d6732 ("memory: emif: fix device_node reference leak on np_ddr")
--- drivers/memory/emif.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/memory/emif.c +2 -4
@@ -1170,13 +1170,11 @@ static int __init_or_module emif_probe(struct platform_device *pdev)return -ENODEV ; } -static int __exit emif_remove(struct platform_device *pdev) +static void __exit emif_remove(struct platform_device *pdev) {struct emif_data *emif =platform_get_drvdata (pdev);emif_debugfs_exit (emif); - -return 0 ; }static void emif_shutdown (struct platform_device *pdev)
@@ -1196,7 +1194,7 @@ MODULE_DEVICE_TABLE(of, emif_of_match);#endif static struct platform_driver emif_driver = { - .remove =__exit_p (emif_remove), + .remove_new =__exit_p (emif_remove), .shutdown = emif_shutdown, .driver = { .name ="emif" ,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1505/2214 memory: emif: fix device_node reference leak on np_ddr
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miles Krause <[email protected]>
[ Upstream commit 314ef67d673284d4c070455bd62d332f6d0f8634 ]
of_get_memory_device_details() takes a reference on the DDR device node via of_parse_phandle() and stores it in emif->np_ddr for later use, but drops that reference without calling of_node_put() on two error paths: the devm_kzalloc() allocation-failure check and the is_dev_data_valid() check. Both return NULL immediately, leaking the node reference each time either failure triggers.
The same reference is also never released on the success path: it is kept for the life of the bound device (compared against a later instance's np_ddr in the duplicate-DDR-geometry check) but emif_remove() never calls of_node_put() on it, leaking it every time an EMIF device unbinds. of_node_put() on a NULL pointer is a no-op, so this is also safe for the non-DT get_device_details() path, where np_ddr is left NULL by devm_kzalloc().
--- drivers/memory/emif.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/memory/emif.c +3 -0
@@ -937,6 +937,7 @@ static struct emif_data * __init_or_module of_get_memory_device_details(if (!emif || !pd || !dev_info) {dev_err (dev,"%s: Out of memory!!\n" , __func__); +of_node_put (np_ddr); goto error; }
@@ -961,6 +962,7 @@ static struct emif_data * __init_or_module of_get_memory_device_details( pd->device_info->io_width, pd->phy_type, pd->ip_rev, emif->dev)) {dev_err (dev,"%s: invalid device data!!\n" , __func__); +of_node_put (np_ddr); goto error; }/*
@@ -1175,6 +1177,7 @@ static void __exit emif_remove(struct platform_device *pdev)struct emif_data *emif =platform_get_drvdata (pdev);emif_debugfs_exit (emif); +of_node_put (emif->np_ddr); }static void emif_shutdown (struct platform_device *pdev)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1506/2214 RDMA/uverbs: Make CQ handle mandatory for WQ creation
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <[email protected]>
[ Upstream commit f7d28791433d373ecdab7b00f60ddb504e858e0a ]
UVERBS_ATTR_CREATE_WQ_CQ_HANDLE is declared UA_OPTIONAL in the ioctl method definition, so the mandatory attribute bitmap does not enforce its presence. When userspace omits it, uverbs_attr_get_obj() returns ERR_PTR(-ENOENT) and the handler stores that error pointer into wq_init_attr.cq without validation.
The bogus cq pointer is then passed to the driver's create_wq callback. In the mlx5 case, create_rq() calls to_mcq(init_attr->cq) which applies container_of to the ERR_PTR value, producing a near-NULL pointer. The subsequent access in get_rq_ts_format() triggers a kernel NULL pointer dereference:
BUG: kernel NULL pointer dereference, address: 0000000000000296 RIP: 0010:create_rq+0x32/0x550 [mlx5_ib] Call Trace: mlx5_ib_create_wq+0x14a/0x210 [mlx5_ib] ib_uverbs_handler_UVERBS_METHOD_WQ_CREATE+0x1f0/0x320 [ib_uverbs] ib_uverbs_run_method+0x296/0x320 [ib_uverbs] ib_uverbs_cmd_verbs+0x1a0/0x260 [ib_uverbs] ib_uverbs_ioctl+0xa8/0x120 [ib_uverbs]
A WQ without a CQ was never valid; the legacy write path always required one via uobj_get_obj_read() in ib_uverbs_ex_create_wq(). Declare the attribute UA_MANDATORY so the uverbs framework rejects the ioctl early when the CQ handle is missing, before the handler ever runs.
--- drivers/infiniband/core/uverbs_std_types_wq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/uverbs_std_types_wq.c +1 -1
@@ -140,7 +140,7 @@ DECLARE_UVERBS_NAMED_METHOD(UVERBS_ATTR_IDR (UVERBS_ATTR_CREATE_WQ_CQ_HANDLE ,UVERBS_OBJECT_CQ ,UVERBS_ACCESS_READ , -UA_OPTIONAL ), +UA_MANDATORY ), UVERBS_ATTR_FD(UVERBS_ATTR_CREATE_WQ_EVENT_FD, UVERBS_OBJECT_ASYNC_EVENT, UVERBS_ACCESS_READ,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1507/2214 remoteproc: core: Set trace buffer name for diagnostics
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yonghao Zhang <[email protected]>
[ Upstream commit e23eab619b0d2dd796618406ba25da62f4d539a2 ]
rproc_trace_read() (in remoteproc_debugfs.c) prints the name of a trace buffer whose device address could not be resolved, but nothing ever assigns trace_mem.name, so that the diagnostics always prints an empty string:
Trace not available
Copy the generated "trace%d" name into the memory entry, so the diagnostics identifies the buffer failed to translate.
--- drivers/remoteproc/remoteproc_core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/remoteproc/remoteproc_core.c +3 -0
@@ -690,6 +690,9 @@ static int rproc_handle_trace(struct rproc *rproc, void *ptr,return -EINVAL ; } +/* keep the name for the diagnostic in rproc_trace_read() */ +strscpy (trace->trace_mem.name, name,sizeof (trace->trace_mem.name)); +list_add_tail (&trace->node, &rproc->traces); rproc->num_traces++;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1508/2214 dmaengine: mv_xor: kill tasklet on channel add error path
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rosen Penev <[email protected]>
[ Upstream commit bcb4d469b19d53dc21e4a1da12d4438e7489e150 ]
If request_irq() succeeds but a later step (self-test or device registration) fails, the error path at err_free_irq frees the IRQ but does not kill the tasklet. A previously scheduled tasklet can still run after the channel is freed, accessing freed memory.
Add tasklet_kill() after free_irq() on the error path.
--- drivers/dma/mv_xor.c | 1 + 1 file changed, 1 insertion(+)
drivers/dma/mv_xor.c +1 -0
@@ -1162,6 +1162,7 @@ mv_xor_channel_add(struct mv_xor_device *xordev, err_free_irq:free_irq (mv_chan->irq, mv_chan); +tasklet_kill (&mv_chan->irq_tasklet); err_free_dma:dma_free_wc (&pdev->dev,MV_XOR_POOL_SIZE , mv_chan->dma_desc_pool_virt, mv_chan->dma_desc_pool);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1509/2214 loadpin: Fix stale KEXEC_VERIFY_SIG reference in documentation
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Mehltretter <[email protected]>
[ Upstream commit eb0b0d222a832b6ec851e56d4922a775ac762955 ]
Commit 99d5cadfde2b ("kexec_file: split KEXEC_VERIFY_SIG into KEXEC_SIG and KEXEC_SIG_FORCE") removed CONFIG_KEXEC_VERIFY_SIG but left the LoadPin documentation pointing at it. Refer to CONFIG_KEXEC_SIG instead.
While at it, clean up the grammar of the sentence.
Message-ID: <[email protected]>
--- Documentation/admin-guide/LSM/LoadPin.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Documentation/admin-guide/LSM/LoadPin.rst +5 -5
@@ -23,9 +23,9 @@ sysctl allows for easy testing on systems with a mutable filesystem.) It's also possible to exclude specific file types from LoadPin using kernel command line option "``loadpin.exclude``". By default, all files are included, but they can be excluded using kernel command line option such -as "``loadpin.exclude=kernel-module,kexec-image``". This allows to use +as "``loadpin.exclude=kernel-module,kexec-image``". This allows using different mechanisms such as ``CONFIG_MODULE_SIG`` and -``CONFIG_KEXEC_VERIFY_SIG`` to verify kernel module and kernel image while -still use LoadPin to protect the integrity of other files kernel loads. The -full list of valid file types can be found in ``kernel_read_file_str`` -defined in ``include/linux/kernel_read_file.h``. +``CONFIG_KEXEC_SIG`` to verify kernel modules and kernel images while +still using LoadPin to protect the integrity of other files the kernel +loads. The full list of valid file types can be found in +``kernel_read_file_str`` defined in ``include/linux/kernel_read_file.h``.
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1510/2214 ntfs3: fix out-of-bounds read in ntfs_read_mft()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weiming Shi <[email protected]>
[ Upstream commit 7a374d9be8267834dc534e55f01e5e01765cab4c ]
ntfs_read_mft() walks the attributes of an MFT record and, for each FILE_NAME attribute, compares the resident on-disk name with the name being looked up. The only size check before the compare is rsize >= SIZEOF_ATTRIBUTE_FILENAME, which covers the fixed header up to and including name_len, but not the variable-length name that follows it.
name_len comes straight from disk and is not validated against the resident data_size. A crafted image can set name_len large while keeping data_size at the header size, so ntfs_cmp_names_cpu() reads name_len le16 characters past the end of the MFT record buffer:
BUG: KASAN: slab-out-of-bounds in ntfs_cmp_names_cpu (fs/ntfs3/upcase.c:84) Read of size 2 at addr ffff888031879c00 by task a.out ntfs_cmp_names_cpu (fs/ntfs3/upcase.c:84) ntfs_iget5 (fs/ntfs3/inode.c:209) dir_search_u (fs/ntfs3/dir.c:265) ntfs_lookup (fs/ntfs3/namei.c:85) __lookup_slow (fs/namei.c:1915) lookup_slow (fs/namei.c:1932) path_lookupat (fs/namei.c:2278) vfs_statx (fs/stat.c) vfs_fstatat (fs/stat.c) __do_sys_newfstatat (fs/stat.c)
Allocated by task:
mi_init (fs/ntfs3/record.c)
ntfs_iget5 (fs/ntfs3/inode.c)
dir_search_u (fs/ntfs3/dir.c)
ntfs_lookup (fs/ntfs3/namei.c)
Check that the name fits in the resident data before using it.
--- fs/ntfs3/inode.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/ntfs3/inode.c +5 -0
@@ -198,6 +198,11 @@ static struct inode *ntfs_read_mft(struct inode *inode, names +=1 ; fname =Add2Ptr (attr, roff); + +/* Make sure the full name fits in the resident data. */ +if (rsize <fname_full_size (fname)) + goto out; +if (fname->type ==FILE_NAME_DOS ) goto next_attr;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1511/2214 mm/gup_test: reject wrapped user ranges
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Samuel Moelius <[email protected]>
[ Upstream commit e8ae6fd67021fafa9205330b3b248c9fc7216e0b ]
gup_test accepts an address and size from the debugfs ioctl and repeatedly compares against addr + size. If that addition wraps, the loop can be skipped and the ioctl returns success with size rewritten to zero.
Compute the end address once with overflow checking and use that checked end for the loop bounds.
Stable-dep-of: 44817a536aaa ("mm/gup_test: safely calculate GUP batch size")
--- mm/gup_test.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
mm/gup_test.c +8 -4
@@ -102,11 +102,15 @@ static int __gup_test_ioctl(unsigned int cmd,unsigned long i, nr_pages, addr, next;long nr;struct page **pages; +unsigned long end;int ret =0 ;bool needs_mmap_lock = cmd !=GUP_FAST_BENCHMARK && cmd !=PIN_FAST_BENCHMARK ; -if (gup->size >ULONG_MAX ) +if (gup->addr >ULONG_MAX || gup->size >ULONG_MAX ) +return -EINVAL ; +if (check_add_overflow ((unsigned long )gup->addr, + (unsigned long )gup->size, &end))return -EINVAL ; nr_pages = gup->size /PAGE_SIZE ;
@@ -122,13 +126,13 @@ static int __gup_test_ioctl(unsigned int cmd, i =0 ; nr = gup->nr_pages_per_call; start_time =ktime_get (); -for (addr = gup->addr; addr < gup->addr + gup->size; addr = next) { +for (addr = gup->addr; addr < end; addr = next) {if (nr != gup->nr_pages_per_call)break ; next = addr + nr *PAGE_SIZE ; -if (next > gup->addr + gup->size) { - next = gup->addr + gup->size; +if (next > end) { + next = end; nr = (next - addr) /PAGE_SIZE ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1512/2214 mm/gup_test: safely calculate GUP batch size
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sarthak Sharma <[email protected]>
[ Upstream commit 44817a536aaa5bfac0d316242e93e489d0a69d5f ]
__gup_test_ioctl() calculates the end of a GUP batch using:
next = addr + nr * PAGE_SIZE;
If nr is too large, it can cause next to overflow and wrap around. If it wraps, the next > end check is bypassed and a large value of nr is passed to the GUP call, even though the pages array was allocated according to gup->size. This can lead to out of bounds writes.
Also, when fewer than PAGE_SIZE bytes remain, the calculated batch contains zero pages. The code still calls GUP functions with pages + i, which can point past the allocated array.
Calculate nr by taking the minimum of the number of pages per call and the pages remaining in the address range. Reject zero sized and non page aligned gup->size values and zero nr_pages_per_call value.
--- mm/gup_test.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
mm/gup_test.c +4 -5
@@ -107,7 +107,8 @@ static int __gup_test_ioctl(unsigned int cmd,bool needs_mmap_lock = cmd !=GUP_FAST_BENCHMARK && cmd !=PIN_FAST_BENCHMARK ; -if (gup->addr >ULONG_MAX || gup->size >ULONG_MAX ) +if (gup->addr >ULONG_MAX || gup->size >ULONG_MAX || !gup->size || + !gup->nr_pages_per_call || !PAGE_ALIGNED (gup->size))return -EINVAL ;if (check_add_overflow ((unsigned long )gup->addr, (unsigned long )gup->size, &end))
@@ -130,11 +131,9 @@ static int __gup_test_ioctl(unsigned int cmd,if (nr != gup->nr_pages_per_call)break ; + nr = min_t(unsigned long, nr, (end - addr) / PAGE_SIZE); + next = addr + nr *PAGE_SIZE ; -if (next > end) { - next = end; - nr = (next - addr) /PAGE_SIZE ; - }switch (cmd) {case GUP_FAST_BENCHMARK :
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1513/2214 mm/gup_test: report actual pinned bytes
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sarthak Sharma <[email protected]>
[ Upstream commit 65a79b9b693d8c7bd7e5e4865c02cce922a7cc50 ]
__gup_test_ioctl() advances addr to the end of the current batch before checking if GUP pinned the entire requested batch. If GUP pins more than 0 pages but less than the requested batch size, addr still advances by the requested batch size.
The next iteration detects the partial pinning and breaks out of the loop. Again gup->size is calculated using addr - gup->addr, so it also includes the unpinned pages of the requested batch.
Calculate gup->size using the actual number of pages pinned multiplied by PAGE_SIZE.
--- mm/gup_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/gup_test.c +1 -1
@@ -180,7 +180,7 @@ static int __gup_test_ioctl(unsigned int cmd, nr_pages = i; gup->get_delta_usec =ktime_us_delta (end_time, start_time); - gup->size = addr - gup->addr; + gup->size = nr_pages *PAGE_SIZE ;/* * Take an un-benchmark-timed moment to verify DMA pinned
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1514/2214 arm64: dts: mediatek: mt8173: Fix MFG_ASYNC power domain clock
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen-Yu Tsai <[email protected]>
[ Upstream commit c9b3c82c9f1f86cdb2449d47e4ca66a19159ee12 ]
The MFG_ASYNC domain, which is likely associated to the whole MFG block, currently specifies clk26m as its domain clock. This is bogus, since the clock is an external crystal with no controls. Also, the MFG block has a independent CLK_TOP_AXI_MFG_IN_SEL clock, which according to the block diagram, gates access to the hardware registers. Having this one as the domain clock makes much more sense. This also fixes access to the MFGTOP registers.
Change the MFG_ASYNC domain clock to CLK_TOP_AXI_MFG_IN_SEL.
--- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt8173.dtsi +1 -1
@@ -506,7 +506,7 @@ power-domain@MT8173_POWER_DOMAIN_USB { }; mfg_async: power-domain@MT8173_POWER_DOMAIN_MFG_ASYNC { reg = <MT8173_POWER_DOMAIN_MFG_ASYNC>; - clocks = <&clk26m>; + clocks = <&topckgen CLK_TOP_AXI_MFG_IN_SEL>; clock-names = "mfg"; #address-cells = <1>; #size-cells = <0>;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1515/2214 ACPI: tables: handle failed initrd override mappings
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Slavin Liu <[email protected]>
[ Upstream commit 047c834d939df75386cfc0603c7ddeaa23a349a4 ]
The runtime AML table-loading path can invoke initrd override after permanent mappings are enabled. Mapping bookkeeping can then fail.
Return AE_NO_MEMORY in that case to prevent a NULL pointer dereference when attempting to read the table length.
Detected by static analysis and reviewed with AI-assisted source auditing.
--- drivers/acpi/tables.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/acpi/tables.c +3 -0
@@ -651,6 +651,9 @@ acpi_table_initrd_override(struct acpi_table_header *existing_table,while (table_offset +ACPI_HEADER_SIZE <= all_tables_size) { table =acpi_os_map_memory (acpi_tables_addr + table_offset,ACPI_HEADER_SIZE ); +if (!table) +return AE_NO_MEMORY ; +if (table_offset + table->length > all_tables_size) {acpi_os_unmap_memory (table,ACPI_HEADER_SIZE );WARN_ON (1 );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1516/2214 scsi: pm8001: Fix SATA FIS offset in struct hw_event_resp
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bart Van Assche <[email protected]>
[ Upstream commit cdc97921de02a0c1a8324afa03e8b3e30a72bbe6 ]
In struct hw_event_resp, sas_identify was defined using struct sas_identify_frame, which is 32 bytes long because it includes a 4-byte CRC field. However, PM8001 and PM80xx hardware does not send the CRC in the event response frame, providing only the 28-byte identify payload.
Because sas_identify had a size of 32 bytes, the following sata_fis member was located at byte offset 44 instead of the actual hardware offset 40. In hw_event_sata_phy_up(), this discrepancy was worked around with negative pointer arithmetic: ((u8 *)&pPayload->sata_fis - 4). This triggers a compiler error under Clang with -Wstringop-overread:
error: 'memcpy' reading 20 bytes from a region of size 0 [-Werror,-Wstringop-overread]
memcpy(phy->frame_rcvd, ((u8 *)&pPayload->sata_fis - 4),
Move struct sas_identify_frame_local (28 bytes) into pm8001_defs.h, and update struct hw_event_resp in both pm8001_hwi.h and pm80xx_hwi.h to use struct sas_identify_frame_local followed by sata_fis and a 4-byte padding word. This correctly aligns sata_fis at byte offset 40 while maintaining the 64-byte total payload size.
Update hw_event_sata_phy_up() in pm8001_hwi.c and pm80xx_hwi.c to copy directly from &pPayload->sata_fis.
Compile-tested only. Both the patch and its description have been generated by Gemini.
--- drivers/scsi/pm8001/pm8001_defs.h | 98 +++++++++++++++++++++++++++++ drivers/scsi/pm8001/pm8001_hwi.c | 2 +- drivers/scsi/pm8001/pm8001_hwi.h | 4 +- drivers/scsi/pm8001/pm80xx_hwi.c | 2 +- drivers/scsi/pm8001/pm80xx_hwi.h | 100 +----------------------------- 5 files changed, 106 insertions(+), 100 deletions(-)
drivers/scsi/pm8001/pm8001_defs.h +98 -0
@@ -41,6 +41,104 @@#ifndef _PM8001_DEFS_H_#define _PM8001_DEFS_H_ +#include <scsi/sas.h> + +#ifdef __LITTLE_ENDIAN_BITFIELD +struct sas_identify_frame_local { +/* Byte 0 */ +u8 frame_type:4 ; +u8 dev_type:3 ; +u8 _un0:1 ; + +/* Byte 1 */ +u8 _un1; + +/* Byte 2 */ +union { +struct { +u8 _un20:1 ; +u8 smp_iport:1 ; +u8 stp_iport:1 ; +u8 ssp_iport:1 ; +u8 _un247:4 ; + }; +u8 initiator_bits; + }; + +/* Byte 3 */ +union { +struct { +u8 _un30:1 ; +u8 smp_tport:1 ; +u8 stp_tport:1 ; +u8 ssp_tport:1 ; +u8 _un347:4 ; + }; +u8 target_bits; + }; + +/* Byte 4 - 11 */ +u8 _un4_11[8 ]; + +/* Byte 12 - 19 */ +u8 sas_addr[SAS_ADDR_SIZE ]; + +/* Byte 20 */ +u8 phy_id; + +u8 _un21_27[7 ]; + +} __packed; + +#elif defined(__BIG_ENDIAN_BITFIELD) +struct sas_identify_frame_local { +/* Byte 0 */ +u8 _un0:1 ; +u8 dev_type:3 ; +u8 frame_type:4 ; + +/* Byte 1 */ +u8 _un1; + +/* Byte 2 */ +union { +struct { +u8 _un247:4 ; +u8 ssp_iport:1 ; +u8 stp_iport:1 ; +u8 smp_iport:1 ; +u8 _un20:1 ; + }; +u8 initiator_bits; + }; + +/* Byte 3 */ +union { +struct { +u8 _un347:4 ; +u8 ssp_tport:1 ; +u8 stp_tport:1 ; +u8 smp_tport:1 ; +u8 _un30:1 ; + }; +u8 target_bits; + }; + +/* Byte 4 - 11 */ +u8 _un4_11[8 ]; + +/* Byte 12 - 19 */ +u8 sas_addr[SAS_ADDR_SIZE ]; + +/* Byte 20 */ +u8 phy_id; + +u8 _un21_27[7 ]; +} __packed; +#else +#error "Bitfield order not defined!" +#endif +enum chip_flavors { chip_8001, chip_8008,
drivers/scsi/pm8001/pm8001_hwi.c +1 -1
@@ -3433,7 +3433,7 @@ hw_event_sata_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb) phy->sas_phy.oob_mode =SATA_OOB_MODE ;sas_notify_phy_event (&phy->sas_phy,PHYE_OOB_DONE ,GFP_ATOMIC );spin_lock_irqsave (&phy->sas_phy.frame_rcvd_lock, flags); -memcpy (phy->frame_rcvd, ((u8 *)&pPayload->sata_fis -4 ), +memcpy (phy->frame_rcvd, &pPayload->sata_fis,sizeof (struct dev_to_host_fis )); phy->frame_rcvd_size =sizeof (struct dev_to_host_fis ); phy->identify.target_port_protocols =SAS_PROTOCOL_SATA ;
drivers/scsi/pm8001/pm8001_hwi.h +3 -1
@@ -42,6 +42,7 @@#include <linux/types.h> #include <scsi/libsas.h> +#include "pm8001_defs.h" /* for Request Opcode of IOMB */
@@ -229,8 +230,9 @@ struct hw_event_resp {__le32 lr_evt_status_phyid_portid;__le32 evt_param;__le32 npip_portstate; -struct sas_identify_frame sas_identify; +struct sas_identify_frame_local sas_identify;struct dev_to_host_fis sata_fis; +u32 _r_a; } __attribute__((packed, aligned(4)));
drivers/scsi/pm8001/pm80xx_hwi.c +1 -1
@@ -3420,7 +3420,7 @@ hw_event_sata_phy_up(struct pm8001_hba_info *pm8001_ha, void *piomb) phy->sas_phy.oob_mode =SATA_OOB_MODE ;sas_notify_phy_event (&phy->sas_phy,PHYE_OOB_DONE ,GFP_ATOMIC );spin_lock_irqsave (&phy->sas_phy.frame_rcvd_lock, flags); -memcpy (phy->frame_rcvd, ((u8 *)&pPayload->sata_fis -4 ), +memcpy (phy->frame_rcvd, &pPayload->sata_fis,sizeof (struct dev_to_host_fis )); phy->frame_rcvd_size =sizeof (struct dev_to_host_fis ); phy->identify.target_port_protocols =SAS_PROTOCOL_SATA ;
drivers/scsi/pm8001/pm80xx_hwi.h +3 -97
119 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1517/2214 staging: iio: adc: ad7816: Fix DMA safety issues in SPI transfers
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abdelnasser Hussein <[email protected]>
[ Upstream commit 69fa76f0af3414cc189c3b0b807cb59e327ecc00 ]
The SPI operations in this driver are not DMA safe:
1. spi_read() uses a stack-allocated buffer.
2. spi_write() in ad7816_spi_read() uses a struct member that shares a cacheline with other variables.
3. spi_write() in ad7816_spi_write() passes a stack parameter by reference.
Fix these violations by replacing all spi_read() and spi_write() calls with spi_write_then_read(). This safely handles DMA by internally allocating a bounce buffer for the transfers, avoiding cacheline sharing issues without needing dedicated aligned buffers. This implicitly corrects the size argument in read to sizeof(buf).
--- drivers/staging/iio/adc/ad7816.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/iio/adc/ad7816.c +3 -3
@@ -69,7 +69,7 @@ static int ad7816_spi_read(struct ad7816_chip_info *chip, u16 *data)gpiod_set_value (chip->rdwr_pin,1 );gpiod_set_value (chip->rdwr_pin,0 ); - ret =spi_write (spi_dev, &chip->channel_id,sizeof (chip->channel_id)); + ret =spi_write_then_read (spi_dev, &chip->channel_id,sizeof (chip->channel_id),NULL ,0 );if (ret <0 ) {dev_err (&spi_dev->dev,"SPI channel setting error\n" );return ret;
@@ -91,7 +91,7 @@ static int ad7816_spi_read(struct ad7816_chip_info *chip, u16 *data)gpiod_set_value (chip->rdwr_pin,0 );gpiod_set_value (chip->rdwr_pin,1 ); - ret =spi_read (spi_dev, &buf,sizeof (*data)); + ret =spi_write_then_read (spi_dev,NULL ,0 , &buf,sizeof (buf));if (ret <0 ) {dev_err (&spi_dev->dev,"SPI data read error\n" );return ret;
@@ -109,7 +109,7 @@ static int ad7816_spi_write(struct ad7816_chip_info *chip, u8 data)gpiod_set_value (chip->rdwr_pin,1 );gpiod_set_value (chip->rdwr_pin,0 ); - ret =spi_write (spi_dev, &data,sizeof (data)); + ret =spi_write_then_read (spi_dev, &data,sizeof (data),NULL ,0 );if (ret <0 )dev_err (&spi_dev->dev,"SPI oti data write error\n" );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1518/2214 md: reject v0.90 arrays with too many devices
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jérémy Jean <[email protected]>
[ Upstream commit 1a33a379e67853d6d778e6e80b214bdf1208f6f8 ]
The v0.90 superblock has room for MD_SB_DISKS device descriptors, but super_90_load() only rejects nonpositive raid_disks values. A crafted superblock can therefore copy a larger value into mddev->raid_disks. When metadata is next updated, super_90_sync() walks sb->disks[] up to that count and reads and writes beyond the 4 KiB superblock buffer.
A checksum-valid RAID1 member advertising 64 devices can be assembled by mdadm --incremental --run. The first write to the array then produces out-of-bounds writes from super_90_sync() under KASAN.
Reject device counts that cannot be represented by the v0.90 format while loading the superblock.
--- drivers/md/md.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/md.c +1 -1
@@ -1229,7 +1229,7 @@ static int super_90_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor goto abort; } -if (sb->raid_disks <=0 ) +if (sb->raid_disks <=0 || sb->raid_disks >MD_SB_DISKS ) goto abort;if (md_csum_fold (calc_sb_csum (sb)) !=md_csum_fold (sb->sb_csum)) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1519/2214 md/raid5: dont BUG() on an inconsistent reshape state from the superblock
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yogesh Gaur <[email protected]>
[ Upstream commit 0669c7dbd1d375f279e607a24addc2f1dae2d4f3 ]
raid5_run() branches on mddev->reshape_position. When it is MaxSector -- no reshape in progress -- the else branch asserts that nothing else describes one:
BUG_ON(mddev->level != mddev->new_level); BUG_ON(mddev->layout != mddev->new_layout); BUG_ON(mddev->chunk_sectors != mddev->new_chunk_sectors); BUG_ON(mddev->delta_disks != 0);
Nothing enforces that invariant. Both superblock validators copy the reshape fields straight off disk without cross-checking them against each other: super_1_validate() takes reshape_position, delta_disks, new_level, new_layout and new_chunk from the superblock whenever MD_FEATURE_RESHAPE_ACTIVE is set, and super_90_validate() does the same for minor version 91. A superblock that sets the reshape feature while leaving reshape_position at the MaxSector sentinel therefore reaches the else branch with a non-zero delta_disks, and assembling the array takes the machine down:
kernel BUG at drivers/md/raid5.c:8117!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI RIP: 0010:raid5_run+0x11a7/0x1670 drivers/md/raid5.c:8117 Call Trace: md_run+0xc2f/0x2510 drivers/md/md.c:6779 do_md_run+0x36/0x660 drivers/md/md.c:6880 array_state_store+0x9c5/0xcf0 drivers/md/md.c:4765 md_attr_store+0x1c5/0x330 drivers/md/md.c:6158 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345
This is reachable by anyone who can present an md superblock, so BUG() is the wrong response. Refuse to start the array instead, the way the reshape_position != MaxSector branch a few lines above already refuses a reshape it cannot resume. Nothing has been allocated at this point -- the journal-and-bitmap check just above returns -EINVAL the same way -- so there is nothing to unwind.
--- drivers/md/raid5.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/md/raid5.c +11 -5
@@ -7593,11 +7593,17 @@ static int raid5_run(struct mddev *mddev) }pr_debug ("md/raid:%s: reshape will continue\n" ,mdname (mddev));/* OK, we should be able to continue; */ - }else { -BUG_ON (mddev->level != mddev->new_level); -BUG_ON (mddev->layout != mddev->new_layout); -BUG_ON (mddev->chunk_sectors != mddev->new_chunk_sectors); -BUG_ON (mddev->delta_disks !=0 ); + }else if (mddev->level != mddev->new_level || + mddev->layout != mddev->new_layout || + mddev->chunk_sectors != mddev->new_chunk_sectors || + mddev->delta_disks !=0 ) { +/* No reshape is in progress, but the array describes one. +* The superblock validators do not cross-check these against +* reshape_position, so this is reachable from disk. +*/ +pr_warn ("md/raid:%s: inconsistent reshape state - aborting.\n" , +mdname (mddev)); +return -EINVAL ; } if (test_bit(MD_HAS_JOURNAL, &mddev->flags) &&
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1520/2214 md/raid5: setup_conf: Fix null-ptr-def in error handling path
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhihao Cheng <[email protected]>
[ Upstream commit eba5f518701b1c7f2d883504f89c41611bd2de46 ]
For raid5 setup_conf, if an error(eg. bioset_init fails) happens before 'conf->mddev = mddev', following error handling path could trigger a null-ptr-def problem:
free_conf
log_exit
raid5_has_ppl
test_bit(MD_HAS_PPL, &conf->mddev->flags) // conf->mddev is NULL !
Fix it by initializing conf->mddev in advance.
--- drivers/md/raid5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/raid5.c +1 -1
@@ -7228,6 +7228,7 @@ static struct r5conf *setup_conf(struct mddev *mddev)if (conf ==NULL ) goto abort; + conf->mddev = mddev;#if PAGE_SIZE !=DEFAULT_STRIPE_SIZE conf->stripe_size =DEFAULT_STRIPE_SIZE ; conf->stripe_shift =ilog2 (DEFAULT_STRIPE_SIZE ) -9 ;
@@ -7300,7 +7301,6 @@ static struct r5conf *setup_conf(struct mddev *mddev) ret =bioset_init (&conf->bio_split,BIO_POOL_SIZE ,0 ,0 );if (ret) goto abort; - conf->mddev = mddev;if ((conf->stripe_hashtbl =kzalloc (PAGE_SIZE ,GFP_KERNEL )) ==NULL ) goto abort;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1521/2214 clk: milbeaut: Return divider update timeouts
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 92d0998090d1716ee6b47174c10eb9415a12fca8 ]
m10v_clk_divider_set_rate() logs when the hardware does not clear its write-valid request, but still returns success to the clock framework. It also uses the sleeping poll helper while holding the divider spinlock.
Use the atomic poll helper under the lock and return its timeout so the rate change is not reported as successful before the hardware accepts it.
The issue was found by our static-analysis tool and manually reviewed.
--- drivers/clk/clk-milbeaut.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/clk/clk-milbeaut.c +6 -4
@@ -411,8 +411,8 @@ static int m10v_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) {struct m10v_clk_divider *divider =to_m10v_div (hw); -int value;unsigned long flags =0 ; +int value, ret =0 ;u32 val;u32 write_en =BIT (divider->width -1 );
@@ -434,8 +434,10 @@ static int m10v_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,if (divider->write_valid_reg) {writel (M10V_DCHREQ , divider->write_valid_reg); -if (readl_poll_timeout (divider->write_valid_reg, val, - !val,M10V_UPOLL_RATE ,M10V_UTIMEOUT )) + ret =readl_poll_timeout_atomic (divider->write_valid_reg, val, + !val,M10V_UPOLL_RATE , +M10V_UTIMEOUT ); +if (ret)pr_err ("%s:%s couldn't stabilize\n" , __func__,clk_hw_get_name (hw)); }
@@ -445,7 +447,7 @@ static int m10v_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,else __release (divider->lock); -return 0 ; +return ret; }static const struct clk_ops m10v_clk_divider_ops = {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1522/2214 drm/amd/pm: bound SCLK FCW range entries to the table size
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hari Mishal <[email protected]>
[ Upstream commit f35aa5c77f5fca20fc269d6221df19c7b96704a5 ]
atomctrl_get_smc_sclk_range_table() copies ucSclkEntryNum entries from the VBIOS SMU_Info table into pp_atom_ctrl_sclk_range_table. Both the source (asSclkFcwRangeEntry[]) and destination (table->entry[]) arrays are fixed at MAX_SCLK_RANGE (8) entries, but ucSclkEntryNum is an unchecked u8 read straight from the VBIOS, so it can be up to 255. The destination is stack-allocated in both callers (polaris10_get_sclk_range_table(), vegam_get_sclk_range_table()), so a count above 8 overflows a stack buffer, not just a heap read.
Reject counts above MAX_SCLK_RANGE rather than clamping to it. Only one version of this VBIOS struct (ATOM_SMU_INFO_V2_1) has ever existed, so a count above 8 corresponds to no legitimate table format and means either a corrupted or a tampered VBIOS.
--- drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/ppatomctrl.c +3 -0
@@ -1453,6 +1453,9 @@ int atomctrl_get_smc_sclk_range_table(struct pp_hwmgr *hwmgr, struct pp_atom_ctrif (!psmu_info)return -EINVAL ; +if (psmu_info->ucSclkEntryNum >MAX_SCLK_RANGE ) +return -EINVAL ; +for (i =0 ; i < psmu_info->ucSclkEntryNum; i++) { table->entry[i].ucVco_setting = psmu_info->asSclkFcwRangeEntry[i].ucVco_setting; table->entry[i].ucPostdiv = psmu_info->asSclkFcwRangeEntry[i].ucPostdiv;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1523/2214 ata: sata_dwc_460ex: Use devm_platform_*ioremap_resource() APIs
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Shevchenko <[email protected]>
[ Upstream commit f713961de5057765bc663db72b7e540f27827750 ]
Use devm_platform_get_and_ioremap_resource() and devm_platform_ioremap_resource() APIs instead of their open coded analogues.
Stable-dep-of: e137035fcd66 ("ata: sata_dwc_460ex: Don't enable interrupt if libATA core registration fails")
--- drivers/ata/sata_dwc_460ex.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/ata/sata_dwc_460ex.c +2 -5
@@ -241,7 +241,6 @@ static int sata_dwc_dma_init_old(struct platform_device *pdev, struct sata_dwc_device *hsdev) {struct device_node *np = pdev->dev.of_node; -struct resource *res; hsdev->dma =devm_kzalloc (&pdev->dev,sizeof (*hsdev->dma),GFP_KERNEL );if (!hsdev->dma)
@@ -258,8 +257,7 @@ static int sata_dwc_dma_init_old(struct platform_device *pdev, }/* Get physical SATA DMA register base address */ - res =platform_get_resource (pdev,IORESOURCE_MEM ,1 ); - hsdev->dma->regs =devm_ioremap_resource (&pdev->dev, res); + hsdev->dma->regs =devm_platform_ioremap_resource (pdev,1 );if (IS_ERR (hsdev->dma->regs))return PTR_ERR (hsdev->dma->regs);
@@ -1224,8 +1222,7 @@ static int sata_dwc_probe(struct platform_device *ofdev) host->private_data = hsdev;/* Ioremap SATA registers */ - res =platform_get_resource (ofdev,IORESOURCE_MEM ,0 ); - base =devm_ioremap_resource (&ofdev->dev, res); + base =devm_platform_get_and_ioremap_resource (ofdev,0 , &res);if (IS_ERR (base))return PTR_ERR (base);dev_dbg (&ofdev->dev,"ioremap done for SATA register address\n" );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1524/2214 ata: sata_dwc_460ex: Use temporary variable for struct device
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Shevchenko <[email protected]>
[ Upstream commit f1550f27f8a92a4d29329aeeb28b743365abceae ]
Use temporary variable for struct device to make code neater.
Stable-dep-of: e137035fcd66 ("ata: sata_dwc_460ex: Don't enable interrupt if libATA core registration fails")
--- drivers/ata/sata_dwc_460ex.c | 37 ++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-)
drivers/ata/sata_dwc_460ex.c +19 -18
@@ -219,9 +219,10 @@ static int sata_dwc_dma_get_channel_old(struct sata_dwc_device_port *hsdevp) {struct sata_dwc_device *hsdev = hsdevp->hsdev;struct dw_dma_slave *dws = &sata_dwc_dma_dws; +struct device *dev = hsdev->dev;dma_cap_mask_t mask; - dws->dma_dev = hsdev->dev; + dws->dma_dev = dev;dma_cap_zero (mask);dma_cap_set (DMA_SLAVE , mask);
@@ -229,8 +230,7 @@ static int sata_dwc_dma_get_channel_old(struct sata_dwc_device_port *hsdevp)/* Acquire DMA channel */ hsdevp->chan =dma_request_channel (mask, sata_dwc_dma_filter, hsdevp);if (!hsdevp->chan) { -dev_err (hsdev->dev,"%s: dma channel unavailable\n" , - __func__); +dev_err (dev,"%s: dma channel unavailable\n" , __func__);return -EAGAIN ; }
@@ -240,19 +240,20 @@ static int sata_dwc_dma_get_channel_old(struct sata_dwc_device_port *hsdevp)static int sata_dwc_dma_init_old (struct platform_device *pdev,struct sata_dwc_device *hsdev) { -struct device_node *np = pdev->dev.of_node; +struct device *dev = &pdev->dev; +struct device_node *np = dev->of_node; - hsdev->dma =devm_kzalloc (&pdev->dev,sizeof (*hsdev->dma),GFP_KERNEL ); + hsdev->dma =devm_kzalloc (dev,sizeof (*hsdev->dma),GFP_KERNEL );if (!hsdev->dma)return -ENOMEM ; - hsdev->dma->dev = &pdev->dev; + hsdev->dma->dev = dev; hsdev->dma->id = pdev->id;/* Get SATA DMA interrupt number */ hsdev->dma->irq =irq_of_parse_and_map (np,1 );if (hsdev->dma->irq ==NO_IRQ ) { -dev_err (&pdev->dev,"no SATA DMA irq\n" ); +dev_err (dev,"no SATA DMA irq\n" );return -ENODEV ; }
@@ -1201,6 +1202,8 @@ static const struct ata_port_info sata_dwc_port_info[] = {static int sata_dwc_probe (struct platform_device *ofdev) { +struct device *dev = &ofdev->dev; +struct device_node *np = dev->of_node;struct sata_dwc_device *hsdev;u32 idr, versionr;char *ver = (char *)&versionr;
@@ -1210,12 +1213,11 @@ static int sata_dwc_probe(struct platform_device *ofdev)struct ata_host *host;struct ata_port_info pi = sata_dwc_port_info[0 ];const struct ata_port_info *ppi[] = { &pi,NULL }; -struct device_node *np = ofdev->dev.of_node;struct resource *res;/* Allocate DWC SATA device */ - host =ata_host_alloc_pinfo (&ofdev->dev, ppi,SATA_DWC_MAX_PORTS ); - hsdev =devm_kzalloc (&ofdev->dev,sizeof (*hsdev),GFP_KERNEL ); + host =ata_host_alloc_pinfo (dev, ppi,SATA_DWC_MAX_PORTS ); + hsdev =devm_kzalloc (dev,sizeof (*hsdev),GFP_KERNEL );if (!host || !hsdev)return -ENOMEM ;
@@ -1225,7 +1227,7 @@ static int sata_dwc_probe(struct platform_device *ofdev) base =devm_platform_get_and_ioremap_resource (ofdev,0 , &res);if (IS_ERR (base))return PTR_ERR (base); -dev_dbg (&ofdev->dev,"ioremap done for SATA register address\n" ); +dev_dbg (dev,"ioremap done for SATA register address\n" );/* Synopsys DWC SATA specific Registers */ hsdev->sata_dwc_regs = base +SATA_DWC_REG_OFFSET ;
@@ -1239,16 +1241,15 @@ static int sata_dwc_probe(struct platform_device *ofdev)/* Read the ID and Version Registers */ idr =sata_dwc_readl (&hsdev->sata_dwc_regs->idr); versionr =sata_dwc_readl (&hsdev->sata_dwc_regs->versionr); -dev_notice (&ofdev->dev,"id %d, controller version %c.%c%c\n" , - idr, ver[0 ], ver[1 ], ver[2 ]); +dev_notice (dev,"id %d, controller version %c.%c%c\n" , idr, ver[0 ], ver[1 ], ver[2 ]);/* Save dev for later use in dev_xxx() routines */ - hsdev->dev = &ofdev->dev; + hsdev->dev = dev;/* Get SATA interrupt number */ irq =irq_of_parse_and_map (np,0 );if (irq ==NO_IRQ ) { -dev_err (&ofdev->dev,"no SATA DMA irq\n" ); +dev_err (dev,"no SATA DMA irq\n" );return -ENODEV ; }
@@ -1260,7 +1261,7 @@ static int sata_dwc_probe(struct platform_device *ofdev) }#endif - hsdev->phy =devm_phy_optional_get (hsdev->dev,"sata-phy" ); + hsdev->phy =devm_phy_optional_get (dev,"sata-phy" );if (IS_ERR (hsdev->phy))return PTR_ERR (hsdev->phy);
@@ -1275,7 +1276,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)*/ err =ata_host_activate (host, irq, sata_dwc_isr,0 , &sata_dwc_sht);if (err) -dev_err (&ofdev->dev,"failed to activate host" ); +dev_err (dev,"failed to activate host" );/* Enable SATA Interrupts */ sata_dwc_enable_interrupts (hsdev);
@@ -1301,7 +1302,7 @@ static int sata_dwc_remove(struct platform_device *ofdev)sata_dwc_dma_exit_old (hsdev);#endif -dev_dbg (&ofdev->dev,"done\n" ); +dev_dbg (dev,"done\n" );return 0 ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1525/2214 ata: sata_dwc_460ex: Dont enable interrupt if libATA core registration fails
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikolay Borisov <[email protected]>
[ Upstream commit e137035fcd66cb454c479bb989968561bbc60341 ]
Recent 4bbc16a353a9 commit changed the timing when interrupts are enabled. However it didn't account for the libATA registration step. So it's possible that interrupts are enabled when the device is not registered with libATA core.
Resolve the issue by failing the entire registration process in case of failure to register with libATA.
--- drivers/ata/sata_dwc_460ex.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/ata/sata_dwc_460ex.c +4 -1
@@ -1275,11 +1275,14 @@ static int sata_dwc_probe(struct platform_device *ofdev)* error_handler() to execute a dummy Softreset EH session */ err =ata_host_activate (host, irq, sata_dwc_isr,0 , &sata_dwc_sht); -if (err) +if (err) {dev_err (dev,"failed to activate host" ); + goto error_out; + }/* Enable SATA Interrupts */ sata_dwc_enable_interrupts (hsdev); +return 0 ; error_out:
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1526/2214 PCI: cadence: Preserve all error codes in cdns_plat_pcie_probe()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Oltean <[email protected]>
[ Upstream commit fe108800a865b268eec103e4940c248c85a86e9f ]
The blamed commit functionally changed the error path of cdns_pcie_host_probe(), now cdns_plat_pcie_probe().
When the old code path executed "goto err_get_sync", the PCIe controller probe function propagated the pm_runtime_get_sync() error code. The new code doesn't, and returns 0.
Similarly for the "goto err_init" previously triggered by cdns_pcie_host_init() errors, and now triggered by cdns_pcie_host_setup() and cdns_pcie_ep_setup() errors. These are not propagated and will result in probing success, which is incorrect.
--- drivers/pci/controller/cadence/pcie-cadence-plat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/cadence/pcie-cadence-plat.c +1 -1
@@ -122,7 +122,7 @@ static int cdns_plat_pcie_probe(struct platform_device *pdev)while (phy_count--)device_link_del (pcie->link[phy_count]); -return 0 ; +return ret; }static void cdns_plat_pcie_shutdown (struct platform_device *pdev)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1527/2214 kconfig: remove unneeded symbol_empty variable
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masahiro Yamada <[email protected]>
[ Upstream commit 4e244c10eab345a735c5052688e4a55bddce5bf7 ]
This is used only for initializing other variables.
Use the empty string "" directly.
Please note newval.tri is unused for S_INT/HEX/STRING.
Stable-dep-of: dbe1ae2304a3 ("kconfig: fix extra output from savedefconfig on out-of-range defaults")
--- scripts/kconfig/symbol.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
scripts/kconfig/symbol.c +2 -9
@@ -32,12 +32,6 @@ struct symbol symbol_no = { .flags = SYMBOL_CONST|SYMBOL_VALID, }; -static struct symbol symbol_empty = { - .name ="" , - .curr = {"" , no }, - .flags =SYMBOL_VALID , -}; -struct symbol *modules_sym;static tristate modules_val;static int sym_warnings;
@@ -359,7 +353,7 @@ void sym_calc_value(struct symbol *sym)case S_INT :case S_HEX :case S_STRING : - newval = symbol_empty.curr; + newval.val ="" ;break ;case S_BOOLEAN :case S_TRISTATE :
@@ -710,13 +704,12 @@ const char *sym_get_string_default(struct symbol *sym) {struct property *prop;struct symbol *ds; -const char *str; +const char *str ="" ;tristate val;sym_calc_visibility (sym);sym_calc_value (modules_sym); val = symbol_no.curr.tri; - str = symbol_empty.curr.val;/* If symbol has a default value look it up */ prop =sym_get_default_prop (sym);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1528/2214 kconfig: default to zero if int/hex symbol lacks default property
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masahiro Yamada <[email protected]>
[ Upstream commit 6262afa10ef7cc8fdf39b81a36f9546b68810431 ]
When a default property is missing in an int or hex symbol, it defaults to an empty string, which is not a valid symbol value.
It results in an incorrect .config, and can also lead to an infinite loop in scripting.
Use "0" for int and "0x0" for hex as a default value.
Stable-dep-of: dbe1ae2304a3 ("kconfig: fix extra output from savedefconfig on out-of-range defaults")
--- scripts/kconfig/symbol.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
scripts/kconfig/symbol.c +12 -5
@@ -351,7 +351,11 @@ void sym_calc_value(struct symbol *sym)switch (sym->type) {case S_INT : + newval.val ="0" ; +break ;case S_HEX : + newval.val ="0x0" ; +break ;case S_STRING : newval.val ="" ;break ;
@@ -759,14 +763,17 @@ const char *sym_get_string_default(struct symbol *sym)case yes:return "y" ; }case S_INT : +if (!str[0 ]) + str ="0" ; +break ;case S_HEX : -return str; -case S_STRING : -return str; -case S_UNKNOWN : +if (!str[0 ]) + str ="0x0" ; +break ; +default :break ; } -return "" ; +return str; }const char *sym_get_string_value (struct symbol *sym)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1529/2214 kconfig: fix extra output from savedefconfig on out-of-range defaults
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julian Braha <[email protected]>
[ Upstream commit dbe1ae2304a3b02c3bf6ae82895ff232a29f3fee ]
The Kconfig interpreter currently allows defaults that are outside of the range bounds.
In these cases, the 'sym_validate_range' function will adjust the default value to the nearest range bound. For example, see this example:
config A
int
range 1 2
default 16
Here, since the default value of 16 is greater than the bounds, the effective default value gets adjusted down to the upper bound, 2.
However, 'savedefconfig' writes non-default values, and without being aware of the automatic adjustment to the range bound, it would write: A=2
This limitation is also documented in a comment: "The following fails to handle the situation where a default value is further limited by the valid range."
To resolve this, let's factor out the default-range adjustment logic from the existing 'sym_validate_range' function into its own 'sym_get_near_range_bound' function for 'savedefconfig' to use too, so that it compares against the effective value.
Adds tests, accordingly.
--- scripts/kconfig/symbol.c | 39 ++++++++---- .../kconfig/tests/savedefconfig_range/Kconfig | 60 +++++++++++++++++++ .../tests/savedefconfig_range/__init__.py | 8 +++ .../kconfig/tests/savedefconfig_range/config | 7 +++ .../savedefconfig_range/expected_defconfig | 0 5 files changed, 102 insertions(+), 12 deletions(-) create mode 100644 scripts/kconfig/tests/savedefconfig_range/Kconfig create mode 100644 scripts/kconfig/tests/savedefconfig_range/__init__.py create mode 100644 scripts/kconfig/tests/savedefconfig_range/config create mode 100644 scripts/kconfig/tests/savedefconfig_range/expected_defconfig
scripts/kconfig/symbol.c +27 -12
@@ -117,7 +117,12 @@ static long long sym_get_range_val(struct symbol *sym, int base)return strtoll (sym->curr.val,NULL , base); } -static void sym_validate_range (struct symbol *sym) +/* +* Return the nearest range bound for an out-of-range default value. +* Return NULL if the value is valid or the symbol has no active range. +*/ +static struct symbol *sym_get_near_range_bound (struct symbol *sym, +const char *value) {struct property *prop;struct symbol *range_sym;
@@ -132,21 +137,31 @@ static void sym_validate_range(struct symbol *sym) base =16 ;break ;default : -return ; +return NULL ; } prop =sym_get_range_prop (sym);if (!prop) -return ; - val =strtoll (sym->curr.val,NULL , base); +return NULL ; + val =strtoll (value,NULL , base); range_sym = prop->expr->left.sym; val2 =sym_get_range_val (range_sym, base);if (val >= val2) { range_sym = prop->expr->right.sym; val2 =sym_get_range_val (range_sym, base);if (val <= val2) -return ; +return NULL ; } - sym->curr.val = range_sym->curr.val; + +return range_sym; +} + +static void sym_validate_range (struct symbol *sym) +{ +struct symbol *range_sym; + + range_sym =sym_get_near_range_bound (sym, sym->curr.val); +if (range_sym) + sym->curr.val = range_sym->curr.val; }static void sym_set_changed (struct symbol *sym)
@@ -707,7 +722,7 @@ bool sym_set_string_value(struct symbol *sym, const char *newval)const char *sym_get_string_default (struct symbol *sym) {struct property *prop; -struct symbol *ds; +struct symbol *ds, *range_sym;const char *str ="" ;tristate val;
@@ -725,11 +740,6 @@ const char *sym_get_string_default(struct symbol *sym) val =EXPR_AND (expr_calc_value (prop->expr), prop->visible.tri);break ;default : -/* -* The following fails to handle the situation -* where a default value is further limited by -* the valid range. -*/ ds =prop_get_symbol (prop);if (ds !=NULL ) {sym_calc_value (ds);
@@ -773,6 +783,11 @@ const char *sym_get_string_default(struct symbol *sym)default :break ; } + + range_sym =sym_get_near_range_bound (sym, str); +if (range_sym) + str = range_sym->curr.val; +return str; }
scripts/kconfig/tests/savedefconfig_range/Kconfig new file +60 -0
60 lines not on this page · raw message
scripts/kconfig/tests/savedefconfig_range/__init__.py new file +8 -0
@@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0 +"""Test savedefconfig with numerical defaults outside of ranges.""" + + +def test(conf): + assert conf._run_conf('--savedefconfig=defconfig', dot_config='config', + out_file='defconfig') == 0 + assert conf.config_matches('expected_defconfig')
scripts/kconfig/tests/savedefconfig_range/config new file +7 -0
@@ -0,0 +1,7 @@ +CONFIG_INT_DEFAULT_ABOVE_RANGE=1 +CONFIG_INT_DEFAULT_BELOW_RANGE=4 +CONFIG_INT_DYNAMIC_RANGE=3 +CONFIG_HEX_DEFAULT_ABOVE_RANGE=0x20 +CONFIG_INT_IMPLICIT_DEFAULT_ZERO=1 +CONFIG_INT_CONDITIONAL_RANGE=2 +CONFIG_INT_CONDITIONAL_DEFAULT=2
scripts/kconfig/tests/savedefconfig_range/expected_defconfig new file +0 -0
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1530/2214 crypto: atmel-sha - reject initialization without a device
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Slavin Liu <[email protected]>
[ Upstream commit a9a2152d292fd0bc73814eb4a127278ee7dd3f6a ]
A transform may be initialized for the first time after the last device has been removed from the driver list. Return -ENODEV when the lookup is empty, before the debug message reads dd->dev.
Detected by static analysis and reviewed with AI-assisted source auditing.
--- drivers/crypto/atmel-sha.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/crypto/atmel-sha.c +3 -0
@@ -430,6 +430,9 @@ static int atmel_sha_init(struct ahash_request *req)struct atmel_sha_reqctx *ctx =ahash_request_ctx (req);struct atmel_sha_dev *dd =atmel_sha_find_dev (tctx); +if (!dd) +return -ENODEV ; + ctx->dd = dd; ctx->flags =0 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1531/2214 RDMA/uverbs: Drop restrack ref on ib_init_ucontext() failure in GET_CONTEXT
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <[email protected]>
[ Upstream commit 9dcacdc41083cccff74292851bf9fde999e0731a ]
The UVERBS_METHOD_GET_CONTEXT handler allocates the ucontext via ib_alloc_ucontext(), which calls rdma_restrack_new() (initialising the kref to 1) and rdma_restrack_set_name(NULL), the latter attaching the current task and taking a task_struct reference. When ib_init_ucontext() subsequently fails, the error path only does:
kfree(attrs->context); attrs->context = NULL;
without first calling rdma_restrack_put() on &attrs->context->res. The kref therefore never reaches zero, restrack_release() is never invoked, and put_task_struct() is never called, so the task_struct reference taken during set_name is leaked permanently.
A local user with access to an RDMA device can repeat this path (e.g. by hitting an RDMA cgroup limit or supplying invalid ucaps) and leak one task_struct reference per attempt, eventually preventing those processes from being reaped or exhausting memory.
The legacy ib_uverbs_get_context() path already handles this correctly at its err_ucontext label, where rdma_restrack_put() precedes kfree(). Mirror that ordering here.
--- drivers/infiniband/core/uverbs_std_types_device.c | 1 + 1 file changed, 1 insertion(+)
drivers/infiniband/core/uverbs_std_types_device.c +1 -0
@@ -230,6 +230,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_GET_CONTEXT)(return ret; ret =ib_init_ucontext (attrs);if (ret) { +rdma_restrack_put (&attrs->context->res);kfree (attrs->context); attrs->context =NULL ;return ret;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1532/2214 ACPI: CPPC: Validate the _CPC package header
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Loehle <[email protected]>
[ Upstream commit fb345025f161d17fe7c8a6048c7e80e467fa8ddf ]
The _CPC NumEntries field includes every package element, including NumEntries and Revision. acpi_cppc_processor_probe() nevertheless reads those first two elements before checking that they exist and trusts NumEntries when walking the remaining elements.
Reject packages with fewer than two elements and NumEntries values which exceed the package count before accessing Revision or iterating over register descriptors. Although the specification defines NumEntries as the number of package elements, tolerate additional trailing elements because ignoring them is safe and avoids rejecting padded firmware.
Revision is specified as a BYTE, but the parser assigns its 64-bit AML Integer to an unsigned int before validating it. Reject values above U8_MAX before conversion so, for example, 0x100000004 cannot truncate to revision 4.
--- drivers/acpi/cppc_acpi.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
drivers/acpi/cppc_acpi.c +18 -4
@@ -693,6 +693,11 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) } out_obj = (union acpi_object *) output.pointer; +if (out_obj->package.count <2 ) { +pr_debug ("Unexpected _CPC package count (%u) for CPU:%d\n" , + out_obj->package.count, pr->id); + goto out_buf_free; + } cpc_ptr =kzalloc (sizeof (struct cpc_desc ),GFP_KERNEL );if (!cpc_ptr) {
@@ -703,12 +708,15 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)/* First entry is NumEntries. */ cpc_obj = &out_obj->package.elements[0 ];if (cpc_obj->type ==ACPI_TYPE_INTEGER ) { - num_ent = cpc_obj->integer.value; -if (num_ent <=1 ) { -pr_debug ("Unexpected _CPC NumEntries value (%d) for CPU:%d\n" , - num_ent, pr->id); +if (cpc_obj->integer.value <2 || + cpc_obj->integer.value > out_obj->package.count) { +pr_debug ("Invalid _CPC NumEntries (%llu) for package count (%u) on CPU:%d\n" , + cpc_obj->integer.value, out_obj->package.count, + pr->id); goto out_free; } + + num_ent = cpc_obj->integer.value; }else {pr_debug ("Unexpected entry type(%d) for NumEntries\n" , cpc_obj->type);
@@ -718,6 +726,12 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)/* Second entry should be revision. */ cpc_obj = &out_obj->package.elements[1 ];if (cpc_obj->type ==ACPI_TYPE_INTEGER ) { +if (cpc_obj->integer.value >U8_MAX ) { +pr_debug ("Invalid _CPC Revision (%llu) for CPU:%d\n" , + cpc_obj->integer.value, pr->id); + ret = -EINVAL ; + goto out_free; + } cpc_rev = cpc_obj->integer.value; }else { pr_debug("Unexpected entry type(%d) for Revision\n",
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1533/2214 spi: mxic: fix ps_clk leak in runtime resume
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Gu <[email protected]>
[ Upstream commit 648e3c436032b675b339662ea9c0edd9221add76 ]
mxic_spi_runtime_resume() enables ps_clk before calling mxic_spi_clk_enable(). If the latter fails, ps_clk was not disabled.
Unwind ps_clk with clk_disable_unprepare() before returning the error.
--- drivers/spi/spi-mxic.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/spi/spi-mxic.c +7 -1
@@ -529,7 +529,13 @@ static int __maybe_unused mxic_spi_runtime_resume(struct device *dev)return ret; } -return mxic_spi_clk_enable (mxic); + ret =mxic_spi_clk_enable (mxic); +if (ret) { +clk_disable_unprepare (mxic->ps_clk); +return ret; + } + +return 0 ; }static const struct dev_pm_ops mxic_spi_dev_pm_ops = {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1534/2214 dt-bindings: vendor-prefixes: add ESS Technology
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Karl Asseily <[email protected]>
[ Upstream commit beb56d1d3de522885b30bb97fee83825041d65c2 ]
Add the vendor prefix for ESS Technology, Inc., maker of the SABRE family of audio DACs. The prefix follows the company's domain, esstech.com.
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -379,6 +379,8 @@ patternProperties: description: Seiko Epson Corp. "^esp,.*": description: Espressif Systems Co. Ltd. + "^esstech,.*": + description: ESS Technology, Inc. "^est,.*": description: ESTeem Wireless Modems "^ettus,.*":
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1535/2214 clk: raspberrypi: Handle cpufreq device registration failure
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Triet Hoang <[email protected]>
[ Upstream commit e98e3d712023859af7cd78bb7fdb87ea3a9ffb83 ]
Check the return value of platform_device_register_data() when registering the raspberrypi-cpufreq device and propagate the error if registration fails.
This prevents the clock driver from reporting a successful probe when the cpufreq device could not be registered.
--- drivers/clk/bcm/clk-raspberrypi.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/bcm/clk-raspberrypi.c +2 -0
@@ -351,6 +351,8 @@ static int raspberrypi_clk_probe(struct platform_device *pdev) rpi->cpufreq =platform_device_register_data (dev,"raspberrypi-cpufreq" ,-1 ,NULL ,0 ); +if (IS_ERR (rpi->cpufreq)) +return PTR_ERR (rpi->cpufreq);return 0 ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1536/2214 bpf: Factor out helpers for ctx access checking
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hou Tao <[email protected]>
[ Upstream commit 35346ab64132d0f5919b06932d708c0d10360553 ]
Factor out two helpers to check the read access of ctx for raw tp and BTF function. bpf_tracing_ctx_access() is used to check the read access to argument is valid, and bpf_tracing_btf_ctx_access() checks whether the btf type of argument is valid besides the checking of argument read. bpf_tracing_btf_ctx_access() will be used by the following patch.
Stable-dep-of: c42da1d3ba9d ("bpf, lsm: Reject writes into the BPF LSM program context")
--- include/linux/bpf.h | 23 +++++++++++++++++++++++ kernel/trace/bpf_trace.c | 16 ++-------------- net/ipv4/bpf_tcp_ca.c | 9 +-------- 3 files changed, 26 insertions(+), 22 deletions(-)
include/linux/bpf.h +23 -0
@@ -1808,6 +1808,29 @@ bool bpf_prog_test_check_kfunc_call(u32 kfunc_id);bool btf_ctx_access (int off,int size,enum bpf_access_type type,const struct bpf_prog *prog,struct bpf_insn_access_aux *info); + +static inline bool bpf_tracing_ctx_access (int off,int size, +enum bpf_access_type type) +{ +if (off <0 || off >=sizeof (__u64) *MAX_BPF_FUNC_ARGS ) +return false; +if (type !=BPF_READ ) +return false; +if (off % size !=0 ) +return false; +return true; +} + +static inline bool bpf_tracing_btf_ctx_access (int off,int size, +enum bpf_access_type type, +const struct bpf_prog *prog, +struct bpf_insn_access_aux *info) +{ +if (!bpf_tracing_ctx_access (off, size, type)) +return false; +return btf_ctx_access (off, size, type, prog, info); +} + int btf_struct_access(struct bpf_verifier_log *log, const struct btf *btf, const struct btf_type *t, int off, int size, enum bpf_access_type atype,
kernel/trace/bpf_trace.c +2 -14
@@ -1575,13 +1575,7 @@ static bool raw_tp_prog_is_valid_access(int off, int size,const struct bpf_prog *prog, struct bpf_insn_access_aux *info) { - if (off < 0 || off >= sizeof(__u64) * MAX_BPF_FUNC_ARGS) - return false; -if (type !=BPF_READ ) -return false; -if (off % size !=0 ) -return false; -return true; + return bpf_tracing_ctx_access(off, size, type); } static bool tracing_prog_is_valid_access(int off, int size,
@@ -1589,13 +1583,7 @@ static bool tracing_prog_is_valid_access(int off, int size,const struct bpf_prog *prog, struct bpf_insn_access_aux *info) { - if (off < 0 || off >= sizeof(__u64) * MAX_BPF_FUNC_ARGS) - return false; -if (type !=BPF_READ ) -return false; -if (off % size !=0 ) -return false; -return btf_ctx_access (off, size, type, prog, info); + return bpf_tracing_btf_ctx_access(off, size, type, prog, info); } int __weak bpf_prog_test_run_tracing(struct bpf_prog *prog,
net/ipv4/bpf_tcp_ca.c +1 -8
@@ -81,14 +81,7 @@ static bool bpf_tcp_ca_is_valid_access(int off, int size, const struct bpf_prog *prog, struct bpf_insn_access_aux *info) { - if (off < 0 || off >= sizeof(__u64) * MAX_BPF_FUNC_ARGS) - return false; -if (type !=BPF_READ ) -return false; -if (off % size !=0 ) -return false; - -if (!btf_ctx_access (off, size, type, prog, info)) + if (!bpf_tracing_btf_ctx_access(off, size, type, prog, info)) return false;if (info->reg_type ==PTR_TO_BTF_ID && info->btf_id == sock_id)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1537/2214 bpf, lsm: Reject writes into the BPF LSM program context
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <[email protected]>
[ Upstream commit c42da1d3ba9d5067cf3f0676b98bcb3f5f9e3ce1 ]
The verifier types a load from a tracing-style context by its offset
alone: btf_ctx_access() looks the offset up in the attach hook's prototype, and check_mem_access() stamps the resulting type onto the destination register. Nothing tracks what the slot actually holds. That is sound only as long as the context is read-only, and for BPF LSM it is not. lsm_verifier_ops wires ->is_valid_access() straight to btf_ctx_access(), which never looks at enum bpf_access_type, so a store into the context passes verification. Every other user of the helper either goes through bpf_tracing_btf_ctx_access() or open-codes the same type != BPF_READ test first; BPF LSM is the only one that does neither.
A program can therefore store a scalar of its choosing into a context slot, read the slot back, and get a register the verifier believes is a trusted pointer of the hook's argument type. Handing that to a kfunc or helper which dereferences a trusted argument turns it into an arbitrary kernel access. Route BPF LSM through bpf_tracing_btf_ctx_access() like everyone else.
--- kernel/bpf/bpf_lsm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/bpf/bpf_lsm.c +2 -2
@@ -223,6 +223,6 @@ const struct bpf_prog_ops lsm_prog_ops = { };const struct bpf_verifier_ops lsm_verifier_ops = { - .get_func_proto = bpf_lsm_func_proto, - .is_valid_access = btf_ctx_access, + .get_func_proto = bpf_lsm_func_proto, + .is_valid_access = bpf_tracing_btf_ctx_access, };
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1538/2214 fs/ntfs3: check INDEX_ROOT resident size before use in ntfs_read_mft()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiang Mei (Microsoft) <[email protected]>
[ Upstream commit d0ac69ce3af4dbae01d4f064b7482f0c5440dbde ]
When ntfs_read_mft() parses an ATTR_ROOT attribute it computes
root = Add2Ptr(attr, roff);
using the on-disk resident data offset (roff = attr->res.data_off) and then dereferences root->type and root->rule, and later passes root on to indx_init(). Unlike the ATTR_STD and ATTR_NAME cases, which validate that the resident data is large enough (asize >= sizeof(struct X) + roff and rsize >= sizeof(struct X)) before accessing it, the ATTR_ROOT case has no such check.
mi_enum_attr() only guarantees data_off + data_size <= attribute size, so a crafted image can set data_off such that root lands at (or past) the end of the MFT record's slab allocation while still passing that check (e.g. data_size == 0). The subsequent read of root->type is then a slab-out-of-bounds read, reported by KASAN when mounting the image:
BUG: KASAN: slab-out-of-bounds in ntfs_iget5 (fs/ntfs3/inode.c:283) Read of size 4 at addr ffff88800c06a400 by task exploit/142 Call Trace: ... [KASAN report internals] ntfs_iget5 (fs/ntfs3/inode.c:283 fs/ntfs3/inode.c:542) ntfs_fill_super (fs/ntfs3/super.c:1690) get_tree_bdev_flags (fs/super.c:1634) vfs_get_tree (fs/super.c:1694) fc_mount (fs/namespace.c:1198) path_mount (fs/namespace.c:3765 ...) __x64_sys_mount (fs/namespace.c:4174 ...) do_syscall_64 (arch/x86/entry/syscall_64.c:63) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121) The buggy address is located 0 bytes to the right of allocated 1024-byte region [ffff88800c06a000, ffff88800c06a400) which belongs to the cache kmalloc-1k of size 1024
Validate the resident data size in the ATTR_ROOT case the same way the neighbouring cases do, so that a truncated or mis-offset INDEX_ROOT is rejected before root is dereferenced.
--- fs/ntfs3/inode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/ntfs3/inode.c +3 -1
@@ -273,7 +273,9 @@ static struct inode *ntfs_read_mft(struct inode *inode,break ;case ATTR_ROOT : -if (attr->non_res) +if (attr->non_res || + asize <sizeof (struct INDEX_ROOT ) + roff || + rsize <sizeof (struct INDEX_ROOT )) goto out; root =Add2Ptr (attr, roff);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1539/2214 fs/ntfs3: fix valid_size not being updated in attr_allocate_frame()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhan Xusheng <[email protected]>
[ Upstream commit a1972501ffb15313f7ae598989bb2cd32829e625 ]
At the end of attr_allocate_frame() the on-disk valid_size is meant to be updated to the value passed in via @new_valid:
valid_size = le64_to_cpu(attr_b->nres.valid_size);
if (new_valid != valid_size) {
attr_b->nres.valid_size = cpu_to_le64(valid_size);
mi_b->dirty = true;
}but it writes back the old valid_size that was just read instead of new_valid, so the field is never actually changed even though the record is marked dirty -- the intended update is a no-op.
ni_update_parent() spells the same read-compare-write out correctly a few hundred lines away, storing the newly derived value:
valid_le = cpu_to_le64(new_valid);
if (valid_le != attr->nres.valid_size) {
attr->nres.valid_size = valid_le;In practice that path, reached from ni_write_inode(), re-derives nres.valid_size from ni->i_valid on inode write-back, which normally masks this, so the visible impact is limited. The assignment here is still wrong though; store @new_valid as intended.
--- fs/ntfs3/attrib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ntfs3/attrib.c +1 -1
@@ -1686,7 +1686,7 @@ int attr_allocate_frame(struct ntfs_inode *ni, CLST frame, size_t compr_size, valid_size =le64_to_cpu (attr_b->nres.valid_size);if (new_valid != valid_size) { - attr_b->nres.valid_size =cpu_to_le64 (valid_size); + attr_b->nres.valid_size =cpu_to_le64 (new_valid); mi_b->dirty = true; } }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1540/2214 fs/ntfs3: validate EA entry layout against ef->size in ntfs_read_ea
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Konstantin Komarov <[email protected]>
[ Upstream commit 01e56820ef52d14a5560fb7c0c6f2f75ef6f9393 ]
In ntfs_read_ea(), the ef->size branch only checks that the declared entry size fits the remaining buffer; unlike the zero-size branch it never verifies that the entry's own name and value fit inside ef->size. A crafted image can thus present an in-bounds ef->size with an arbitrary elength, which find_ea()/ntfs_get_ea() later use as the memcpy length, reading past the allocation and leaking adjacent heap memory:
BUG: KASAN: slab-out-of-bounds in ntfs_get_ea (fs/ntfs3/xattr.c:302) Read of size 65535 at addr ffff888010770b0f by task exploit/142 ... __asan_memcpy (mm/kasan/shadow.c:105) ntfs_get_ea (fs/ntfs3/xattr.c:302) ntfs_getxattr (fs/ntfs3/xattr.c:848) __vfs_getxattr (fs/xattr.c:446) vfs_getxattr (fs/xattr.c:479) do_getxattr (fs/xattr.c:808) filename_getxattr (fs/xattr.c:837) path_getxattrat (fs/xattr.c:876) do_syscall_64 (arch/x86/entry/syscall_64.c:94) ... The buggy address is located 15 bytes inside of allocated 20-byte region, cache kmalloc-32
Validate the name/value layout in the ef->size branch too, bounding it against ef->size, as the zero-size branch validates it against the buffer.
--- fs/ntfs3/xattr.c | 2 ++ 1 file changed, 2 insertions(+)
fs/ntfs3/xattr.c +2 -0
@@ -167,6 +167,8 @@ static int ntfs_read_ea(struct ntfs_inode *ni, struct EA_FULL **ea, ea_size =le32_to_cpu (ef->size);if (ea_size > bytes || packed_size > ea_size) goto out1; +if (bytes < offsetof(struct EA_FULL , name)) + goto out1;continue ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1541/2214 fs/ntfs3: validate $SDH entry size in ntfs_insert_security
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xiang Mei <[email protected]>
[ Upstream commit 5b76487f94dacc2884135ce9a7bda61ce7ffa209 ]
ntfs_insert_security() walks the $Secure::$SDH index and reads e->sec_hdr.size for every entry returned by indx_find()/indx_find_sort(). Those only guarantee the NTFS_DE envelope (e->size), so a crafted $SDH entry shorter than a full NTFS_DE_SDH at the tail of an index buffer makes the read of e->sec_hdr.size run past the allocation. Triggerable by an unprivileged setxattr(2) on a crafted NTFS image.
BUG: KASAN: slab-out-of-bounds in ntfs_insert_security (fs/ntfs3/fsntfs.c:2148) Read of size 4 at addr ffff88800fa1de00 by task exploit/142 ntfs_insert_security (fs/ntfs3/fsntfs.c:2148) ntfs_setxattr (fs/ntfs3/xattr.c:947) __vfs_setxattr (fs/xattr.c:223) __vfs_setxattr_noperm (fs/xattr.c:257) vfs_setxattr (fs/xattr.c:344) filename_setxattr (fs/xattr.c:690) path_setxattrat (fs/xattr.c:734) __x64_sys_setxattr (fs/xattr.c:764) [...] The buggy address is located 0 bytes to the right of allocated 512-byte region [ffff88800fa1dc00, ffff88800fa1de00)
Stop the scan when an entry is too small to hold a SECURITY_HDR.
--- fs/ntfs3/fsntfs.c | 3 +++ 1 file changed, 3 insertions(+)
fs/ntfs3/fsntfs.c +3 -0
@@ -2153,6 +2153,9 @@ int ntfs_insert_security(struct ntfs_sb_info *sbi, goto out;while (e) { +if (le16_to_cpu (e->de.size) <SIZEOF_SDH_DIRENTRY ) +break ; +if (le32_to_cpu (e->sec_hdr.size) == new_sec_size) { err = ntfs_read_run_nb(sbi, &ni->file.run, le64_to_cpu(e->sec_hdr.off),
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1542/2214 pmdomain: imx: Propagate SCU provider registration failures
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit d3efba7921f3ebebd91fc481910a428c78414fd8 ]
imx_scu_init_pm_domains() ignores of_genpd_add_provider_onecell() and returns success even when none of the initialized domains are published to DT consumers.
Return the provider error and remove the initialized domains in reverse order before devm releases their backing storage on probe failure.
The issue was found by our static-analysis tool and manually reviewed.
--- drivers/firmware/imx/scu-pd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/firmware/imx/scu-pd.c +8 -2
@@ -348,7 +348,7 @@ static int imx_scu_init_pm_domains(struct device *dev,struct genpd_onecell_data *pd_data;struct imx_sc_pm_domain *sc_pd;u32 count =0 ; -int i, j; +int i, j, ret;for (i =0 ; i < pd_soc->num_ranges; i++) count += pd_ranges[i].num;
@@ -377,7 +377,13 @@ static int imx_scu_init_pm_domains(struct device *dev, pd_data->num_domains = count; pd_data->xlate = imx_scu_pd_xlate; -of_genpd_add_provider_onecell (dev->of_node, pd_data); + ret =of_genpd_add_provider_onecell (dev->of_node, pd_data); +if (ret) { +while (count) +pm_genpd_remove (domains[--count]); + +return ret; + }return 0 ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1543/2214 dt-bindings: vendor-prefixes: add vendor prefix for Nexperia B.V.
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neil Armstrong <[email protected]>
[ Upstream commit 819a3e62d37a2fe73c1e7f241f2ac086042e7757 ]
Document the vendor prefix for the semiconductor company Nexperia B.V.
The company website is https://www.nexperia.com/
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -802,6 +802,8 @@ patternProperties: description: Guangdong Neweast Optoelectronics CO., LTD "^nexbox,.*": description: Nexbox + "^nexperia,.*": + description: Nexperia B.V. "^nextthing,.*": description: Next Thing Co. "^newhaven,.*":
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1544/2214 pstore: dont leave an ERR_PTR in the ramoops zone pointer
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Parri <[email protected]>
[ Upstream commit 70fec428c845216da98041b1ae9f16a8f54b3d68 ]
ramoops_init_prz() stores the result of persistent_ram_new() in *prz and returns the error without clearing it when initialization fails. ramoops_probe() then cleans up through ramoops_free_przs(), which hands *prz to persistent_ram_free(); that treats the ERR_PTR as a valid zone and dereferences it, crashing the kernel.
Clear *prz before returning so that cleanup sees a NULL zone.
--- fs/pstore/ram.c | 1 + 1 file changed, 1 insertion(+)
fs/pstore/ram.c +1 -0
@@ -590,6 +590,7 @@ static int ramoops_init_prz(const char *name,if (IS_ERR (*prz)) {int err =PTR_ERR (*prz); + *prz =NULL ;dev_err (dev,"failed to request %s mem region (0x%zx@0x%llx): %d\n" , name, sz, (unsigned long long )*paddr, err);return err;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1545/2214 pstore: reject persistent RAM zones too small for the buffer header
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrea Parri <[email protected]>
[ Upstream commit 1b30df8662ac85a6759be4332f3bec7e3cb28efc ]
persistent_ram_buffer_map() computes
prz->buffer_size = size - sizeof(struct persistent_ram_buffer);
without checking that size is large enough to hold the header. A ramoops zone configured with a tiny size (e.g. ramoops.pmsg_size=1) underflows buffer_size to a huge value, which defeats every bounds check in persistent_ram_write() and persistent_ram_write_user(); a write to /dev/pmsg0 then copies user data far past the end of the zone and corrupts kernel memory.
Reject zones that are not larger than the buffer header.
--- fs/pstore/ram_core.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/pstore/ram_core.c +6 -0
@@ -507,6 +507,12 @@ static int persistent_ram_buffer_map(phys_addr_t start, phys_addr_t size, prz->paddr = start; prz->size = size; +if (size <=sizeof (struct persistent_ram_buffer )) { +pr_err ("%s: persistent ram zone too small (%#llx bytes)\n" , + prz->label, (unsigned long long )size); +return -EINVAL ; + } +if (pfn_valid (start >>PAGE_SHIFT )) prz->vaddr =persistent_ram_vmap (start, size, memtype);else
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1546/2214 leds: pca9532: Check i2c_smbus_read_byte_data() return value
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haibo Chen <[email protected]>
[ Upstream commit 1b75f038e5f71ed32ce6593b5763f9776ec58a25 ]
Coverity report INTEGER_OVERFLOW (tainted_data_return -> cast_underflow -> overflow) in pca9532_getled(). pca9532_getled() stored the return value of i2c_smbus_read_byte_data() into a char and used it directly to compute the LED state without checking for an error. i2c_smbus_read_byte_data() returns a negative error code on failure. On an I2C read error the negative value was assigned to an unsigned type, triggering an integer underflow/overflow, and a meaningless LED state was returned to the caller.
Read the value into an int, check for the error, and fall back to PCA9532_OFF while emitting a warning when the read fails.
--- drivers/leds/leds-pca9532.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/leds/leds-pca9532.c +6 -3
@@ -259,12 +259,15 @@ static enum pca9532_state pca9532_getled(struct pca9532_led *led)struct i2c_client *client = led->client;struct pca9532_data *data =i2c_get_clientdata (client);u8 maxleds = data->chip_info->num_leds; -char reg; -enum pca9532_state ret; +int reg; +enum pca9532_state ret =PCA9532_OFF ;mutex_lock (&data->update_lock); reg =i2c_smbus_read_byte_data (client,LED_REG (maxleds, led->id)); - ret = (reg &LED_MASK (led->id)) >>LED_SHIFT (led->id); +if (reg >=0 ) + ret = (reg &LED_MASK (led->id)) >>LED_SHIFT (led->id); +else +dev_warn (&client->dev,"failed to read LED register: %d\n" , reg);mutex_unlock (&data->update_lock);return ret; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1547/2214 leds: lm3692x: Fix regulator/gpio leak and wrong enabled state on last write failure
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Nguyen <[email protected]>
[ Upstream commit 145ca6bca2cc5fd8d9c7af216df58a9c75c0e84c ]
Every write in lm3692x_leds_enable() checks its return and jumps to
out: on failure -- except the last one, which falls through and sets led->enabled = true regardless of whether it actually succeeded. Leaks the regulator on a failing probe, and short-circuits later brightness_set() calls without retrying.
Route it through out: like every other write here, and only set enabled = true once it succeeds.
--- drivers/leds/leds-lm3692x.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/leds/leds-lm3692x.c +3 -1
@@ -274,9 +274,11 @@ static int lm3692x_leds_enable(struct lm3692x_led *led) ret =regmap_update_bits (led->regmap,LM3692X_EN ,LM3692X_ENABLE_MASK , enable_state |LM3692X_DEVICE_EN ); +if (ret) + goto out; led->enabled = true; -return ret; +return 0 ; out:dev_err (&led->client->dev,"Fail writing initialization values\n" );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1548/2214 RDMA/core: Fix partial copy of IPv6 flow_lbl in LAG hash skb
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li RongQing <[email protected]>
[ Upstream commit b63d21631f836528ef660d7b5a0d84890ff6dbd5 ]
rdma_build_skb() constructs a synthetic IPv6 header for LAG slave selection and copies the flow label from the AH attribute:
memcpy(&ip6h->flow_lbl, &ah_attr->grh.flow_label, sizeof(*ip6h->flow_lbl));
ipv6hdr.flow_lbl is __u8[3], so sizeof(*ip6h->flow_lbl) dereferences the array to a single __u8 and yields 1. The memcpy therefore copies only the first byte of the flow label, leaving flow_lbl[1] and flow_lbl[2] uninitialised in the skb buffer (alloc_skb() does not zero the data). The resulting LAG hash is computed over one byte of real flow-label data and two bytes of kmalloc residue, so IPv6 RoCEv2 traffic on a bonded interface can be steered to the wrong slave.
Use sizeof(ip6h->flow_lbl) (the array, 3 bytes) so the whole flow label is copied.
--- drivers/infiniband/core/lag.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/core/lag.c +1 -1
@@ -60,7 +60,7 @@ static struct sk_buff *rdma_build_skb(struct ib_device *device, ip6h->version =6 ; ip6h->nexthdr =IPPROTO_UDP ;memcpy (&ip6h->flow_lbl, &ah_attr->grh.flow_label, -sizeof (*ip6h->flow_lbl)); +sizeof (ip6h->flow_lbl));memcpy (&ip6h->saddr, ah_attr->grh.sgid_attr->gid.raw,sizeof (struct in6_addr )); memcpy(&ip6h->daddr, ah_attr->grh.dgid.raw,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1549/2214 leds: flash: Prevent using uninitialized variable in flash_fault_show()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Antipov <[email protected]>
[ Upstream commit d229695f2162a41bfa614f175798fa56a5f1c969 ]
In flash_fault_show(), address of uninitialized 'fault' variable is passed to device-specific .fault_get callbacks. This is not a problem if such a callback directly assigns the value like rt4505_fault_get(), but results in an undefined behavior if callback just performs bitwise ORs like as3645a_get_fault(). So just initialize 'fault' with zero.
--- drivers/leds/led-class-flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/leds/led-class-flash.c +1 -1
@@ -188,7 +188,7 @@ static ssize_t flash_fault_show(struct device *dev, {struct led_classdev *led_cdev =dev_get_drvdata (dev);struct led_classdev_flash *fled_cdev =lcdev_to_flcdev (led_cdev); -u32 fault, mask =0x1 ; +u32 fault =0 , mask =0x1 ;char *pbuf = buf;int i, ret, buf_len;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1550/2214 regulator: mp886x: check get_voltage_sel() return value
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jisheng Zhang <[email protected]>
[ Upstream commit 87121c42fadc7683469aee96ad833bc560197a55 ]
The get_voltage_sel() can fail, resulting in negative error codes stored in unsigned integers and corrupted state logic.
--- drivers/regulator/mp886x.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/regulator/mp886x.c +7 -1
@@ -256,6 +256,7 @@ static int mp886x_regulator_register(struct mp886x_device_info *di, {struct regulator_desc *rdesc = &di->desc;struct regulator_dev *rdev; +int sel; rdesc->name ="mp886x-reg" ; rdesc->supply_name ="vin" ;
@@ -277,7 +278,12 @@ static int mp886x_regulator_register(struct mp886x_device_info *di, rdev =devm_regulator_register (di->dev, &di->desc, config);if (IS_ERR (rdev))return PTR_ERR (rdev); - di->sel = rdesc->ops->get_voltage_sel (rdev); + + sel = rdesc->ops->get_voltage_sel (rdev); +if (sel <0 ) +return sel; + di->sel = sel; +return 0 ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1551/2214 regulator: mp886x: fix pontential division by zero
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jisheng Zhang <[email protected]>
[ Upstream commit d16ef5debccc4289c1f25309a2cccfbbe879601a ]
If the "mps,fb-voltage-divider" 2nd var is 0, there will be division by zero bug.
--- drivers/regulator/mp886x.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/regulator/mp886x.c +3 -0
@@ -317,6 +317,9 @@ static int mp886x_i2c_probe(struct i2c_client *client)if (ret)return ret; +if (di->r[1 ] ==0 ) +return -EINVAL ; + di->en_gpio =devm_gpiod_get (dev,"enable" ,GPIOD_OUT_HIGH );if (IS_ERR (di->en_gpio))return PTR_ERR (di->en_gpio);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1552/2214 RDMA/irdma: Use kvzalloc for lvl2 leafmem allocation
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeremy Bongio <[email protected]>
[ Upstream commit 9c40f13a63a4b87177de3e8c318af25068fc6ab4 ]
During VM live migration or when registering large memory regions (e.g., guest memory >= 256 GB backed by 4 KiB pages), get_lvl2_pble() calculates total leaves exceeding ~131,072. The memory required for lvl2->leafmem.va exceeds 4 MiB (sizeof(*leaf) * total > 5.24 MiB).
Because kzalloc() requires physically contiguous pages, requests larger than MAX_PAGE_ORDER (4 MiB on x86_64) fail and trigger a warning:
WARNING: CPU: 123 PID: 119906 at mm/page_alloc.c:5997 __alloc_frozen_pages_noprof+0x50c/0x1050 Call Trace: <TASK> alloc_frozen_pages_noprof+0xc0/0x240 ___kmalloc_large_node+0x3d/0xd0 __kmalloc_large_node_noprof+0x1b/0x90 __kmalloc_noprof+0x254/0x660 get_lvl1_lvl2_pble+0xbc/0x270 [irdma] irdma_get_pble+0x44/0xc0 [irdma] irdma_setup_pbles+0x46/0x1d0 [irdma] irdma_reg_user_mr_type_mem+0x41/0x230 [irdma] irdma_reg_user_mr+0x194/0x1c0 [irdma] ib_uverbs_reg_mr+0x1b0/0x2c0 [ib_uverbs]
The leafmem array is purely host software tracking structures (struct irdma_pble_info) and does not require physically contiguous memory.
Switch the allocation from kzalloc() to kvzalloc() and free it with kvfree() so that requests exceeding MAX_PAGE_ORDER fall back to virtually contiguous memory via vmalloc.
--- drivers/infiniband/hw/irdma/pble.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/hw/irdma/pble.c +3 -3
@@ -328,7 +328,7 @@ static void free_lvl2(struct irdma_hmc_pble_rsrc *pble_rsrc,if (root->addr)irdma_prm_return_pbles (&pble_rsrc->pinfo, &root->chunkinfo); -kfree (lvl2->leafmem.va); +kvfree (lvl2->leafmem.va); lvl2->leaf =NULL ; }
@@ -357,7 +357,7 @@ get_lvl2_pble(struct irdma_hmc_pble_rsrc *pble_rsrc, lvl2->leaf_cnt = total; lvl2->leafmem.size = (sizeof (*leaf) * total); - lvl2->leafmem.va =kzalloc (lvl2->leafmem.size,GFP_KERNEL ); + lvl2->leafmem.va =kvzalloc (lvl2->leafmem.size,GFP_KERNEL );if (!lvl2->leafmem.va)return IRDMA_ERR_NO_MEMORY ;
@@ -366,7 +366,7 @@ get_lvl2_pble(struct irdma_hmc_pble_rsrc *pble_rsrc, ret_code =irdma_prm_get_pbles (&pble_rsrc->pinfo, &root->chunkinfo, total <<3 , &root->addr, &fpm_addr);if (ret_code) { -kfree (lvl2->leafmem.va); +kvfree (lvl2->leafmem.va); lvl2->leaf =NULL ;return IRDMA_ERR_NO_MEMORY ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1553/2214 wifi: rtl8xxxu: Use dev_* instead of pr_info
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bitterblue Smith <[email protected]>
[ Upstream commit bd954a7e4aa0739630884fc572d2d0e4dcd16e25 ]
Replace two instances of bare pr_info with dev_info and dev_warn.
Also make their messages a little more informative.
Stable-dep-of: 9f7edf4e8584 ("wifi: rtl8xxxu: free RX skb when URB submission fails")
--- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +4 -2
@@ -1996,7 +1996,8 @@ static int rtl8xxxu_download_firmware(struct rtl8xxxu_priv *priv) val8 =rtl8xxxu_read8 (priv,REG_MCU_FW_DL );if (val8 &MCU_FW_RAM_SEL ) { -pr_info ("do the RAM reset\n" ); +dev_info (&priv->udev->dev, +"Firmware is already running, resetting the MCU.\n" );rtl8xxxu_write8 (priv,REG_MCU_FW_DL ,0x00 ); priv->fops->reset_8051 (priv); }
@@ -5228,7 +5229,8 @@ static void rtl8xxxu_rx_urb_work(struct work_struct *work)rtl8xxxu_queue_rx_urb (priv, rx_urb);break ;default : -pr_info ("failed to requeue urb %i\n" , ret); +dev_warn (&priv->udev->dev, +"failed to requeue urb with error %i\n" , ret); skb = (struct sk_buff *)rx_urb->urb.context;dev_kfree_skb (skb);usb_free_urb (&rx_urb->urb);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1554/2214 wifi: rtl8xxxu: free RX skb when URB submission fails
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kim Wooseok <[email protected]>
[ Upstream commit 9f7edf4e8584c87e3c478c6dd87c08d51b5157c2 ]
When usb_submit_urb() fails, rtl8xxxu_submit_rx_urb() unanchors the URB but leaves the newly allocated skb in urb.context. For ENOMEM/EAGAIN, the RX worker puts the request back on the pending list. The next submission allocates another skb and overwrites that pointer, leaking the previous buffer. Stopping before the retry also leaks it, because pending-list cleanup frees only the URB.
Free the skb and clear urb.context in rtl8xxxu_submit_rx_urb() when submission fails. This keeps buffer allocation and failure cleanup in the same function, so a request returned for retry or teardown no longer owns an skb. Remove the corresponding cleanup from start and the RX worker; they only need to decide whether to retry or free the URB.
--- .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +5 -11
@@ -5199,7 +5199,6 @@ static void rtl8xxxu_rx_urb_work(struct work_struct *work)struct rtl8xxxu_priv *priv;struct rtl8xxxu_rx_urb *rx_urb, *tmp;struct list_head local; -struct sk_buff *skb;unsigned long flags;int ret;
@@ -5231,8 +5230,6 @@ static void rtl8xxxu_rx_urb_work(struct work_struct *work)default :dev_warn (&priv->udev->dev,"failed to requeue urb with error %i\n" , ret); - skb = (struct sk_buff *)rx_urb->urb.context; -dev_kfree_skb (skb);usb_free_urb (&rx_urb->urb); } }
@@ -5811,8 +5808,11 @@ static int rtl8xxxu_submit_rx_urb(struct rtl8xxxu_priv *priv, skb_size, rtl8xxxu_rx_complete, skb);usb_anchor_urb (&rx_urb->urb, &priv->rx_anchor); ret =usb_submit_urb (&rx_urb->urb,GFP_ATOMIC ); -if (ret) +if (ret) {usb_unanchor_urb (&rx_urb->urb); +dev_kfree_skb (skb); + rx_urb->urb.context =NULL ; + }return ret; }
@@ -6372,7 +6372,6 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw)struct rtl8xxxu_priv *priv = hw->priv;struct rtl8xxxu_rx_urb *rx_urb;struct rtl8xxxu_tx_urb *tx_urb; -struct sk_buff *skb;unsigned long flags;int ret, i;
@@ -6423,13 +6422,8 @@ static int rtl8xxxu_start(struct ieee80211_hw *hw) rx_urb->hw = hw; ret =rtl8xxxu_submit_rx_urb (priv, rx_urb); -if (ret) { -if (ret != -ENOMEM ) { - skb = (struct sk_buff *)rx_urb->urb.context; -dev_kfree_skb (skb); - } +if (ret)rtl8xxxu_queue_rx_urb (priv, rx_urb); - } }schedule_delayed_work (&priv->ra_watchdog,2 *HZ );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1555/2214 RDMA/cxgb4: Fix neigh reference leak in rx_pkt()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <[email protected]>
[ Upstream commit 5fb3051aa4611ae18e304814fb1b74a30065fd85 ]
If ip_dev_find() fails on the loopback path the code jumps to free_dst without releasing the neighbour reference taken by dst_neigh_lookup_skb(), leaking one neigh reference.
Release the neighbour before jumping to free_dst.
--- drivers/infiniband/hw/cxgb4/cm.c | 1 + 1 file changed, 1 insertion(+)
drivers/infiniband/hw/cxgb4/cm.c +1 -0
@@ -4162,6 +4162,7 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb) pdev =ip_dev_find (&init_net, iph->daddr);if (!pdev) {pr_err ("%s - failed to find device!\n" , __func__); +neigh_release (neigh); goto free_dst; } e = cxgb4_l2t_get(dev->rdev.lldi.l2t, neigh,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1556/2214 RDMA/cxgb4: Fix skb reference leak in rx_pkt()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <[email protected]>
[ Upstream commit 5eb6ecb612841927b5ede554a0e9d88240934282 ]
rx_pkt() takes an extra reference on the received skb so it can be handed to the firmware completion path via req->cookie. When the work request skb allocation in send_fw_pass_open_req() fails the function returns without releasing that extra reference, leaking one skb reference.
Free the packet skb before returning when the allocation fails, matching the cxgb4_ofld_send() failure path.
--- drivers/infiniband/hw/cxgb4/cm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/hw/cxgb4/cm.c +3 -1
@@ -4012,8 +4012,10 @@ static void send_fw_pass_open_req(struct c4iw_dev *dev, struct sk_buff *skb,int ret; req_skb =alloc_skb (sizeof (struct fw_ofld_connection_wr ),GFP_KERNEL ); -if (!req_skb) +if (!req_skb) { +kfree_skb (skb);return ; + } req =__skb_put_zero (req_skb,sizeof (*req)); req->op_compl =htonl (WR_OP_V (FW_OFLD_CONNECTION_WR ) |FW_WR_COMPL_F ); req->len16_pkd =htonl (FW_WR_LEN16_V (DIV_ROUND_UP (sizeof (*req),16 )));
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1557/2214 RDMA/mlx5: Fix RQ resource reference leak in mlx5_ib_wq_event()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <[email protected]>
[ Upstream commit 65f3eab431944415bbe5e3af1bbb2736d4bb1523 ]
Since commit 312b8f79eb05 ("RDMA/mlx: Calling qp event handler in workqueue context") rsc_event_notifier() expects the event handler to drop the resource reference taken by mlx5_get_rsc(). mlx5_ib_wq_event() was missed by that conversion, so every RQ event leaks one reference, which keeps destroy_resource_common() waiting on the completion.
Put the resource reference on all exits of the handler.
--- drivers/infiniband/hw/mlx5/qp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/qp.c +4 -1
@@ -5121,11 +5121,14 @@ static void mlx5_ib_wq_event(struct mlx5_core_qp *core_qp, int type)break ;default :mlx5_ib_warn (dev,"Unexpected event type %d on WQ %06x\n" , type, core_qp->qpn); -return ; + goto out; } rwq->ibwq.event_handler (&event, rwq->ibwq.wq_context); } + +out: +mlx5_core_res_put (&core_qp->common); }static int set_delay_drop (struct mlx5_ib_dev *dev)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1558/2214 RDMA/siw: Fix qp use-after-free in siw_get_base_qp()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <[email protected]>
[ Upstream commit ef15197f81ffedf29560edf2221199d92fd83dc2 ]
The reference taken by siw_qp_id2obj() is dropped before the address of the embedded ib_qp is taken from the QP. If that reference was the last one the QP is freed and the pointer returned to the iwarp core is dangling; the core only pins the QP with iw_add_ref() after the call has returned.
Copy the pointer while the reference is still held.
--- drivers/infiniband/sw/siw/siw_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/infiniband/sw/siw/siw_main.c +4 -1
@@ -244,8 +244,11 @@ static struct ib_qp *siw_get_base_qp(struct ib_device *base_dev, int id)/* * siw_qp_id2obj() increments object reference count */ +struct ib_qp *base_qp = &qp->base_qp; +siw_qp_put (qp); -return &qp->base_qp; + +return base_qp; }return NULL ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1559/2214 crypto: hisilicon/hpre - remove dma_free_coherent on NULL req->dst in ECDH
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weili Qian <[email protected]>
[ Upstream commit 5b87f619cc5c0a55dcd85ce97974e3f5b9333b7b ]
In hpre_ecdh_hw_data_clr_all(), req->dst is always NULL because hpre_ecdh_dst_data_init() sets hpre_req->dst = NULL before mapping the user buffer with dma_map_single(). The dma_free_coherent() call on req->dst is therefore dead code. Remove it.
--- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 2 -- 1 file changed, 2 deletions(-)
drivers/crypto/hisilicon/hpre/hpre_crypto.c +0 -2
@@ -1438,8 +1438,6 @@ static void hpre_ecdh_hw_data_clr_all(struct hpre_ctx *ctx,if (unlikely (dma_mapping_error (dev, dma)))return ; -if (req->dst) -dma_free_coherent (dev, ctx->key_sz <<1 , req->dst, dma);if (dst)dma_unmap_single (dev, dma, ctx->key_sz <<1 ,DMA_FROM_DEVICE ); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1560/2214 crypto: ccp - kill v3 IRQ tasklet during teardown
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <[email protected]>
[ Upstream commit b72a639bdee6e07d8091718ac3e451d9c5cba1b5 ]
On PCI devices using MSI-X, ccp_irq_handler() schedules irq_tasklet. The teardown paths release the IRQ but do not drain a tasklet that was already queued, so it can access ccp after the device-managed allocation has been released.
Kill the tasklet after releasing the IRQ in both the initialization error path and ccp_destroy().
--- drivers/crypto/ccp/ccp-dev-v3.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/crypto/ccp/ccp-dev-v3.c +4 -0
@@ -507,6 +507,8 @@ static int ccp_init(struct ccp_device *ccp)kthread_stop (ccp->cmd_q[i].kthread);sp_free_ccp_irq (ccp->sp, ccp); +if (ccp->use_tasklet) +tasklet_kill (&ccp->irq_tasklet); e_pool:for (i =0 ; i < ccp->cmd_q_count; i++)
@@ -546,6 +548,8 @@ static void ccp_destroy(struct ccp_device *ccp)kthread_stop (ccp->cmd_q[i].kthread);sp_free_ccp_irq (ccp->sp, ccp); +if (ccp->use_tasklet) +tasklet_kill (&ccp->irq_tasklet);for (i =0 ; i < ccp->cmd_q_count; i++)dma_pool_destroy (ccp->cmd_q[i].dma_pool);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1561/2214 crypto: ccp - kill v5 IRQ tasklet during teardown
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiale Yao <[email protected]>
[ Upstream commit 67aefeccc4101a93627f36abbd049f191b54f903 ]
On PCI devices using MSI-X, ccp5_irq_handler() schedules irq_tasklet. The teardown paths release the IRQ but do not drain a tasklet that was already queued, so it can access ccp after the device-managed allocation has been released.
Kill the tasklet after releasing the IRQ in both the initialization error path and ccp5_destroy().
--- drivers/crypto/ccp/ccp-dev-v5.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/crypto/ccp/ccp-dev-v5.c +4 -0
@@ -996,6 +996,8 @@ static int ccp5_init(struct ccp_device *ccp) e_irq:sp_free_ccp_irq (ccp->sp, ccp); +if (ccp->use_tasklet) +tasklet_kill (&ccp->irq_tasklet); e_pool:for (i =0 ; i < ccp->cmd_q_count; i++)
@@ -1047,6 +1049,8 @@ static void ccp5_destroy(struct ccp_device *ccp)kthread_stop (ccp->cmd_q[i].kthread);sp_free_ccp_irq (ccp->sp, ccp); +if (ccp->use_tasklet) +tasklet_kill (&ccp->irq_tasklet);/* Flush the cmd and backlog queue */ while (!list_empty (&ccp->cmd)) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1562/2214 swim: Assert strobe with stable outputs
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit adcc410bfb41715fef198a0975db4ed594a49bb7 ]
Inside Macintosh says, "Be sure that you don't change CA0-CA2 or SEL while LSTRB is high". Unfortunately, those bits do change. The CA0-CA2 outputs become inputs when (LSTRB << 4) | LSTRB gets written to the phase register. Then LSTRB is driven low (with CA0-CA2 bits set).
This is a problem because the drive interprets a STEP command as an EJECT command when these pins float high. This occurs intermittently, perhaps because interrupts are disabled and the race condition happens to end well. However, when I add code to step the heads with interrupts enabled, the disk always ejects.
Keep the four phase pin directions set to output and hold their levels constant during LSTRB signalling. Introduce the PHASE_PIN_DIRECTION macro to separate the pin configuration from the logic level changes.
--- drivers/block/swim.c | 62 ++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 31 deletions(-)
drivers/block/swim.c +31 -31
@@ -87,37 +87,37 @@ struct iwm {#define iwm_write (base, reg, v) out_8(&(base)->reg, (v))#define iwm_read (base, reg) in_8(&(base)->reg) -/* bits in phase register */ +/* Bits in phase register */ -#define SEEK_POSITIVE 0x070 -#define SEEK_NEGATIVE 0x074 -#define STEP 0x071 -#define MOTOR_ON 0x072 -#define MOTOR_OFF 0x076 -#define INDEX 0x073 -#define EJECT 0x077 -#define SETMFM 0x171 -#define SETGCR 0x175 - -#define RELAX 0x033 -#define LSTRB 0x008 - -#define CA_MASK 0x077 +#define RELAX 0x03 +#define LSTRB 0x08 +#define CA_MASK 0x07 +#define PHASE_PIN_DIR 0xF0/* Select values for swim_select and swim_readbit */ -#define READ_DATA_0 0x074 -#define ONEMEG_DRIVE 0x075 -#define SINGLE_SIDED 0x076 -#define DRIVE_PRESENT 0x077 -#define DISK_IN 0x170 -#define WRITE_PROT 0x171 -#define TRACK_ZERO 0x172 -#define TACHO 0x173 -#define READ_DATA_1 0x174 -#define GCR_MODE 0x175 -#define SEEK_COMPLETE 0x176 -#define TWOMEG_MEDIA 0x177 +#define SEEK_POSITIVE 0x000 +#define SEEK_NEGATIVE 0x004 +#define STEP 0x001 +#define MOTOR_ON 0x002 +#define MOTOR_OFF 0x006 +#define INDEX 0x003 +#define EJECT 0x007 +#define SETMFM 0x101 +#define SETGCR 0x105 + +#define READ_DATA_0 0x004 +#define ONEMEG_DRIVE 0x005 +#define SINGLE_SIDED 0x006 +#define DRIVE_PRESENT 0x007 +#define DISK_IN 0x100 +#define WRITE_PROT 0x101 +#define TRACK_ZERO 0x102 +#define TACHO 0x103 +#define READ_DATA_1 0x104 +#define GCR_MODE 0x105 +#define SEEK_COMPLETE 0x106 +#define TWOMEG_MEDIA 0x107/* Bits in handshake register */
@@ -268,11 +268,11 @@ static inline int get_swim_mode(struct swim __iomem *base)static inline void swim_select (struct swim __iomem *base,int sel) { -swim_write (base, phase,RELAX ); +swim_write (base, phase,RELAX |PHASE_PIN_DIR );via1_set_head (sel &0x100 ); -swim_write (base, phase, sel &CA_MASK ); +swim_write (base, phase, (sel &CA_MASK ) |PHASE_PIN_DIR ); }static inline void swim_action (struct swim __iomem *base,int action)
@@ -283,9 +283,9 @@ static inline void swim_action(struct swim __iomem *base, int action)swim_select (base, action);udelay (1 ); -swim_write (base, phase, (LSTRB <<4 ) |LSTRB ); +swim_write (base, phase,LSTRB | action |PHASE_PIN_DIR );udelay (1 ); -swim_write (base, phase, (LSTRB <<4 ) | ((~LSTRB ) &0x0F )); +swim_write (base, phase, action |PHASE_PIN_DIR );udelay (1 );local_irq_restore (flags);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1563/2214 swim: Select appropriate drive once only
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit a2d22b3f25c388f9fbce7bf36a45a8900dce4aa3 ]
Before turning off the spindle motor, call swim_drive() to select the appropriate drive. Remove the swim_drive() call from swim_add_floppy() because it was already called by swim_floppy_init().
--- drivers/block/swim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/block/swim.c +3 -3
@@ -680,8 +680,10 @@ static void floppy_release(struct gendisk *disk, fmode_t mode)else if (fs->ref_count >0 ) --fs->ref_count; -if (fs->ref_count ==0 ) +if (fs->ref_count ==0 ) { +swim_drive (base, fs->location);swim_motor (base,OFF ); + }mutex_unlock (&swim_mutex); }
@@ -753,8 +755,6 @@ static int swim_add_floppy(struct swim_priv *swd, enum drive_location location) fs->location = location; -swim_drive (base, location); -swim_motor (base,OFF ); fs->type =HD_MEDIA ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1564/2214 swim: Enable the drive when probing
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit 57d88c8f4ea34a4dd7c5351bd026e225c7283f3f ]
According to the ISM spec, the MOTON bit "causes the Enable 1 and Enable 2 signals to be turned on to the drive." It doesn't actually turn on the motor. When selecting a drive, enable MOTON. Disable it upon eject or release. This fixes detection of the Sony FDHD drive.
--- drivers/block/swim.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
drivers/block/swim.c +15 -3
@@ -154,8 +154,9 @@ struct iwm {/*----------------------------------------------------------------------------*/ enum drive_location { -INTERNAL_DRIVE =0x02 , -EXTERNAL_DRIVE =0x04 , +NO_DRIVE =0 , +INTERNAL_DRIVE =BIT (1 ), +EXTERNAL_DRIVE =BIT (2 ), };enum media_type {
@@ -310,9 +311,15 @@ static inline void swim_drive(struct swim __iomem *base,if (location ==INTERNAL_DRIVE ) {swim_write (base, mode0,EXTERNAL_DRIVE );/* clear drive 1 bit */ swim_write (base, mode1,INTERNAL_DRIVE );/* set drive 0 bit */ +swim_write (base, mode1,MOTON ); }else if (location ==EXTERNAL_DRIVE ) {swim_write (base, mode0,INTERNAL_DRIVE );/* clear drive 0 bit */ swim_write (base, mode1,EXTERNAL_DRIVE );/* set drive 1 bit */ +swim_write (base, mode1,MOTON ); + }else { +swim_write (base, mode0,INTERNAL_DRIVE ); +swim_write (base, mode0,EXTERNAL_DRIVE ); +swim_write (base, mode0,MOTON ); } }
@@ -446,6 +453,7 @@ static int floppy_eject(struct floppy_state *fs)swim_drive (base, fs->location);swim_motor (base,OFF );swim_eject (base); +swim_drive (base,NO_DRIVE ); fs->disk_in =0 ; fs->ejected =1 ;
@@ -653,8 +661,10 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)else if (fs->ref_count >0 ) --fs->ref_count; -if (fs->ref_count ==0 ) +if (fs->ref_count ==0 ) {swim_motor (base,OFF ); +swim_drive (base,NO_DRIVE ); + }return err; }
@@ -683,6 +693,7 @@ static void floppy_release(struct gendisk *disk, fmode_t mode)if (fs->ref_count ==0 ) {swim_drive (base, fs->location);swim_motor (base,OFF ); +swim_drive (base,NO_DRIVE ); }mutex_unlock (&swim_mutex); }
@@ -788,6 +799,7 @@ static int swim_floppy_init(struct swim_priv *swd)if (swim_readbit (base,DRIVE_PRESENT ) && !swim_readbit (base,ONEMEG_DRIVE ))swim_add_floppy (swd,EXTERNAL_DRIVE ); +swim_drive (base,NO_DRIVE );/* register floppy drives */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1565/2214 swim: Dont disable drive after every sector
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit 05a7c4b197279cfb3ec3df26146ce085a2438aec ]
This fixes multi-sector reads on a Sony drive. The Mitsubishi drive doesn't seem to care either way.
--- drivers/block/swim.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/block/swim.c +0 -4
@@ -472,8 +472,6 @@ static inline int swim_read_sector(struct floppy_state *fs,short i;swim_track (fs, track); - -swim_write (base, mode1,MOTON );swim_head (base, side);swim_write (base, mode0, side);
@@ -489,8 +487,6 @@ static inline int swim_read_sector(struct floppy_state *fs, }local_irq_restore (flags); -swim_write (base, mode0,MOTON ); -if ((header.side != side) || (header.track != track) || (header.sector != sector))return 0 ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1566/2214 swim: Perform ISM/IWM mode switching according to specs
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit 52981bb358d1b5c38040b00f81e2cf973f9148ad ]
The SWIM spec says, "MOTOREN must be low to switch modes" and "after switching from ISM to IWM, the very first command must be a clear L7".
The ISM spec says, MOTOREN "must not be cleared until after the Action bit is cleared". Perform those operations in the correct sequence.
When switching to ISM mode, the Mode register has to be selected with a particular sequence of bit flips. Set q7 low then q6 low then mtrOff.
--- drivers/block/swim.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/block/swim.c +7 -3
@@ -149,6 +149,7 @@ struct iwm {#define ACTION 0x08#define WRITE_MODE 0x10#define HEDSEL 0x20 +#define ISM_SELECT 0x40#define MOTON 0x80/*----------------------------------------------------------------------------*/
@@ -222,18 +223,21 @@ extern int swim_read_sector_data(struct swim __iomem *base,static DEFINE_MUTEX (swim_mutex);static inline void set_swim_mode (struct swim __iomem *base,int enable) { -struct iwm __iomem *iwm_base; +struct iwm __iomem *iwm_base = (struct iwm __iomem *)base;unsigned long flags;if (!enable) { -swim_write (base, mode0,0xf8 ); +swim_write (base, mode0,ACTION ); +swim_write (base, mode0,ENBL1 |ENBL2 |MOTON ); +swim_write (base, mode0,ISM_SELECT ); +iwm_read (iwm_base, q7L);return ; } - iwm_base = (struct iwm __iomem *)base;local_irq_save (flags);iwm_read (iwm_base, q7L); +iwm_read (iwm_base, q6L);iwm_read (iwm_base, mtrOff);iwm_read (iwm_base, q6H);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1567/2214 swim: simplify using blk_cleanup_disk() on swim_remove()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luis Chamberlain <[email protected]>
[ Upstream commit b76a30c254d987b4ae7d47415081121d4c0a7423 ]
We can simplify swim_remove() by using one call instead of two, just as other drivers do. Use that pattern.
Stable-dep-of: 994a778d9665 ("swim: Configure parameter memory")
--- drivers/block/swim.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/block/swim.c +1 -2
@@ -924,9 +924,8 @@ static int swim_remove(struct platform_device *dev)for (drive =0 ; drive < swd->floppy_count; drive++) {del_gendisk (swd->unit[drive].disk); -blk_cleanup_queue (swd->unit[drive].disk->queue); +blk_cleanup_disk (swd->unit[drive].disk);blk_mq_free_tag_set (&swd->unit[drive].tag_set); -put_disk (swd->unit[drive].disk); }unregister_blkdev (FLOPPY_MAJOR ,"fd" );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1568/2214 swim: add helper for disk cleanup
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luis Chamberlain <[email protected]>
[ Upstream commit 4e9abe72530a2baf5f80d60e8d0bcdb84964d2e4 ]
Disk cleanup can be shared between exit and bringup. Use a helper to do the work required. The only functional change at this point is we're being overly paraoid on exit to check for a null disk as well now, and this should be safe.
We'll later expand on this, this change just makes subsequent changes easier to read.
Stable-dep-of: 994a778d9665 ("swim: Configure parameter memory")
--- drivers/block/swim.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-)
drivers/block/swim.c +13 -8
@@ -783,6 +783,17 @@ static const struct blk_mq_ops swim_mq_ops = { .queue_rq = swim_queue_rq, }; +static void swim_cleanup_floppy_disk (struct floppy_state *fs) +{ +struct gendisk *disk = fs->disk; + +if (!disk) +return ; + +blk_cleanup_disk (disk); +blk_mq_free_tag_set (&fs->tag_set); +} +static int swim_floppy_init (struct swim_priv *swd) {int err;
@@ -848,12 +859,7 @@ static int swim_floppy_init(struct swim_priv *swd) exit_put_disks:unregister_blkdev (FLOPPY_MAJOR ,"fd" );do { -struct gendisk *disk = swd->unit[drive].disk; - -if (!disk) -continue ; -blk_cleanup_disk (disk); -blk_mq_free_tag_set (&swd->unit[drive].tag_set); +swim_cleanup_floppy_disk (&swd->unit[drive]); }while (drive--);return err; }
@@ -924,8 +930,7 @@ static int swim_remove(struct platform_device *dev)for (drive =0 ; drive < swd->floppy_count; drive++) {del_gendisk (swd->unit[drive].disk); -blk_cleanup_disk (swd->unit[drive].disk); -blk_mq_free_tag_set (&swd->unit[drive].tag_set); +swim_cleanup_floppy_disk (&swd->unit[drive]); }unregister_blkdev (FLOPPY_MAJOR ,"fd" );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1569/2214 swim: Configure parameter memory
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit 994a778d966592d0e211deaf6e436fcb21413935 ]
The original SWIM chip has a 16 byte memory to store parameters which control read/write timing. The SWIM 2 chip retains the last 4 parameters which control write pre-compensation, but omits the first 12. Hence SWIM 2 can perform reads without any parameter memory setup but SWIM 1 cannot.
Configure the SWIM parameter memory with the appropriate values so that SWIM 1 can read too. The parameters used here were observed in SWIM chip memory, using Macsbug, while MacOS was reading from an MFM floppy disk.
--- drivers/block/swim.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/block/swim.c +13 -0
@@ -794,12 +794,25 @@ static void swim_cleanup_floppy_disk(struct floppy_state *fs)blk_mq_free_tag_set (&fs->tag_set); } +static void swim_set_parameters (struct swim __iomem *base) +{ +unsigned int i; +static const u8 mem[] = {0x18 ,0x41 ,0x2e ,0x2e ,0x18 ,0x18 ,0x1b ,0x1b , +0x2f ,0x2f ,0x19 ,0x19 ,0x97 ,0x1b ,0x57 ,0x3b , }; + +swim_write (base, mode0,0 );/* reset parameter memory index */ +for (i =0 ; i <16 ; ++i) +swim_write (base, parameter, mem[i]); +} +static int swim_floppy_init (struct swim_priv *swd) {int err;int drive;struct swim __iomem *base = swd->base; +swim_set_parameters (base); +/* scan floppy drives */ swim_drive (base,INTERNAL_DRIVE );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1570/2214 swim: Dont start motor until medium is present
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit dbbaaae83cb277d76e70426c0f0ce289e867ed77 ]
The spindle motor should not be running when a disk is to be inserted. Don't start the motor while the drive is empty.
--- drivers/block/swim.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/block/swim.c +4 -2
@@ -632,8 +632,7 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)swim_write (base, setup,S_IBM_DRIVE |S_FCLK_DIV2 );udelay (10 );swim_drive (base, fs->location); -swim_motor (base,ON ); -swim_action (base,SETMFM ); +if (fs->ejected)setup_medium (fs);if (!fs->disk_in) {
@@ -641,6 +640,9 @@ static int floppy_open(struct block_device *bdev, fmode_t mode) goto out; } +swim_motor (base,ON ); +swim_action (base,SETMFM ); +set_capacity (fs->disk, fs->total_secs);if (mode &FMODE_NDELAY )
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1571/2214 swim: Recalibrate when drive is probed
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit ba087774a1493ade524f8a783461fa8be9c75039 ]
Track zero recalibration can be slow and is normally done only once i.e. during system POST or boot-up. Recalibrate once after the drive is probed rather than every time the device is opened. Don't register the drive if recalibration fails. Park the heads before ejecting.
--- drivers/block/swim.c | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-)
drivers/block/swim.c +17 -20
@@ -411,6 +411,7 @@ static inline int swim_track00(struct swim __iomem *base)if (swim_readbit (base,TRACK_ZERO ))return 0 ; +pr_err ("swim: track zero recalibration failed\n" );return -1 ; }
@@ -455,6 +456,7 @@ static int floppy_eject(struct floppy_state *fs)struct swim __iomem *base = fs->swd->base;swim_drive (base, fs->location); +swim_track (fs,40 );swim_motor (base,OFF );swim_eject (base);swim_drive (base,NO_DRIVE );
@@ -595,13 +597,6 @@ static void setup_medium(struct floppy_state *fs)struct floppy_struct *g; fs->disk_in =1 ; fs->write_protected =swim_readbit (base,WRITE_PROT ); - -if (swim_track00 (base)) -printk (KERN_ERR -"SWIM: cannot move floppy head to track 0\n" ); - -swim_track00 (base); - fs->type =swim_readbit (base,TWOMEG_MEDIA ) ?HD_MEDIA :DD_MEDIA ; fs->head_number =swim_readbit (base,SINGLE_SIDED ) ?1 :2 ;
@@ -609,7 +604,6 @@ static void setup_medium(struct floppy_state *fs) fs->total_secs = g->size; fs->secpercyl = g->head * g->sect; fs->secpertrack = g->sect; - fs->track =0 ; }else { fs->disk_in =0 ; }
@@ -761,24 +755,33 @@ static const struct block_device_operations floppy_fops = { .check_events = floppy_check_events, }; -static int swim_add_floppy (struct swim_priv *swd,enum drive_location location) +static void swim_add_floppy (struct swim_priv *swd,enum drive_location location) {struct floppy_state *fs = &swd->unit[swd->floppy_count];struct swim __iomem *base = swd->base; - fs->location = location; +swim_drive (base, location); +if (!swim_readbit (base,DRIVE_PRESENT ) || +swim_readbit (base,ONEMEG_DRIVE )) + goto out; +if (swim_readbit (base,DISK_IN )) +swim_motor (base,ON ); +if (swim_track00 (base)) + goto out; -swim_motor (base,OFF ); + fs->location = location; fs->type =HD_MEDIA ; fs->head_number =2 ; fs->ref_count =0 ; fs->ejected =1 ; + fs->track =0 ; swd->floppy_count++; -return 0 ; +out: +swim_motor (base,OFF ); }static const struct blk_mq_ops swim_mq_ops = {
@@ -817,14 +820,8 @@ static int swim_floppy_init(struct swim_priv *swd)/* scan floppy drives */ -swim_drive (base,INTERNAL_DRIVE ); -if (swim_readbit (base,DRIVE_PRESENT ) && - !swim_readbit (base,ONEMEG_DRIVE )) -swim_add_floppy (swd,INTERNAL_DRIVE ); -swim_drive (base,EXTERNAL_DRIVE ); -if (swim_readbit (base,DRIVE_PRESENT ) && - !swim_readbit (base,ONEMEG_DRIVE )) -swim_add_floppy (swd,EXTERNAL_DRIVE ); +swim_add_floppy (swd,INTERNAL_DRIVE ); +swim_add_floppy (swd,EXTERNAL_DRIVE );swim_drive (base,NO_DRIVE );/* register floppy drives */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1572/2214 swim: Add track zero recalibration delay
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit b9c1095048537cc9563f12d0a24f2f0df129e4d5 ]
The UPD72070 spec indicates that the track zero sensor can take 3 ms to stabilize following a STEP command so add a call to msleep(). Remove the duplicate swim_readbit() call as there's no need for that once the sensor signal has stabilized.
--- drivers/block/swim.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/block/swim.c +4 -5
@@ -401,16 +401,15 @@ static inline int swim_track00(struct swim __iomem *base)for (try =0 ; try <100 ; try++) {swim_select (base,RELAX ); +msleep (3 ); +if (swim_readbit (base,TRACK_ZERO )) -break ; +return 0 ;if (swim_step (base)) -return -1 ; +break ; } -if (swim_readbit (base,TRACK_ZERO )) -return 0 ; -pr_err ("swim: track zero recalibration failed\n" );return -1 ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1573/2214 swim: Handle FIFO timeout error
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit 2e9bcbecee68431b689d16b23bc5529db686f8d4 ]
When polling the FIFO for a mark byte in the sector header, don't return zero if the timeout counter has expired, return an error code.
--- drivers/block/swim_asm.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/block/swim_asm.S +1 -2
@@ -79,7 +79,7 @@ wait_addr_mark_byte: tstb %a2@ dbmi %d2, wait_addr_mark_byte - bpl header_exit + bpl signal_nonyb moveb %a3@, %d3 cmpb %a0@+, %d3
@@ -136,7 +136,6 @@ crc1: tstb %a2@ tstb %a3@(read_error - read_mark) -header_exit: moveq #0, %d0 moveb #0x18, %a3@(write_mode0 - read_mark) rts
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1574/2214 swim: Check for CRC errors
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit 01bff87152e6748fbac9ccd645d3d5f490d75ddc ]
After reading either the sector header or sector data, examine that flag in the handshake register which holds the result of the CRC calculation. CRC validation has to take place with the last byte still in the FIFO. This flag can't be checked by the caller because by then all bytes will have been retrieved from the FIFO. Return an error code when appropriate.
--- drivers/block/swim_asm.S | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/block/swim_asm.S +10 -0
@@ -42,6 +42,8 @@ .equ max_retry, 40 .equ sector_size, 512 + .equ .Lhr_crc_error, 0x02 + .global swim_read_sector_header swim_read_sector_header: link %a6, #0
@@ -134,6 +136,10 @@ crc1: tstb %a2@ moveb %a3@, %a4@(o_crc1) + moveb %a2@, %d5 + andb #.Lhr_crc_error, %d5 + bne signal_nonyb + tstb %a3@(read_error - read_mark) moveq #0, %d0
@@ -226,6 +232,10 @@ data_crc1: moveb %a3@, %d5 + moveb %a2@, %d5 + andb #.Lhr_crc_error, %d5 + bne data_exit + tstb %a3@(read_error - read_mark) moveb #0x18, %a3@(write_mode0 - read_mark)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1575/2214 swim: Simplify return value initialization
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit 385a44e78702762e2fce796cf37b6f465d86a87f ]
Initialize the error result once only. Update the result only after a successful read.
Stable-dep-of: d66bdef0a308 ("swim: Check error register during sector read")
--- drivers/block/swim_asm.S | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/block/swim_asm.S +3 -8
@@ -49,6 +49,7 @@ swim_read_sector_header: link %a6, #0 moveml %d1-%d5/%a0-%a4,%sp@- movel %a6@(0x0c), %a4 + moveq #-1, %d0 bsr mfm_read_addrmark moveml %sp@+, %d1-%d5/%a0-%a4 unlk %a6
@@ -63,7 +64,6 @@ mfm_read_addrmark: movel %a6@(0x08), %a3 lea %a3@(read_handshake), %a2 lea %a3@(read_mark), %a3 - moveq #-1, %d0 movew #seek_time, %d2 wait_header_init:
@@ -143,10 +143,7 @@ crc1: tstb %a2@ tstb %a3@(read_error - read_mark) moveq #0, %d0 - moveb #0x18, %a3@(write_mode0 - read_mark) - rts signal_nonyb: - moveq #-1, %d0 moveb #0x18, %a3@(write_mode0 - read_mark) rts
@@ -155,6 +152,7 @@ swim_read_sector_data: link %a6, #0 moveml %d1-%d5/%a0-%a5,%sp@- movel %a6@(0x0c), %a4 + moveq #-1, %d0 bsr mfm_read_data moveml %sp@+, %d1-%d5/%a0-%a5 unlk %a6
@@ -238,15 +236,12 @@ data_crc1: tstb %a3@(read_error - read_mark) - moveb #0x18, %a3@(write_mode0 - read_mark) - /* return number of bytes read */ movel #sector_size, %d0 addw #1, %d4 subl %d4, %d0 - rts + data_exit: moveb #0x18, %a3@(write_mode0 - read_mark) - moveq #-1, %d0 rts
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1576/2214 swim: Check error register during sector read
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit d66bdef0a3083fed1a0fc4f0ee1c85b26476b21c ]
Clear the error register only once before a sector read operation. Don't clear it afterwards -- the caller needs it. Check the error register in swim_read_sector() and return the appropriate error when necessary. Fully validate the sector header. Don't terminate the search loop early just because an erroneous sector header showed up.
--- drivers/block/swim.c | 13 +++++++------ drivers/block/swim_asm.S | 8 -------- 2 files changed, 7 insertions(+), 14 deletions(-)
drivers/block/swim.c +7 -6
@@ -482,20 +482,21 @@ static inline int swim_read_sector(struct floppy_state *fs,local_irq_save (flags);for (i =0 ; i <36 ; i++) { - ret =swim_read_sector_header (base, &header); -if (!ret && (header.sector == sector)) { +if (swim_read_sector_header (base, &header) || +swim_read (base, error) || header.track != track || + header.side != side || header.size !=2 ) +continue ; +if (header.sector == sector) {/* found */ ret =swim_read_sector_data (base, buffer); +if (swim_read (base, error)) + ret = -EIO ;break ; } }local_irq_restore (flags); -if ((header.side != side) || (header.track != track) || - (header.sector != sector)) -return 0 ; -return ret; }
drivers/block/swim_asm.S +0 -8
@@ -67,7 +67,6 @@ mfm_read_addrmark: movew #seek_time, %d2 wait_header_init: - tstb %a3@(read_error - read_mark) moveb #0x18, %a3@(write_mode0 - read_mark) moveb #0x01, %a3@(write_mode1 - read_mark) moveb #0x01, %a3@(write_mode0 - read_mark)
@@ -140,8 +139,6 @@ crc1: tstb %a2@ andb #.Lhr_crc_error, %d5 bne signal_nonyb - tstb %a3@(read_error - read_mark) - moveq #0, %d0 signal_nonyb: moveb #0x18, %a3@(write_mode0 - read_mark)
@@ -166,7 +163,6 @@ mfm_read_data: movew #seek_time, %d2 wait_data_init: - tstb %a3@(read_error - read_mark) moveb #0x18, %a3@(write_mode0 - read_mark) moveb #0x01, %a3@(write_mode1 - read_mark) moveb #0x01, %a3@(write_mode0 - read_mark)
@@ -191,8 +187,6 @@ wait_data_mark_byte: /* read data */ - tstb %a3@(read_error - read_mark) - movel #sector_size-1, %d4 /* sector size */ read_new_data: movew #max_retry, %d2
@@ -234,8 +228,6 @@ data_crc1: andb #.Lhr_crc_error, %d5 bne data_exit - tstb %a3@(read_error - read_mark) - /* return number of bytes read */ movel #sector_size, %d0
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1577/2214 swim: Dont use the mark register to read data
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit cb7923133ec18e67e2d6718e29426a4423af6b73 ]
If an unexpected mark byte were to be read from the data register, an error would be flagged. But no error gets flagged when such a byte is read from the mark register, which is misleading. Always use the data register except when a mark byte is expected.
--- drivers/block/swim_asm.S | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/block/swim_asm.S +11 -10
@@ -47,11 +47,11 @@ .global swim_read_sector_header swim_read_sector_header: link %a6, #0 - moveml %d1-%d5/%a0-%a4,%sp@- + moveml %d1-%d5/%a0-%a5,%sp@- movel %a6@(0x0c), %a4 moveq #-1, %d0 bsr mfm_read_addrmark - moveml %sp@+, %d1-%d5/%a0-%a4 + moveml %sp@+, %d1-%d5/%a0-%a5 unlk %a6 rts
@@ -63,6 +63,7 @@ sector_data_mark: mfm_read_addrmark: movel %a6@(0x08), %a3 lea %a3@(read_handshake), %a2 + lea %a3@(read_data), %a5 lea %a3@(read_mark), %a3 movew #seek_time, %d2
@@ -93,7 +94,7 @@ amark0: tstb %a2@ dbmi %d2, amark0 bpl signal_nonyb - moveb %a3@, %a4@(o_track) + moveb %a5@, %a4@(o_track) moveq #max_retry, %d2
@@ -101,7 +102,7 @@ amark1: tstb %a2@ dbmi %d2, amark1 bpl signal_nonyb - moveb %a3@, %a4@(o_side) + moveb %a5@, %a4@(o_side) moveq #max_retry, %d2
@@ -109,7 +110,7 @@ amark2: tstb %a2@ dbmi %d2, amark2 bpl signal_nonyb - moveb %a3@, %a4@(o_sector) + moveb %a5@, %a4@(o_sector) moveq #max_retry, %d2
@@ -117,7 +118,7 @@ amark3: tstb %a2@ dbmi %d2, amark3 bpl signal_nonyb - moveb %a3@, %a4@(o_size) + moveb %a5@, %a4@(o_size) moveq #max_retry, %d2
@@ -125,7 +126,7 @@ crc0: tstb %a2@ dbmi %d2, crc0 bpl signal_nonyb - moveb %a3@, %a4@(o_crc0) + moveb %a5@, %a4@(o_crc0) moveq #max_retry, %d2
@@ -133,7 +134,7 @@ crc1: tstb %a2@ dbmi %d2, crc1 bpl signal_nonyb - moveb %a3@, %a4@(o_crc1) + moveb %a5@, %a4@(o_crc1) moveb %a2@, %d5 andb #.Lhr_crc_error, %d5
@@ -212,7 +213,7 @@ data_crc0: dbmi %d2, data_crc0 bpl data_exit - moveb %a3@, %d5 + moveb %a5@, %d5 moveq #max_retry, %d2
@@ -222,7 +223,7 @@ data_crc1: dbmi %d2, data_crc1 bpl data_exit - moveb %a3@, %d5 + moveb %a5@, %d5 moveb %a2@, %d5 andb #.Lhr_crc_error, %d5
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1578/2214 swim: Fix buffer overflow
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit a54870a4ae4962acf341eb6ca010cae02af1a6ea ]
The effect of this bug can be observed as swim_read_sector_data() inexplicably returning -5, or an error flag indicating that a mark byte was read from the data register, or other odd behviour.
When copying bytes from the chip FIFO to the read buffer, the driver keeps count of the remaining buffer space using register %d4. A counter in register %d2 serves as a timeout. The driver polls (%a2), the handshake register, until flags indicate that byte(s) have arrived in the FIFO.
movel #sector_size-1, %d4
read_new_data:
movew #max_retry, %d2
read_data_loop:
moveb %a2@, %d5
andb #0xc0, %d5
dbne %d2, read_data_loop
beq data_exit
moveb %a5@, %a4@+
andb #0x40, %d5
dbne %d4, read_new_data
beq exit_loopNote that the exit_loop branch depends upon a flag in the handshake register and not on the remaining buffer space. Hence there may be no branch to exit_loop after %d4 is decremented to -1 (i.e. full buffer).
moveb %a5@, %a4@+
dbra %d4, read_new_dataexit_loop:
Here is a second decrement of %d4 which can now reach -2. But the buffer bounds check is a comparison with -1, which is now ineffective. Hence the loop will continue copying until %d2 eventually reaches -1.
Fix this bug by terminating the loop as soon as %d4 or %d2 reach -1. Reset the timeout whenever a byte is copied.
--- drivers/block/swim_asm.S | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/block/swim_asm.S +9 -7
@@ -43,6 +43,8 @@ .equ sector_size, 512 .equ .Lhr_crc_error, 0x02 + .equ .Lhr_fifo_2bytes, 0x40 + .equ .Lhr_fifo_1byte, 0x80 .global swim_read_sector_header swim_read_sector_header:
@@ -189,20 +191,20 @@ wait_data_mark_byte: /* read data */ movel #sector_size-1, %d4 /* sector size */ -read_new_data: movew #max_retry, %d2 read_data_loop: moveb %a2@, %d5 - andb #0xc0, %d5 + andb #(.Lhr_fifo_1byte + .Lhr_fifo_2bytes), %d5 dbne %d2, read_data_loop beq data_exit + moveq #max_retry, %d2 moveb %a5@, %a4@+ - andb #0x40, %d5 - dbne %d4, read_new_data - beq exit_loop + dbra %d4, 1f + bra data_crc0 +1: andb #.Lhr_fifo_2bytes, %d5 + beq read_data_loop moveb %a5@, %a4@+ - dbra %d4, read_new_data -exit_loop: + dbra %d4, read_data_loop /* read CRC */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1579/2214 swim: Remove redundant RELAX actions
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit 04cb277e6841b55b950b42063fe11501b5d1676a ]
Wherever we have a swim_select() or swim_readbit() call there is an implicit RELAX. That means the caller doesn't have to do it. Remove the redundant code.
BTW, Inside Macintosh says, "Be sure [...] that CA0 and CA1 are set high before changing SEL." Hence the RELAX found in swim_select(). The SwimIII driver in mkLinux also has that. But the swim3.c driver in Linux is odd:
it scatters RELAX actions around as though SEL was not actually under its control... In anycase, swim.c really does control SEL so there's no need for that here.
Stable-dep-of: b736189c93c9 ("swim: Deduplicate polling loops")
--- drivers/block/swim.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/block/swim.c +1 -7
@@ -336,7 +336,6 @@ static inline void swim_motor(struct swim __iomem *base,swim_action (base,MOTOR_ON );for (i =0 ; i <2 *HZ ; i++) { -swim_select (base,RELAX );if (swim_readbit (base,MOTOR_ON ))break ;set_current_state (TASK_INTERRUPTIBLE );
@@ -344,7 +343,7 @@ static inline void swim_motor(struct swim __iomem *base, } }else if (action ==OFF ) {swim_action (base,MOTOR_OFF ); -swim_select (base,RELAX ); +swim_write (base, phase,RELAX |PHASE_PIN_DIR ); } }
@@ -355,13 +354,11 @@ static inline void swim_eject(struct swim __iomem *base)swim_action (base,EJECT );for (i =0 ; i <2 *HZ ; i++) { -swim_select (base,RELAX );if (!swim_readbit (base,DISK_IN ))break ;set_current_state (TASK_INTERRUPTIBLE );schedule_timeout (1 ); } -swim_select (base,RELAX ); }static inline void swim_head (struct swim __iomem *base,enum head head)
@@ -385,7 +382,6 @@ static inline int swim_step(struct swim __iomem *base)set_current_state (TASK_INTERRUPTIBLE );schedule_timeout (1 ); -swim_select (base,RELAX );if (!swim_readbit (base,STEP ))return 0 ; }
@@ -399,8 +395,6 @@ static inline int swim_track00(struct swim __iomem *base)swim_action (base,SEEK_NEGATIVE );for (try =0 ; try <100 ; try++) { - -swim_select (base,RELAX );msleep (3 );if (swim_readbit (base,TRACK_ZERO ))
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1580/2214 swim: Deduplicate polling loops
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit b736189c93c9ad1056521a4229ec2f252b714b5a ]
Replace duplicated polling loops with poll_timeout_us(). Change the interruptible sleep to uninterruptible because signal delivery shouldn't be allowed to shorten delays required by the drive hardware.
Change the timeout for the !STEP transition to 20 ms in accordance with the maximum interval required by the UPD72070 spec. The existing 1 second timeout is impractical considering the number of steps in a typical seek.
Change the return type of swim_readbit() to bool because that way the bit names make sense i.e. the reader doesn't have to remember to invert the active-low logic used for drive signals.
--- drivers/block/swim.c | 39 ++++++++------------------------------- 1 file changed, 8 insertions(+), 31 deletions(-)
drivers/block/swim.c +8 -31
@@ -19,6 +19,7 @@#include <linux/major.h> #include <linux/mutex.h> #include <linux/hdreg.h> +#include <linux/iopoll.h> #include <linux/kernel.h> #include <linux/delay.h> #include <linux/platform_device.h>
@@ -296,7 +297,7 @@ static inline void swim_action(struct swim __iomem *base, int action)local_irq_restore (flags); } -static inline int swim_readbit (struct swim __iomem *base,int bit) +static inline bool swim_readbit (struct swim __iomem *base,int bit) {int stat;
@@ -309,6 +310,9 @@ static inline int swim_readbit(struct swim __iomem *base, int bit)return (stat &SENSE ) ==0 ; } +#define swim_readbit_timeout (base, bit, val, timeout_us) \ + poll_timeout_us(, swim_readbit(base, bit) == val, 1000, timeout_us, false) +static inline void swim_drive (struct swim __iomem *base,enum drive_location location) {
@@ -331,16 +335,8 @@ static inline void swim_motor(struct swim __iomem *base, enum motor_action action) {if (action ==ON ) { -int i; -swim_action (base,MOTOR_ON ); - -for (i =0 ; i <2 *HZ ; i++) { -if (swim_readbit (base,MOTOR_ON )) -break ; -set_current_state (TASK_INTERRUPTIBLE ); -schedule_timeout (1 ); - } +swim_readbit_timeout (base,MOTOR_ON , true,2000 *1000 ); }else if (action ==OFF ) {swim_action (base,MOTOR_OFF );swim_write (base, phase,RELAX |PHASE_PIN_DIR );
@@ -349,16 +345,8 @@ static inline void swim_motor(struct swim __iomem *base,static inline void swim_eject (struct swim __iomem *base) { -int i; -swim_action (base,EJECT ); - -for (i =0 ; i <2 *HZ ; i++) { -if (!swim_readbit (base,DISK_IN )) -break ; -set_current_state (TASK_INTERRUPTIBLE ); -schedule_timeout (1 ); - } +swim_readbit_timeout (base,DISK_IN , false,2000 *1000 ); }static inline void swim_head (struct swim __iomem *base,enum head head)
@@ -373,19 +361,8 @@ static inline void swim_head(struct swim __iomem *base, enum head head)static inline int swim_step (struct swim __iomem *base) { -int wait; -swim_action (base,STEP ); - -for (wait =0 ; wait <HZ ; wait++) { - -set_current_state (TASK_INTERRUPTIBLE ); -schedule_timeout (1 ); - -if (!swim_readbit (base,STEP )) -return 0 ; - } -return -1 ; +return swim_readbit_timeout (base,STEP , false,20 *1000 ); }static inline int swim_track00 (struct swim __iomem *base)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1581/2214 swim: Check drive ready bit
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit abae04f5bed924590e98fe1519566a6e0144e6b5 ]
The drive provides a readiness signal that has to be tested before certain commands are issued to the drive. Rename the SEEK_COMPLETE flag as READY because that's how it's known in the documentation as well as the mkLinux source code.
Poll for that signal after stepping the heads and also after switching to MFM mode, as that's what mkLinux does. Check for readiness when stepping because testing shows that some drives require this.
--- drivers/block/swim.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-)
drivers/block/swim.c +22 -7
@@ -117,7 +117,7 @@ struct iwm {#define TACHO 0x103#define READ_DATA_1 0x104#define GCR_MODE 0x105 -#define SEEK_COMPLETE 0x106 +#define READY 0x106#define TWOMEG_MEDIA 0x107/* Bits in handshake register */
@@ -313,6 +313,14 @@ static inline bool swim_readbit(struct swim __iomem *base, int bit)#define swim_readbit_timeout (base, bit, val, timeout_us) \ poll_timeout_us(, swim_readbit(base, bit) == val, 1000, timeout_us, false) +#define swim_READY_timeout (base) \ +({ \ + int ret = swim_readbit_timeout(base, READY, true, 1000 * 1000); \ + if (ret) \ + printk(KERN_DEBUG "%s: drive not ready\n", __func__); \ + ret; \ +}) +static inline void swim_drive (struct swim __iomem *base,enum drive_location location) {
@@ -351,8 +359,6 @@ static inline void swim_eject(struct swim __iomem *base)static inline void swim_head (struct swim __iomem *base,enum head head) { -/* wait drive is ready */ -if (head ==UPPER_HEAD )swim_select (base,READ_DATA_1 );else if (head ==LOWER_HEAD )
@@ -387,20 +393,25 @@ static inline int swim_track00(struct swim __iomem *base)static inline int swim_seek (struct swim __iomem *base,int step) { -if (step ==0 ) -return 0 ; -if (step <0 ) {swim_action (base,SEEK_NEGATIVE ); step = -step; - }else + }else if (step >0 )swim_action (base,SEEK_POSITIVE ); +swim_READY_timeout (base); + +if (step ==0 ) +return 0 ; +for ( ; step >0 ; step--) {if (swim_step (base))return -1 ; } +msleep (30 ); +swim_READY_timeout (base); +return 0 ; }
@@ -482,6 +493,8 @@ static blk_status_t floppy_read_sectors(struct floppy_state *fs,swim_drive (base, fs->location); +swim_READY_timeout (base); +for (i = req_sector; i < req_sector + sectors_nb; i++) {int x; track = i / fs->secpercyl;
@@ -607,6 +620,8 @@ static int floppy_open(struct block_device *bdev, fmode_t mode)swim_motor (base,ON );swim_action (base,SETMFM ); +msleep (30 ); +swim_READY_timeout (base);set_capacity (fs->disk, fs->total_secs);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1582/2214 swim: Revisit delays
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit bbcd3e38a4f355d6b0320f3f6916df96c109f2ad ]
AFAIK, timing requirements for the various FDHD drive mechanisms aren't well documented. But we do have the UPD72070 spec and secondary sources like swim3.c and mkLinux source code. This patch is needed to satisfy the requirements in the UPD72070 spec and follows mkLinux.
Change the LSTRB pulse to 2 microseconds, because this is what mkLinux does. Inside Macintosh says, "Hold LSTRB high for at least one usec but not more than one msec".
When a disk is ejected, pause before de-asserting /ENBL. Wait 150 us after the STEP command for valid signalling. Pause for 1 us after setting the step direction before sending the STEP command.
--- drivers/block/swim.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/block/swim.c +5 -1
@@ -290,7 +290,7 @@ static inline void swim_action(struct swim __iomem *base, int action)swim_select (base, action);udelay (1 );swim_write (base, phase,LSTRB | action |PHASE_PIN_DIR ); -udelay (1 ); +udelay (2 );swim_write (base, phase, action |PHASE_PIN_DIR );udelay (1 );
@@ -337,6 +337,7 @@ static inline void swim_drive(struct swim __iomem *base,swim_write (base, mode0,EXTERNAL_DRIVE );swim_write (base, mode0,MOTON ); } +udelay (1 ); } static inline void swim_motor(struct swim __iomem *base,
@@ -355,6 +356,7 @@ static inline void swim_eject(struct swim __iomem *base) {swim_action (base,EJECT );swim_readbit_timeout (base,DISK_IN , false,2000 *1000 ); +msleep (1 ); }static inline void swim_head (struct swim __iomem *base,enum head head)
@@ -368,6 +370,7 @@ static inline void swim_head(struct swim __iomem *base, enum head head)static inline int swim_step (struct swim __iomem *base) {swim_action (base,STEP ); +udelay (150 );return swim_readbit_timeout (base,STEP , false,20 *1000 ); }
@@ -398,6 +401,7 @@ static inline int swim_seek(struct swim __iomem *base, int step) step = -step; }else if (step >0 )swim_action (base,SEEK_POSITIVE ); +udelay (1 );swim_READY_timeout (base);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1583/2214 swim: Dont search beyond the first data mark
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Finn Thain <[email protected]>
[ Upstream commit 79eafa4ccb74be023fd2cae87d75425d6eb903bb ]
The ISM chip does an automatic MFM gap/sync search when the Action bit is first set. That search may stop at any of a) post-index gap, b) address field gap or c) data field gap. To find the next sector header, the driver need not search at all. It only has to validate the mark bytes.
Once the sector address mark has been validated, swim_read_sector_data() is called to read the sector contents. Between the sector address and data fields lies an intra-sector gap followed by a data field mark. After this mark is validated, the 512-byte data area is read into the IO request buffer.
Problem is, if any byte in the data field mark is mis-read, the driver searches the whole sector and then reaches the data field mark in the following sector. The wrong sector is then read into the buffer, and swim_read_sector_data() returns success. The request is silently corrupted.
The existing limit on polling loop iterations does constrain the search distance but is inherently tied to CPU speed. This is probably the reason why corruption was only observed on a 68030 system.
Discontinue the mark search when the mark bytes fail validation.
--- drivers/block/swim_asm.S | 73 ++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 33 deletions(-)
drivers/block/swim_asm.S +40 -33
@@ -41,18 +41,45 @@ .equ seek_time, 30000 .equ max_retry, 40 .equ sector_size, 512 + .equ .Lmark_sequence_len, 4 .equ .Lhr_crc_error, 0x02 .equ .Lhr_fifo_2bytes, 0x40 .equ .Lhr_fifo_1byte, 0x80 +.Lmfm_mark_check: + /* + * This subroutine reads and validates a mark byte sequence. + * On entry, %a1 and %d4 shall hold the location and length (resp.) + * of the mark byte array. + * %a2 and %a3 shall hold the locations of the handshake and mark + * registers. + * Returns zero in %d1 for success. + */ + + moveq #-1, %d1 + subq #1, %d4 + movew #seek_time, %d2 + +5: tstb %a2@ + dbmi %d2, 5b + bpl 6f + + moveb %a3@, %d3 + cmpb %a1@+, %d3 + dbne %d4, 5b + bne 6f + + moveq #0, %d1 +6: rts + .global swim_read_sector_header swim_read_sector_header: link %a6, #0 moveml %d1-%d5/%a0-%a5,%sp@- movel %a6@(0x0c), %a4 moveq #-1, %d0 - bsr mfm_read_addrmark + bsr .Lmfm_read_header moveml %sp@+, %d1-%d5/%a0-%a5 unlk %a6 rts
@@ -62,33 +89,25 @@ sector_address_mark: sector_data_mark: .byte 0xa1, 0xa1, 0xa1, 0xfb -mfm_read_addrmark: +.Lmfm_read_header: movel %a6@(0x08), %a3 lea %a3@(read_handshake), %a2 lea %a3@(read_data), %a5 lea %a3@(read_mark), %a3 - movew #seek_time, %d2 -wait_header_init: moveb #0x18, %a3@(write_mode0 - read_mark) moveb #0x01, %a3@(write_mode1 - read_mark) moveb #0x01, %a3@(write_mode0 - read_mark) tstb %a3@(read_error - read_mark) moveb #0x08, %a3@(write_mode1 - read_mark) - lea sector_address_mark, %a0 - moveq #3, %d1 - -wait_addr_mark_byte: - - tstb %a2@ - dbmi %d2, wait_addr_mark_byte - bpl signal_nonyb + lea sector_address_mark, %a1 + moveq #.Lmark_sequence_len, %d4 + bsr .Lmfm_mark_check + tstl %d1 + bne signal_nonyb - moveb %a3@, %d3 - cmpb %a0@+, %d3 - dbne %d1, wait_addr_mark_byte - bne wait_header_init + /* read header */ moveq #max_retry, %d2
@@ -163,30 +182,18 @@ mfm_read_data: lea %a3@(read_handshake), %a2 lea %a3@(read_data), %a5 lea %a3@(read_mark), %a3 - movew #seek_time, %d2 -wait_data_init: moveb #0x18, %a3@(write_mode0 - read_mark) moveb #0x01, %a3@(write_mode1 - read_mark) moveb #0x01, %a3@(write_mode0 - read_mark) tstb %a3@(read_error - read_mark) moveb #0x08, %a3@(write_mode1 - read_mark) - lea sector_data_mark, %a0 - moveq #3, %d1 - - /* wait data address mark */ - -wait_data_mark_byte: - - tstb %a2@ - dbmi %d2, wait_data_mark_byte - bpl data_exit - - moveb %a3@, %d3 - cmpb %a0@+, %d3 - dbne %d1, wait_data_mark_byte - bne wait_data_init + lea sector_data_mark, %a1 + moveq #.Lmark_sequence_len, %d4 + bsr .Lmfm_mark_check + tstl %d1 + bne data_exit /* read data */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1584/2214 media: i2c: ov5648: Fix a data race on state->streaming
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ginger Li <[email protected]>
[ Upstream commit 76c8ffbe1b9bc0ee4c977180e3f498352de0d01e ]
ov5648_s_stream() updates state->streaming after it has released sensor->mutex, while ov5648_resume() reads that field with sensor->mutex held. A concurrent resume can therefore observe a stale streaming state and leave the sensor in standby while the software believes that it is streaming, or the other way around.
Keep the update inside the sensor->mutex protected section that already programs the standby mode.
--- drivers/media/i2c/ov5648.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/ov5648.c +2 -2
@@ -2145,13 +2145,13 @@ static int ov5648_s_stream(struct v4l2_subdev *subdev, int enable)mutex_lock (&sensor->mutex); ret =ov5648_sw_standby (sensor, !enable); +if (!ret) + state->streaming = !!enable;mutex_unlock (&sensor->mutex);if (ret)return ret; - state->streaming = !!enable; -if (!enable)pm_runtime_put (sensor->dev);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1585/2214 serial: sifive: fix off-by-one in console port bounds check
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zongmin Zhou <[email protected]>
[ Upstream commit bf961847813d9edcb5a9c089714069428d141fa9 ]
sifive_serial_console_ports[] is sized SIFIVE_SERIAL_MAX_PORTS (8), so valid indices are 0..7. The bounds check in sifive_serial_probe() uses "id > SIFIVE_SERIAL_MAX_PORTS", which lets id == 8 pass and causes an out-of-bounds write in __ssp_add_console_port() through sifive_serial_console_ports[ssp->port.line].
Fix the check to use >= instead, matching the check already used in sifive_serial_console_setup().
--- drivers/tty/serial/sifive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/sifive.c +1 -1
@@ -975,7 +975,7 @@ static int sifive_serial_probe(struct platform_device *pdev) }#ifdef CONFIG_SERIAL_SIFIVE_CONSOLE -if (id >SIFIVE_SERIAL_MAX_PORTS ) { +if (id >=SIFIVE_SERIAL_MAX_PORTS ) {dev_err (&pdev->dev,"too many UARTs (%d)\n" , id);return -EINVAL ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1586/2214 dt-bindings: vendor-prefixes: add Genesys Logic
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Icenowy Zheng <[email protected]>
[ Upstream commit 38cea8e31e9ef143187135d714aed4d7bd18463c ]
Genesys Logic, Inc. is a manufacturer for interface chips, especially USB hubs.
https://www.genesyslogic.com.tw/
Stable-dep-of: aa906abf611c ("dt-bindings: vendor-prefixes: add Free Mobile")
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -445,6 +445,8 @@ patternProperties: description: GE Fanuc Intelligent Platforms Embedded Systems, Inc. "^gemei,.*": description: Gemei Digital Technology Co., Ltd. + "^genesys,.*": + description: Genesys Logic, Inc. "^geniatech,.*": description: Geniatech, Inc. "^giantec,.*":
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1587/2214 dt-bindings: vendor-prefixes: Add GPLUS
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lin, Meng-Bo <[email protected]>
[ Upstream commit d7a2d86837b9de8d378f040cfc9184905d82bd78 ]
Add vendor prefix for GPLUS.
https://www.gplus.com.tw
Stable-dep-of: aa906abf611c ("dt-bindings: vendor-prefixes: add Free Mobile")
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -463,6 +463,8 @@ patternProperties: description: Shenzhen Huiding Technology Co., Ltd. "^google,.*": description: Google, Inc. + "^gplus,.*": + description: GPLUS "^grinn,.*": description: Grinn "^grmn,.*":
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1588/2214 dt-bindings: Add vendor prefixes
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
[ Upstream commit 714ff69c331c005c9cd05d69d3c6fe9da20ef687 ]
These vendor prefixes are used by some routers supported by e.g. OpenWrt.
- ADI Engineering is a US telecom equipment company.
- Arcom Controllers is a US manufacturer of repeaters.
- Freecom Gmbh is a german telecom equipment company.
- Gemtek Technology is a Taiwan telecom company.
- Gateway Communications was a telecommunication company, now acquired by HKT Limited/PCCW.
- Goramo Gorecki is a privately owned Polish telecom company.
- U.S. Robotics Corporation, known through their brand name USRobotics is generally referred to as "USR" so use this prefix for the company's device tree bindings.
Stable-dep-of: aa906abf611c ("dt-bindings: vendor-prefixes: add Free Mobile")
--- .../devicetree/bindings/vendor-prefixes.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +14 -0
@@ -53,6 +53,8 @@ patternProperties: description: AD Holdings Plc. "^adi,.*": description: Analog Devices, Inc. + "^adieng,.*": + description: ADI Engineering, Inc. "^advantech,.*": description: Advantech Corporation "^aeroflexgaisler,.*":
@@ -113,6 +115,8 @@ patternProperties: description: Arasan Chip Systems "^archermind,.*": description: ArcherMind Technology (Nanjing) Co., Ltd. + "^arcom,.*": + description: Arcom Controllers "^arctic,.*": description: Arctic Sand "^arcx,.*":
@@ -421,6 +425,8 @@ patternProperties: description: FocalTech Systems Co.,Ltd "^forlinx,.*": description: Baoding Forlinx Embedded Technology Co., Ltd. + "^freecom,.*": + description: Freecom Gmbh "^frida,.*": description: Shenzhen Frida LCD Co., Ltd. "^friendlyarm,.*":
@@ -431,6 +437,8 @@ patternProperties: description: Fujitsu Ltd. "^gardena,.*": description: GARDENA GmbH + "^gateway,.*": + description: Gateway Communications "^gateworks,.*": description: Gateworks Corporation "^gcw,.*":
@@ -445,6 +453,8 @@ patternProperties: description: GE Fanuc Intelligent Platforms Embedded Systems, Inc. "^gemei,.*": description: Gemei Digital Technology Co., Ltd. + "^gemtek,.*": + description: Gemtek Technology Co., Ltd. "^genesys,.*": description: Genesys Logic, Inc. "^geniatech,.*":
@@ -463,6 +473,8 @@ patternProperties: description: Shenzhen Huiding Technology Co., Ltd. "^google,.*": description: Google, Inc. + "^goramo,.*": + description: Goramo Gorecki "^gplus,.*": description: GPLUS "^grinn,.*":
@@ -1248,6 +1260,8 @@ patternProperties: description: United Radiant Technology Corporation "^usi,.*": description: Universal Scientific Industrial Co., Ltd. + "^usr,.*": + description: U.S. Robotics Corporation "^utoo,.*": description: Aigo Digital Technology Co., Ltd. "^v3,.*":
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1589/2214 dt-bindings: vendor-prefixes: add Free Mobile
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vincent Jardin <[email protected]>
[ Upstream commit aa906abf611c7f37c0fe9171c1d33c40270aa5fe ]
Free Mobile is a French mobile network operator. Add its vendor prefix, used by the Nodebox v3 CPU Module (freemobile,nbxv3).
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -427,6 +427,8 @@ patternProperties: description: Baoding Forlinx Embedded Technology Co., Ltd. "^freecom,.*": description: Freecom Gmbh + "^freemobile,.*": + description: Free Mobile "^frida,.*": description: Shenzhen Frida LCD Co., Ltd. "^friendlyarm,.*":
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1590/2214 mfd: intel_quark_i2c_gpio: Manage the fixed-rate clock
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <[email protected]>
[ Upstream commit 14a7cf1a3730c7c2393ef5a226e90baf61aa8a9f ]
The I2C clock is allocated by clk_register_fixed_rate(), but cleanup uses clk_unregister(), leaving the fixed-rate provider allocation behind.
Manage the provider with devm_clk_hw_register_fixed_rate() and its lookup with devm_clk_hw_register_clkdev(). Managed resources release the lookup before the provider, after the MFD children have been removed.
Remove the manual clock cleanup and the private structure that only stored the clock and lookup pointers.
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
--- drivers/mfd/intel_quark_i2c_gpio.c | 52 ++++-------------------------- 1 file changed, 6 insertions(+), 46 deletions(-)
drivers/mfd/intel_quark_i2c_gpio.c +6 -46
@@ -35,11 +35,6 @@/* The Quark I2C controller source clock */ #define INTEL_QUARK_I2C_CLK_HZ 33000000 -struct intel_quark_mfd { -struct clk *i2c_clk; -struct clk_lookup *i2c_clk_lookup; -}; -static const struct property_entry intel_quark_i2c_controller_standard_properties[] = {PROPERTY_ENTRY_U32 ("clock-frequency" ,I2C_MAX_STANDARD_MODE_FREQ ), { }
@@ -160,37 +155,12 @@ MODULE_DEVICE_TABLE(pci, intel_quark_mfd_ids);static int intel_quark_register_i2c_clk (struct device *dev) { -struct intel_quark_mfd *quark_mfd =dev_get_drvdata (dev); -struct clk *i2c_clk; - - i2c_clk =clk_register_fixed_rate (dev, -INTEL_QUARK_I2C_CONTROLLER_CLK ,NULL , -0 ,INTEL_QUARK_I2C_CLK_HZ ); -if (IS_ERR (i2c_clk)) -return PTR_ERR (i2c_clk); - - quark_mfd->i2c_clk = i2c_clk; - quark_mfd->i2c_clk_lookup =clkdev_create (i2c_clk,NULL , -INTEL_QUARK_I2C_CONTROLLER_CLK ); - -if (!quark_mfd->i2c_clk_lookup) { -clk_unregister (quark_mfd->i2c_clk); -dev_err (dev,"Fixed clk register failed\n" ); -return -ENOMEM ; - } - -return 0 ; -} - -static void intel_quark_unregister_i2c_clk (struct device *dev) -{ -struct intel_quark_mfd *quark_mfd =dev_get_drvdata (dev); - -if (!quark_mfd->i2c_clk_lookup) -return ; +struct clk_hw *hw; -clkdev_drop (quark_mfd->i2c_clk_lookup); -clk_unregister (quark_mfd->i2c_clk); + hw =devm_clk_hw_register_fixed_rate (dev,INTEL_QUARK_I2C_CONTROLLER_CLK , +NULL ,0 ,INTEL_QUARK_I2C_CLK_HZ ); +return devm_clk_hw_register_clkdev (dev, hw,NULL , +INTEL_QUARK_I2C_CONTROLLER_CLK ); }static int intel_quark_i2c_setup (struct pci_dev *pdev)
@@ -238,19 +208,12 @@ static int intel_quark_gpio_setup(struct pci_dev *pdev)static int intel_quark_mfd_probe (struct pci_dev *pdev,const struct pci_device_id *id) { -struct intel_quark_mfd *quark_mfd;int ret; ret =pcim_enable_device (pdev);if (ret)return ret; - quark_mfd =devm_kzalloc (&pdev->dev,sizeof (*quark_mfd),GFP_KERNEL ); -if (!quark_mfd) -return -ENOMEM ; - -dev_set_drvdata (&pdev->dev, quark_mfd); - ret =intel_quark_register_i2c_clk (&pdev->dev);if (ret)return ret;
@@ -260,7 +223,7 @@ static int intel_quark_mfd_probe(struct pci_dev *pdev,/* This driver only requires 1 IRQ vector */ ret =pci_alloc_irq_vectors (pdev,1 ,1 ,PCI_IRQ_ALL_TYPES );if (ret <0 ) - goto err_unregister_i2c_clk; +return ret; ret =intel_quark_i2c_setup (pdev);if (ret)
@@ -282,8 +245,6 @@ static int intel_quark_mfd_probe(struct pci_dev *pdev,software_node_unregister_node_group (intel_quark_gpio_node_group); err_free_irq_vectors:pci_free_irq_vectors (pdev); -err_unregister_i2c_clk: -intel_quark_unregister_i2c_clk (&pdev->dev);return ret; }
@@ -292,7 +253,6 @@ static void intel_quark_mfd_remove(struct pci_dev *pdev)mfd_remove_devices (&pdev->dev);software_node_unregister_node_group (intel_quark_gpio_node_group);pci_free_irq_vectors (pdev); -intel_quark_unregister_i2c_clk (&pdev->dev); }static struct pci_driver intel_quark_mfd_driver = {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1591/2214 mfd: da9150: Balance IRQ wake on teardown
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myeonghun Pak <[email protected]>
[ Upstream commit ef464f82f3aecad4071af71074b2ceb77ffbb609 ]
DA9150 enables IRQ wake after registering its regmap IRQ chip, but does not disable it on a later probe failure or driver removal. This leaves the wake depth elevated after the handler is removed, and repeated bind attempts can accumulate the imbalance.
Remember whether enabling IRQ wake succeeded and balance only a successful call. Remove MFD children first so their nested IRQ users are gone, then disable wake before removing the regmap IRQ chip. Preserve the existing non-fatal behavior when IRQ wake cannot be enabled.
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
--- drivers/mfd/da9150-core.c | 8 ++++++-- include/linux/mfd/da9150/core.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-)
drivers/mfd/da9150-core.c +6 -2
@@ -451,7 +451,7 @@ static int da9150_probe(struct i2c_client *client, da9150->irq_base =regmap_irq_chip_get_base (da9150->regmap_irq_data); -enable_irq_wake (da9150->irq); + da9150->irq_wake_enabled = !enable_irq_wake (da9150->irq); ret = mfd_add_devices(da9150->dev, -1, da9150_devs, ARRAY_SIZE(da9150_devs), NULL,
@@ -464,6 +464,8 @@ static int da9150_probe(struct i2c_client *client,return 0 ; mfd_fail: +if (da9150->irq_wake_enabled) +disable_irq_wake (da9150->irq);regmap_del_irq_chip (da9150->irq, da9150->regmap_irq_data); regmap_irq_fail:i2c_unregister_device (da9150->core_qif);
@@ -475,8 +477,10 @@ static int da9150_remove(struct i2c_client *client) {struct da9150 *da9150 =i2c_get_clientdata (client); -regmap_del_irq_chip (da9150->irq, da9150->regmap_irq_data);mfd_remove_devices (da9150->dev); +if (da9150->irq_wake_enabled) +disable_irq_wake (da9150->irq); +regmap_del_irq_chip (da9150->irq, da9150->regmap_irq_data);i2c_unregister_device (da9150->core_qif);return 0 ;
include/linux/mfd/da9150/core.h +1 -0
@@ -65,6 +65,7 @@ struct da9150 {struct regmap_irq_chip_data *regmap_irq_data;int irq;int irq_base; +bool irq_wake_enabled; };/* Device I/O - Query Interface for FG and standard register access */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1592/2214 kconfig: warn about malformed KCONFIG_PROBABILITY values
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitrii Tulnov <[email protected]>
[ Upstream commit 9f01cd3a324390b235c67ae4ca3d35085369ebdd ]
randconfig checks the numeric range of each probability but does not validate where strtol() stops. For example, KCONFIG_PROBABILITY=50% is accepted as 50:0:0: the '%' is parsed repeatedly as zero. For the documented value 50, tristate y/m/n probabilities are 25%/25%/50%. With 50%, both y/m probabilities silently become zero, reducing the coverage of random configuration builds. Empty fields and extra fields are also accepted.
Warn when the value does not follow the documented decimal format. For malformed inputs whose parsed probabilities are in range, preserve the existing interpretation unless KCONFIG_WERROR is set. In that case, exit with an error before writing the configuration. Leading whitespace and signs are accepted by strtol(), but also trigger the warning because they are outside the documented format.
Keep the strtol() result as long until the range check. This rejects out-of-range values that narrowing to int previously made valid, such as 4294967296 becoming zero on a 64-bit host, regardless of KCONFIG_WERROR.
Add regression tests for one warning per malformed input, preserved configurations, KCONFIG_WERROR, out-of-range values, the supported probability formats, and the documented empty-value default.
--- scripts/kconfig/conf.c | 16 ++- scripts/kconfig/tests/conftest.py | 6 + .../tests/randconfig_probability/Kconfig | 12 ++ .../tests/randconfig_probability/__init__.py | 130 ++++++++++++++++++ 4 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 scripts/kconfig/tests/randconfig_probability/Kconfig create mode 100644 scripts/kconfig/tests/randconfig_probability/__init__.py
scripts/kconfig/conf.c +15 -1
@@ -184,12 +184,23 @@ static bool conf_set_all_new_symbols(enum conf_def_mode mode)if (mode == def_random) {int n, p[3 ]; +bool warned = false;char *env =getenv ("KCONFIG_PROBABILITY" ); n =0 ;while (env && *env) {char *endp; -int tmp =strtol (env, &endp,10 ); +long tmp =strtol (env, &endp,10 ); + +if (!isdigit ((unsigned char )*env) || + (*endp && *endp !=':' ) || + (*endp ==':' && (!endp[1 ] || n ==2 ))) { +if (!warned) { +fprintf (stderr, +"warning: KCONFIG_PROBABILITY has malformed format\n" ); + warned = true; + } + }if (tmp >=0 && tmp <=100 ) { p[n++] = tmp;
@@ -225,6 +236,9 @@ static bool conf_set_all_new_symbols(enum conf_def_mode mode)perror ("KCONFIG_PROBABILITY" );exit (1 ); } + +if (warned &&getenv ("KCONFIG_WERROR" )) +exit (1 ); } for_all_symbols(i, sym) {
scripts/kconfig/tests/conftest.py +6 -0
@@ -289,6 +289,12 @@ class Conf: return self._matches('stderr', expected) [email protected](autouse=True) +def clear_werror(monkeypatch): + # extra_env can set strict mode, but cannot remove an inherited flag. + monkeypatch.delenv('KCONFIG_WERROR', raising=False) + + @pytest.fixture(scope="module") def conf(request): """Create a Conf instance and provide it to test functions."""
scripts/kconfig/tests/randconfig_probability/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +# SPDX-License-Identifier: GPL-2.0-only + +config MODULES + bool + default y + modules + +config BOOL + bool "Bool" + +config TRI + tristate "Tristate"
scripts/kconfig/tests/randconfig_probability/__init__.py new file +130 -0
130 lines not on this page · raw message
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1593/2214 ASoC: fsl_asrc: use regmap_write_bits to update clock source registers
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shengjiu Wang <[email protected]>
[ Upstream commit 92871abc1302b852b88d86114115f8fd6b50b9b9 ]
After a warm reboot the REG_ASRCSR register may not be in its hardware reset state. regmap caches the register value as 0 (the assumed default), so when the desired clock source index is also 0, regmap_update_bits() skips the actual hardware write because it believes the register already holds the correct value. This leaves a stale clock source in the hardware.
Replace regmap_update_bits() with regmap_write_bits() so that the masked fields are always written to hardware regardless of the cached value.
--- sound/soc/fsl/fsl_asrc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/soc/fsl/fsl_asrc.c +4 -4
@@ -517,10 +517,10 @@ static int fsl_asrc_config_pair(struct fsl_asrc_pair *pair, bool use_ideal_rate) ASRCTR_USR(index));/* Set the input and output clock sources */ -regmap_update_bits (asrc->regmap,REG_ASRCSR , -ASRCSR_AICSi_MASK (index) |ASRCSR_AOCSi_MASK (index), -ASRCSR_AICS (index, clk_index[IN ]) | -ASRCSR_AOCS (index, clk_index[OUT ])); +regmap_write_bits (asrc->regmap,REG_ASRCSR , +ASRCSR_AICSi_MASK (index) |ASRCSR_AOCSi_MASK (index), +ASRCSR_AICS (index, clk_index[IN ]) | +ASRCSR_AOCS (index, clk_index[OUT ]));/* Calculate the input clock divisors */ indiv =fsl_asrc_cal_asrck_divisor (pair, div[IN ]);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1594/2214 ASoC: fsl_asrc: check the second front-end DMA channel
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Slavin Liu <[email protected]>
[ Upstream commit b4136c0d69ead737197af741e20edd1c3574f6b4 ]
The temporary Front-End DMA request can fail independently of the persistent channel acquired earlier in fsl_asrc_dma_hw_params(). The returned NULL pointer is immediately used to read its private data.
Check the temporary channel and release the previously acquired persistent Front-End channel on failure. Clear its slot so a later hw_free cannot release it twice. ASoC marks a component's hw_params only after success and skips unmarked components during rollback, so returning an error alone would leak the earlier channel.
Detected by static analysis and reviewed with AI-assisted source auditing.
--- sound/soc/fsl/fsl_asrc_dma.c | 5 +++++ 1 file changed, 5 insertions(+)
sound/soc/fsl/fsl_asrc_dma.c +5 -0
@@ -231,6 +231,11 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component,/* Get DMA request of Front-End */ tmp_chan = asrc->get_dma_channel (pair, dir); +if (!tmp_chan) { +dma_release_channel (pair->dma_chan[!dir]); + pair->dma_chan[!dir] =NULL ; +return -EINVAL ; + } tmp_data = tmp_chan->private; pair->dma_data.dma_request2 = tmp_data->dma_request; pair->dma_data.peripheral_type = tmp_data->peripheral_type;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1595/2214 ASoC: adau17x1: return cache sync errors from resume
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 8ca84987c11d11e0ba60f202e3199b3b80c87721 ]
adau17x1_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The optional switch-mode callback remains ordered before the cache replay.
The issue was found by a tool we developed.
--- sound/soc/codecs/adau17x1.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/adau17x1.c +1 -3
@@ -978,9 +978,7 @@ int adau17x1_resume(struct snd_soc_component *component)if (adau->switch_mode) adau->switch_mode (component->dev); -regcache_sync (adau->regmap); - -return 0 ; +return regcache_sync (adau->regmap); }EXPORT_SYMBOL_GPL (adau17x1_resume);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1596/2214 ASoC: ak4642: return cache sync errors from resume
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 7142c34ed92fddca7038787b8695d22c661dc6ec ]
ak4642_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/ak4642.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/codecs/ak4642.c +1 -2
@@ -533,8 +533,7 @@ static int ak4642_resume(struct snd_soc_component *component)struct regmap *regmap =dev_get_regmap (component->dev,NULL );regcache_cache_only (regmap, false); -regcache_sync (regmap); -return 0 ; +return regcache_sync (regmap); }static int ak4642_probe (struct snd_soc_component *component) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1597/2214 ASoC: nau8540: return cache sync errors from resume
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 0bf2b3411537e8e4d9c03702646a9fc87198d4b1 ]
nau8540_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/nau8540.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/nau8540.c +1 -3
@@ -786,9 +786,7 @@ static int __maybe_unused nau8540_resume(struct snd_soc_component *component)struct nau8540 *nau8540 =snd_soc_component_get_drvdata (component);regcache_cache_only (nau8540->regmap, false); -regcache_sync (nau8540->regmap); - -return 0 ; +return regcache_sync (nau8540->regmap); }static const struct snd_soc_component_driver nau8540_component_driver = {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1598/2214 ASoC: rt1011: return cache sync errors from resume
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 432734a00bfae17baeff1a83b61bfc9c2ab20c12 ]
rt1011_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt1011.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/rt1011.c +1 -3
@@ -2048,9 +2048,7 @@ static int rt1011_resume(struct snd_soc_component *component)struct rt1011_priv *rt1011 =snd_soc_component_get_drvdata (component);regcache_cache_only (rt1011->regmap, false); -regcache_sync (rt1011->regmap); - - return 0; + return regcache_sync(rt1011->regmap); }#else #define rt1011_suspend NULL
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1599/2214 ASoC: rt1016: return cache sync errors from resume
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 98ace05793c7b80a9f49d92b78fcc88e0970f8e4 ]
rt1016_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt1016.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/rt1016.c +1 -3
@@ -571,9 +571,7 @@ static int rt1016_resume(struct snd_soc_component *component)struct rt1016_priv *rt1016 =snd_soc_component_get_drvdata (component);regcache_cache_only (rt1016->regmap, false); -regcache_sync (rt1016->regmap); - - return 0; + return regcache_sync(rt1016->regmap); }#else #define rt1016_suspend NULL
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1600/2214 ASoC: rt1305: return cache sync errors from resume
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 30858325aa90380c6bcdde605214f1ebdbec568c ]
rt1305_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt1305.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/rt1305.c +1 -3
@@ -898,9 +898,7 @@ static int rt1305_resume(struct snd_soc_component *component)struct rt1305_priv *rt1305 =snd_soc_component_get_drvdata (component);regcache_cache_only (rt1305->regmap, false); -regcache_sync (rt1305->regmap); - - return 0; + return regcache_sync(rt1305->regmap); }#else #define rt1305_suspend NULL
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1601/2214 ASoC: rt1308: return cache sync errors from resume
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 3db3289178b94056753f7a8c6ee4ab4b232ee6a5 ]
rt1308_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt1308.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/rt1308.c +1 -3
@@ -717,9 +717,7 @@ static int rt1308_resume(struct snd_soc_component *component)struct rt1308_priv *rt1308 =snd_soc_component_get_drvdata (component);regcache_cache_only (rt1308->regmap, false); -regcache_sync (rt1308->regmap); - - return 0; + return regcache_sync(rt1308->regmap); }#else #define rt1308_suspend NULL
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1602/2214 ASoC: rt5616: return cache sync errors from resume
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 8fc9d353d5371a946d9a9952278b96c09070374c ]
rt5616_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt5616.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/soc/codecs/rt5616.c +1 -2
@@ -1250,8 +1250,7 @@ static int rt5616_resume(struct snd_soc_component *component)struct rt5616_priv *rt5616 =snd_soc_component_get_drvdata (component);regcache_cache_only (rt5616->regmap, false); -regcache_sync (rt5616->regmap); - return 0; + return regcache_sync(rt5616->regmap); }#else #define rt5616_suspend NULL
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1603/2214 ASoC: rt5659: return cache sync errors from resume
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 3a9b5bce85a1baff95463a2bb021efac64bcf83f ]
rt5659_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt5659.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/rt5659.c +1 -3
@@ -3705,9 +3705,7 @@ static int rt5659_resume(struct snd_soc_component *component)struct rt5659_priv *rt5659 =snd_soc_component_get_drvdata (component);regcache_cache_only (rt5659->regmap, false); -regcache_sync (rt5659->regmap); - - return 0; + return regcache_sync(rt5659->regmap); }#else #define rt5659_suspend NULL
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1604/2214 ASoC: rt5660: return cache sync errors from resume
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 70fe8997b03078ff8253d985a161fef310f7c346 ]
rt5660_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The power-off resume delay remains ordered before the cache replay.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt5660.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/rt5660.c +1 -3
@@ -1152,9 +1152,7 @@ static int rt5660_resume(struct snd_soc_component *component)msleep (350 );regcache_cache_only (rt5660->regmap, false); -regcache_sync (rt5660->regmap); - - return 0; + return regcache_sync(rt5660->regmap); }#else #define rt5660_suspend NULL
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1605/2214 ASoC: rt5665: return cache sync errors from resume
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit 9f2933d9a437302d5ae32eb9022efef049d8ab22 ]
rt5665_resume() restores cached registers during component resume but discards the regcache_sync() result and returns success. A failed replay can therefore leave the hardware register state stale without reaching the component error reporting path.
Return the cache synchronization result. The ASoC component wrapper reports a negative callback result and retains the established best-effort resume state, so this adds observability without introducing rollback or retry semantics.
The successful resume path is unchanged.
The issue was found by a tool we developed.
--- sound/soc/codecs/rt5665.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/rt5665.c +1 -3
@@ -4491,9 +4491,7 @@ static int rt5665_resume(struct snd_soc_component *component)struct rt5665_priv *rt5665 =snd_soc_component_get_drvdata (component);regcache_cache_only (rt5665->regmap, false); -regcache_sync (rt5665->regmap); - - return 0; + return regcache_sync(rt5665->regmap); }#else #define rt5665_suspend NULL
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1606/2214 iio: accel: bma220: publish the SPI driver ACPI alias
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pengpeng Hou <[email protected]>
[ Upstream commit cdc7d3dd101251a6373332726b8d6fad35e83b8a ]
The SPI driver advertises an ACPI match for BMA0220 but does not export that table. A modular build therefore lacks the ACPI alias used to load the driver when the device is enumerated through ACPI.
Export the ACPI table. Move the existing SPI export next to its SPI ID table so each export is adjacent to the table it describes.
The issue was found by our static-analysis tool.
--- drivers/iio/accel/bma220_spi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/accel/bma220_spi.c +2 -1
@@ -308,12 +308,13 @@ static const struct spi_device_id bma220_spi_id[] = { {"bma220", 0}, {} }; +MODULE_DEVICE_TABLE(spi, bma220_spi_id); static const struct acpi_device_id bma220_acpi_id[] = { {"BMA0220", 0}, {} }; -MODULE_DEVICE_TABLE(spi, bma220_spi_id); +MODULE_DEVICE_TABLE(acpi, bma220_acpi_id); static struct spi_driver bma220_driver = { .driver = {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1607/2214 dt-bindings: vendor-prefixes: Add General Mobile
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Muzaffer Kadir <[email protected]>
[ Upstream commit 7034bec693b752bcd7ebb4fa00dc3b429b4dc4f7 ]
Add vendor prefix for General Mobile.
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -457,6 +457,8 @@ patternProperties: description: Gemei Digital Technology Co., Ltd. "^gemtek,.*": description: Gemtek Technology Co., Ltd. + "^generalmobile,.*": + description: General Mobile Fzc. "^genesys,.*": description: Genesys Logic, Inc. "^geniatech,.*":
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1608/2214 perf c2c: Fix documented default coalesce fields
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiebin Sun <[email protected]>
[ Upstream commit b36a6f180baad35a962677ae181681ca60dda35b ]
The default coalesce fields dropped pid in favor of iaddr, but the man page still documents the old pid,iaddr default. Update it to match the command.
--- tools/perf/Documentation/perf-c2c.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Documentation/perf-c2c.txt +1 -1
@@ -269,7 +269,7 @@ output fields set for cacheline offsets output: Code address, Code symbol, Shared Object, Source line dso - coalesced by shared object -By default the coalescing is setup with 'pid,iaddr'. +By default, coalescing uses `iaddr`. STDIO OUTPUT ------------
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1609/2214 mtd: block: prevent reclaim I/O during request processing
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Qingfang Deng <[email protected]>
[ Upstream commit d498b2ddda99eed28cde177b1620dbcea246a1c4 ]
The blktrans request callbacks run under dev->lock and may allocate memory with GFP_KERNEL. For example, mtdblock_writesect() uses vmalloc() to allocate its eraseblock cache. Direct reclaim can then recurse into block I/O and deadlock on resources held by the request being processed. syzbot reports a circular locking dependency involving the device mutex and fs_reclaim.
Commit d5ba1c8ffd0b ("mtd: don't use PF_MEMALLOC") removed PF_MEMALLOC from the MTD request thread. That flag had prevented direct reclaim, so its removal made allocations during request processing eligible for reclaim without excluding I/O.
Wrap request processing in mtd_queue_rq() in a NOIO scope. This covers both the request and background callbacks, including allocations made by lower MTD drivers, and prevents reclaim from initiating filesystem or block I/O.
--- drivers/mtd/mtd_blkdevs.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/mtd/mtd_blkdevs.c +5 -0
@@ -18,6 +18,7 @@#include <linux/spinlock.h> #include <linux/hdreg.h> #include <linux/mutex.h> +#include <linux/sched/mm.h> #include <linux/uaccess.h> #include "mtdcore.h"
@@ -166,6 +167,7 @@ static blk_status_t mtd_queue_rq(struct blk_mq_hw_ctx *hctx, const struct blk_mq_queue_data *bd) {struct mtd_blktrans_dev *dev; +unsigned int noio_flags; dev = hctx->queue->queuedata;if (!dev) {
@@ -173,10 +175,13 @@ static blk_status_t mtd_queue_rq(struct blk_mq_hw_ctx *hctx,return BLK_STS_IOERR ; } +/* Reclaim must not recurse into I/O while processing requests. */ + noio_flags =memalloc_noio_save ();spin_lock_irq (&dev->queue_lock);list_add_tail (&bd->rq->queuelist, &dev->rq_list);mtd_blktrans_work (dev);spin_unlock_irq (&dev->queue_lock); +memalloc_noio_restore (noio_flags);return BLK_STS_OK ; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1610/2214 writeback: size foreign flushes by target wb dirty pages
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xin Yin <[email protected]>
[ Upstream commit 168a8c13159c6e3f0f08da6f8fa2f633a91ba9fd ]
Foreign dirty tracking records the bdi and wb memcg IDs of recently dirtied foreign inodes. When the source memcg needs foreign writeback, mem_cgroup_flush_foreign() queues WB_REASON_FOREIGN_FLUSH to the recorded target bdi_writeback.
cgroup_writeback_by_id() currently sizes this best-effort work from the target memcg's NR_FILE_DIRTY counter. The work is scoped to one target wb, so a memcg-wide dirty count can over-size a single-bdi flush when the target memcg has dirty pages on other devices. It can also under-size the flush when the target wb has dirty pages charged to other memcgs.
Over-sizing keeps the target wb busy longer and can delay later writeback work. Under-sizing can finish before enough pages are written back for the source memcg.
Use the target wb's WB_RECLAIMABLE counter and keep the existing 25% headroom. This keeps the budget aligned with the writeback object being queued.
--- fs/fs-writeback.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
fs/fs-writeback.c +7 -10
@@ -1084,7 +1084,7 @@ int cgroup_writeback_by_id(u64 bdi_id, int memcg_id,struct cgroup_subsys_state *memcg_css;struct bdi_writeback *wb;struct wb_writeback_work *work; -unsigned long dirty; +long dirty;int ret;/* lookup bdi and memcg */
@@ -1113,16 +1113,13 @@ int cgroup_writeback_by_id(u64 bdi_id, int memcg_id, }/* -* The caller is attempting to write out most of -* the currently dirty pages. Let's take the current dirty page -* count and inflate it by 25% which should be large enough to -* flush out most dirty pages while avoiding getting livelocked by -* concurrent dirtiers. -* -* BTW the memcg stats are flushed periodically and this is best-effort -* estimation, so some potential error is ok. +* The caller is attempting to write out most of the target wb's +* currently dirty pages. Size the work from the wb's reclaimable pages +* and inflate the count by 25%, which should be large enough to flush +* out most dirty pages while avoiding getting livelocked by concurrent +* dirtiers. */ - dirty =memcg_page_state (mem_cgroup_from_css (memcg_css),NR_FILE_DIRTY ); + dirty =wb_stat_sum (wb,WB_RECLAIMABLE ); dirty = dirty *10 /8 ;/* issue the writeback work */
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1611/2214 ACPICA: Fix memory leak in acpi_ds_create_field()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Breno Leitao <[email protected]>
[ Upstream commit dbb3d99ee95c32711950850ddd33eb22a6042eb2 ]
acpi_ds_create_field() allocates internal_pcc_buffer for operation regions in the PCC address space.
The function runs once per field, so a second field on the same region overwrites the pointer and orphans the previous buffer.
The matching ACPI_FREE() in acpi_ut_delete_internal_obj() only ever sees the last one.
An arm64 platform whose SSDT declares regions with multiple fields each leaks two buffers at boot, as detected by kmemleak:
unreferenced object 0xffff000051e65400 (size 192):
comm "swapper/0", pid 1, jiffies 4294668436 backtrace (crc 0):
__kmalloc_noprof
acpi_ds_create_field acpi_ds_load2_end_op acpi_ds_exec_end_op
acpi_ps_parse_loop
acpi_ps_parse_aml
acpi_ns_load_table
acpi_load_tables
acpi_init
Do not allocate a region if it was previously allocated before, preserving the current design, but, not leaking memory.
--- drivers/acpi/acpica/dsfield.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/acpi/acpica/dsfield.c +2 -1
@@ -522,7 +522,8 @@ acpi_ds_create_field(union acpi_parse_object *op, }if (info.region_node->object->region.space_id == -ACPI_ADR_SPACE_PLATFORM_COMM ) { +ACPI_ADR_SPACE_PLATFORM_COMM && + !region_node->object->field.internal_pcc_buffer) { region_node->object->field.internal_pcc_buffer =ACPI_ALLOCATE_ZEROED (info.region_node->object->region. length);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1612/2214 ACPICA: Fix PCC OperationRegion command offsets
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sudeep Holla <[email protected]>
[ Upstream commit 888dab4b04ea8725168c6d50d0bfb8057fccca18 ]
ACPI 6.3, section 5.5.2.4.7.3, states that the PCC Operation Region is associated with the region of shared memory that follows the PCC signature.
The generic and extended PCC shared memory layouts include the 4-byte signature at offset 0, so their raw shared memory COMMAND fields are at offsets 4 and 12 respectively. Since AML field offsets for the PCC OperationRegion are relative to the region after that signature, ACPICA must look for those COMMAND fields at OperationRegion offsets 0 and 8.
Adjust the generic and master subspace command checks to use those OperationRegion-relative offsets. Otherwise writes to the COMMAND field can fail to invoke the PCC address space handler at the offset described by the PCC OperationRegion definition.
--- drivers/acpi/acpica/exfield.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/acpi/acpica/exfield.c +6 -5
@@ -45,12 +45,13 @@ static const u8 acpi_protocol_lengths[] = {/* * The following macros determine a given offset is a COMD field. -* According to the specification, generic subspaces (types 0-2) contains a -* 2-byte COMD field at offset 4 and master subspaces (type 3) contains a 4-byte -* COMD field starting at offset 12. +* According to the specification, the PCC OperationRegion begins after +* the PCC signature. The raw shared memory COMD offsets of 4 for generic +* subspaces (types 0-2) and 12 for master subspaces (type 3) therefore +* appear at OperationRegion offsets 0 and 8. */ -#define GENERIC_SUBSPACE_COMMAND (a) (4 == a || a == 5) -#define MASTER_SUBSPACE_COMMAND (a) (12 <= a && a <= 15) +#define GENERIC_SUBSPACE_COMMAND (a) (0 == a || a == 1) +#define MASTER_SUBSPACE_COMMAND (a) (8 <= a && a <= 11)/******************************************************************************* *
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1613/2214 ASoC: mediatek: mt8183: Fix wrong clock cleanup on clk_set_parent() failure
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <[email protected]>
[ Upstream commit 7f05596bd4047e4623eeb1f3c6921d6f71481c3b ]
In mt8183_afe_enable_clock(), when clk_set_parent() fails, the current error path incorrectly cleans up the previously enabled clock instead of the clock used by clk_set_parent().
Fix the error path to clean up the correct clock when clk_set_parent() fails.
--- sound/soc/mediatek/mt8183/mt8183-afe-clk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/mediatek/mt8183/mt8183-afe-clk.c +2 -2
@@ -137,7 +137,7 @@ int mt8183_afe_enable_clock(struct mtk_base_afe *afe)dev_err (afe->dev,"%s(), clk_set_parent %s-%s fail %d\n" , __func__, aud_clks[CLK_MUX_AUDIO ], aud_clks[CLK_CLK26M ], ret); - goto CLK_MUX_AUDIO_ERR; + goto CLK_MUX_AUDIO_INTBUS_ERR; } ret =clk_prepare_enable (afe_priv->clk[CLK_MUX_AUDIOINTBUS ]);
@@ -153,7 +153,7 @@ int mt8183_afe_enable_clock(struct mtk_base_afe *afe)dev_err (afe->dev,"%s(), clk_set_parent %s-%s fail %d\n" , __func__, aud_clks[CLK_MUX_AUDIOINTBUS ], aud_clks[CLK_TOP_SYSPLL_D2_D4 ], ret); - goto CLK_MUX_AUDIO_INTBUS_ERR; + goto CLK_AFE_ERR; } ret =clk_prepare_enable (afe_priv->clk[CLK_AFE ]);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1614/2214 ASoC: mediatek: mt8183: Fix clock handling in mux disable path
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <[email protected]>
[ Upstream commit 4a0f9566ae0c3ad32620254342b266f37f4757de ]
In the disable path of the appl*_mux_setting() functions, clk_disable_unprepare() is called after clk_set_parent(). If clk_set_parent() fails, clk_disable_unprepare() is skipped, potentially leaving one of the clocks enabled.
Remove the goto exit paths so that all teardown steps are attempted and any errors are only reported.
--- sound/soc/mediatek/mt8183/mt8183-afe-clk.c | 6 ------ 1 file changed, 6 deletions(-)
sound/soc/mediatek/mt8183/mt8183-afe-clk.c +0 -6
@@ -271,7 +271,6 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)dev_err (afe->dev,"%s clk_set_parent %s-%s fail %d\n" , __func__, aud_clks[CLK_TOP_MUX_AUD_ENG1 ], aud_clks[CLK_CLK26M ], ret); - goto EXIT; }clk_disable_unprepare (afe_priv->clk[CLK_TOP_MUX_AUD_ENG1 ]);
@@ -281,7 +280,6 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable)dev_err (afe->dev,"%s clk_set_parent %s-%s fail %d\n" , __func__, aud_clks[CLK_TOP_MUX_AUD_1 ], aud_clks[CLK_CLK26M ], ret); - goto EXIT; }clk_disable_unprepare (afe_priv->clk[CLK_TOP_MUX_AUD_1 ]); }
@@ -298,7 +296,6 @@ static int apll1_mux_setting(struct mtk_base_afe *afe, bool enable) afe_priv->clk[CLK_CLK26M]);clk_disable_unprepare (afe_priv->clk[CLK_TOP_MUX_AUD_1 ]); ERR_ENABLE_CLK_TOP_MUX_AUD_1: -EXIT:return ret; }
@@ -345,7 +342,6 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)dev_err (afe->dev,"%s clk_set_parent %s-%s fail %d\n" , __func__, aud_clks[CLK_TOP_MUX_AUD_ENG2 ], aud_clks[CLK_CLK26M ], ret); - goto EXIT; }clk_disable_unprepare (afe_priv->clk[CLK_TOP_MUX_AUD_ENG2 ]);
@@ -355,7 +351,6 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable)dev_err (afe->dev,"%s clk_set_parent %s-%s fail %d\n" , __func__, aud_clks[CLK_TOP_MUX_AUD_2 ], aud_clks[CLK_CLK26M ], ret); - goto EXIT; }clk_disable_unprepare (afe_priv->clk[CLK_TOP_MUX_AUD_2 ]); }
@@ -372,7 +367,6 @@ static int apll2_mux_setting(struct mtk_base_afe *afe, bool enable) afe_priv->clk[CLK_CLK26M]);clk_disable_unprepare (afe_priv->clk[CLK_TOP_MUX_AUD_2 ]); ERR_ENABLE_CLK_TOP_MUX_AUD_2: -EXIT:return ret; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1615/2214 ASoC: mediatek: mt8183: Fix APLL enable error handling
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <[email protected]>
[ Upstream commit 30cf48383006579d7cd35380cc6e766260b72bff ]
Currently, the mt8183_apll*_enable() functions call mux_setting(afe, true) but do not check its return value to handle failures.
In addition, the cleanup paths of mt8183_apll*_enable() do not call mux_setting(afe, false) when the enable operation fails, while the mt8183_apll*_disable() functions do.
Add error handling for apll*_mux_setting() and call mux_setting(afe, false) in the cleanup paths when mt8183_apll*_enable() fails.
--- sound/soc/mediatek/mt8183/mt8183-afe-clk.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
sound/soc/mediatek/mt8183/mt8183-afe-clk.c +10 -2
@@ -376,7 +376,9 @@ int mt8183_apll1_enable(struct mtk_base_afe *afe)int ret;/* setting for APLL */ -apll1_mux_setting (afe, true); + ret =apll1_mux_setting (afe, true); +if (ret) +return ret; ret =clk_prepare_enable (afe_priv->clk[CLK_APLL22M ]);if (ret) {
@@ -405,6 +407,8 @@ int mt8183_apll1_enable(struct mtk_base_afe *afe) ERR_CLK_APLL1_TUNER:clk_disable_unprepare (afe_priv->clk[CLK_APLL22M ]); ERR_CLK_APLL22M: +apll1_mux_setting (afe, false); +return ret; }
@@ -430,7 +434,9 @@ int mt8183_apll2_enable(struct mtk_base_afe *afe)int ret;/* setting for APLL */ -apll2_mux_setting (afe, true); + ret =apll2_mux_setting (afe, true); +if (ret) +return ret; ret =clk_prepare_enable (afe_priv->clk[CLK_APLL24M ]);if (ret) {
@@ -459,6 +465,8 @@ int mt8183_apll2_enable(struct mtk_base_afe *afe) ERR_CLK_APLL2_TUNER:clk_disable_unprepare (afe_priv->clk[CLK_APLL24M ]); ERR_CLK_APLL24M: +apll2_mux_setting (afe, false); +return ret; }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1616/2214 dt-bindings: vendor-prefixes: Document Chongzhou
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jagan Teki <[email protected]>
[ Upstream commit 90f86d0c617d9461cb00f4d8e861eda28011d46e ]
Chongzhou is a professional is a manufacturer of LCD panels from Shenzhen.
Add vendor prefix for it.
Stable-dep-of: 058ee00216a1 ("dt-bindings: vendor-prefixes: Add Chip Wealth Technology")
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -229,6 +229,8 @@ patternProperties: description: ChipOne "^chipspark,.*": description: ChipSPARK + "^chongzhou,.*": + description: Shenzhen Chongzhou Electronic Technology Co., Ltd "^chrontel,.*": description: Chrontel, Inc. "^chrp,.*":
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1617/2214 dt-bindings: vendor-prefixes: Add Chip Wealth Technology
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaron Kling <[email protected]>
[ Upstream commit 058ee00216a1356e710446b59a800065d2abbd80 ]
Add an entry for Chip Wealth Technology (https://www.chipwealth.com/)
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -229,6 +229,8 @@ patternProperties: description: ChipOne "^chipspark,.*": description: ChipSPARK + "^chipwealth,.*": + description: Chip Wealth Technology "^chongzhou,.*": description: Shenzhen Chongzhou Electronic Technology Co., Ltd "^chrontel,.*":
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1618/2214 hfs/hfsplus: serialize B-tree close against folio release
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bruno Produit <[email protected]>
[ Upstream commit dce0e0248205bb3dc5b4c6793cd2ecb453152259 ]
B-tree nodes with a zero reference count remain in the node hash until folio reclaim or tree teardown frees them. The folio release callbacks remove nodes while holding hash_lock, but hfs_btree_close() walks and frees the same hash without that lock. Reclaim can therefore unhash and free a node after close has loaded its pointer, causing a use-after-free or double-free.
The following syzkaller crashes seem to be the same UAF in {hfs,hfsplus}_btree_close() (or {hfs,hfsplus}_bnode_unhash()) and follow the same pattern, but do not contain a reproducer to confirm.
Detach each node with hfs_bnode_unhash() while holding hash_lock before inspecting and freeing it. Drop the lock before hfs_bnode_free() so a large tree is not freed while holding a spinlock. Apply the same fix to the matching HFS+ implementation.
--- fs/hfs/btree.c | 7 +++++-- fs/hfsplus/btree.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-)
fs/hfs/btree.c +5 -2
@@ -143,15 +143,18 @@ void hfs_btree_close(struct hfs_btree *tree)return ;for (i =0 ; i <NODE_HASH_SIZE ; i++) { +spin_lock (&tree->hash_lock);while ((node = tree->node_hash[i])) { - tree->node_hash[i] = node->next_hash; +hfs_bnode_unhash (node); +spin_unlock (&tree->hash_lock);if (atomic_read (&node->refcnt))pr_err ("node %d:%d still has %d user(s)!\n" , node->tree->cnid, node->this,atomic_read (&node->refcnt));hfs_bnode_free (node); - tree->node_hash_cnt--; +spin_lock (&tree->hash_lock); } +spin_unlock (&tree->hash_lock); }iput (tree->inode);kfree (tree);
fs/hfsplus/btree.c +5 -2
@@ -264,16 +264,19 @@ void hfs_btree_close(struct hfs_btree *tree)return ;for (i =0 ; i <NODE_HASH_SIZE ; i++) { +spin_lock (&tree->hash_lock);while ((node = tree->node_hash[i])) { - tree->node_hash[i] = node->next_hash; +hfs_bnode_unhash (node); +spin_unlock (&tree->hash_lock);if (atomic_read (&node->refcnt))pr_crit ("node %d:%d " "still has %d user(s)!\n" , node->tree->cnid, node->this,atomic_read (&node->refcnt));hfs_bnode_free (node); - tree->node_hash_cnt--; +spin_lock (&tree->hash_lock); } +spin_unlock (&tree->hash_lock); }iput (tree->inode);kfree (tree);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1619/2214 dt-bindings: vendor-prefixes: Add LeEco
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adam Skladowski <[email protected]>
[ Upstream commit 1658af4d25bd3133d1b3403ccdda6214d40c0ebb ]
Add vendor prefix for now dead ecosystem company LeEco
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -651,6 +651,8 @@ patternProperties: description: Lattice Semiconductor "^leadtek,.*": description: Shenzhen Leadtek Technology Co., Ltd. + "^leeco,.*": + description: Leshi Holding Beijing. "^leez,.*": description: Leez "^lego,.*":
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1620/2214 dt-bindings: vendor-prefixes: Add Retronix Technology Inc.
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <[email protected]>
[ Upstream commit da076d5562d2fc99138ff8ab04ff82eee7a4a3d8 ]
Add vendor prefix for Retronix Technology Inc.
https://www.retronix.com.tw/en/about.html
Stable-dep-of: ea55bba4c68a ("dt-bindings: vendor-prefixes: Add Retroid Pocket")
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -1004,6 +1004,8 @@ patternProperties: description: iMX6 Rex Project "^rervision,.*": description: Shenzhen Rervision Technology Co., Ltd. + "^retronix,.*": + description: Retronix Technology Inc. "^revotics,.*": description: Revolution Robotics, Inc. (Revotics) "^richtek,.*":
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1621/2214 dt-bindings: vendor-prefixes: Add Retroid Pocket
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaron Kling <[email protected]>
[ Upstream commit ea55bba4c68a49fcb527da6c71dd48879b705fd1 ]
Add an entry for Retroid Pocket (https://www.goretroid.com/)
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -1004,6 +1004,8 @@ patternProperties: description: iMX6 Rex Project "^rervision,.*": description: Shenzhen Rervision Technology Co., Ltd. + "^retroidpocket,.*": + description: Retroid Pocket "^retronix,.*": description: Retronix Technology Inc. "^revotics,.*":
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1622/2214 MIPS: Octeon: size the swiotlb for a modular OHCI platform driver
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Orgad Shaneh <[email protected]>
[ Upstream commit f1dd1f0c8d595a019be503d40060d25721313b4a ]
plat_swiotlb_setup() raises the swiotlb to 64 MB on OCTEON II with memory above 4 GB, because that OHCI can only DMA to 32 bits. The test is "#ifdef CONFIG_USB_OHCI_HCD_PLATFORM", which is false when the driver is a module - the usual way to build it - so the bump is silently skipped.
What is left depends on the rest of the function: with PCI enabled the "memory past the BAR1 hole" branch happens to ask for the same 64 MB, but with CONFIG_PCI off - which is normal on these SoCs when no PCI devices are wired - swiotlbsize stays at the PAGE_SIZE it was initialised to. A full- or low-speed device on an OCTEON II board with more than 4 GB of RAM then has no bounce buffer to speak of.
Use IS_ENABLED() so a modular OHCI gets the same sizing as a built-in one. Seen on a CN6635 board with 8 GB of RAM and CONFIG_USB_OHCI_HCD_PLATFORM=m.
--- arch/mips/cavium-octeon/dma-octeon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/cavium-octeon/dma-octeon.c +1 -1
@@ -231,7 +231,7 @@ void __init plat_swiotlb_setup(void) swiotlbsize = 64 * (1<<20); }#endif -#ifdef CONFIG_USB_OHCI_HCD_PLATFORM +#if IS_ENABLED (CONFIG_USB_OHCI_HCD_PLATFORM )/* OCTEON II ohci is only 32-bit. */ if (OCTEON_IS_OCTEON2 () && max_addr >=0x100000000ul ) swiotlbsize =64 * (1 <<20 );
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1623/2214 MIPS: Only check -msym32 when need-compiler
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: WangYuli <[email protected]>
[ Upstream commit 7a8f286c235f5d308208cfdcb025b2a0e0c84742 ]
During 'make modules_install', the need-compiler variable is null, so Makefile.compiler isn't included. This results in call cc-option-yn returning nothing and consequently an error is issued:
*** CONFIG_CPU_DADDI_WORKAROUNDS unsupported without -msym32. Stop.
and the invocation terminated for configurations that set the Kconfig option named.
Previously commit a79a404e6c22 ("MIPS: Fix CONFIG_CPU_DADDI_WORKAROUNDS `modules_install' regression") addressed the same issue for GCC versions now supported for Linux compilation, but caused a build error with Clang because it doesn't support '-msym32'. Then commit 18ca63a2e23c ("MIPS:
Probe toolchain support of -msym32") fixed the issue with Clang, but reintroduced the 'make modules_install' error listed above.
Wrap the handling of the '-msym32' option then with ifdef need-compiler, fixing said error for 'make modules_install'.
For more technical details on why need-compiler is null during 'make modules_install' and why no compiler invocation is actually needed at this point, please refer to commit 4fe4a6374c4d ("MIPS: Only fiddle with CHECKFLAGS if need-compiler") and commit 805b2e1d427a ("kbuild: include Makefile.compiler only when compiler is needed").
NB leading 8 spaces rather than tabs required due to `make' syntax.
--- arch/mips/Makefile | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
arch/mips/Makefile +12 -10
@@ -272,18 +272,20 @@ drivers-$(CONFIG_PCI) += arch/mips/pci/ # We can always force a build with a 64-bits symbol format by # passing 'KBUILD_SYM32=no' option to the make's command line. # -ifdef CONFIG_64BIT - ifndef KBUILD_SYM32 - ifeq ($(shell expr $(load-y) \< 0xffffffff80000000), 0) - KBUILD_SYM32 = $(call cc-option-yn, -msym32) +ifdef need-compiler + ifdef CONFIG_64BIT + ifndef KBUILD_SYM32 + ifeq ($(shell expr $(load-y) \< 0xffffffff80000000), 0) + KBUILD_SYM32 = $(call cc-option-yn, -msym32) + endif endif - endif - ifeq ($(KBUILD_SYM32), y) - cflags-$(KBUILD_SYM32) += -msym32 -DKBUILD_64BIT_SYM32 - else - ifeq ($(CONFIG_CPU_DADDI_WORKAROUNDS), y) - $(error CONFIG_CPU_DADDI_WORKAROUNDS unsupported without -msym32) + ifeq ($(KBUILD_SYM32), y) + cflags-$(KBUILD_SYM32) += -msym32 -DKBUILD_64BIT_SYM32 + else + ifeq ($(CONFIG_CPU_DADDI_WORKAROUNDS), y) + $(error CONFIG_CPU_DADDI_WORKAROUNDS unsupported without -msym32) + endif endif endif endif
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1624/2214 m68k: apollo: Fix interrupt setup
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Palmer <[email protected]>
[ Upstream commit 6cdbe63badcb524c88f2c8b3cee08f2ffc099a1b ]
The user interrupt vector needs to be installed before the interrupts are unmasked otherwise the timer tick isn't handled and boot up gets stuck in calibrate_delay().
--- arch/m68k/apollo/dn_ints.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/m68k/apollo/dn_ints.c +6 -0
@@ -2,6 +2,7 @@#include <linux/interrupt.h> #include <linux/irq.h> +#include <asm/irq.h> #include <asm/traps.h> #include <asm/apollohw.h>
@@ -9,10 +10,13 @@ unsigned int apollo_irq_startup(struct irq_data *data) {unsigned int irq = data->irq; +m68k_irq_startup (data); +if (irq <8 ) *(volatile unsigned char *)(pica+1 ) &= ~(1 << irq);else *(volatile unsigned char *)(picb+1 ) &= ~(1 << (irq -8 )); +return 0 ; }
@@ -24,6 +28,8 @@ void apollo_irq_shutdown(struct irq_data *data) *(volatile unsigned char *)(pica+1 ) |= (1 << irq); else *(volatile unsigned char *)(picb+1 ) |= (1 << (irq -8 )); + +m68k_irq_shutdown (data); }void apollo_irq_eoi (struct irq_data *data)
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1625/2214 drm/msm/a6xx: Fix secondary rail vote in ARC votes
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Akhil P Oommen <[email protected]>
[ Upstream commit 128a0edde50780ed9eb93ab5d2e18ca24c1f1c43 ]
Using the requested level can pick a secondary corner lower than the one required to support the chosen primary corner, under-voting the dependent rail. To fix this, match against the selected primary voltage instead.
Patchwork: https://patchwork.freedesktop.org/patch/755592/
Message-ID: <[email protected]>
--- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +5 -1
@@ -1304,10 +1304,14 @@ static int a6xx_gmu_rpmh_arc_votes_init(struct device *dev, u32 *votes,/* * Look for a level in in the secondary list that matches. If * nothing fits, use the maximum non zero vote +* +* The secondary rail depends on the primary rail, so match it +* against the quantized primary voltage (which is >= the +* requested level), not the requested level itself. */ for (j =0 ; j < sec_count; j++) { -if (sec[j] >= level) { +if (sec[j] >= pri[pindex]) { sindex = j;break ; }else if (sec[j]) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1626/2214 netfilter: synproxy: fix reset of ct seqadj when reopening a connection
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fernando Fernandez Mancera <[email protected]>
[ Upstream commit a8708aa9fe1095ca7859cb3f102b6a3fa0fb98bd ]
SYNPROXY is resetting conntrack seqadj when a closed connection is re-opened, but it was using nf_ct_seqadj_init() which is a no-op for a zero offset.
This patch introduces nf_ct_seqadj_reset() which sets the offset values directly to zero and avoid setting IPS_SEQ_ADJUST_BIT flag, it changes SYNPROXY code to use it when needed.
--- include/net/netfilter/nf_conntrack_seqadj.h | 1 + net/netfilter/nf_conntrack_seqadj.c | 17 +++++++++++++++++ net/netfilter/nf_synproxy_core.c | 4 ++-- 3 files changed, 20 insertions(+), 2 deletions(-)
include/net/netfilter/nf_conntrack_seqadj.h +1 -0
@@ -33,6 +33,7 @@ static inline struct nf_conn_seqadj *nfct_seqadj_ext_add(struct nf_conn *ct)int nf_ct_seqadj_init (struct nf_conn *ct,enum ip_conntrack_info ctinfo,s32 off); +void nf_ct_seqadj_reset (struct nf_conn *ct,enum ip_conntrack_info ctinfo);int nf_ct_seqadj_set (struct nf_conn *ct,enum ip_conntrack_info ctinfo,__be32 seq,s32 off); void nf_ct_tcp_seqadj_set(struct sk_buff *skb, struct nf_conn *ct,
net/netfilter/nf_conntrack_seqadj.c +17 -0
@@ -29,6 +29,23 @@ int nf_ct_seqadj_init(struct nf_conn *ct, enum ip_conntrack_info ctinfo, }EXPORT_SYMBOL_GPL (nf_ct_seqadj_init); +void nf_ct_seqadj_reset (struct nf_conn *ct,enum ip_conntrack_info ctinfo) +{ +struct nf_conn_seqadj *seqadj =nfct_seqadj (ct); +enum ip_conntrack_dir dir =CTINFO2DIR (ctinfo); +struct nf_ct_seqadj *this_way; + +if (unlikely (!seqadj)) +return ; + +spin_lock_bh (&ct->lock); + this_way = &seqadj->seq[dir]; + this_way->offset_before =0 ; + this_way->offset_after =0 ; +spin_unlock_bh (&ct->lock); +} +EXPORT_SYMBOL_GPL (nf_ct_seqadj_reset); +int nf_ct_seqadj_set (struct nf_conn *ct,enum ip_conntrack_info ctinfo,__be32 seq,s32 off) {
net/netfilter/nf_synproxy_core.c +2 -2
@@ -709,7 +709,7 @@ ipv4_synproxy_hook(void *priv, struct sk_buff *skb,* adjustments, they will get initialized once the connection is * reestablished. */ -nf_ct_seqadj_init (ct, ctinfo,0 ); +nf_ct_seqadj_reset (ct, ctinfo); synproxy->tsoff =0 ;this_cpu_inc (snet->stats->conn_reopened); fallthrough;
@@ -1137,7 +1137,7 @@ ipv6_synproxy_hook(void *priv, struct sk_buff *skb,* adjustments, they will get initialized once the connection is * reestablished. */ -nf_ct_seqadj_init (ct, ctinfo,0 ); +nf_ct_seqadj_reset (ct, ctinfo); synproxy->tsoff =0 ;this_cpu_inc (snet->stats->conn_reopened); fallthrough;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 1627/2214 ARM: dts: gemini: Use a level-high interrupt for TVE200
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Linus Walleij <[email protected]>
[ Upstream commit 5bf1bb010712bba28eda926ed453db3cab91381a ]
TVE200's interrupt is configured as rising-edge. On the D-Link DIR-685, this can stop interrupt delivery after the first vertical interrupt, causing vblank and page-flip timeouts and delaying framebuffer console startup.
The vertical interrupt can remain pending after acknowledgment. Use level-high triggering so the pending condition is delivered again without requiring another edge.
Message-ID: <[email protected]>
--- arch/arm/boot/dts/gemini.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/gemini.dtsi +1 -1
@@ -411,7 +411,7 @@ dma-controller@67000000 { display-controller@6a000000 { compatible = "cortina,gemini-tvc", "faraday,tve200"; reg = <0x6a000000 0x1000>; - interrupts = <13 IRQ_TYPE_EDGE_RISING>; + interrupts = <13 IRQ_TYPE_LEVEL_HIGH>; resets = <&syscon GEMINI_RESET_TVC>; clocks = <&syscon GEMINI_CLK_GATE_TVC>, <&syscon GEMINI_CLK_TVC>;
Signature · 1 line
2.53.0