Re: [PATCH 1/3] avr32: fix build failure

2015-09-24 Thread Sudip Mukherjee
On Wed, Sep 23, 2015 at 07:15:16PM +0200, Hans-Christian Egtvedt wrote:
> Around Wed 23 Sep 2015 21:26:01 +0530 or thereabout, Sudip Mukherjee wrote:
> > On Mon, Sep 21, 2015 at 01:31:44PM +0530, Sudip Mukherjee wrote:
> >> On Mon, Sep 21, 2015 at 09:33:00AM +0200, Hans-Christian Egtvedt wrote:
> >> > Around Mon 21 Sep 2015 12:09:01 +0530 or thereabout, Sudip Mukherjee 
> >> > wrote:
> >> > > On Mon, Sep 21, 2015 at 08:09:42AM +0200, Hans-Christian Egtvedt wrote:
> >> > >> Around Sat 19 Sep 2015 22:42:57 +0530 or thereabout, Sudip Mukherjee 
> >> > >> wrote:
> >> > >> > While building avr32 with allmodconfig, the build used to fail with 
> >> > >> > the
> >> > >> > message:
> >> > >> > error: implicit declaration of function 'pci_iomap'
> >> > >> > error: implicit declaration of function 'pci_iounmap'
> >> > >> 
> >> > >> What has changed recently that start pulling in these? AVR32 does not 
> >> > >> have
> >> > >> PCI at all, and will never have it either. Is this exposing a bug 
> >> > >> somewhere
> >> > >> else?
> >> > > It looks like pci_iomap and pci_iounmap doesnot depend on CONFIG_PCI.
> >> > > So drivers/net/ethernet/via/via-rhine.c is calling these functions even
> >> > > if PCI is disabled. The build log is at:
> >> > > https://travis-ci.org/sudipm-mukherjee/parport/jobs/81127188
> >> > > 
> >> > > You can find a similar discussion at:
> >> > > http://www.linux-mips.org/archives/linux-mips/2013-06/msg00510.html
> >> > 
> >> > If multiple architectures have similar problems, then a more global
> >> > definition of these unused functions could be added.
> >> > 
> >> > Just move the implementation for MIPS into include/asm-generic/io.h ?
> >> > 
> >> > That way we do not have to implement and identical stub for every device 
> >> > not
> >> > supporting PCI.
> >> 
> >> include/asm-generic/io.h is having:
> >> #ifndef CONFIG_GENERIC_IOMAP
> >> struct pci_dev;
> >> extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned
> >>long max);
> >> 
> >> #ifndef pci_iounmap
> >> #define pci_iounmap pci_iounmap
> >> static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p)
> >> {
> >> }
> >> #endif
> >> #endif /* CONFIG_GENERIC_IOMAP */
> >> 
> >> and CONFIG_GENERIC_IOMAP is not defined when I do allmodconfig with
> >> avr32. I have not seen this earlier, maybe in my patch pci_iounmap() was
> >> not required. But pci_iomap is declared as extern so we need have it
> >> somewhere.
> > Hi Hans,
> > Please suggest.
> 
> I can ack the original change, but it will only lead to a cluttered code
> base. The real problem is somewhere else, where it looks like the
> CONFIG_GENERIC_IOMAP symbol assumes PCI is for everybody. I would like if
> somebody addressed that problem instead.

I was having a look and it looks like generic empty pci_iomap and
pci_iounmap are already defined and is used only if CONFIG_PCI is not
defined and CONFIG_GENERIC_PCI_IOMAP is defined. So instead of adding
empty functions to each architecture where PCI is not supported maybe
the driver can have a dependency on CONFIG_GENERIC_PCI_IOMAP.
I have submitted the patch and you are in CC list. arch/sh had a similar
problem with the same driver.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] avr32: fix build failure

2015-09-23 Thread Sudip Mukherjee
On Mon, Sep 21, 2015 at 01:31:44PM +0530, Sudip Mukherjee wrote:
> On Mon, Sep 21, 2015 at 09:33:00AM +0200, Hans-Christian Egtvedt wrote:
> > Around Mon 21 Sep 2015 12:09:01 +0530 or thereabout, Sudip Mukherjee wrote:
> > > On Mon, Sep 21, 2015 at 08:09:42AM +0200, Hans-Christian Egtvedt wrote:
> > >> Around Sat 19 Sep 2015 22:42:57 +0530 or thereabout, Sudip Mukherjee 
> > >> wrote:
> > >> > While building avr32 with allmodconfig, the build used to fail with the
> > >> > message:
> > >> > error: implicit declaration of function 'pci_iomap'
> > >> > error: implicit declaration of function 'pci_iounmap'
> > >> 
> > >> What has changed recently that start pulling in these? AVR32 does not 
> > >> have
> > >> PCI at all, and will never have it either. Is this exposing a bug 
> > >> somewhere
> > >> else?
> > > It looks like pci_iomap and pci_iounmap doesnot depend on CONFIG_PCI.
> > > So drivers/net/ethernet/via/via-rhine.c is calling these functions even
> > > if PCI is disabled. The build log is at:
> > > https://travis-ci.org/sudipm-mukherjee/parport/jobs/81127188
> > > 
> > > You can find a similar discussion at:
> > > http://www.linux-mips.org/archives/linux-mips/2013-06/msg00510.html
> > 
> > If multiple architectures have similar problems, then a more global
> > definition of these unused functions could be added.
> > 
> > Just move the implementation for MIPS into include/asm-generic/io.h ?
> > 
> > That way we do not have to implement and identical stub for every device not
> > supporting PCI.
> 
> include/asm-generic/io.h is having:
> #ifndef CONFIG_GENERIC_IOMAP
> struct pci_dev;
> extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned
>   long max);
> 
> #ifndef pci_iounmap
> #define pci_iounmap pci_iounmap
> static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p)
> {
> }
> #endif
> #endif /* CONFIG_GENERIC_IOMAP */
> 
> and CONFIG_GENERIC_IOMAP is not defined when I do allmodconfig with
> avr32. I have not seen this earlier, maybe in my patch pci_iounmap() was
> not required. But pci_iomap is declared as extern so we need have it
> somewhere.
Hi Hans,
Please suggest.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] avr32: fix build failure

2015-09-23 Thread Hans-Christian Egtvedt
Around Wed 23 Sep 2015 21:26:01 +0530 or thereabout, Sudip Mukherjee wrote:
> On Mon, Sep 21, 2015 at 01:31:44PM +0530, Sudip Mukherjee wrote:
>> On Mon, Sep 21, 2015 at 09:33:00AM +0200, Hans-Christian Egtvedt wrote:
>> > Around Mon 21 Sep 2015 12:09:01 +0530 or thereabout, Sudip Mukherjee wrote:
>> > > On Mon, Sep 21, 2015 at 08:09:42AM +0200, Hans-Christian Egtvedt wrote:
>> > >> Around Sat 19 Sep 2015 22:42:57 +0530 or thereabout, Sudip Mukherjee 
>> > >> wrote:
>> > >> > While building avr32 with allmodconfig, the build used to fail with 
>> > >> > the
>> > >> > message:
>> > >> > error: implicit declaration of function 'pci_iomap'
>> > >> > error: implicit declaration of function 'pci_iounmap'
>> > >> 
>> > >> What has changed recently that start pulling in these? AVR32 does not 
>> > >> have
>> > >> PCI at all, and will never have it either. Is this exposing a bug 
>> > >> somewhere
>> > >> else?
>> > > It looks like pci_iomap and pci_iounmap doesnot depend on CONFIG_PCI.
>> > > So drivers/net/ethernet/via/via-rhine.c is calling these functions even
>> > > if PCI is disabled. The build log is at:
>> > > https://travis-ci.org/sudipm-mukherjee/parport/jobs/81127188
>> > > 
>> > > You can find a similar discussion at:
>> > > http://www.linux-mips.org/archives/linux-mips/2013-06/msg00510.html
>> > 
>> > If multiple architectures have similar problems, then a more global
>> > definition of these unused functions could be added.
>> > 
>> > Just move the implementation for MIPS into include/asm-generic/io.h ?
>> > 
>> > That way we do not have to implement and identical stub for every device 
>> > not
>> > supporting PCI.
>> 
>> include/asm-generic/io.h is having:
>> #ifndef CONFIG_GENERIC_IOMAP
>> struct pci_dev;
>> extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned
>>  long max);
>> 
>> #ifndef pci_iounmap
>> #define pci_iounmap pci_iounmap
>> static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p)
>> {
>> }
>> #endif
>> #endif /* CONFIG_GENERIC_IOMAP */
>> 
>> and CONFIG_GENERIC_IOMAP is not defined when I do allmodconfig with
>> avr32. I have not seen this earlier, maybe in my patch pci_iounmap() was
>> not required. But pci_iomap is declared as extern so we need have it
>> somewhere.
> Hi Hans,
> Please suggest.

I can ack the original change, but it will only lead to a cluttered code
base. The real problem is somewhere else, where it looks like the
CONFIG_GENERIC_IOMAP symbol assumes PCI is for everybody. I would like if
somebody addressed that problem instead.

-- 
Hans-Christian Egtvedt
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] avr32: fix build failure

2015-09-21 Thread Hans-Christian Egtvedt
Around Sat 19 Sep 2015 22:42:57 +0530 or thereabout, Sudip Mukherjee wrote:
> While building avr32 with allmodconfig, the build used to fail with the
> message:
> error: implicit declaration of function 'pci_iomap'
> error: implicit declaration of function 'pci_iounmap'

What has changed recently that start pulling in these? AVR32 does not have
PCI at all, and will never have it either. Is this exposing a bug somewhere
else?

> Create dummy pci_io{map,unmap} functions to fix the build.
> 
> Signed-off-by: Sudip Mukherjee 
> ---
> 
> Tested with defconfig, allmodconfig, allnoconfig and merisc_defconfig.
> Build is at:
> https://travis-ci.org/sudipm-mukherjee/parport/builds/81168845
> 
> Partial idea taken from:
> 78857614104a ("MIPS: Expose missing pci_io{map,unmap} declarations")
> which solved a similar problem with mips.
> 
>  arch/avr32/include/asm/io.h | 13 +
>  1 file changed, 13 insertions(+)
> 
> diff --git a/arch/avr32/include/asm/io.h b/arch/avr32/include/asm/io.h
> index f855646..1d8c4e4 100644
> --- a/arch/avr32/include/asm/io.h
> +++ b/arch/avr32/include/asm/io.h
> @@ -276,6 +276,19 @@ extern void __iomem *__ioremap(unsigned long offset, 
> size_t size,
>  unsigned long flags);
>  extern void __iounmap(void __iomem *addr);
>  
> +#ifndef CONFIG_PCI
> +struct pci_dev;
> +static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
> +{
> +}
> +
> +static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar,
> +   unsigned long maxlen)
> +{
> + return NULL;
> +}
> +#endif
> +
>  /*
>   * ioremap   -   map bus memory into CPU space
>   * @offset   bus address of the memory
-- 
mvh
Hans-Christian Egtvedt
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] avr32: fix build failure

2015-09-21 Thread Sudip Mukherjee
On Mon, Sep 21, 2015 at 08:09:42AM +0200, Hans-Christian Egtvedt wrote:
> Around Sat 19 Sep 2015 22:42:57 +0530 or thereabout, Sudip Mukherjee wrote:
> > While building avr32 with allmodconfig, the build used to fail with the
> > message:
> > error: implicit declaration of function 'pci_iomap'
> > error: implicit declaration of function 'pci_iounmap'
> 
> What has changed recently that start pulling in these? AVR32 does not have
> PCI at all, and will never have it either. Is this exposing a bug somewhere
> else?
It looks like pci_iomap and pci_iounmap doesnot depend on CONFIG_PCI.
So drivers/net/ethernet/via/via-rhine.c is calling these functions even
if PCI is disabled. The build log is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/81127188

You can find a similar discussion at:
http://www.linux-mips.org/archives/linux-mips/2013-06/msg00510.html

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] avr32: fix build failure

2015-09-21 Thread Sudip Mukherjee
On Mon, Sep 21, 2015 at 09:33:00AM +0200, Hans-Christian Egtvedt wrote:
> Around Mon 21 Sep 2015 12:09:01 +0530 or thereabout, Sudip Mukherjee wrote:
> > On Mon, Sep 21, 2015 at 08:09:42AM +0200, Hans-Christian Egtvedt wrote:
> >> Around Sat 19 Sep 2015 22:42:57 +0530 or thereabout, Sudip Mukherjee wrote:
> >> > While building avr32 with allmodconfig, the build used to fail with the
> >> > message:
> >> > error: implicit declaration of function 'pci_iomap'
> >> > error: implicit declaration of function 'pci_iounmap'
> >> 
> >> What has changed recently that start pulling in these? AVR32 does not have
> >> PCI at all, and will never have it either. Is this exposing a bug somewhere
> >> else?
> > It looks like pci_iomap and pci_iounmap doesnot depend on CONFIG_PCI.
> > So drivers/net/ethernet/via/via-rhine.c is calling these functions even
> > if PCI is disabled. The build log is at:
> > https://travis-ci.org/sudipm-mukherjee/parport/jobs/81127188
> > 
> > You can find a similar discussion at:
> > http://www.linux-mips.org/archives/linux-mips/2013-06/msg00510.html
> 
> If multiple architectures have similar problems, then a more global
> definition of these unused functions could be added.
> 
> Just move the implementation for MIPS into include/asm-generic/io.h ?
> 
> That way we do not have to implement and identical stub for every device not
> supporting PCI.

include/asm-generic/io.h is having:
#ifndef CONFIG_GENERIC_IOMAP
struct pci_dev;
extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned
long max);

#ifndef pci_iounmap
#define pci_iounmap pci_iounmap
static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p)
{
}
#endif
#endif /* CONFIG_GENERIC_IOMAP */

and CONFIG_GENERIC_IOMAP is not defined when I do allmodconfig with
avr32. I have not seen this earlier, maybe in my patch pci_iounmap() was
not required. But pci_iomap is declared as extern so we need have it
somewhere.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] avr32: fix build failure

2015-09-21 Thread Hans-Christian Egtvedt
Around Mon 21 Sep 2015 12:09:01 +0530 or thereabout, Sudip Mukherjee wrote:
> On Mon, Sep 21, 2015 at 08:09:42AM +0200, Hans-Christian Egtvedt wrote:
>> Around Sat 19 Sep 2015 22:42:57 +0530 or thereabout, Sudip Mukherjee wrote:
>> > While building avr32 with allmodconfig, the build used to fail with the
>> > message:
>> > error: implicit declaration of function 'pci_iomap'
>> > error: implicit declaration of function 'pci_iounmap'
>> 
>> What has changed recently that start pulling in these? AVR32 does not have
>> PCI at all, and will never have it either. Is this exposing a bug somewhere
>> else?
> It looks like pci_iomap and pci_iounmap doesnot depend on CONFIG_PCI.
> So drivers/net/ethernet/via/via-rhine.c is calling these functions even
> if PCI is disabled. The build log is at:
> https://travis-ci.org/sudipm-mukherjee/parport/jobs/81127188
> 
> You can find a similar discussion at:
> http://www.linux-mips.org/archives/linux-mips/2013-06/msg00510.html

If multiple architectures have similar problems, then a more global
definition of these unused functions could be added.

Just move the implementation for MIPS into include/asm-generic/io.h ?

That way we do not have to implement and identical stub for every device not
supporting PCI.

-- 
mvh
Hans-Christian Egtvedt
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] avr32: fix build failure

2015-09-19 Thread Sudip Mukherjee
While building avr32 with allmodconfig, the build used to fail with the
message:
error: implicit declaration of function 'pci_iomap'
error: implicit declaration of function 'pci_iounmap'

Create dummy pci_io{map,unmap} functions to fix the build.

Signed-off-by: Sudip Mukherjee 
---

Tested with defconfig, allmodconfig, allnoconfig and merisc_defconfig.
Build is at:
https://travis-ci.org/sudipm-mukherjee/parport/builds/81168845

Partial idea taken from:
78857614104a ("MIPS: Expose missing pci_io{map,unmap} declarations")
which solved a similar problem with mips.

 arch/avr32/include/asm/io.h | 13 +
 1 file changed, 13 insertions(+)

diff --git a/arch/avr32/include/asm/io.h b/arch/avr32/include/asm/io.h
index f855646..1d8c4e4 100644
--- a/arch/avr32/include/asm/io.h
+++ b/arch/avr32/include/asm/io.h
@@ -276,6 +276,19 @@ extern void __iomem *__ioremap(unsigned long offset, 
size_t size,
   unsigned long flags);
 extern void __iounmap(void __iomem *addr);
 
+#ifndef CONFIG_PCI
+struct pci_dev;
+static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
+{
+}
+
+static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar,
+ unsigned long maxlen)
+{
+   return NULL;
+}
+#endif
+
 /*
  * ioremap -   map bus memory into CPU space
  * @offset bus address of the memory
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html