ASoC: ops: Fix off by one in range control validation
Subsystems (6)
Sasha Levin
maintainerPATCH 2/15 pinctrl: aspeed: Fix potential NULL dereference in aspeed_pinmux_set_mux()
In reply to Sasha LevinFrom: Haowen Bai <[email protected]>
[ Upstream commit 84a85d3fef2e75b1fe9fc2af6f5267122555a1ed ]
pdesc could be null but still dereference pdesc->name and it will lead to a null pointer access. So we move a null check before dereference.
--- drivers/pinctrl/aspeed/pinctrl-aspeed.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/aspeed/pinctrl-aspeed.c +2 -2
@@ -235,11 +235,11 @@ int aspeed_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned int function,const struct aspeed_sig_expr **funcs;const struct aspeed_sig_expr ***prios; -pr_debug ("Muxing pin %s for %s\n" , pdesc->name, pfunc->name); -if (!pdesc)return -EINVAL ; +pr_debug ("Muxing pin %s for %s\n" , pdesc->name, pfunc->name); + prios = pdesc->prios;if (!prios)
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 9/15 irqchip: or1k-pic: Undefine mask_ack for level triggered hardware
In reply to Sasha LevinFrom: Stafford Horne <[email protected]>
[ Upstream commit 8520501346ed8d1c4a6dfa751cb57328a9c843f1 ]
The mask_ack operation clears the interrupt by writing to the PICSR register. This we don't want for level triggered interrupt because it does not actually clear the interrupt on the source hardware.
This was causing issues in qemu with multi core setups where interrupts would continue to fire even though they had been cleared in PICSR.
Just remove the mask_ack operation.
--- drivers/irqchip/irq-or1k-pic.c | 1 - 1 file changed, 1 deletion(-)
drivers/irqchip/irq-or1k-pic.c +0 -1
@@ -66,7 +66,6 @@ static struct or1k_pic_dev or1k_pic_level = { .name = "or1k-PIC-level", .irq_unmask = or1k_pic_unmask, .irq_mask = or1k_pic_mask, - .irq_mask_ack = or1k_pic_mask_ack, }, .handle = handle_level_irq, .flags = IRQ_LEVEL | IRQ_NOPROBE,
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 14/15 nvme-pci: phison e16 has bogus namespace ids
In reply to Sasha LevinFrom: Keith Busch <[email protected]>
[ Upstream commit 73029c9b23cf1213e5f54c2b59efce08665199e7 ]
Add the quirk.
--- drivers/nvme/host/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/pci.c +2 -1
@@ -3234,7 +3234,8 @@ static const struct pci_device_id nvme_id_table[] = {NVME_QUIRK_DISABLE_WRITE_ZEROES | NVME_QUIRK_IGNORE_DEV_SUBNQN, }, { PCI_DEVICE(0x1987, 0x5016), /* Phison E16 */ - .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, }, + .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN | + NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(0x1b4b, 0x1092), /* Lexar 256 GB SSD */ .driver_data = NVME_QUIRK_NO_NS_DESC_LIST | NVME_QUIRK_IGNORE_DEV_SUBNQN, },
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 13/15 Revert "can: xilinx_can: Limit CANFD brp to 2"
In reply to Sasha LevinFrom: Srinivas Neeli <[email protected]>
[ Upstream commit c6da4590fe819dfe28a4f8037a8dc1e056542fb4 ]
This reverts commit 05ca14fdb6fe65614e0652d03e44b02748d25af7.
On early silicon engineering samples observed bit shrinking issue when we use brp as 1. Hence updated brp_min as 2. As in production silicon this issue is fixed, so reverting the patch.
--- drivers/net/can/xilinx_can.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/can/xilinx_can.c +2 -2
@@ -259,7 +259,7 @@ static const struct can_bittiming_const xcan_bittiming_const_canfd2 = { .tseg2_min = 1, .tseg2_max = 128, .sjw_max = 128, - .brp_min = 2, + .brp_min = 1, .brp_max = 256, .brp_inc = 1, };
@@ -272,7 +272,7 @@ static const struct can_bittiming_const xcan_data_bittiming_const_canfd2 = { .tseg2_min = 1, .tseg2_max = 16, .sjw_max = 16, - .brp_min = 2, + .brp_min = 1, .brp_max = 256, .brp_inc = 1, };
Signature · 7 lines
2.35.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 1/15 ASoC: ops: Fix off by one in range control validation
From: Mark Brown <[email protected]>
[ Upstream commit 5871321fb4558c55bf9567052b618ff0be6b975e ]
We currently report that range controls accept a range of 0..(max-min) but accept writes in the range 0..(max-min+1). Remove that extra +1.
--- sound/soc/soc-ops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/soc-ops.c +2 -2
@@ -517,7 +517,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,return -EINVAL ;if (mc->platform_max && tmp > mc->platform_max)return -EINVAL ; -if (tmp > mc->max - mc->min +1 ) +if (tmp > mc->max - mc->min)return -EINVAL ;if (invert)
@@ -538,7 +538,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol,return -EINVAL ;if (mc->platform_max && tmp > mc->platform_max)return -EINVAL ; -if (tmp > mc->max - mc->min +1 ) +if (tmp > mc->max - mc->min)return -EINVAL ;if (invert)
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 3/15 ASoC: SOF: Intel: hda-loader: Clarify the cl_dsp_init() flow
From: Peter Ujfalusi <[email protected]>
[ Upstream commit bbfef046c6613404c01aeb9e9928bebb78dd327a ]
Update the comment for the cl_dsp_init() to clarify what is done by the function and use the chip->init_core_mask instead of BIT(0) when unstalling/running the init core.
Complements: 2a68ff846164 ("ASoC: SOF: Intel: hda: Revisit IMR boot sequence")
--- sound/soc/sof/intel/hda-loader.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/soc/sof/intel/hda-loader.c +4 -4
@@ -79,9 +79,9 @@ static struct hdac_ext_stream *cl_stream_prepare(struct snd_sof_dev *sdev, unsig }/* -* first boot sequence has some extra steps. core 0 waits for power -* status on core 1, so power up core 1 also momentarily, keep it in -* reset/stall and then turn it off +* first boot sequence has some extra steps. +* power on all host managed cores and only unstall/run the boot core to boot the +* DSP then turn off all non boot cores (if any) is powered on. */ static int cl_dsp_init (struct snd_sof_dev *sdev,int stream_tag) {
@@ -115,7 +115,7 @@ static int cl_dsp_init(struct snd_sof_dev *sdev, int stream_tag) ((stream_tag - 1) << 9)));/* step 3: unset core 0 reset state & unstall/run core 0 */ - ret =hda_dsp_core_run (sdev,BIT (0 )); + ret =hda_dsp_core_run (sdev, chip->init_core_mask);if (ret <0 ) {if (hda->boot_iteration ==HDA_FW_BOOT_ATTEMPTS ) dev_err(sdev->dev,
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 4/15 ASoC: wm5110: Fix DRE control
In reply to Sasha LevinFrom: Charles Keepax <[email protected]>
[ Upstream commit 0bc0ae9a5938d512fd5d44f11c9c04892dcf4961 ]
The DRE controls on wm5110 should return a value of 1 if the DRE state is actually changed, update to fix this.
--- sound/soc/codecs/wm5110.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
sound/soc/codecs/wm5110.c +6 -2
@@ -413,6 +413,7 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,unsigned int rnew = (!!ucontrol->value.integer.value[1 ]) << mc->rshift;unsigned int lold, rold;unsigned int lena, rena; +bool change = false;int ret;snd_soc_dapm_mutex_lock (dapm);
@@ -440,8 +441,8 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol, goto err; } - ret =regmap_update_bits (arizona->regmap,ARIZONA_DRE_ENABLE , - mask, lnew | rnew); + ret =regmap_update_bits_check (arizona->regmap,ARIZONA_DRE_ENABLE , + mask, lnew | rnew, &change);if (ret) {dev_err (arizona->dev,"Failed to set DRE: %d\n" , ret); goto err;
@@ -454,6 +455,9 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol,if (!rnew && rold)wm5110_clear_pga_volume (arizona, mc->rshift); +if (change) + ret =1 ; + err:snd_soc_dapm_mutex_unlock (dapm);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 8/15 ASoC: madera: Fix event generation for rate controls
In reply to Sasha LevinFrom: Charles Keepax <[email protected]>
[ Upstream commit 980555e95f7cabdc9c80a07107622b097ba23703 ]
madera_adsp_rate_put always returns zero regardless of if the control value was updated. This results in missing notifications to user-space of the control change. Update the handling to return 1 when the value is changed.
--- sound/soc/codecs/madera.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/codecs/madera.c +3 -3
@@ -899,7 +899,7 @@ static int madera_adsp_rate_put(struct snd_kcontrol *kcontrol,struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;const int adsp_num = e->shift_l;const unsigned int item = ucontrol->value.enumerated.item[0 ]; -int ret; +int ret =0 ;if (item >= e->items)return -EINVAL ;
@@ -916,10 +916,10 @@ static int madera_adsp_rate_put(struct snd_kcontrol *kcontrol,"Cannot change '%s' while in use by active audio paths\n" , kcontrol->id.name); ret = -EBUSY ; - }else { + }else if (priv->adsp_rate_cache[adsp_num] != e->values[item]) {/* Volatile register so defer until the codec is powered up */ priv->adsp_rate_cache[adsp_num] = e->values[item]; - ret =0 ; + ret =1 ; }mutex_unlock (&priv->rate_lock);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 10/15 x86: Clear .brk area at early boot
In reply to Sasha LevinFrom: Juergen Gross <[email protected]>
[ Upstream commit 38fa5479b41376dc9d7f57e71c83514285a25ca0 ]
The .brk section has the same properties as .bss: it is an alloc-only section and should be cleared before being used.
Not doing so is especially a problem for Xen PV guests, as the hypervisor will validate page tables (check for writable page tables and hypervisor private bits) before accepting them to be used.
Make sure .brk is initially zero by letting clear_bss() clear the brk area, too.
--- arch/x86/kernel/head64.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/kernel/head64.c +2 -0
@@ -419,6 +419,8 @@ static void __init clear_bss(void) {memset (__bss_start,0 , (unsigned long ) __bss_stop - (unsigned long ) __bss_start); +memset (__brk_base,0 , + (unsigned long ) __brk_limit - (unsigned long ) __brk_base); }static unsigned long get_cmd_line_ptr (void )
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 12/15 ARM: dts: stm32: use the correct clock source for CEC on stm32mp151
In reply to Sasha LevinFrom: Gabriel Fernandez <[email protected]>
[ Upstream commit 78ece8cce1ba0c3f3e5a7c6c1b914b3794f04c44 ]
The peripheral clock of CEC is not LSE but CEC.
--- arch/arm/boot/dts/stm32mp151.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/stm32mp151.dtsi +1 -1
@@ -543,7 +543,7 @@ cec: cec@40016000 { compatible = "st,stm32-cec"; reg = <0x40016000 0x400>; interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&rcc CEC_K>, <&clk_lse>; + clocks = <&rcc CEC_K>, <&rcc CEC>; clock-names = "cec", "hdmi-cec"; status = "disabled"; };
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 6/15 ASoC: cs47l15: Fix event generation for low power mux control
In reply to Sasha LevinFrom: Charles Keepax <[email protected]>
[ Upstream commit 7f103af4a10f375b9b346b4d0b730f6a66b8c451 ]
cs47l15_in1_adc_put always returns zero regardless of if the control value was updated. This results in missing notifications to user-space of the control change. Update the handling to return 1 when the value is changed.
--- sound/soc/codecs/cs47l15.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
sound/soc/codecs/cs47l15.c +4 -1
@@ -122,6 +122,9 @@ static int cs47l15_in1_adc_put(struct snd_kcontrol *kcontrol,snd_soc_kcontrol_component (kcontrol);struct cs47l15 *cs47l15 =snd_soc_component_get_drvdata (component); +if (!!ucontrol->value.integer.value[0 ] == cs47l15->in1_lp_mode) +return 0 ; +switch (ucontrol->value.integer.value[0 ]) {case 0 :/* Set IN1 to normal mode */
@@ -150,7 +153,7 @@ static int cs47l15_in1_adc_put(struct snd_kcontrol *kcontrol,break ; } -return 0 ; +return 1 ; }static const struct snd_kcontrol_new cs47l15_snd_controls[] = {
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 5/15 ASoC: dapm: Initialise kcontrol data for mux/demux controls
In reply to Sasha LevinFrom: Charles Keepax <[email protected]>
[ Upstream commit 11d7a12f7f50baa5af9090b131c9b03af59503e7 ]
DAPM keeps a copy of the current value of mux/demux controls, however this value is only initialised in the case of autodisable controls. This leads to false notification events when first modifying a DAPM kcontrol that has a non-zero default.
Autodisable controls are left as they are, since they already initialise the value, and there would be more work required to support autodisable muxes where the first option isn't disabled and/or that isn't the default.
Technically this issue could affect mixer/switch elements as well, although not on any of the devices I am currently running. There is also a little more work to do to address the issue there due to that side supporting stereo controls, so that has not been tackled in this patch.
--- sound/soc/soc-dapm.c | 5 +++++ 1 file changed, 5 insertions(+)
sound/soc/soc-dapm.c +5 -0
@@ -62,6 +62,8 @@ struct snd_soc_dapm_widget * snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm, const struct snd_soc_dapm_widget *widget); +static unsigned int soc_dapm_read (struct snd_soc_dapm_context *dapm,int reg); +/* dapm power sequences - make this per codec in the future */ static int dapm_up_seq[] = { [snd_soc_dapm_pre] =1 ,
@@ -442,6 +444,9 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,snd_soc_dapm_add_path (widget->dapm, data->widget, widget,NULL ,NULL ); + }else if (e->reg !=SND_SOC_NOPM ) { + data->value =soc_dapm_read (widget->dapm, e->reg) & + (e->mask << e->shift_l); }break ;default :
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 7/15 ASoC: madera: Fix event generation for OUT1 demux
In reply to Sasha LevinFrom: Charles Keepax <[email protected]>
[ Upstream commit e3cabbef3db8269207a6b8808f510137669f8deb ]
madera_out1_demux_put returns the value of snd_soc_dapm_mux_update_power, which returns a 1 if a path was found for the kcontrol. This is obviously different to the expected return a 1 if the control was updated value. This results in spurious notifications to user-space. Update the handling to only return a 1 when the value is changed.
--- sound/soc/codecs/madera.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
sound/soc/codecs/madera.c +7 -1
@@ -618,7 +618,13 @@ int madera_out1_demux_put(struct snd_kcontrol *kcontrol, end:snd_soc_dapm_mutex_unlock (dapm); -return snd_soc_dapm_mux_update_power (dapm, kcontrol, mux, e,NULL ); + ret =snd_soc_dapm_mux_update_power (dapm, kcontrol, mux, e,NULL ); +if (ret <0 ) { +dev_err (madera->dev,"Failed to update demux power state: %d\n" , ret); +return ret; + } + +return change; }EXPORT_SYMBOL_GPL (madera_out1_demux_put);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 15/15 signal handling: don't use BUG_ON() for debugging
In reply to Sasha LevinFrom: Linus Torvalds <[email protected]>
[ Upstream commit a382f8fee42ca10c9bfce0d2352d4153f931f5dc ]
These are indeed "should not happen" situations, but it turns out recent changes made the 'task_is_stopped_or_trace()' case trigger (fix for that exists, is pending more testing), and the BUG_ON() makes it unnecessarily hard to actually debug for no good reason.
It's been that way for a long time, but let's make it clear: BUG_ON() is not good for debugging, and should never be used in situations where you could just say "this shouldn't happen, but we can continue".
Use WARN_ON_ONCE() instead to make sure it gets logged, and then just continue running. Instead of making the system basically unusuable because you crashed the machine while potentially holding some very core locks (eg this function is commonly called while holding 'tasklist_lock' for writing).
--- kernel/signal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/signal.c +4 -4
@@ -1912,12 +1912,12 @@ bool do_notify_parent(struct task_struct *tsk, int sig)bool autoreap = false;u64 utime, stime; -BUG_ON (sig ==-1 ); +WARN_ON_ONCE (sig ==-1 ); -/* do_notify_parent_cldstop should have been called instead. */ -BUG_ON (task_is_stopped_or_traced (tsk)); +/* do_notify_parent_cldstop should have been called instead. */ +WARN_ON_ONCE (task_is_stopped_or_traced (tsk)); -BUG_ON (!tsk->ptrace && +WARN_ON_ONCE (!tsk->ptrace && (tsk->group_leader != tsk || !thread_group_empty (tsk)));/* Wake up all pidfd waiters */
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 11/15 soc: ixp4xx/npe: Fix unused match warning
In reply to Sasha LevinFrom: Linus Walleij <[email protected]>
[ Upstream commit 620f83b8326ce9706b1118334f0257ae028ce045 ]
The kernel test robot found this inconsistency:
drivers/soc/ixp4xx/ixp4xx-npe.c:737:34: warning:
'ixp4xx_npe_of_match' defined but not used [-Wunused-const-variable=]
737 | static const struct of_device_id ixp4xx_npe_of_match[] = {This is because the match is enclosed in the of_match_ptr() which compiles into NULL when OF is disabled and this is unnecessary.
Fix it by dropping of_match_ptr() around the match.
--- drivers/soc/ixp4xx/ixp4xx-npe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/ixp4xx/ixp4xx-npe.c +1 -1
@@ -735,7 +735,7 @@ static const struct of_device_id ixp4xx_npe_of_match[] = {static struct platform_driver ixp4xx_npe_driver = { .driver = { .name ="ixp4xx-npe" , - .of_match_table =of_match_ptr (ixp4xx_npe_of_match), + .of_match_table = ixp4xx_npe_of_match, }, .probe = ixp4xx_npe_probe, .remove = ixp4xx_npe_remove,
Signature · 1 line
2.35.1