* [PATCH] ALSA: hda: avoid reset of sdo_limit
@ 2020-08-19 14:44 Sameer Pujar
2020-08-19 14:53 ` Takashi Iwai
0 siblings, 1 reply; 3+ messages in thread
From: Sameer Pujar @ 2020-08-19 14:44 UTC (permalink / raw)
To: tiwai, perex
Cc: kai.vehmanen, yang.jie, pierre-louis.bossart, alsa-devel,
linux-kernel, Sameer Pujar, stable
By default 'sdo_limit' is initialized with a default value of '8'
as per spec. This is overridden in cases where a different value is
required. However this is getting reset when snd_hdac_bus_init_chip()
is called again, which happens during runtime PM cycle. Avoid reset
by not initializing to default value everytime.
Fixes: 67ae482a59e9 ("ALSA: hda: add member to store ratio for stripe control")
Cc: <stable@vger.kernel.org>
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
---
sound/hda/hdac_controller.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c
index 011b17c..0e26e96 100644
--- a/sound/hda/hdac_controller.c
+++ b/sound/hda/hdac_controller.c
@@ -538,7 +538,8 @@ bool snd_hdac_bus_init_chip(struct hdac_bus *bus, bool full_reset)
* { ((num_channels * bits_per_sample * rate/48000) /
* number of SDOs) >= 8 }
*/
- bus->sdo_limit = 8;
+ if (!bus->sdo_limit)
+ bus->sdo_limit = 8;
return true;
}
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ALSA: hda: avoid reset of sdo_limit
2020-08-19 14:44 [PATCH] ALSA: hda: avoid reset of sdo_limit Sameer Pujar
@ 2020-08-19 14:53 ` Takashi Iwai
2020-08-19 15:21 ` Sameer Pujar
0 siblings, 1 reply; 3+ messages in thread
From: Takashi Iwai @ 2020-08-19 14:53 UTC (permalink / raw)
To: Sameer Pujar
Cc: tiwai, perex, kai.vehmanen, yang.jie, pierre-louis.bossart,
alsa-devel, linux-kernel, stable
On Wed, 19 Aug 2020 16:44:33 +0200,
Sameer Pujar wrote:
>
> By default 'sdo_limit' is initialized with a default value of '8'
> as per spec. This is overridden in cases where a different value is
> required. However this is getting reset when snd_hdac_bus_init_chip()
> is called again, which happens during runtime PM cycle. Avoid reset
> by not initializing to default value everytime.
>
> Fixes: 67ae482a59e9 ("ALSA: hda: add member to store ratio for stripe control")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
How about to move the default sdo_limit setup into snd_hdac_bus_init()
instead? That's the place to be called only once.
thanks,
Takashi
> ---
> sound/hda/hdac_controller.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c
> index 011b17c..0e26e96 100644
> --- a/sound/hda/hdac_controller.c
> +++ b/sound/hda/hdac_controller.c
> @@ -538,7 +538,8 @@ bool snd_hdac_bus_init_chip(struct hdac_bus *bus, bool full_reset)
> * { ((num_channels * bits_per_sample * rate/48000) /
> * number of SDOs) >= 8 }
> */
> - bus->sdo_limit = 8;
> + if (!bus->sdo_limit)
> + bus->sdo_limit = 8;
>
> return true;
> }
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ALSA: hda: avoid reset of sdo_limit
2020-08-19 14:53 ` Takashi Iwai
@ 2020-08-19 15:21 ` Sameer Pujar
0 siblings, 0 replies; 3+ messages in thread
From: Sameer Pujar @ 2020-08-19 15:21 UTC (permalink / raw)
To: Takashi Iwai
Cc: tiwai, perex, kai.vehmanen, yang.jie, pierre-louis.bossart,
alsa-devel, linux-kernel, stable
On 8/19/2020 8:23 PM, Takashi Iwai wrote:
> External email: Use caution opening links or attachments
>
>
> On Wed, 19 Aug 2020 16:44:33 +0200,
> Sameer Pujar wrote:
>> By default 'sdo_limit' is initialized with a default value of '8'
>> as per spec. This is overridden in cases where a different value is
>> required. However this is getting reset when snd_hdac_bus_init_chip()
>> is called again, which happens during runtime PM cycle. Avoid reset
>> by not initializing to default value everytime.
>>
>> Fixes: 67ae482a59e9 ("ALSA: hda: add member to store ratio for stripe control")
>> Cc: <stable@vger.kernel.org>
>> Signed-off-by: Sameer Pujar <spujar@nvidia.com>
> How about to move the default sdo_limit setup into snd_hdac_bus_init()
> instead? That's the place to be called only once.
A better choice. Thanks for the suggestion. Will publish v2.
>
>
> thanks,
>
> Takashi
>
>
>> ---
>> sound/hda/hdac_controller.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c
>> index 011b17c..0e26e96 100644
>> --- a/sound/hda/hdac_controller.c
>> +++ b/sound/hda/hdac_controller.c
>> @@ -538,7 +538,8 @@ bool snd_hdac_bus_init_chip(struct hdac_bus *bus, bool full_reset)
>> * { ((num_channels * bits_per_sample * rate/48000) /
>> * number of SDOs) >= 8 }
>> */
>> - bus->sdo_limit = 8;
>> + if (!bus->sdo_limit)
>> + bus->sdo_limit = 8;
>>
>> return true;
>> }
>> --
>> 2.7.4
>>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-19 15:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-19 14:44 [PATCH] ALSA: hda: avoid reset of sdo_limit Sameer Pujar
2020-08-19 14:53 ` Takashi Iwai
2020-08-19 15:21 ` Sameer Pujar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).