ALSA: usb-audio: Fix dB level of Bose Revolve+ SoundLink
Subsystems (10)
Sasha Levin
maintainerPATCH 1/34 ALSA: usb-audio: Fix dB level of Bose Revolve+ SoundLink
From: Takashi Iwai <[email protected]>
[ Upstream commit 02eb1d098e26f34c8f047b0b1cee6f4433a34bd1 ]
Bose Revolve+ SoundLink (0a57:40fa) advertises invalid dB level for the speaker volume. This patch provides the correction in the mixer map quirk table entry.
Note that this requires the prerequisite change to add min_mute flag to the dB map table.
--- sound/usb/mixer_maps.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
sound/usb/mixer_maps.c +12 -0
@@ -337,6 +337,13 @@ static const struct usbmix_name_map bose_companion5_map[] = { { 0 } /* terminator */ }; +/* Bose Revolve+ SoundLink, correction of dB maps */ +static const struct usbmix_dB_map bose_soundlink_dB = {-8283 ,-0 , true}; +static const struct usbmix_name_map bose_soundlink_map[] = { + {2 ,NULL , .dB = &bose_soundlink_dB }, + {0 }/* terminator */ +}; +/* Sennheiser Communications Headset [PC 8], the dB value is reported as -6 negative maximum */ static const struct usbmix_dB_map sennheiser_pc8_dB = {-9500 ,0 };static const struct usbmix_name_map sennheiser_pc8_map[] = {
@@ -551,6 +558,11 @@ static const struct usbmix_ctl_map usbmix_ctl_maps[] = { .id = USB_ID(0x05a7, 0x1020), .map = bose_companion5_map, }, + { +/* Bose Revolve+ SoundLink */ + .id = USB_ID(0x05a7, 0x40fa), + .map = bose_soundlink_map, + }, {/* Corsair Virtuoso SE (wired mode) */ .id = USB_ID(0x1b1c, 0x0a3d),
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 2/34 clk: imx: Use div64_ul instead of do_div
From: Changcheng Deng <[email protected]>
[ Upstream commit c1b6ad9a902539f9c037b6b3c35cb134c5724022 ]
do_div() does a 64-by-32 division. Here the divisor is an unsigned long which on some platforms is 64 bit wide. So use div64_ul instead of do_div to avoid a possible truncation.
--- drivers/clk/imx/clk-pllv3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/imx/clk-pllv3.c +3 -3
@@ -247,7 +247,7 @@ static long clk_pllv3_av_round_rate(struct clk_hw *hw, unsigned long rate, div = rate / parent_rate; temp64 = (u64) (rate - div * parent_rate); temp64 *= mfd; -do_div (temp64, parent_rate); + temp64 =div64_ul (temp64, parent_rate); mfn = temp64; temp64 = (u64 )parent_rate;
@@ -277,7 +277,7 @@ static int clk_pllv3_av_set_rate(struct clk_hw *hw, unsigned long rate, div = rate / parent_rate; temp64 = (u64) (rate - div * parent_rate); temp64 *= mfd; -do_div (temp64, parent_rate); + temp64 =div64_ul (temp64, parent_rate); mfn = temp64; val =readl_relaxed (pll->base);
@@ -334,7 +334,7 @@ static struct clk_pllv3_vf610_mf clk_pllv3_vf610_rate_to_mf(/* rate = parent_rate * (mfi + mfn/mfd) */ temp64 = rate - parent_rate * mf.mfi; temp64 *= mf.mfd; -do_div (temp64, parent_rate); + temp64 =div64_ul (temp64, parent_rate); mf.mfn = temp64; }
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 3/34 powerpc/6xx: add missing of_node_put
In reply to Sasha LevinFrom: Julia Lawall <[email protected]>
[ Upstream commit f6e82647ff71d427d4148964b71f239fba9d7937 ]
for_each_compatible_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put.
A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr):
// <smpl>
@@
expression e;
local idexpression n;
@@
@@
local idexpression n;
expression e;
@@
for_each_compatible_node(n,...) {
...
(
of_node_put(n);
|
e = n
|
+ of_node_put(n);
? break;
)
...
}
... when != n
// </smpl>
--- arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/platforms/embedded6xx/hlwd-pic.c +1 -0
@@ -215,6 +215,7 @@ void hlwd_pic_probe(void)irq_set_chained_handler (cascade_virq, hlwd_pic_irq_cascade); hlwd_irq_host = host; +of_node_put (np);break ; } }
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 4/34 powerpc/powernv: add missing of_node_put
In reply to Sasha LevinFrom: Julia Lawall <[email protected]>
[ Upstream commit 7d405a939ca960162eb30c1475759cb2fdf38f8c ]
for_each_compatible_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put.
A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr):
// <smpl>
@@
local idexpression n;
expression e;
@@
for_each_compatible_node(n,...) {
...
(
of_node_put(n);
|
e = n
|
+ of_node_put(n);
? break;
)
...
}
... when != n
// </smpl>
--- arch/powerpc/platforms/powernv/opal-lpc.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/platforms/powernv/opal-lpc.c +1 -0
@@ -396,6 +396,7 @@ void __init opal_lpc_init(void)if (!of_get_property (np,"primary" ,NULL ))continue ; opal_lpc_chip_id =of_get_ibm_chip_id (np); +of_node_put (np);break ; }if (opal_lpc_chip_id <0 )
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 5/34 powerpc/cell: add missing of_node_put
In reply to Sasha LevinFrom: Julia Lawall <[email protected]>
[ Upstream commit a841fd009e51c8c0a8f07c942e9ab6bb48da8858 ]
for_each_node_by_name performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put.
A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr):
// <smpl>
@@
expression e,e1;
local idexpression n;
@@
for_each_node_by_name(n, e1) {
... when != of_node_put(n)
when != e = n
(
return n;
|
+ of_node_put(n);
? return ...;
)
...
}
// </smpl>
--- arch/powerpc/platforms/cell/iommu.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/platforms/cell/iommu.c +1 -0
@@ -976,6 +976,7 @@ static int __init cell_iommu_fixed_mapping_init(void)if (hbase < dbase || (hend > (dbase + dsize))) {pr_debug ("iommu: hash window doesn't fit in" "real DMA window\n" ); +of_node_put (np);return -1 ; } }
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 6/34 powerpc/btext: add missing of_node_put
In reply to Sasha LevinFrom: Julia Lawall <[email protected]>
[ Upstream commit a1d2b210ffa52d60acabbf7b6af3ef7e1e69cda0 ]
for_each_node_by_type performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put.
A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr):
// <smpl>
@@
local idexpression n;
expression e;
@@
for_each_node_by_type(n,...) {
...
(
of_node_put(n);
|
e = n
|
+ of_node_put(n);
? break;
)
...
}
... when != n
// </smpl>
--- arch/powerpc/kernel/btext.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/powerpc/kernel/btext.c +3 -1
@@ -241,8 +241,10 @@ int __init btext_find_display(int allow_nonstdout) rc =btext_initialize (np);printk ("result: %d\n" , rc); } -if (rc ==0 ) +if (rc ==0 ) { +of_node_put (np);break ; + } }return rc; }
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 7/34 powerpc/watchdog: Fix missed watchdog reset due to memory ordering race
In reply to Sasha LevinFrom: Nicholas Piggin <[email protected]>
[ Upstream commit 5dad4ba68a2483fc80d70b9dc90bbe16e1f27263 ]
It is possible for all CPUs to miss the pending cpumask becoming clear, and then nobody resetting it, which will cause the lockup detector to stop working. It will eventually expire, but watchdog_smp_panic will avoid doing anything if the pending mask is clear and it will never be reset.
Order the cpumask clear vs the subsequent test to close this race.
Add an extra check for an empty pending mask when the watchdog fires and finds its bit still clear, to try to catch any other possible races or bugs here and keep the watchdog working. The extra test in arch_touch_nmi_watchdog is required to prevent the new warning from firing off.
--- arch/powerpc/kernel/watchdog.c | 41 +++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-)
arch/powerpc/kernel/watchdog.c +40 -1
@@ -132,6 +132,10 @@ static void set_cpumask_stuck(const struct cpumask *cpumask, u64 tb) {cpumask_or (&wd_smp_cpus_stuck, &wd_smp_cpus_stuck, cpumask);cpumask_andnot (&wd_smp_cpus_pending, &wd_smp_cpus_pending, cpumask); +/* +* See wd_smp_clear_cpu_pending() +*/ +smp_mb ();if (cpumask_empty (&wd_smp_cpus_pending)) { wd_smp_last_reset_tb = tb; cpumask_andnot(&wd_smp_cpus_pending,
@@ -217,13 +221,44 @@ static void wd_smp_clear_cpu_pending(int cpu, u64 tb)cpumask_clear_cpu (cpu, &wd_smp_cpus_stuck);wd_smp_unlock (&flags); + }else { +/* +* The last CPU to clear pending should have reset the +* watchdog so we generally should not find it empty +* here if our CPU was clear. However it could happen +* due to a rare race with another CPU taking the +* last CPU out of the mask concurrently. +* +* We can't add a warning for it. But just in case +* there is a problem with the watchdog that is causing +* the mask to not be reset, try to kick it along here. +*/ +if (unlikely (cpumask_empty (&wd_smp_cpus_pending))) + goto none_pending; }return ; } +cpumask_clear_cpu (cpu, &wd_smp_cpus_pending); + +/* +* Order the store to clear pending with the load(s) to check all +* words in the pending mask to check they are all empty. This orders +* with the same barrier on another CPU. This prevents two CPUs +* clearing the last 2 pending bits, but neither seeing the other's +* store when checking if the mask is empty, and missing an empty +* mask, which ends with a false positive. +*/ +smp_mb ();if (cpumask_empty (&wd_smp_cpus_pending)) {unsigned long flags; +none_pending: +/* +* Double check under lock because more than one CPU could see +* a clear mask with the lockless check after clearing their +* pending bits. +*/ wd_smp_lock (&flags);if (cpumask_empty (&wd_smp_cpus_pending)) { wd_smp_last_reset_tb = tb;
@@ -314,8 +349,12 @@ void arch_touch_nmi_watchdog(void) {unsigned long ticks = tb_ticks_per_usec * wd_timer_period_ms *1000 ;int cpu =smp_processor_id (); -u64 tb =get_tb (); +u64 tb; +if (!cpumask_test_cpu (cpu, &watchdog_cpumask)) +return ; + + tb =get_tb ();if (tb -per_cpu (wd_timer_tb, cpu) >= ticks) {per_cpu (wd_timer_tb, cpu) = tb;wd_smp_clear_cpu_pending (cpu, tb);
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 8/34 i2c: i801: Don't silently correct invalid transfer size
In reply to Sasha LevinFrom: Heiner Kallweit <[email protected]>
[ Upstream commit effa453168a7eeb8a562ff4edc1dbf9067360a61 ]
If an invalid block size is provided, reject it instead of silently changing it to a supported value. Especially critical I see the case of a write transfer with block length 0. In this case we have no guarantee that the byte we would write is valid. When silently reducing a read to 32 bytes then we don't return an error and the caller may falsely assume that we returned the full requested data.
If this change should break any (broken) caller, then I think we should fix the caller.
--- drivers/i2c/busses/i2c-i801.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/i2c/busses/i2c-i801.c +5 -10
@@ -797,6 +797,11 @@ static int i801_block_transaction(struct i801_priv *priv,int result =0 ;unsigned char hostc; +if (read_write ==I2C_SMBUS_READ && command ==I2C_SMBUS_BLOCK_DATA ) + data->block[0 ] =I2C_SMBUS_BLOCK_MAX ; +else if (data->block[0 ] <1 || data->block[0 ] >I2C_SMBUS_BLOCK_MAX ) +return -EPROTO ; +if (command ==I2C_SMBUS_I2C_BLOCK_DATA ) {if (read_write ==I2C_SMBUS_WRITE ) {/* set I2C_EN bit in configuration register */
@@ -810,16 +815,6 @@ static int i801_block_transaction(struct i801_priv *priv, } } -if (read_write ==I2C_SMBUS_WRITE - || command ==I2C_SMBUS_I2C_BLOCK_DATA ) { -if (data->block[0 ] <1 ) - data->block[0 ] =1 ; -if (data->block[0 ] >I2C_SMBUS_BLOCK_MAX ) - data->block[0 ] =I2C_SMBUS_BLOCK_MAX ; - }else { - data->block[0 ] =32 ;/* max for SMBus block reads */ - } -/* Experience has shown that the block buffer can only be used for SMBus (not I2C) block transactions, even though the datasheet doesn't mention this limitation. */
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 9/34 powerpc/smp: Move setup_profiling_timer() under CONFIG_PROFILING
In reply to Sasha LevinFrom: Michael Ellerman <[email protected]>
[ Upstream commit a4ac0d249a5db80e79d573db9e4ad29354b643a8 ]
setup_profiling_timer() is only needed when CONFIG_PROFILING is enabled.
Fixes the following W=1 warning when CONFIG_PROFILING=n:
linux/arch/powerpc/kernel/smp.c:1638:5: error: no previous prototype for ‘setup_profiling_timer’
--- arch/powerpc/kernel/smp.c | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/kernel/smp.c +2 -0
@@ -1488,10 +1488,12 @@ void start_secondary(void *unused)BUG (); } +#ifdef CONFIG_PROFILING int setup_profiling_timer (unsigned int multiplier) {return 0 ; } +#endif static void fixup_topology (void ) {
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 10/34 i2c: mpc: Correct I2C reset procedure
In reply to Sasha LevinFrom: Joakim Tjernlund <[email protected]>
[ Upstream commit ebe82cf92cd4825c3029434cabfcd2f1780e64be ]
Current I2C reset procedure is broken in two ways:
1) It only generate 1 START instead of 9 STARTs and STOP.
2) It leaves the bus Busy so every I2C xfer after the first fixup calls the reset routine again, for every xfer there after.
This fixes both errors.
--- drivers/i2c/busses/i2c-mpc.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/i2c/busses/i2c-mpc.c +15 -8
@@ -105,23 +105,30 @@ static irqreturn_t mpc_i2c_isr(int irq, void *dev_id)/* Sometimes 9th clock pulse isn't generated, and slave doesn't release * the bus, because it wants to send ACK. * Following sequence of enabling/disabling and sending start/stop generates -* the 9 pulses, so it's all OK. +* the 9 pulses, each with a START then ending with STOP, so it's all OK. */ static void mpc_i2c_fixup (struct mpc_i2c *i2c) {int k; -u32 delay_val =1000000 / i2c->real_clk +1 ; - -if (delay_val <2 ) - delay_val =2 ; +unsigned long flags;for (k =9 ; k; k--) {writeccr (i2c,0 ); -writeccr (i2c,CCR_MSTA |CCR_MTX |CCR_MEN ); +writeb (0 , i2c->base +MPC_I2C_SR );/* clear any status bits */ +writeccr (i2c,CCR_MEN |CCR_MSTA );/* START */ +readb (i2c->base +MPC_I2C_DR );/* init xfer */ +udelay (15 );/* let it hit the bus */ +local_irq_save (flags);/* should not be delayed further */ +writeccr (i2c,CCR_MEN |CCR_MSTA |CCR_RSTA );/* delay SDA */ readb (i2c->base +MPC_I2C_DR ); -writeccr (i2c,CCR_MEN ); -udelay (delay_val <<1 ); +if (k !=1 ) +udelay (5 ); +local_irq_restore (flags); } +writeccr (i2c,CCR_MEN );/* Initiate STOP */ +readb (i2c->base +MPC_I2C_DR ); +udelay (15 );/* Let STOP propagate */ +writeccr (i2c,0 ); }static int i2c_wait (struct mpc_i2c *i2c,unsigned timeout,int writing)
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 11/34 clk: meson: gxbb: Fix the SDM_EN bit for MPLL0 on GXBB
In reply to Sasha LevinFrom: Martin Blumenstingl <[email protected]>
[ Upstream commit ff54938dd190d85f740b9bf9dde59b550936b621 ]
There are reports that 48kHz audio does not work on the WeTek Play 2 (which uses a GXBB SoC), while 44.1kHz audio works fine on the same board. There are also reports of 48kHz audio working fine on GXL and GXM SoCs, which are using an (almost) identical AIU (audio controller).
Experimenting has shown that MPLL0 is causing this problem. In the .dts we have by default:
assigned-clocks = <&clkc CLKID_MPLL0>, <&clkc CLKID_MPLL1>, <&clkc CLKID_MPLL2>; assigned-clock-rates = <294912000>, <270950400>, <393216000>;
The MPLL0 rate is divisible by 48kHz without remainder and the MPLL1 rate is divisible by 44.1kHz without remainder. Swapping these two clock rates "fixes" 48kHz audio but breaks 44.1kHz audio.
Everything looks normal when looking at the info provided by the common clock framework while playing 48kHz audio (via I2S with mclk-fs = 256):
mpll_prediv 1 1 0 2000000000
mpll0_div 1 1 0 294909641
mpll0 1 1 0 294909641
cts_amclk_sel 1 1 0 294909641
cts_amclk_div 1 1 0 12287902
cts_amclk 1 1 0 12287902meson-clk-msr however shows that the actual MPLL0 clock is off by more than 38MHz:
mp0_out 333322917 +/-10416Hz
The rate seen by meson-clk-msr is very close to what we would get when SDM (the fractional part) was ignored:
(2000000000Hz * 16384) / ((16384 * 6) = 333.33MHz
If SDM was considered the we should get close to:
(2000000000Hz * 16384) / ((16384 * 6) + 12808) = 294.9MHz
Further experimenting shows that HHI_MPLL_CNTL7[15] does not have any effect on the rate of MPLL0 as seen my meson-clk-msr (regardless of whether that bit is zero or one the rate is always the same according to meson-clk-msr). Using HHI_MPLL_CNTL[25] on the other hand as SDM_EN results in SDM being considered for the rate output by the hardware. The rate - as seen by meson-clk-msr - matches with what we expect when SDM_EN is enabled (fractional part is being considered, resulting in a 294.9MHz output) or disable (fractional part being ignored, resulting in a 333.33MHz output).
--- drivers/clk/meson/gxbb.c | 44 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-)
drivers/clk/meson/gxbb.c +41 -3
@@ -712,6 +712,35 @@ static struct clk_regmap gxbb_mpll_prediv = { };static struct clk_regmap gxbb_mpll0_div = { + .data = &(struct meson_clk_mpll_data ){ + .sdm = { + .reg_off =HHI_MPLL_CNTL7 , + .shift =0 , + .width =14 , + }, + .sdm_en = { + .reg_off =HHI_MPLL_CNTL , + .shift =25 , + .width =1 , + }, + .n2 = { + .reg_off =HHI_MPLL_CNTL7 , + .shift =16 , + .width =9 , + }, + .lock = &meson_clk_lock, + }, + .hw.init = &(struct clk_init_data ){ + .name ="mpll0_div" , + .ops = &meson_clk_mpll_ops, + .parent_hws = (const struct clk_hw *[]) { + &gxbb_mpll_prediv.hw + }, + .num_parents =1 , + }, +}; + +static struct clk_regmap gxl_mpll0_div = { .data = &(struct meson_clk_mpll_data ){ .sdm = { .reg_off =HHI_MPLL_CNTL7 ,
@@ -748,7 +777,16 @@ static struct clk_regmap gxbb_mpll0 = { .hw.init = &(struct clk_init_data){ .name ="mpll0" , .ops = &clk_regmap_gate_ops, - .parent_hws = (const struct clk_hw *[]) { &gxbb_mpll0_div.hw }, + .parent_data = &(const struct clk_parent_data ) { +/* +* Note: +* GXL and GXBB have different SDM_EN registers. We +* fallback to the global naming string mechanism so +* mpll0_div picks up the appropriate one. +*/ + .name ="mpll0_div" , + .index =-1 , + }, .num_parents =1 , .flags =CLK_SET_RATE_PARENT , },
@@ -3043,7 +3081,7 @@ static struct clk_hw_onecell_data gxl_hw_onecell_data = { [CLKID_VAPB_1] = &gxbb_vapb_1.hw, [CLKID_VAPB_SEL] = &gxbb_vapb_sel.hw, [CLKID_VAPB] = &gxbb_vapb.hw, - [CLKID_MPLL0_DIV] = &gxbb_mpll0_div.hw, + [CLKID_MPLL0_DIV] = &gxl_mpll0_div.hw, [CLKID_MPLL1_DIV] = &gxbb_mpll1_div.hw, [CLKID_MPLL2_DIV] = &gxbb_mpll2_div.hw, [CLKID_MPLL_PREDIV] = &gxbb_mpll_prediv.hw,
@@ -3438,7 +3476,7 @@ static struct clk_regmap *const gxl_clk_regmaps[] = { &gxbb_mpll0, &gxbb_mpll1, &gxbb_mpll2, - &gxbb_mpll0_div, + &gxl_mpll0_div, &gxbb_mpll1_div, &gxbb_mpll2_div, &gxbb_cts_amclk_div,
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 12/34 powerpc/powermac: Add missing lockdep_register_key()
In reply to Sasha LevinFrom: Christophe Leroy <[email protected]>
[ Upstream commit df1f679d19edb9eeb67cc2f96b29375f21991945 ]
KeyWest i2c @0xf8001003 irq 42 /uni-n@f8000000/i2c@f8001000
BUG: key c2d00cbc has not been registered! ------------[ cut here ]------------ DEBUG_LOCKS_WARN_ON(1) WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:4801 lockdep_init_map_type+0x4c0/0xb4c Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.15.5-gentoo-PowerMacG4 #9 NIP: c01a9428 LR: c01a9428 CTR: 00000000 REGS: e1033cf0 TRAP: 0700 Not tainted (5.15.5-gentoo-PowerMacG4) MSR: 00029032 <EE,ME,IR,DR,RI> CR: 24002002 XER: 00000000
GPR00: c01a9428 e1033db0 c2d1cf20 00000016 00000004 00000001 c01c0630 e1033a73
GPR08: 00000000 00000000 00000000 e1033db0 24002004 00000000 f8729377 00000003
GPR16: c1829a9c 00000000 18305357 c1416fc0 c1416f80 c006ac60 c2d00ca8 c1416f00
GPR24: 00000000 c21586f0 c2160000 00000000 c2d00cbc c2170000 c216e1a0 c2160000 NIP [c01a9428] lockdep_init_map_type+0x4c0/0xb4c
LR [c01a9428] lockdep_init_map_type+0x4c0/0xb4c
Call Trace: [e1033db0] [c01a9428] lockdep_init_map_type+0x4c0/0xb4c (unreliable) [e1033df0] [c1c177b8] kw_i2c_add+0x334/0x424 [e1033e20] [c1c18294] pmac_i2c_init+0x9ec/0xa9c [e1033e80] [c1c1a790] smp_core99_probe+0xbc/0x35c [e1033eb0] [c1c03cb0] kernel_init_freeable+0x190/0x5a4 [e1033f10] [c000946c] kernel_init+0x28/0x154 [e1033f30] [c0035148] ret_from_kernel_thread+0x14/0x1c
Add missing lockdep_register_key()
--- arch/powerpc/platforms/powermac/low_i2c.c | 1 + 1 file changed, 1 insertion(+)
arch/powerpc/platforms/powermac/low_i2c.c +1 -0
@@ -582,6 +582,7 @@ static void __init kw_i2c_add(struct pmac_i2c_host_kw *host, bus->close = kw_i2c_close; bus->xfer = kw_i2c_xfer;mutex_init (&bus->mutex); +lockdep_register_key (&bus->lock_key);lockdep_set_class (&bus->mutex, &bus->lock_key);if (controller == busnode) bus->flags = pmac_i2c_multibus;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 13/34 KVM: PPC: Book3S: Suppress warnings when allocating too big memory slots
In reply to Sasha LevinFrom: Alexey Kardashevskiy <[email protected]>
[ Upstream commit 511d25d6b789fffcb20a3eb71899cf974a31bd9d ]
The userspace can trigger "vmalloc size %lu allocation failure: exceeds total pages" via the KVM_SET_USER_MEMORY_REGION ioctl.
This silences the warning by checking the limit before calling vzalloc() and returns ENOMEM if failed.
This does not call underlying valloc helpers as __vmalloc_node() is only exported when CONFIG_TEST_VMALLOC_MODULE and __vmalloc_node_range() is not exported at all.
Spotted by syzkaller.
--- arch/powerpc/kvm/book3s_hv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
arch/powerpc/kvm/book3s_hv.c +6 -2
@@ -4557,8 +4557,12 @@ static int kvmppc_core_prepare_memory_region_hv(struct kvm *kvm,unsigned long npages = mem->memory_size >>PAGE_SHIFT ;if (change ==KVM_MR_CREATE ) { - slot->arch.rmap =vzalloc (array_size (npages, -sizeof (*slot->arch.rmap))); +unsigned long size =array_size (npages,sizeof (*slot->arch.rmap)); + +if ((size >>PAGE_SHIFT ) >totalram_pages ()) +return -ENOMEM ; + + slot->arch.rmap =vzalloc (size);if (!slot->arch.rmap)return -ENOMEM ; }
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 14/34 KVM: PPC: Book3S: Suppress failed alloc warning in H_COPY_TOFROM_GUEST
In reply to Sasha LevinFrom: Alexey Kardashevskiy <[email protected]>
[ Upstream commit 792020907b11c6f9246c21977cab3bad985ae4b6 ]
H_COPY_TOFROM_GUEST is an hcall for an upper level VM to access its nested VMs memory. The userspace can trigger WARN_ON_ONCE(!(gfp & __GFP_NOWARN)) in __alloc_pages() by constructing a tiny VM which only does H_COPY_TOFROM_GUEST with a too big GPR9 (number of bytes to copy).
This silences the warning by adding __GFP_NOWARN.
Spotted by syzkaller.
--- arch/powerpc/kvm/book3s_hv_nested.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kvm/book3s_hv_nested.c +1 -1
@@ -510,7 +510,7 @@ long kvmhv_copy_tofrom_guest_nested(struct kvm_vcpu *vcpu)if (eaddr & (0xFFFUL <<52 ))return H_PARAMETER ; - buf =kzalloc (n,GFP_KERNEL ); + buf =kzalloc (n,GFP_KERNEL | __GFP_NOWARN);if (!buf)return H_NO_MEM ;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 15/34 w1: Misuse of get_user()/put_user() reported by sparse
In reply to Sasha LevinFrom: Christophe Leroy <[email protected]>
[ Upstream commit 33dc3e3e99e626ce51f462d883b05856c6c30b1d ]
sparse warnings: (new ones prefixed by >>)
Quoted 1 line
Quoted 1 line
drivers/w1/slaves/w1_ds28e04.c:342:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char [noderef]__user*_pu_addr@@ got char *buf @@
drivers/w1/slaves/w1_ds28e04.c:342:13: sparse: expected char [noderef] __user *_pu_addr
drivers/w1/slaves/w1_ds28e04.c:342:13: sparse: got char *buf
Quoted 1 line
Quoted 1 line
drivers/w1/slaves/w1_ds28e04.c:356:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char const [noderef]__user*_gu_addr@@ got char const *buf @@
drivers/w1/slaves/w1_ds28e04.c:356:13: sparse: expected char const [noderef] __user *_gu_addr
drivers/w1/slaves/w1_ds28e04.c:356:13: sparse: got char const *buf
The buffer buf is a failsafe buffer in kernel space, it's not user memory hence doesn't deserve the use of get_user() or put_user().
Access 'buf' content directly.
--- drivers/w1/slaves/w1_ds28e04.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-)
drivers/w1/slaves/w1_ds28e04.c +6 -20
@@ -32,7 +32,7 @@ static int w1_strong_pullup = 1;module_param_named (strong_pullup, w1_strong_pullup, int,0 );/* enable/disable CRC checking on DS28E04-100 memory accesses */ -static char w1_enable_crccheck =1 ; +static bool w1_enable_crccheck = true;#define W1_EEPROM_SIZE 512#define W1_PAGE_COUNT 16
@@ -339,32 +339,18 @@ static BIN_ATTR_RW(pio, 1);static ssize_t crccheck_show (struct device *dev,struct device_attribute *attr,char *buf) { -if (put_user (w1_enable_crccheck +0x30 , buf)) -return -EFAULT ; - -return sizeof (w1_enable_crccheck); +return sysfs_emit (buf,"%d\n" , w1_enable_crccheck); }static ssize_t crccheck_store (struct device *dev,struct device_attribute *attr,const char *buf,size_t count) { -char val; - -if (count !=1 || !buf) -return -EINVAL ; +int err =kstrtobool (buf, &w1_enable_crccheck); -if (get_user (val, buf)) -return -EFAULT ; +if (err) +return err; -/* convert to decimal */ - val = val -0x30 ; -if (val !=0 && val !=1 ) -return -EINVAL ; - -/* set the new value */ - w1_enable_crccheck = val; - -return sizeof (w1_enable_crccheck); +return count; }static DEVICE_ATTR_RW (crccheck);
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 16/34 nvmem: core: set size for sysfs bin file
In reply to Sasha LevinFrom: Srinivas Kandagatla <[email protected]>
[ Upstream commit 86192251033308bb42f1e9813c962989d8ed07ec ]
For some reason we never set the size for nvmem sysfs binary file. Set this.
--- drivers/nvmem/core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/nvmem/core.c +2 -0
@@ -222,6 +222,8 @@ static umode_t nvmem_bin_attr_is_visible(struct kobject *kobj,struct device *dev =kobj_to_dev (kobj);struct nvmem_device *nvmem =to_nvmem_device (dev); + attr->size = nvmem->size; +return nvmem_bin_attr_get_umode (nvmem); }
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 17/34 dm: fix alloc_dax error handling in alloc_dev
In reply to Sasha LevinFrom: Christoph Hellwig <[email protected]>
[ Upstream commit d751939235b9b7bc4af15f90a3e99288a8b844a7 ]
Make sure ->dax_dev is NULL on error so that the cleanup path doesn't trip over an ERR_PTR.
--- drivers/md/dm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/md/dm.c +3 -1
@@ -1894,8 +1894,10 @@ static struct mapped_device *alloc_dev(int minor)if (IS_ENABLED (CONFIG_DAX_DRIVER )) { md->dax_dev =alloc_dax (md, md->disk->disk_name, &dm_dax_ops,0 ); -if (IS_ERR (md->dax_dev)) +if (IS_ERR (md->dax_dev)) { + md->dax_dev =NULL ; goto bad; + } }add_disk_no_queue_reg (md->disk);
Signature · 7 lines
2.34.1 -- dm-devel mailing list [email protected] https://listman.redhat.com/mailman/listinfo/dm-devel
Sasha Levin
maintainerPATCH 18/34 scsi: lpfc: Trigger SLI4 firmware dump before doing driver cleanup
In reply to Sasha LevinFrom: James Smart <[email protected]>
[ Upstream commit 7dd2e2a923173d637c272e483966be8e96a72b64 ]
Extraneous teardown routines are present in the firmware dump path causing altered states in firmware captures.
When a firmware dump is requested via sysfs, trigger the dump immediately without tearing down structures and changing adapter state.
The driver shall rely on pre-existing firmware error state clean up handlers to restore the adapter.
--- drivers/scsi/lpfc/lpfc.h | 2 +- drivers/scsi/lpfc/lpfc_attr.c | 62 ++++++++++++++++++++------------ drivers/scsi/lpfc/lpfc_hbadisc.c | 8 ++++- drivers/scsi/lpfc/lpfc_sli.c | 6 ---- 4 files changed, 48 insertions(+), 30 deletions(-)
drivers/scsi/lpfc/lpfc.h +1 -1
@@ -763,7 +763,6 @@ struct lpfc_hba {#define HBA_DEVLOSS_TMO 0x2000/* HBA in devloss timeout */ #define HBA_RRQ_ACTIVE 0x4000/* process the rrq active list */ #define HBA_IOQ_FLUSH 0x8000/* FCP/NVME I/O queues being flushed */ -#define HBA_FW_DUMP_OP 0x10000/* Skips fn reset before FW dump */ #define HBA_RECOVERABLE_UE 0x20000/* Firmware supports recoverable UE */ #define HBA_FORCED_LINK_SPEED 0x40000/* * Firmware supports Forced Link Speed
@@ -772,6 +771,7 @@ struct lpfc_hba {#define HBA_FLOGI_ISSUED 0x100000/* FLOGI was issued */ #define HBA_DEFER_FLOGI 0x800000/* Defer FLOGI till read_sparm cmpl */ +struct completion *fw_dump_cmpl;/* cmpl event tracker for fw_dump */ uint32_t fcp_ring_in_use;/* When polling test if intr-hndlr active*/ struct lpfc_dmabuf slim2p;
drivers/scsi/lpfc/lpfc_attr.c +40 -22
89 lines not on this page · raw message
drivers/scsi/lpfc/lpfc_hbadisc.c +7 -1
@@ -635,10 +635,16 @@ lpfc_work_done(struct lpfc_hba *phba)if (phba->pci_dev_grp ==LPFC_PCI_DEV_OC )lpfc_sli4_post_async_mbox (phba); -if (ha_copy &HA_ERATT ) +if (ha_copy &HA_ERATT ) {/* Handle the error attention event */ lpfc_handle_eratt (phba); +if (phba->fw_dump_cmpl) { +complete (phba->fw_dump_cmpl); + phba->fw_dump_cmpl =NULL ; + } + } +if (ha_copy &HA_MBATT )lpfc_sli_handle_mb_event (phba);
drivers/scsi/lpfc/lpfc_sli.c +0 -6
@@ -4629,12 +4629,6 @@ lpfc_sli4_brdreset(struct lpfc_hba *phba) phba->fcf.fcf_flag =0 ;spin_unlock_irq (&phba->hbalock); -/* SLI4 INTF 2: if FW dump is being taken skip INIT_PORT */ -if (phba->hba_flag &HBA_FW_DUMP_OP ) { - phba->hba_flag &= ~HBA_FW_DUMP_OP ; -return rc; - } -/* Now physically reset the device */ lpfc_printf_log (phba,KERN_INFO ,LOG_INIT ,"0389 Performing PCI function reset!\n" );
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 19/34 ALSA: seq: Set upper limit of processed events
In reply to Sasha LevinFrom: Takashi Iwai <[email protected]>
[ Upstream commit 6fadb494a638d8b8a55864ecc6ac58194f03f327 ]
Currently ALSA sequencer core tries to process the queued events as much as possible when they become dispatchable. If applications try to queue too massive events to be processed at the very same timing, the sequencer core would still try to process such all events, either in the interrupt context or via some notifier; in either away, it might be a cause of RCU stall or such problems.
As a potential workaround for those problems, this patch adds the upper limit of the amount of events to be processed. The remaining events are processed in the next batch, so they won't be lost.
For the time being, it's limited up to 1000 events per queue, which should be high enough for any normal usages.
--- sound/core/seq/seq_queue.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
sound/core/seq/seq_queue.c +12 -2
@@ -234,12 +234,15 @@ struct snd_seq_queue *snd_seq_queue_find_name(char *name)/* -------------------------------------------------------- */ +#define MAX_CELL_PROCESSES_IN_QUEUE 1000 +void snd_seq_check_queue (struct snd_seq_queue *q,int atomic,int hop) {unsigned long flags;struct snd_seq_event_cell *cell;snd_seq_tick_time_t cur_tick;snd_seq_real_time_t cur_time; +int processed =0 ;if (q ==NULL )return ;
@@ -262,6 +265,8 @@ void snd_seq_check_queue(struct snd_seq_queue *q, int atomic, int hop)if (!cell)break ;snd_seq_dispatch_event (cell, atomic, hop); +if (++processed >=MAX_CELL_PROCESSES_IN_QUEUE ) + goto out;/* the rest processed at the next batch */ }/* Process time queue... */
@@ -271,14 +276,19 @@ void snd_seq_check_queue(struct snd_seq_queue *q, int atomic, int hop)if (!cell)break ;snd_seq_dispatch_event (cell, atomic, hop); +if (++processed >=MAX_CELL_PROCESSES_IN_QUEUE ) + goto out;/* the rest processed at the next batch */ } + out:/* free lock */ spin_lock_irqsave (&q->check_lock, flags);if (q->check_again) { q->check_again =0 ; -spin_unlock_irqrestore (&q->check_lock, flags); - goto __again; +if (processed <MAX_CELL_PROCESSES_IN_QUEUE ) { +spin_unlock_irqrestore (&q->check_lock, flags); + goto __again; + } } q->check_blocked =0 ;spin_unlock_irqrestore (&q->check_lock, flags);
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 20/34 MIPS: Loongson64: Use three arguments for slti
In reply to Sasha LevinFrom: Nathan Chancellor <[email protected]>
[ Upstream commit f2c6c22fa83ab2577619009057b3ebcb5305bb03 ]
LLVM's integrated assembler does not support 'slti <reg>, <imm>':
<instantiation>:16:12: error: invalid operand for instruction
slti $12, (0x6300 | 0x0008)
^
arch/mips/kernel/head.S:86:2: note: while in macro instantiation
kernel_entry_setup # cpu specific setup
^
<instantiation>:16:12: error: invalid operand for instruction
slti $12, (0x6300 | 0x0008)
^
arch/mips/kernel/head.S:150:2: note: while in macro instantiation
smp_slave_setup
^
To increase compatibility with LLVM's integrated assembler, use the full form of 'slti <reg>, <reg>, <imm>', which matches the rest of arch/mips/. This does not result in any change for GNU as.
--- arch/mips/include/asm/mach-loongson64/kernel-entry-init.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/include/asm/mach-loongson64/kernel-entry-init.h +2 -2
@@ -36,7 +36,7 @@nop /* Loongson-3A R2/R3 */ andi t0, (PRID_IMP_MASK | PRID_REV_MASK) - slti t0, (PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_0) + slti t0, t0, (PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_0) bnez t0, 2f nop 1:
@@ -71,7 +71,7 @@nop /* Loongson-3A R2/R3 */ andi t0, (PRID_IMP_MASK | PRID_REV_MASK) - slti t0, (PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_0) + slti t0, t0, (PRID_IMP_LOONGSON_64C | PRID_REV_LOONGSON3A_R2_0) bnez t0, 2f nop 1:
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 21/34 powerpc/40x: Map 32Mbytes of memory at startup
In reply to Sasha LevinFrom: Christophe Leroy <[email protected]>
[ Upstream commit 06e7cbc29e97b4713b4ea6def04ae8501a7d1a59 ]
As reported by Carlo, 16Mbytes is not enough with modern kernels that tend to be a bit big, so map another 16M page at boot.
--- arch/powerpc/kernel/head_40x.S | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
arch/powerpc/kernel/head_40x.S +8 -1
@@ -27,6 +27,7 @@ #include <linux/init.h> #include <linux/pgtable.h> +#include <linux/sizes.h> #include <asm/processor.h> #include <asm/page.h> #include <asm/mmu.h>
@@ -626,7 +627,7 @@ start_here: b . /* prevent prefetch past rfi */ /* Set up the initial MMU state so we can do the first level of - * kernel initialization. This maps the first 16 MBytes of memory 1:1 + * kernel initialization. This maps the first 32 MBytes of memory 1:1 * virtual to physical and more importantly sets the cache mode. */ initial_mmu:
@@ -663,6 +664,12 @@ initial_mmu: tlbwe r4,r0,TLB_DATA /* Load the data portion of the entry */ tlbwe r3,r0,TLB_TAG /* Load the tag portion of the entry */ + li r0,62 /* TLB slot 62 */ + addis r4,r4,SZ_16M@h + addis r3,r3,SZ_16M@h + tlbwe r4,r0,TLB_DATA /* Load the data portion of the entry */ + tlbwe r3,r0,TLB_TAG /* Load the tag portion of the entry */ + isync /* Establish the exception vector base
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 22/34 selftests/powerpc/spectre_v2: Return skip code when miss_percent is high
In reply to Sasha LevinFrom: Thadeu Lima de Souza Cascardo <[email protected]>
[ Upstream commit 3c42e9542050d49610077e083c7c3f5fd5e26820 ]
A mis-match between reported and actual mitigation is not restricted to the Vulnerable case. The guest might also report the mitigation as "Software count cache flush" and the host will still mitigate with branch cache disabled.
So, instead of skipping depending on the detected mitigation, simply skip whenever the detected miss_percent is the expected one for a fully mitigated system, that is, above 95%.
--- tools/testing/selftests/powerpc/security/spectre_v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/powerpc/security/spectre_v2.c +1 -1
@@ -193,7 +193,7 @@ int spectre_v2_test(void)* We are not vulnerable and reporting otherwise, so * missing such a mismatch is safe. */ -if (state ==VULNERABLE ) +if (miss_percent >95 )return 4 ;return 1 ;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 23/34 powerpc: handle kdump appropriately with crash_kexec_post_notifiers option
In reply to Sasha LevinFrom: Hari Bathini <[email protected]>
[ Upstream commit 219572d2fc4135b5ce65c735d881787d48b10e71 ]
Kdump can be triggered after panic_notifers since commit f06e5153f4ae2 ("kernel/panic.c: add "crash_kexec_post_notifiers" option for kdump after panic_notifers") introduced crash_kexec_post_notifiers option. But using this option would mean smp_send_stop(), that marks all other CPUs as offline, gets called before kdump is triggered. As a result, kdump routines fail to save other CPUs' registers. To fix this, kdump friendly crash_smp_send_stop() function was introduced with kernel commit 0ee59413c967 ("x86/panic: replace smp_send_stop() with kdump friendly version in panic path"). Override this kdump friendly weak function to handle crash_kexec_post_notifiers option appropriately on powerpc.
--- arch/powerpc/kernel/smp.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/powerpc/kernel/smp.c +30 -0
@@ -594,6 +594,36 @@ void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *)) }#endif +#ifdef CONFIG_NMI_IPI +static void crash_stop_this_cpu(struct pt_regs *regs) +#else +static void crash_stop_this_cpu(void *dummy) +#endif +{ + /* + * Just busy wait here and avoid marking CPU as offline to ensure + * register data is captured appropriately. + */ + while (1) + cpu_relax(); +} + +void crash_smp_send_stop(void) +{ + static bool stopped = false; + + if (stopped) + return; + + stopped = true; + +#ifdef CONFIG_NMI_IPI + smp_send_nmi_ipi(NMI_IPI_ALL_OTHERS, crash_stop_this_cpu, 1000000); +#else + smp_call_function(crash_stop_this_cpu, NULL, 0); +#endif /* CONFIG_NMI_IPI */ +} + #ifdef CONFIG_NMI_IPI static void nmi_stop_this_cpu(struct pt_regs *regs) {
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 24/34 powerpc/fadump: Fix inaccurate CPU state info in vmcore generated with panic
In reply to Sasha LevinFrom: Hari Bathini <[email protected]>
[ Upstream commit 06e629c25daa519be620a8c17359ae8fc7a2e903 ]
In panic path, fadump is triggered via a panic notifier function. Before calling panic notifier functions, smp_send_stop() gets called, which stops all CPUs except the panic'ing CPU. Commit 8389b37dffdc ("powerpc: stop_this_cpu: remove the cpu from the online map.") and again commit bab26238bbd4 ("powerpc: Offline CPU in stop_this_cpu()") started marking CPUs as offline while stopping them. So, if a kernel has either of the above commits, vmcore captured with fadump via panic path would not process register data for all CPUs except the panic'ing CPU. Sample output of crash-utility with such vmcore:
# crash vmlinux vmcore
...
KERNEL: vmlinux
DUMPFILE: vmcore [PARTIAL DUMP]
CPUS: 1
DATE: Wed Nov 10 09:56:34 EST 2021
UPTIME: 00:00:42
LOAD AVERAGE: 2.27, 0.69, 0.24
TASKS: 183
NODENAME: XXXXXXXXX
RELEASE: 5.15.0+
VERSION: #974 SMP Wed Nov 10 04:18:19 CST 2021
MACHINE: ppc64le (2500 Mhz)
MEMORY: 8 GB
PANIC: "Kernel panic - not syncing: sysrq triggered crash"
PID: 3394
COMMAND: "bash"
TASK: c0000000150a5f80 [THREAD_INFO: c0000000150a5f80]
CPU: 1
STATE: TASK_RUNNING (PANIC) crash> p -x __cpu_online_mask
__cpu_online_mask = $1 = {
bits = {0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
}
crash>
crash>
crash> p -x __cpu_active_mask
__cpu_active_mask = $2 = {
bits = {0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
}
crash>While this has been the case since fadump was introduced, the issue was not identified for two probable reasons:
- In general, the bulk of the vmcores analyzed were from crash due to exception.
- The above did change since commit 8341f2f222d7 ("sysrq: Use panic() to force a crash") started using panic() instead of deferencing NULL pointer to force a kernel crash. But then commit de6e5d38417e ("powerpc: smp_send_stop do not offline stopped CPUs") stopped marking CPUs as offline till kernel commit bab26238bbd4 ("powerpc: Offline CPU in stop_this_cpu()") reverted that change.
To ensure post processing register data of all other CPUs happens as intended, let panic() function take the crash friendly path (read crash_smp_send_stop()) with the help of crash_kexec_post_notifiers option. Also, as register data for all CPUs is captured by f/w, skip IPI callbacks here for fadump, to avoid any complications in finding the right backtraces.
--- arch/powerpc/kernel/fadump.c | 8 ++++++++ arch/powerpc/kernel/smp.c | 10 ++++++++++ 2 files changed, 18 insertions(+)
arch/powerpc/kernel/fadump.c +8 -0
@@ -1641,6 +1641,14 @@ int __init setup_fadump(void)else if (fw_dump.reserve_dump_area_size) fw_dump.ops->fadump_init_mem_struct (&fw_dump); +/* +* In case of panic, fadump is triggered via ppc_panic_event() +* panic notifier. Setting crash_kexec_post_notifiers to 'true' +* lets panic() function take crash friendly path before panic +* notifiers are invoked. +*/ + crash_kexec_post_notifiers = true; +return 1 ; }subsys_initcall (setup_fadump);
arch/powerpc/kernel/smp.c +10 -0
@@ -60,6 +60,7 @@#include <asm/cpu_has_feature.h> #include <asm/ftrace.h> #include <asm/kup.h> +#include <asm/fadump.h> #ifdef DEBUG #include <asm/udbg.h>
@@ -612,6 +613,15 @@ void crash_smp_send_stop(void) {static bool stopped = false; +/* +* In case of fadump, register data for all CPUs is captured by f/w +* on ibm,os-term rtas call. Skip IPI callbacks to other CPUs before +* this rtas call to avoid tricky post processing of those CPUs' +* backtraces. +*/ +if (should_fadump_crash ()) +return ; +if (stopped)return ;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 25/34 udf: Fix error handling in udf_new_inode()
In reply to Sasha LevinFrom: Jan Kara <[email protected]>
[ Upstream commit f05f2429eec60851b98bdde213de31dab697c01b ]
When memory allocation of iinfo or block allocation fails, already allocated struct udf_inode_info gets freed with iput() and udf_evict_inode() may look at inode fields which are not properly initialized. Fix it by marking inode bad before dropping reference to it in udf_new_inode().
--- fs/udf/ialloc.c | 2 ++ 1 file changed, 2 insertions(+)
fs/udf/ialloc.c +2 -0
@@ -77,6 +77,7 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode) GFP_KERNEL); }if (!iinfo->i_data) { +make_bad_inode (inode);iput (inode);return ERR_PTR (-ENOMEM ); }
@@ -86,6 +87,7 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode) dinfo->i_location.partitionReferenceNum, start, &err);if (err) { +make_bad_inode (inode);iput (inode);return ERR_PTR (err); }
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 26/34 MIPS: OCTEON: add put_device() after of_find_device_by_node()
In reply to Sasha LevinFrom: Ye Guojin <[email protected]>
[ Upstream commit 858779df1c0787d3fec827fb705708df9ebdb15b ]
This was found by coccicheck:./arch/mips/cavium-octeon/octeon-platform.c, 332, 1-7, ERROR missing put_device; call of_find_device_by_node on line 324, but without a corresponding object release within this function. ./arch/mips/cavium-octeon/octeon-platform.c, 395, 1-7, ERROR missing put_device; call of_find_device_by_node on line 387, but without a corresponding object release within this function. ./arch/mips/cavium-octeon/octeon-usb.c, 512, 3-9, ERROR missing put_device; call of_find_device_by_node on line 515, but without a corresponding object release within this function. ./arch/mips/cavium-octeon/octeon-usb.c, 543, 1-7, ERROR missing put_device; call of_find_device_by_node on line 515, but without a corresponding object release within this function.
--- arch/mips/cavium-octeon/octeon-platform.c | 2 ++ arch/mips/cavium-octeon/octeon-usb.c | 1 + 2 files changed, 3 insertions(+)
arch/mips/cavium-octeon/octeon-platform.c +2 -0
@@ -328,6 +328,7 @@ static int __init octeon_ehci_device_init(void) pd->dev.platform_data = &octeon_ehci_pdata;octeon_ehci_hw_start (&pd->dev); +put_device (&pd->dev);return ret; }
@@ -391,6 +392,7 @@ static int __init octeon_ohci_device_init(void) pd->dev.platform_data = &octeon_ohci_pdata;octeon_ohci_hw_start (&pd->dev); +put_device (&pd->dev);return ret; }
arch/mips/cavium-octeon/octeon-usb.c +1 -0
@@ -544,6 +544,7 @@ static int __init dwc3_octeon_device_init(void)devm_iounmap (&pdev->dev, base);devm_release_mem_region (&pdev->dev, res->start,resource_size (res)); +put_device (&pdev->dev); } }while (node !=NULL );
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 27/34 irqchip/gic-v4: Disable redistributors' view of the VPE table at boot time
In reply to Sasha LevinFrom: Marc Zyngier <[email protected]>
[ Upstream commit 79a7f77b9b154d572bd9d2f1eecf58c4d018d8e2 ]
Jay Chen reported that using a kdump kernel on a GICv4.1 system results in a RAS error being delivered when the secondary kernel configures the ITS's view of the new VPE table.
As it turns out, that's because each RD still has a pointer to the previous instance of the VPE table, and that particular implementation is very upset by seeing two bits of the HW that should point to the same table with different values.
To solve this, let's invalidate any reference that any RD has to the VPE table when discovering the RDs. The ITS can then be programmed as expected.
--- drivers/irqchip/irq-gic-v3.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/irqchip/irq-gic-v3.c +16 -0
@@ -915,6 +915,22 @@ static int __gic_update_rdist_properties(struct redist_region *region, {u64 typer =gic_read_typer (ptr +GICR_TYPER ); +/* Boot-time cleanip */ +if ((typer &GICR_TYPER_VLPIS ) && (typer &GICR_TYPER_RVPEID )) { +u64 val; + +/* Deactivate any present vPE */ + val =gicr_read_vpendbaser (ptr +SZ_128K +GICR_VPENDBASER ); +if (val & GICR_VPENDBASER_Valid) +gicr_write_vpendbaser (GICR_VPENDBASER_PendingLast, + ptr +SZ_128K +GICR_VPENDBASER ); + +/* Mark the VPE table as invalid */ + val =gicr_read_vpropbaser (ptr +SZ_128K +GICR_VPROPBASER ); + val &= ~GICR_VPROPBASER_4_1_VALID ; +gicr_write_vpropbaser (val, ptr +SZ_128K +GICR_VPROPBASER ); + } + gic_data.rdists.has_vlpis &= !!(typer &GICR_TYPER_VLPIS );/* RVPEID implies some form of DirectLPI, no matter what the doc says... :-/ */
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 28/34 i2c: designware-pci: Fix to change data types of hcnt and lcnt parameters
In reply to Sasha LevinFrom: Lakshmi Sowjanya D <[email protected]>
[ Upstream commit d52097010078c1844348dc0e467305e5f90fd317 ]
The data type of hcnt and lcnt in the struct dw_i2c_dev is of type u16. It's better to have same data type in struct dw_scl_sda_cfg as well.
--- drivers/i2c/busses/i2c-designware-pcidrv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/i2c/busses/i2c-designware-pcidrv.c +4 -4
@@ -37,10 +37,10 @@ enum dw_pci_ctl_id_t { };struct dw_scl_sda_cfg { -u32 ss_hcnt; -u32 fs_hcnt; -u32 ss_lcnt; -u32 fs_lcnt; +u16 ss_hcnt; +u16 fs_hcnt; +u16 ss_lcnt; +u16 fs_lcnt;u32 sda_hold; };
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 29/34 MIPS: Octeon: Fix build errors using clang
In reply to Sasha LevinFrom: Tianjia Zhang <[email protected]>
[ Upstream commit 95339b70677dc6f9a2d669c4716058e71b8dc1c7 ]
A large number of the following errors is reported when compiling with clang:
cvmx-bootinfo.h:326:3: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int]
ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NULL)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cvmx-bootinfo.h:321:20: note: expanded from macro 'ENUM_BRD_TYPE_CASE'
case x: return(#x + 16); /* Skip CVMX_BOARD_TYPE_ */
~~~^~~~
cvmx-bootinfo.h:326:3: note: use array indexing to silence this warning
cvmx-bootinfo.h:321:20: note: expanded from macro 'ENUM_BRD_TYPE_CASE'
case x: return(#x + 16); /* Skip CVMX_BOARD_TYPE_ */
^Follow the prompts to use the address operator '&' to fix this error.
--- arch/mips/include/asm/octeon/cvmx-bootinfo.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/include/asm/octeon/cvmx-bootinfo.h +2 -2
@@ -317,7 +317,7 @@ enum cvmx_chip_types_enum {/* Functions to return string based on type */ #define ENUM_BRD_TYPE_CASE (x) \ - case x: return(#x + 16);/* Skip CVMX_BOARD_TYPE_ */ + case x: return (&#x[16]);/* Skip CVMX_BOARD_TYPE_ */ static inline const char *cvmx_board_type_to_string (enum cvmx_board_types_enum type) {
@@ -408,7 +408,7 @@ static inline const char *cvmx_board_type_to_string(enum }#define ENUM_CHIP_TYPE_CASE (x) \ - case x: return(#x + 15);/* Skip CVMX_CHIP_TYPE */ + case x: return (&#x[15]);/* Skip CVMX_CHIP_TYPE */ static inline const char *cvmx_chip_type_to_string (enum cvmx_chip_types_enum type) {
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 30/34 scsi: sr: Don't use GFP_DMA
In reply to Sasha LevinFrom: Christoph Hellwig <[email protected]>
[ Upstream commit d94d94969a4ba07a43d62429c60372320519c391 ]
The allocated buffers are used as a command payload, for which the block layer and/or DMA API do the proper bounce buffering if needed.
--- drivers/scsi/sr.c | 2 +- drivers/scsi/sr_vendor.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/sr.c +1 -1
@@ -917,7 +917,7 @@ static void get_capabilities(struct scsi_cd *cd)/* allocate transfer buffer */ - buffer =kmalloc (512 ,GFP_KERNEL |GFP_DMA ); + buffer =kmalloc (512 ,GFP_KERNEL );if (!buffer) {sr_printk (KERN_ERR , cd,"out of memory.\n" );return ;
drivers/scsi/sr_vendor.c +2 -2
@@ -131,7 +131,7 @@ int sr_set_blocklength(Scsi_CD *cd, int blocklength)if (cd->vendor ==VENDOR_TOSHIBA ) density = (blocklength >2048 ) ?0x81 :0x83 ; - buffer =kmalloc (512 ,GFP_KERNEL |GFP_DMA ); + buffer =kmalloc (512 ,GFP_KERNEL );if (!buffer)return -ENOMEM ;
@@ -179,7 +179,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)if (cd->cdi.mask &CDC_MULTI_SESSION )return 0 ; - buffer =kmalloc (512 ,GFP_KERNEL |GFP_DMA ); + buffer =kmalloc (512 ,GFP_KERNEL );if (!buffer)return -ENOMEM ;
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 31/34 ASoC: mediatek: mt8173: fix device_node leak
In reply to Sasha LevinFrom: Tzung-Bi Shih <[email protected]>
[ Upstream commit 493433785df0075afc0c106ab65f10a605d0b35d ]
Fixes the device_node leak.
--- sound/soc/mediatek/mt8173/mt8173-max98090.c | 3 +++ sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c | 2 ++ sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c | 2 ++ sound/soc/mediatek/mt8173/mt8173-rt5650.c | 2 ++ 4 files changed, 9 insertions(+)
sound/soc/mediatek/mt8173/mt8173-max98090.c +3 -0
@@ -180,6 +180,9 @@ static int mt8173_max98090_dev_probe(struct platform_device *pdev)if (ret)dev_err (&pdev->dev,"%s snd_soc_register_card fail %d\n" , __func__, ret); + +of_node_put (codec_node); +of_node_put (platform_node);return ret; }
sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c +2 -0
@@ -218,6 +218,8 @@ static int mt8173_rt5650_rt5514_dev_probe(struct platform_device *pdev)if (ret)dev_err (&pdev->dev,"%s snd_soc_register_card fail %d\n" , __func__, ret); + +of_node_put (platform_node);return ret; }
sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c +2 -0
@@ -285,6 +285,8 @@ static int mt8173_rt5650_rt5676_dev_probe(struct platform_device *pdev)if (ret)dev_err (&pdev->dev,"%s snd_soc_register_card fail %d\n" , __func__, ret); + +of_node_put (platform_node);return ret; }
sound/soc/mediatek/mt8173/mt8173-rt5650.c +2 -0
@@ -323,6 +323,8 @@ static int mt8173_rt5650_dev_probe(struct platform_device *pdev)if (ret)dev_err (&pdev->dev,"%s snd_soc_register_card fail %d\n" , __func__, ret); + +of_node_put (platform_node);return ret; }
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 32/34 ASoC: mediatek: mt8183: fix device_node leak
In reply to Sasha LevinFrom: Tzung-Bi Shih <[email protected]>
[ Upstream commit cb006006fe6221f092fadaffd3f219288304c9ad ]
Fixes the device_node leak.
--- sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c | 6 +++++- sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-)
sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c +5 -1
@@ -787,7 +787,11 @@ static int mt8183_da7219_max98357_dev_probe(struct platform_device *pdev)return ret; } -return devm_snd_soc_register_card (&pdev->dev, card); + ret =devm_snd_soc_register_card (&pdev->dev, card); + +of_node_put (platform_node); +of_node_put (hdmi_codec); +return ret; }#ifdef CONFIG_OF
sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c +6 -1
@@ -720,7 +720,12 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev) __func__, ret); } -return devm_snd_soc_register_card (&pdev->dev, card); + ret =devm_snd_soc_register_card (&pdev->dev, card); + +of_node_put (platform_node); +of_node_put (ec_codec); +of_node_put (hdmi_codec); +return ret; }#ifdef CONFIG_OF
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 33/34 phy: mediatek: Fix missing check in mtk_mipi_tx_probe
In reply to Sasha LevinFrom: Miaoqian Lin <[email protected]>
[ Upstream commit 399c91c3f30531593e5ff6ca7b53f47092128669 ]
The of_device_get_match_data() function may return NULL. Add check to prevent potential null dereference.
--- drivers/gpu/drm/mediatek/mtk_mipi_tx.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/mediatek/mtk_mipi_tx.c +2 -0
@@ -147,6 +147,8 @@ static int mtk_mipi_tx_probe(struct platform_device *pdev)return -ENOMEM ; mipi_tx->driver_data =of_device_get_match_data (dev); +if (!mipi_tx->driver_data) +return -ENODEV ; mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); mipi_tx->regs =devm_ioremap_resource (dev, mem);
Signature · 1 line
2.34.1
Sasha Levin
maintainerPATCH 34/34 leds: leds-fsg: Drop FSG3 LED driver
In reply to Sasha LevinFrom: Linus Walleij <[email protected]>
[ Upstream commit b7f1ac9bb6413b739ea91bd61bdf23c9130a8007 ]
The board file using this driver has been deleted and the FSG3 LEDs can be modeled using a system controller and some register bit LEDs in the device tree so this driver is no longer needed.
--- drivers/leds/Kconfig | 7 -- drivers/leds/Makefile | 1 - drivers/leds/leds-fsg.c | 193 ---------------------------------------- 3 files changed, 201 deletions(-) delete mode 100644 drivers/leds/leds-fsg.c
drivers/leds/Kconfig +0 -7
@@ -288,13 +288,6 @@ config LEDS_NET48XX This option enables support for the Soekris net4801 and net4826 error LED. -config LEDS_FSG - tristate "LED Support for the Freecom FSG-3" - depends on LEDS_CLASS - depends on MACH_FSG - help - This option enables support for the LEDs on the Freecom FSG-3. - config LEDS_WRAP tristate "LED Support for the WRAP series LEDs" depends on LEDS_CLASS
drivers/leds/Makefile +0 -1
@@ -28,7 +28,6 @@ obj-$(CONFIG_LEDS_COBALT_RAQ) += leds-cobalt-raq.o obj-$(CONFIG_LEDS_CPCAP) += leds-cpcap.o obj-$(CONFIG_LEDS_DA903X) += leds-da903x.o obj-$(CONFIG_LEDS_DA9052) += leds-da9052.o -obj-$(CONFIG_LEDS_FSG) += leds-fsg.o obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o obj-$(CONFIG_LEDS_GPIO_REGISTER) += leds-gpio-register.o obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o
drivers/leds/leds-fsg.c deleted +0 -193
193 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH AUTOSEL 5.10 34/34] leds: leds-fsg: Drop FSG3 LED driver
Quoted 8 lines · Sasha Levin
From: Linus Walleij <[email protected]>
[ Upstream commit
b7f1ac9bb6413b739ea91bd61bdf23c9130a8007]The board file using this driver has been deleted and the FSG3 LEDs can be modeled using a system controller and some register bit LEDs in the device tree so this driver is no longer needed.
Please drop.
Pavel
Signature · 1 line
http://www.livejournal.com/~pavelmachek
Sasha Levin
maintainerRe: [PATCH AUTOSEL 5.10 34/34] leds: leds-fsg: Drop FSG3 LED driver
Quoted 11 lines · Pavel Machek
Quoted 8 lines · Sasha Levin
From: Linus Walleij <[email protected]>
[ Upstream commit
b7f1ac9bb6413b739ea91bd61bdf23c9130a8007]The board file using this driver has been deleted and the FSG3 LEDs can be modeled using a system controller and some register bit LEDs in the device tree so this driver is no longer needed.
Please drop.
Uh, not sure how it made it in to begin with. Dropped, thanks!
Signature · 2 lines
Thanks, Sasha