From: Christoph Hellwig <hch@lst.de>
To: Shawn Anastasio <shawn@anastas.io>
Cc: Gavin Li <git@thegavinli.com>,
linux-kernel@vger.kernel.org,
Michael Ellerman <mpe@ellerman.id.au>,
linuxppc-dev@lists.ozlabs.org,
Russell King <linux@armlinux.org.uk>,
linux-mips@vger.kernel.org, iommu@lists.linux-foundation.org,
Paul Burton <paul.burton@mips.com>,
Catalin Marinas <catalin.marinas@arm.com>,
James Hogan <jhogan@kernel.org>, Will Deacon <will@kernel.org>,
Christoph Hellwig <hch@lst.de>,
linux-arm-kernel@lists.infradead.org,
Robin Murphy <robin.murphy@arm.com>
Subject: Re: [PATCH 1/2] dma-mapping: fix page attributes for dma_mmap_*
Date: Wed, 7 Aug 2019 08:04:32 +0200 [thread overview]
Message-ID: <20190807060432.GD6627@lst.de> (raw)
In-Reply-To: <7df95ffb-6df3-b118-284c-ee32cad81199@anastas.io>
On Tue, Aug 06, 2019 at 09:39:06PM +0200, Shawn Anastasio wrote:
>> -#ifdef CONFIG_ARCH_HAS_DMA_MMAP_PGPROT
>> pgprot_t arch_dma_mmap_pgprot(struct device *dev, pgprot_t prot,
>> unsigned long attrs);
>> -#else
>> -# define arch_dma_mmap_pgprot(dev, prot, attrs) pgprot_noncached(prot)
>> -#endif
>
> Nit, but maybe the prototype should still be ifdef'd here? It at least
> could prevent a reader from incorrectly thinking that the function is
> always present.
Actually it is typical modern Linux style to just provide a prototype
and then use "if (IS_ENABLED(CONFIG_FOO))" to guard the call(s) to it.
>
> Also, like Will mentioned earlier, the function name isn't entirely
> accurate anymore. I second the suggestion of using something like
> arch_dma_noncoherent_pgprot().
As mentioned I plan to remove arch_dma_mmap_pgprot for 5.4, so I'd
rather avoid churn for the short period of time.
> As for your idea of defining
> pgprot_dmacoherent for all architectures as
>
> #ifndef pgprot_dmacoherent
> #define pgprot_dmacoherent pgprot_noncached
> #endif
>
> I think that the name here is kind of misleading too, since this
> definition will only be used when there is no support for proper
> DMA coherency.
Do you have a suggestion for a better name? I'm pretty bad at naming,
so just reusing the arm name seemed like a good way to avoid having
to make naming decisions myself.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Shawn Anastasio <shawn@anastas.io>
Cc: Christoph Hellwig <hch@lst.de>,
iommu@lists.linux-foundation.org,
Michael Ellerman <mpe@ellerman.id.au>,
Russell King <linux@armlinux.org.uk>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Paul Burton <paul.burton@mips.com>,
James Hogan <jhogan@kernel.org>,
linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Gavin Li <git@thegavinli.com>
Subject: Re: [PATCH 1/2] dma-mapping: fix page attributes for dma_mmap_*
Date: Wed, 7 Aug 2019 08:04:32 +0200 [thread overview]
Message-ID: <20190807060432.GD6627@lst.de> (raw)
In-Reply-To: <7df95ffb-6df3-b118-284c-ee32cad81199@anastas.io>
On Tue, Aug 06, 2019 at 09:39:06PM +0200, Shawn Anastasio wrote:
>> -#ifdef CONFIG_ARCH_HAS_DMA_MMAP_PGPROT
>> pgprot_t arch_dma_mmap_pgprot(struct device *dev, pgprot_t prot,
>> unsigned long attrs);
>> -#else
>> -# define arch_dma_mmap_pgprot(dev, prot, attrs) pgprot_noncached(prot)
>> -#endif
>
> Nit, but maybe the prototype should still be ifdef'd here? It at least
> could prevent a reader from incorrectly thinking that the function is
> always present.
Actually it is typical modern Linux style to just provide a prototype
and then use "if (IS_ENABLED(CONFIG_FOO))" to guard the call(s) to it.
>
> Also, like Will mentioned earlier, the function name isn't entirely
> accurate anymore. I second the suggestion of using something like
> arch_dma_noncoherent_pgprot().
As mentioned I plan to remove arch_dma_mmap_pgprot for 5.4, so I'd
rather avoid churn for the short period of time.
> As for your idea of defining
> pgprot_dmacoherent for all architectures as
>
> #ifndef pgprot_dmacoherent
> #define pgprot_dmacoherent pgprot_noncached
> #endif
>
> I think that the name here is kind of misleading too, since this
> definition will only be used when there is no support for proper
> DMA coherency.
Do you have a suggestion for a better name? I'm pretty bad at naming,
so just reusing the arm name seemed like a good way to avoid having
to make naming decisions myself.
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Shawn Anastasio <shawn@anastas.io>
Cc: Gavin Li <git@thegavinli.com>,
linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
Russell King <linux@armlinux.org.uk>,
linux-mips@vger.kernel.org, iommu@lists.linux-foundation.org,
Paul Burton <paul.burton@mips.com>,
Catalin Marinas <catalin.marinas@arm.com>,
James Hogan <jhogan@kernel.org>, Will Deacon <will@kernel.org>,
Christoph Hellwig <hch@lst.de>,
linux-arm-kernel@lists.infradead.org,
Robin Murphy <robin.murphy@arm.com>
Subject: Re: [PATCH 1/2] dma-mapping: fix page attributes for dma_mmap_*
Date: Wed, 7 Aug 2019 08:04:32 +0200 [thread overview]
Message-ID: <20190807060432.GD6627@lst.de> (raw)
In-Reply-To: <7df95ffb-6df3-b118-284c-ee32cad81199@anastas.io>
On Tue, Aug 06, 2019 at 09:39:06PM +0200, Shawn Anastasio wrote:
>> -#ifdef CONFIG_ARCH_HAS_DMA_MMAP_PGPROT
>> pgprot_t arch_dma_mmap_pgprot(struct device *dev, pgprot_t prot,
>> unsigned long attrs);
>> -#else
>> -# define arch_dma_mmap_pgprot(dev, prot, attrs) pgprot_noncached(prot)
>> -#endif
>
> Nit, but maybe the prototype should still be ifdef'd here? It at least
> could prevent a reader from incorrectly thinking that the function is
> always present.
Actually it is typical modern Linux style to just provide a prototype
and then use "if (IS_ENABLED(CONFIG_FOO))" to guard the call(s) to it.
>
> Also, like Will mentioned earlier, the function name isn't entirely
> accurate anymore. I second the suggestion of using something like
> arch_dma_noncoherent_pgprot().
As mentioned I plan to remove arch_dma_mmap_pgprot for 5.4, so I'd
rather avoid churn for the short period of time.
> As for your idea of defining
> pgprot_dmacoherent for all architectures as
>
> #ifndef pgprot_dmacoherent
> #define pgprot_dmacoherent pgprot_noncached
> #endif
>
> I think that the name here is kind of misleading too, since this
> definition will only be used when there is no support for proper
> DMA coherency.
Do you have a suggestion for a better name? I'm pretty bad at naming,
so just reusing the arm name seemed like a good way to avoid having
to make naming decisions myself.
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Shawn Anastasio <shawn@anastas.io>
Cc: Gavin Li <git@thegavinli.com>,
linux-kernel@vger.kernel.org,
Michael Ellerman <mpe@ellerman.id.au>,
linuxppc-dev@lists.ozlabs.org,
Russell King <linux@armlinux.org.uk>,
linux-mips@vger.kernel.org, iommu@lists.linux-foundation.org,
Paul Burton <paul.burton@mips.com>,
Catalin Marinas <catalin.marinas@arm.com>,
James Hogan <jhogan@kernel.org>, Will Deacon <will@kernel.org>,
Christoph Hellwig <hch@lst.de>,
linux-arm-kernel@lists.infradead.org,
Robin Murphy <robin.murphy@arm.com>
Subject: Re: [PATCH 1/2] dma-mapping: fix page attributes for dma_mmap_*
Date: Wed, 7 Aug 2019 08:04:32 +0200 [thread overview]
Message-ID: <20190807060432.GD6627@lst.de> (raw)
In-Reply-To: <7df95ffb-6df3-b118-284c-ee32cad81199@anastas.io>
On Tue, Aug 06, 2019 at 09:39:06PM +0200, Shawn Anastasio wrote:
>> -#ifdef CONFIG_ARCH_HAS_DMA_MMAP_PGPROT
>> pgprot_t arch_dma_mmap_pgprot(struct device *dev, pgprot_t prot,
>> unsigned long attrs);
>> -#else
>> -# define arch_dma_mmap_pgprot(dev, prot, attrs) pgprot_noncached(prot)
>> -#endif
>
> Nit, but maybe the prototype should still be ifdef'd here? It at least
> could prevent a reader from incorrectly thinking that the function is
> always present.
Actually it is typical modern Linux style to just provide a prototype
and then use "if (IS_ENABLED(CONFIG_FOO))" to guard the call(s) to it.
>
> Also, like Will mentioned earlier, the function name isn't entirely
> accurate anymore. I second the suggestion of using something like
> arch_dma_noncoherent_pgprot().
As mentioned I plan to remove arch_dma_mmap_pgprot for 5.4, so I'd
rather avoid churn for the short period of time.
> As for your idea of defining
> pgprot_dmacoherent for all architectures as
>
> #ifndef pgprot_dmacoherent
> #define pgprot_dmacoherent pgprot_noncached
> #endif
>
> I think that the name here is kind of misleading too, since this
> definition will only be used when there is no support for proper
> DMA coherency.
Do you have a suggestion for a better name? I'm pretty bad at naming,
so just reusing the arm name seemed like a good way to avoid having
to make naming decisions myself.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-08-07 6:04 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-05 8:01 fix default dma_mmap_* pgprot v2 Christoph Hellwig
2019-08-05 8:01 ` Christoph Hellwig
2019-08-05 8:01 ` Christoph Hellwig
2019-08-05 8:01 ` Christoph Hellwig
2019-08-05 8:01 ` [PATCH 1/2] dma-mapping: fix page attributes for dma_mmap_* Christoph Hellwig
2019-08-05 8:01 ` Christoph Hellwig
2019-08-05 8:01 ` Christoph Hellwig
2019-08-05 8:01 ` Christoph Hellwig
2019-08-05 9:10 ` Catalin Marinas
2019-08-05 9:10 ` Catalin Marinas
2019-08-05 9:10 ` Catalin Marinas
2019-08-05 9:10 ` Catalin Marinas
[not found] ` <CAP_+7SzPdNCMKuuXMjHjpCzxsey2YWR_e6mTAWtNSZ6kKBvKFw@mail.gmail.com>
2019-08-06 2:55 ` Gavin Li
2019-08-06 2:55 ` Gavin Li
2019-08-06 2:55 ` Gavin Li
2019-08-06 5:12 ` Christoph Hellwig
2019-08-06 5:12 ` Christoph Hellwig
2019-08-06 5:12 ` Christoph Hellwig
2019-08-06 19:39 ` Shawn Anastasio via iommu
2019-08-06 19:39 ` Shawn Anastasio
2019-08-06 19:39 ` Shawn Anastasio
2019-08-06 19:39 ` Shawn Anastasio
2019-08-07 6:04 ` Christoph Hellwig [this message]
2019-08-07 6:04 ` Christoph Hellwig
2019-08-07 6:04 ` Christoph Hellwig
2019-08-07 6:04 ` Christoph Hellwig
2019-08-07 11:45 ` Shawn Anastasio via iommu
2019-08-07 11:45 ` Shawn Anastasio
2019-08-07 11:45 ` Shawn Anastasio
2019-08-07 11:45 ` Shawn Anastasio
2019-08-05 8:01 ` [PATCH 2/2] MIPS: remove support for DMA_ATTR_WRITE_COMBINE Christoph Hellwig
2019-08-05 8:01 ` Christoph Hellwig
2019-08-05 8:01 ` Christoph Hellwig
2019-08-05 8:01 ` Christoph Hellwig
2019-08-05 8:06 ` Sergei Shtylyov
2019-08-05 8:06 ` Sergei Shtylyov
2019-08-05 8:06 ` Sergei Shtylyov
2019-08-05 8:06 ` Sergei Shtylyov
-- strict thread matches above, loose matches on Subject: below --
2019-08-07 6:16 fix default dma_mmap_* pgprot v3 Christoph Hellwig
2019-08-07 6:16 ` [PATCH 1/2] dma-mapping: fix page attributes for dma_mmap_* Christoph Hellwig
2019-08-07 6:16 ` Christoph Hellwig
2019-08-07 6:16 ` Christoph Hellwig
2019-08-07 6:16 ` Christoph Hellwig
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=20190807060432.GD6627@lst.de \
--to=hch@lst.de \
--cc=catalin.marinas@arm.com \
--cc=git@thegavinli.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jhogan@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paul.burton@mips.com \
--cc=robin.murphy@arm.com \
--cc=shawn@anastas.io \
--cc=will@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.