public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Software based unplug of USB device?
@ 2004-05-03 10:21 Joerg Pommnitz
  2004-05-03 11:07 ` Duncan Sands
  2004-05-03 14:54 ` Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Joerg Pommnitz @ 2004-05-03 10:21 UTC (permalink / raw)
  To: linux-usb-users; +Cc: linux-kernel

Hello listees,
we are struggling with a 3rd party USB device. It comes with its own
firmware and its own Linux USB serial drivers. Unfortunately the
communication between the device and the user application seems to break
down from time to time. This situation can easily be resolved by
unplugging and then re-plugging the device. Unfortunately this requires
manual intervention.
While resolving the real issue would be the preferred way to deal with
this problem, we would settle for a way to do a software unplug/re-plug.
Can this be done at all? If so, is there a tool to do this?

A detailed description of our environment:
* Linux 2.4.21 with USB OHCI driver
* Natsemi Geode integrated CPU/Chipset

Thanks in advance
  Joerg


	

	
		
Mit schönen Grüßen von Yahoo! Mail - http://mail.yahoo.de

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

* Re: Software based unplug of USB device?
  2004-05-03 10:21 Software based unplug of USB device? Joerg Pommnitz
@ 2004-05-03 11:07 ` Duncan Sands
  2004-05-03 14:54 ` Greg KH
  1 sibling, 0 replies; 4+ messages in thread
From: Duncan Sands @ 2004-05-03 11:07 UTC (permalink / raw)
  To: Joerg Pommnitz, linux-usb-users; +Cc: linux-kernel

On Monday 03 May 2004 12:21, Joerg Pommnitz wrote:
> Hello listees,
> we are struggling with a 3rd party USB device. It comes with its own
> firmware and its own Linux USB serial drivers. Unfortunately the
> communication between the device and the user application seems to break
> down from time to time. This situation can easily be resolved by
> unplugging and then re-plugging the device. Unfortunately this requires
> manual intervention.
> While resolving the real issue would be the preferred way to deal with
> this problem, we would settle for a way to do a software unplug/re-plug.
> Can this be done at all? If so, is there a tool to do this?
>
> A detailed description of our environment:
> * Linux 2.4.21 with USB OHCI driver
> * Natsemi Geode integrated CPU/Chipset

This can be done in a number of ways:
(1) unload and reload the module driving the usb device.  This should disconnect
it from the device and reconnect it when reloaded.
(2) restart the hotplug system (this will disconnect and reconnect all devices).
(3) use usbfs: there is an ioctl to disconnect a kernel driver from a device,
and another to reconnect it.

I hope this helps,

Duncan.

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

* Re: Software based unplug of USB device?
  2004-05-03 10:21 Software based unplug of USB device? Joerg Pommnitz
  2004-05-03 11:07 ` Duncan Sands
@ 2004-05-03 14:54 ` Greg KH
  2004-05-03 18:10   ` Johannes Erdfelt
  1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2004-05-03 14:54 UTC (permalink / raw)
  To: Joerg Pommnitz; +Cc: linux-usb-users, linux-kernel

On Mon, May 03, 2004 at 12:21:20PM +0200, Joerg Pommnitz wrote:
> Hello listees,
> we are struggling with a 3rd party USB device. It comes with its own
> firmware and its own Linux USB serial drivers.

Which device and driver is this?  Do you have a pointer to the driver?

> Unfortunately the
> communication between the device and the user application seems to break
> down from time to time. This situation can easily be resolved by
> unplugging and then re-plugging the device. Unfortunately this requires
> manual intervention.
> While resolving the real issue would be the preferred way to deal with
> this problem, we would settle for a way to do a software unplug/re-plug.

Do you want to do this from within the kernel, or from userspace?  If
from within the kernel, you should be able to drop the power to a hub
port and reenable it, but I haven't checked to see if that works in a
long time.

thanks,

greg k-h

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

* Re: Software based unplug of USB device?
  2004-05-03 14:54 ` Greg KH
@ 2004-05-03 18:10   ` Johannes Erdfelt
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Erdfelt @ 2004-05-03 18:10 UTC (permalink / raw)
  To: Greg KH; +Cc: Joerg Pommnitz, linux-usb-users, linux-kernel

On Mon, May 03, 2004, Greg KH <greg@kroah.com> wrote:
> On Mon, May 03, 2004 at 12:21:20PM +0200, Joerg Pommnitz wrote:
> > Hello listees,
> > we are struggling with a 3rd party USB device. It comes with its own
> > firmware and its own Linux USB serial drivers.
> 
> Which device and driver is this?  Do you have a pointer to the driver?
> 
> > Unfortunately the
> > communication between the device and the user application seems to break
> > down from time to time. This situation can easily be resolved by
> > unplugging and then re-plugging the device. Unfortunately this requires
> > manual intervention.
> > While resolving the real issue would be the preferred way to deal with
> > this problem, we would settle for a way to do a software unplug/re-plug.
> 
> Do you want to do this from within the kernel, or from userspace?  If
> from within the kernel, you should be able to drop the power to a hub
> port and reenable it, but I haven't checked to see if that works in a
> long time.

Wouldn't usb_reset_device() work? That's assuming the device isn't
totally and completely hosed.

It can be done via usbfs as well.

JE


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

end of thread, other threads:[~2004-05-04  6:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-03 10:21 Software based unplug of USB device? Joerg Pommnitz
2004-05-03 11:07 ` Duncan Sands
2004-05-03 14:54 ` Greg KH
2004-05-03 18:10   ` Johannes Erdfelt

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