mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Chen Ni <nichen@iscas.ac.cn>
Cc: inki.dae@samsung.com, sw0312.kim@samsung.com,
	kyungmin.park@samsung.com, airlied@gmail.com, daniel@ffwll.ch,
	krzk@kernel.org, alim.akhtar@samsung.com,
	m.szyprowski@samsung.com, dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/exynos: Add check for dma_set_max_seg_size
Date: Sun, 28 Apr 2024 21:36:32 -0700	[thread overview]
Message-ID: <Zi8j0J9PoOiMrA6H@infradead.org> (raw)
In-Reply-To: <20240429023833.1869154-1-nichen@iscas.ac.cn>

On Mon, Apr 29, 2024 at 10:38:33AM +0800, Chen Ni wrote:
> Add check for the return value of dma_set_max_seg_size() and return
> the error if it fails in order to catch the error.
> 
> Fixes: ddfd4ab6bb08 ("drm/exynos: Fix dma_parms allocation")
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>

With my dma-mapping hat maintainer on I think we should remove the
return value from it.  It can only return -EIO or 0, and the first
only if the bus has not set up a dma_params structure for the device.
I'd much rather WARN_ON() on that, as it is is a grave error to either
call dma_set_max_seg_size on a device that is on a bus that doesn't
support DMA at all, or for the bus maintainer to accidentlaly drop it.

Feel free to add the patch if exynos has a strict error checking policy,
but it's rather pointless and I'll add removing the return value to my
ever growing TODO list.


      reply	other threads:[~2024-04-29  4:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29  2:38 Chen Ni
2024-04-29  4:36 ` Christoph Hellwig [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=Zi8j0J9PoOiMrA6H@infradead.org \
    --to=hch@infradead.org \
    --cc=airlied@gmail.com \
    --cc=alim.akhtar@samsung.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=inki.dae@samsung.com \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=nichen@iscas.ac.cn \
    --cc=sw0312.kim@samsung.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

all inboxes | Powered by JetHome®