* Re: Which microcode patch for MPC870?
From: Anton Vorontsov @ 2010-07-30 6:45 UTC (permalink / raw)
To: Shawn Jin; +Cc: ppcdev
In-Reply-To: <AANLkTimBP98EwRuvU_dj-RM2kaXZ-FSZ=GQxdod9VQeU@mail.gmail.com>
Hello,
On Thu, Jul 29, 2010 at 11:40:21PM -0700, Shawn Jin wrote:
> Hi,
>
> Which microcode patch should be selected for MPC870? In the old 2.4
> kernel, the CONFIG_UCODE_PATCH was selected. What's the corresponding
> config: CONFIG_USB_SOF_UCODE_PATCH or CONFIG_I2C_SPI_UCODE_PATCH or
> CONFIG_I2C_SPI_SMC1_UCODE_PATCH? Since my board doesn't have USB, I
> believe USB microcode is irrelevant here. So it comes down the other
> two choices. Of course do I really need the patch? My board has I2C
> and SMC1, but no SPI.
>
> I chose CONFIG_I2C_SPI_UCODE_PATCH as an experiment but got the
> following compilation error:
These errors were fixed by
http://patchwork.ozlabs.org/patch/58262/
and
http://patchwork.ozlabs.org/patch/58263/
Thanks,
> CC arch/powerpc/sysdev/micropatch.o
> arch/powerpc/sysdev/micropatch.c: In function 'cpm_load_patch':
> arch/powerpc/sysdev/micropatch.c:629: error: expected '=', ',', ';',
> 'asm' or '__attribute__' before '*' token
> arch/powerpc/sysdev/micropatch.c:629: error: 'spp' undeclared (first
> use in this function)
> arch/powerpc/sysdev/micropatch.c:629: error: (Each undeclared
> identifier is reported only once
> arch/powerpc/sysdev/micropatch.c:629: error: for each function it appears in.)
> cc1: warnings being treated as errors
> arch/powerpc/sysdev/micropatch.c:630: warning: ISO C90 forbids mixed
> declarations and code
> arch/powerpc/sysdev/micropatch.c:671: error: 'spi_t' undeclared (first
> use in this function)
> arch/powerpc/sysdev/micropatch.c:671: error: expected expression
> before ')' token
> arch/powerpc/sysdev/micropatch.c:630: warning: unused variable 'smp'
> make[1]: *** [arch/powerpc/sysdev/micropatch.o] Error 1
>
> Obviously there is no spi_t declaration in 2.6.33.5. So where is this
> spi_t declared?
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply
* ramdisk size is larger than 4MB
From: Shawn Jin @ 2010-07-30 7:00 UTC (permalink / raw)
To: ppcdev
Hi,
I have a ramdisk as RFS much larger than 4MB in a 2.4 kernel. In
recent 2.6 kernels ramdisk is no longer supported so I decided to go
with initramfs. However I found the initial RFS for initramfs is
limited to 4MB since the bootwrapper locates at 0x400000.
One way to lift this limitation is to relocate the bootwrapper to
somewhere else, say for example, 0x1000000 so that a 16MB initramfs
can be loaded. If the bootwrapper is relocated, what else would be
affected by this relocation?
Another (better?) way may be to find a right file system for RFS such
as JFFS2. My board has limited NOR flash (32MB) but larger RAM
(128MB). There is not much space left in flash for RFS.
Would you like to share some thoughts?
Thanks a lot,
-Shawn.
^ permalink raw reply
* Re: [PATCH] Adjust arch/powerpc inline asms for recent gcc change
From: Benjamin Herrenschmidt @ 2010-07-30 7:04 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <1278569285.28659.76.camel@pasglop>
On Thu, 2010-07-08 at 16:08 +1000, Benjamin Herrenschmidt wrote:
> On Fri, 2010-06-25 at 11:56 +0200, Jakub Jelinek wrote:
>
> > static inline void sync(void)
> > diff --git a/arch/powerpc/include/asm/atomic.h b/arch/powerpc/include/asm/atomic.h
> > index b8f152e..288d8b2 100644
> > --- a/arch/powerpc/include/asm/atomic.h
> > +++ b/arch/powerpc/include/asm/atomic.h
> > @@ -19,14 +19,14 @@ static __inline__ int atomic_read(const atomic_t *v)
> > {
> > int t;
> >
> > - __asm__ __volatile__("lwz%U1%X1 %0,%1" : "=r"(t) : "m"(v->counter));
> > + __asm__ __volatile__("lwz%U1%X1 %0,%1" : "=r"(t) : "m<>"(v->counter));
> >
> > return t;
> > }
> >
>
> This gives me:
>
> /home/benh/linux-powerpc-test/arch/powerpc/kernel/time.c: In function ‘timer_interrupt’:
> /home/benh/linux-powerpc-test/arch/powerpc/include/asm/atomic.h:22: error: ‘asm’ operand has impossible constraints
> make[2]: *** [arch/powerpc/kernel/time.o] Error 1
>
> $ gcc --version
> gcc (Debian 4.4.4-1) 4.4.4
Ping :-)
Do that mean that 4.4.4 doesn't understand your new constraints or are
we doing something incorrect ?
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 3/3 v2] mmc: Add ESDHC weird voltage bits workaround
From: Anton Vorontsov @ 2010-07-30 7:06 UTC (permalink / raw)
To: Roy Zang; +Cc: linuxppc-dev, akpm, linux-mmc
In-Reply-To: <1280461977-2023-1-git-send-email-tie-fei.zang@freescale.com>
On Fri, Jul 30, 2010 at 11:52:57AM +0800, Roy Zang wrote:
> P4080 ESDHC controller does not support 1.8V and 3.0V voltage. but the
> host controller capabilities register wrongly set the bits.
> This patch adds the workaround to correct the weird voltage setting bits.
>
> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
> ---
[...]
> diff --git a/drivers/mmc/host/sdhci-of-core.c b/drivers/mmc/host/sdhci-of-core.c
> index 0c30242..1f3913d 100644
> --- a/drivers/mmc/host/sdhci-of-core.c
> +++ b/drivers/mmc/host/sdhci-of-core.c
> @@ -164,6 +164,10 @@ static int __devinit sdhci_of_probe(struct of_device *ofdev,
> if (sdhci_of_wp_inverted(np))
> host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
>
> + if (of_device_is_compatible(np, "fsl,p4080-esdhc"))
> + host->quirks |= (SDHCI_QUIRK_QORIQ_NO_VDD_180
> + |SDHCI_QUIRK_QORIQ_NO_VDD_300);
> +
It should be two properties, something like sdhci,no-vdd-180
and sdhci,no-vdd-300. But it might be even better: we have
voltage-ranges for mmc-spi case, see
Documentation/powerpc/dts-bindings/mmc-spi-slot.txt.
If voltage-ranges specified, then we use it, not capabilities
register.
For p4080 it will be 'voltage-ranges = <3200 3400>;'. So, with
voltage-ranges we can do fine grained VDD control without
introducing anything new.
As for implementation, you might just factor out voltage-ranges
parsing from drivers/mmc/host/of_mmc_spi.c, and then in sdhci
driver you could do.
if (host->ocr_avail)
mmc->ocr_avail = host->ocr_avail.
> clk = of_get_property(np, "clock-frequency", &size);
> if (clk && size == sizeof(*clk) && *clk)
> of_host->clock = *clk;
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 1424d08..a667790 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1699,6 +1699,14 @@ int sdhci_add_host(struct sdhci_host *host)
>
> caps = sdhci_readl(host, SDHCI_CAPABILITIES);
>
> + /* Workaround for P4080 host controller capabilities
> + * 1.8V and 3.0V do not supported*/
> + if (host->quirks & SDHCI_QUIRK_QORIQ_NO_VDD_180)
The point of making NO_VDD stuff is to make these quirks
"chip-agnostic". Ideally, sdhci.c should never know about
particular chips.
So, you shouldn't name quirks with QORIQ.
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: [PATCH] Adjust arch/powerpc inline asms for recent gcc change
From: Jakub Jelinek @ 2010-07-30 7:19 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <1280473486.2169.2.camel@pasglop>
On Fri, Jul 30, 2010 at 05:04:46PM +1000, Benjamin Herrenschmidt wrote:
> On Thu, 2010-07-08 at 16:08 +1000, Benjamin Herrenschmidt wrote:
> > On Fri, 2010-06-25 at 11:56 +0200, Jakub Jelinek wrote:
> >
> > > static inline void sync(void)
> > > diff --git a/arch/powerpc/include/asm/atomic.h b/arch/powerpc/include/asm/atomic.h
> > > index b8f152e..288d8b2 100644
> > > --- a/arch/powerpc/include/asm/atomic.h
> > > +++ b/arch/powerpc/include/asm/atomic.h
> > > @@ -19,14 +19,14 @@ static __inline__ int atomic_read(const atomic_t *v)
> > > {
> > > int t;
> > >
> > > - __asm__ __volatile__("lwz%U1%X1 %0,%1" : "=r"(t) : "m"(v->counter));
> > > + __asm__ __volatile__("lwz%U1%X1 %0,%1" : "=r"(t) : "m<>"(v->counter));
> > >
> > > return t;
> > > }
> > >
> >
> > This gives me:
> >
> > /home/benh/linux-powerpc-test/arch/powerpc/kernel/time.c: In function ‘timer_interrupt’:
> > /home/benh/linux-powerpc-test/arch/powerpc/include/asm/atomic.h:22: error: ‘asm’ operand has impossible constraints
> > make[2]: *** [arch/powerpc/kernel/time.o] Error 1
> >
> > $ gcc --version
> > gcc (Debian 4.4.4-1) 4.4.4
>
> Ping :-)
>
> Do that mean that 4.4.4 doesn't understand your new constraints or are
> we doing something incorrect ?
The constraints weren't new, so in theory everything would work fine.
Except because < and > were so rarely used on many targets before,
there were backend bugs on PowerPC and SPARC at least related to that.
See
http://gcc.gnu.org/PR44707
http://gcc.gnu.org/PR44701
http://gcc.gnu.org/PR44492
So, in short, I'm afraid "m<>" needs to be used only for GCC 4.6+
(and, vendors which backported the inline-asm handling changes
to their older gcc would need to adjust for their gccs too).
When "m<>" isn't used, it just leads to potential code pessimization
in inline-asms that are prepared for handling side-effects.
Jakub
^ permalink raw reply
* Re: [PATCH 1/3] mmc: Auto CMD12 support for eSDHC driver
From: Anton Vorontsov @ 2010-07-30 7:26 UTC (permalink / raw)
To: Roy Zang; +Cc: linuxppc-dev, linux-mmc-approval, Chang-Ming.Huang
In-Reply-To: <1280295753-12331-1-git-send-email-tie-fei.zang@freescale.com>
On Wed, Jul 28, 2010 at 01:42:33PM +0800, Roy Zang wrote:
[...]
> + if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)
> + if (mrq->stop) {
> + mrq->data->stop = NULL;
> + mrq->stop = NULL;
> + }
Please put additional curly braces for the first 'if' statement.
> host->mrq = mrq;
>
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index c846813..aa112aa 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -2,6 +2,7 @@
> * linux/drivers/mmc/host/sdhci.h - Secure Digital Host Controller Interface driver
> *
> * Copyright (C) 2005-2008 Pierre Ossman, All Rights Reserved.
> + * Copyright 2010 Freescale Semiconductor, Inc.
Wrong count of spaces after '*'.
Also, according to git shortlog it's Freescale's first
patch to sdhci core, and the patch is quite trivial.
IANAL, but please refrain from adding authorship or copyright
notices unless you have done some major contribution(s).
> * This program is free software; you can redistribute it and/or modify
> * it under the terms of the GNU General Public License as published by
> @@ -240,6 +241,8 @@ struct sdhci_host {
> #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN (1<<25)
> /* Controller cannot support End Attribute in NOP ADMA descriptor */
> #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC (1<<26)
> +/* Controller uses Auto CMD12 command to stop the transfer */
> +#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<27)
Thanks,
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: [PATCH 2/3] dts: Add sdhci-auto-cmd12 field for p4080 device tree
From: Anton Vorontsov @ 2010-07-30 7:30 UTC (permalink / raw)
To: Roy Zang; +Cc: linuxppc-dev, linux-mmc-approval
In-Reply-To: <1280295887-14251-1-git-send-email-tie-fei.zang@freescale.com>
On Wed, Jul 28, 2010 at 01:44:47PM +0800, Roy Zang wrote:
> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
> ---
> arch/powerpc/boot/dts/p4080ds.dts | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/boot/dts/p4080ds.dts b/arch/powerpc/boot/dts/p4080ds.dts
> index 6b29eab..11c8884 100644
> --- a/arch/powerpc/boot/dts/p4080ds.dts
> +++ b/arch/powerpc/boot/dts/p4080ds.dts
> @@ -280,6 +280,7 @@
> reg = <0x114000 0x1000>;
> interrupts = <48 2>;
> interrupt-parent = <&mpic>;
> + fsl,sdhci-auto-cmd12;
This should be sdhci,auto-cmd12 or something like that,
not fsl-specific.
Also please document this property in
Documentation/powerpc/dts-bindings/fsl/esdhc.txt.
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: [PATCH 3/3] mmc: Add ESDHC weird register workaround
From: Anton Vorontsov @ 2010-07-30 7:37 UTC (permalink / raw)
To: Zang Roy-R61911; +Cc: linuxppc-dev, linux-mmc
In-Reply-To: <83024545B35D6445A690EFD603E7869A0512E0@zch01exm23.fsl.freescale.net>
On Wed, Jul 28, 2010 at 05:43:00PM +0800, Zang Roy-R61911 wrote:
[...]
> > > + /* The default value of DMAS bits of Protocol Control
> > Register is not
> > > + * correct. clear these two bits to use simple DMA */
> > > +#define ESDHCI_CTRL_DMAS_MASK 0xFFFFFCFF
> > > + if (host->quirks & SDHCI_QUIRK_QORIQ_REG_WEIRD) {
> > > + ctrl = sdhci_readl(host, SDHCI_HOST_CONTROL);
> > > + ctrl = ctrl & ESDHCI_CTRL_DMAS_MASK;
> > > + sdhci_writel(host, ctrl, SDHCI_HOST_CONTROL);
> > > + }
> >
> > You should implement register quirks via SDHCI IO accessors.
> What does you mean "SDHCI IO accessors?
See drivers/mmc/host/sdhci-of-esdhc.c
struct sdhci_of_data sdhci_esdhc = {
...
.ops = {
...
.write_l = sdhci_be32bs_writel,
...
},
};
You can implement your own write_l and put the quirk in
there, as we do for esdhc_readw, esdhc_writew, etc.
OTOH, as you say it has wrong default value, not behaviour,
so I think you can just initialize the HOST_CONTROL register
just once somewhere in sdhci-of-esdhc, e.g. ->enable_dma
callback?
> It makes more sense to define something like:
> SDHCI_QUIRK_QORIQ_PROCTL_WEIRD.
I don't think so.
Thanks,
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply
* Re: [PATCH] Adjust arch/powerpc inline asms for recent gcc change
From: Benjamin Herrenschmidt @ 2010-07-30 7:52 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <20100730071922.GQ18378@tyan-ft48-01.lab.bos.redhat.com>
On Fri, 2010-07-30 at 09:19 +0200, Jakub Jelinek wrote:
> So, in short, I'm afraid "m<>" needs to be used only for GCC 4.6+
> (and, vendors which backported the inline-asm handling changes
> to their older gcc would need to adjust for their gccs too).
> When "m<>" isn't used, it just leads to potential code pessimization
> in inline-asms that are prepared for handling side-effects.
Ok, so we'll need some kind of macro to "fixup" those constraints ...
Just to make sure I understand things properly, if we don't change them,
the code will still be correct with 4.6 but sub-optimal, right ?
Cheers,
Ben.
^ permalink raw reply
* [PATCH] Use is_32bit_task() helper to test 32 bit binary
From: Denis Kirjanov @ 2010-07-30 8:04 UTC (permalink / raw)
To: benh; +Cc: shaggy, paulus, linuxppc-dev
Use is_32bit_task() helper to test 32 bit binary.
Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
---
arch/powerpc/kernel/process.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 43855c9..e7dffbf 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -692,7 +692,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
p->thread.regs = childregs;
if (clone_flags & CLONE_SETTLS) {
#ifdef CONFIG_PPC64
- if (!test_thread_flag(TIF_32BIT))
+ if (!is_32bit_task())
childregs->gpr[13] = childregs->gpr[6];
else
#endif
@@ -787,7 +787,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
regs->nip = start;
regs->msr = MSR_USER;
#else
- if (!test_thread_flag(TIF_32BIT)) {
+ if (!is_32bit_task()) {
unsigned long entry, toc;
/* start is a relocated pointer to the function descriptor for
@@ -959,7 +959,7 @@ int sys_clone(unsigned long clone_flags, unsigned long usp,
if (usp == 0)
usp = regs->gpr[1]; /* stack pointer for child */
#ifdef CONFIG_PPC64
- if (test_thread_flag(TIF_32BIT)) {
+ if (is_32bit_task()) {
parent_tidp = TRUNC_PTR(parent_tidp);
child_tidp = TRUNC_PTR(child_tidp);
}
--
1.6.4.4
^ permalink raw reply related
* Re: [PATCH 0/6] Remove owner field from sysfs attribute structure
From: Tejun Heo @ 2010-07-30 8:45 UTC (permalink / raw)
To: Guenter Roeck
Cc: Mark Brown, Jani Nikula, Linus Walleij, James Smart,
Eric W. Biederman, Greg Kroah-Hartman, linux-kernel, Chris Wright,
linuxppc-dev, James E.J. Bottomley, Richard Purdie, Nick Cheng,
Dmitry Torokhov, Jean Delvare, Paul Mackerras, Benjamin Thery,
linux-scsi, Alex Iannicelli, Liam Girdwood
In-Reply-To: <1280380166-29196-1-git-send-email-guenter.roeck@ericsson.com>
On 07/29/2010 07:09 AM, Guenter Roeck wrote:
> The following comment is found in include/linux/sysfs.h:
>
> /* FIXME
> * The *owner field is no longer used.
> * x86 tree has been cleaned up. The owner
> * attribute is still left for other arches.
> */
>
> As it turns out, the *owner field is (again?) initialized in several modules,
> suggesting that such initialization may be creeping back into the code.
>
> This patch set removes the above comment, the *owner field, and each instance
> in the code where it was found to be initialized.
>
> Compiled with x86 allmodconfig as well as with all alpha, arm, mips, powerpc,
> and sparc defconfig builds.
Yeah, the change is way overdue. Maybe we should have just removed
them back then.
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
^ permalink raw reply
* Re: [PATCH 1/4] irq: Add new IRQ flag IRQF_NO_SUSPEND
From: Benjamin Herrenschmidt @ 2010-07-30 10:29 UTC (permalink / raw)
To: Ian Campbell
Cc: Jeremy Fitzhardinge, xen-devel, devicetree-discuss,
Dmitry Torokhov, linux-kernel, linuxppc-dev, Paul Mackerras,
linux-input, Thomas Gleixner
In-Reply-To: <1280398595-29708-1-git-send-email-ian.campbell@citrix.com>
On Thu, 2010-07-29 at 11:16 +0100, Ian Campbell wrote:
> A small number of users of IRQF_TIMER are using it for the implied no
> suspend behaviour on interrupts which are not timer interrupts.
>
> Therefore add a new IRQF_NO_SUSPEND flag, rename IRQF_TIMER to
> __IRQF_TIMER and redefine IRQF_TIMER in terms of these new flags.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: xen-devel@lists.xensource.com
> Cc: linux-input@vger.kernel.org
> Cc: linuxppc-dev@ozlabs.org
> Cc: devicetree-discuss@lists.ozlabs.org
> ---
> include/linux/interrupt.h | 7 ++++++-
> kernel/irq/manage.c | 2 +-
> 2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
> index c233113..a0384a4 100644
> --- a/include/linux/interrupt.h
> +++ b/include/linux/interrupt.h
> @@ -53,16 +53,21 @@
> * IRQF_ONESHOT - Interrupt is not reenabled after the hardirq handler finished.
> * Used by threaded interrupts which need to keep the
> * irq line disabled until the threaded handler has been run.
> + * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend
> + *
> */
> #define IRQF_DISABLED 0x00000020
> #define IRQF_SAMPLE_RANDOM 0x00000040
> #define IRQF_SHARED 0x00000080
> #define IRQF_PROBE_SHARED 0x00000100
> -#define IRQF_TIMER 0x00000200
> +#define __IRQF_TIMER 0x00000200
> #define IRQF_PERCPU 0x00000400
> #define IRQF_NOBALANCING 0x00000800
> #define IRQF_IRQPOLL 0x00001000
> #define IRQF_ONESHOT 0x00002000
> +#define IRQF_NO_SUSPEND 0x00004000
> +
> +#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND)
>
> /*
> * Bits used by threaded handlers:
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index e149748..c3003e9 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -216,7 +216,7 @@ static inline int setup_affinity(unsigned int irq, struct irq_desc *desc)
> void __disable_irq(struct irq_desc *desc, unsigned int irq, bool suspend)
> {
> if (suspend) {
> - if (!desc->action || (desc->action->flags & IRQF_TIMER))
> + if (!desc->action || (desc->action->flags & IRQF_NO_SUSPEND))
> return;
> desc->status |= IRQ_SUSPENDED;
> }
^ permalink raw reply
* Re: [PATCH 3/4] powerpc: Use IRQF_NO_SUSPEND not IRQF_TIMER for non-timer interrupts
From: Benjamin Herrenschmidt @ 2010-07-30 10:30 UTC (permalink / raw)
To: Ian Campbell
Cc: devicetree-discuss, linux-kernel, linuxppc-dev, Paul Mackerras,
Thomas Gleixner
In-Reply-To: <1280398595-29708-3-git-send-email-ian.campbell@citrix.com>
On Thu, 2010-07-29 at 11:16 +0100, Ian Campbell wrote:
> kw_i2c_irq and via_pmu_interrupt are not timer interrupts and
> therefore should not use IRQF_TIMER. Use the recently introduced
> IRQF_NO_SUSPEND instead since that is the actual desired behaviour.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: linuxppc-dev@ozlabs.org
> Cc: devicetree-discuss@lists.ozlabs.org
> ---
> arch/powerpc/platforms/powermac/low_i2c.c | 5 +++--
> drivers/macintosh/via-pmu.c | 9 +++++----
> 2 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
> index 06a137c..480567e 100644
> --- a/arch/powerpc/platforms/powermac/low_i2c.c
> +++ b/arch/powerpc/platforms/powermac/low_i2c.c
> @@ -542,11 +542,12 @@ static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np)
> /* Make sure IRQ is disabled */
> kw_write_reg(reg_ier, 0);
>
> - /* Request chip interrupt. We set IRQF_TIMER because we don't
> + /* Request chip interrupt. We set IRQF_NO_SUSPEND because we don't
> * want that interrupt disabled between the 2 passes of driver
> * suspend or we'll have issues running the pfuncs
> */
> - if (request_irq(host->irq, kw_i2c_irq, IRQF_TIMER, "keywest i2c", host))
> + if (request_irq(host->irq, kw_i2c_irq, IRQF_NO_SUSPEND,
> + "keywest i2c", host))
> host->irq = NO_IRQ;
>
> printk(KERN_INFO "KeyWest i2c @0x%08x irq %d %s\n",
> diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
> index 3d4fc0f..35bc273 100644
> --- a/drivers/macintosh/via-pmu.c
> +++ b/drivers/macintosh/via-pmu.c
> @@ -400,11 +400,12 @@ static int __init via_pmu_start(void)
> printk(KERN_ERR "via-pmu: can't map interrupt\n");
> return -ENODEV;
> }
> - /* We set IRQF_TIMER because we don't want the interrupt to be disabled
> - * between the 2 passes of driver suspend, we control our own disabling
> - * for that one
> + /* We set IRQF_NO_SUSPEND because we don't want the interrupt
> + * to be disabled between the 2 passes of driver suspend, we
> + * control our own disabling for that one
> */
> - if (request_irq(irq, via_pmu_interrupt, IRQF_TIMER, "VIA-PMU", (void *)0)) {
> + if (request_irq(irq, via_pmu_interrupt, IRQF_NO_SUSPEND,
> + "VIA-PMU", (void *)0)) {
> printk(KERN_ERR "via-pmu: can't request irq %d\n", irq);
> return -ENODEV;
> }
^ permalink raw reply
* Re: [PATCH 0/6] Remove owner field from sysfs attribute structure
From: Benjamin Herrenschmidt @ 2010-07-30 10:28 UTC (permalink / raw)
To: Tejun Heo
Cc: Mark Brown, Linus Walleij, James Smart, Eric W. Biederman,
Dmitry Torokhov, Benjamin Thery, Greg Kroah-Hartman, linux-kernel,
Chris Wright, linuxppc-dev, James E.J. Bottomley, Paul Mackerras,
Nick Cheng, Jani Nikula, Jean Delvare, Richard Purdie,
Liam Girdwood, linux-scsi, Alex Iannicelli, Guenter Roeck
In-Reply-To: <4C52913C.9020204@kernel.org>
On Fri, 2010-07-30 at 10:45 +0200, Tejun Heo wrote:
> On 07/29/2010 07:09 AM, Guenter Roeck wrote:
> > The following comment is found in include/linux/sysfs.h:
> >
> > /* FIXME
> > * The *owner field is no longer used.
> > * x86 tree has been cleaned up. The owner
> > * attribute is still left for other arches.
> > */
> >
> > As it turns out, the *owner field is (again?) initialized in several modules,
> > suggesting that such initialization may be creeping back into the code.
> >
> > This patch set removes the above comment, the *owner field, and each instance
> > in the code where it was found to be initialized.
> >
> > Compiled with x86 allmodconfig as well as with all alpha, arm, mips, powerpc,
> > and sparc defconfig builds.
>
> Yeah, the change is way overdue. Maybe we should have just removed
> them back then.
I'm happy with the powerpc related patches as long as we all agree that
needs to go. Do you need me to put some of this in powerpc.git or are
you carrying them all to Linus ?
Cheers,
Ben.
> Acked-by: Tejun Heo <tj@kernel.org>
>
> Thanks.
>
^ permalink raw reply
* Re: [PATCH] powerpc: Replace hardcoded offset by BREAK_INSTR_SIZE
From: Michael Ellerman @ 2010-07-30 12:26 UTC (permalink / raw)
To: Michal Simek; +Cc: linuxppc-dev, Jason Wessel
In-Reply-To: <1280308724-8402-1-git-send-email-monstr@monstr.eu>
[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]
On Wed, 2010-07-28 at 11:18 +0200, Michal Simek wrote:
> kgdb_handle_breakpoint checks the first arch_kgdb_breakpoint
> which is not known by gdb that's why is necessary jump over
> it. The jump lenght is equal to BREAK_INSTR_SIZE that's
> why is cleaner to use defined macro instead of hardcoded
> non-described offset.
>
> Signed-off-by: Michal Simek <monstr@monstr.eu>
> CC: Jason Wessel <jason.wessel@windriver.com>
> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: linuxppc-dev@ozlabs.org
> ---
> arch/powerpc/kernel/kgdb.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c
> index 82a7b22..7f61a3a 100644
> --- a/arch/powerpc/kernel/kgdb.c
> +++ b/arch/powerpc/kernel/kgdb.c
> @@ -129,7 +129,7 @@ static int kgdb_handle_breakpoint(struct pt_regs *regs)
> return 0;
>
> if (*(u32 *) (regs->nip) == *(u32 *) (&arch_kgdb_ops.gdb_bpt_instr))
> - regs->nip += 4;
> + regs->nip += BREAK_INSTR_SIZE;
Except to powerpc fokls, who intuitively know what nip + 4 means, but
will have to lookup what BREAK_INSTR_SIZE is to be sure. But I'm being
nit-picky :)
cheers
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: [PATCH 0/2] tqm85xx: enable PCMCIA bridge on ST85xx baseboards.
From: Dmitry Eremin-Solenikov @ 2010-07-30 12:33 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1279744404-10171-1-git-send-email-dbaryshkov@gmail.com>
Hello,
On 7/22/10, Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:
> Baseboards for tqm85xx modules (STK85xx) bear TI PCI1520 PCMCIA controllers.
> These two patches enables one to fully use this controller in Linux.
I'm sorry, what about these two patches?
--
With best wishes
Dmitry
^ permalink raw reply
* Re: [PATCH 0/6] Remove owner field from sysfs attribute structure
From: Greg KH @ 2010-07-30 14:36 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Nick Cheng, Linus Walleij, James Smart, linuxppc-dev,
Eric W. Biederman, Dmitry Torokhov, Benjamin Thery, Mark Brown,
linux-kernel, Chris Wright, Jean Delvare, James E.J. Bottomley,
Paul Mackerras, Alex Iannicelli, Jani Nikula, Tejun Heo,
Richard Purdie, Liam Girdwood, linux-scsi, Guenter Roeck
In-Reply-To: <1280485690.1902.8.camel@pasglop>
On Fri, Jul 30, 2010 at 08:28:10PM +1000, Benjamin Herrenschmidt wrote:
> On Fri, 2010-07-30 at 10:45 +0200, Tejun Heo wrote:
> > On 07/29/2010 07:09 AM, Guenter Roeck wrote:
> > > The following comment is found in include/linux/sysfs.h:
> > >
> > > /* FIXME
> > > * The *owner field is no longer used.
> > > * x86 tree has been cleaned up. The owner
> > > * attribute is still left for other arches.
> > > */
> > >
> > > As it turns out, the *owner field is (again?) initialized in several modules,
> > > suggesting that such initialization may be creeping back into the code.
> > >
> > > This patch set removes the above comment, the *owner field, and each instance
> > > in the code where it was found to be initialized.
> > >
> > > Compiled with x86 allmodconfig as well as with all alpha, arm, mips, powerpc,
> > > and sparc defconfig builds.
> >
> > Yeah, the change is way overdue. Maybe we should have just removed
> > them back then.
>
> I'm happy with the powerpc related patches as long as we all agree that
> needs to go. Do you need me to put some of this in powerpc.git or are
> you carrying them all to Linus ?
I can carry them all in my driver-core tree if you don't object.
thanks,
greg k-h
^ permalink raw reply
* [PATCH RFC] usb gadget: introduce usb_gadget_probe_driver
From: Uwe Kleine-König @ 2010-07-30 14:49 UTC (permalink / raw)
To: linux-usb
Cc: Cliff Cai, Mark Brown, Dinh Nguyen, Tony Lindgren, Nicolas Ferre,
linux-kernel, linuxppc-dev, Julia Lawall, Philipp Zabel,
Felipe Balbi, Andrea Gelmini, Robert Jarzmik, Fabien Chouteau,
Dan Carpenter, David Brownell, Vladimir Zapolskiy,
Sergei Shtylyov, Vincent Sanders, Marc Singer,
André Goddard Rosa, Alan Stern, Sean MacLennan, Russell King,
Tobias Klauser, Marc Kleine-Budde, Eirik Aanonsen, Mike Frysinger,
Thomas Dahlmann, Uwe Kleine-König, linux-geode, Ben Dooks,
Magnus Damm, Anton Vorontsov, Andrew Victor, linux-arm-kernel,
Anatolij Gustschin, Eric Miao, Németh Márton,
Jiri Kosina, Yoshihiro Shimoda, Greg Kroah-Hartman,
Michal Nazarewicz, Harro Haan, FUJITA Tomonori, H Hartley Sweeten,
Paul Mundt, Tejun Heo, Andrew Morton, Cory Maccarrone
This is like usb_gadget_register_driver with the only difference that it
gets the bind function as parameter instead of using driver->bind. This
allows fixing section mismatches like
WARNING: drivers/usb/gadget/g_printer.o(.data+0xc): Section mismatch in
reference from the variable printer_driver to the function
.init.text:printer_bind()
The variable printer_driver references
the function __init printer_bind()
by using usb_gadget_probe_driver with driver->bind = NULL. When all
drivers are fixed to use the new function the bind member of struct
usb_gadget_driver can go away.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
Hello,
there is an alternative patch in Greg's tree [1], but IMHO mine is
better as it doesn't need __ref.
Thoughts?
Uwe
[1] http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/usb/usb-gadget-section-mismatch-warning-fixed.patch
drivers/usb/gadget/amd5536udc.c | 9 +++++----
drivers/usb/gadget/at91_udc.c | 9 +++++----
drivers/usb/gadget/atmel_usba_udc.c | 7 ++++---
drivers/usb/gadget/ci13xxx_udc.c | 16 ++++++++--------
drivers/usb/gadget/dummy_hcd.c | 8 ++++----
drivers/usb/gadget/fsl_qe_udc.c | 12 ++++++------
drivers/usb/gadget/fsl_udc_core.c | 10 +++++-----
drivers/usb/gadget/goku_udc.c | 9 +++++----
drivers/usb/gadget/imx_udc.c | 9 +++++----
drivers/usb/gadget/langwell_udc.c | 9 +++++----
drivers/usb/gadget/lh7a40x_udc.c | 9 +++++----
drivers/usb/gadget/m66592-udc.c | 9 +++++----
drivers/usb/gadget/net2280.c | 8 ++++----
drivers/usb/gadget/omap_udc.c | 10 +++++-----
drivers/usb/gadget/pxa25x_udc.c | 9 +++++----
drivers/usb/gadget/pxa27x_udc.c | 12 +++++++-----
drivers/usb/gadget/r8a66597-udc.c | 9 +++++----
drivers/usb/gadget/s3c-hsotg.c | 9 +++++----
drivers/usb/gadget/s3c2410_udc.c | 14 +++++++-------
drivers/usb/musb/musb_gadget.c | 8 ++++----
include/linux/usb/gadget.h | 27 ++++++++++++++++++++++++---
21 files changed, 128 insertions(+), 94 deletions(-)
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index 731150d..c266c1e 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -1954,13 +1954,14 @@ static int setup_ep0(struct udc *dev)
}
/* Called by gadget driver to register itself */
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct udc *dev = udc;
int retval;
u32 tmp;
- if (!driver || !driver->bind || !driver->setup
+ if (!driver || bind || !driver->setup
|| driver->speed != USB_SPEED_HIGH)
return -EINVAL;
if (!dev)
@@ -1972,7 +1973,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
dev->driver = driver;
dev->gadget.dev.driver = &driver->driver;
- retval = driver->bind(&dev->gadget);
+ retval = bind(&dev->gadget);
/* Some gadget drivers use both ep0 directions.
* NOTE: to gadget driver, ep0 is just one endpoint...
@@ -2000,7 +2001,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
return 0;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
/* shutdown requests and disconnect from gadget */
static void
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index eaa79c8..fc7bbb7 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1570,14 +1570,15 @@ static irqreturn_t at91_vbus_irq(int irq, void *_udc)
return IRQ_HANDLED;
}
-int usb_gadget_register_driver (struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver (struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct at91_udc *udc = &controller;
int retval;
if (!driver
|| driver->speed < USB_SPEED_FULL
- || !driver->bind
+ || !bind
|| !driver->setup) {
DBG("bad parameter.\n");
return -EINVAL;
@@ -1594,9 +1595,9 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
udc->enabled = 1;
udc->selfpowered = 1;
- retval = driver->bind(&udc->gadget);
+ retval = bind(&udc->gadget);
if (retval) {
- DBG("driver->bind() returned %d\n", retval);
+ DBG("bind() returned %d\n", retval);
udc->driver = NULL;
udc->gadget.dev.driver = NULL;
dev_set_drvdata(&udc->gadget.dev, NULL);
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index d623c7b..e4810c6 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1789,7 +1789,8 @@ out:
return IRQ_HANDLED;
}
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct usba_udc *udc = &the_udc;
unsigned long flags;
@@ -1812,7 +1813,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
clk_enable(udc->pclk);
clk_enable(udc->hclk);
- ret = driver->bind(&udc->gadget);
+ ret = bind(&udc->gadget);
if (ret) {
DBG(DBG_ERR, "Could not bind to driver %s: error %d\n",
driver->driver.name, ret);
@@ -1841,7 +1842,7 @@ err_driver_bind:
udc->gadget.dev.driver = NULL;
return ret;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
{
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c
index 6996951..83fc0d4 100644
--- a/drivers/usb/gadget/ci13xxx_udc.c
+++ b/drivers/usb/gadget/ci13xxx_udc.c
@@ -2340,12 +2340,13 @@ static const struct usb_ep_ops usb_ep_ops = {
static const struct usb_gadget_ops usb_gadget_ops;
/**
- * usb_gadget_register_driver: register a gadget driver
+ * usb_gadget_probe_driver: register a gadget driver
*
- * Check usb_gadget_register_driver() at "usb_gadget.h" for details
- * Interrupts are enabled here
+ * Check usb_gadget_probe_driver() at "usb_gadget.h" for details.
+ * Interrupts are enabled here.
*/
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct ci13xxx *udc = _udc;
unsigned long i, k, flags;
@@ -2354,7 +2355,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
trace("%p", driver);
if (driver == NULL ||
- driver->bind == NULL ||
+ bind == NULL ||
driver->unbind == NULL ||
driver->setup == NULL ||
driver->disconnect == NULL ||
@@ -2430,7 +2431,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
udc->gadget.dev.driver = &driver->driver;
spin_unlock_irqrestore(udc->lock, flags);
- retval = driver->bind(&udc->gadget); /* MAY SLEEP */
+ retval = bind(&udc->gadget); /* MAY SLEEP */
spin_lock_irqsave(udc->lock, flags);
if (retval) {
@@ -2447,7 +2448,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
usb_gadget_unregister_driver(driver);
return retval;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
/**
* usb_gadget_unregister_driver: unregister a gadget driver
@@ -2462,7 +2463,6 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
trace("%p", driver);
if (driver == NULL ||
- driver->bind == NULL ||
driver->unbind == NULL ||
driver->setup == NULL ||
driver->disconnect == NULL ||
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 4f9e578..e81c939 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -748,7 +748,8 @@ static DEVICE_ATTR (function, S_IRUGO, show_function, NULL);
*/
int
-usb_gadget_register_driver (struct usb_gadget_driver *driver)
+usb_gadget_probe_driver (struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct dummy *dum = the_controller;
int retval, i;
@@ -757,8 +758,7 @@ usb_gadget_register_driver (struct usb_gadget_driver *driver)
return -EINVAL;
if (dum->driver)
return -EBUSY;
- if (!driver->bind || !driver->setup
- || driver->speed == USB_SPEED_UNKNOWN)
+ if (!bind || !driver->setup || driver->speed == USB_SPEED_UNKNOWN)
return -EINVAL;
/*
@@ -796,7 +796,7 @@ usb_gadget_register_driver (struct usb_gadget_driver *driver)
dum->gadget.dev.driver = &driver->driver;
dev_dbg (udc_dev(dum), "binding gadget driver '%s'\n",
driver->driver.name);
- retval = driver->bind(&dum->gadget);
+ retval = bind(&dum->gadget);
if (retval) {
dum->driver = NULL;
dum->gadget.dev.driver = NULL;
diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c
index 82506ca..9b4f4b5 100644
--- a/drivers/usb/gadget/fsl_qe_udc.c
+++ b/drivers/usb/gadget/fsl_qe_udc.c
@@ -2301,9 +2301,10 @@ static irqreturn_t qe_udc_irq(int irq, void *_udc)
}
/*-------------------------------------------------------------------------
- Gadget driver register and unregister.
+ Gadget driver probe and unregister.
--------------------------------------------------------------------------*/
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
int retval;
unsigned long flags = 0;
@@ -2314,8 +2315,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
if (!driver || (driver->speed != USB_SPEED_FULL
&& driver->speed != USB_SPEED_HIGH)
- || !driver->bind || !driver->disconnect
- || !driver->setup)
+ || !bind || !driver->disconnect || !driver->setup)
return -EINVAL;
if (udc_controller->driver)
@@ -2331,7 +2331,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
udc_controller->gadget.speed = (enum usb_device_speed)(driver->speed);
spin_unlock_irqrestore(&udc_controller->lock, flags);
- retval = driver->bind(&udc_controller->gadget);
+ retval = bind(&udc_controller->gadget);
if (retval) {
dev_err(udc_controller->dev, "bind to %s --> %d",
driver->driver.name, retval);
@@ -2352,7 +2352,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
udc_controller->gadget.name, driver->driver.name);
return 0;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
{
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index 08a9a62..c16b402 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -1765,7 +1765,8 @@ static irqreturn_t fsl_udc_irq(int irq, void *_udc)
* Hook to gadget drivers
* Called by initialization code of gadget drivers
*----------------------------------------------------------------*/
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
int retval = -ENODEV;
unsigned long flags = 0;
@@ -1775,8 +1776,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
if (!driver || (driver->speed != USB_SPEED_FULL
&& driver->speed != USB_SPEED_HIGH)
- || !driver->bind || !driver->disconnect
- || !driver->setup)
+ || !bind || !driver->disconnect || !driver->setup)
return -EINVAL;
if (udc_controller->driver)
@@ -1792,7 +1792,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
spin_unlock_irqrestore(&udc_controller->lock, flags);
/* bind udc driver to gadget driver */
- retval = driver->bind(&udc_controller->gadget);
+ retval = bind(&udc_controller->gadget);
if (retval) {
VDBG("bind to %s --> %d", driver->driver.name, retval);
udc_controller->gadget.dev.driver = NULL;
@@ -1814,7 +1814,7 @@ out:
retval);
return retval;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
/* Disconnect from gadget driver */
int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c
index 1088d08..49fbd4d 100644
--- a/drivers/usb/gadget/goku_udc.c
+++ b/drivers/usb/gadget/goku_udc.c
@@ -1343,14 +1343,15 @@ static struct goku_udc *the_controller;
* disconnect is reported. then a host may connect again, or
* the driver might get unbound.
*/
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct goku_udc *dev = the_controller;
int retval;
if (!driver
|| driver->speed < USB_SPEED_FULL
- || !driver->bind
+ || !bind
|| !driver->disconnect
|| !driver->setup)
return -EINVAL;
@@ -1363,7 +1364,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
driver->driver.bus = NULL;
dev->driver = driver;
dev->gadget.dev.driver = &driver->driver;
- retval = driver->bind(&dev->gadget);
+ retval = bind(&dev->gadget);
if (retval) {
DBG(dev, "bind to driver %s --> error %d\n",
driver->driver.name, retval);
@@ -1380,7 +1381,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
DBG(dev, "registered gadget driver '%s'\n", driver->driver.name);
return 0;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
static void
stop_activity(struct goku_udc *dev, struct usb_gadget_driver *driver)
diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c
index e743122..ed02664 100644
--- a/drivers/usb/gadget/imx_udc.c
+++ b/drivers/usb/gadget/imx_udc.c
@@ -1319,14 +1319,15 @@ static struct imx_udc_struct controller = {
* USB gadged driver functions
*******************************************************************************
*/
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct imx_udc_struct *imx_usb = &controller;
int retval;
if (!driver
|| driver->speed < USB_SPEED_FULL
- || !driver->bind
+ || !bind
|| !driver->disconnect
|| !driver->setup)
return -EINVAL;
@@ -1342,7 +1343,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
retval = device_add(&imx_usb->gadget.dev);
if (retval)
goto fail;
- retval = driver->bind(&imx_usb->gadget);
+ retval = bind(&imx_usb->gadget);
if (retval) {
D_ERR(imx_usb->dev, "<%s> bind to driver %s --> error %d\n",
__func__, driver->driver.name, retval);
@@ -1362,7 +1363,7 @@ fail:
imx_usb->gadget.dev.driver = NULL;
return retval;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
{
diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c
index a391351..e7222de 100644
--- a/drivers/usb/gadget/langwell_udc.c
+++ b/drivers/usb/gadget/langwell_udc.c
@@ -1807,7 +1807,8 @@ static DEVICE_ATTR(langwell_udc, S_IRUGO, show_langwell_udc, NULL);
* the driver might get unbound.
*/
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct langwell_udc *dev = the_controller;
unsigned long flags;
@@ -1830,7 +1831,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
spin_unlock_irqrestore(&dev->lock, flags);
- retval = driver->bind(&dev->gadget);
+ retval = bind(&dev->gadget);
if (retval) {
DBG(dev, "bind to driver %s --> %d\n",
driver->driver.name, retval);
@@ -1868,7 +1869,7 @@ err_unbind:
DBG(dev, "<--- %s()\n", __func__);
return retval;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
/* unregister gadget driver */
@@ -1882,7 +1883,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
DBG(dev, "---> %s()\n", __func__);
- if (unlikely(!driver || !driver->bind || !driver->unbind))
+ if (unlikely(!driver || !driver->unbind))
return -EINVAL;
/* unbind OTG transceiver */
diff --git a/drivers/usb/gadget/lh7a40x_udc.c b/drivers/usb/gadget/lh7a40x_udc.c
index fded3fc..470c45c 100644
--- a/drivers/usb/gadget/lh7a40x_udc.c
+++ b/drivers/usb/gadget/lh7a40x_udc.c
@@ -408,7 +408,8 @@ static void udc_enable(struct lh7a40x_udc *dev)
/*
Register entry point for the peripheral controller driver.
*/
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct lh7a40x_udc *dev = the_controller;
int retval;
@@ -417,7 +418,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
if (!driver
|| driver->speed != USB_SPEED_FULL
- || !driver->bind
+ || !bind
|| !driver->disconnect
|| !driver->setup)
return -EINVAL;
@@ -431,7 +432,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
dev->gadget.dev.driver = &driver->driver;
device_add(&dev->gadget.dev);
- retval = driver->bind(&dev->gadget);
+ retval = bind(&dev->gadget);
if (retval) {
printk(KERN_WARNING "%s: bind to driver %s --> error %d\n",
dev->gadget.name, driver->driver.name, retval);
@@ -454,7 +455,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
return 0;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
/*
Unregister entry point for the peripheral controller driver.
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c
index 166bf71..2ce1f49 100644
--- a/drivers/usb/gadget/m66592-udc.c
+++ b/drivers/usb/gadget/m66592-udc.c
@@ -1454,14 +1454,15 @@ static struct usb_ep_ops m66592_ep_ops = {
/*-------------------------------------------------------------------------*/
static struct m66592 *the_controller;
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct m66592 *m66592 = the_controller;
int retval;
if (!driver
|| driver->speed != USB_SPEED_HIGH
- || !driver->bind
+ || !bind
|| !driver->setup)
return -EINVAL;
if (!m66592)
@@ -1480,7 +1481,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
goto error;
}
- retval = driver->bind (&m66592->gadget);
+ retval = bind(&m66592->gadget);
if (retval) {
pr_err("bind to driver error (%d)\n", retval);
device_del(&m66592->gadget.dev);
@@ -1505,7 +1506,7 @@ error:
return retval;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
{
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index 9498be8..a469b27 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -1929,7 +1929,8 @@ static void ep0_start (struct net2280 *dev)
* disconnect is reported. then a host may connect again, or
* the driver might get unbound.
*/
-int usb_gadget_register_driver (struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct net2280 *dev = the_controller;
int retval;
@@ -1941,8 +1942,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
*/
if (!driver
|| driver->speed != USB_SPEED_HIGH
- || !driver->bind
- || !driver->setup)
+ || !bind || !driver->setup)
return -EINVAL;
if (!dev)
return -ENODEV;
@@ -1957,7 +1957,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
driver->driver.bus = NULL;
dev->driver = driver;
dev->gadget.dev.driver = &driver->driver;
- retval = driver->bind (&dev->gadget);
+ retval = bind(&dev->gadget);
if (retval) {
DEBUG (dev, "bind to driver %s --> %d\n",
driver->driver.name, retval);
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index f81e4f0..61d3ca6 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -2102,7 +2102,8 @@ static inline int machine_without_vbus_sense(void)
);
}
-int usb_gadget_register_driver (struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
int status = -ENODEV;
struct omap_ep *ep;
@@ -2114,8 +2115,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
if (!driver
// FIXME if otg, check: driver->is_otg
|| driver->speed < USB_SPEED_FULL
- || !driver->bind
- || !driver->setup)
+ || !bind || !driver->setup)
return -EINVAL;
spin_lock_irqsave(&udc->lock, flags);
@@ -2145,7 +2145,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
if (udc->dc_clk != NULL)
omap_udc_enable_clock(1);
- status = driver->bind (&udc->gadget);
+ status = bind(&udc->gadget);
if (status) {
DBG("bind to %s --> %d\n", driver->driver.name, status);
udc->gadget.dev.driver = NULL;
@@ -2186,7 +2186,7 @@ done:
omap_udc_enable_clock(0);
return status;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
{
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index be5fb34..b37f92c 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -1280,14 +1280,15 @@ static void udc_enable (struct pxa25x_udc *dev)
* disconnect is reported. then a host may connect again, or
* the driver might get unbound.
*/
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct pxa25x_udc *dev = the_controller;
int retval;
if (!driver
|| driver->speed < USB_SPEED_FULL
- || !driver->bind
+ || !bind
|| !driver->disconnect
|| !driver->setup)
return -EINVAL;
@@ -1308,7 +1309,7 @@ fail:
dev->gadget.dev.driver = NULL;
return retval;
}
- retval = driver->bind(&dev->gadget);
+ retval = bind(&dev->gadget);
if (retval) {
DMSG("bind to driver %s --> error %d\n",
driver->driver.name, retval);
@@ -1338,7 +1339,7 @@ fail:
bind_fail:
return retval;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
static void
stop_activity(struct pxa25x_udc *dev, struct usb_gadget_driver *driver)
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
index 85b0d89..798d280 100644
--- a/drivers/usb/gadget/pxa27x_udc.c
+++ b/drivers/usb/gadget/pxa27x_udc.c
@@ -1792,8 +1792,9 @@ static void udc_enable(struct pxa_udc *udc)
}
/**
- * usb_gadget_register_driver - Register gadget driver
+ * usb_gadget_probe_driver - Register gadget driver
* @driver: gadget driver
+ * @bind: bind function
*
* When a driver is successfully registered, it will receive control requests
* including set_configuration(), which enables non-control requests. Then
@@ -1805,12 +1806,13 @@ static void udc_enable(struct pxa_udc *udc)
*
* Returns 0 if no error, -EINVAL, -ENODEV, -EBUSY otherwise
*/
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct pxa_udc *udc = the_controller;
int retval;
- if (!driver || driver->speed < USB_SPEED_FULL || !driver->bind
+ if (!driver || driver->speed < USB_SPEED_FULL || !bind
|| !driver->disconnect || !driver->setup)
return -EINVAL;
if (!udc)
@@ -1828,7 +1830,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
dev_err(udc->dev, "device_add error %d\n", retval);
goto add_fail;
}
- retval = driver->bind(&udc->gadget);
+ retval = bind(&udc->gadget);
if (retval) {
dev_err(udc->dev, "bind to driver %s --> error %d\n",
driver->driver.name, retval);
@@ -1859,7 +1861,7 @@ add_fail:
udc->gadget.dev.driver = NULL;
return retval;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
/**
diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c
index 70a8178..5545d41 100644
--- a/drivers/usb/gadget/r8a66597-udc.c
+++ b/drivers/usb/gadget/r8a66597-udc.c
@@ -1405,14 +1405,15 @@ static struct usb_ep_ops r8a66597_ep_ops = {
/*-------------------------------------------------------------------------*/
static struct r8a66597 *the_controller;
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct r8a66597 *r8a66597 = the_controller;
int retval;
if (!driver
|| driver->speed != USB_SPEED_HIGH
- || !driver->bind
+ || !bind
|| !driver->setup)
return -EINVAL;
if (!r8a66597)
@@ -1431,7 +1432,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
goto error;
}
- retval = driver->bind(&r8a66597->gadget);
+ retval = bind(&r8a66597->gadget);
if (retval) {
printk(KERN_ERR "bind to driver error (%d)\n", retval);
device_del(&r8a66597->gadget.dev);
@@ -1456,7 +1457,7 @@ error:
return retval;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
{
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c
index 26193ec..89f04bc 100644
--- a/drivers/usb/gadget/s3c-hsotg.c
+++ b/drivers/usb/gadget/s3c-hsotg.c
@@ -2478,7 +2478,8 @@ static int s3c_hsotg_corereset(struct s3c_hsotg *hsotg)
return 0;
}
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct s3c_hsotg *hsotg = our_hsotg;
int ret;
@@ -2498,7 +2499,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
dev_err(hsotg->dev, "%s: bad speed\n", __func__);
}
- if (!driver->bind || !driver->setup) {
+ if (!bind || !driver->setup) {
dev_err(hsotg->dev, "%s: missing entry points\n", __func__);
return -EINVAL;
}
@@ -2517,7 +2518,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
goto err;
}
- ret = driver->bind(&hsotg->gadget);
+ ret = bind(&hsotg->gadget);
if (ret) {
dev_err(hsotg->dev, "failed bind %s\n", driver->driver.name);
@@ -2641,7 +2642,7 @@ err:
hsotg->gadget.dev.driver = NULL;
return ret;
}
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
{
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
index e724a05..bcface6 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -1628,9 +1628,10 @@ static void s3c2410_udc_enable(struct s3c2410_udc *dev)
}
/*
- * usb_gadget_register_driver
+ * usb_gadget_probe_driver
*/
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
struct s3c2410_udc *udc = the_controller;
int retval;
@@ -1645,10 +1646,9 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
if (udc->driver)
return -EBUSY;
- if (!driver->bind || !driver->setup
- || driver->speed < USB_SPEED_FULL) {
+ if (!bind || !driver->setup || driver->speed < USB_SPEED_FULL) {
printk(KERN_ERR "Invalid driver: bind %p setup %p speed %d\n",
- driver->bind, driver->setup, driver->speed);
+ bind, driver->setup, driver->speed);
return -EINVAL;
}
#if defined(MODULE)
@@ -1671,7 +1671,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
dprintk(DEBUG_NORMAL, "binding gadget driver '%s'\n",
driver->driver.name);
- if ((retval = driver->bind (&udc->gadget)) != 0) {
+ if ((retval = bind(&udc->gadget)) != 0) {
device_del(&udc->gadget.dev);
goto register_error;
}
@@ -2045,7 +2045,7 @@ static void __exit udc_exit(void)
}
EXPORT_SYMBOL(usb_gadget_unregister_driver);
-EXPORT_SYMBOL(usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
module_init(udc_init);
module_exit(udc_exit);
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 6fca870..529d216 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1698,7 +1698,8 @@ void musb_gadget_cleanup(struct musb *musb)
* @param driver the gadget driver
* @return <0 if error, 0 if everything is fine
*/
-int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *))
{
int retval;
unsigned long flags;
@@ -1706,8 +1707,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
if (!driver
|| driver->speed != USB_SPEED_HIGH
- || !driver->bind
- || !driver->setup)
+ || !bind || !driver->setup)
return -EINVAL;
/* driver must be initialized to support peripheral mode */
@@ -1735,7 +1735,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
spin_unlock_irqrestore(&musb->lock, flags);
if (retval == 0) {
- retval = driver->bind(&musb->g);
+ retval = bind(&musb->g);
if (retval != 0) {
DBG(3, "bind to driver %s failed --> %d\n",
driver->driver.name, retval);
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index d3ef42d..aa4a877 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -798,17 +798,38 @@ struct usb_gadget_driver {
*/
/**
+ * usb_gadget_probe_driver - probe a gadget driver
+ * @driver: the driver being registered
+ * Context: can sleep
+ *
+ * Call this in your gadget driver's module initialization function,
+ * to tell the underlying usb controller driver about your driver.
+ * The bind() function will be called to bind it to a gadget before this
+ * registration call returns. It's expected that the bind() function will
+ * be in init sections.
+ */
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+ int (*bind)(struct usb_gadget *));
+
+/**
* usb_gadget_register_driver - register a gadget driver
- * @driver:the driver being registered
+ * @driver: the driver being registered
* Context: can sleep
*
* Call this in your gadget driver's module initialization function,
* to tell the underlying usb controller driver about your driver.
* The driver's bind() function will be called to bind it to a
* gadget before this registration call returns. It's expected that
- * the bind() functions will be in init sections.
+ * the bind() functions will be in init sections. As this results in
+ * a section mismatch better use usb_gadget_probe_driver directly though.
*/
-int usb_gadget_register_driver(struct usb_gadget_driver *driver);
+static inline int usb_gadget_register_driver(struct usb_gadget_driver *driver)
+{
+ if (!driver)
+ return -EINVAL;
+
+ return usb_gadget_probe_driver(driver, driver->bind);
+}
/**
* usb_gadget_unregister_driver - unregister a gadget driver
--
1.7.1
^ permalink raw reply related
* Re: [PATCH RFC] usb gadget: introduce usb_gadget_probe_driver
From: Michał Nazarewicz @ 2010-07-30 15:16 UTC (permalink / raw)
To: linux-usb, Uwe Kleine-König
Cc: Cliff Cai, Mark Brown, Dan Carpenter, Tony Lindgren,
Nicolas Ferre, linux-kernel, linuxppc-dev, Julia Lawall,
Philipp Zabel, Felipe Balbi, Andrea Gelmini, Robert Jarzmik,
Fabien Chouteau, Dinh Nguyen, David Brownell, Vladimir Zapolskiy,
Sergei Shtylyov, Vincent Sanders, Marc Singer,
André Goddard Rosa, Alan Stern, Sean MacLennan, Russell King,
Tobias Klauser, Anatolij Gustschin, Marc Kleine-Budde,
Eirik Aanonsen, Mike Frysinger, Thomas Dahlmann, linux-geode,
Ben Dooks, Magnus Damm, Anton Vorontsov, Andrew Victor,
linux-arm-kernel, Eric Miao, Németh Márton, Jiri Kosina,
Yoshihiro Shimoda, Greg Kroah-Hartman, Harro Haan,
FUJITA Tomonori, H Hartley Sweeten, Paul Mundt, Tejun Heo,
Andrew Morton, Cory Maccarrone
In-Reply-To: <1280501361-13410-1-git-send-email-u.kleine-koenig@pengutronix.de>
On Fri, 30 Jul 2010 16:49:14 +0200, Uwe Kleine-K=C3=B6nig <u.kleine-koen=
ig@pengutronix.de> wrote:
> This is like usb_gadget_register_driver with the only difference that =
it
> gets the bind function as parameter instead of using driver->bind. Th=
is
> allows fixing section mismatches like
>
> WARNING: drivers/usb/gadget/g_printer.o(.data+0xc): Section mismatch =
in
> reference from the variable printer_driver to the function
> .init.text:printer_bind()
> The variable printer_driver references
> the function __init printer_bind()
>
> by using usb_gadget_probe_driver with driver->bind =3D NULL. When all=
> drivers are fixed to use the new function the bind member of struct
> usb_gadget_driver can go away.
>
> Signed-off-by: Uwe Kleine-K=C3=B6nig <u.kleine-koenig@pengutronix.de>
> Cc: Michal Nazarewicz <m.nazarewicz@samsung.com>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> ---
> Hello,
>
> there is an alternative patch in Greg's tree [1], but IMHO mine is
> better as it doesn't need __ref.
>
> Thoughts?
Personally I don't see advantage of this over changing the __init to __r=
ef.
Or am I missing something? I see your patch as an unnecessary API chang=
e.
The way I understand it, __ref was introduced exactly for cases like thi=
s
one where function is referenced from "normal" data but used only during=
init. Could you try to clarify for me why you think your solution is
better then mine?
-- =
Best regards, _ _
| Humble Liege of Serenely Enlightened Majesty of o' \,=3D./ `o
| Computer Science, Micha=C5=82 "mina86" Nazarewicz (o o)
+----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--
^ permalink raw reply
* Re: [PATCH RFC] usb gadget: introduce usb_gadget_probe_driver
From: Uwe Kleine-König @ 2010-07-30 15:26 UTC (permalink / raw)
To: Michał Nazarewicz
Cc: Cliff Cai, Greg Kroah-Hartman, Dinh Nguyen, Tony Lindgren,
Nicolas Ferre, linux-kernel, linuxppc-dev, Julia Lawall,
Philipp Zabel, Mark Brown, Felipe Balbi, Andrea Gelmini,
Robert Jarzmik, Fabien Chouteau, Dan Carpenter, David Brownell,
Vladimir Zapolskiy, Sergei Shtylyov, Vincent Sanders, Marc Singer,
André Goddard Rosa, Alan Stern, Sean MacLennan, Russell King,
Tobias Klauser, Marc Kleine-Budde, Eirik Aanonsen, Mike Frysinger,
Thomas Dahlmann, linux-geode, Ben Dooks, Magnus Damm,
Anton Vorontsov, Andrew Victor, linux-arm-kernel,
Anatolij Gustschin, Eric Miao, Németh Márton,
Jiri Kosina, Yoshihiro Shimoda, linux-usb, Harro Haan,
FUJITA Tomonori, H Hartley Sweeten, Paul Mundt, Tejun Heo,
Andrew Morton, Cory Maccarrone
In-Reply-To: <op.vgnwp8107p4s8u@pikus>
Hello Michał,
On Fri, Jul 30, 2010 at 05:16:46PM +0200, Michał Nazarewicz wrote:
> On Fri, 30 Jul 2010 16:49:14 +0200, Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:
>
>> This is like usb_gadget_register_driver with the only difference that it
>> gets the bind function as parameter instead of using driver->bind. This
>> allows fixing section mismatches like
>>
>> WARNING: drivers/usb/gadget/g_printer.o(.data+0xc): Section mismatch in
>> reference from the variable printer_driver to the function
>> .init.text:printer_bind()
>> The variable printer_driver references
>> the function __init printer_bind()
>>
>> by using usb_gadget_probe_driver with driver->bind = NULL. When all
>> drivers are fixed to use the new function the bind member of struct
>> usb_gadget_driver can go away.
>>
>> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>> Cc: Michal Nazarewicz <m.nazarewicz@samsung.com>
>> Cc: Greg Kroah-Hartman <gregkh@suse.de>
>> ---
>> Hello,
>>
>> there is an alternative patch in Greg's tree [1], but IMHO mine is
>> better as it doesn't need __ref.
>>
>> Thoughts?
>
> Personally I don't see advantage of this over changing the __init to __ref.
> Or am I missing something? I see your patch as an unnecessary API change.
> The way I understand it, __ref was introduced exactly for cases like this
> one where function is referenced from "normal" data but used only during
> init. Could you try to clarify for me why you think your solution is
> better then mine?
- Using __ref instead of __init moves all bind functions from .init.text
to .text and so the code isn't freed after booting or module loading.
(OK, you could fix this by marking the driver structs as __ref and
keep __init for the bind functions.)
- Using __ref might hide section mismatches. (Your patch hasn't this
problem as the bind functions used to live in .init.text, so any
reference to .init should be OK assuming that it was OK to live in
.init.text in the first place. But when marking the driver structs
this is an issue.) That's why I don't like __ref and said my patch
were better as it doesn't make use of it.
- The bind functions are only called at init time, so there is no need
to save a pointer to it.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* Re: [PATCH RFC] usb gadget: introduce usb_gadget_probe_driver
From: Uwe Kleine-König @ 2010-07-30 15:28 UTC (permalink / raw)
To: Julia Lawall
Cc: Cliff Cai, Greg Kroah-Hartman, Dinh Nguyen, Tony Lindgren,
Nicolas Ferre, linux-kernel, linuxppc-dev, Philipp Zabel,
Mark Brown, Felipe Balbi, Andrea Gelmini, Robert Jarzmik,
Fabien Chouteau, Dan Carpenter, David Brownell,
Vladimir Zapolskiy, Sergei Shtylyov, Vincent Sanders, Marc Singer,
André Goddard Rosa, Alan Stern, Sean MacLennan, Russell King,
Tobias Klauser, Marc Kleine-Budde, Eirik Aanonsen, Mike Frysinger,
Thomas Dahlmann, linux-geode, Ben Dooks, Magnus Damm,
Anton Vorontsov, Andrew Victor, linux-arm-kernel,
Anatolij Gustschin, Eric Miao, Németh Márton,
Jiri Kosina, Yoshihiro Shimoda, linux-usb, Michal Nazarewicz,
Harro Haan, FUJITA Tomonori, H Hartley Sweeten, Paul Mundt,
Tejun Heo, Andrew Morton, Cory Maccarrone
In-Reply-To: <Pine.LNX.4.64.1007301712560.17618@ask.diku.dk>
On Fri, Jul 30, 2010 at 05:14:46PM +0200, Julia Lawall wrote:
> > diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
> > index 731150d..c266c1e 100644
> > --- a/drivers/usb/gadget/amd5536udc.c
> > +++ b/drivers/usb/gadget/amd5536udc.c
> > @@ -1954,13 +1954,14 @@ static int setup_ep0(struct udc *dev)
> > }
> >
> > /* Called by gadget driver to register itself */
> > -int usb_gadget_register_driver(struct usb_gadget_driver *driver)
> > +int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
> > + int (*bind)(struct usb_gadget *))
> > {
> > struct udc *dev = udc;
> > int retval;
> > u32 tmp;
> >
> > - if (!driver || !driver->bind || !driver->setup
> > + if (!driver || bind || !driver->setup
>
> Is it intentional that !driver->bind has become just bind in this case?
> That doesn't seem to happen in the other cases.
Yes, this is what the patch is about. bind got a parameter to the probe
function. This is used in favour of driver->bind to allow driver to
live in .data and bind to live in .init.text without a section mismatch.
So the other cases are broken. I'll recheck.
Thanks
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* Re: [PATCH RFC] usb gadget: introduce usb_gadget_probe_driver
From: Julia Lawall @ 2010-07-30 15:14 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Cliff Cai, Greg Kroah-Hartman, Dinh Nguyen, Tony Lindgren,
Nicolas Ferre, linux-kernel, linuxppc-dev, Philipp Zabel,
Mark Brown, Felipe Balbi, Andrea Gelmini, Robert Jarzmik,
Fabien Chouteau, Dan Carpenter, David Brownell,
Vladimir Zapolskiy, Sergei Shtylyov, Vincent Sanders, Marc Singer,
André Goddard Rosa, Alan Stern, Sean MacLennan, Russell King,
Tobias Klauser, Marc Kleine-Budde, Eirik Aanonsen, Mike Frysinger,
Thomas Dahlmann, linux-geode, Ben Dooks, Magnus Damm,
Anton Vorontsov, Andrew Victor, linux-arm-kernel,
Anatolij Gustschin, Eric Miao, Németh Márton,
Jiri Kosina, Yoshihiro Shimoda, linux-usb, Michal Nazarewicz,
Harro Haan, FUJITA Tomonori, H Hartley Sweeten, Paul Mundt,
Tejun Heo, Andrew Morton, Cory Maccarrone
In-Reply-To: <1280501361-13410-1-git-send-email-u.kleine-koenig@pengutronix.de>
> diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
> index 731150d..c266c1e 100644
> --- a/drivers/usb/gadget/amd5536udc.c
> +++ b/drivers/usb/gadget/amd5536udc.c
> @@ -1954,13 +1954,14 @@ static int setup_ep0(struct udc *dev)
> }
>
> /* Called by gadget driver to register itself */
> -int usb_gadget_register_driver(struct usb_gadget_driver *driver)
> +int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
> + int (*bind)(struct usb_gadget *))
> {
> struct udc *dev = udc;
> int retval;
> u32 tmp;
>
> - if (!driver || !driver->bind || !driver->setup
> + if (!driver || bind || !driver->setup
Is it intentional that !driver->bind has become just bind in this case?
That doesn't seem to happen in the other cases.
julia
^ permalink raw reply
* Re: [PATCH RFC] usb gadget: introduce usb_gadget_probe_driver
From: Michał Nazarewicz @ 2010-07-30 16:08 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Cliff Cai, Greg Kroah-Hartman, Dinh Nguyen, Tony Lindgren,
Nicolas Ferre, linux-kernel, linuxppc-dev, Julia Lawall,
Philipp Zabel, Mark Brown, Felipe Balbi, Andrea Gelmini,
Robert Jarzmik, Fabien Chouteau, Dan Carpenter, David Brownell,
Vladimir Zapolskiy, Sergei Shtylyov, Vincent Sanders, Marc Singer,
André Goddard Rosa, Alan Stern, Sean MacLennan, Russell King,
Tobias Klauser, Marc Kleine-Budde, Eirik Aanonsen, Mike Frysinger,
Thomas Dahlmann, linux-geode, Ben Dooks, Magnus Damm,
Anton Vorontsov, Andrew Victor, linux-arm-kernel,
Anatolij Gustschin, Eric Miao, Németh Márton,
Jiri Kosina, Yoshihiro Shimoda, linux-usb, Harro Haan,
FUJITA Tomonori, H Hartley Sweeten, Paul Mundt, Tejun Heo,
Andrew Morton, Cory Maccarrone
In-Reply-To: <20100730152602.GA28042@pengutronix.de>
On Fri, 30 Jul 2010 17:26:02 +0200, Uwe Kleine-K=C3=B6nig <u.kleine-koen=
ig@pengutronix.de> wrote:
> On Fri, Jul 30, 2010 at 05:16:46PM +0200, Micha=C5=82 Nazarewicz wrote=
:
>> On Fri, 30 Jul 2010 16:49:14 +0200, Uwe Kleine-K=C3=B6nig <u.kleine-k=
oenig@pengutronix.de> wrote:
>>
>>> This is like usb_gadget_register_driver with the only difference tha=
t it
>>> gets the bind function as parameter instead of using driver->bind. =
This
>>> allows fixing section mismatches like
>>>
>>> WARNING: drivers/usb/gadget/g_printer.o(.data+0xc): Section mismatc=
h in
>>> reference from the variable printer_driver to the function
>>> .init.text:printer_bind()
>>> The variable printer_driver references
>>> the function __init printer_bind()
>>>
>>> by using usb_gadget_probe_driver with driver->bind =3D NULL. When a=
ll
>>> drivers are fixed to use the new function the bind member of struct
>>> usb_gadget_driver can go away.
>>>
>>> Signed-off-by: Uwe Kleine-K=C3=B6nig <u.kleine-koenig@pengutronix.de=
>
>>> Cc: Michal Nazarewicz <m.nazarewicz@samsung.com>
>>> Cc: Greg Kroah-Hartman <gregkh@suse.de>
BTW. Dunno if there is a reason to put me on Cc and Greg will be in
Signed-off-by anyway.
>>> ---
>>> Hello,
>>>
>>> there is an alternative patch in Greg's tree [1], but IMHO mine is
>>> better as it doesn't need __ref.
>>>
>>> Thoughts?
>>
>> Personally I don't see advantage of this over changing the __init to =
__ref.
>> Or am I missing something? I see your patch as an unnecessary API ch=
ange.
>> The way I understand it, __ref was introduced exactly for cases like =
this
>> one where function is referenced from "normal" data but used only dur=
ing
>> init. Could you try to clarify for me why you think your solution is=
>> better then mine?
> - Using __ref instead of __init moves all bind functions from .init.te=
xt
> to .text and so the code isn't freed after booting or module loading=
.
> (OK, you could fix this by marking the driver structs as __ref and
> keep __init for the bind functions.)
I believe this to be untrue. __ref puts code in .ref.text which AFAIK i=
s
freed.
> - Using __ref might hide section mismatches. (Your patch hasn't this
> problem as the bind functions used to live in .init.text, so any
> reference to .init should be OK assuming that it was OK to live in
> .init.text in the first place. But when marking the driver structs
> this is an issue.) That's why I don't like __ref and said my patch
> were better as it doesn't make use of it.
>
> - The bind functions are only called at init time, so there is no need=
> to save a pointer to it.
OK, I see some merit in this approach. However, the same issue is with
usb_configuration and ?usb_composite_driver -- those should be changed
in the same way or it would defeat the purpose of the patch.
-- =
Best regards, _ _
| Humble Liege of Serenely Enlightened Majesty of o' \,=3D./ `o
| Computer Science, Micha=C5=82 "mina86" Nazarewicz (o o)
+----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--
^ permalink raw reply
* Re: [PATCH] PCI: MSI: Restore read_msi_msg_desc(); add get_cached_msi_msg_desc()
From: Jesse Barnes @ 2010-07-30 16:42 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Stephen Rothwell, ppc-dev, LKML, linux-pci
In-Reply-To: <1279893388.2089.9.camel@achroite.uk.solarflarecom.com>
On Fri, 23 Jul 2010 14:56:28 +0100
Ben Hutchings <bhutchings@solarflare.com> wrote:
> commit 2ca1af9aa3285c6a5f103ed31ad09f7399fc65d7 "PCI: MSI: Remove
> unsafe and unnecessary hardware access" changed read_msi_msg_desc() to
> return the last MSI message written instead of reading it from the
> device, since it may be called while the device is in a reduced
> power state.
>
> However, the pSeries platform code really does need to read messages
> from the device, since they are initially written by firmware.
> Therefore:
> - Restore the previous behaviour of read_msi_msg_desc()
> - Add new functions get_cached_msi_msg{,_desc}() which return the
> last MSI message written
> - Use the new functions where appropriate
>
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
> Compile-tested only.
>
Applied to linux-next with Michael's ack, thanks. I hope it actually
works, I didn't see a tested-by!
--
Jesse Barnes, Intel Open Source Technology Center
^ permalink raw reply
* Re: ramdisk size is larger than 4MB
From: Scott Wood @ 2010-07-30 17:04 UTC (permalink / raw)
To: Shawn Jin; +Cc: ppcdev
In-Reply-To: <AANLkTinKb8E_McVAv5epg+4acb8H1+8HNsKHJYDr9B10@mail.gmail.com>
On Fri, 30 Jul 2010 00:00:52 -0700
Shawn Jin <shawnxjin@gmail.com> wrote:
> Hi,
>
> I have a ramdisk as RFS much larger than 4MB in a 2.4 kernel. In
> recent 2.6 kernels ramdisk is no longer supported so I decided to go
> with initramfs. However I found the initial RFS for initramfs is
> limited to 4MB since the bootwrapper locates at 0x400000.
The uncompressed image, including both ramfs and kernel must fit below
4MB.
> One way to lift this limitation is to relocate the bootwrapper to
> somewhere else, say for example, 0x1000000 so that a 16MB initramfs
> can be loaded. If the bootwrapper is relocated, what else would be
> affected by this relocation?
It should be fine to just change it locally. It would be a problem to
change it upstream for all boards, since some supported boards have
only 16MB (or even 8MB) of RAM.
Another option is to provide a vmlinux_alloc callback to stick the
kernel somewhere other than zero, at the cost of an extra image copy
once the kernel runs to get itself back down to zero. This wasn't done
in cuboot because it was considered better to adjust the bootwrapper
link address at build time based on the kernel+ramfs image size, but
that never got implemented.
Perhaps a reasonable compromise is a vmlinux_alloc that returns zero if
the image fits there, and calls malloc otherwise?
-Scott
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox