Il 14/06/24 09:27, Alexandre Mergnat ha scritto:
> Add soundcard bindings for the MT8365 SoC with the MT6357 audio codec.
>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski(a)linaro.org>
> Signed-off-by: Alexandre Mergnat <amergnat(a)baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno(a)collabora.com>
Il 14/06/24 09:27, Alexandre Mergnat ha scritto:
> Add I2S Device Audio Interface support for MT8365 SoC.
>
> Signed-off-by: Alexandre Mergnat <amergnat(a)baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno(a)collabora.com>
Il 14/06/24 09:27, Alexandre Mergnat ha scritto:
> Add ADDA Device Audio Interface support for MT8365 SoC.
>
> Signed-off-by: Alexandre Mergnat <amergnat(a)baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno(a)collabora.com>
Il 14/06/24 09:27, Alexandre Mergnat ha scritto:
> Add Digital Micro Device Audio Interface support for MT8365 SoC.
>
> Signed-off-by: Alexandre Mergnat <amergnat(a)baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno(a)collabora.com>
Hi TaoJiang,
On Tue, Jun 18, 2024 at 4:30 PM TaoJiang <tao.jiang_2(a)nxp.com> wrote:
>
> From: Ming Qian <ming.qian(a)nxp.com>
>
> When the memory type is VB2_MEMORY_DMABUF, the v4l2 device can't know
> whether the dma buffer is coherent or synchronized.
>
> The videobuf2-core will skip cache syncs as it think the DMA exporter
> should take care of cache syncs
>
> But in fact it's likely that the client doesn't
> synchronize the dma buf before qbuf() or after dqbuf(). and it's
> difficult to find this type of error directly.
>
> I think it's helpful that videobuf2-core can call
> dma_buf_end_cpu_access() and dma_buf_begin_cpu_access() to handle the
> cache syncs.
>
> Signed-off-by: Ming Qian <ming.qian(a)nxp.com>
> Signed-off-by: TaoJiang <tao.jiang_2(a)nxp.com>
> ---
> .../media/common/videobuf2/videobuf2-core.c | 22 +++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
Sorry, that patch is incorrect. I believe you're misunderstanding the
way DMA-buf buffers should be managed in the userspace. It's the
userspace responsibility to call the DMA_BUF_IOCTL_SYNC ioctl [1] to
signal start and end of CPU access to the kernel and imply necessary
cache synchronization.
[1] https://docs.kernel.org/driver-api/dma-buf.html#dma-buffer-ioctls
So, really sorry, but it's a NAK.
Best regards,
Tomasz
> diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c
> index 358f1fe42975..4734ff9cf3ce 100644
> --- a/drivers/media/common/videobuf2/videobuf2-core.c
> +++ b/drivers/media/common/videobuf2/videobuf2-core.c
> @@ -340,6 +340,17 @@ static void __vb2_buf_mem_prepare(struct vb2_buffer *vb)
> vb->synced = 1;
> for (plane = 0; plane < vb->num_planes; ++plane)
> call_void_memop(vb, prepare, vb->planes[plane].mem_priv);
> +
> + if (vb->memory != VB2_MEMORY_DMABUF)
> + return;
> + for (plane = 0; plane < vb->num_planes; ++plane) {
> + struct dma_buf *dbuf = vb->planes[plane].dbuf;
> +
> + if (!dbuf)
> + continue;
> +
> + dma_buf_end_cpu_access(dbuf, vb->vb2_queue->dma_dir);
> + }
> }
>
> /*
> @@ -356,6 +367,17 @@ static void __vb2_buf_mem_finish(struct vb2_buffer *vb)
> vb->synced = 0;
> for (plane = 0; plane < vb->num_planes; ++plane)
> call_void_memop(vb, finish, vb->planes[plane].mem_priv);
> +
> + if (vb->memory != VB2_MEMORY_DMABUF)
> + return;
> + for (plane = 0; plane < vb->num_planes; ++plane) {
> + struct dma_buf *dbuf = vb->planes[plane].dbuf;
> +
> + if (!dbuf)
> + continue;
> +
> + dma_buf_begin_cpu_access(dbuf, vb->vb2_queue->dma_dir);
> + }
> }
>
> /*
> --
> 2.43.0-rc1
>
Il 17/06/24 10:05, Alexandre Mergnat ha scritto:
>
>
> On 14/06/2024 11:31, Mark Brown wrote:
>> On Fri, Jun 14, 2024 at 09:27:43AM +0200, Alexandre Mergnat wrote:
>>> This serie aim to add the following audio support for the Genio 350-evk:
>>> - Playback
>>> - 2ch Headset Jack (Earphone)
>>> - 1ch Line-out Jack (Speaker)
>>> - 8ch HDMI Tx
>>
>> I seem to remember you had review comments that needed addressing from
>> AngeloGioacchino, why resend without addressing those?
>
> I don't see any comment:
> https://lore.kernel.org/lkml/20240226-audio-i350-v5-0-e7e2569df481@baylibre…
>
Mark, the review comments were on the v4 of this series :-)
I'll review this version probably tomorrow, or anyway this week.
Cheers,
Angelo
On Mon, Jun 17, 2024 at 10:05:37AM +0200, Alexandre Mergnat wrote:
> On 14/06/2024 11:31, Mark Brown wrote:
> > I seem to remember you had review comments that needed addressing from
> > AngeloGioacchino, why resend without addressing those?
> I don't see any comment:
> https://lore.kernel.org/lkml/20240226-audio-i350-v5-0-e7e2569df481@baylibre…
Possibly it was racing with comments on the previous version? In any
case I see it's still waiting for some review from AngeloGioacchino.
Hi Markus,
Le lundi 17 juin 2024 à 08:56 +0200, Markus Elfring a écrit :
> …
> > +++ b/drivers/iio/industrialio-buffer.c
> …
> > static int iio_buffer_chrdev_release(struct inode *inode, struct
> > file *filep)
> > {
> …
> > wake_up(&buffer->pollq);
> >
> > + mutex_lock(&buffer->dmabufs_mutex);
> > +
> > + /* Close all attached DMABUFs */
> …
> > + mutex_unlock(&buffer->dmabufs_mutex);
> > +
> > kfree(ib);
> …
>
> Would you become interested to apply a statement like
> “guard(mutex)(&buffer->dmabufs_mutex);”?
> https://elixir.bootlin.com/linux/v6.10-rc3/source/include/linux/mutex.h#L196
I'll update the patch to use it.
Cheers,
-Paul