linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
	xen-devel@lists.xensource.com, sstabellini@kernel.org,
	Florian Fainelli <f.fainelli@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	"open list:SWIOTLB SUBSYSTEM" <iommu@lists.linux-foundation.org>,
	open list <linux-kernel@vger.kernel.org>,
	Russell King <linux@armlinux.org.uk>,
	Mike Rapoport <rppt@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ard Biesheuvel <ardb@kernel.org>,
	Max Filippov <jcmvbkbc@gmail.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	opendmb@gmail.com
Subject: Re: [PATCH] ARM: Qualify enabling of swiotlb_init()
Date: Fri, 19 Mar 2021 17:22:28 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.21.2103191718210.439@sstabellini-ThinkPad-T480s> (raw)
In-Reply-To: <20210319195929.GA1346384@konrad-char-us-oracle-com.allregionaliads.osdevelopmeniad.oraclevcn.com>

On Fri, 19 Mar 2021, Konrad Rzeszutek Wilk wrote:
> On Fri, Mar 19, 2021 at 02:07:31PM +0100, Christoph Hellwig wrote:
> > On Thu, Mar 18, 2021 at 09:03:33PM -0700, Florian Fainelli wrote:
> > >  #ifdef CONFIG_ARM_LPAE
> > > +	if (swiotlb_force == SWIOTLB_FORCE ||
> > > +	    max_pfn > arm_dma_pfn_limit)
> > 
> > Does arm_dma_pfn_limit do the right thing even with the weirdest
> > remapping ranges?  Maybe a commen here would be useful.
> > 
> > > +		swiotlb_init(1);
> > > +	else
> > > +		swiotlb_force = SWIOTLB_NO_FORCE;
> > 
> > Konrad: what do you think of setting swiotlb_force to SWIOTLB_NO_FORCE
> > and only switching it to SWIOTLB_NORMAL when swiotlb_init* is called?
> > That kind makes more sense than forcing the callers to do it.
> > 
> > While we're at it, I think swiotlb_force should probably be renamed to
> > swiotlb_mode or somethng like that.
> 
> swiotlb_mode sounds good.
> 
> Also it got me thinking - ARM on Xen at some point was a bit strange, so not sure how
> the logic works here, Stefano?

There is nothing strange in regards to swiotlb_force. swiotlb_force is only used
in swiotlb-xen map_page to figure out whether:

- we actually have to use the swiotlb bounce buffer (this is the
  swiotlb_xen == SWIOTLB_FORCE case)
- or we can use the provided page directly for dma if other conditions
  are met (dma_capable, !range_straddles_page_boundary, ...)


I don't think that switching to "swiotlb_mode" would cause any issues.

  reply	other threads:[~2021-03-20  0:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19  4:03 [PATCH] ARM: Qualify enabling of swiotlb_init() Florian Fainelli
2021-03-19 13:07 ` Christoph Hellwig
2021-03-19 17:43   ` Florian Fainelli
2021-03-19 19:59   ` Konrad Rzeszutek Wilk
2021-03-20  0:22     ` Stefano Stabellini [this message]
2021-03-29 19:30       ` Florian Fainelli
2021-03-30  5:36         ` Christoph Hellwig
2021-04-01 17:33           ` Konrad Rzeszutek Wilk
2021-04-01 19:11             ` Florian Fainelli

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=alpine.DEB.2.21.2103191718210.439@sstabellini-ThinkPad-T480s \
    --to=sstabellini@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=f.fainelli@gmail.com \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jcmvbkbc@gmail.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=m.szyprowski@samsung.com \
    --cc=opendmb@gmail.com \
    --cc=robin.murphy@arm.com \
    --cc=rppt@kernel.org \
    --cc=xen-devel@lists.xensource.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).