linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	Linux-sh list <linux-sh@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Joerg Roedel <joro@8bytes.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	Liviu Dudau <Liviu.Dudau@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	James Bottomley <jbottomley@parallels.com>,
	Magnus Damm <damm@opensource.se>,
	linux-pci <linux-pci@vger.kernel.org>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH v3 3/4] sh/PCI: Pass GAPSPCI_DMA_BASE CPU & bus address to dma_declare_coherent_memory()
Date: Mon, 26 May 2014 23:33:28 +0000	[thread overview]
Message-ID: <CAErSpo708iC2UWjTwDqLnSUSXWG087DoOQEMkFcfNsGw1wvQsg@mail.gmail.com> (raw)
In-Reply-To: <CAMuHMdWp-dUFwSgw30SYqXxAtAsrXDgaxcgfBZwV=1pEVN3B=A@mail.gmail.com>

On Mon, May 26, 2014 at 8:46 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Thu, May 8, 2014 at 10:49 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>> --- a/arch/sh/drivers/pci/fixups-dreamcast.c
>> +++ b/arch/sh/drivers/pci/fixups-dreamcast.c
>> @@ -31,6 +31,8 @@
>>  static void gapspci_fixup_resources(struct pci_dev *dev)
>>  {
>>         struct pci_channel *p = dev->sysdata;
>> +       struct resource res;
>> +       struct pci_bus_region region;
>>
>>         printk(KERN_NOTICE "PCI: Fixing up device %s\n", pci_name(dev));
>>
>> @@ -50,11 +52,21 @@ static void gapspci_fixup_resources(struct pci_dev *dev)
>>
>>                 /*
>>                  * Redirect dma memory allocations to special memory window.
>> +                *
>> +                * If this GAPSPCI region were mapped by a BAR, the CPU
>> +                * phys_addr_t would be pci_resource_start(), and the bus
>> +                * address would be pci_bus_address(pci_resource_start()).
>> +                * But apparently there's no BAR mapping it, so we just
>> +                * "know" its CPU address is GAPSPCI_DMA_BASE.
>>                  */
>> +               res.start = GAPSPCI_DMA_BASE;
>> +               res.end = GAPSPCI_DMA_BASE + GAPSPCI_DMA_SIZE - 1;
>> +               res.flags = IORESOURCE_MEM;
>> +               pcibios_resource_to_bus(dev, &region, &resource);
>
> In response to http://kisskb.ellerman.id.au/kisskb/buildresult/11212250/
>
> | /scratch/kisskb/src/arch/sh/drivers/pci/fixups-dreamcast.c: In
> function 'gapspci_fixup_resources':
> | /scratch/kisskb/src/arch/sh/drivers/pci/fixups-dreamcast.c:65:42:
> error: 'resource' undeclared (first use in this function)
> | /scratch/kisskb/src/arch/sh/drivers/pci/fixups-dreamcast.c:65:42:
> note: each undeclared identifier is reported only once for each
> function it appears in
>
> "resource" seem to have been replaced by "res", but this warning still happens:
>
> | /scratch/kisskb/src/arch/sh/drivers/pci/fixups-dreamcast.c:65:3:
> warning: passing argument 1 of 'pcibios_resource_to_bus' from
> incompatible pointer type [enabled by default]
> | /scratch/kisskb/src/include/linux/pci.h:737:6: note: expected
> 'struct pci_bus *' but argument is of type 'struct pci_dev *'

Sheesh, this really has not been my day.  Fixed, thanks.

>>                 BUG_ON(!dma_declare_coherent_memory(&dev->dev,
>> -                                               GAPSPCI_DMA_BASE,
>> -                                               GAPSPCI_DMA_BASE,
>> -                                               GAPSPCI_DMA_SIZE,
>> +                                               res.start,
>> +                                               region.start,
>> +                                               resource_size(&res),
>>                                                 DMA_MEMORY_MAP |
>>                                                 DMA_MEMORY_EXCLUSIVE));
>>                 break;
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

      reply	other threads:[~2014-05-26 23:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140508204257.17877.4639.stgit@bhelgaas-glaptop.roam.corp.google.com>
2014-05-08 20:49 ` [PATCH v3 3/4] sh/PCI: Pass GAPSPCI_DMA_BASE CPU & bus address to dma_declare_coherent_memory() Bjorn Helgaas
2014-05-26 14:46   ` Geert Uytterhoeven
2014-05-26 23:33     ` Bjorn Helgaas [this message]

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=CAErSpo708iC2UWjTwDqLnSUSXWG087DoOQEMkFcfNsGw1wvQsg@mail.gmail.com \
    --to=bhelgaas@google.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=arnd@arndb.de \
    --cc=damm@opensource.se \
    --cc=dwmw2@infradead.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jbottomley@parallels.com \
    --cc=joro@8bytes.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=rdunlap@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).