All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
To: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
Cc: "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org"
	<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Subject: Re: [PATCH] iommu/io-pgtable-arm: Don't use dma_to_phys()
Date: Thu, 17 Sep 2015 16:53:08 +0100	[thread overview]
Message-ID: <55FAE1E4.4060009@arm.com> (raw)
In-Reply-To: <20150917145216.GJ25634-5wv7dgnIgG8@public.gmane.org>

On 17/09/15 15:52, Will Deacon wrote:
[...]
>> -static dma_addr_t __arm_lpae_dma_addr(struct device *dev, void *pages)
>> -{
>> -	return phys_to_dma(dev, virt_to_phys(pages));
>> -}
>
> Can we keep this helper kicking around, at least to contain the ugliness
> of the virt_to_phys + cast?

Can do for the sync and unmap cases - the alloc_pages one needs to avoid 
truncation in the comparison if dma_addr_t and phys_addr_t are different 
sizes, so can't safely cast one to the other either way. I can at least 
get rid of the u64 casts there though, as they seem superfluous after a 
bit of experimentation and another read of the good old "Usual 
arithmetic conversions". I'll fix up and repost.

Robin.

>
> Will
>

WARNING: multiple messages have this Message-ID (diff)
From: robin.murphy@arm.com (Robin Murphy)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] iommu/io-pgtable-arm: Don't use dma_to_phys()
Date: Thu, 17 Sep 2015 16:53:08 +0100	[thread overview]
Message-ID: <55FAE1E4.4060009@arm.com> (raw)
In-Reply-To: <20150917145216.GJ25634@arm.com>

On 17/09/15 15:52, Will Deacon wrote:
[...]
>> -static dma_addr_t __arm_lpae_dma_addr(struct device *dev, void *pages)
>> -{
>> -	return phys_to_dma(dev, virt_to_phys(pages));
>> -}
>
> Can we keep this helper kicking around, at least to contain the ugliness
> of the virt_to_phys + cast?

Can do for the sync and unmap cases - the alloc_pages one needs to avoid 
truncation in the comparison if dma_addr_t and phys_addr_t are different 
sizes, so can't safely cast one to the other either way. I can at least 
get rid of the u64 casts there though, as they seem superfluous after a 
bit of experimentation and another read of the good old "Usual 
arithmetic conversions". I'll fix up and repost.

Robin.

>
> Will
>

  parent reply	other threads:[~2015-09-17 15:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-17 14:22 [PATCH] iommu/io-pgtable-arm: Don't use dma_to_phys() Robin Murphy
2015-09-17 14:22 ` Robin Murphy
     [not found] ` <1c591836f1ec6e676a8889cdccd042650eadb73b.1442499554.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2015-09-17 14:52   ` Will Deacon
2015-09-17 14:52     ` Will Deacon
     [not found]     ` <20150917145216.GJ25634-5wv7dgnIgG8@public.gmane.org>
2015-09-17 15:53       ` Robin Murphy [this message]
2015-09-17 15:53         ` Robin Murphy
2015-09-17 16:42   ` [PATCH v2] " Robin Murphy
2015-09-17 16:42     ` Robin Murphy
     [not found]     ` <59f4ebbf06e75a6176a366495211afd16d0048a3.1442507940.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2015-09-18  8:55       ` Yong Wu
2015-09-18  8:55         ` Yong Wu
2015-09-18 11:04         ` Robin Murphy
2015-09-18 11:04           ` Robin Murphy
     [not found]           ` <55FBEFBA.6000606-5wv7dgnIgG8@public.gmane.org>
2015-09-18 12:29             ` Russell King - ARM Linux
2015-09-18 12:29               ` Russell King - ARM Linux
2015-09-22 13:25             ` Yong Wu
2015-09-22 13:25               ` Yong Wu
2015-09-22 16:23               ` Robin Murphy
2015-09-22 16:23                 ` Robin Murphy
     [not found]                 ` <56018074.2010104-5wv7dgnIgG8@public.gmane.org>
2015-09-22 16:26                   ` Will Deacon
2015-09-22 16:26                     ` Will Deacon

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=55FAE1E4.4060009@arm.com \
    --to=robin.murphy-5wv7dgnigg8@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=will.deacon-5wv7dgnIgG8@public.gmane.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.