linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Make drivers/char/mem.c use remap_pfn_range()
       [not found] <200410220206.i9M26gUi016689@hera.kernel.org>
@ 2004-10-22  2:19 ` William Lee Irwin III
  2004-10-22 14:24   ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: William Lee Irwin III @ 2004-10-22  2:19 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel Mailing List

On Thu, Oct 21, 2004 at 10:25:17PM +0000, Linux Kernel Mailing List wrote:
> ChangeSet 1.2036.1.25, 2004/10/21 15:25:17-07:00, torvalds@ppc970.osdl.org
> 	Make drivers/char/mem.c use remap_pfn_range()
> 	Rather than the deprecated remap_page_range() function
> 	that can't handle all of the PFN range anyway.
> 	Also, since that will now mark the vma as being special,
> 	there's no need to do it in mmap_mem() any more.
>  mem.c |   19 +++++++------------
>  1 files changed, 7 insertions(+), 12 deletions(-)

Odd. I doublechecked the patches I submitted and they actually
covered this.


-- wli

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Make drivers/char/mem.c use remap_pfn_range()
  2004-10-22  2:19 ` Make drivers/char/mem.c use remap_pfn_range() William Lee Irwin III
@ 2004-10-22 14:24   ` Linus Torvalds
  2004-10-22 14:37     ` William Lee Irwin III
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Torvalds @ 2004-10-22 14:24 UTC (permalink / raw)
  To: William Lee Irwin III; +Cc: Linux Kernel Mailing List



On Thu, 21 Oct 2004, William Lee Irwin III wrote:
> 
> Odd. I doublechecked the patches I submitted and they actually
> covered this.

Andrew had a broken patch that shifted the wrong argument by PAGE_SHIFT,
do you want to take the blame for that one (it shifted the size, not the
pfn)?

		Linus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Make drivers/char/mem.c use remap_pfn_range()
  2004-10-22 14:24   ` Linus Torvalds
@ 2004-10-22 14:37     ` William Lee Irwin III
  2004-10-22 15:09       ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: William Lee Irwin III @ 2004-10-22 14:37 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel Mailing List

On Thu, 21 Oct 2004, William Lee Irwin III wrote:
>> Odd. I doublechecked the patches I submitted and they actually
>> covered this.

On Fri, Oct 22, 2004 at 07:24:34AM -0700, Linus Torvalds wrote:
> Andrew had a broken patch that shifted the wrong argument by PAGE_SHIFT,
> do you want to take the blame for that one (it shifted the size, not the
> pfn)?


What I posted shifted the correct argument, though vma->vm_pgoff would
have been been better, as it shifted offset right by PAGE_SHIFT, where
offset could have overflowed. I have no idea what you're referring to
about shifting the wrong argument.

This hunk appeared verbatim in my posted patch,
	Message-ID: <20040925075102.GG9106@holomorphy.com>:


Index: mm3-2.6.9-rc2/drivers/char/mem.c
===================================================================
--- mm3-2.6.9-rc2.orig/drivers/char/mem.c	2004-09-25 00:21:50.622348424 -0700
+++ mm3-2.6.9-rc2/drivers/char/mem.c	2004-09-25 00:21:57.538297040 -0700
@@ -227,7 +227,7 @@
 	 */
 	vma->vm_flags |= VM_RESERVED|VM_IO;
 
-	if (remap_page_range(vma, vma->vm_start, offset,
+	if (remap_pfn_range(vma, vma->vm_start, offset >> PAGE_SHIFT,
 			vma->vm_end-vma->vm_start, vma->vm_page_prot))
 		return -EAGAIN;
 	return 0;

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Make drivers/char/mem.c use remap_pfn_range()
  2004-10-22 14:37     ` William Lee Irwin III
@ 2004-10-22 15:09       ` Linus Torvalds
  2004-10-22 15:13         ` William Lee Irwin III
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Torvalds @ 2004-10-22 15:09 UTC (permalink / raw)
  To: William Lee Irwin III; +Cc: Linux Kernel Mailing List



On Fri, 22 Oct 2004, William Lee Irwin III wrote:
> 
> What I posted shifted the correct argument, though vma->vm_pgoff would
> have been been better, as it shifted offset right by PAGE_SHIFT, where
> offset could have overflowed. I have no idea what you're referring to
> about shifting the wrong argument.

Ok, that patch just got lost.

Quite as well, actually. The whole point of changing remap_page_range() to 
remap_pfn_range() is to give the full range of page frame numbers, and 
just shifting "offset" back down thus seems to be a bug to me. Otherwise 
we migth as well just have continued with the old code.

			Linus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Make drivers/char/mem.c use remap_pfn_range()
  2004-10-22 15:09       ` Linus Torvalds
@ 2004-10-22 15:13         ` William Lee Irwin III
  0 siblings, 0 replies; 5+ messages in thread
From: William Lee Irwin III @ 2004-10-22 15:13 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel Mailing List

On Fri, 22 Oct 2004, William Lee Irwin III wrote:
>> What I posted shifted the correct argument, though vma->vm_pgoff would
>> have been been better, as it shifted offset right by PAGE_SHIFT, where
>> offset could have overflowed. I have no idea what you're referring to
>> about shifting the wrong argument.

On Fri, Oct 22, 2004 at 08:09:07AM -0700, Linus Torvalds wrote:
> Ok, that patch just got lost.
> Quite as well, actually. The whole point of changing remap_page_range() to 
> remap_pfn_range() is to give the full range of page frame numbers, and 
> just shifting "offset" back down thus seems to be a bug to me. Otherwise 
> we migth as well just have continued with the old code.

What I had intended to be the functional improvements were in the arch
code for pci_mmap_page_range(), but I would say the mem.c change beyond
my own changes is an improvement. All is well.


-- wli

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-10-22 15:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200410220206.i9M26gUi016689@hera.kernel.org>
2004-10-22  2:19 ` Make drivers/char/mem.c use remap_pfn_range() William Lee Irwin III
2004-10-22 14:24   ` Linus Torvalds
2004-10-22 14:37     ` William Lee Irwin III
2004-10-22 15:09       ` Linus Torvalds
2004-10-22 15:13         ` William Lee Irwin III

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).