* [PATCH AUTOSEL 5.12 05/63] Revert "ALSA: sb: fix a missing check of snd_ctl_add"
[not found] <20210524144620.2497249-1-sashal@kernel.org>
@ 2021-05-24 14:45 ` Sasha Levin
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 16/63] Revert "ALSA: gus: add a check of the status " Sasha Levin
` (7 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Sasha Levin @ 2021-05-24 14:45 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Takashi Iwai, Greg Kroah-Hartman, alsa-devel, Sasha Levin,
Aditya Pakki
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit 4b059ce1f4b368208c2310925f49be77f15e527b ]
This reverts commit beae77170c60aa786f3e4599c18ead2854d8694d.
Because of recent interactions with developers from @umn.edu, all
commits from them have been recently re-reviewed to ensure if they were
correct or not.
Upon review, this commit was found to be incorrect for the reasons
below, so it must be reverted. It is safe to ignore this error as the
mixer element is optional, and the driver is very legacy.
Cc: Aditya Pakki <pakki001@umn.edu>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210503115736.2104747-8-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/isa/sb/sb16_main.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c
index 38dc1fde25f3..aa4870531023 100644
--- a/sound/isa/sb/sb16_main.c
+++ b/sound/isa/sb/sb16_main.c
@@ -846,14 +846,10 @@ int snd_sb16dsp_pcm(struct snd_sb *chip, int device)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_sb16_playback_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_sb16_capture_ops);
- if (chip->dma16 >= 0 && chip->dma8 != chip->dma16) {
- err = snd_ctl_add(card, snd_ctl_new1(
- &snd_sb16_dma_control, chip));
- if (err)
- return err;
- } else {
+ if (chip->dma16 >= 0 && chip->dma8 != chip->dma16)
+ snd_ctl_add(card, snd_ctl_new1(&snd_sb16_dma_control, chip));
+ else
pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
- }
snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
card->dev, 64*1024, 128*1024);
--
2.30.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH AUTOSEL 5.12 16/63] Revert "ALSA: gus: add a check of the status of snd_ctl_add"
[not found] <20210524144620.2497249-1-sashal@kernel.org>
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 05/63] Revert "ALSA: sb: fix a missing check of snd_ctl_add" Sasha Levin
@ 2021-05-24 14:45 ` Sasha Levin
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 17/63] ALSA: sb8: Add a comment note regarding an unused pointer Sasha Levin
` (6 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Sasha Levin @ 2021-05-24 14:45 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Takashi Iwai, Greg Kroah-Hartman, alsa-devel, Kangjie Lu,
Sasha Levin
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit 1dacca7fa1ebea47d38d20cd2df37094805d2649 ]
This reverts commit 0f25e000cb4398081748e54f62a902098aa79ec1.
Because of recent interactions with developers from @umn.edu, all
commits from them have been recently re-reviewed to ensure if they were
correct or not.
Upon review, this commit was found to be incorrect for the reasons
below, so it must be reverted. It will be fixed up "correctly" in a
later kernel change.
The original commit did nothing if there was an error, except to print
out a message, which is pointless. So remove the commit as it gives a
"false sense of doing something".
Cc: Kangjie Lu <kjlu@umn.edu>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210503115736.2104747-33-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/isa/gus/gus_main.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c
index afc088f0377c..b7518122a10d 100644
--- a/sound/isa/gus/gus_main.c
+++ b/sound/isa/gus/gus_main.c
@@ -77,17 +77,8 @@ static const struct snd_kcontrol_new snd_gus_joystick_control = {
static void snd_gus_init_control(struct snd_gus_card *gus)
{
- int ret;
-
- if (!gus->ace_flag) {
- ret =
- snd_ctl_add(gus->card,
- snd_ctl_new1(&snd_gus_joystick_control,
- gus));
- if (ret)
- snd_printk(KERN_ERR "gus: snd_ctl_add failed: %d\n",
- ret);
- }
+ if (!gus->ace_flag)
+ snd_ctl_add(gus->card, snd_ctl_new1(&snd_gus_joystick_control, gus));
}
/*
--
2.30.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH AUTOSEL 5.12 17/63] ALSA: sb8: Add a comment note regarding an unused pointer
[not found] <20210524144620.2497249-1-sashal@kernel.org>
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 05/63] Revert "ALSA: sb: fix a missing check of snd_ctl_add" Sasha Levin
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 16/63] Revert "ALSA: gus: add a check of the status " Sasha Levin
@ 2021-05-24 14:45 ` Sasha Levin
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 18/63] Revert "ALSA: usx2y: Fix potential NULL pointer dereference" Sasha Levin
` (5 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Sasha Levin @ 2021-05-24 14:45 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Takashi Iwai, Greg Kroah-Hartman, Atul Gopinathan, alsa-devel,
Sasha Levin
From: Atul Gopinathan <atulgopinathan@gmail.com>
[ Upstream commit a28591f61b60fac820c6de59826ffa710e5e314e ]
The field "fm_res" of "struct snd_sb8" is never used/dereferenced
throughout the sb8.c code. Therefore there is no need for any null value
check after the "request_region()".
Add a comment note to make developers know about this and prevent any
"NULL check" patches on this part of code.
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Atul Gopinathan <atulgopinathan@gmail.com>
Link: https://lore.kernel.org/r/20210503115736.2104747-36-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/isa/sb/sb8.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
index 6c9d534ce8b6..e17b58437e66 100644
--- a/sound/isa/sb/sb8.c
+++ b/sound/isa/sb/sb8.c
@@ -93,7 +93,11 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev)
acard = card->private_data;
card->private_free = snd_sb8_free;
- /* block the 0x388 port to avoid PnP conflicts */
+ /*
+ * Block the 0x388 port to avoid PnP conflicts.
+ * No need to check this value after request_region,
+ * as we never do anything with it.
+ */
acard->fm_res = request_region(0x388, 4, "SoundBlaster FM");
if (!acard->fm_res) {
err = -EBUSY;
--
2.30.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH AUTOSEL 5.12 18/63] Revert "ALSA: usx2y: Fix potential NULL pointer dereference"
[not found] <20210524144620.2497249-1-sashal@kernel.org>
` (2 preceding siblings ...)
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 17/63] ALSA: sb8: Add a comment note regarding an unused pointer Sasha Levin
@ 2021-05-24 14:45 ` Sasha Levin
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 29/63] Revert "ASoC: rt5645: fix a " Sasha Levin
` (4 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Sasha Levin @ 2021-05-24 14:45 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Takashi Iwai, Greg Kroah-Hartman, alsa-devel, Sasha Levin,
Aditya Pakki
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit 4667a6fc1777ce071504bab570d3599107f4790f ]
This reverts commit a2c6433ee5a35a8de6d563f6512a26f87835ea0f.
Because of recent interactions with developers from @umn.edu, all
commits from them have been recently re-reviewed to ensure if they were
correct or not.
Upon review, this commit was found to be incorrect for the reasons
below, so it must be reverted. It will be fixed up "correctly" in a
later kernel change.
The original patch was incorrect, and would leak memory if the error
path the patch added was hit.
Cc: Aditya Pakki <pakki001@umn.edu>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20210503115736.2104747-37-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/usx2y/usb_stream.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/sound/usb/usx2y/usb_stream.c b/sound/usb/usx2y/usb_stream.c
index 091c071b270a..6bba17bf689a 100644
--- a/sound/usb/usx2y/usb_stream.c
+++ b/sound/usb/usx2y/usb_stream.c
@@ -91,12 +91,7 @@ static int init_urbs(struct usb_stream_kernel *sk, unsigned use_packsize,
for (u = 0; u < USB_STREAM_NURBS; ++u) {
sk->inurb[u] = usb_alloc_urb(sk->n_o_ps, GFP_KERNEL);
- if (!sk->inurb[u])
- return -ENOMEM;
-
sk->outurb[u] = usb_alloc_urb(sk->n_o_ps, GFP_KERNEL);
- if (!sk->outurb[u])
- return -ENOMEM;
}
if (init_pipe_urbs(sk, use_packsize, sk->inurb, indata, dev, in_pipe) ||
--
2.30.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH AUTOSEL 5.12 29/63] Revert "ASoC: rt5645: fix a NULL pointer dereference"
[not found] <20210524144620.2497249-1-sashal@kernel.org>
` (3 preceding siblings ...)
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 18/63] Revert "ALSA: usx2y: Fix potential NULL pointer dereference" Sasha Levin
@ 2021-05-24 14:45 ` Sasha Levin
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 30/63] ASoC: rt5645: add error checking to rt5645_probe function Sasha Levin
` (3 subsequent siblings)
8 siblings, 0 replies; 14+ messages in thread
From: Sasha Levin @ 2021-05-24 14:45 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sasha Levin, Greg Kroah-Hartman, alsa-devel, Mark Brown,
Kangjie Lu
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit 1e0ce84215dbfd6065872e5d3755352da34f198b ]
This reverts commit 51dd97d1df5fb9ac58b9b358e63e67b530f6ae21.
Because of recent interactions with developers from @umn.edu, all
commits from them have been recently re-reviewed to ensure if they were
correct or not.
Upon review, this commit was found to be incorrect for the reasons
below, so it must be reverted. It will be fixed up "correctly" in a
later kernel change.
Lots of things seem to be still allocated here and must be properly
cleaned up if an error happens here.
Cc: Kangjie Lu <kjlu@umn.edu>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210503115736.2104747-55-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt5645.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 63a7e052eaa0..ab06133a85da 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3407,9 +3407,6 @@ static int rt5645_probe(struct snd_soc_component *component)
RT5645_HWEQ_NUM, sizeof(struct rt5645_eq_param_s),
GFP_KERNEL);
- if (!rt5645->eq_param)
- return -ENOMEM;
-
return 0;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH AUTOSEL 5.12 30/63] ASoC: rt5645: add error checking to rt5645_probe function
[not found] <20210524144620.2497249-1-sashal@kernel.org>
` (4 preceding siblings ...)
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 29/63] Revert "ASoC: rt5645: fix a " Sasha Levin
@ 2021-05-24 14:45 ` Sasha Levin
2021-05-25 14:01 ` Mark Brown
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 31/63] Revert "ASoC: cs43130: fix a NULL pointer dereference" Sasha Levin
` (2 subsequent siblings)
8 siblings, 1 reply; 14+ messages in thread
From: Sasha Levin @ 2021-05-24 14:45 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sasha Levin, Greg Kroah-Hartman, alsa-devel, Mark Brown,
Phillip Potter
From: Phillip Potter <phil@philpotter.co.uk>
[ Upstream commit 5e70b8e22b64eed13d5bbebcb5911dae65bf8c6b ]
Check for return value from various snd_soc_dapm_* calls, as many of
them can return errors and this should be handled. Also, reintroduce
the allocation failure check for rt5645->eq_param as well. Make all
areas where return values are checked lead to the end of the function
in the case of an error. Finally, introduce a comment explaining how
resources here are actually eventually cleaned up by the caller.
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210503115736.2104747-56-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/rt5645.c | 48 +++++++++++++++++++++++++++++++--------
1 file changed, 39 insertions(+), 9 deletions(-)
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index ab06133a85da..85ab33bdcdec 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -3364,30 +3364,44 @@ static int rt5645_probe(struct snd_soc_component *component)
{
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
struct rt5645_priv *rt5645 = snd_soc_component_get_drvdata(component);
+ int ret = 0;
rt5645->component = component;
switch (rt5645->codec_type) {
case CODEC_TYPE_RT5645:
- snd_soc_dapm_new_controls(dapm,
+ ret = snd_soc_dapm_new_controls(dapm,
rt5645_specific_dapm_widgets,
ARRAY_SIZE(rt5645_specific_dapm_widgets));
- snd_soc_dapm_add_routes(dapm,
+ if (ret < 0)
+ goto exit;
+
+ ret = snd_soc_dapm_add_routes(dapm,
rt5645_specific_dapm_routes,
ARRAY_SIZE(rt5645_specific_dapm_routes));
+ if (ret < 0)
+ goto exit;
+
if (rt5645->v_id < 3) {
- snd_soc_dapm_add_routes(dapm,
+ ret = snd_soc_dapm_add_routes(dapm,
rt5645_old_dapm_routes,
ARRAY_SIZE(rt5645_old_dapm_routes));
+ if (ret < 0)
+ goto exit;
}
break;
case CODEC_TYPE_RT5650:
- snd_soc_dapm_new_controls(dapm,
+ ret = snd_soc_dapm_new_controls(dapm,
rt5650_specific_dapm_widgets,
ARRAY_SIZE(rt5650_specific_dapm_widgets));
- snd_soc_dapm_add_routes(dapm,
+ if (ret < 0)
+ goto exit;
+
+ ret = snd_soc_dapm_add_routes(dapm,
rt5650_specific_dapm_routes,
ARRAY_SIZE(rt5650_specific_dapm_routes));
+ if (ret < 0)
+ goto exit;
break;
}
@@ -3395,9 +3409,17 @@ static int rt5645_probe(struct snd_soc_component *component)
/* for JD function */
if (rt5645->pdata.jd_mode) {
- snd_soc_dapm_force_enable_pin(dapm, "JD Power");
- snd_soc_dapm_force_enable_pin(dapm, "LDO2");
- snd_soc_dapm_sync(dapm);
+ ret = snd_soc_dapm_force_enable_pin(dapm, "JD Power");
+ if (ret < 0)
+ goto exit;
+
+ ret = snd_soc_dapm_force_enable_pin(dapm, "LDO2");
+ if (ret < 0)
+ goto exit;
+
+ ret = snd_soc_dapm_sync(dapm);
+ if (ret < 0)
+ goto exit;
}
if (rt5645->pdata.long_name)
@@ -3407,7 +3429,15 @@ static int rt5645_probe(struct snd_soc_component *component)
RT5645_HWEQ_NUM, sizeof(struct rt5645_eq_param_s),
GFP_KERNEL);
- return 0;
+ if (!rt5645->eq_param)
+ ret = -ENOMEM;
+exit:
+ /*
+ * If there was an error above, everything will be cleaned up by the
+ * caller if we return an error here. This will be done with a later
+ * call to rt5645_remove().
+ */
+ return ret;
}
static void rt5645_remove(struct snd_soc_component *component)
--
2.30.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH AUTOSEL 5.12 31/63] Revert "ASoC: cs43130: fix a NULL pointer dereference"
[not found] <20210524144620.2497249-1-sashal@kernel.org>
` (5 preceding siblings ...)
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 30/63] ASoC: rt5645: add error checking to rt5645_probe function Sasha Levin
@ 2021-05-24 14:45 ` Sasha Levin
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 32/63] ASoC: cs43130: handle errors in cs43130_probe() properly Sasha Levin
2021-05-24 14:46 ` [PATCH AUTOSEL 5.12 51/63] ALSA: dice: disable double_pcm_frames mode for M-Audio Profire 610, 2626 and Avid M-Box 3 Pro Sasha Levin
8 siblings, 0 replies; 14+ messages in thread
From: Sasha Levin @ 2021-05-24 14:45 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sasha Levin, alsa-devel, Greg Kroah-Hartman, Kangjie Lu,
Mark Brown, patches
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit fdda0dd2686ecd1f2e616c9e0366ea71b40c485d ]
This reverts commit a2be42f18d409213bb7e7a736e3ef6ba005115bb.
Because of recent interactions with developers from @umn.edu, all
commits from them have been recently re-reviewed to ensure if they were
correct or not.
Upon review, this commit was found to be incorrect for the reasons
below, so it must be reverted. It will be fixed up "correctly" in a
later kernel change.
The original patch here is not correct, sysfs files that were created
are not unwound.
Cc: Kangjie Lu <kjlu@umn.edu>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210503115736.2104747-57-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/cs43130.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
index 80bc7c10ed75..c2b6f0ae6d57 100644
--- a/sound/soc/codecs/cs43130.c
+++ b/sound/soc/codecs/cs43130.c
@@ -2319,8 +2319,6 @@ static int cs43130_probe(struct snd_soc_component *component)
return ret;
cs43130->wq = create_singlethread_workqueue("cs43130_hp");
- if (!cs43130->wq)
- return -ENOMEM;
INIT_WORK(&cs43130->work, cs43130_imp_meas);
}
--
2.30.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH AUTOSEL 5.12 32/63] ASoC: cs43130: handle errors in cs43130_probe() properly
[not found] <20210524144620.2497249-1-sashal@kernel.org>
` (6 preceding siblings ...)
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 31/63] Revert "ASoC: cs43130: fix a NULL pointer dereference" Sasha Levin
@ 2021-05-24 14:45 ` Sasha Levin
2021-05-25 14:00 ` Mark Brown
2021-05-24 14:46 ` [PATCH AUTOSEL 5.12 51/63] ALSA: dice: disable double_pcm_frames mode for M-Audio Profire 610, 2626 and Avid M-Box 3 Pro Sasha Levin
8 siblings, 1 reply; 14+ messages in thread
From: Sasha Levin @ 2021-05-24 14:45 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sasha Levin, Greg Kroah-Hartman, alsa-devel, Mark Brown, patches
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[ Upstream commit 2da441a6491d93eff8ffff523837fd621dc80389 ]
cs43130_probe() does not do any valid error checking of things it
initializes, OR what it does, it does not unwind properly if there are
errors.
Fix this up by moving the sysfs files to an attribute group so the
driver core will correctly add/remove them all at once and handle errors
with them, and correctly check for creating a new workqueue and
unwinding if that fails.
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20210503115736.2104747-58-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/codecs/cs43130.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
index c2b6f0ae6d57..80cd3ea0c157 100644
--- a/sound/soc/codecs/cs43130.c
+++ b/sound/soc/codecs/cs43130.c
@@ -1735,6 +1735,14 @@ static DEVICE_ATTR(hpload_dc_r, 0444, cs43130_show_dc_r, NULL);
static DEVICE_ATTR(hpload_ac_l, 0444, cs43130_show_ac_l, NULL);
static DEVICE_ATTR(hpload_ac_r, 0444, cs43130_show_ac_r, NULL);
+static struct attribute *hpload_attrs[] = {
+ &dev_attr_hpload_dc_l.attr,
+ &dev_attr_hpload_dc_r.attr,
+ &dev_attr_hpload_ac_l.attr,
+ &dev_attr_hpload_ac_r.attr,
+};
+ATTRIBUTE_GROUPS(hpload);
+
static struct reg_sequence hp_en_cal_seq[] = {
{CS43130_INT_MASK_4, CS43130_INT_MASK_ALL},
{CS43130_HP_MEAS_LOAD_1, 0},
@@ -2302,23 +2310,15 @@ static int cs43130_probe(struct snd_soc_component *component)
cs43130->hpload_done = false;
if (cs43130->dc_meas) {
- ret = device_create_file(component->dev, &dev_attr_hpload_dc_l);
- if (ret < 0)
- return ret;
-
- ret = device_create_file(component->dev, &dev_attr_hpload_dc_r);
- if (ret < 0)
- return ret;
-
- ret = device_create_file(component->dev, &dev_attr_hpload_ac_l);
- if (ret < 0)
- return ret;
-
- ret = device_create_file(component->dev, &dev_attr_hpload_ac_r);
- if (ret < 0)
+ ret = sysfs_create_groups(&component->dev->kobj, hpload_groups);
+ if (ret)
return ret;
cs43130->wq = create_singlethread_workqueue("cs43130_hp");
+ if (!cs43130->wq) {
+ sysfs_remove_groups(&component->dev->kobj, hpload_groups);
+ return -ENOMEM;
+ }
INIT_WORK(&cs43130->work, cs43130_imp_meas);
}
--
2.30.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH AUTOSEL 5.12 51/63] ALSA: dice: disable double_pcm_frames mode for M-Audio Profire 610, 2626 and Avid M-Box 3 Pro
[not found] <20210524144620.2497249-1-sashal@kernel.org>
` (7 preceding siblings ...)
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 32/63] ASoC: cs43130: handle errors in cs43130_probe() properly Sasha Levin
@ 2021-05-24 14:46 ` Sasha Levin
8 siblings, 0 replies; 14+ messages in thread
From: Sasha Levin @ 2021-05-24 14:46 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Takashi Iwai, Sasha Levin, alsa-devel
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
[ Upstream commit 9f079c1bdc9087842dc5ac9d81b1d7f2578e81ce ]
ALSA dice driver detects jumbo payload at high sampling transfer frequency
for below models:
* Avid M-Box 3 Pro
* M-Audio Profire 610
* M-Audio Profire 2626
Although many DICE-based devices have a quirk at high sampling transfer
frequency to multiplex double number of PCM frames into data block than
the number in IEC 61883-1/6, the above devices are just compliant to
IEC 61883-1/6.
This commit disables the mode of double_pcm_frames for the models.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210518012510.37126-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/firewire/dice/dice-pcm.c | 4 ++--
sound/firewire/dice/dice-stream.c | 2 +-
sound/firewire/dice/dice.c | 24 ++++++++++++++++++++++++
sound/firewire/dice/dice.h | 3 ++-
4 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/sound/firewire/dice/dice-pcm.c b/sound/firewire/dice/dice-pcm.c
index af8a90ee40f3..a69ca1111b03 100644
--- a/sound/firewire/dice/dice-pcm.c
+++ b/sound/firewire/dice/dice-pcm.c
@@ -218,7 +218,7 @@ static int pcm_open(struct snd_pcm_substream *substream)
if (frames_per_period > 0) {
// For double_pcm_frame quirk.
- if (rate > 96000) {
+ if (rate > 96000 && !dice->disable_double_pcm_frames) {
frames_per_period *= 2;
frames_per_buffer *= 2;
}
@@ -273,7 +273,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
mutex_lock(&dice->mutex);
// For double_pcm_frame quirk.
- if (rate > 96000) {
+ if (rate > 96000 && !dice->disable_double_pcm_frames) {
events_per_period /= 2;
events_per_buffer /= 2;
}
diff --git a/sound/firewire/dice/dice-stream.c b/sound/firewire/dice/dice-stream.c
index 1a14c083e8ce..c4dfe76500c2 100644
--- a/sound/firewire/dice/dice-stream.c
+++ b/sound/firewire/dice/dice-stream.c
@@ -181,7 +181,7 @@ static int keep_resources(struct snd_dice *dice, struct amdtp_stream *stream,
// as 'Dual Wire'.
// For this quirk, blocking mode is required and PCM buffer size should
// be aligned to SYT_INTERVAL.
- double_pcm_frames = rate > 96000;
+ double_pcm_frames = (rate > 96000 && !dice->disable_double_pcm_frames);
if (double_pcm_frames) {
rate /= 2;
pcm_chs *= 2;
diff --git a/sound/firewire/dice/dice.c b/sound/firewire/dice/dice.c
index 107a81691f0e..239d164b0eea 100644
--- a/sound/firewire/dice/dice.c
+++ b/sound/firewire/dice/dice.c
@@ -21,6 +21,7 @@ MODULE_LICENSE("GPL v2");
#define OUI_SSL 0x0050c2 // Actually ID reserved by IEEE.
#define OUI_PRESONUS 0x000a92
#define OUI_HARMAN 0x000fd7
+#define OUI_AVID 0x00a07e
#define DICE_CATEGORY_ID 0x04
#define WEISS_CATEGORY_ID 0x00
@@ -222,6 +223,14 @@ static int dice_probe(struct fw_unit *unit,
(snd_dice_detect_formats_t)entry->driver_data;
}
+ // Below models are compliant to IEC 61883-1/6 and have no quirk at high sampling transfer
+ // frequency.
+ // * Avid M-Box 3 Pro
+ // * M-Audio Profire 610
+ // * M-Audio Profire 2626
+ if (entry->vendor_id == OUI_MAUDIO || entry->vendor_id == OUI_AVID)
+ dice->disable_double_pcm_frames = true;
+
spin_lock_init(&dice->lock);
mutex_init(&dice->mutex);
init_completion(&dice->clock_accepted);
@@ -278,7 +287,22 @@ static void dice_bus_reset(struct fw_unit *unit)
#define DICE_INTERFACE 0x000001
+#define DICE_DEV_ENTRY_TYPICAL(vendor, model, data) \
+ { \
+ .match_flags = IEEE1394_MATCH_VENDOR_ID | \
+ IEEE1394_MATCH_MODEL_ID | \
+ IEEE1394_MATCH_SPECIFIER_ID | \
+ IEEE1394_MATCH_VERSION, \
+ .vendor_id = (vendor), \
+ .model_id = (model), \
+ .specifier_id = (vendor), \
+ .version = DICE_INTERFACE, \
+ .driver_data = (kernel_ulong_t)(data), \
+ }
+
static const struct ieee1394_device_id dice_id_table[] = {
+ // Avid M-Box 3 Pro. To match in probe function.
+ DICE_DEV_ENTRY_TYPICAL(OUI_AVID, 0x000004, snd_dice_detect_extension_formats),
/* M-Audio Profire 2626 has a different value in version field. */
{
.match_flags = IEEE1394_MATCH_VENDOR_ID |
diff --git a/sound/firewire/dice/dice.h b/sound/firewire/dice/dice.h
index adc6f7c84460..3c967d1b3605 100644
--- a/sound/firewire/dice/dice.h
+++ b/sound/firewire/dice/dice.h
@@ -109,7 +109,8 @@ struct snd_dice {
struct fw_iso_resources rx_resources[MAX_STREAMS];
struct amdtp_stream tx_stream[MAX_STREAMS];
struct amdtp_stream rx_stream[MAX_STREAMS];
- bool global_enabled;
+ bool global_enabled:1;
+ bool disable_double_pcm_frames:1;
struct completion clock_accepted;
unsigned int substreams_counter;
--
2.30.2
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH AUTOSEL 5.12 32/63] ASoC: cs43130: handle errors in cs43130_probe() properly
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 32/63] ASoC: cs43130: handle errors in cs43130_probe() properly Sasha Levin
@ 2021-05-25 14:00 ` Mark Brown
2021-05-25 14:43 ` Greg Kroah-Hartman
0 siblings, 1 reply; 14+ messages in thread
From: Mark Brown @ 2021-05-25 14:00 UTC (permalink / raw)
To: Sasha Levin; +Cc: Greg Kroah-Hartman, alsa-devel, linux-kernel, stable, patches
[-- Attachment #1: Type: text/plain, Size: 3019 bytes --]
On Mon, May 24, 2021 at 10:45:49AM -0400, Sasha Levin wrote:
> From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> [ Upstream commit 2da441a6491d93eff8ffff523837fd621dc80389 ]
>
> cs43130_probe() does not do any valid error checking of things it
> initializes, OR what it does, it does not unwind properly if there are
> errors.
I don't have this commit and can't see any sign of it having been
submitted upstream. Where is it being backported from? The last
commit I can see in -next to this driver is
d2912cb15bdda8ba4a5dd73396ad62641af2f520 (treewide: Replace GPLv2
boilerplate/reference with SPDX - rule 500) from 2019.
>
> Fix this up by moving the sysfs files to an attribute group so the
> driver core will correctly add/remove them all at once and handle errors
> with them, and correctly check for creating a new workqueue and
> unwinding if that fails.
>
> Cc: Mark Brown <broonie@kernel.org>
> Link: https://lore.kernel.org/r/20210503115736.2104747-58-gregkh@linuxfoundation.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
> sound/soc/codecs/cs43130.c | 28 ++++++++++++++--------------
> 1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
> index c2b6f0ae6d57..80cd3ea0c157 100644
> --- a/sound/soc/codecs/cs43130.c
> +++ b/sound/soc/codecs/cs43130.c
> @@ -1735,6 +1735,14 @@ static DEVICE_ATTR(hpload_dc_r, 0444, cs43130_show_dc_r, NULL);
> static DEVICE_ATTR(hpload_ac_l, 0444, cs43130_show_ac_l, NULL);
> static DEVICE_ATTR(hpload_ac_r, 0444, cs43130_show_ac_r, NULL);
>
> +static struct attribute *hpload_attrs[] = {
> + &dev_attr_hpload_dc_l.attr,
> + &dev_attr_hpload_dc_r.attr,
> + &dev_attr_hpload_ac_l.attr,
> + &dev_attr_hpload_ac_r.attr,
> +};
> +ATTRIBUTE_GROUPS(hpload);
> +
> static struct reg_sequence hp_en_cal_seq[] = {
> {CS43130_INT_MASK_4, CS43130_INT_MASK_ALL},
> {CS43130_HP_MEAS_LOAD_1, 0},
> @@ -2302,23 +2310,15 @@ static int cs43130_probe(struct snd_soc_component *component)
>
> cs43130->hpload_done = false;
> if (cs43130->dc_meas) {
> - ret = device_create_file(component->dev, &dev_attr_hpload_dc_l);
> - if (ret < 0)
> - return ret;
> -
> - ret = device_create_file(component->dev, &dev_attr_hpload_dc_r);
> - if (ret < 0)
> - return ret;
> -
> - ret = device_create_file(component->dev, &dev_attr_hpload_ac_l);
> - if (ret < 0)
> - return ret;
> -
> - ret = device_create_file(component->dev, &dev_attr_hpload_ac_r);
> - if (ret < 0)
> + ret = sysfs_create_groups(&component->dev->kobj, hpload_groups);
> + if (ret)
> return ret;
>
> cs43130->wq = create_singlethread_workqueue("cs43130_hp");
> + if (!cs43130->wq) {
> + sysfs_remove_groups(&component->dev->kobj, hpload_groups);
> + return -ENOMEM;
> + }
> INIT_WORK(&cs43130->work, cs43130_imp_meas);
> }
>
> --
> 2.30.2
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH AUTOSEL 5.12 30/63] ASoC: rt5645: add error checking to rt5645_probe function
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 30/63] ASoC: rt5645: add error checking to rt5645_probe function Sasha Levin
@ 2021-05-25 14:01 ` Mark Brown
2021-05-25 14:44 ` Greg Kroah-Hartman
0 siblings, 1 reply; 14+ messages in thread
From: Mark Brown @ 2021-05-25 14:01 UTC (permalink / raw)
To: Sasha Levin
Cc: Greg Kroah-Hartman, alsa-devel, linux-kernel, stable,
Phillip Potter
[-- Attachment #1: Type: text/plain, Size: 492 bytes --]
On Mon, May 24, 2021 at 10:45:47AM -0400, Sasha Levin wrote:
> From: Phillip Potter <phil@philpotter.co.uk>
>
> [ Upstream commit 5e70b8e22b64eed13d5bbebcb5911dae65bf8c6b ]
>
> Check for return value from various snd_soc_dapm_* calls, as many of
> them can return errors and this should be handled. Also, reintroduce
> the allocation failure check for rt5645->eq_param as well. Make all
I also don't have this commit and can't see any sign of it
having been submitted upstream.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH AUTOSEL 5.12 32/63] ASoC: cs43130: handle errors in cs43130_probe() properly
2021-05-25 14:00 ` Mark Brown
@ 2021-05-25 14:43 ` Greg Kroah-Hartman
2021-05-25 22:17 ` Mark Brown
0 siblings, 1 reply; 14+ messages in thread
From: Greg Kroah-Hartman @ 2021-05-25 14:43 UTC (permalink / raw)
To: Mark Brown; +Cc: Sasha Levin, patches, alsa-devel, linux-kernel, stable
On Tue, May 25, 2021 at 03:00:28PM +0100, Mark Brown wrote:
> On Mon, May 24, 2021 at 10:45:49AM -0400, Sasha Levin wrote:
> > From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >
> > [ Upstream commit 2da441a6491d93eff8ffff523837fd621dc80389 ]
> >
> > cs43130_probe() does not do any valid error checking of things it
> > initializes, OR what it does, it does not unwind properly if there are
> > errors.
>
> I don't have this commit and can't see any sign of it having been
> submitted upstream. Where is it being backported from? The last
> commit I can see in -next to this driver is
> d2912cb15bdda8ba4a5dd73396ad62641af2f520 (treewide: Replace GPLv2
> boilerplate/reference with SPDX - rule 500) from 2019.
This is now in 5.13-rc3.
You should have been cc:ed on it a few times already.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH AUTOSEL 5.12 30/63] ASoC: rt5645: add error checking to rt5645_probe function
2021-05-25 14:01 ` Mark Brown
@ 2021-05-25 14:44 ` Greg Kroah-Hartman
0 siblings, 0 replies; 14+ messages in thread
From: Greg Kroah-Hartman @ 2021-05-25 14:44 UTC (permalink / raw)
To: Mark Brown; +Cc: Sasha Levin, alsa-devel, linux-kernel, stable, Phillip Potter
On Tue, May 25, 2021 at 03:01:40PM +0100, Mark Brown wrote:
> On Mon, May 24, 2021 at 10:45:47AM -0400, Sasha Levin wrote:
> > From: Phillip Potter <phil@philpotter.co.uk>
> >
> > [ Upstream commit 5e70b8e22b64eed13d5bbebcb5911dae65bf8c6b ]
> >
> > Check for return value from various snd_soc_dapm_* calls, as many of
> > them can return errors and this should be handled. Also, reintroduce
> > the allocation failure check for rt5645->eq_param as well. Make all
>
> I also don't have this commit and can't see any sign of it
> having been submitted upstream.
I cc:ed you on it, as it was part of the larger "revert the umn.edu"
mess. It's now in 5.13-rc3.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH AUTOSEL 5.12 32/63] ASoC: cs43130: handle errors in cs43130_probe() properly
2021-05-25 14:43 ` Greg Kroah-Hartman
@ 2021-05-25 22:17 ` Mark Brown
0 siblings, 0 replies; 14+ messages in thread
From: Mark Brown @ 2021-05-25 22:17 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Sasha Levin, patches, alsa-devel, linux-kernel, stable
[-- Attachment #1: Type: text/plain, Size: 1748 bytes --]
On Tue, May 25, 2021 at 04:43:52PM +0200, Greg Kroah-Hartman wrote:
> On Tue, May 25, 2021 at 03:00:28PM +0100, Mark Brown wrote:
> > On Mon, May 24, 2021 at 10:45:49AM -0400, Sasha Levin wrote:
> > > From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > [ Upstream commit 2da441a6491d93eff8ffff523837fd621dc80389 ]
> This is now in 5.13-rc3.
> You should have been cc:ed on it a few times already.
Hrm, I've managed to find a *single* copy mixed in with a revert
as part of a huge series (it was almost 70 patches) with no cover
letter that got copied to me - I think what happened here is that
this looked like this was something where you'd done a revert and
then dropped that revert (which was what things I'd heard from
other sources suggested was what was going on with that series).
I'd certainly have expected to get a standalone patch submission
or other communication for something that was entirely new code,
and if you're not getting review for new code like this that
isn't super urgent I'd expect some attempts to get it before
bypassing.
This sort of stuff is not great, especially when half of what you
were doing was to address bad practice on the part of the UMN
people - I would have really expected any completely new changes
like these that came up to be sent as new patches through the
normal process rather than mixed in with what look like
mechanical, treewide changes. It's a recipe for things getting
missed, as I said in followup to the copy of the patch I found
there's some issues with the rt5645 changes. On rechecking
everything the only issue I actually spotted with any of that
code (use of devm at the component level, which realistically is
at worst very minor) is not fixed by the additional patch.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2021-05-25 22:18 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20210524144620.2497249-1-sashal@kernel.org>
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 05/63] Revert "ALSA: sb: fix a missing check of snd_ctl_add" Sasha Levin
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 16/63] Revert "ALSA: gus: add a check of the status " Sasha Levin
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 17/63] ALSA: sb8: Add a comment note regarding an unused pointer Sasha Levin
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 18/63] Revert "ALSA: usx2y: Fix potential NULL pointer dereference" Sasha Levin
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 29/63] Revert "ASoC: rt5645: fix a " Sasha Levin
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 30/63] ASoC: rt5645: add error checking to rt5645_probe function Sasha Levin
2021-05-25 14:01 ` Mark Brown
2021-05-25 14:44 ` Greg Kroah-Hartman
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 31/63] Revert "ASoC: cs43130: fix a NULL pointer dereference" Sasha Levin
2021-05-24 14:45 ` [PATCH AUTOSEL 5.12 32/63] ASoC: cs43130: handle errors in cs43130_probe() properly Sasha Levin
2021-05-25 14:00 ` Mark Brown
2021-05-25 14:43 ` Greg Kroah-Hartman
2021-05-25 22:17 ` Mark Brown
2021-05-24 14:46 ` [PATCH AUTOSEL 5.12 51/63] ALSA: dice: disable double_pcm_frames mode for M-Audio Profire 610, 2626 and Avid M-Box 3 Pro Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox