All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sameer Pujar <spujar@nvidia.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, kai.vehmanen@linux.intel.com,
	linux-kernel@vger.kernel.org, yang.jie@linux.intel.com,
	pierre-louis.bossart@linux.intel.com, stable@vger.kernel.org,
	tiwai@suse.com
Subject: Re: [PATCH] ALSA: hda: avoid reset of sdo_limit
Date: Wed, 19 Aug 2020 20:51:39 +0530	[thread overview]
Message-ID: <376cc1ba-d781-e319-e68d-99a8e8d8bbdf@nvidia.com> (raw)
In-Reply-To: <s5hmu2qhele.wl-tiwai@suse.de>


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
>>

WARNING: multiple messages have this Message-ID (diff)
From: Sameer Pujar <spujar@nvidia.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: <tiwai@suse.com>, <perex@perex.cz>,
	<kai.vehmanen@linux.intel.com>, <yang.jie@linux.intel.com>,
	<pierre-louis.bossart@linux.intel.com>,
	<alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
	<stable@vger.kernel.org>
Subject: Re: [PATCH] ALSA: hda: avoid reset of sdo_limit
Date: Wed, 19 Aug 2020 20:51:39 +0530	[thread overview]
Message-ID: <376cc1ba-d781-e319-e68d-99a8e8d8bbdf@nvidia.com> (raw)
In-Reply-To: <s5hmu2qhele.wl-tiwai@suse.de>


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
>>

  reply	other threads:[~2020-08-19 15:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19 14:44 [PATCH] ALSA: hda: avoid reset of sdo_limit Sameer Pujar
2020-08-19 14:44 ` Sameer Pujar
2020-08-19 14:53 ` Takashi Iwai
2020-08-19 14:53   ` Takashi Iwai
2020-08-19 15:21   ` Sameer Pujar [this message]
2020-08-19 15:21     ` Sameer Pujar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=376cc1ba-d781-e319-e68d-99a8e8d8bbdf@nvidia.com \
    --to=spujar@nvidia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.com \
    --cc=tiwai@suse.de \
    --cc=yang.jie@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.