linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] AT91 USB Serial Device
@ 2010-11-11  1:16 Rob Emanuele
  2010-11-11 23:24 ` Jean-Christophe PLAGNIOL-VILLARD
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Rob Emanuele @ 2010-11-11  1:16 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Nicolas,

I came across a small bug while debugging my problems of getting the
host interface and device interface to work at the same time but on
different ports.  I had compiled the atmel usb device support as a
module and after unloading it and trying to reload it, the irq for
vbus was not released.  This little patch fixes that

diff --git a/drivers/usb/gadget/atmel_usba_udc.c
b/drivers/usb/gadget/atmel_usba_udc.c
index d6ef3d5..bc70e53 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -2052,8 +2052,10 @@ static int __exit usba_udc_remove(struct
platform_device *pdev)
                usba_ep_cleanup_debugfs(&usba_ep[i]);
        usba_cleanup_debugfs(udc);

-       if (gpio_is_valid(udc->vbus_pin))
+       if (gpio_is_valid(udc->vbus_pin)) {
+               free_irq(gpio_to_irq(udc->vbus_pin), udc);
                gpio_free(udc->vbus_pin);
+       }

        free_irq(udc->irq, udc);
        kfree(usba_ep);


On Tue, Nov 9, 2010 at 3:59 PM, Rob Emanuele <poorarm@shoreis.com> wrote:
> Nicolas et al,
>
> Thank you for the information. ?For the moment I have a boot option to
> use either 2 host ports or a host and a device port. ?That would seem
> to fit my needs except for the case that I'm loading the usb serial
> gadget as a module and then specifying in the inittab that getty use
> it as ttyGS0. ?In that case connecting the device port to a host does
> not seem to ever register on the host. ?If I remove the getty line
> from inittab and then run getty manually after it boots, it works
> fine. ?To add insult to injury, then it will work after reboot also
> until a hard power down.
>
> Anyone experience this?
>
> Thank you,
>
> Rob
>
> On Tue, Nov 9, 2010 at 9:46 AM, Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
>> Le 05/11/2010 22:09, Rob Emanuele :
>>> Greetings,
>>>
>>> We've been developing a at91sam9g45 product and it is finally available at:
>>> https://www.crystalfontz.com/product/CFA910.html
>>
>> Very nice platform!
>>
>>> We are looking into supporting USB OTG on this device as the 'g45 has
>>> the USB host/device port. ?As far at I can tell Atmel or anyone else
>>> working on this platform has not made full use of this as an OTG
>>> device.
>>
>> Indeed, it is not done for the moment...
>>
>>> ?I haven't found support in the USB or the OTG code for
>>> reading the USB ID line to determine host or device mode.
>>
>> I am not sure USB ID is well supported by consumer cable providers and
>> is a reliable way to determine host or device mode.
>>
>>> Am I missing something or is that an area that needs some code written for it?
>>
>> Anyway, using this port as host or device is a matter of
>> 1/ driving or not VBUS pin
>> 2/ dealing with loading the gadget driver (as the "Enable" of the usba
>> IP is responsible for swithing to device mode).
>>
>> I think that determining if the port shall be used in host or device
>> mode can be asked through the GUI... But note that I am not an USB expert...
>> --
>> Nicolas Ferre
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>>
>

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] AT91 USB Serial Device
  2010-11-11  1:16 [PATCH] AT91 USB Serial Device Rob Emanuele
@ 2010-11-11 23:24 ` Jean-Christophe PLAGNIOL-VILLARD
  2010-12-03 15:17 ` Nicolas Ferre
  2010-12-14 15:05 ` [PATCH] AT91: usb gadget: fix freeing irq in _udc_remove() Nicolas Ferre
  2 siblings, 0 replies; 7+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2010-11-11 23:24 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

	please send a patch

Best Regards,
J.
On 17:16 Wed 10 Nov     , Rob Emanuele wrote:
> Hi Nicolas,
> 
> I came across a small bug while debugging my problems of getting the
> host interface and device interface to work at the same time but on
> different ports.  I had compiled the atmel usb device support as a
> module and after unloading it and trying to reload it, the irq for
> vbus was not released.  This little patch fixes that
> 
> diff --git a/drivers/usb/gadget/atmel_usba_udc.c
> b/drivers/usb/gadget/atmel_usba_udc.c
> index d6ef3d5..bc70e53 100644
> --- a/drivers/usb/gadget/atmel_usba_udc.c
> +++ b/drivers/usb/gadget/atmel_usba_udc.c
> @@ -2052,8 +2052,10 @@ static int __exit usba_udc_remove(struct
> platform_device *pdev)
>                 usba_ep_cleanup_debugfs(&usba_ep[i]);
>         usba_cleanup_debugfs(udc);
> 
> -       if (gpio_is_valid(udc->vbus_pin))
> +       if (gpio_is_valid(udc->vbus_pin)) {
> +               free_irq(gpio_to_irq(udc->vbus_pin), udc);
>                 gpio_free(udc->vbus_pin);
> +       }
> 
>         free_irq(udc->irq, udc);
>         kfree(usba_ep);
> 
> 
> On Tue, Nov 9, 2010 at 3:59 PM, Rob Emanuele <poorarm@shoreis.com> wrote:
> > Nicolas et al,
> >
> > Thank you for the information. ?For the moment I have a boot option to
> > use either 2 host ports or a host and a device port. ?That would seem
> > to fit my needs except for the case that I'm loading the usb serial
> > gadget as a module and then specifying in the inittab that getty use
> > it as ttyGS0. ?In that case connecting the device port to a host does
> > not seem to ever register on the host. ?If I remove the getty line
> > from inittab and then run getty manually after it boots, it works
> > fine. ?To add insult to injury, then it will work after reboot also
> > until a hard power down.
> >
> > Anyone experience this?
> >
> > Thank you,
> >
> > Rob
> >
> > On Tue, Nov 9, 2010 at 9:46 AM, Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
> >> Le 05/11/2010 22:09, Rob Emanuele :
> >>> Greetings,
> >>>
> >>> We've been developing a at91sam9g45 product and it is finally available at:
> >>> https://www.crystalfontz.com/product/CFA910.html
> >>
> >> Very nice platform!
> >>
> >>> We are looking into supporting USB OTG on this device as the 'g45 has
> >>> the USB host/device port. ?As far at I can tell Atmel or anyone else
> >>> working on this platform has not made full use of this as an OTG
> >>> device.
> >>
> >> Indeed, it is not done for the moment...
> >>
> >>> ?I haven't found support in the USB or the OTG code for
> >>> reading the USB ID line to determine host or device mode.
> >>
> >> I am not sure USB ID is well supported by consumer cable providers and
> >> is a reliable way to determine host or device mode.
> >>
> >>> Am I missing something or is that an area that needs some code written for it?
> >>
> >> Anyway, using this port as host or device is a matter of
> >> 1/ driving or not VBUS pin
> >> 2/ dealing with loading the gadget driver (as the "Enable" of the usba
> >> IP is responsible for swithing to device mode).
> >>
> >> I think that determining if the port shall be used in host or device
> >> mode can be asked through the GUI... But note that I am not an USB expert...
> >> --
> >> Nicolas Ferre
> >>
> >>
> >> _______________________________________________
> >> linux-arm-kernel mailing list
> >> linux-arm-kernel at lists.infradead.org
> >> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> >>
> >
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] AT91 USB Serial Device
  2010-11-11  1:16 [PATCH] AT91 USB Serial Device Rob Emanuele
  2010-11-11 23:24 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2010-12-03 15:17 ` Nicolas Ferre
  2010-12-14 15:05 ` [PATCH] AT91: usb gadget: fix freeing irq in _udc_remove() Nicolas Ferre
  2 siblings, 0 replies; 7+ messages in thread
From: Nicolas Ferre @ 2010-12-03 15:17 UTC (permalink / raw)
  To: linux-arm-kernel

Rob,

Le 11/11/2010 02:16, Rob Emanuele :
> Hi Nicolas,
> 
> I came across a small bug while debugging my problems of getting the
> host interface and device interface to work at the same time but on
> different ports.  I had compiled the atmel usb device support as a
> module and after unloading it and trying to reload it, the irq for
> vbus was not released.  This little patch fixes that

I have created the patch. The only thing that is missing it your
Signed-off-by: xxxxx xxx <xxxx@xxx>
line..

Can you please send it to me (even quickly replying to this email saying
ok)? I will add it before I send your patch upstream (to usb maintainer).

Bye,

> diff --git a/drivers/usb/gadget/atmel_usba_udc.c
> b/drivers/usb/gadget/atmel_usba_udc.c
> index d6ef3d5..bc70e53 100644
> --- a/drivers/usb/gadget/atmel_usba_udc.c
> +++ b/drivers/usb/gadget/atmel_usba_udc.c
> @@ -2052,8 +2052,10 @@ static int __exit usba_udc_remove(struct
> platform_device *pdev)
>                 usba_ep_cleanup_debugfs(&usba_ep[i]);
>         usba_cleanup_debugfs(udc);
> 
> -       if (gpio_is_valid(udc->vbus_pin))
> +       if (gpio_is_valid(udc->vbus_pin)) {
> +               free_irq(gpio_to_irq(udc->vbus_pin), udc);
>                 gpio_free(udc->vbus_pin);
> +       }
> 
>         free_irq(udc->irq, udc);
>         kfree(usba_ep);
> 
> 
> On Tue, Nov 9, 2010 at 3:59 PM, Rob Emanuele <poorarm@shoreis.com> wrote:
>> Nicolas et al,
>>
>> Thank you for the information.  For the moment I have a boot option to
>> use either 2 host ports or a host and a device port.  That would seem
>> to fit my needs except for the case that I'm loading the usb serial
>> gadget as a module and then specifying in the inittab that getty use
>> it as ttyGS0.  In that case connecting the device port to a host does
>> not seem to ever register on the host.  If I remove the getty line
>> from inittab and then run getty manually after it boots, it works
>> fine.  To add insult to injury, then it will work after reboot also
>> until a hard power down.
>>
>> Anyone experience this?
>>
>> Thank you,
>>
>> Rob
>>
>> On Tue, Nov 9, 2010 at 9:46 AM, Nicolas Ferre <nicolas.ferre@atmel.com> wrote:
>>> Le 05/11/2010 22:09, Rob Emanuele :
>>>> Greetings,
>>>>
>>>> We've been developing a at91sam9g45 product and it is finally available at:
>>>> https://www.crystalfontz.com/product/CFA910.html
>>>
>>> Very nice platform!
>>>
>>>> We are looking into supporting USB OTG on this device as the 'g45 has
>>>> the USB host/device port.  As far at I can tell Atmel or anyone else
>>>> working on this platform has not made full use of this as an OTG
>>>> device.
>>>
>>> Indeed, it is not done for the moment...
>>>
>>>>  I haven't found support in the USB or the OTG code for
>>>> reading the USB ID line to determine host or device mode.
>>>
>>> I am not sure USB ID is well supported by consumer cable providers and
>>> is a reliable way to determine host or device mode.
>>>
>>>> Am I missing something or is that an area that needs some code written for it?
>>>
>>> Anyway, using this port as host or device is a matter of
>>> 1/ driving or not VBUS pin
>>> 2/ dealing with loading the gadget driver (as the "Enable" of the usba
>>> IP is responsible for swithing to device mode).
>>>
>>> I think that determining if the port shall be used in host or device
>>> mode can be asked through the GUI... But note that I am not an USB expert...
>>> --
>>> Nicolas Ferre
>>>
>>>
>>> _______________________________________________
>>> linux-arm-kernel mailing list
>>> linux-arm-kernel at lists.infradead.org
>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>>>
>>
> 


-- 
Nicolas Ferre

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] AT91: usb gadget: fix freeing irq in _udc_remove()
  2010-11-11  1:16 [PATCH] AT91 USB Serial Device Rob Emanuele
  2010-11-11 23:24 ` Jean-Christophe PLAGNIOL-VILLARD
  2010-12-03 15:17 ` Nicolas Ferre
@ 2010-12-14 15:05 ` Nicolas Ferre
  2010-12-14 16:21   ` David Brownell
  2 siblings, 1 reply; 7+ messages in thread
From: Nicolas Ferre @ 2010-12-14 15:05 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Emanuele <rje@crystalfontz.com>

Add a free_irq() call on vbus gpio when we remove udc so that the
vbus irq is properly released.

Signed-off-by: Rob Emanuele <rje@crystalfontz.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/usb/gadget/atmel_usba_udc.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index 717ff65..e7c65a4 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -2057,8 +2057,10 @@ static int __exit usba_udc_remove(struct platform_device *pdev)
 		usba_ep_cleanup_debugfs(&usba_ep[i]);
 	usba_cleanup_debugfs(udc);
 
-	if (gpio_is_valid(udc->vbus_pin))
+	if (gpio_is_valid(udc->vbus_pin)) {
+		free_irq(gpio_to_irq(udc->vbus_pin), udc);
 		gpio_free(udc->vbus_pin);
+	}
 
 	free_irq(udc->irq, udc);
 	kfree(usba_ep);
-- 
1.7.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] AT91: usb gadget: fix freeing irq in _udc_remove()
  2010-12-14 15:05 ` [PATCH] AT91: usb gadget: fix freeing irq in _udc_remove() Nicolas Ferre
@ 2010-12-14 16:21   ` David Brownell
  2010-12-14 18:00     ` [PATCH v2] USB: atmel_usba_udc: fix freeing irq in usba_udc_remove() Nicolas Ferre
  0 siblings, 1 reply; 7+ messages in thread
From: David Brownell @ 2010-12-14 16:21 UTC (permalink / raw)
  To: linux-arm-kernel

You _do_ know that $SUBJECT references
an entirely different driver than $PATCH ...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] USB: atmel_usba_udc: fix freeing irq in usba_udc_remove()
  2010-12-14 16:21   ` David Brownell
@ 2010-12-14 18:00     ` Nicolas Ferre
  2010-12-15  1:29       ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Ferre @ 2010-12-14 18:00 UTC (permalink / raw)
  To: linux-arm-kernel

From: Rob Emanuele <rje@crystalfontz.com>

Add a free_irq() call on vbus gpio when we remove udc so that the
vbus irq is properly released.

Signed-off-by: Rob Emanuele <rje@crystalfontz.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
David,

I modified $SUBJECT to be more explicit about which driver is modified.
Hope that makes sense now...

Bye,

 drivers/usb/gadget/atmel_usba_udc.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index 717ff65..e7c65a4 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -2057,8 +2057,10 @@ static int __exit usba_udc_remove(struct platform_device *pdev)
 		usba_ep_cleanup_debugfs(&usba_ep[i]);
 	usba_cleanup_debugfs(udc);
 
-	if (gpio_is_valid(udc->vbus_pin))
+	if (gpio_is_valid(udc->vbus_pin)) {
+		free_irq(gpio_to_irq(udc->vbus_pin), udc);
 		gpio_free(udc->vbus_pin);
+	}
 
 	free_irq(udc->irq, udc);
 	kfree(usba_ep);
-- 
1.7.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2] USB: atmel_usba_udc: fix freeing irq in usba_udc_remove()
  2010-12-14 18:00     ` [PATCH v2] USB: atmel_usba_udc: fix freeing irq in usba_udc_remove() Nicolas Ferre
@ 2010-12-15  1:29       ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 7+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2010-12-15  1:29 UTC (permalink / raw)
  To: linux-arm-kernel

On 19:00 Tue 14 Dec     , Nicolas Ferre wrote:
> From: Rob Emanuele <rje@crystalfontz.com>
> 
> Add a free_irq() call on vbus gpio when we remove udc so that the
> vbus irq is properly released.
> 
> Signed-off-by: Rob Emanuele <rje@crystalfontz.com>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
> ---
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Best Regards,
J.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-12-15  1:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-11  1:16 [PATCH] AT91 USB Serial Device Rob Emanuele
2010-11-11 23:24 ` Jean-Christophe PLAGNIOL-VILLARD
2010-12-03 15:17 ` Nicolas Ferre
2010-12-14 15:05 ` [PATCH] AT91: usb gadget: fix freeing irq in _udc_remove() Nicolas Ferre
2010-12-14 16:21   ` David Brownell
2010-12-14 18:00     ` [PATCH v2] USB: atmel_usba_udc: fix freeing irq in usba_udc_remove() Nicolas Ferre
2010-12-15  1:29       ` Jean-Christophe PLAGNIOL-VILLARD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).