linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Andrzej Hajda <a.hajda@samsung.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>
Subject: Re: [PATCH] media: s5p-mfc: Properly handle dma_parms for the allocated devices
Date: Thu, 28 May 2020 16:16:42 +0200	[thread overview]
Message-ID: <CAPDyKFqaD74m17ROncd8YA6bFY+m3ePX=jenSfVGq1K9E9zONQ@mail.gmail.com> (raw)
In-Reply-To: <20200528140326.5215-1-m.szyprowski@samsung.com>

On Thu, 28 May 2020 at 16:03, Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>
> Commit 9495b7e92f71 ("driver core: platform: Initialize dma_parms for
> platform devices") in v5.7-rc5 added allocation of dma_parms structure to
> all platform devices. Then vb2_dma_contig_set_max_seg_size() have been
> changed not to allocate dma_parms structure and rely on the one allocated
> by the device core. Lets allocate the needed structure also for the
> devices created for the 2 MFC device memory ports.
>
> Reported-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
> Fixes: 9495b7e92f71 ("driver core: platform: Initialize dma_parms for platform devices")
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  drivers/media/platform/s5p-mfc/s5p_mfc.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> index 5c2a23b953a4..eba2b9f040df 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> @@ -1089,6 +1089,10 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev,
>         child->coherent_dma_mask = dev->coherent_dma_mask;
>         child->dma_mask = dev->dma_mask;
>         child->release = s5p_mfc_memdev_release;
> +       child->dma_parms = devm_kzalloc(dev, sizeof(*child->dma_parms),
> +                                       GFP_KERNEL);
> +       if (!child->dma_parms)
> +               goto err;
>
>         /*
>          * The memdevs are not proper OF platform devices, so in order for them
> @@ -1104,7 +1108,7 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev,
>                         return child;
>                 device_del(child);
>         }
> -
> +err:
>         put_device(child);
>         return NULL;
>  }
> --
> 2.17.1
>

      reply	other threads:[~2020-05-28 14:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200528140337eucas1p2499a623f10d9bedf568f3a9bf55320f7@eucas1p2.samsung.com>
2020-05-28 14:03 ` [PATCH] media: s5p-mfc: Properly handle dma_parms for the allocated devices Marek Szyprowski
2020-05-28 14:16   ` Ulf Hansson [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='CAPDyKFqaD74m17ROncd8YA6bFY+m3ePX=jenSfVGq1K9E9zONQ@mail.gmail.com' \
    --to=ulf.hansson@linaro.org \
    --cc=a.hajda@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=s.nawrocki@samsung.com \
    --cc=tomi.valkeinen@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).