All of lore.kernel.org
 help / color / mirror / Atom feed
* amba pl011: where to submit a fix for x86 builds
@ 2013-06-07  9:38 Alessandro Rubini
  2013-06-07  9:50 ` Russell King - ARM Linux
  0 siblings, 1 reply; 2+ messages in thread
From: Alessandro Rubini @ 2013-06-07  9:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux, gregkh, jslaby, linux-serial, x86, tglx, mingo, hpa,
	Chanho Min, Giancarlo Asnaghi

Hello.
This is cc'd to $(get_maintainer.pl -f drivers/tty/serial/amba-pl011.c)
and x86 maintainers too.

While working on the pci-to-amba bridge driver (to be resubmitted in
the next days) I have to deal with the problem of pl011 not building,
after phys_to_page was introduced, by Chanho Min (Cc: here) in commit

   cb06ff1 ARM: PL011: Add support for Rx DMA buffer polling.

because x86 has no phys_to_page.

The fix I use is trivially this:

  -       sg_set_page(&sg->sg, phys_to_page(dma_addr),
  +       sg_set_page(&sg->sg, virt_to_page(sg->buf),

(virt_to_page is slower, but other sg_get_page() users do the same
and other solutions are more convoluted).

Shall I submit this to x86 with the pci-to-amba bridge series or to
arm/serial and then note the dependency when posting the bridge series?

thanks
/alessandro

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

* Re: amba pl011: where to submit a fix for x86 builds
  2013-06-07  9:38 amba pl011: where to submit a fix for x86 builds Alessandro Rubini
@ 2013-06-07  9:50 ` Russell King - ARM Linux
  0 siblings, 0 replies; 2+ messages in thread
From: Russell King - ARM Linux @ 2013-06-07  9:50 UTC (permalink / raw)
  To: Alessandro Rubini
  Cc: linux-kernel, gregkh, jslaby, linux-serial, x86, tglx, mingo, hpa,
	Chanho Min, Giancarlo Asnaghi

On Fri, Jun 07, 2013 at 11:38:54AM +0200, Alessandro Rubini wrote:
> Hello.
> This is cc'd to $(get_maintainer.pl -f drivers/tty/serial/amba-pl011.c)
> and x86 maintainers too.
> 
> While working on the pci-to-amba bridge driver (to be resubmitted in
> the next days) I have to deal with the problem of pl011 not building,
> after phys_to_page was introduced, by Chanho Min (Cc: here) in commit
> 
>    cb06ff1 ARM: PL011: Add support for Rx DMA buffer polling.
> 
> because x86 has no phys_to_page.
> 
> The fix I use is trivially this:
> 
>   -       sg_set_page(&sg->sg, phys_to_page(dma_addr),
>   +       sg_set_page(&sg->sg, virt_to_page(sg->buf),
> 
> (virt_to_page is slower, but other sg_get_page() users do the same
> and other solutions are more convoluted).

... and thereby breaks ARM, because sg->buf is not part of the kernel
direct mapped RAM region.

I don't think there's a portable way to do the above, because the DMA
coherent API doesn't really support translating the allocated memory
region to a struct page pointer.

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

end of thread, other threads:[~2013-06-07  9:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-07  9:38 amba pl011: where to submit a fix for x86 builds Alessandro Rubini
2013-06-07  9:50 ` Russell King - ARM Linux

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.