lkml.org 
[lkml]   [2012]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3 3/4] PCI: Add support for non-BAR ROMs
On Wed, 5 Sep 2012 14:20:07 +0100
Matthew Garrett <mjg@redhat.com> wrote:

> On Wed, Sep 05, 2012 at 01:46:21PM +0100, Alan Cox wrote:
> > On Wed, 5 Sep 2012 03:29:32 +0100
> > Matthew Garrett <mjg@redhat.com> wrote:
> >
> > > On Tue, Sep 04, 2012 at 10:18:48PM -0400, Don Dutile wrote:
> > > > > /*
> > > > >+ * Some devices may provide ROMs via a source other than the BAR
> > > > >+ */
> > > > >+ if (pdev->rom&& pdev->romlen) {
> > > > >+ *size = pdev->romlen;
> > > > >+ return phys_to_virt((phys_addr_t)pdev->rom);
> > > > ^^^^^
> > > > ioremap_nocache() ? ... or is caching rom ok?
> > >
> > > If it's appearing through this pathway then it's not actually in ROM,
> > > the platform has pulled it out of somewhere else.
> >
> > If that somewhere else is on the PCI bus then it should be a bus not a
> > virt translation surely ?
>
> We've no good way of knowing what the firmware's giving us - we copy it
> to RAM in the EFI init process, so by the time we're here it certainly
> shouldn't be on the PCI bus.

In which case how do you know that physical address you have been given
actually has a mapping in kernel virtual space. It seems like it ought to
be getting an ioremap in that case ?

phys_to_virt is not valid for arbitary addresses.

Alan




\
 
 \ /
  Last update: 2012-09-05 16:22    [W:0.060 / U:2.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site