linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Mingarelli, Thomas" <Thomas.Mingarelli@hp.com>
To: Wim Van Sebroeck <wim@iguana.be>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: Maxim Uvarov <maxim.uvarov@oracle.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	dann frazier <dannf@hp.com>
Subject: RE: [PATCH] hpwdt: clean up set_memory_x call for 32 bit
Date: Tue, 24 Jan 2012 21:05:53 +0000	[thread overview]
Message-ID: <9774516974AF5F4C8A2C3C69CD3412332032E846@G9W0755.americas.hpqcorp.net> (raw)
In-Reply-To: <20120124203738.GA27296@infomag.iguana.be>

Yes I agree that Maxim's patch is correct. The original set_memory_x call for 64 bit was done correctly and the newer calls are wrong.

The 2 pages for the BIOS SD is a known value so it should be safe to use as is.



Tom
-----Original Message-----
From: Wim Van Sebroeck [mailto:wim@iguana.be] 
Sent: Tuesday, January 24, 2012 2:38 PM
To: Linus Torvalds
Cc: Maxim Uvarov; linux-kernel@vger.kernel.org; akpm@linux-foundation.org; stable@vger.kernel.org; Mingarelli, Thomas; dann frazier
Subject: Re: [PATCH] hpwdt: clean up set_memory_x call for 32 bit

Hi Linus,

> So I don't know who is supposed to be handling this (Wim?), but the
> patch itself looks suspicious.

I asked Tom to look at Maxim's patch and see what it does. Tom was going to look at the patch and
I'm waiting on feedback from him first. (That's why I din't sent it upstream yet).

> On Sun, Jan 15, 2012 at 8:02 PM, Maxim Uvarov <maxim.uvarov@oracle.com> wrote:
> > -       set_memory_x((unsigned long)bios32_entrypoint, (2 * PAGE_SIZE));
> > +       set_memory_x((unsigned long)bios32_entrypoint & PAGE_MASK, 2);
> 
> If it wasn't page-aligned to begin with, then maybe it needs three pages now?
> 
> > -                               set_memory_x((unsigned long)cru_rom_addr, cru_length);
> > +                               set_memory_x((unsigned long)cru_rom_addr & PAGE_MASK, cru_length >> PAGE_SHIFT);
> 
> Same here. If we align the start address down, we should fix up the
> length. And should we not align the number of pages up?
> 
> In general, a "start/length" conversion to a "page/nr" model needs to be roughly
> 
>    len += start & ~PAGE_MASK;
>    start &= PAGE_MASK;
>    nr_pages = (len + PAGE_SIZE - 1) >> PAGE_SHIFT;
> 
> to do things right. But I don't know where those magic numbers come
> from. Maybe the "2" is already due to the code possibly traversing a
> page boundary, and has already been fixed up. Somebody who knows the
> driver and the requirements should take a look at this.

Valid comments indeed. Tom please take Linus comments with you when you look at the patch.

Dan: I put you in Cc: also so that you can have a look at it also.

Kind regards,
Wim.



  reply	other threads:[~2012-01-24 21:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-16  4:02 hpwdt: clean up set_memory_x call for 32 bit Maxim Uvarov
2012-01-16  4:02 ` [PATCH] " Maxim Uvarov
2012-01-24 20:20   ` Linus Torvalds
2012-01-24 20:37     ` Wim Van Sebroeck
2012-01-24 21:05       ` Mingarelli, Thomas [this message]
2012-01-25 23:21         ` Maxim Uvarov
2012-01-26  0:01           ` Mingarelli, Thomas
2012-01-27 16:49     ` Wim Van Sebroeck
2012-01-27 16:55       ` Mingarelli, Thomas
2012-01-27 18:33       ` Maxim Uvarov

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=9774516974AF5F4C8A2C3C69CD3412332032E846@G9W0755.americas.hpqcorp.net \
    --to=thomas.mingarelli@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=dannf@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxim.uvarov@oracle.com \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=wim@iguana.be \
    /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).