From: Vinod Koul <vinod.koul@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, patches.audio@intel.com,
Hardik T Shah <hardik.t.shah@intel.com>,
Guneshwor Singh <guneshwor.o.singh@intel.com>,
liam.r.girdwood@linux.intel.com, broonie@kernel.org
Subject: Re: [PATCH 1/3] ALSA - hda: Add support for GTS capability
Date: Mon, 11 Jul 2016 19:37:32 +0530 [thread overview]
Message-ID: <20160711140732.GH9681@localhost> (raw)
In-Reply-To: <s5h7fcsv5ig.wl-tiwai@suse.de>
On Mon, Jul 11, 2016 at 12:22:15PM +0200, Takashi Iwai wrote:
> On Mon, 11 Jul 2016 12:13:27 +0200,
> Vinod Koul wrote:
> >
> >
> > +void azx_parse_capabilities(struct azx *chip)
>
> Please give a bit more comments about the function.
Sure thing, will add.
> > + /* Lets walk the linked capabilities list */
> > + do {
> > + cur_cap = _snd_hdac_chip_read(l, azx_bus(chip), offset);
> > +
> > + switch ((cur_cap & CAP_HDR_ID_MASK) >> CAP_HDR_ID_OFF) {
> > + case GTS_CAP_ID:
> > + dev_dbg(chip->card->dev, "Found GTS capability");
> > + chip->gts_present = 1;
> > + break;
> > +
> > + default:
> > + break;
> > + }
> > +
> > + /* read the offset of next capabiity */
> > + offset = cur_cap & CAP_HDR_NXT_PTR_MASK;
> > + } while (offset);
>
> It's be safer to have a counter not to go over the endless loop.
I do agree a broken hw can cause issues, so will add that as well.
> > runtime->private_data = azx_dev;
> > +
> > + /* CPU must have ART for reporting link synchronized time */
> > + if (chip->gts_present && boot_cpu_has(X86_FEATURE_ART))
>
> This comes out of sudden. It needs more explanation.
Ah, this was merged in last window. We cna check of cpu is capable of ART,
and in these cases only we cna report these timestamps
> > diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
> > index 9a0d1445ca5c..b4ebdde59398 100644
> > --- a/sound/pci/hda/hda_intel.c
> > +++ b/sound/pci/hda/hda_intel.c
> > @@ -1649,6 +1649,7 @@ static int azx_first_init(struct azx *chip)
> > return -ENXIO;
> > }
> >
> > + azx_parse_capabilities(chip);
>
> Is it really safe to call the function no matter which chip?
I think so, since we read base HDA registers for capablity. For older hw the
next capablity will not be there.
But yes I will verify this on older machines.
--
~Vinod
next prev parent reply other threads:[~2016-07-11 14:00 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-11 10:13 [PATCH 0/3] ALSA - hda: Add support for link audio time reporting Vinod Koul
2016-07-11 10:13 ` [PATCH 1/3] ALSA - hda: Add support for GTS capability Vinod Koul
2016-07-11 10:22 ` Takashi Iwai
2016-07-11 14:07 ` Vinod Koul [this message]
2016-07-11 14:06 ` Takashi Iwai
2016-07-11 14:22 ` Vinod Koul
2016-07-11 14:17 ` Takashi Iwai
2016-07-11 10:13 ` [PATCH 2/3] ALSA - hda: Add support for link audio time reporting Vinod Koul
2016-07-11 10:32 ` Takashi Iwai
2016-07-11 14:11 ` Vinod Koul
[not found] ` <201607111916.R5HdrB76%fengguang.wu@intel.com>
2016-07-15 4:37 ` Vinod Koul
2016-07-15 5:00 ` Takashi Iwai
2016-07-15 5:19 ` Vinod Koul
2016-07-15 5:17 ` Takashi Iwai
2016-07-15 5:39 ` Vinod Koul
2016-07-15 5:39 ` Takashi Iwai
2016-07-15 5:50 ` Vinod Koul
2016-07-15 5:56 ` Takashi Iwai
2016-07-11 10:13 ` [PATCH 3/3] ALSA - hda: Fix timestamping documentation Vinod Koul
2016-07-11 10:46 ` Takashi Iwai
2016-07-11 14:12 ` Vinod Koul
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=20160711140732.GH9681@localhost \
--to=vinod.koul@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=guneshwor.o.singh@intel.com \
--cc=hardik.t.shah@intel.com \
--cc=liam.r.girdwood@linux.intel.com \
--cc=patches.audio@intel.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 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.