[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <44336db8-2b17-1682-6c38-128ec7f8f7d1@wanadoo.fr>
Date: Sun, 29 Nov 2020 13:27:22 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: hverkuil@...all.nl, mchehab@...nel.org
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH NACK] media: saa7146: switch from 'pci_' to 'dma_' API
Le 29/11/2020 à 08:38, Christophe JAILLET a écrit :
> When memory is allocated in 'saa7146_vv_init()' GFP_KERNEL can be used
> because this function already uses GFP_KERNEL and no lock is taken in the
> between.
>
> When memory is allocated in 'vbi_workaround()' GFP_KERNEL can be used
> because it is only called from a .open function.
>
>
> diff --git a/drivers/media/common/saa7146/saa7146_fops.c b/drivers/media/common/saa7146/saa7146_fops.c
> index e936c56b0378..7b1840cad278 100644
> --- a/drivers/media/common/saa7146/saa7146_fops.c
> +++ b/drivers/media/common/saa7146/saa7146_fops.c
> @@ -515,8 +515,8 @@ int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv)
> dev->ext_vv_data = ext_vv;
>
> vv->d_clipping.cpu_addr =
> - pci_zalloc_consistent(dev->pci, SAA7146_CLIPPING_MEM,
> - &vv->d_clipping.dma_handle);
> + dma_alloc_coherent(&dev->pci->dev, SAA7146_CLIPPING_MEM,
> + &vv->d_clipping.dma_handle, GFP_);
>
> diff --git a/drivers/media/common/saa7146/saa7146_vbi.c b/drivers/media/common/saa7146/saa7146_vbi.c
> index e1d369b976ed..e140d4a5aeb2 100644
> --- a/drivers/media/common/saa7146/saa7146_vbi.c
> +++ b/drivers/media/common/saa7146/saa7146_vbi.c
> @@ -22,7 +22,7 @@ static int vbi_workaround(struct saa7146_dev *dev)
> as specified. there is this workaround, but please
> don't let me explain it. ;-) */
>
> - cpu = pci_alloc_consistent(dev->pci, 4096, &dma_addr);
> + cpu = dma_alloc_coherent(&dev->pci->dev, 4096, &dma_addr, GFP_);
The patch don't have 2 needed commit that got stucked on my machine.
The analysis at the top of the patch description is fine, but the
corresponding s/GFP_/GFP_KERNEL/ are not part of the patch itself.
I'll send a v2.
Sorry for the noise.
CJ
Powered by blists - more mailing lists