From: Christoph Hellwig <hch@lst.de>
To: Yangyu Chen <cyy@cyyself.name>
Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
Christoph Hellwig <hch@lst.de>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Robin Murphy <robin.murphy@arm.com>
Subject: Re: [PATCH -fixes] dma-direct: only reference arch_dma_set_uncached symbol when usable
Date: Tue, 9 Jul 2024 13:14:25 +0200 [thread overview]
Message-ID: <20240709111425.GA4421@lst.de> (raw)
In-Reply-To: <tencent_5E4637BE7BC1256D39C73ADCA118BD908507@qq.com>
On Tue, Jul 09, 2024 at 04:32:48PM +0800, Yangyu Chen wrote:
> The arch_dma_set_uncached symbol is only used when the architecture
> provides it. However, many architectures do not provide it, and the
> code currently relies on compiler optimization to cut the unnecessary
> code. When the compiler fails to optimize it, the code will reference
> the symbol and cause a link error. I found this bug when developing
> some new extensions for RISC-V on LLVM.
>
> This patch adds a check to avoid the reference to the symbol when it is
> not provided.
arch_dma_set_uncached is only called from dma_direct_alloc when the
set_uncached variable is set to true. The variable is only set to
true if CONFIG_ARCH_HAS_DMA_SET_UNCACHED is set.
Are you running the compiler without basic optimizations? Because even
the most basic compile time constant propagation would make it
unreachable
prev parent reply other threads:[~2024-07-09 11:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-09 8:32 Yangyu Chen
2024-07-09 9:29 ` Yangyu Chen
2024-07-09 11:14 ` 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=20240709111425.GA4421@lst.de \
--to=hch@lst.de \
--cc=cyy@cyyself.name \
--cc=iommu@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=robin.murphy@arm.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®