From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: alsa-devel@alsa-project.org,
Kai Vehmanen <kai.vehmanen@linux.intel.com>,
kernel-janitors@vger.kernel.org,
Keyon Jie <yang.jie@linux.intel.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Takashi Iwai <tiwai@suse.com>,
Liam Girdwood <liam.r.girdwood@linux.intel.com>,
Slawomir Blauciak <slawomir.blauciak@linux.intel.com>,
Mark Brown <broonie@kernel.org>,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH] ASoC: SOF: Fix snd_sof_ipc_stream_posn()
Date: Wed, 4 Mar 2020 08:07:11 +0100 [thread overview]
Message-ID: <20200304070710.GA12003@ubuntu> (raw)
In-Reply-To: <993233ff-1492-5a87-1026-09af76f6fc7f@linux.intel.com>
On Tue, Mar 03, 2020 at 09:36:29AM -0600, Pierre-Louis Bossart wrote:
>
>
> > > We're passing "&posn" instead of "posn" so it ends up corrupting
> > > memory instead of doing something useful.
> > [...]
> > > /* send IPC to the DSP */
> > > err = sof_ipc_tx_message(sdev->ipc,
> > > - stream.hdr.cmd, &stream, sizeof(stream), &posn,
> > > + stream.hdr.cmd, &stream, sizeof(stream), posn,
> > > sizeof(*posn));
> >
> > ack, thanks, this is clearly wrong. This function is not used by current
> > platforms, so the bug has gone unnnoticed. Most platforms either rely on
> > direct MMIO queries of the DSP position, or the periodic position updates
> > DSPs send after each ALSA period. This function for host to query DSP
> > position via IPC is thus not used, although it's part of the generic audio
> > DSP IPC interface.
> >
> > For the SOF folks in CC, I wonder should we keep this function at all?
> >
> > Anyways, that's probably a longer discussion, so while it's there,
> > the code should be correct, so for the patch:
> > Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
>
> I checked all the way to 5.2 and it was never used, so indeed wondering what
> the purpose of this function was.
I actually have a patch, removing that function, which I noticed as being unused
during my VirtIO work. I think it was used by compressed.c before.
Thanks
Guennadi
WARNING: multiple messages have this Message-ID (diff)
From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: alsa-devel@alsa-project.org,
Kai Vehmanen <kai.vehmanen@linux.intel.com>,
kernel-janitors@vger.kernel.org,
Keyon Jie <yang.jie@linux.intel.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Takashi Iwai <tiwai@suse.com>,
Liam Girdwood <liam.r.girdwood@linux.intel.com>,
Slawomir Blauciak <slawomir.blauciak@linux.intel.com>,
Mark Brown <broonie@kernel.org>,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH] ASoC: SOF: Fix snd_sof_ipc_stream_posn()
Date: Wed, 04 Mar 2020 07:07:11 +0000 [thread overview]
Message-ID: <20200304070710.GA12003@ubuntu> (raw)
In-Reply-To: <993233ff-1492-5a87-1026-09af76f6fc7f@linux.intel.com>
On Tue, Mar 03, 2020 at 09:36:29AM -0600, Pierre-Louis Bossart wrote:
>
>
> > > We're passing "&posn" instead of "posn" so it ends up corrupting
> > > memory instead of doing something useful.
> > [...]
> > > /* send IPC to the DSP */
> > > err = sof_ipc_tx_message(sdev->ipc,
> > > - stream.hdr.cmd, &stream, sizeof(stream), &posn,
> > > + stream.hdr.cmd, &stream, sizeof(stream), posn,
> > > sizeof(*posn));
> >
> > ack, thanks, this is clearly wrong. This function is not used by current
> > platforms, so the bug has gone unnnoticed. Most platforms either rely on
> > direct MMIO queries of the DSP position, or the periodic position updates
> > DSPs send after each ALSA period. This function for host to query DSP
> > position via IPC is thus not used, although it's part of the generic audio
> > DSP IPC interface.
> >
> > For the SOF folks in CC, I wonder should we keep this function at all?
> >
> > Anyways, that's probably a longer discussion, so while it's there,
> > the code should be correct, so for the patch:
> > Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
>
> I checked all the way to 5.2 and it was never used, so indeed wondering what
> the purpose of this function was.
I actually have a patch, removing that function, which I noticed as being unused
during my VirtIO work. I think it was used by compressed.c before.
Thanks
Guennadi
next prev parent reply other threads:[~2020-03-04 7:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-03 10:18 [PATCH] ASoC: SOF: Fix snd_sof_ipc_stream_posn() Dan Carpenter
2020-03-03 10:18 ` Dan Carpenter
2020-03-03 11:39 ` Kai Vehmanen
2020-03-03 11:39 ` Kai Vehmanen
2020-03-03 15:36 ` Pierre-Louis Bossart
2020-03-03 15:36 ` Pierre-Louis Bossart
2020-03-04 7:07 ` Guennadi Liakhovetski [this message]
2020-03-04 7:07 ` Guennadi Liakhovetski
2020-03-04 7:46 ` Keyon Jie
2020-03-04 7:46 ` Keyon Jie
2020-03-03 17:07 ` Applied "ASoC: SOF: Fix snd_sof_ipc_stream_posn()" to the asoc tree Mark Brown
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=20200304070710.GA12003@ubuntu \
--to=guennadi.liakhovetski@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lgirdwood@gmail.com \
--cc=liam.r.girdwood@linux.intel.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=slawomir.blauciak@linux.intel.com \
--cc=tiwai@suse.com \
--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.