LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Please pull my perf.git master branch
From: Paul Mackerras @ 2010-08-03  1:04 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Peter Zijlstra, Scott Wood, linux-kernel, linuxppc-dev

Ingo,

Please do a pull from my perf.git tree at:

  git://git.kernel.org/pub/scm/linux/kernel/git/paulus/perf.git master

to get two commits.  They only affect the driver for the PMU on the
Freescale embedded PowerPC processors.  One is from Peter Z. and has
been around for some time.  The other fixes a bug introduced by a
patch from Peter Z. that I sent upstream recently.

Thanks,
Paul.

Peter Zijlstra (1):
      perf, powerpc: Convert the FSL driver to use local64_t

Scott Wood (1):
      perf, powerpc: fsl_emb: Restore setting perf_sample_data.period

 arch/powerpc/kernel/perf_event_fsl_emb.c |   29 +++++++++++++++--------------
 1 files changed, 15 insertions(+), 14 deletions(-)

^ permalink raw reply

* Re: [PATCH 0/6] Remove owner field from sysfs attribute structure
From: Greg KH @ 2010-08-02 23:31 UTC (permalink / raw)
  To: Eric Biederman
  Cc: Mark Brown, Jani Nikula, Linus Walleij, James Smart, linuxppc-dev,
	Benjamin Thery, Greg Kroah-Hartman, linux-kernel, Chris Wright,
	Tejun Heo, James E.J. Bottomley, Richard Purdie, Nick Cheng,
	Dmitry Torokhov, Jean Delvare, Paul Mackerras, Liam Girdwood,
	linux-scsi, Alex Iannicelli, Guenter Roeck
In-Reply-To: <AANLkTinM+m15QbAg+J3YyHWnObsxtHYYU6p6C89p8wjp@mail.gmail.com>

On Wed, Jul 28, 2010 at 11:16:35PM -0700, Eric Biederman wrote:
> On Wed, Jul 28, 2010 at 10:09 PM, Guenter Roeck
> <guenter.roeck@ericsson.com> 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.
> 
> This seems reasonable to me.  Can we get this in linux-next?

It will show up in linux-next tomorrow.

thanks,

greg k-h

^ permalink raw reply

* Re: [PATCH 2/3] USB: add of_platform glue driver for FSL USB DR controller
From: Greg KH @ 2010-08-02 23:01 UTC (permalink / raw)
  To: Greg KH
  Cc: David Brownell, Wolfgang Denk, Detlev Zundel, linux-usb,
	linuxppc-dev, Anatolij Gustschin
In-Reply-To: <20100728184647.GA7128@suse.de>

On Wed, Jul 28, 2010 at 11:46:47AM -0700, Greg KH wrote:
> On Wed, Jul 28, 2010 at 12:14:14PM -0600, Grant Likely wrote:
> > On Wed, Jul 28, 2010 at 5:58 AM, Anatolij Gustschin <agust@denx.de> wrote:
> > > Hi Grant,
> > >
> > > On Wed, 28 Jul 2010 02:16:08 -0600
> > > Grant Likely <grant.likely@secretlab.ca> wrote:
> > >
> > >> On Thu, Jul 22, 2010 at 10:25 AM, Anatolij Gustschin <agust@denx.de> wrote:
> > >> > The driver creates platform devices based on the information
> > >> > from USB nodes in the flat device tree. This is the replacement
> > >> > for old arch fsl_soc usb code removed by the previous patch.
> > >> > It uses usual of-style binding, available EHCI-HCD and UDC
> > >> > drivers can be bound to the created devices. The new of-style
> > >> > driver additionaly instantiates USB OTG platform device, as the
> > >> > appropriate USB OTG driver will be added soon.
> > >> >
> > >> > Signed-off-by: Anatolij Gustschin <agust@denx.de>
> > >> > Cc: Kumar Gala <galak@kernel.crashing.org>
> > >> > Cc: Grant Likely <grant.likely@secretlab.ca>
> > >>
> > >> Hi Anatolij,
> > >>
> > >> Looks pretty good, but some comments below.
> > >
> > > Thanks for review and comments! Greg already merged this series and
> > > therefore I'll submit an incremental cleanup patch to address
> > > outstanding issues. My reply is below.
> > 
> > Greg maintains a patchwork tree IIRC.  I believe he drops patches from
> > his linux-next branch if they need to be reworked.  Greg, do I have
> > this right?
> 
> Yup.  I can easily drop all of these patches.
> 
> > Also, my preference would be to see some 3rd party testing before
> > committing to having this merged.
> 
> Ok, I will go drop them all now, and wait for some that pass your
> review.

All 3 now dropped.

thanks,

greg k-h

^ permalink raw reply

* Re: [PATCH] usb gadget: don't save bind callback in struct usb_gadget_driver
From: Greg KH @ 2010-08-02 22:54 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Cliff Cai, Mark Brown, Dinh Nguyen, Takashi Iwai, Nicolas Ferre,
	linux-kernel, linuxppc-dev, Julia Lawall, Laurent Pinchart,
	Philipp Zabel, Felipe Balbi, Andrea Gelmini, Robert Jarzmik,
	Fabien Chouteau, Dan Carpenter, FUJITA Tomonori, David Brownell,
	Vladimir Zapolskiy, Sergei Shtylyov, Vincent Sanders, Marc Singer,
	David Brownell, Tony Lindgren, André Goddard Rosa,
	Alan Stern, Sean MacLennan, Russell King, Tobias Klauser,
	Anatolij Gustschin, Alexey Dobriyan, Eirik Aanonsen,
	Mike Frysinger, Thomas Dahlmann, linux-geode, Ben Dooks,
	Magnus Damm, Thomas Gleixner, Anton Vorontsov, Andrew Victor,
	linux-arm-kernel, Robert Lukassen, Eric Miao,
	Németh Márton, Jiri Kosina, Yoshihiro Shimoda,
	linux-usb, Michał Nazarewicz, Harro Haan, Kyle McMartin,
	H Hartley Sweeten, Paul Mundt, Tejun Heo, Andrew Morton,
	Cory Maccarrone
In-Reply-To: <20100802131248.GD13900@pengutronix.de>

On Mon, Aug 02, 2010 at 03:12:48PM +0200, Uwe Kleine-König wrote:
> On Mon, Aug 02, 2010 at 02:51:36PM +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
> > 
> > I have the impression that this should be !bind rather than bind.  
> ah, now I see what you meant.  Obviously you're right.  I fixed it up
> locally here for now.  Greg, just tell me when/if you need a fixed
> patch.

Didn't you already post a "fixed" patch?

thanks,

greg k-h

^ permalink raw reply

* [PATCH] perf, powerpc: fsl_emb: Restore setting perf_sample_data.period
From: Scott Wood @ 2010-08-02 22:17 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: Peter Zijlstra, linuxppc-dev, linux-kernel

Commit 6b95ed345b9faa4ab3598a82991968f2e9f851bb changed from
a struct initializer to perf_sample_data_init(), but the setting
of the .period member was left out.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 arch/powerpc/kernel/perf_event_fsl_emb.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/perf_event_fsl_emb.c b/arch/powerpc/kernel/perf_event_fsl_emb.c
index babccee..4339d20 100644
--- a/arch/powerpc/kernel/perf_event_fsl_emb.c
+++ b/arch/powerpc/kernel/perf_event_fsl_emb.c
@@ -569,6 +569,7 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
 		struct perf_sample_data data;
 
 		perf_sample_data_init(&data, 0);
+		data.period = event->hw.last_period;
 
 		if (perf_event_overflow(event, nmi, &data, regs)) {
 			/*
-- 
1.7.0.4

^ permalink raw reply related

* Re: Please pull my perf.git urgent branch
From: Scott Wood @ 2010-08-02 22:16 UTC (permalink / raw)
  To: Paul Mackerras
  Cc: Peter Zijlstra, Kumar Gala, linux-kernel, linuxppc-dev,
	Ingo Molnar
In-Reply-To: <20100728044731.GA2408@brick.ozlabs.ibm.com>

On Wed, 28 Jul 2010 14:47:31 +1000
Paul Mackerras <paulus@samba.org> wrote:

> On Tue, Jul 27, 2010 at 11:28:54AM -0500, Scott Wood wrote:
> 
> > Doesn't the setting of .period need to be maintained (it is in the other
> > powerpc perf_event implementation that this is derived from)?
> 
> Gah, yes it does.

Well, looks like Linus pulled anyway...  I'll send a patch to
add .period.

-Scott

^ permalink raw reply

* Re: make 3.82 fails on powerpc defconfig update [was: Linux 2.6.35]
From: Thomas Backlund @ 2010-08-02 21:03 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Michal Marek, linuxppc-dev@ozlabs.org, bug-make@gnu.org,
	Linux Kernel Mailing List, Thomas Backlund
In-Reply-To: <20100802205121.GA16520@merkur.ravnborg.org>

02.08.2010 23:51, Sam Ravnborg skrev:
>>
>> Thanks, this seems to fix the first issue, but then I get the same erro on the following line 190:
>>
>> 190: bootwrapper_install %.dtb:
>> 191:        $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
>>
> 
> Obviously - dunno how I missed that.
> Updated patch below.
> 
> I will do a proper submission after you
> confirm that powerpc build is working with make 3.82.
> 

Yeah, that was an obvious fix, thanks!

One small typo fix below...
(a missing ':')

Otherwise it works here, so:

Tested-by: Thomas Backlund <tmb@mandriva.org>

> 	Sam
> 
> diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> index 77cfe7a..ace7a3e 100644
> --- a/arch/powerpc/Makefile
> +++ b/arch/powerpc/Makefile
> @@ -163,9 +163,11 @@ drivers-$(CONFIG_OPROFILE)	+= arch/powerpc/oprofile/
>  # Default to zImage, override when needed
>  all: zImage
>  
> -BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
> +# With make 3.82 we cannot mix normal and wildcard targets
> +BOOT_TARGETS1 := zImage zImage.initrd uImaged
> +BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
>  
> -PHONY += $(BOOT_TARGETS)
> +PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
>  
>  boot := arch/$(ARCH)/boot
>  
> @@ -180,10 +182,16 @@ relocs_check: arch/powerpc/relocs_check.pl vmlinux
>  zImage: relocs_check
>  endif
>  
> -$(BOOT_TARGETS): vmlinux
> +$(BOOT_TARGETS1): vmlinux
> +	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
> +$(BOOT_TARGETS2): vmlinux
> +	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
> +
> +
> +bootwrapper_install

bootwrapper_install:

>  	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
>  
> -bootwrapper_install %.dtb:
> +%.dtb:
>  	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
>  
>  define archhelp
> .
> 

--
Thomas

^ permalink raw reply

* Re: make 3.82 fails on powerpc defconfig update [was: Linux 2.6.35]
From: Andreas Schwab @ 2010-08-02 21:02 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Michal Marek, linuxppc-dev, bug-make, Linux Kernel Mailing List,
	Thomas Backlund
In-Reply-To: <20100802205121.GA16520@merkur.ravnborg.org>

Sam Ravnborg <sam@ravnborg.org> writes:

> +bootwrapper_install

Missing colon.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply

* Re: make 3.82 fails on powerpc defconfig update [was: Linux 2.6.35]
From: Thomas Backlund @ 2010-08-02 20:46 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Michal Marek, linuxppc-dev, Linux Kernel Mailing List, bug-make
In-Reply-To: <20100802182848.GA16394@merkur.ravnborg.org>

02.08.2010 21:28, Sam Ravnborg skrev:
> On Mon, Aug 02, 2010 at 11:51:11AM +0300, Thomas Backlund wrote:
>> Hi,
>> (please cc me as I'm not subscribed)
>>
>> updating from make 3.81 to 3.82 gets me this:
>>
>> [thomas@tmb linux-2.6.35]$ cp arch/powerpc/configs/ppc64_defconfig .config
>> [thomas@tmb linux-2.6.35]$ LC_ALL=C make oldconfig ARCH=powerpc
>> /mnt/work/2.6.35/linux-2.6.35/arch/powerpc/Makefile:183: *** mixed  
>> implicit and normal rules.  Stop.
>>
>> The lines are:
>>
>> 182:
>> 183: $(BOOT_TARGETS): vmlinux
>> 184:         $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst  
>> %,$(boot)/%,$@)
>> 185:
>>
>> BOOT_TARGETS are defined on line 166 as:
>> BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.%  
>> cuImage.% simpleImage.%
>>
>>
>> Now it's not a regression in the kernel as the same happends with the  
>> 2.6.34 tree too.
>>
>> (btw, the host I'm syncing the defconfig with is a x86_64 machine)
>>
>>
>> Now, I dont know if this is "intended breakage" by the make update, or  
>> if the Makefile needs to be updated....
>>
>> Any ideas how to fix ?
> 
> This is in the category "intended breakage".
> We had a similar issue in the top-level Makefile which Paul (IIRC)
> helped me to fix long time ago.
> 
> To fix popwerpc I suggest something along these lines.
> [Note: I did not test it - please do so.
> 
> 	Sam
> 
> [PATCH] powerpc: fix build with make 3.82
> 
> Thomas Backlund reported that the powerpc build broke with make 3.82.
> It failed with the following message:
> 
>     arch/powerpc/Makefile:183: *** mixed implicit and normal rules.  Stop.
> 
> The fix is to avoid mixing non-wildcard and wildcard targets.
> 
> Reported-by: Thomas Backlund <tmb@mandriva.org>
> Cc: Michal Marek <mmarek@suse.cz>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> ---
> diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> index 77cfe7a..ad88b21 100644
> --- a/arch/powerpc/Makefile
> +++ b/arch/powerpc/Makefile
> @@ -163,9 +163,11 @@ drivers-$(CONFIG_OPROFILE)	+= arch/powerpc/oprofile/
>  # Default to zImage, override when needed
>  all: zImage
>  
> -BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
> +# With make 3.82 we cannot mix normal and wildcard targets
> +BOOT_TARGETS1 := zImage zImage.initrd uImaged
> +BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
>  
> -PHONY += $(BOOT_TARGETS)
> +PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
>  
>  boot := arch/$(ARCH)/boot
>  
> @@ -180,7 +182,9 @@ relocs_check: arch/powerpc/relocs_check.pl vmlinux
>  zImage: relocs_check
>  endif
>  
> -$(BOOT_TARGETS): vmlinux
> +$(BOOT_TARGETS1): vmlinux
> +	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
> +$(BOOT_TARGETS2): vmlinux
>  	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
>  
>  bootwrapper_install %.dtb:


Thanks, this seems to fix the first issue, but then I get the same erro on the following line 190:

190: bootwrapper_install %.dtb:
191:        $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)


--
Thomas

^ permalink raw reply

* Re: make 3.82 fails on powerpc defconfig update [was: Linux 2.6.35]
From: Sam Ravnborg @ 2010-08-02 20:51 UTC (permalink / raw)
  To: Thomas Backlund
  Cc: Michal Marek, linuxppc-dev, Linux Kernel Mailing List, bug-make
In-Reply-To: <4C572EB0.7060706@mandriva.org>

> 
> Thanks, this seems to fix the first issue, but then I get the same erro on the following line 190:
> 
> 190: bootwrapper_install %.dtb:
> 191:        $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
> 

Obviously - dunno how I missed that.
Updated patch below.

I will do a proper submission after you
confirm that powerpc build is working with make 3.82.

	Sam

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 77cfe7a..ace7a3e 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -163,9 +163,11 @@ drivers-$(CONFIG_OPROFILE)	+= arch/powerpc/oprofile/
 # Default to zImage, override when needed
 all: zImage
 
-BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
+# With make 3.82 we cannot mix normal and wildcard targets
+BOOT_TARGETS1 := zImage zImage.initrd uImaged
+BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
 
-PHONY += $(BOOT_TARGETS)
+PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
 
 boot := arch/$(ARCH)/boot
 
@@ -180,10 +182,16 @@ relocs_check: arch/powerpc/relocs_check.pl vmlinux
 zImage: relocs_check
 endif
 
-$(BOOT_TARGETS): vmlinux
+$(BOOT_TARGETS1): vmlinux
+	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+$(BOOT_TARGETS2): vmlinux
+	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+
+
+bootwrapper_install
 	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
 
-bootwrapper_install %.dtb:
+%.dtb:
 	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
 
 define archhelp

^ permalink raw reply related

* Re: [PATCH v2 1/2] powerpc/85xx: kexec for SMP 85xx BookE systems
From: Kumar Gala @ 2010-08-02 19:37 UTC (permalink / raw)
  To: Matthew McClintock; +Cc: linuxppc-dev
In-Reply-To: <1279746894-29529-2-git-send-email-msm@freescale.com>


On Jul 21, 2010, at 4:14 PM, Matthew McClintock wrote:

> Adds support for kexec on 85xx machines for the BookE platform.
> Including support for SMP machines
>=20
> Based off work from Maxim Uvarov <muvarov@mvista.com>
> Signed-off-by: Matthew McClintock <msm@freescale.com>
> ---
> arch/powerpc/Kconfig              |   10 +++---
> arch/powerpc/platforms/85xx/smp.c |   63 =
+++++++++++++++++++++++++++++++++++++
> 2 files changed, 68 insertions(+), 5 deletions(-)

applied to next

- k=

^ permalink raw reply

* Re: make 3.82 fails on powerpc defconfig update [was: Linux 2.6.35]
From: Sam Ravnborg @ 2010-08-02 18:28 UTC (permalink / raw)
  To: Thomas Backlund
  Cc: Michal Marek, linuxppc-dev, Linux Kernel Mailing List, bug-make
In-Reply-To: <4C5686FF.9010803@mandriva.org>

On Mon, Aug 02, 2010 at 11:51:11AM +0300, Thomas Backlund wrote:
> Hi,
> (please cc me as I'm not subscribed)
>
> updating from make 3.81 to 3.82 gets me this:
>
> [thomas@tmb linux-2.6.35]$ cp arch/powerpc/configs/ppc64_defconfig .config
> [thomas@tmb linux-2.6.35]$ LC_ALL=C make oldconfig ARCH=powerpc
> /mnt/work/2.6.35/linux-2.6.35/arch/powerpc/Makefile:183: *** mixed  
> implicit and normal rules.  Stop.
>
> The lines are:
>
> 182:
> 183: $(BOOT_TARGETS): vmlinux
> 184:         $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst  
> %,$(boot)/%,$@)
> 185:
>
> BOOT_TARGETS are defined on line 166 as:
> BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.%  
> cuImage.% simpleImage.%
>
>
> Now it's not a regression in the kernel as the same happends with the  
> 2.6.34 tree too.
>
> (btw, the host I'm syncing the defconfig with is a x86_64 machine)
>
>
> Now, I dont know if this is "intended breakage" by the make update, or  
> if the Makefile needs to be updated....
>
> Any ideas how to fix ?

This is in the category "intended breakage".
We had a similar issue in the top-level Makefile which Paul (IIRC)
helped me to fix long time ago.

To fix popwerpc I suggest something along these lines.
[Note: I did not test it - please do so.

	Sam

[PATCH] powerpc: fix build with make 3.82

Thomas Backlund reported that the powerpc build broke with make 3.82.
It failed with the following message:

    arch/powerpc/Makefile:183: *** mixed implicit and normal rules.  Stop.

The fix is to avoid mixing non-wildcard and wildcard targets.

Reported-by: Thomas Backlund <tmb@mandriva.org>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 77cfe7a..ad88b21 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -163,9 +163,11 @@ drivers-$(CONFIG_OPROFILE)	+= arch/powerpc/oprofile/
 # Default to zImage, override when needed
 all: zImage
 
-BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
+# With make 3.82 we cannot mix normal and wildcard targets
+BOOT_TARGETS1 := zImage zImage.initrd uImaged
+BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
 
-PHONY += $(BOOT_TARGETS)
+PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
 
 boot := arch/$(ARCH)/boot
 
@@ -180,7 +182,9 @@ relocs_check: arch/powerpc/relocs_check.pl vmlinux
 zImage: relocs_check
 endif
 
-$(BOOT_TARGETS): vmlinux
+$(BOOT_TARGETS1): vmlinux
+	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+$(BOOT_TARGETS2): vmlinux
 	$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
 
 bootwrapper_install %.dtb:

^ permalink raw reply related

* Re: Issues to access Compact Flash Card on MPC8360E
From: Anton Vorontsov @ 2010-08-02 17:59 UTC (permalink / raw)
  To: Atul Deshmukh; +Cc: linuxppc-dev
In-Reply-To: <AANLkTikRq95=4Pbhne9CikR-gEHOOp7tETdV0Lnr0Chh@mail.gmail.com>

On Mon, Aug 02, 2010 at 07:44:22PM +0530, Atul Deshmukh wrote:
> Thanks a lot Anton,
> From the dts entry given below,
> 
> localbus@e0005000 {
>          #address-cells = <2>;
>                #size-cells = <1>;
>                compatible = "fsl,mpc8349e-localbus",
>                             "fsl,pq2pro-localbus";
>                reg = <0xe0005000 0xd8>;
>                ranges = <0x3 0x0 0xf0000000 0x210>;
>                pata@3,0 {
>                        compatible = "fsl,mpc8349emitx-pata",
> "ata-generic";
>                        reg = <0x3 0x0 0x10 0x3 0x20c 0x4>;
>                        reg-shift = <1>;
>                        pio-mode = <6>;
>                        interrupts = <23 0x8>;
>                       interrupt-parent = <&ipic>;
>                };
>        };
> 
> 
> we can conclude that it uses ata-generic SATA/PATA controlelr driver which

How did you come to this conclusion? From the node above it's IMHO
pretty clear that IDE (PATA) is on the localbus.

The driver is drivers/ata/pata_of_platform.c.

> controls PCI-based IDE-controller where we can plug in our CF card...Am I
> right???

Nope, no PCI involved. CF is almost* directly connected to
the localbus.

> But in our design we don't use any controller we directly connects CF card
> to local bus where UPM controls it..

Yes, that's exactly how CF is done on MPC8349EmITX boards.

> Can you please explain how the interface is implemented in MPC8349..

Via localbus + UPM.

* 'almost' is because there are some buffers and inverters, see
  schematics:
  http://www.freescale.com/files/32bit/hardware_tools/schematics/MPC8349EMITXESCH.pdf

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply

* Re: [PATCH] perf, powerpc: Convert the FSL driver to use local64_t
From: Kumar Gala @ 2010-08-02 17:21 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, Peter Zijlstra
In-Reply-To: <20100802061851.GA898@brick.ozlabs.ibm.com>


On Aug 2, 2010, at 1:18 AM, Paul Mackerras wrote:

> From: Peter Zijlstra <a.p.zijlstra@chello.nl>
>=20
> For some reason the FSL driver got left out when we converted perf
> to use local64_t instead of atomic64_t.
>=20
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> ---
> This is against the perf/core branch in the tip tree at
> git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
> Posting here for comment.
>=20
> arch/powerpc/kernel/perf_event_fsl_emb.c |   28 =
++++++++++++++--------------
> 1 file changed, 14 insertions(+), 14 deletions(-)

Acked-by: Kumar Gala <galak@kernel.crashing.org>

- k=

^ permalink raw reply

* [PATCH] powerpc: Dont require a dma_ops struct to set dma mask
From: Kumar Gala @ 2010-08-02 17:21 UTC (permalink / raw)
  To: linuxppc-dev

The only reason to require a dma_ops struct is to see if it has
implemented set_dma_mask.  If not we can fall back to setting the mask
directly.

This resolves an issue with how to sequence the setting of a DMA mask
for platform devices.  Before we had an issue in that we have no way of
setting the DMA mask before the various low level bus notifiers get
called that might check it (swiotlb).

So now we can do:

	pdev = platform_device_alloc("foobar", 0);
	dma_set_mask(&pdev->dev, DMA_BIT_MASK(37));
	platform_device_register(pdev);

And expect the right thing to happen with the bus notifiers get called
via platform_device_register.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 arch/powerpc/include/asm/dma-mapping.h |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index c85ef23..17d5c17 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -131,9 +131,7 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)
 {
 	struct dma_map_ops *dma_ops = get_dma_ops(dev);
 
-	if (unlikely(dma_ops == NULL))
-		return -EIO;
-	if (dma_ops->set_dma_mask != NULL)
+	if (unlikely(dma_ops == NULL) && (dma_ops->set_dma_mask != NULL))
 		return dma_ops->set_dma_mask(dev, dma_mask);
 	if (!dev->dma_mask || !dma_supported(dev, dma_mask))
 		return -EIO;
-- 
1.6.0.6

^ permalink raw reply related

* Re: [PATCH 0/6] Remove owner field from sysfs attribute structure
From: Greg KH @ 2010-08-02 16:53 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Nick Cheng, Jani Nikula, Linus Walleij, James Smart,
	linuxppc-dev@ozlabs.org, Eric W. Biederman, Mark Brown,
	linux-kernel@vger.kernel.org, Chris Wright, Jean Delvare,
	James E.J. Bottomley, Richard Purdie, Alex Iannicelli,
	Dmitry Torokhov, Tejun Heo, Paul Mackerras, Benjamin Thery,
	linux-scsi@vger.kernel.org, Liam Girdwood
In-Reply-To: <1280765724.5745.4.camel@groeck-laptop>

On Mon, Aug 02, 2010 at 09:15:24AM -0700, Guenter Roeck wrote:
> On Fri, 2010-07-30 at 10:36 -0400, Greg KH wrote:
> > 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.
> > 
> Any final verdict ? 
> 
> Not that it is my decision to make, but I think it would be better to
> have it all in one tree. Otherwise the timing for the last patch would
> get a bit complicated.

I'll take it.

thanks,

greg k-h

^ permalink raw reply

* Re: [PATCH 0/6] Remove owner field from sysfs attribute structure
From: Guenter Roeck @ 2010-08-02 16:15 UTC (permalink / raw)
  To: Greg KH
  Cc: Nick Cheng, Jani Nikula, Linus Walleij, James Smart,
	linuxppc-dev@ozlabs.org, Eric W. Biederman, Mark Brown,
	linux-kernel@vger.kernel.org, Chris Wright, Jean Delvare,
	James E.J. Bottomley, Richard Purdie, Alex Iannicelli,
	Dmitry Torokhov, Tejun Heo, Paul Mackerras, Benjamin Thery,
	linux-scsi@vger.kernel.org, Liam Girdwood
In-Reply-To: <20100730143622.GA30105@suse.de>

On Fri, 2010-07-30 at 10:36 -0400, Greg KH wrote:
> 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.
> 
Any final verdict ? 

Not that it is my decision to make, but I think it would be better to
have it all in one tree. Otherwise the timing for the last patch would
get a bit complicated.

Thanks,
Guenter

^ permalink raw reply

* Re: [PATCH] usb gadget: don't save bind callback in struct usb_gadget_driver
From: Michał Nazarewicz @ 2010-08-02 14:25 UTC (permalink / raw)
  To: linux-usb, Uwe Kleine-König
  Cc: Cliff Cai, Mark Brown, Dinh Nguyen, Takashi Iwai, Nicolas Ferre,
	linux-kernel, linuxppc-dev, Julia Lawall, Laurent Pinchart,
	Philipp Zabel, Felipe Balbi, Andrea Gelmini, Robert Jarzmik,
	Christoph Hellwig, Dan Carpenter, FUJITA Tomonori, David Brownell,
	Vladimir Zapolskiy, Sergei Shtylyov, Vincent Sanders, Marc Singer,
	David Brownell, Tony Lindgren, André Goddard Rosa,
	Alan Stern, Sean MacLennan, Russell King, Tobias Klauser,
	Anatolij Gustschin, Alexey Dobriyan, Eirik Aanonsen,
	Mike Frysinger, Thomas Dahlmann, linux-geode, Fabien Chouteau,
	Ben Dooks, Magnus Damm, Thomas Gleixner, Anton Vorontsov,
	Andrew Victor, linux-arm-kernel, Robert Lukassen, Eric Miao,
	Németh Márton, Jiri Kosina, Yoshihiro Shimoda,
	Greg Kroah-Hartman, Harro Haan, Kyle McMartin, H Hartley Sweeten,
	Paul Mundt, Tejun Heo, Andrew Morton, Cory Maccarrone
In-Reply-To: <1280752803-11441-1-git-send-email-u.kleine-koenig@pengutronix.de>

Some random thoughts, one bug and mostly just minor comments:

> @@ -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 =3D udc;
>  	int			retval;
>  	u32 tmp;
>-	if (!driver || !driver->bind || !driver->setup
> +	if (!driver || bind || !driver->setup


** BUG: Should read "!bind".


> diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_u=
dc.c
> @@ -1612,7 +1613,7 @@ int usb_gadget_register_driver (struct usb_gadge=
t_driver *driver)
>  	DBG("bound to %s\n", driver->driver.name);
>  	return 0;
>  }
> -EXPORT_SYMBOL (usb_gadget_register_driver);
> +EXPORT_SYMBOL (usb_gadget_probe_driver);

How about also correcting space before "("?

> diff --git 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 =3D &the_udc;
>  	unsigned long flags;

There was no checking here?  How about adding?

> diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci1=
3xxx_udc.c
> @@ -2340,12 +2340,13 @@ static const struct usb_ep_ops usb_ep_ops =3D =
{
>  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.
>   */

usb_gadget.h is the old name.  How about correcting it as well?

> diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/fi=
le_storage.c
> @@ -3583,7 +3582,7 @@ static int __init fsg_init(void)
>  	if ((rc =3D fsg_alloc()) !=3D 0)
>  		return rc;
>  	fsg =3D the_fsg;
> -	if ((rc =3D usb_gadget_register_driver(&fsg_driver)) !=3D 0)
> +	if ((rc =3D usb_gadget_probe_driver(&fsg_driver, fsg_bind)) !=3D 0)

I'm tempted to propose:

+ rc =3D usb_gadget_probe_driver(&fsg_driver, fsg_bind);
+ if (rc !=3D 0)

which is more compatible with coding style but it probably would be inco=
nsistent
with the rest of the code.

> diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/la=
ngwell_udc.c
> @@ -1807,7 +1807,8 @@ static DEVICE_ATTR(langwell_udc, S_IRUGO, show_l=
angwell_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 =3D the_controller;
>  	unsigned long		flags;

Again, function has no checking, how about adding?

> diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_ga=
dget.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
>   */

I've just noticed that it misses @param bind in the comment.  Would be g=
reat to update it
and all other occurrences.

> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
> @@ -798,17 +797,18 @@ struct usb_gadget_driver {
>   */
> /**
> - * usb_gadget_register_driver - register a gadget driver
> - * @driver:the driver being registered
> + * usb_gadget_probe_driver - probe a gadget driver
> + * @driver: the driver being registered

+ * @bind: the driver's bind callback.

>   * 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() function will be called to bind it to a gadget before t=
his
> + * registration call returns.  It's expected that the bind() function=
 will

Maybe "the @bind function" in those two places?

So for what it's worth, I haven't noticed any other obvious problems.

I think it still does not fix all the section mismatch warnings -- would=
 have to look
closer at composite gadgets -- so I think still parts of my patch is leg=
it.

-- =

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: Issues to access Compact Flash Card on MPC8360E
From: Atul Deshmukh @ 2010-08-02 14:14 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <20100802134857.GA8689@oksana.dev.rtsoft.ru>

[-- Attachment #1: Type: text/plain, Size: 3256 bytes --]

Thanks a lot Anton,
>From the dts entry given below,

localbus@e0005000 {
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L251>
         #address-cells = <2>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L252>
               #size-cells = <1>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L253>
               compatible = "fsl,mpc8349e-localbus",
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L254>
                            "fsl,pq2pro-localbus";
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L255>
               reg = <0xe0005000 0xd8>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L256>
               ranges = <0x3 0x0 0xf0000000 0x210>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L257>
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L258>
               pata@3,0 {
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L259>
                       compatible = "fsl,mpc8349emitx-pata",
"ata-generic";
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L260>
                       reg = <0x3 0x0 0x10 0x3 0x20c 0x4>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L261>
                       reg-shift = <1>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L262>
                       pio-mode = <6>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L263>
                       interrupts = <23 0x8>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L264>
                      interrupt-parent = <&ipic>;
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L265>
               };
 <http://lxr.linux.no/linux+*/arch/powerpc/boot/dts/mpc8349emitx.dts#L266>
       };


we can conclude that it uses ata-generic SATA/PATA controlelr driver which
controls PCI-based IDE-controller where we can plug in our CF card...Am I
right???
But in our design we don't use any controller we directly connects CF card
to local bus where UPM controls it..
Can you please explain how the interface is implemented in MPC8349..



On Mon, Aug 2, 2010 at 7:18 PM, linuxppc-dev@lists.ozlabs.org wrote:

> On Mon, Aug 02, 2010 at 06:08:14PM +0530, Atul Deshmukh wrote:
> [...]
> > 2: To access CF card in True IDE mode we have to use
> > "linux-kernel-source/drivers/ata/pata_platform.c" and
> > "linux-kernel-source/drivers/ata/libata-sff.c".....I'm going right??
>
> CF IDE support was already implemented for MPC8349EmITX boards
> with a bit of help from UPM (User-Programmable Machine), so
> you can do the same for MPC8360.
>
> UPM is programmed in U-Boot, u-boot/include/configs/MPC8349ITX.h
> (CONFIG_SYS_BR3_PRELIM stuff), and
> u-boot/board/freescale/mpc8349itx/mpc8349itx.c (UPMATable).
>
> For linux part, see arch/powerpc/boot/dts/mpc8349emitx.dts (pata
> node), and drivers/ata/pata_of_platform.c.
>
> For HW side, you can find MPC8349EmITX schematics on Freescale
> site (last time I checked, no registration was required).
>
> --
> Anton Vorontsov
> email: cbouatmailru@gmail.com
> irc://irc.freenode.net/bd2
>



-- 
Regards,
Atul

[-- Attachment #2: Type: text/html, Size: 4886 bytes --]

^ permalink raw reply

* Re: Issues to access Compact Flash Card on MPC8360E
From: Anton Vorontsov @ 2010-08-02 13:48 UTC (permalink / raw)
  To: Atul Deshmukh; +Cc: linuxppc-dev
In-Reply-To: <AANLkTikGL6LKJyWjK946enVwkUzviOsHasYbzV1Wj2LR@mail.gmail.com>

On Mon, Aug 02, 2010 at 06:08:14PM +0530, Atul Deshmukh wrote:
[...]
> 2: To access CF card in True IDE mode we have to use
> "linux-kernel-source/drivers/ata/pata_platform.c" and
> "linux-kernel-source/drivers/ata/libata-sff.c".....I'm going right??

CF IDE support was already implemented for MPC8349EmITX boards
with a bit of help from UPM (User-Programmable Machine), so
you can do the same for MPC8360.

UPM is programmed in U-Boot, u-boot/include/configs/MPC8349ITX.h
(CONFIG_SYS_BR3_PRELIM stuff), and
u-boot/board/freescale/mpc8349itx/mpc8349itx.c (UPMATable).

For linux part, see arch/powerpc/boot/dts/mpc8349emitx.dts (pata
node), and drivers/ata/pata_of_platform.c.

For HW side, you can find MPC8349EmITX schematics on Freescale
site (last time I checked, no registration was required).

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply

* Re: [PATCH] usb gadget: don't save bind callback in struct usb_gadget_driver
From: Uwe Kleine-König @ 2010-08-02 13:12 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Cliff Cai, Greg Kroah-Hartman, Dinh Nguyen, Takashi Iwai,
	Nicolas Ferre, linux-kernel, linuxppc-dev, Laurent Pinchart,
	Philipp Zabel, Mark Brown, Felipe Balbi, Andrea Gelmini,
	Robert Jarzmik, Fabien Chouteau, Dan Carpenter, FUJITA Tomonori,
	David Brownell, Vladimir Zapolskiy, Sergei Shtylyov,
	Vincent Sanders, Marc Singer, David Brownell, Tony Lindgren,
	André Goddard Rosa, Alan Stern, Sean MacLennan, Russell King,
	Tobias Klauser, Anatolij Gustschin, Alexey Dobriyan,
	Eirik Aanonsen, Mike Frysinger, Thomas Dahlmann, linux-geode,
	Ben Dooks, Magnus Damm, Thomas Gleixner, Anton Vorontsov,
	Andrew Victor, linux-arm-kernel, Robert Lukassen, Eric Miao,
	Németh Márton, Jiri Kosina, Yoshihiro Shimoda,
	linux-usb, Michał Nazarewicz, Harro Haan, Kyle McMartin,
	H Hartley Sweeten, Paul Mundt, Tejun Heo, Andrew Morton,
	Cory Maccarrone
In-Reply-To: <Pine.LNX.4.64.1008021446470.10662@ask.diku.dk>

On Mon, Aug 02, 2010 at 02:51:36PM +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
> 
> I have the impression that this should be !bind rather than bind.  
ah, now I see what you meant.  Obviously you're right.  I fixed it up
locally here for now.  Greg, just tell me when/if you need a fixed
patch.

> That would be like what is done in the patch for 
> drivers/usb/gadget/fsl_udc_core.c below

Thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply

* Re: [PATCH] usb gadget: don't save bind callback in struct usb_gadget_driver
From: Julia Lawall @ 2010-08-02 12:51 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Cliff Cai, Greg Kroah-Hartman, Dinh Nguyen, Takashi Iwai,
	Nicolas Ferre, linux-kernel, linuxppc-dev, Laurent Pinchart,
	Philipp Zabel, Mark Brown, Felipe Balbi, Andrea Gelmini,
	Robert Jarzmik, Christoph Hellwig, Dan Carpenter, FUJITA Tomonori,
	David Brownell, Vladimir Zapolskiy, Sergei Shtylyov,
	Vincent Sanders, Marc Singer, David Brownell, Tony Lindgren,
	André Goddard Rosa, Alan Stern, Sean MacLennan, Russell King,
	Tobias Klauser, Alexey Dobriyan, Eirik Aanonsen, Mike Frysinger,
	Thomas Dahlmann, linux-geode, Fabien Chouteau, Ben Dooks,
	Magnus Damm, Thomas Gleixner, Anton Vorontsov, Andrew Victor,
	linux-arm-kernel, Robert Lukassen, Anatolij Gustschin, Eric Miao,
	Németh Márton, Jiri Kosina, Yoshihiro Shimoda,
	linux-usb, Michał Nazarewicz, Harro Haan, Kyle McMartin,
	H Hartley Sweeten, Paul Mundt, Tejun Heo, Andrew Morton,
	Cory Maccarrone
In-Reply-To: <1280752803-11441-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

I have the impression that this should be !bind rather than bind.  
That would be like what is done in the patch for 
drivers/usb/gadget/fsl_udc_core.c below


> 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;

Here !driver->bind is converted to !bind.

julia

^ permalink raw reply

* [PATCH] usb gadget: don't save bind callback in struct usb_gadget_driver
From: Uwe Kleine-König @ 2010-08-02 12:39 UTC (permalink / raw)
  To: Michał Nazarewicz, linux-usb
  Cc: Cliff Cai, Mark Brown, Dinh Nguyen, Takashi Iwai, Nicolas Ferre,
	linux-kernel, linuxppc-dev, Julia Lawall, Laurent Pinchart,
	Philipp Zabel, Felipe Balbi, Andrea Gelmini, Robert Jarzmik,
	Christoph Hellwig, Dan Carpenter, FUJITA Tomonori, David Brownell,
	Vladimir Zapolskiy, Sergei Shtylyov, Vincent Sanders, Marc Singer,
	David Brownell, Tony Lindgren, André Goddard Rosa,
	Alan Stern, Thomas Dahlmann, Russell King, Tobias Klauser,
	Alexey Dobriyan, Eirik Aanonsen, Mike Frysinger, Sean MacLennan,
	Uwe Kleine-König, linux-geode, Fabien Chouteau, Ben Dooks,
	Magnus Damm, Thomas Gleixner, Anton Vorontsov, Andrew Victor,
	linux-arm-kernel, Robert Lukassen, Anatolij Gustschin, Eric Miao,
	Németh Márton, Jiri Kosina, Yoshihiro Shimoda,
	Greg Kroah-Hartman, Michał Nazarewicz, Harro Haan,
	Kyle McMartin, H Hartley Sweeten, Paul Mundt, Tejun Heo,
	Andrew Morton, Cory Maccarrone
In-Reply-To: <op.vgs04dub7p4s8u@pikus>

The bind function is only needed at probe time, so there is no value in
saving it .

To accomplish this the function to register a gadget driver now takes
the bind function as a second argument.  To make things clearer rename
the function to resemble platform_driver_probe vs.
platform_driver_register.

This fixes many 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()

All callers are fixed.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Michał Nazarewicz <m.nazarewicz@samsung.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Julia Lawall <julia@diku.dk>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
Hello,

now that Michał seems to be happy with my approach I made the effort to come up
with a complete patch that fixes the section mismatches.

Note this patch conflicts with usb-gadget-section-mismatch-warning-fixed.patch
in Greg's usb tree.  Greg, up to you to decide if it's already to late to drop
the old patch in favour of mine.

Julia, you found an inconsitency in my first patch.  I didn't, so can
you please point out in more words what you meant?

Best regards
Uwe

 drivers/usb/gadget/amd5536udc.c     |    9 +++++----
 drivers/usb/gadget/at91_udc.c       |   11 ++++++-----
 drivers/usb/gadget/atmel_usba_udc.c |    7 ++++---
 drivers/usb/gadget/ci13xxx_udc.c    |   16 ++++++++--------
 drivers/usb/gadget/composite.c      |    3 +--
 drivers/usb/gadget/dummy_hcd.c      |   10 +++++-----
 drivers/usb/gadget/file_storage.c   |    3 +--
 drivers/usb/gadget/fsl_qe_udc.c     |   12 ++++++------
 drivers/usb/gadget/fsl_udc_core.c   |   10 +++++-----
 drivers/usb/gadget/gmidi.c          |    3 +--
 drivers/usb/gadget/goku_udc.c       |    9 +++++----
 drivers/usb/gadget/imx_udc.c        |    9 +++++----
 drivers/usb/gadget/inode.c          |    6 ++----
 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        |   10 +++++-----
 drivers/usb/gadget/omap_udc.c       |   10 +++++-----
 drivers/usb/gadget/printer.c        |    5 ++---
 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    |   17 ++++++++---------
 drivers/usb/musb/musb_gadget.c      |    8 ++++----
 include/linux/usb/gadget.h          |   14 +++++++-------
 26 files changed, 122 insertions(+), 116 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..a3d04ba 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);
@@ -1612,7 +1613,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
 	DBG("bound to %s\n", 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/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/composite.c b/drivers/usb/gadget/composite.c
index 391d169..d07960e 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1112,7 +1112,6 @@ composite_resume(struct usb_gadget *gadget)
 static struct usb_gadget_driver composite_driver = {
 	.speed		= USB_SPEED_HIGH,
 
-	.bind		= composite_bind,
 	.unbind		= composite_unbind,
 
 	.setup		= composite_setup,
@@ -1152,7 +1151,7 @@ int usb_composite_register(struct usb_composite_driver *driver)
 	composite_driver.driver.name = driver->name;
 	composite = driver;
 
-	return usb_gadget_register_driver(&composite_driver);
+	return usb_gadget_probe_driver(&composite_driver, composite_bind);
 }
 
 /**
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 4f9e578..5860222 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;
@@ -812,7 +812,7 @@ usb_gadget_register_driver (struct usb_gadget_driver *driver)
 	usb_hcd_poll_rh_status (dummy_to_hcd (dum));
 	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/file_storage.c b/drivers/usb/gadget/file_storage.c
index b49d86e..7c858ca 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -3541,7 +3541,6 @@ static struct usb_gadget_driver		fsg_driver = {
 	.speed		= USB_SPEED_FULL,
 #endif
 	.function	= (char *) fsg_string_product,
-	.bind		= fsg_bind,
 	.unbind		= fsg_unbind,
 	.disconnect	= fsg_disconnect,
 	.setup		= fsg_setup,
@@ -3583,7 +3582,7 @@ static int __init fsg_init(void)
 	if ((rc = fsg_alloc()) != 0)
 		return rc;
 	fsg = the_fsg;
-	if ((rc = usb_gadget_register_driver(&fsg_driver)) != 0)
+	if ((rc = usb_gadget_probe_driver(&fsg_driver, fsg_bind)) != 0)
 		kref_put(&fsg->ref, fsg_release);
 	return rc;
 }
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/gmidi.c b/drivers/usb/gadget/gmidi.c
index 2b56ce6..b33ee5d 100644
--- a/drivers/usb/gadget/gmidi.c
+++ b/drivers/usb/gadget/gmidi.c
@@ -1292,7 +1292,6 @@ static void gmidi_resume(struct usb_gadget *gadget)
 static struct usb_gadget_driver gmidi_driver = {
 	.speed		= USB_SPEED_FULL,
 	.function	= (char *)longname,
-	.bind		= gmidi_bind,
 	.unbind		= gmidi_unbind,
 
 	.setup		= gmidi_setup,
@@ -1309,7 +1308,7 @@ static struct usb_gadget_driver gmidi_driver = {
 
 static int __init gmidi_init(void)
 {
-	return usb_gadget_register_driver(&gmidi_driver);
+	return usb_gadget_probe_driver(&gmidi_driver, gmidi_bind);
 }
 module_init(gmidi_init);
 
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/inode.c b/drivers/usb/gadget/inode.c
index de8a838..1da5583 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -1777,7 +1777,6 @@ static struct usb_gadget_driver gadgetfs_driver = {
 	.speed		= USB_SPEED_FULL,
 #endif
 	.function	= (char *) driver_desc,
-	.bind		= gadgetfs_bind,
 	.unbind		= gadgetfs_unbind,
 	.setup		= gadgetfs_setup,
 	.disconnect	= gadgetfs_disconnect,
@@ -1800,7 +1799,6 @@ static int gadgetfs_probe (struct usb_gadget *gadget)
 
 static struct usb_gadget_driver probe_driver = {
 	.speed		= USB_SPEED_HIGH,
-	.bind		= gadgetfs_probe,
 	.unbind		= gadgetfs_nop,
 	.setup		= (void *)gadgetfs_nop,
 	.disconnect	= gadgetfs_nop,
@@ -1914,7 +1912,7 @@ dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
 
 	/* triggers gadgetfs_bind(); then we can enumerate. */
 	spin_unlock_irq (&dev->lock);
-	value = usb_gadget_register_driver (&gadgetfs_driver);
+	value = usb_gadget_probe_driver(&gadgetfs_driver, gadgetfs_bind);
 	if (value != 0) {
 		kfree (dev->buf);
 		dev->buf = NULL;
@@ -2053,7 +2051,7 @@ gadgetfs_fill_super (struct super_block *sb, void *opts, int silent)
 		return -ESRCH;
 
 	/* fake probe to determine $CHIP */
-	(void) usb_gadget_register_driver (&probe_driver);
+	(void) usb_gadget_probe_driver(&probe_driver, gadgetfs_probe);
 	if (!CHIP)
 		return -ENODEV;
 
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..d09155b 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);
@@ -1993,7 +1993,7 @@ err_unbind:
 	dev->driver = NULL;
 	return retval;
 }
-EXPORT_SYMBOL (usb_gadget_register_driver);
+EXPORT_SYMBOL(usb_gadget_probe_driver);
 
 static void
 stop_activity (struct net2280 *dev, struct usb_gadget_driver *driver)
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/printer.c b/drivers/usb/gadget/printer.c
index 4c3ac5c..317f113 100644
--- a/drivers/usb/gadget/printer.c
+++ b/drivers/usb/gadget/printer.c
@@ -1542,7 +1542,6 @@ static struct usb_gadget_driver printer_driver = {
 	.speed		= DEVSPEED,
 
 	.function	= (char *) driver_desc,
-	.bind		= printer_bind,
 	.unbind		= printer_unbind,
 
 	.setup		= printer_setup,
@@ -1578,11 +1577,11 @@ init(void)
 		return status;
 	}
 
-	status = usb_gadget_register_driver(&printer_driver);
+	status = usb_gadget_probe_driver(&printer_driver, printer_bind);
 	if (status) {
 		class_destroy(usb_gadget_class);
 		unregister_chrdev_region(g_printer_devno, 1);
-		DBG(dev, "usb_gadget_register_driver %x\n", status);
+		DBG(dev, "usb_gadget_probe_driver %x\n", status);
 	}
 
 	return status;
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..a281606 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -1628,15 +1628,15 @@ 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;
 
-	dprintk(DEBUG_NORMAL, "usb_gadget_register_driver() '%s'\n",
-		driver->driver.name);
+	dprintk(DEBUG_NORMAL, "%s() '%s'\n", __func__, driver->driver.name);
 
 	/* Sanity checks */
 	if (!udc)
@@ -1645,10 +1645,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 +1670,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 +2044,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..d96ebb9 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -774,7 +774,6 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget)
 struct usb_gadget_driver {
 	char			*function;
 	enum usb_device_speed	speed;
-	int			(*bind)(struct usb_gadget *);
 	void			(*unbind)(struct usb_gadget *);
 	int			(*setup)(struct usb_gadget *,
 					const struct usb_ctrlrequest *);
@@ -798,17 +797,18 @@ struct usb_gadget_driver {
  */
 
 /**
- * usb_gadget_register_driver - register a gadget driver
- * @driver:the driver being registered
+ * 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 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() 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_register_driver(struct usb_gadget_driver *driver);
+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
+		int (*bind)(struct usb_gadget *));
 
 /**
  * usb_gadget_unregister_driver - unregister a gadget driver
-- 
1.7.1

^ permalink raw reply related

* Issues to access Compact Flash Card on MPC8360E
From: Atul Deshmukh @ 2010-08-02 12:38 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <AANLkTi=ke8Yiy39dONFkMPpm5H8vhRy1jVyaKLuG8r4e@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1841 bytes --]

Hi,

I would like to have your expert opinion on one of our design issue to
access the Compact Flash on MPC8360E.

I'm building an embedded system that will access Compact Flash card on
MPC8360E through local bus and not through PCMCIA.

The issue is how to access the CF card i.e. whether in memory mapped/io
mapped/True IDE mode?

Following are some concerned points...

1: If we use PC-Card ATA memory mapped mode then we have to stick with
PCMCIA specs and we also need PCMCIA bus on our board and have to use 'CF to
PCMCIA adapter'. But I don't have that much space on the board.So how can I
use CF card in PC-Card ATA memory mapped mode without using adapter and what
kernel drivers we can use for that?

2: The second approach is to use True IDE but in this case also we need IDE
socket.
Can we use CF card using its own 50 pin connector only without using any
adapter.What drivers we can use for True-IDE mode?



I read the CF specs and digged into kernel code for drivers and came up with
some findings which could be right or wrong..
Pls put on your thoughts on it and correct me if i'm wrong.

1: To access CF card in "PC-Card ATA memory mapped/IO mapped" mode we have
to use PCMCIA subsystem of kernel where we can use low level socket driver
that do resource windows allocation and other low level operations. We also
have to use linux provided Card Services (linux-kernel-source/drivers/
pcmcia/cs.c) and Driver Services (linux-kernel-source/drivers/pcmcia/ds.c)
but we have to write our own client driver and application driver to access
those serives.....Am I going right way????

2: To access CF card in True IDE mode we have to use
"linux-kernel-source/drivers/ata/pata_platform.c" and
"linux-kernel-source/drivers/ata/libata-sff.c".....I'm going right??

Your suggestions would be really helpful....



-- 
Regards,
Atul

[-- Attachment #2: Type: text/html, Size: 2089 bytes --]

^ permalink raw reply

* Re: 2.6.35-stable/ppc64/p7: Badness at lib/dma-debug.c:902, Call Trace & Instruction Dump during boot
From: FUJITA Tomonori @ 2010-08-02 11:55 UTC (permalink / raw)
  To: subrata
  Cc: sachinp, fujita.tomonori, joerg.roedel, linux-kernel, santil,
	Linuxppc-dev, devilbis, James.Bottomley, sleddog, brking, tj,
	dipraksh
In-Reply-To: <1280746270.15317.16.camel@subratamodak.linux.ibm.com>

CC'ed to dma-debug maintainer.

On Mon, 02 Aug 2010 16:21:09 +0530
Subrata Modak <subrata@linux.vnet.ibm.com> wrote:

> Hi,
> 
> On boot, Badness at lib/dma-debug.c:902, Call Trace & Instruction Dump
> are recorded at /var/log/messages:
> 
> ================================================================
> udev: starting version 151
> ses 0:8:0:0: Attached Enclosure device
> IBM eHEA ethernet device driver (Release EHEA_0105)
> mlx4_core: Mellanox ConnectX core driver v0.01 (May 1, 2007)
> mlx4_core: Initializing 0002:01:00.0
> mlx4_core 0002:01:00.0: enabling device (0140 -> 0142)
> ehea: eth0: Jumbo frames are enabled
> ehea: eth0 -> logical port id #1
> ehea: eth1: Jumbo frames are enabled
> ehea: eth1 -> logical port id #2
> mlx4_core 0002:01:00.0: Requested 17 vectors, but only 8 MSI-X vectors
> available, trying again
> mlx4_core 0002:01:00.0: DMA-API: device driver tries to sync DMA memory it has
> not allocated [device address=0x0000000060f22000] [size=4096 bytes]
> ------------[ cut here ]------------
> Badness at lib/dma-debug.c:902
> NIP: c0000000003fdfa0 LR: c0000000003fdf9c CTR: 0000000000000001
> REGS: c000000f35bfad00 TRAP: 0700   Not tainted  (2.6.35)
> MSR: 8000000000029032 <EE,ME,CE,IR,DR>  CR: 48002482  XER: 20000010
> TASK = c000000f35c08000[502] 'modprobe' THREAD: c000000f35bf8000 CPU: 8
> GPR00: c0000000003fdf9c c000000f35bfaf80 c000000001464c48 0000000000000096
> GPR04: 0000000000000001 c0000000000c19b0 0000000000000000 0000000000000002
> GPR08: 0000000000000000 c000000f35c08000 00000000000043b3 0000000000000001
> GPR12: 7669636520616464 c000000003fa5800 0000000000000000 0000000010016628
> GPR16: c000000f32a02000 c000000f32402000 c000000f33604648 c000000f35bfb1c0
> GPR20: c000000f38002120 0000000060f22000 0000000000000200 c000000001f4b000
> GPR24: 0000000000000001 0000000000000001 c000000001f47900 c000000f35bfb0b0
> GPR28: 0000000000000000 c000000f38002120 c0000000013eaea8 c000000f35bfaf80
> NIP [c0000000003fdfa0] .check_sync+0x108/0x52c
> LR [c0000000003fdf9c] .check_sync+0x104/0x52c
> Call Trace:
> [c000000f35bfaf80] [c0000000003fdf9c] .check_sync+0x104/0x52c (unreliable)
> [c000000f35bfb040] [c0000000003fe8d4] .debug_dma_sync_single_for_cpu+0x58/0x70

I guess that this driver does a partial sync with
dma_sync_single_for_* API. dma-debug can't handle it properly. It's
likely that this is a false warning.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox