linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-arm-kernel@lists.infradead.org,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	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 10:43:22 -0700	[thread overview]
Message-ID: <d4308ead-d561-19f6-510c-45e61613de54@gmail.com> (raw)
In-Reply-To: <20210319130731.GB2624@lst.de>



On 3/19/2021 6:07 AM, 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.

It gets assigned to either 0xffffffff or PHYS_OFFSET + arm_dma_zone_size
- 1 which is obtained from the machine descriptor, so I expect it to do
the right thing, it works for a Pi 4 in 32-bit mode for instance. This
is conditional upon enabling CONFIG_ZONE_DMA for ARM, and will otherwise
keep its original value of 0, so this should be safe AFAICT.

> 
>> +		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.
Agreed.
-- 
Florian

  reply	other threads:[~2021-03-19 17:44 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 [this message]
2021-03-19 19:59   ` Konrad Rzeszutek Wilk
2021-03-20  0:22     ` Stefano Stabellini
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=d4308ead-d561-19f6-510c-45e61613de54@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.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 \
    /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).