]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.10
authorSasha Levin <sashal@kernel.org>
Wed, 15 Mar 2023 01:48:20 +0000 (21:48 -0400)
committerSasha Levin <sashal@kernel.org>
Wed, 15 Mar 2023 01:48:20 +0000 (21:48 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
12 files changed:
queue-5.10/alpha-fix-r_alpha_literal-reloc-for-large-modules.patch [new file with mode: 0644]
queue-5.10/clk-qcom-mmcc-apq8084-remove-spdm-clocks.patch [new file with mode: 0644]
queue-5.10/macintosh-windfarm-use-unsigned-type-for-1-bit-bitfi.patch [new file with mode: 0644]
queue-5.10/media-ov5640-fix-analogue-gain-control.patch [new file with mode: 0644]
queue-5.10/media-rc-gpio-ir-recv-add-remove-function.patch [new file with mode: 0644]
queue-5.10/mips-fix-a-compilation-issue.patch [new file with mode: 0644]
queue-5.10/pci-add-solidrun-vendor-id.patch [new file with mode: 0644]
queue-5.10/pci-avoid-flr-for-solidrun-snet-dpu-rev-1.patch [new file with mode: 0644]
queue-5.10/powerpc-check-irq-instead-of-irq-no_irq-and-remove-n.patch [new file with mode: 0644]
queue-5.10/powerpc-kcsan-exclude-udelay-to-prevent-recursive-in.patch [new file with mode: 0644]
queue-5.10/scripts-handle-brokenpipeerror-for-python-scripts.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/alpha-fix-r_alpha_literal-reloc-for-large-modules.patch b/queue-5.10/alpha-fix-r_alpha_literal-reloc-for-large-modules.patch
new file mode 100644 (file)
index 0000000..920d40f
--- /dev/null
@@ -0,0 +1,55 @@
+From c4ce211386de5ea03e2a9c9a7e8c5f26f3e9ecbf Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 27 Aug 2022 02:49:39 -0400
+Subject: alpha: fix R_ALPHA_LITERAL reloc for large modules
+
+From: Edward Humes <aurxenon@lunos.org>
+
+[ Upstream commit b6b17a8b3ecd878d98d5472a9023ede9e669ca72 ]
+
+Previously, R_ALPHA_LITERAL relocations would overflow for large kernel
+modules.
+
+This was because the Alpha's apply_relocate_add was relying on the kernel's
+module loader to have sorted the GOT towards the very end of the module as it
+was mapped into memory in order to correctly assign the global pointer. While
+this behavior would mostly work fine for small kernel modules, this approach
+would overflow on kernel modules with large GOT's since the global pointer
+would be very far away from the GOT, and thus, certain entries would be out of
+range.
+
+This patch fixes this by instead using the Tru64 behavior of assigning the
+global pointer to be 32KB away from the start of the GOT. The change made
+in this patch won't work for multi-GOT kernel modules as it makes the
+assumption the module only has one GOT located at the beginning of .got,
+although for the vast majority kernel modules, this should be fine. Of the
+kernel modules that would previously result in a relocation error, none of
+them, even modules like nouveau, have even come close to filling up a single
+GOT, and they've all worked fine under this patch.
+
+Signed-off-by: Edward Humes <aurxenon@lunos.org>
+Signed-off-by: Matt Turner <mattst88@gmail.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/alpha/kernel/module.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c
+index 5b60c248de9ea..cbefa5a773846 100644
+--- a/arch/alpha/kernel/module.c
++++ b/arch/alpha/kernel/module.c
+@@ -146,10 +146,8 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab,
+       base = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr;
+       symtab = (Elf64_Sym *)sechdrs[symindex].sh_addr;
+-      /* The small sections were sorted to the end of the segment.
+-         The following should definitely cover them.  */
+-      gp = (u64)me->core_layout.base + me->core_layout.size - 0x8000;
+       got = sechdrs[me->arch.gotsecindex].sh_addr;
++      gp = got + 0x8000;
+       for (i = 0; i < n; i++) {
+               unsigned long r_sym = ELF64_R_SYM (rela[i].r_info);
+-- 
+2.39.2
+
diff --git a/queue-5.10/clk-qcom-mmcc-apq8084-remove-spdm-clocks.patch b/queue-5.10/clk-qcom-mmcc-apq8084-remove-spdm-clocks.patch
new file mode 100644 (file)
index 0000000..f543203
--- /dev/null
@@ -0,0 +1,315 @@
+From 68a13c891c6e3f22174885520459f88bcfd967c3 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 11 Jan 2023 08:04:00 +0200
+Subject: clk: qcom: mmcc-apq8084: remove spdm clocks
+
+From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+
+[ Upstream commit 7b347f4b677b6d84687e67d82b6b17c6f55ea2b4 ]
+
+SPDM is used for debug/profiling and does not have any other
+functionality. These clocks can safely be removed.
+
+Suggested-by: Stephen Boyd <sboyd@kernel.org>
+Suggested-by: Georgi Djakov <djakov@kernel.org>
+Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
+Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+Signed-off-by: Bjorn Andersson <andersson@kernel.org>
+Link: https://lore.kernel.org/r/20230111060402.1168726-11-dmitry.baryshkov@linaro.org
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/clk/qcom/mmcc-apq8084.c | 271 --------------------------------
+ 1 file changed, 271 deletions(-)
+
+diff --git a/drivers/clk/qcom/mmcc-apq8084.c b/drivers/clk/qcom/mmcc-apq8084.c
+index fbfcf00067394..893e5536f64c7 100644
+--- a/drivers/clk/qcom/mmcc-apq8084.c
++++ b/drivers/clk/qcom/mmcc-apq8084.c
+@@ -2363,262 +2363,6 @@ static struct clk_branch mmss_rbcpr_clk = {
+       },
+ };
+-static struct clk_branch mmss_spdm_ahb_clk = {
+-      .halt_reg = 0x0230,
+-      .clkr = {
+-              .enable_reg = 0x0230,
+-              .enable_mask = BIT(0),
+-              .hw.init = &(struct clk_init_data){
+-                      .name = "mmss_spdm_ahb_clk",
+-                      .parent_names = (const char *[]){
+-                              "mmss_spdm_ahb_div_clk",
+-                      },
+-                      .num_parents = 1,
+-                      .flags = CLK_SET_RATE_PARENT,
+-                      .ops = &clk_branch2_ops,
+-              },
+-      },
+-};
+-
+-static struct clk_branch mmss_spdm_axi_clk = {
+-      .halt_reg = 0x0210,
+-      .clkr = {
+-              .enable_reg = 0x0210,
+-              .enable_mask = BIT(0),
+-              .hw.init = &(struct clk_init_data){
+-                      .name = "mmss_spdm_axi_clk",
+-                      .parent_names = (const char *[]){
+-                              "mmss_spdm_axi_div_clk",
+-                      },
+-                      .num_parents = 1,
+-                      .flags = CLK_SET_RATE_PARENT,
+-                      .ops = &clk_branch2_ops,
+-              },
+-      },
+-};
+-
+-static struct clk_branch mmss_spdm_csi0_clk = {
+-      .halt_reg = 0x023c,
+-      .clkr = {
+-              .enable_reg = 0x023c,
+-              .enable_mask = BIT(0),
+-              .hw.init = &(struct clk_init_data){
+-                      .name = "mmss_spdm_csi0_clk",
+-                      .parent_names = (const char *[]){
+-                              "mmss_spdm_csi0_div_clk",
+-                      },
+-                      .num_parents = 1,
+-                      .flags = CLK_SET_RATE_PARENT,
+-                      .ops = &clk_branch2_ops,
+-              },
+-      },
+-};
+-
+-static struct clk_branch mmss_spdm_gfx3d_clk = {
+-      .halt_reg = 0x022c,
+-      .clkr = {
+-              .enable_reg = 0x022c,
+-              .enable_mask = BIT(0),
+-              .hw.init = &(struct clk_init_data){
+-                      .name = "mmss_spdm_gfx3d_clk",
+-                      .parent_names = (const char *[]){
+-                              "mmss_spdm_gfx3d_div_clk",
+-                      },
+-                      .num_parents = 1,
+-                      .flags = CLK_SET_RATE_PARENT,
+-                      .ops = &clk_branch2_ops,
+-              },
+-      },
+-};
+-
+-static struct clk_branch mmss_spdm_jpeg0_clk = {
+-      .halt_reg = 0x0204,
+-      .clkr = {
+-              .enable_reg = 0x0204,
+-              .enable_mask = BIT(0),
+-              .hw.init = &(struct clk_init_data){
+-                      .name = "mmss_spdm_jpeg0_clk",
+-                      .parent_names = (const char *[]){
+-                              "mmss_spdm_jpeg0_div_clk",
+-                      },
+-                      .num_parents = 1,
+-                      .flags = CLK_SET_RATE_PARENT,
+-                      .ops = &clk_branch2_ops,
+-              },
+-      },
+-};
+-
+-static struct clk_branch mmss_spdm_jpeg1_clk = {
+-      .halt_reg = 0x0208,
+-      .clkr = {
+-              .enable_reg = 0x0208,
+-              .enable_mask = BIT(0),
+-              .hw.init = &(struct clk_init_data){
+-                      .name = "mmss_spdm_jpeg1_clk",
+-                      .parent_names = (const char *[]){
+-                              "mmss_spdm_jpeg1_div_clk",
+-                      },
+-                      .num_parents = 1,
+-                      .flags = CLK_SET_RATE_PARENT,
+-                      .ops = &clk_branch2_ops,
+-              },
+-      },
+-};
+-
+-static struct clk_branch mmss_spdm_jpeg2_clk = {
+-      .halt_reg = 0x0224,
+-      .clkr = {
+-              .enable_reg = 0x0224,
+-              .enable_mask = BIT(0),
+-              .hw.init = &(struct clk_init_data){
+-                      .name = "mmss_spdm_jpeg2_clk",
+-                      .parent_names = (const char *[]){
+-                              "mmss_spdm_jpeg2_div_clk",
+-                      },
+-                      .num_parents = 1,
+-                      .flags = CLK_SET_RATE_PARENT,
+-                      .ops = &clk_branch2_ops,
+-              },
+-      },
+-};
+-
+-static struct clk_branch mmss_spdm_mdp_clk = {
+-      .halt_reg = 0x020c,
+-      .clkr = {
+-              .enable_reg = 0x020c,
+-              .enable_mask = BIT(0),
+-              .hw.init = &(struct clk_init_data){
+-                      .name = "mmss_spdm_mdp_clk",
+-                      .parent_names = (const char *[]){
+-                              "mmss_spdm_mdp_div_clk",
+-                      },
+-                      .num_parents = 1,
+-                      .flags = CLK_SET_RATE_PARENT,
+-                      .ops = &clk_branch2_ops,
+-              },
+-      },
+-};
+-
+-static struct clk_branch mmss_spdm_pclk0_clk = {
+-      .halt_reg = 0x0234,
+-      .clkr = {
+-              .enable_reg = 0x0234,
+-              .enable_mask = BIT(0),
+-              .hw.init = &(struct clk_init_data){
+-                      .name = "mmss_spdm_pclk0_clk",
+-                      .parent_names = (const char *[]){
+-                              "mmss_spdm_pclk0_div_clk",
+-                      },
+-                      .num_parents = 1,
+-                      .flags = CLK_SET_RATE_PARENT,
+-                      .ops = &clk_branch2_ops,
+-              },
+-      },
+-};
+-
+-static struct clk_branch mmss_spdm_pclk1_clk = {
+-      .halt_reg = 0x0228,
+-      .clkr = {
+-              .enable_reg = 0x0228,
+-              .enable_mask = BIT(0),
+-              .hw.init = &(struct clk_init_data){
+-                      .name = "mmss_spdm_pclk1_clk",
+-                      .parent_names = (const char *[]){
+-                              "mmss_spdm_pclk1_div_clk",
+-                      },
+-                      .num_parents = 1,
+-                      .flags = CLK_SET_RATE_PARENT,
+-                      .ops = &clk_branch2_ops,
+-              },
+-      },
+-};
+-
+-static struct clk_branch mmss_spdm_vcodec0_clk = {
+-      .halt_reg = 0x0214,
+-      .clkr = {
+-              .enable_reg = 0x0214,
+-              .enable_mask = BIT(0),
+-              .hw.init = &(struct clk_init_data){
+-                      .name = "mmss_spdm_vcodec0_clk",
+-                      .parent_names = (const char *[]){
+-                              "mmss_spdm_vcodec0_div_clk",
+-                      },
+-                      .num_parents = 1,
+-                      .flags = CLK_SET_RATE_PARENT,
+-                      .ops = &clk_branch2_ops,
+-              },
+-      },
+-};
+-
+-static struct clk_branch mmss_spdm_vfe0_clk = {
+-      .halt_reg = 0x0218,
+-      .clkr = {
+-              .enable_reg = 0x0218,
+-              .enable_mask = BIT(0),
+-              .hw.init = &(struct clk_init_data){
+-                      .name = "mmss_spdm_vfe0_clk",
+-                      .parent_names = (const char *[]){
+-                              "mmss_spdm_vfe0_div_clk",
+-                      },
+-                      .num_parents = 1,
+-                      .flags = CLK_SET_RATE_PARENT,
+-                      .ops = &clk_branch2_ops,
+-              },
+-      },
+-};
+-
+-static struct clk_branch mmss_spdm_vfe1_clk = {
+-      .halt_reg = 0x021c,
+-      .clkr = {
+-              .enable_reg = 0x021c,
+-              .enable_mask = BIT(0),
+-              .hw.init = &(struct clk_init_data){
+-                      .name = "mmss_spdm_vfe1_clk",
+-                      .parent_names = (const char *[]){
+-                              "mmss_spdm_vfe1_div_clk",
+-                      },
+-                      .num_parents = 1,
+-                      .flags = CLK_SET_RATE_PARENT,
+-                      .ops = &clk_branch2_ops,
+-              },
+-      },
+-};
+-
+-static struct clk_branch mmss_spdm_rm_axi_clk = {
+-      .halt_reg = 0x0304,
+-      .clkr = {
+-              .enable_reg = 0x0304,
+-              .enable_mask = BIT(0),
+-              .hw.init = &(struct clk_init_data){
+-                      .name = "mmss_spdm_rm_axi_clk",
+-                      .parent_names = (const char *[]){
+-                              "mmss_axi_clk_src",
+-                      },
+-                      .num_parents = 1,
+-                      .flags = CLK_SET_RATE_PARENT,
+-                      .ops = &clk_branch2_ops,
+-              },
+-      },
+-};
+-
+-static struct clk_branch mmss_spdm_rm_ocmemnoc_clk = {
+-      .halt_reg = 0x0308,
+-      .clkr = {
+-              .enable_reg = 0x0308,
+-              .enable_mask = BIT(0),
+-              .hw.init = &(struct clk_init_data){
+-                      .name = "mmss_spdm_rm_ocmemnoc_clk",
+-                      .parent_names = (const char *[]){
+-                              "ocmemnoc_clk_src",
+-                      },
+-                      .num_parents = 1,
+-                      .flags = CLK_SET_RATE_PARENT,
+-                      .ops = &clk_branch2_ops,
+-              },
+-      },
+-};
+-
+-
+ static struct clk_branch mmss_misc_ahb_clk = {
+       .halt_reg = 0x502c,
+       .clkr = {
+@@ -3251,21 +2995,6 @@ static struct clk_regmap *mmcc_apq8084_clocks[] = {
+       [MDSS_VSYNC_CLK] = &mdss_vsync_clk.clkr,
+       [MMSS_RBCPR_AHB_CLK] = &mmss_rbcpr_ahb_clk.clkr,
+       [MMSS_RBCPR_CLK] = &mmss_rbcpr_clk.clkr,
+-      [MMSS_SPDM_AHB_CLK] = &mmss_spdm_ahb_clk.clkr,
+-      [MMSS_SPDM_AXI_CLK] = &mmss_spdm_axi_clk.clkr,
+-      [MMSS_SPDM_CSI0_CLK] = &mmss_spdm_csi0_clk.clkr,
+-      [MMSS_SPDM_GFX3D_CLK] = &mmss_spdm_gfx3d_clk.clkr,
+-      [MMSS_SPDM_JPEG0_CLK] = &mmss_spdm_jpeg0_clk.clkr,
+-      [MMSS_SPDM_JPEG1_CLK] = &mmss_spdm_jpeg1_clk.clkr,
+-      [MMSS_SPDM_JPEG2_CLK] = &mmss_spdm_jpeg2_clk.clkr,
+-      [MMSS_SPDM_MDP_CLK] = &mmss_spdm_mdp_clk.clkr,
+-      [MMSS_SPDM_PCLK0_CLK] = &mmss_spdm_pclk0_clk.clkr,
+-      [MMSS_SPDM_PCLK1_CLK] = &mmss_spdm_pclk1_clk.clkr,
+-      [MMSS_SPDM_VCODEC0_CLK] = &mmss_spdm_vcodec0_clk.clkr,
+-      [MMSS_SPDM_VFE0_CLK] = &mmss_spdm_vfe0_clk.clkr,
+-      [MMSS_SPDM_VFE1_CLK] = &mmss_spdm_vfe1_clk.clkr,
+-      [MMSS_SPDM_RM_AXI_CLK] = &mmss_spdm_rm_axi_clk.clkr,
+-      [MMSS_SPDM_RM_OCMEMNOC_CLK] = &mmss_spdm_rm_ocmemnoc_clk.clkr,
+       [MMSS_MISC_AHB_CLK] = &mmss_misc_ahb_clk.clkr,
+       [MMSS_MMSSNOC_AHB_CLK] = &mmss_mmssnoc_ahb_clk.clkr,
+       [MMSS_MMSSNOC_BTO_AHB_CLK] = &mmss_mmssnoc_bto_ahb_clk.clkr,
+-- 
+2.39.2
+
diff --git a/queue-5.10/macintosh-windfarm-use-unsigned-type-for-1-bit-bitfi.patch b/queue-5.10/macintosh-windfarm-use-unsigned-type-for-1-bit-bitfi.patch
new file mode 100644 (file)
index 0000000..2cf26a1
--- /dev/null
@@ -0,0 +1,68 @@
+From bfa319c770d643d5f2a21151b01ceb63b7f8d2b6 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 15 Feb 2023 10:12:12 -0700
+Subject: macintosh: windfarm: Use unsigned type for 1-bit bitfields
+
+From: Nathan Chancellor <nathan@kernel.org>
+
+[ Upstream commit 748ea32d2dbd813d3bd958117bde5191182f909a ]
+
+Clang warns:
+
+  drivers/macintosh/windfarm_lm75_sensor.c:63:14: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
+                  lm->inited = 1;
+                             ^ ~
+
+  drivers/macintosh/windfarm_smu_sensors.c:356:19: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
+                  pow->fake_volts = 1;
+                                  ^ ~
+  drivers/macintosh/windfarm_smu_sensors.c:368:18: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
+                  pow->quadratic = 1;
+                                 ^ ~
+
+There is no bug here since no code checks the actual value of these
+fields, just whether or not they are zero (boolean context), but this
+can be easily fixed by switching to an unsigned type.
+
+Signed-off-by: Nathan Chancellor <nathan@kernel.org>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://lore.kernel.org/r/20230215-windfarm-wsingle-bit-bitfield-constant-conversion-v1-1-26415072e855@kernel.org
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/macintosh/windfarm_lm75_sensor.c | 4 ++--
+ drivers/macintosh/windfarm_smu_sensors.c | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c
+index 29f48c2028b6d..e90ad1b78e936 100644
+--- a/drivers/macintosh/windfarm_lm75_sensor.c
++++ b/drivers/macintosh/windfarm_lm75_sensor.c
+@@ -34,8 +34,8 @@
+ #endif
+ struct wf_lm75_sensor {
+-      int                     ds1775 : 1;
+-      int                     inited : 1;
++      unsigned int            ds1775 : 1;
++      unsigned int            inited : 1;
+       struct i2c_client       *i2c;
+       struct wf_sensor        sens;
+ };
+diff --git a/drivers/macintosh/windfarm_smu_sensors.c b/drivers/macintosh/windfarm_smu_sensors.c
+index c8706cfb83fd8..714c1e14074ed 100644
+--- a/drivers/macintosh/windfarm_smu_sensors.c
++++ b/drivers/macintosh/windfarm_smu_sensors.c
+@@ -273,8 +273,8 @@ struct smu_cpu_power_sensor {
+       struct list_head        link;
+       struct wf_sensor        *volts;
+       struct wf_sensor        *amps;
+-      int                     fake_volts : 1;
+-      int                     quadratic : 1;
++      unsigned int            fake_volts : 1;
++      unsigned int            quadratic : 1;
+       struct wf_sensor        sens;
+ };
+ #define to_smu_cpu_power(c) container_of(c, struct smu_cpu_power_sensor, sens)
+-- 
+2.39.2
+
diff --git a/queue-5.10/media-ov5640-fix-analogue-gain-control.patch b/queue-5.10/media-ov5640-fix-analogue-gain-control.patch
new file mode 100644 (file)
index 0000000..c8dc0bc
--- /dev/null
@@ -0,0 +1,93 @@
+From 5309815bc57e3dc9470905dce5e0d229b890828b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 28 Nov 2022 09:02:01 +0100
+Subject: media: ov5640: Fix analogue gain control
+
+From: Paul Elder <paul.elder@ideasonboard.com>
+
+[ Upstream commit afa4805799c1d332980ad23339fdb07b5e0cf7e0 ]
+
+Gain control is badly documented in publicly available (including
+leaked) documentation.
+
+There is an AGC pre-gain in register 0x3a13, expressed as a 6-bit value
+(plus an enable bit in bit 6). The driver hardcodes it to 0x43, which
+one application note states is equal to x1.047. The documentation also
+states that 0x40 is equel to x1.000. The pre-gain thus seems to be
+expressed as in 1/64 increments, and thus ranges from x1.00 to x1.984.
+What the pre-gain does is however unspecified.
+
+There is then an AGC gain limit, in registers 0x3a18 and 0x3a19,
+expressed as a 10-bit "real gain format" value. One application note
+sets it to 0x00f8 and states it is equal to x15.5, so it appears to be
+expressed in 1/16 increments, up to x63.9375.
+
+The manual gain is stored in registers 0x350a and 0x350b, also as a
+10-bit "real gain format" value. It is documented in the application
+note as a Q6.4 values, up to x63.9375.
+
+One version of the datasheet indicates that the sensor supports a
+digital gain:
+
+  The OV5640 supports 1/2/4 digital gain. Normally, the gain is
+  controlled automatically by the automatic gain control (AGC) block.
+
+It isn't clear how that would be controlled manually.
+
+There appears to be no indication regarding whether the gain controlled
+through registers 0x350a and 0x350b is an analogue gain only or also
+includes digital gain. The words "real gain" don't necessarily mean
+"combined analogue and digital gains". Some OmniVision sensors (such as
+the OV8858) are documented as supoprting different formats for the gain
+values, selectable through a register bit, and they are called "real
+gain format" and "sensor gain format". For that sensor, we have (one of)
+the gain registers documented as
+
+  0x3503[2]=0, gain[7:0] is real gain format, where low 4 bits are
+  fraction bits, for example, 0x10 is 1x gain, 0x28 is 2.5x gain
+
+  If 0x3503[2]=1, gain[7:0] is sensor gain format, gain[7:4] is coarse
+  gain, 00000: 1x, 00001: 2x, 00011: 4x, 00111: 8x, gain[7] is 1,
+  gain[3:0] is fine gain. For example, 0x10 is 1x gain, 0x30 is 2x gain,
+  0x70 is 4x gain
+
+(The second part of the text makes little sense)
+
+"Real gain" may thus refer to the combination of the coarse and fine
+analogue gains as a single value.
+
+The OV5640 0x350a and 0x350b registers thus appear to control analogue
+gain. The driver incorrectly uses V4L2_CID_GAIN as V4L2 has a specific
+control for analogue gain, V4L2_CID_ANALOGUE_GAIN. Use it.
+
+If registers 0x350a and 0x350b are later found to control digital gain
+as well, the driver could then restrict the range of the analogue gain
+control value to lower than x64 and add a separate digital gain control.
+
+Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
+Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
+Reviewed-by: Jai Luthra <j-luthra@ti.com>
+Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/media/i2c/ov5640.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
+index 8f0812e859012..92a5f9aff9b53 100644
+--- a/drivers/media/i2c/ov5640.c
++++ b/drivers/media/i2c/ov5640.c
+@@ -2748,7 +2748,7 @@ static int ov5640_init_controls(struct ov5640_dev *sensor)
+       /* Auto/manual gain */
+       ctrls->auto_gain = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_AUTOGAIN,
+                                            0, 1, 1, 1);
+-      ctrls->gain = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_GAIN,
++      ctrls->gain = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_ANALOGUE_GAIN,
+                                       0, 1023, 1, 0);
+       ctrls->saturation = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_SATURATION,
+-- 
+2.39.2
+
diff --git a/queue-5.10/media-rc-gpio-ir-recv-add-remove-function.patch b/queue-5.10/media-rc-gpio-ir-recv-add-remove-function.patch
new file mode 100644 (file)
index 0000000..ac245d2
--- /dev/null
@@ -0,0 +1,142 @@
+From c463206ef49e6a577e3096836cd1a5ef0904d660 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 11 Jan 2023 10:39:21 +0100
+Subject: media: rc: gpio-ir-recv: add remove function
+
+From: Li Jun <jun.li@nxp.com>
+
+[ Upstream commit 30040818b338b8ebc956ce0ebd198f8d593586a6 ]
+
+In case runtime PM is enabled, do runtime PM clean up to remove
+cpu latency qos request, otherwise driver removal may have below
+kernel dump:
+
+[   19.463299] Unable to handle kernel NULL pointer dereference at
+virtual address 0000000000000048
+[   19.472161] Mem abort info:
+[   19.474985]   ESR = 0x0000000096000004
+[   19.478754]   EC = 0x25: DABT (current EL), IL = 32 bits
+[   19.484081]   SET = 0, FnV = 0
+[   19.487149]   EA = 0, S1PTW = 0
+[   19.490361]   FSC = 0x04: level 0 translation fault
+[   19.495256] Data abort info:
+[   19.498149]   ISV = 0, ISS = 0x00000004
+[   19.501997]   CM = 0, WnR = 0
+[   19.504977] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000049f81000
+[   19.511432] [0000000000000048] pgd=0000000000000000,
+p4d=0000000000000000
+[   19.518245] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
+[   19.524520] Modules linked in: gpio_ir_recv(+) rc_core [last
+unloaded: rc_core]
+[   19.531845] CPU: 0 PID: 445 Comm: insmod Not tainted
+6.2.0-rc1-00028-g2c397a46d47c #72
+[   19.531854] Hardware name: FSL i.MX8MM EVK board (DT)
+[   19.531859] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS
+BTYPE=--)
+[   19.551777] pc : cpu_latency_qos_remove_request+0x20/0x110
+[   19.557277] lr : gpio_ir_recv_runtime_suspend+0x18/0x30
+[gpio_ir_recv]
+[   19.557294] sp : ffff800008ce3740
+[   19.557297] x29: ffff800008ce3740 x28: 0000000000000000 x27:
+ffff800008ce3d50
+[   19.574270] x26: ffffc7e3e9cea100 x25: 00000000000f4240 x24:
+ffffc7e3f9ef0e30
+[   19.574284] x23: 0000000000000000 x22: ffff0061803820f4 x21:
+0000000000000008
+[   19.574296] x20: ffffc7e3fa75df30 x19: 0000000000000020 x18:
+ffffffffffffffff
+[   19.588570] x17: 0000000000000000 x16: ffffc7e3f9efab70 x15:
+ffffffffffffffff
+[   19.595712] x14: ffff800008ce37b8 x13: ffff800008ce37aa x12:
+0000000000000001
+[   19.602853] x11: 0000000000000001 x10: ffffcbe3ec0dff87 x9 :
+0000000000000008
+[   19.609991] x8 : 0101010101010101 x7 : 0000000000000000 x6 :
+000000000f0bfe9f
+[   19.624261] x5 : 00ffffffffffffff x4 : 0025ab8e00000000 x3 :
+ffff006180382010
+[   19.631405] x2 : ffffc7e3e9ce8030 x1 : ffffc7e3fc3eb810 x0 :
+0000000000000020
+[   19.638548] Call trace:
+[   19.640995]  cpu_latency_qos_remove_request+0x20/0x110
+[   19.646142]  gpio_ir_recv_runtime_suspend+0x18/0x30 [gpio_ir_recv]
+[   19.652339]  pm_generic_runtime_suspend+0x2c/0x44
+[   19.657055]  __rpm_callback+0x48/0x1dc
+[   19.660807]  rpm_callback+0x6c/0x80
+[   19.664301]  rpm_suspend+0x10c/0x640
+[   19.667880]  rpm_idle+0x250/0x2d0
+[   19.671198]  update_autosuspend+0x38/0xe0
+[   19.675213]  pm_runtime_set_autosuspend_delay+0x40/0x60
+[   19.680442]  gpio_ir_recv_probe+0x1b4/0x21c [gpio_ir_recv]
+[   19.685941]  platform_probe+0x68/0xc0
+[   19.689610]  really_probe+0xc0/0x3dc
+[   19.693189]  __driver_probe_device+0x7c/0x190
+[   19.697550]  driver_probe_device+0x3c/0x110
+[   19.701739]  __driver_attach+0xf4/0x200
+[   19.705578]  bus_for_each_dev+0x70/0xd0
+[   19.709417]  driver_attach+0x24/0x30
+[   19.712998]  bus_add_driver+0x17c/0x240
+[   19.716834]  driver_register+0x78/0x130
+[   19.720676]  __platform_driver_register+0x28/0x34
+[   19.725386]  gpio_ir_recv_driver_init+0x20/0x1000 [gpio_ir_recv]
+[   19.731404]  do_one_initcall+0x44/0x2ac
+[   19.735243]  do_init_module+0x48/0x1d0
+[   19.739003]  load_module+0x19fc/0x2034
+[   19.742759]  __do_sys_finit_module+0xac/0x12c
+[   19.747124]  __arm64_sys_finit_module+0x20/0x30
+[   19.751664]  invoke_syscall+0x48/0x114
+[   19.755420]  el0_svc_common.constprop.0+0xcc/0xec
+[   19.760132]  do_el0_svc+0x38/0xb0
+[   19.763456]  el0_svc+0x2c/0x84
+[   19.766516]  el0t_64_sync_handler+0xf4/0x120
+[   19.770789]  el0t_64_sync+0x190/0x194
+[   19.774460] Code: 910003fd a90153f3 aa0003f3 91204021 (f9401400)
+[   19.780556] ---[ end trace 0000000000000000 ]---
+
+Signed-off-by: Li Jun <jun.li@nxp.com>
+Signed-off-by: Sean Young <sean@mess.org>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/media/rc/gpio-ir-recv.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c
+index 22e524b69806a..a56c844d7f816 100644
+--- a/drivers/media/rc/gpio-ir-recv.c
++++ b/drivers/media/rc/gpio-ir-recv.c
+@@ -130,6 +130,23 @@ static int gpio_ir_recv_probe(struct platform_device *pdev)
+                               "gpio-ir-recv-irq", gpio_dev);
+ }
++static int gpio_ir_recv_remove(struct platform_device *pdev)
++{
++      struct gpio_rc_dev *gpio_dev = platform_get_drvdata(pdev);
++      struct device *pmdev = gpio_dev->pmdev;
++
++      if (pmdev) {
++              pm_runtime_get_sync(pmdev);
++              cpu_latency_qos_remove_request(&gpio_dev->qos);
++
++              pm_runtime_disable(pmdev);
++              pm_runtime_put_noidle(pmdev);
++              pm_runtime_set_suspended(pmdev);
++      }
++
++      return 0;
++}
++
+ #ifdef CONFIG_PM
+ static int gpio_ir_recv_suspend(struct device *dev)
+ {
+@@ -189,6 +206,7 @@ MODULE_DEVICE_TABLE(of, gpio_ir_recv_of_match);
+ static struct platform_driver gpio_ir_recv_driver = {
+       .probe  = gpio_ir_recv_probe,
++      .remove = gpio_ir_recv_remove,
+       .driver = {
+               .name   = KBUILD_MODNAME,
+               .of_match_table = of_match_ptr(gpio_ir_recv_of_match),
+-- 
+2.39.2
+
diff --git a/queue-5.10/mips-fix-a-compilation-issue.patch b/queue-5.10/mips-fix-a-compilation-issue.patch
new file mode 100644 (file)
index 0000000..c2bcf59
--- /dev/null
@@ -0,0 +1,41 @@
+From ff94cb195f426c228109718b410e49c4565e02a9 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 18 Jan 2023 16:59:12 +0800
+Subject: MIPS: Fix a compilation issue
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: xurui <xurui@kylinos.cn>
+
+[ Upstream commit 109d587a4b4d7ccca2200ab1f808f43ae23e2585 ]
+
+arch/mips/include/asm/mach-rc32434/pci.h:377:
+cc1: error: result of ‘-117440512 << 16’ requires 44 bits to represent, but ‘int’ only has 32 bits [-Werror=shift-overflow=]
+
+All bits in KORINA_STAT are already at the correct position, so there is
+no addtional shift needed.
+
+Signed-off-by: xurui <xurui@kylinos.cn>
+Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/mips/include/asm/mach-rc32434/pci.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/arch/mips/include/asm/mach-rc32434/pci.h b/arch/mips/include/asm/mach-rc32434/pci.h
+index 9a6eefd127571..3eb767c8a4eec 100644
+--- a/arch/mips/include/asm/mach-rc32434/pci.h
++++ b/arch/mips/include/asm/mach-rc32434/pci.h
+@@ -374,7 +374,7 @@ struct pci_msu {
+                                PCI_CFG04_STAT_SSE | \
+                                PCI_CFG04_STAT_PE)
+-#define KORINA_CNFG1          ((KORINA_STAT<<16)|KORINA_CMD)
++#define KORINA_CNFG1          (KORINA_STAT | KORINA_CMD)
+ #define KORINA_REVID          0
+ #define KORINA_CLASS_CODE     0
+-- 
+2.39.2
+
diff --git a/queue-5.10/pci-add-solidrun-vendor-id.patch b/queue-5.10/pci-add-solidrun-vendor-id.patch
new file mode 100644 (file)
index 0000000..c03f187
--- /dev/null
@@ -0,0 +1,39 @@
+From b4abd7be98000fb945be612fad6aa0ee62913807 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 10 Jan 2023 18:56:36 +0200
+Subject: PCI: Add SolidRun vendor ID
+
+From: Alvaro Karsz <alvaro.karsz@solid-run.com>
+
+[ Upstream commit db6c4dee4c104f50ed163af71c53bfdb878a8318 ]
+
+Add SolidRun vendor ID to pci_ids.h
+
+The vendor ID is used in 2 different source files, the SNET vDPA driver
+and PCI quirks.
+
+Signed-off-by: Alvaro Karsz <alvaro.karsz@solid-run.com>
+Acked-by: Bjorn Helgaas <bhelgaas@google.com>
+Message-Id: <20230110165638.123745-2-alvaro.karsz@solid-run.com>
+Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/linux/pci_ids.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
+index 2e1935917c241..4b34a5c125999 100644
+--- a/include/linux/pci_ids.h
++++ b/include/linux/pci_ids.h
+@@ -3115,6 +3115,8 @@
+ #define PCI_VENDOR_ID_3COM_2          0xa727
++#define PCI_VENDOR_ID_SOLIDRUN                0xd063
++
+ #define PCI_VENDOR_ID_DIGIUM          0xd161
+ #define PCI_DEVICE_ID_DIGIUM_HFC4S    0xb410
+-- 
+2.39.2
+
diff --git a/queue-5.10/pci-avoid-flr-for-solidrun-snet-dpu-rev-1.patch b/queue-5.10/pci-avoid-flr-for-solidrun-snet-dpu-rev-1.patch
new file mode 100644 (file)
index 0000000..66ce826
--- /dev/null
@@ -0,0 +1,48 @@
+From c010f0ad86a53a87e6ef959d807ac2924fa28491 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 10 Jan 2023 18:56:37 +0200
+Subject: PCI: Avoid FLR for SolidRun SNET DPU rev 1
+
+From: Alvaro Karsz <alvaro.karsz@solid-run.com>
+
+[ Upstream commit d089d69cc1f824936eeaa4fa172f8fa1a0949eaa ]
+
+This patch fixes a FLR bug on the SNET DPU rev 1 by setting the
+PCI_DEV_FLAGS_NO_FLR_RESET flag.
+
+As there is a quirk to avoid FLR (quirk_no_flr), I added a new quirk
+to check the rev ID before calling to quirk_no_flr.
+
+Without this patch, a SNET DPU rev 1 may hang when FLR is applied.
+
+Signed-off-by: Alvaro Karsz <alvaro.karsz@solid-run.com>
+Acked-by: Bjorn Helgaas <bhelgaas@google.com>
+Message-Id: <20230110165638.123745-3-alvaro.karsz@solid-run.com>
+Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/pci/quirks.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
+index c1ebd5e12b06e..3c7d7f094718f 100644
+--- a/drivers/pci/quirks.c
++++ b/drivers/pci/quirks.c
+@@ -5328,6 +5328,14 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x7901, quirk_no_flr);
+ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1502, quirk_no_flr);
+ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1503, quirk_no_flr);
++/* FLR may cause the SolidRun SNET DPU (rev 0x1) to hang */
++static void quirk_no_flr_snet(struct pci_dev *dev)
++{
++      if (dev->revision == 0x1)
++              quirk_no_flr(dev);
++}
++DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SOLIDRUN, 0x1000, quirk_no_flr_snet);
++
+ static void quirk_no_ext_tags(struct pci_dev *pdev)
+ {
+       struct pci_host_bridge *bridge = pci_find_host_bridge(pdev->bus);
+-- 
+2.39.2
+
diff --git a/queue-5.10/powerpc-check-irq-instead-of-irq-no_irq-and-remove-n.patch b/queue-5.10/powerpc-check-irq-instead-of-irq-no_irq-and-remove-n.patch
new file mode 100644 (file)
index 0000000..f298c8d
--- /dev/null
@@ -0,0 +1,72 @@
+From f0ccf25438430cadcd51d6d50e297ed09bf216eb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 23 Jan 2023 13:26:46 +0100
+Subject: powerpc: Check !irq instead of irq == NO_IRQ and remove NO_IRQ
+
+From: Christophe Leroy <christophe.leroy@csgroup.eu>
+
+[ Upstream commit bab537805a10bdbf55b31324ba4a9599e0651e5e ]
+
+NO_IRQ is a relic from the old days. It is not used anymore in core
+functions. By the way, function irq_of_parse_and_map() returns value 0
+on error.
+
+In some drivers, NO_IRQ is erroneously used to check the return of
+irq_of_parse_and_map().
+
+It is not a real bug today because the only architectures using the
+drivers being fixed by this patch define NO_IRQ as 0, but there are
+architectures which define NO_IRQ as -1. If one day those
+architectures start using the non fixed drivers, there will be a
+problem.
+
+Long time ago Linus advocated for not using NO_IRQ, see
+https://lore.kernel.org/all/Pine.LNX.4.64.0511211150040.13959@g5.osdl.org
+
+He re-iterated the same view recently in
+https://lore.kernel.org/all/CAHk-=wg2Pkb9kbfbstbB91AJA2SF6cySbsgHG-iQMq56j3VTcA@mail.gmail.com
+
+So test !irq instead of tesing irq == NO_IRQ.
+
+All other usage of NO_IRQ for powerpc were removed in previous cycles so
+the time has come to remove NO_IRQ completely for powerpc.
+
+Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://lore.kernel.org/r/4b8d4f96140af01dec3a3330924dda8b2451c316.1674476798.git.christophe.leroy@csgroup.eu
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/powerpc/include/asm/irq.h    | 3 ---
+ arch/powerpc/platforms/44x/fsp2.c | 2 +-
+ 2 files changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h
+index 4f983ca4030a4..4d5e68e6d3b6d 100644
+--- a/arch/powerpc/include/asm/irq.h
++++ b/arch/powerpc/include/asm/irq.h
+@@ -17,9 +17,6 @@
+ extern atomic_t ppc_n_lost_interrupts;
+-/* This number is used when no interrupt has been assigned */
+-#define NO_IRQ                        (0)
+-
+ /* Total number of virq in the platform */
+ #define NR_IRQS               CONFIG_NR_IRQS
+diff --git a/arch/powerpc/platforms/44x/fsp2.c b/arch/powerpc/platforms/44x/fsp2.c
+index 823397c802def..f8bbe05d9ef29 100644
+--- a/arch/powerpc/platforms/44x/fsp2.c
++++ b/arch/powerpc/platforms/44x/fsp2.c
+@@ -205,7 +205,7 @@ static void node_irq_request(const char *compat, irq_handler_t errirq_handler)
+       for_each_compatible_node(np, NULL, compat) {
+               irq = irq_of_parse_and_map(np, 0);
+-              if (irq == NO_IRQ) {
++              if (!irq) {
+                       pr_err("device tree node %pOFn is missing a interrupt",
+                             np);
+                       of_node_put(np);
+-- 
+2.39.2
+
diff --git a/queue-5.10/powerpc-kcsan-exclude-udelay-to-prevent-recursive-in.patch b/queue-5.10/powerpc-kcsan-exclude-udelay-to-prevent-recursive-in.patch
new file mode 100644 (file)
index 0000000..36743ff
--- /dev/null
@@ -0,0 +1,49 @@
+From 70e1c31491e5f1d4c901b4f0031f454172b97b3e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 6 Feb 2023 13:17:58 +1100
+Subject: powerpc/kcsan: Exclude udelay to prevent recursive instrumentation
+
+From: Rohan McLure <rmclure@linux.ibm.com>
+
+[ Upstream commit 2a7ce82dc46c591c9244057d89a6591c9639b9b9 ]
+
+In order for KCSAN to increase its likelihood of observing a data race,
+it sets a watchpoint on memory accesses and stalls, allowing for
+detection of conflicting accesses by other kernel threads or interrupts.
+
+Stalls are implemented by injecting a call to udelay in instrumented code.
+To prevent recursive instrumentation, exclude udelay from being instrumented.
+
+Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Link: https://lore.kernel.org/r/20230206021801.105268-3-rmclure@linux.ibm.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/powerpc/kernel/time.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
+index 1d20f0f77a920..ba9b54d35f570 100644
+--- a/arch/powerpc/kernel/time.c
++++ b/arch/powerpc/kernel/time.c
+@@ -436,7 +436,7 @@ void vtime_flush(struct task_struct *tsk)
+ #define calc_cputime_factors()
+ #endif
+-void __delay(unsigned long loops)
++void __no_kcsan __delay(unsigned long loops)
+ {
+       unsigned long start;
+@@ -457,7 +457,7 @@ void __delay(unsigned long loops)
+ }
+ EXPORT_SYMBOL(__delay);
+-void udelay(unsigned long usecs)
++void __no_kcsan udelay(unsigned long usecs)
+ {
+       __delay(tb_ticks_per_usec * usecs);
+ }
+-- 
+2.39.2
+
diff --git a/queue-5.10/scripts-handle-brokenpipeerror-for-python-scripts.patch b/queue-5.10/scripts-handle-brokenpipeerror-for-python-scripts.patch
new file mode 100644 (file)
index 0000000..146c6c6
--- /dev/null
@@ -0,0 +1,196 @@
+From e37da4ac1fe802636048e09c67fe81663c6701ef Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 12 Jan 2023 11:30:06 +0900
+Subject: scripts: handle BrokenPipeError for python scripts
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Masahiro Yamada <masahiroy@kernel.org>
+
+[ Upstream commit 87c7ee67deb7fce9951a5f9d80641138694aad17 ]
+
+In the follow-up of commit fb3041d61f68 ("kbuild: fix SIGPIPE error
+message for AR=gcc-ar and AR=llvm-ar"), Kees Cook pointed out that
+tools should _not_ catch their own SIGPIPEs [1] [2].
+
+Based on his feedback, LLVM was fixed [3].
+
+However, Python's default behavior is to show noisy bracktrace when
+SIGPIPE is sent. So, scripts written in Python are basically in the
+same situation as the buggy llvm tools.
+
+Example:
+
+  $ make -s allnoconfig
+  $ make -s allmodconfig
+  $ scripts/diffconfig .config.old .config | head -n1
+  -ALIX n
+  Traceback (most recent call last):
+    File "/home/masahiro/linux/scripts/diffconfig", line 132, in <module>
+      main()
+    File "/home/masahiro/linux/scripts/diffconfig", line 130, in main
+      print_config("+", config, None, b[config])
+    File "/home/masahiro/linux/scripts/diffconfig", line 64, in print_config
+      print("+%s %s" % (config, new_value))
+  BrokenPipeError: [Errno 32] Broken pipe
+
+Python documentation [4] notes how to make scripts die immediately and
+silently:
+
+  """
+  Piping output of your program to tools like head(1) will cause a
+  SIGPIPE signal to be sent to your process when the receiver of its
+  standard output closes early. This results in an exception like
+  BrokenPipeError: [Errno 32] Broken pipe. To handle this case,
+  wrap your entry point to catch this exception as follows:
+
+    import os
+    import sys
+
+    def main():
+        try:
+            # simulate large output (your code replaces this loop)
+            for x in range(10000):
+                print("y")
+            # flush output here to force SIGPIPE to be triggered
+            # while inside this try block.
+            sys.stdout.flush()
+        except BrokenPipeError:
+            # Python flushes standard streams on exit; redirect remaining output
+            # to devnull to avoid another BrokenPipeError at shutdown
+            devnull = os.open(os.devnull, os.O_WRONLY)
+            os.dup2(devnull, sys.stdout.fileno())
+            sys.exit(1)  # Python exits with error code 1 on EPIPE
+
+    if __name__ == '__main__':
+        main()
+
+  Do not set SIGPIPE’s disposition to SIG_DFL in order to avoid
+  BrokenPipeError. Doing that would cause your program to exit
+  unexpectedly whenever any socket connection is interrupted while
+  your program is still writing to it.
+  """
+
+Currently, tools/perf/scripts/python/intel-pt-events.py seems to be the
+only script that fixes the issue that way.
+
+tools/perf/scripts/python/compaction-times.py uses another approach
+signal.signal(signal.SIGPIPE, signal.SIG_DFL) but the Python
+documentation clearly says "Don't do it".
+
+I cannot fix all Python scripts since there are so many.
+I fixed some in the scripts/ directory.
+
+[1]: https://lore.kernel.org/all/202211161056.1B9611A@keescook/
+[2]: https://github.com/llvm/llvm-project/issues/59037
+[3]: https://github.com/llvm/llvm-project/commit/4787efa38066adb51e2c049499d25b3610c0877b
+[4]: https://docs.python.org/3/library/signal.html#note-on-sigpipe
+
+Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
+Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
+Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ scripts/checkkconfigsymbols.py         | 13 ++++++++++++-
+ scripts/clang-tools/run-clang-tools.py | 21 ++++++++++++++-------
+ scripts/diffconfig                     | 16 ++++++++++++++--
+ 3 files changed, 40 insertions(+), 10 deletions(-)
+
+diff --git a/scripts/checkkconfigsymbols.py b/scripts/checkkconfigsymbols.py
+index 1548f9ce46827..697972432bbe7 100755
+--- a/scripts/checkkconfigsymbols.py
++++ b/scripts/checkkconfigsymbols.py
+@@ -113,7 +113,7 @@ def parse_options():
+     return args
+-def main():
++def print_undefined_symbols():
+     """Main function of this module."""
+     args = parse_options()
+@@ -472,5 +472,16 @@ def parse_kconfig_file(kfile):
+     return defined, references
++def main():
++    try:
++        print_undefined_symbols()
++    except BrokenPipeError:
++        # Python flushes standard streams on exit; redirect remaining output
++        # to devnull to avoid another BrokenPipeError at shutdown
++        devnull = os.open(os.devnull, os.O_WRONLY)
++        os.dup2(devnull, sys.stdout.fileno())
++        sys.exit(1)  # Python exits with error code 1 on EPIPE
++
++
+ if __name__ == "__main__":
+     main()
+diff --git a/scripts/clang-tools/run-clang-tools.py b/scripts/clang-tools/run-clang-tools.py
+index f754415af398b..f42699134f1c0 100755
+--- a/scripts/clang-tools/run-clang-tools.py
++++ b/scripts/clang-tools/run-clang-tools.py
+@@ -60,14 +60,21 @@ def run_analysis(entry):
+ def main():
+-    args = parse_arguments()
++    try:
++        args = parse_arguments()
+-    lock = multiprocessing.Lock()
+-    pool = multiprocessing.Pool(initializer=init, initargs=(lock, args))
+-    # Read JSON data into the datastore variable
+-    with open(args.path, "r") as f:
+-        datastore = json.load(f)
+-        pool.map(run_analysis, datastore)
++        lock = multiprocessing.Lock()
++        pool = multiprocessing.Pool(initializer=init, initargs=(lock, args))
++        # Read JSON data into the datastore variable
++        with open(args.path, "r") as f:
++            datastore = json.load(f)
++            pool.map(run_analysis, datastore)
++    except BrokenPipeError:
++        # Python flushes standard streams on exit; redirect remaining output
++        # to devnull to avoid another BrokenPipeError at shutdown
++        devnull = os.open(os.devnull, os.O_WRONLY)
++        os.dup2(devnull, sys.stdout.fileno())
++        sys.exit(1)  # Python exits with error code 1 on EPIPE
+ if __name__ == "__main__":
+diff --git a/scripts/diffconfig b/scripts/diffconfig
+index d5da5fa05d1d3..43f0f3d273ae7 100755
+--- a/scripts/diffconfig
++++ b/scripts/diffconfig
+@@ -65,7 +65,7 @@ def print_config(op, config, value, new_value):
+         else:
+             print(" %s %s -> %s" % (config, value, new_value))
+-def main():
++def show_diff():
+     global merge_style
+     # parse command line args
+@@ -129,4 +129,16 @@ def main():
+     for config in new:
+         print_config("+", config, None, b[config])
+-main()
++def main():
++    try:
++        show_diff()
++    except BrokenPipeError:
++        # Python flushes standard streams on exit; redirect remaining output
++        # to devnull to avoid another BrokenPipeError at shutdown
++        devnull = os.open(os.devnull, os.O_WRONLY)
++        os.dup2(devnull, sys.stdout.fileno())
++        sys.exit(1)  # Python exits with error code 1 on EPIPE
++
++
++if __name__ == '__main__':
++    main()
+-- 
+2.39.2
+
index 5768b6fd959d6ab328816f7c20fbd14d178da9d8..41c256fbcb5f5f6549b7e94ccd9dddc21d519402 100644 (file)
@@ -72,3 +72,14 @@ block-bfq-fix-uaf-for-bfqq-in-bfq_exit_icq_bfqq.patch
 block-bfq-iosched.c-use-false-rather-than-blk_rw_asy.patch
 block-bfq-replace-0-1-with-false-true-in-bic-apis.patch
 block-bfq-fix-uaf-for-bfqq-in-bic_set_bfqq.patch
+clk-qcom-mmcc-apq8084-remove-spdm-clocks.patch
+mips-fix-a-compilation-issue.patch
+powerpc-check-irq-instead-of-irq-no_irq-and-remove-n.patch
+powerpc-kcsan-exclude-udelay-to-prevent-recursive-in.patch
+alpha-fix-r_alpha_literal-reloc-for-large-modules.patch
+macintosh-windfarm-use-unsigned-type-for-1-bit-bitfi.patch
+pci-add-solidrun-vendor-id.patch
+pci-avoid-flr-for-solidrun-snet-dpu-rev-1.patch
+scripts-handle-brokenpipeerror-for-python-scripts.patch
+media-ov5640-fix-analogue-gain-control.patch
+media-rc-gpio-ir-recv-add-remove-function.patch