Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Agrawal, Akshu" <Akshu.Agrawal@amd.com>
To: Mark Brown <broonie@kernel.org>, Alex Deucher <alexdeucher@gmail.com>
Cc: alsa-devel@alsa-project.org, tiwai@suse.de, lgirdwood@gmail.com,
	dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
	Vijendar.Mukunda@amd.com,
	Alex Deucher <alexander.deucher@amd.com>,
	Bard Liao <bardliao@realtek.com>,
	airlied@gmail.com
Subject: Re: [PATCH 3/3] ASoC: rt5645: Wait for 400msec before concluding on value of RT5645_VENDOR_ID2
Date: Tue, 7 Nov 2017 12:42:40 +0530	[thread overview]
Message-ID: <8dadcaa1-8712-2f56-14bf-0d070c8c76b9@amd.com> (raw)
In-Reply-To: <20171106162422.vhurovalfxztf6ma@sirena.co.uk>



On 11/6/2017 9:54 PM, Mark Brown wrote:
> On Fri, Nov 03, 2017 at 04:35:45PM -0400, Alex Deucher wrote:
> 
>> Minimum time required between power On of codec and read
>> of RT5645_VENDOR_ID2 is 400msec. We should wait and attempt
>> before erroring out.
> 
> So the description says we have to wait 400ms before attempting a
> read...

Yes, that's true.

> 
>> BUG=b:66978383
> 
> What does this mean?

A bug ID. Removing it in V2.

> 
>> @@ -3786,6 +3789,15 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
>>   	}
>>   	regmap_read(regmap, RT5645_VENDOR_ID2, &val);
>>   
>> +	/*
>> +	 * Read for 400msec, as it is the interval required between
>> +	 * read and power On.
>> +	 */
>> +	while (val != RT5645_DEVICE_ID && val != RT5650_DEVICE_ID && --timeout) {
>> +		msleep(1);
>> +		regmap_read(regmap, RT5645_VENDOR_ID2, &val);
>> +	}
>> +
> 
> ...but what we actually do is try to read up to 400 times starting well
> before that 400ms is up.  This directly contradicts what the commit
> message said we needed, may take a lot longer if the chip misbehaves on
> the I2C bus while it's not ready (which wouldn't be that much of a
> surprise), might lead to us reporting before the chip is really stable
> (if the read happens to work while the chip isn't yet stable) and could
> cause lots of noise on the console if the I2C controller gets upset.
> What are we actually waiting for here?
> 

In my understanding if we get RT5645 or RT5650 DEVICE ID from register 
RT5645_VENDOR_ID2 then that means the chip is stable.

> If we really need 400ms of dead reckoning time (which is a lot for a
> modern chip, that feels more like a VMID ramp) then it's going to be
> safer to just do that.
> 

Agreed, will just sleep for 400ms before reading the register value.

      reply	other threads:[~2017-11-07  7:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-03 20:35 [PATCH 0/3] Fixes for AMD Stoney ACP audio Alex Deucher
2017-11-03 20:35 ` [PATCH 1/3] ASoC: amd: Report accurate hw_ptr during dma Alex Deucher
2017-11-06 15:48   ` Mark Brown
2017-11-07 13:56     ` Mukunda,Vijendar
2017-11-07 11:37       ` Mark Brown
2017-11-07 16:04         ` Agrawal, Akshu
2017-11-08 16:05           ` Mark Brown
2017-11-08 16:07   ` Applied "ASoC: amd: Report accurate hw_ptr during dma" to the asoc tree Mark Brown
2017-11-03 20:35 ` [PATCH 2/3] ASoC: AMD: Make the driver name consistent across files Alex Deucher
2017-11-08 18:34   ` Applied "ASoC: amd: Make the driver name consistent across files" to the asoc tree Mark Brown
2017-11-16 19:28   ` Applied "ASoC: AMD: " Mark Brown
     [not found] ` <1509741345-1589-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2017-11-03 20:35   ` [PATCH 3/3] ASoC: rt5645: Wait for 400msec before concluding on value of RT5645_VENDOR_ID2 Alex Deucher
2017-11-06 16:24     ` Mark Brown
2017-11-07  7:12       ` Agrawal, Akshu [this message]

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=8dadcaa1-8712-2f56-14bf-0d070c8c76b9@amd.com \
    --to=akshu.agrawal@amd.com \
    --cc=Vijendar.Mukunda@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bardliao@realtek.com \
    --cc=broonie@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lgirdwood@gmail.com \
    --cc=tiwai@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox