mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Ruizhe Zhou <zhouruizhe@resnics.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Jonathan Corbet <corbet@lwn.net>, Christoph Hellwig <hch@lst.de>,
	Frank Li <Frank.li@oss.nxp.com>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	linux-doc@vger.kernel.org, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] docs: dma-api: require checking DMA mask setup errors
Date: Mon, 7 Sep 2026 07:47:33 +0200	[thread overview]
Message-ID: <20260907054733.GA31481@lst.de> (raw)
In-Reply-To: <20260907054400.1088151-1-zhouruizhe@resnics.com>

On Mon, Sep 07, 2026 at 01:44:00PM +0800, Ruizhe Zhou wrote:
> The DMA HOWTO says dma_set_mask_and_coherent() cannot fail for
> DMA_BIT_MASK(64), and more generally for masks wider than 32 bits. It
> consequently recommends calls to discard the check for return value.
> 
> The generic direct-DMA path does accept every mask of at least 32 bits,
> but that is not an API-wide success guarantee. Backend callbacks can
> reject wider masks: ibmebus_dma_supported() and
> xen_grant_dma_supported() accept only DMA_BIT_MASK(64), so a 40-bit mask
> fails.

Please fix them as they break the very sensible API guarantees
instead of officially sanctioning this behavior.

> 
> Even DMA_BIT_MASK(64) can fail when DMA setup is unavailable or
> inconsistent. For example, dma_dummy_supported() rejects every mask.

So?  Did you actually try to understand this code or is this just dumb
agent work?


  reply	other threads:[~2026-09-07  5:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07  5:44 Ruizhe Zhou
2026-09-07  5:47 ` Christoph Hellwig [this message]
2026-09-07  7:34   ` Ruizhe Zhou

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=20260907054733.GA31481@lst.de \
    --to=hch@lst.de \
    --cc=Frank.li@oss.nxp.com \
    --cc=corbet@lwn.net \
    --cc=iommu@lists.linux.dev \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=rdunlap@infradead.org \
    --cc=robin.murphy@arm.com \
    --cc=skhan@linuxfoundation.org \
    --cc=zhouruizhe@resnics.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®