linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: joro@8bytes.org (Joerg Roedel)
To: linux-arm-kernel@lists.infradead.org
Subject: [for-4.4-rc6 PATCH] scatterlist: fix sg_phys() masking
Date: Tue, 15 Dec 2015 11:35:24 +0100	[thread overview]
Message-ID: <20151215103524.GH18805@8bytes.org> (raw)
In-Reply-To: <20151214231739.10377.11843.stgit@dwillia2-desk3.jf.intel.com>

On Mon, Dec 14, 2015 at 03:17:39PM -0800, Dan Williams wrote:
> commit db0fa0cb0157 "scatterlist: use sg_phys()" did replacements of the
> form:
> 
>     phys_addr_t phys = page_to_phys(sg_page(s));
>     phys_addr_t phys = sg_phys(s) & PAGE_MASK;
> 
> However, this breaks platforms where sizeof(phys_addr_t) >
> sizeof(unsigned long).  Since PAGE_MASK is an unsigned long this
> inadvertently masks the high bits returned by sg_phys().  Convert to
> PHYSICAL_PAGE_MASK in these cases which will do the proper sign
> extension.
> 
> As caught by the kbuild robot, a generic fallback definition of
> PHYSICAL_PAGE_MASK is needed for several archs.

It is getting late in the cycle already, isn't it better to revert
db0fa0cb0157 for now and queue a fixed version for the next round? Then
you can also replace all the 'sg_phys() & MASK' parts by a new sg helper
which just returns the page-aligned physical address.
This would not only be cleaner than your original patch but also leaves
just one place where you need to fix things if necessary.


	Joerg

  reply	other threads:[~2015-12-15 10:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14 23:17 [for-4.4-rc6 PATCH] scatterlist: fix sg_phys() masking Dan Williams
2015-12-15 10:35 ` Joerg Roedel [this message]
2015-12-15 16:34   ` Dan Williams

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=20151215103524.GH18805@8bytes.org \
    --to=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.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).