[linux-usb-devel] Re: More about reset/config change [was: some analysis of a hang]

2003-08-14 Thread David Brownell
Good morning,

I just noticed that my previous usb_set_configuration() experiment

   http://marc.theaimsgroup.com/?l=linux-usb-develm=105484578921888w=2

was the simplified version, without a driver configure() callback.


Posted back in June!  No wonder I don't remember it :-)  (Quite aside from
it being the simplified version.)
There were preceding email threads, too.  If it hadn't been preventing
me from finishing up a workspace, I might have forgotten it too!  :)
I expect I'll post the 2.6.0-test3 version soon.  It won't do
anything more than make usb_set_configuration() work right in
all currently-legal cases (and from sysfs):  no configure() call.

I read the archived message, and I see what you have in mind.

Basically we're talking about a design decision here.  Should drivers be
able to request configuration changes at arbitrary times, or should they
be restricted to config matching in this new callback routine (which gets
invoked when the core wants to select a config)?
Yes, choosing between those assumptions/approaches implies design choices
beyond usb_set_configuration() needs a task context and kernel code
other than khubd should be able to choose configurations.

Many of the advantages of the second choice would be negated by the fact 
that config changes can be requested via usbfs or sysfs at any time.
How could a constraint on both choices affect only one of them?  :)
I don't see any negation.

What about drivers that are loaded by hand, well after the initial device 
setup has finished?  Would they get a say in choosing a configuration?
Certainly they should.  In the same way their probe() gets called.
It's another way to (implicitly) request a config change.
Alternatively, write the sysfs bConfigurationValue after modprobe.


No, as you pointed out above, unbind for the driver/interface making the 
usb_set_configuration() call must be deferred also.  All the other 
interfaces can be unbound immediately.  Also, I don't see any harm in 
always deferring the re-binding -- it would simplify things, and in any 
case it can't be done until the calling driver has been unbound.
I see different assumptions:  namely, that usb_set_configuration()
should be available to device drivers in almost all contexts, not
just in controlled configure() contexts.


Don't forget, this discussion applies equally well to usb_reset_device() 
in the device morphed pathway.  I doubt you want to restrict that 
capability to these configure() contexts.
No, but I think that the morphed case should go through complete
re-enumeration, from khubd as usual, instead of making a special case.
Enumeration is one of those contexts, and that hand off to khubd
is something you had pointed out was essential.
- Dave



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] USB module for Atmel uC

2003-08-14 Thread David Brownell
J. Dosher wrote:

Are there any generic examples of interrupt mode usb drivers? At this
point I'm really not trying to do anything fancy, so I suspect that the
solution is really rather simple.
You seem to mean interrupt transfers, where the endpoint descriptor
says run this every N frames (or microframes).  Those are used by
the HID and HUB drivers, and for status channels by a few others.
These are indeed simple.  You submit an urb; it gets a completion
callback.  In 2.6 kernels, you're responsible for re-issuing it.
In all kernels, you're responsible for using the data from that URB,
maybe by copying it someplace useful.

I have read, write, and an irq function in my driver, but I NEVER see them
being called (the read and write are listed in my file_operations struct).
Since the device is sending out a packet every 2 seconds, I'd expect to
see the read function getting called, no?
That depends entirely on what your user mode code does.  If it's issuing
a read() on the right file descriptor, then yes it'd get called.
- Dave



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH]correct error handling in usb_driver_claim_interface()

2003-08-14 Thread Greg KH
On Mon, Aug 11, 2003 at 11:19:51PM +0200, Oliver Neukum wrote:
 [EMAIL PROTECTED], 2003-08-11 23:08:16+02:00, [EMAIL PROTECTED]
   - update commentary

Applied, thanks.

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [patch/rfc 2.6.0-test3] usb_set_configuration() meets sysfs

2003-08-14 Thread Alan Stern
The core/message.c file is getting kind of large and unfocussed.  Maybe it 
should be re-factored (so to speak) at some point.  Not important for now.


On Wed, 13 Aug 2003, David Brownell wrote:

 This patch is an update of one I sent around with 2.5.70, when the
 kernel wasn't quite ready to do this.  It resolves some bugs in the
 way changing device configurations were reflected in the driver model:

   - Makes the bConfigurationValue be writable through sysfs, so
 device configurations can be easily changed from user mode.

I foresee races between set_bConfigurationValue() and disconnect.  But 
that's not something I can fix in two minutes.

Some minor changes below, but otherwise this looks good.

Alan Stern


--- 2.6.0/drivers/usb/core/message.c.2  Thu Aug 14 10:04:41 2003
+++ 2.6.0/drivers/usb/core/message.cThu Aug 14 10:08:30 2003
@@ -1064,7 +1064,7 @@
  *
  * Returns zero on success, or else the status code returned by the
  * underlying call that failed.  On succesful completion, each interface
- * in the original device configuration has been destroied, and each one
+ * in the original device configuration has been destroyed, and each one
  * in the new configuration has been probed by all relevant usb device
  * drivers currently known to the kernel.
  */
@@ -1095,13 +1095,15 @@
 
if ((ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
USB_REQ_SET_CONFIGURATION, 0, configuration, 0,
-   NULL, 0, HZ * USB_CTRL_SET_TIMEOUT))  0) {
-   up(dev-serialize);
-   return ret;
-   }
-   if (configuration)
-   dev-state = USB_STATE_CONFIGURED;
+   NULL, 0, HZ * USB_CTRL_SET_TIMEOUT))  0)
+   goto out;
+
dev-actconfig = cp;
+   if (!configuration) {
+   dev-state = USB_STATE_ADDRESS;
+   goto out;
+   }
+   dev-state = USB_STATE_CONFIGURED;
 
/* re-initialize hc/hcd/usbcore interface/endpoint state.
 * this triggers binding of drivers to interfaces; and
@@ -1128,8 +1130,9 @@
usb_create_driverfs_intf_files (intf);
}
 
+out:
up(dev-serialize);
-   return 0;
+   return ret;
 }
 
 




---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] More about reset/config change [was: some analysis of a hang]

2003-08-14 Thread Alan Stern
On Tue, 12 Aug 2003, David Brownell wrote:

 Alan Stern wrote:
 
  There's another time.  That's if the device driver happens to know that 
  the device has to operate in a configuration other than the default one 
  (or other than the one installed when probe() is called).  Yes, I know 
  there are issues of policy involved there, and just who should decide 
  which configuration to use, but it's a legitimate thing to do.
 
 Eventually.  But it's never really worked correctly yet, so to
 that extent it's a new feature -- not a backwards compatibility
 issue.  Essentially all current callers of usb_set_configuration()
 other than khubd (setting the default) and usbfs (causing trouble)
 want usb_reset_configuration() functionality -- not config changes.

While that's true, there's no reason we shouldn't add the capability as 
part of this reorganization -- especially if it's easy to do so.

 I just noticed that my previous usb_set_configuration() experiment
 
 http://marc.theaimsgroup.com/?l=linux-usb-develm=105484578921888w=2
 
 was the simplified version, without a driver configure() callback.

Posted back in June!  No wonder I don't remember it :-)  (Quite aside from
it being the simplified version.)

 Sorry, I forgot I didn't send that.  Briefly, for multi-config
 devices, drivers that matched the device descriptor and had a
 configure() callback were given the opportunity to choose a
 non-default configuration.

I read the archived message, and I see what you have in mind.

Basically we're talking about a design decision here.  Should drivers be
able to request configuration changes at arbitrary times, or should they
be restricted to config matching in this new callback routine (which gets
invoked when the core wants to select a config)?

Many of the advantages of the second choice would be negated by the fact 
that config changes can be requested via usbfs or sysfs at any time.

What about drivers that are loaded by hand, well after the initial device 
setup has finished?  Would they get a say in choosing a configuration?

 I'm still expecting that any driver API would use something like
 that configure() callback.  I think that approach is simpler.
 (But I also don't think kernel drivers need that capability much
 at all today, and it's enough to be available from userland.)

We shouldn't let the fact that no drivers today need this ability sway us 
to declare that drivers will _never_ be allowed to do it.

  No, as you pointed out above, unbind for the driver/interface making the 
  usb_set_configuration() call must be deferred also.  All the other 
  interfaces can be unbound immediately.  Also, I don't see any harm in 
  always deferring the re-binding -- it would simplify things, and in any 
  case it can't be done until the calling driver has been unbound.
 
 I see different assumptions:  namely, that usb_set_configuration()
 should be available to device drivers in almost all contexts, not
 just in controlled configure() contexts.

Don't forget, this discussion applies equally well to usb_reset_device() 
in the device morphed pathway.  I doubt you want to restrict that 
capability to these configure() contexts.

  There _is_ a problem, which Oliver identified.  What if one driver
  requests a reset or config change at the same time that another interface
  is being probed (or unbound)?  Then the serialization must block the
  request until the probe is done.  But if a driver makes such a request
  within its own probe(), serialization shouldn't block it.  Arranging that 
  will require a little effort.
 
 It's easy to serialize for a new configure() callback, which isn't
 doing double duty.  Or to let userspace deal with the problem.

Again, we also have to deal with usb_reset_device().  But handling this 
correctly shouldn't be too hard; we simply have to record which interface 
is probed/disconnected as it happens.

Alan Stern



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: More about reset/config change [was: some analysis of a hang]

2003-08-14 Thread Alan Stern
I think at this point we're pretty much in agreement.

On Wed, 13 Aug 2003, David Brownell wrote:

 Yes, choosing between those assumptions/approaches implies design choices
 beyond usb_set_configuration() needs a task context and kernel code
 other than khubd should be able to choose configurations.
 
 
  Many of the advantages of the second choice would be negated by the fact 
  that config changes can be requested via usbfs or sysfs at any time.
 
 How could a constraint on both choices affect only one of them?  :)
 I don't see any negation.

[This is moot as we aren't going to adopt the callback approach, at
least not for the time being.  Nevertheless...]

The constraint that usbfs and sysfs can request config changes at any
time only affects the second choice, because the first choice amounts to
saying that drivers can also request config changes at any time.  On the
face of it, the second choice (allowing drivers to change the config only
at controlled times) would make certain things easier: not having to worry
about locking or interfering with probe/disconnect.  But those advantages
aren't realized because non-drivers can still make config changes whenever
they want.


  What about drivers that are loaded by hand, well after the initial device 
  setup has finished?  Would they get a say in choosing a configuration?
 
 Certainly they should.  In the same way their probe() gets called.
 It's another way to (implicitly) request a config change.
 
 Alternatively, write the sysfs bConfigurationValue after modprobe.

The disadvantage to that is it requires knowledge of what configurations
are supported to be divided between the driver and a user-mode helper.


 I see different assumptions:  namely, that usb_set_configuration()
 should be available to device drivers in almost all contexts, not
 just in controlled configure() contexts.
  
  
  Don't forget, this discussion applies equally well to usb_reset_device() 
  in the device morphed pathway.  I doubt you want to restrict that 
  capability to these configure() contexts.
 
 No, but I think that the morphed case should go through complete
 re-enumeration, from khubd as usual, instead of making a special case.
 Enumeration is one of those contexts, and that hand off to khubd
 is something you had pointed out was essential.

Okay, makes sense.

Alan Stern



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [patch/rfc 2.6.0-test3] usb_set_configuration() meets sysfs

2003-08-14 Thread David Brownell
Alan Stern wrote:
The core/message.c file is getting kind of large and unfocussed.  Maybe it 
should be re-factored (so to speak) at some point.  Not important for now.
That issue seems orthogonal to this patch -- I don't think it
made the problem worse.
Should the usb_{enable,disable}_*() internal routines (and their
callers) maybe move into usb.c or hcd.c?  They're special
since they maintain usbcore state (including HCD state).  The others
are just convenience/utility code, wrapping core functionality.

 - Makes the bConfigurationValue be writable through sysfs, so
   device configurations can be easily changed from user mode.


I foresee races between set_bConfigurationValue() and disconnect.  But 
that's not something I can fix in two minutes.
Could you elaborate?  I don't think I added any new races there.


Some minor changes below, but otherwise this looks good.
And those look fine ... merged into this revised patch, with one
minor cleanup:  got rid of one of the two goto out statements
you added, which makes the non-error exit states (state ADDRESS vs.
state CONFIGURED) clearer too.
- Dave
--- 1.34/drivers/usb/core/message.c Mon Aug 11 07:56:25 2003
+++ edited/drivers/usb/core/message.c   Thu Aug 14 08:24:01 2003
@@ -788,18 +788,39 @@
  * @skip_ep0: 0 to disable endpoint 0, 1 to skip it.
  *
  * Disables all the device's endpoints, potentially including endpoint 0.
- * Deallocates hcd/hardware state for the endpoints ... and nukes all
- * pending urbs.
+ * Deallocates hcd/hardware state for the endpoints (nuking all or most
+ * pending urbs) and usbcore state for the interfaces, so that usbcore
+ * must usb_set_configuration() before any interfaces could be used.
  */
 void usb_disable_device(struct usb_device *dev, int skip_ep0)
 {
int i;
 
-   dbg(nuking URBs for device %s, dev-dev.bus_id);
+   dev_dbg(dev-dev, %s nuking %s URBs\n, __FUNCTION__,
+   skip_ep0 ? non-ep0 : all);
for (i = skip_ep0; i  16; ++i) {
usb_disable_endpoint(dev, i);
usb_disable_endpoint(dev, i + USB_DIR_IN);
}
+   dev-toggle[0] = dev-toggle[1] = 0;
+   dev-halted[0] = dev-halted[1] = 0;
+
+   /* getting rid of interfaces will disconnect
+* any drivers bound to them (a key side effect)
+*/
+   if (dev-actconfig) {
+   for (i = 0; i  dev-actconfig-desc.bNumInterfaces; i++) {
+   struct usb_interface*interface;
+
+   /* remove this interface */
+   interface = dev-actconfig-interface[i];
+   dev_dbg (dev-dev, unregistering interface %s\n,
+   interface-dev.bus_id);
+   device_unregister(interface-dev);
+   }
+   dev-actconfig = 0;
+   }
+   dev-state = USB_STATE_ADDRESS;
 }
 
 
@@ -1019,28 +1040,33 @@
  * Context: !in_interrupt ()
  *
  * This is used to enable non-default device modes.  Not all devices
- * support this kind of configurability.  By default, configuration
- * zero is selected after enumeration; many devices only have a single
+ * support this kind of configurability; many devices only have one
  * configuration.
  *
- * USB devices may support one or more configurations, which affect
+ * USB device configuration affect
  * power consumption and the functionality available.  For example,
  * the default configuration is limited to using 100mA of bus power,
  * so that when certain device functionality requires more power,
- * and the device is bus powered, that functionality will be in some
+ * and the device is bus powered, that functionality should be in some
  * non-default device configuration.  Other device modes may also be
  * reflected as configuration options, such as whether two ISDN
  * channels are presented as independent 64Kb/s interfaces or as one
- * bonded 128Kb/s interface.
+ * bonded 128Kb/s interface; or whether the device uses standard protocols
+ * (maybe CDC Ethernet) or proprietary ones (maybe RNDIS).
  *
  * Note that USB has an additional level of device configurability,
  * associated with interfaces.  That configurability is accessed using
  * usb_set_interface().
  *
- * This call is synchronous, and may not be used in an interrupt context.
+ * This call is synchronous. The calling context must be able to sleep,
+ * and must not hold the driver model lock for USB; usb device driver
+ * probe() methods may not use this routine.
  *
  * Returns zero on success, or else the status code returned by the
- * underlying usb_control_msg() call.
+ * underlying call that failed.  On succesful completion, each interface
+ * in the original device configuration has been destroyed, and each one
+ * in the new configuration has been probed by all relevant usb device
+ * drivers currently known to the kernel.
  */
 int usb_set_configuration(struct usb_device *dev, int configuration)
 {
@@ -1058,30 +1084,55 

[linux-usb-devel] Re: [patch 2.6.0-test3] usb hcd-pci suspend/resume updates

2003-08-14 Thread Greg KH
On Tue, Aug 12, 2003 at 04:38:47PM -0700, David Brownell wrote:
 This patch has some updates to the hcd pci power management glue:
 
  - removes now-obsolete comments (driver model now exists)
 
  - better state transitions:
  * suspending dead controllers needn't oops
  * multi-resume case (pm bug) simplified
  * multi-suspend case likewise (not always a bug)
  * should handle transitions other than D0-D3{hot,cold}
 
  - prepares for usb remote wake up support, which will be
wanting the driver model suspend/resume code to be ready.
 
 Please merge to test4.

Applied, thanks.

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [patch 2.6.0-test3] ov511 sysfs conversion (3/3)

2003-08-14 Thread Mark McClelland
This patch adds some read-only files to ov511's sysfs directory. The 
read/write attributes will be added in a future patch. For now, the 
read/write-related code is #if'd out to prevent warnings.

Please apply.

--
Mark McClelland
[EMAIL PROTECTED]

===


[EMAIL PROTECTED], 2003-08-13 06:52:30-07:00, [EMAIL PROTECTED]
  ov511: Add read-only sysfs files


 ov511.c |  122 ++
 1 files changed, 115 insertions, 7 deletions


# This is a BitKeeper generated patch for the following project:
# Project Name: greg k-h's linux 2.5 USB kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#  ChangeSet1.2255  - 1.2256 
#   drivers/usb/media/ov511.c   1.57- 1.58   
#
# The following is the BitKeeper ChangeSet Log
# 
# 03/08/13  [EMAIL PROTECTED]   1.2256
# ov511: Add read-only sysfs files
# 
#
diff -Nru a/drivers/usb/media/ov511.c b/drivers/usb/media/ov511.c
--- a/drivers/usb/media/ov511.c Wed Aug 13 06:54:33 2003
+++ b/drivers/usb/media/ov511.c Wed Aug 13 06:54:33 2003
@@ -293,7 +293,6 @@
{ -1, NULL }
 };
 
-#if defined(CONFIG_VIDEO_PROC_FS)
 static struct symbolic_list senlist[] = {
{ SEN_OV76BE,   OV76BE },
{ SEN_OV7610,   OV7610 },
@@ -309,7 +308,6 @@
{ SEN_SAA7111A, SAA7111A },
{ -1, NULL }
 };
-#endif
 
 /* URB error codes: */
 static struct symbolic_list urb_errlist[] = {
@@ -1133,7 +1131,7 @@
}
 }
 
-#if defined(CONFIG_VIDEO_PROC_FS)
+#if 0
 /* Checks the status of the snapshot button. Returns 1 if it was pressed since
  * it was last cleared, and zero in all other cases (including errors) */
 static int
@@ -1832,7 +1830,7 @@
return 0;
 }
 
-#if defined(CONFIG_VIDEO_PROC_FS)
+#if 0
 // FIXME: Exposure range is only 0x00-0x7f in interlace mode
 /* Sets current exposure for sensor. This only has an effect if auto-exposure
  * is off */
@@ -1877,6 +1875,7 @@
 
return rc;
 }
+#endif
 
 /* Gets current exposure level from sensor, regardless of whether it is under
  * manual control. */
@@ -1914,7 +1913,6 @@
 
return 0;
 }
-#endif /* CONFIG_VIDEO_PROC_FS */
 
 /* Turns on or off the LED. Only has an effect with OV511+/OV518(+) */
 static void
@@ -5679,9 +5677,118 @@
 }
 
 /
- *
+ *  sysfs
+ ***/
+
+static inline struct usb_ov511 *cd_to_ov(struct class_device *cd)
+{
+   struct video_device *vdev = to_video_device(cd);
+   return video_get_drvdata(vdev);
+}
+
+static ssize_t show_custom_id(struct class_device *cd, char *buf)
+{
+   struct usb_ov511 *ov = cd_to_ov(cd);
+   return sprintf(buf, %d\n, ov-customid);
+} 
+static CLASS_DEVICE_ATTR(custom_id, S_IRUGO, show_custom_id, NULL);
+
+static ssize_t show_model(struct class_device *cd, char *buf)
+{
+   struct usb_ov511 *ov = cd_to_ov(cd);
+   return sprintf(buf, %s\n, ov-desc);
+} 
+static CLASS_DEVICE_ATTR(model, S_IRUGO, show_model, NULL);
+
+static ssize_t show_bridge(struct class_device *cd, char *buf)
+{
+   struct usb_ov511 *ov = cd_to_ov(cd);
+   return sprintf(buf, %s\n, symbolic(brglist, ov-bridge));
+} 
+static CLASS_DEVICE_ATTR(bridge, S_IRUGO, show_bridge, NULL);
+
+static ssize_t show_sensor(struct class_device *cd, char *buf)
+{
+   struct usb_ov511 *ov = cd_to_ov(cd);
+   return sprintf(buf, %s\n, symbolic(senlist, ov-sensor));
+} 
+static CLASS_DEVICE_ATTR(sensor, S_IRUGO, show_sensor, NULL);
+
+static ssize_t show_brightness(struct class_device *cd, char *buf)
+{
+   struct usb_ov511 *ov = cd_to_ov(cd);
+   unsigned short x;
+
+   if (!ov-dev)
+   return -ENODEV;
+   sensor_get_brightness(ov, x);
+   return sprintf(buf, %d\n, x  8);
+} 
+static CLASS_DEVICE_ATTR(brightness, S_IRUGO, show_brightness, NULL);
+
+static ssize_t show_saturation(struct class_device *cd, char *buf)
+{
+   struct usb_ov511 *ov = cd_to_ov(cd);
+   unsigned short x;
+
+   if (!ov-dev)
+   return -ENODEV;
+   sensor_get_saturation(ov, x);
+   return sprintf(buf, %d\n, x  8);
+} 
+static CLASS_DEVICE_ATTR(saturation, S_IRUGO, show_saturation, NULL);
+
+static ssize_t show_contrast(struct class_device *cd, char *buf)
+{
+   struct usb_ov511 *ov = cd_to_ov(cd);
+   unsigned short x;
+
+   if (!ov-dev)
+   return -ENODEV;
+   sensor_get_contrast(ov, x);
+   return sprintf(buf, %d\n, x  8);
+} 
+static CLASS_DEVICE_ATTR(contrast, S_IRUGO, show_contrast, NULL);
+
+static ssize_t show_hue(struct class_device *cd, char *buf)
+{
+   struct usb_ov511 *ov = cd_to_ov(cd);
+   unsigned short x;
+
+   if 

Re: [linux-usb-devel] bug in EHCI device reset through transactiontranslator (2.4.22)

2003-08-14 Thread David Brownell
Kevin Owen wrote:
I have found a problem in linux-2.4.22 with resetting usb 1.1 devices 
that are attached through a transaction translator to an EHCI 
controller. My setup to produce this problem is to connect a usb 2.0 hub 
to a usb 2.0 port, then connect a usb 1.1 hub to the 2.0 hub, then 
connect a 1.1 device to the 1.1 hub. If at this point a usb device reset 
is sent to the 1.1 device, the 1.1 hub's port is reset, then a 
set_address is sent to the device, but this fails (-32). After some 
It's too darn bad that's such a common configuration!  ;)

But this issue looks generic; any device being reset might see
this particular problem, though maybe your hardware setup only
generated the need for a reset in this case.  And 2.6 will need
this fixed too.

analysis, the urb to send the set_address is fine, contains device 
address 0, however in the EHCI driver (ehci-q.c), the reuse of queue 
heads means that the set_address is sent out on the wire to device 4 
(confirmed with usb 1.1 wire-level analyzer), which was the previous 
address of the device to be reset. As the device has just been reset, it 
really has address 0, so it is no wonder the set_address fails. The 
Aha!  So this is another subtle usb_device_reset() failure.

Thanks for tracking this down.


following patch seems to fix the problem, sensing when the urb is to 
device 0, and patching this into the re-used queue heads, then letting 
the existing code write the queue heads device address back to the 
just-set address on the next transfer.
Actually a patch would be diff -u old new output.  Other than
whitespace changes, I think your bugfix is much simpler, like the
attached patch.
- Dave



--- 1.16/drivers/usb/host/ehci-q.c  Thu Jun 19 06:51:52 2003
+++ edited/drivers/usb/host/ehci-q.cWed Aug 13 09:58:53 2003
@@ -832,6 +832,10 @@
qh-hw_info1 = cpu_to_le32 (info);
}
}
+
+/* usb_reset_device() briefly reverts to address 0 */
+if (usb_pipedevice (urb-pipe) == 0)
+qh-hw_info1 = cpu_to_le32(~0x7f);
}
 
/* NOTE:  changing config or interface setting is not


[linux-usb-devel] dvb usb driver sleeping in interrupt

2003-08-14 Thread Oliver Neukum
Hi,

submitting an URB in a completion handler requires GFP_ATOMIC to be
used.

Regards
Oliver

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===


[EMAIL PROTECTED], 2003-08-06 21:05:08+02:00, [EMAIL PROTECTED]
  - usb_submit_urb must use GFP_ATOMIC in interrupt


 dvb-ttusb-budget.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c 
b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c Wed Aug  6 21:06:39 2003
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c Wed Aug  6 21:06:39 2003
@@ -788,7 +788,7 @@
}
}
 #if LINUX_VERSION_CODE = KERNEL_VERSION(2,5,0)
-   usb_submit_urb(urb, GFP_KERNEL);
+   usb_submit_urb(urb, GFP_ATOMIC);
 #endif
 }
 

===


This BitKeeper patch contains the following changesets:
1.2153
## Wrapped with gzip_uu ##


begin 664 bkpatch27305
M'XL(`+]1,3\``\54VVK,!!]7GW%0%Y:4MNZ6++LXK+IIDE#$[)LDZ=2%E^T
M]K+Q.LA22L$?7WD-N=`+W92V0L:C7GFZ,RQ#NZ4SJ9M#?K.Z71`;QO.Y-,
MG-W84FW]K;(;V_BMKEQLT;[EMAIL PROTECTED]/[EMAIL PROTECTED]
M(3Z[]YBOMRJ9+-Z=7I\?+1!*4YC5V;92'Y6!-$7Y9EI:=-O=)O50[G^/MQ3
MC`DAE/!$]E8R%/1$X+YU9TBAY2)(Z#I#Y`_36PQ)2$SB7M84W0,
MQ*$,\`LP#+``BA),$^P/,0TP1A^GAH.[EMAIL PROTECTED]@F%QV-F_69FEU
M#HWMC/,I.#V9+X^N+B_.9K#NFF4UO;[EMAIL PROTECTED];P]!T([EMAIL PROTECTED]
MT_$`1=M\I:?^U(/9^^1I7K+CO\L8H=VY+2ME!H?WV.$7(\1E42$+1N
MZ:CN9Y6F9`BHU8[KZ!:?/+2FQ(#'FF/A8YCL-+9WJD+_Y*'OU(LW#'`
M1V%_IVK^ZHF_U758PLOP=-?=M.I=+Y_-Y_Q*QQ',0SL;7YGR%^YY]0CU
;R]/5UY1JV+3V29EDG`9,HJ^`;'[\H)!0``
`
end



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: gadget-2.4

2003-08-14 Thread David Brownell
Alex Au wrote:
I downloaded (using bitkeeper) the gadget-2.4 source tree and I noticed that
the arch\arm\mach-pxa and include\asm-arm\arch-pxa folders are not in
the source tree.  These 2 folders are present in the gadget-2.6 tree.  I
have the Lubbock board running 2.4.19 kernel.  Does it mean I need to
So presumably you're using the 2.4.19-rmk7-pxa2 (or pxa1) patch -- that
should behave nicely.  Some of the PXA files are already in the 2.6 kernel,
but 2.5.70-rmk1-pxa1 isn't quite ready yet.  (I saw modprobe oopses when
loading gadget drivers, though not when loading pxa2xx_udc.)
If you have the 2.6 kernel there's also a small patch to tell that kernel
about the Lubbock USB disconnect IRQ ... which works just fine on 2.4, but
the pxa patches don't know about it yet.  You might feel motivated to do
that backpatch (#define the IRQ and update the lubbock.c platform code
that knows about how many irqs the fpga gives you).

incorporate your gadget source into my source tree and modify the some
Makefile and Config.in files in order to try out the gadget API?  The macro
IRQ_USB is not defined in gadget-2.4 tree without the those folders...  
Exactly.  You can do it with symlinks from your PXA tree into that BK clone,
for these files:
  drivers/usb/gadget  ... whole directory
  include/linux/usb_{gadget,gadgetfs,ch9}.h
Plus the relevant changes in

  drivers/Makefile
  drivers/usb/Makefile
  drivers/usb/Config.in
Or if you like, generate a patch comparing your clone against the latest
Linux 2.4 tree, using BK 3.x and this command:
  bk export -tpatch -r`bk repogca bk://linux.bkbits.net/linux-2.4`,+

Then apply that to your older 2.4 tree ... you'll notice everything except
the Makefile and Config.in changes apply cleanly.  Symlinking the source
has an advantage that you can more easily pull updates from BK, or send
patches against it.
- Dave



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH] Fix compilation problem with 2.6.0-test2 on PPC

2003-08-14 Thread Jocelyn Mayer
Hi,

There is a compilation issue in driver/input/evdev.c
due to the fact a complex expression is used as an argument
for an inline assembly construction (get_user)
The fix I done is to use a temporary variable to get the argument
and then use this variable for get_user.

-- 
Jocelyn Mayer [EMAIL PROTECTED]
--- evdev.c.origMon Jun 16 06:39:02 2003
+++ evdev.c Thu Jul 31 02:41:35 2003
@@ -208,7 +208,7 @@
struct evdev *evdev = list-evdev;
struct input_dev *dev = evdev-handle.dev;
struct input_absinfo abs;
-   int i, t, u;
+   int i, t, u, v;
 
if (!evdev-exist) return -ENODEV;
 
@@ -240,7 +240,8 @@
if (get_user(t, ((int *) arg) + 0)) return -EFAULT;
if (t  0 || t  dev-keycodemax || !dev-keycodesize) return 
-EINVAL;
u = INPUT_KEYCODE(dev, t);
-   if (get_user(INPUT_KEYCODE(dev, t), ((int *) arg) + 1)) return 
-EFAULT;
+v = INPUT_KEYCODE(dev, t);
+   if (get_user(v, ((int *) arg) + 1)) return -EFAULT;
 
for (i = 0; i  dev-keycodemax; i++)
if(INPUT_KEYCODE(dev, t) == u) break;


[linux-usb-devel] some analysis of a hang

2003-08-14 Thread aeb
Now that I mentioned that inserting usb-storage hangs forever
and then causes a SCSI oops, the question arises how the hang
is caused. It turns out to be a semaphore deadlock.

What happens is that base/bus.c:bus_add_driver() downs
down_write(bus-subsys.rwsem);
and then later usb/core/hub.c:usb_reset_device() downs
down_read(gdev-bus-subsys.rwsem);

This is the same semaphore, and we have a deadlock.

Andries


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] synchronous ops with urbs

2003-08-14 Thread David Brownell
Prageeth wrote:
hi all,

in my driver i need to provide synchronous read/write
operations to the application. moreover, operation
cancellation is also needed. 

-what is the most recommended way to wait for
completion of an urb?
Submit using usb_submit_urb(), then if you don't need
operation cancellation, use linux/completion.h primitives
to wait.
If you need cancelation, linux/wait.h primitives
are one option, like:
 - wait_event_interruptible()
 - wait_event_interruptible_timeout()
Yes, there's no wait_event_timeout() without the
option of breaking out on interrupts; sigh.  But
it seems like you don't need that option.
When those primitives complete early, then call
usb_unlink_urb() and then use wait_event() to catch
the canceled URB.  (Even if you gave up just a
smidgeon too early, and it already completed...)
You can use a struct completion with these, and
have the urb completion handler calling complete().
There's another wait/synchronize primitive that
I found at one point, I think the block layer
used it, which involved a bit less inlined code
and didn't necessarily require everything to be
interruptible.  I lost track of it though.



-i was planning to use a modified version of
usb_start_wait_urb() used inside usb_bulk_msg()
is any better methods possible?
Absolutely.  That code needs to be replaced,
it's not even correct in certain cases.
- Dave



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH]ttusb_dec.c: another case of GFP_KERNEL in interrupt

2003-08-14 Thread Oliver Neukum
You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===


[EMAIL PROTECTED], 2003-08-09 13:42:28+02:00, [EMAIL PROTECTED]
  - in interrupt usb_submit_urb must use GFP_ATOMIC


 ttusb_dec.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/media/dvb/ttusb-dec/ttusb_dec.c 
b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c   Sat Aug  9 13:43:04 2003
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c   Sat Aug  9 13:43:04 2003
@@ -413,7 +413,7 @@
 
 #if LINUX_VERSION_CODE = KERNEL_VERSION(2,5,0)
if (dec-iso_stream_count)
-   usb_submit_urb(urb, GFP_KERNEL);
+   usb_submit_urb(urb, GFP_ATOMIC);
 #endif
 }
 

===


This BitKeeper patch contains the following changesets:
1.2214
## Wrapped with gzip_uu ##


begin 664 bkpatch27243
M'XL(`$C-#\``\54:VN0!3][/R*_G2DJAW'HZCQ;+IIDU#6[)LDT^E+#ZF
MZV)[EMAIL PROTECTED]5$:[EMAIL PROTECTED][.YTX8P=NF[6+'
MQG5?Z*VWU7W5UUYCUA9;-HW%_+*IM3\E^%=Z]9/JZYO,V*/+-(N+\$B;Q0
MCS_L=-]N=PL7Y]?OS]=$I(D,_3[5I_U!TDFJ6='KZ\R35J.U88'(
ME%(6(`\D#0:F.![EMAIL PROTECTED]'W)9$361J]G4WKU/OI'!4C+$0PT'(B$Y
[EMAIL PROTECTED]@]U'Y`'EL6`Q4\?(8D28Z,U^H@,4W1O((_[WE.G!AL[6KT\;T
MMQU85=MG]6;;M6;#.J^'?TG+]9K$ZO+C]S,D[$*%$01:/$A+WB1AF)Y
M?NJ?1I?/P^%;FW?JV+3H7=YG?C-UYU/TI7CXIS)%I#Y9M%`U%
MJC*)3#$M+1S^2LFG%5(842H8DP.75H=AP[\P.BP?\_T+Y10*B(2NPXJLFF
M_`/RL,\2O^K1ZA78)KONZ6]=SBT'G]AIW/!)5`R7T)S]'I_9^^2[_IZ_
9/Q7Y:7.J[:O$Y8%7(8R(_*D,TR%`4`
`
end



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [2.6.0-test2-bk5] OHCI USB printing call trace...

2003-08-14 Thread Daniel Blueman
Oliver,

Thanks for your response. This is consistently reproducible and the printer
will get to ~20% down the first page before stopping. Just when or after it
stops printing, I observed the system time jump to 61% [2], then some
polling/logging going on, until I turn the printer off or disconnect the cable. This
can be seen again in the logs [1], but we do not observe your additional
debugging. I enabled the additional USB debugging also.

--- [1]
[printer plugged into root hub]
Aug  6 23:42:33 stratum kernel: hub 1-0:0: debounce: port 2: delay 100ms
stable 4 status 0x101
Aug  6 23:42:33 stratum kernel: hub 1-0:0: new USB device on port 2,
assigned address 3
Aug  6 23:42:33 stratum kernel: usb 1-2: Product: USB Printer
Aug  6 23:42:33 stratum kernel: usb 1-2: Manufacturer: EPSON
Aug  6 23:42:33 stratum kernel: usb 1-2: SerialNumber: ABCDE0212160438390
Aug  6 23:42:33 stratum kernel: drivers/usb/class/usblp.c: usblp0: USB
Bidirectional printer dev 3 if 0 alt 0 proto 2 vid 0x04B8 pid 0x0005

[print job started; printer reached 20% down the page and stopped]
Aug  6 23:44:33 stratum kernel: drivers/usb/class/usblp.c: usblp0: error
-110 reading printer status
Aug  6 23:44:33 stratum last message repeated 17 times

[printer powered off]
Aug  6 23:44:33 stratum kernel: usb 1-2: USB disconnect, address 3
Aug  6 23:44:33 stratum kernel: ohci-hcd :00:02.2: ed df122080 (#0)
state 2(has tds)
Aug  6 23:44:33 stratum kernel: drivers/usb/class/usblp.c: usblp0: error
-108 reading printer status
Aug  6 23:44:37 stratum kernel: drivers/usb/class/usblp.c: usblp0: removed
Aug  6 23:44:37 stratum kernel: Unable to handle kernel paging request at
virtual address d6b990e4
Aug  6 23:44:37 stratum kernel:  printing eip:
Aug  6 23:44:37 stratum kernel: c02c6383
Aug  6 23:44:37 stratum kernel: *pde = 00059067
Aug  6 23:44:37 stratum kernel: *pte = 16b99000
Aug  6 23:44:37 stratum kernel: Oops:  [#1]
Aug  6 23:44:37 stratum kernel: CPU:0
Aug  6 23:44:37 stratum kernel: EIP:0060:[c02c6383]Not tainted
Aug  6 23:44:37 stratum kernel: EFLAGS: 00010282
Aug  6 23:44:37 stratum kernel: EIP is at usb_buffer_free+0xd/0x46
Aug  6 23:44:37 stratum kernel: eax: d6b99004   ebx: dda96004   ecx:
df1aa000   edx: d6b7
Aug  6 23:44:37 stratum kernel: esi: dda96008   edi: dcc6f098   ebp:
d6b71f1c   esp: d6b71f0c
Aug  6 23:44:37 stratum kernel: ds: 007b   es: 007b   ss: 0068
Aug  6 23:44:37 stratum kernel: Process usb (pid: 1257, threadinfo=d6b7
task=d0fb3000)
Aug  6 23:44:37 stratum kernel: Stack: d6b71f0c dda96004 dda96008 dcc6f098
d6b71f38 c02ddf4d d6b99004 2000
Aug  6 23:44:37 stratum kernel:d137 1137 dda96004 d6b71f50
c02de04f dda96004 0077 d113f004
Aug  6 23:44:37 stratum kernel:dffe61dc d6b71f70 c016aa7b dcc6f098
d113f004 dd86d004 d113f004 d1045004
Aug  6 23:44:37 stratum kernel: Call Trace:
Aug  6 23:44:37 stratum kernel:  [c02ddf4d] usblp_cleanup+0x43/0xa2
Aug  6 23:44:37 stratum kernel:  [c02de04f] usblp_release+0x6b/0x6d
Aug  6 23:44:37 stratum kernel:  [c016aa7b] __fput+0xb5/0xc4
Aug  6 23:44:37 stratum kernel:  [c0168c09] filp_close+0x4b/0x74
Aug  6 23:44:37 stratum kernel:  [c0168d35] sys_close+0x103/0x226
Aug  6 23:44:37 stratum kernel:  [c0169b05] sys_read+0x3f/0x5d
Aug  6 23:44:37 stratum kernel:  [c010a07d] sysenter_past_esp+0x52/0x71
Aug  6 23:44:37 stratum kernel:
Aug  6 23:44:37 stratum kernel: Code: 8b 90 e0 00 00 00 85 d2 74 0e 8b 4a 20
85 c9 74 07 8b 41 18

--- [2]
$ vmstat 1
   procs  memory  swap  io system 
cpu
 r  b  w   swpd   free   buff  cache   si   sobibo   incs us sy
id
 0  0  0  0 195816   9412 13072000   750   115 1197   469 14  6
80
 0  0  0  0 195816   9412 13072000 0 0 102048  0  1
99
 1  0  0  0 183144   9416 13084000 0 0 1006   408 56  7
37
 0  1  0  0 183080   9416 13084000 0 0 1970  1993 61  0
39
 1  0  0  0 183080   9424 13084000 0   384 2012  2092  0  8
92
 1  0  0  0 183096   9424 13084000 0 0 2018  2044  0  0
100
 1  0  0  0 183096   9424 13084000 0 0 2004  2026  1  0
99
 1  0  0  0 183096   9424 13084000 0 0 2021  2052  0  0
100
 1  0  0  0 183096   9424 13084000 0 0 2005  2022  0  1
99
 1  0  0  0 183096   9424 13084000 0 0 2020  2041  0  2
98
 1  0  0  0 183096   9432 13084000 020 2002  2049  1  5
94
 1  0  0  0 183096   9432 13084000 0 0 2020  2034  0  0
100
 1  0  0  0 183096   9432 13084000 0 0 2003  2032  0  1
99

  --- [test print job started]
  
  drivers/usb/class/usblp.c: usblp0: nonzero read/write bulk status
 received:
  -2
  drivers/usb/class/usblp.c: usblp0: error -110 reading printer status
  [last message repeated 216 times]
 
 Did it print at all?
 Could you please run this diagnostic patch?
 
   Regards
   Oliver

Re: [linux-usb-devel] Re: Comments/questions about the Gadget API

2003-08-14 Thread David Brownell
Alan Stern wrote:

Again, seems like NAK is the answer.  And the way to make the gadget stop
NAKing is to provide some data for it to deliver to the host:   submit
a request to that IN endpoint, with its data buffer.
If a STALL is the right response, then halt the endpoint.  Otherwise the
only non-error responses are to NAK, or to provide the requested DATA.


What if STALL is only temporarily the right response?  That is, the gadget 
doesn't have any more data to send until the host gives it another 
command.  If the host tries to read more data, it should receive a STALL.  
So far as I understand, that's not part of the USB device model.


What happens if the host has sent all the data the gadget driver wants,
and is still sending more, has filled the FIFO, and is continuing to send
data?  It will wait while the gadget NAKs.  But the gadget driver won't
know what's going on and hence won't be able to HALT the endpoint, thereby
telling the host that the gadget won't accept any more.
If the host is sending more data, and the gadget driver doesn't expect it,
that's clearly a protocol error.  (While it's true that STALL generally means
there's an error, that's not the only kind of error...)

Probably the only answer to these problems will be to let the host timeout 
the transfer.
Yes.  In fact, having a FIFO there doesn't affect that answer at all.  In
both cases (IN, OUT), this is a host side protocol error, with the only
real fix being to get rid of that host side bug.
- Dave



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH] fixes for usb-skeleton.c

2003-08-14 Thread Michal Sojka
Hello,

I've found minor errors in usb-skeleton.c. First, there is no valid
value of interface-minor in assignment to dev-minor. Second, when
calling usb_deregister_dev the interface-minor must be valid or else
minor isn't deregistered.
  Michal Sojka

diff -ur linux-2.6.0-test2/drivers/usb/usb-skeleton.c 
edited-2.6.0-test2/drivers/usb/usb-skeleton.c
--- linux-2.6.0-test2/drivers/usb/usb-skeleton.c2003-08-06 11:23:13.936918128 
+0200
+++ edited-2.6.0-test2/drivers/usb/usb-skeleton.c   2003-08-06 11:20:34.0 
+0200
@@ -526,7 +526,6 @@
init_MUTEX (dev-sem);
dev-udev = udev;
dev-interface = interface;
-   dev-minor = interface-minor;
 
/* set up the endpoint information */
/* check out the endpoints */
@@ -606,6 +605,7 @@
goto error;
}
 
+   dev-minor = interface-minor;
 
/* let the user know what node this device is now attached to */
info (USB Skeleton device now attached to USBSkel-%d, dev-minor);
@@ -641,9 +641,6 @@
 
down (dev-sem);
 
-   /* disable open() */
-   interface-minor = -1;
-
minor = dev-minor;
 
/* give back our minor */



[linux-usb-devel] Re: [PATCH] More USB fixes for 2.6.0-test2

2003-08-14 Thread Greg KH
ChangeSet 1.1119.1.5, 2003/08/06 15:51:06-07:00, [EMAIL PROTECTED]

[PATCH] USB: remove GFP_DMA from pegasus

GFP_DMA has no place in USB drivers, as its meaning is inconsistent
across architectures.


 drivers/usb/net/pegasus.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


diff -Nru a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c
--- a/drivers/usb/net/pegasus.c Fri Aug  8 17:05:59 2003
+++ b/drivers/usb/net/pegasus.c Fri Aug  8 17:05:59 2003
@@ -121,7 +121,7 @@
char *buffer;
DECLARE_WAITQUEUE(wait, current);
 
-   buffer = kmalloc(size, GFP_DMA);
+   buffer = kmalloc(size, GFP_KERNEL);
if (!buffer) {
warn(%s: looks like we're out of memory, __FUNCTION__);
return -ENOMEM;
@@ -170,7 +170,7 @@
char *buffer;
DECLARE_WAITQUEUE(wait, current);
 
-   buffer = kmalloc(size, GFP_DMA);
+   buffer = kmalloc(size, GFP_KERNEL);
if (!buffer) {
warn(%s: looks like we're out of memory, __FUNCTION__);
return -ENOMEM;
@@ -218,7 +218,7 @@
char *tmp;
DECLARE_WAITQUEUE(wait, current);
 
-   tmp = kmalloc(1, GFP_DMA);
+   tmp = kmalloc(1, GFP_KERNEL);
if (!tmp) {
warn(%s: looks like we're out of memory, __FUNCTION__);
return -ENOMEM;



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] use of __devinit in st5481

2003-08-14 Thread Greg KH
On Wed, Aug 06, 2003 at 08:35:06PM +0200, Oliver Neukum wrote:
 
  But you CAN NOT mark the usb_device_id table as __devinitdata or
  __initdata as that will be touched later on if a new USB device is
  added, or if a new usb module is loaded.
 
 So these need to go.

Applied, thanks.

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Log message from 2.6.0-test2

2003-08-14 Thread Tvrtko A. Urulin

Aug  7 17:14:35 oxygene kernel: usb-storage: This device (0781,0002,0009 S 06 
P 50) has unneeded SubClass and Protocol entries in unusual_devs.h
Aug  7 17:14:35 oxygene kernel:Please send a copy of this message to 
[EMAIL PROTECTED]

Also, read/write ops on this device are _much_ slower than with 2.4.21.



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: My report on running 2.6.0-test2 on a Dell Inspiron 7000 (lost USB mouse)

2003-08-14 Thread Greg KH
On Wed, Aug 06, 2003 at 03:03:37AM -0700, Paul Dickson wrote:
 On Wed, 6 Aug 2003 02:16:21 -0700, Paul Dickson wrote:
 
  But all is not perfect.  I'll attach the problems I had as replies (so
  each has it's own message thread).
 
 After spending the day visiting relatives, I came back to the notebook and
 put something down nearby.  I then went away for a moment and upon
 returning discovered the screen unblanked but the mouse not functioning. 
 Flipping workspaces relieved my fear that 2.6.0-test2 had crashed, but
 still no mouse.
 
 So I decided to unplug and replug in the mouse (its USB after all).
 
 This allowed the mouse to function again.
 
 This is what was recorded in the message log:

Known issue.  Is fixed in Linus's latest tree.  If this still shows up
in 2.6.0-test3, please let us know.

thanks,

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] More USB fixes for 2.6.0-test2

2003-08-14 Thread Greg KH
ChangeSet 1.1119.1.3, 2003/08/06 15:50:39-07:00, [EMAIL PROTECTED]

[PATCH] USB: ohci-hcd, minor d3cold resume fix

The ohci d3cold resume path kept re-creating the sysfs files,
and that seemed eventually to cause an oops.  This patch
only creates them on first initialization, not re-init;
and includes some minor debug message tweaks.


 drivers/usb/host/ohci-hcd.c|4 +---
 drivers/usb/host/ohci-pci.c|   11 +--
 drivers/usb/host/ohci-sa.c |1 +
 3 files changed, 7 insertions(+), 9 deletions(-)


diff -Nru a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
--- a/drivers/usb/host/ohci-hcd.c   Fri Aug  8 17:06:17 2003
+++ b/drivers/usb/host/ohci-hcd.c   Fri Aug  8 17:06:17 2003
@@ -412,8 +412,7 @@
/* Disable HC interrupts */
writel (OHCI_INTR_MIE, ohci-regs-intrdisable);
 
-   ohci_dbg (ohci, USB HC reset_hc %s: ctrl = 0x%x ;\n,
-   hcd_to_bus (ohci-hcd)-bus_name,
+   ohci_dbg (ohci, reset, control = 0x%x\n,
readl (ohci-regs-control));
 
/* Reset USB (needed by some controllers); RemoteWakeupConnected
@@ -548,7 +547,6 @@
return -ENODEV;
}
 
-   create_debug_files (ohci);
return 0;
 }
 
diff -Nru a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c
--- a/drivers/usb/host/ohci-pci.c   Fri Aug  8 17:06:17 2003
+++ b/drivers/usb/host/ohci-pci.c   Fri Aug  8 17:06:17 2003
@@ -101,6 +101,7 @@
ohci_stop (hcd);
return -EBUSY;
}
+   create_debug_files (ohci);
 
 #ifdef DEBUG
ohci_dump (ohci, 1);
@@ -115,6 +116,7 @@
struct ohci_hcd *ohci = hcd_to_ohci (hcd);
unsigned long   flags;
u16 cmd;
+   u32 tmp;
 
if ((ohci-hc_control  OHCI_CTRL_HCFS) != OHCI_USB_OPER) {
ohci_dbg (ohci, can't suspend (state is %s)\n,
@@ -156,15 +158,12 @@
(void) readl (ohci-regs-control);
mdelay (500); /* No schedule here ! */
 
-   switch (readl (ohci-regs-control)  OHCI_CTRL_HCFS) {
+   tmp = readl (ohci-regs-control) | OHCI_CTRL_HCFS;
+   switch (tmp) {
case OHCI_USB_RESET:
-   ohci_dbg (ohci, suspend-reset ?\n);
-   break;
case OHCI_USB_RESUME:
-   ohci_dbg (ohci, suspend-resume ?\n);
-   break;
case OHCI_USB_OPER:
-   ohci_dbg (ohci, suspend-operational ?\n);
+   ohci_err (ohci, can't suspend; hcfs %d\n, tmp);
break;
case OHCI_USB_SUSPEND:
ohci_dbg (ohci, suspended\n);
diff -Nru a/drivers/usb/host/ohci-sa.c b/drivers/usb/host/ohci-sa.c
--- a/drivers/usb/host/ohci-sa.cFri Aug  8 17:06:17 2003
+++ b/drivers/usb/host/ohci-sa.cFri Aug  8 17:06:17 2003
@@ -296,6 +296,7 @@
ohci_stop (hcd);
return -EBUSY;
}
+   create_debug_files (ohci);
 
 #ifdef DEBUG
ohci_dump (ohci, 1);



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH]remove GFP_DMA from pegasus

2003-08-14 Thread Petko Manolov
On Wed, 6 Aug 2003, Oliver Neukum wrote:

 GFP_DMA has no place in USB drivers, as its meaning is inconsistent
 across architectures.

The patch looks ok to me, although GFP_DMA used to mean that the allocated
memory will be contiguous and taken from the dma-able memory.  If this is
no longer needed then it's better if GFP_DMA go away.


Petko


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Re: Comments/questions about the Gadget API

2003-08-14 Thread Oliver Neukum

   Halt endpoints by doing a wrong direction I/O ... read from an IN endpoint
   (instead of writing to the host), or write to an OUT endpoint (instead of
   reading what it wrote).  This idiom avoids use of ioctls, and makes use
   of a code path that would otherwise just return an error.
  
  That is worse than an ioctl.
 
 No.
 
  Read and write should transfer data, not change status of an io channel.
 
 Sounds like a valid thing for a special purpose fs to do (is simple, and
 can be done in any language, and doesn't require special thunking ioctl
 layer.)

That depends on whether you want to design a clean API, or you are
driven by avoiding ioctl, which is a valid part of the Unix API, at all cost
and your overriding concern are shell scripts.

You are treating write like ioctl. Using the syscall actually designed
for this is the clean solution. Write writes data, that's what it is meant
for.

Regards
Oliver



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Re: Comments/questions about the Gadget API

2003-08-14 Thread David Brownell
Oliver Neukum wrote:

Think of it instead as portability.  The main barrier to being
able to use this should be knowing USB -- not whether your
chosen programming environment supports POSIX-specific APIs.
Remember that _today_ you can write fully realistic user mode
gadget drivers in C, C++, Python, Java, and other languages
(including BASH!).  Not all of those have, or want, ioctl().


Firstly, you are unlikely to see gadgetfs ported to anything that
doesn't have ioctl.
Reread the above.  It's _already_ usable in several such
programming environments.  Didn't need porting.
- Dave





---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH]catc dma coherency fix

2003-08-14 Thread Oliver Neukum
Hi,

this fixes the coherency problems in catc.

Regards
Oliver

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===


[EMAIL PROTECTED], 2003-08-05 19:49:14+02:00, [EMAIL PROTECTED]
  - fix dma cache coherency issues


 catc.c |   97 +++--
 1 files changed, 59 insertions(+), 38 deletions(-)


diff -Nru a/drivers/usb/net/catc.c b/drivers/usb/net/catc.c
--- a/drivers/usb/net/catc.cTue Aug  5 19:49:57 2003
+++ b/drivers/usb/net/catc.cTue Aug  5 19:49:57 2003
@@ -7,7 +7,7 @@
  *
  *  Based on the work of
  * Donald Becker
- * 
+ *
  *  Old chipset support added by Simon Evans [EMAIL PROTECTED] 2002
  *- adds support for Belkin F5U011
  */
@@ -15,18 +15,18 @@
 /*
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or 
+ * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- * 
+ *
  * Should you need to contact me, the author, you can do so either by
  * e-mail - mail your message to [EMAIL PROTECTED], or by paper mail:
  * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
@@ -67,7 +67,7 @@
 
 /*
  * Some defines.
- */ 
+ */
 
 #define STATS_UPDATE   (HZ)/* Time between stats updates */
 #define TX_TIMEOUT (5*HZ)  /* Max time the queue can be stopped */
@@ -172,8 +172,8 @@
 
u8 tx_buf[2][TX_MAX_BURST * (PKT_SZ + 2)];
u8 rx_buf[RX_MAX_BURST * (PKT_SZ + 2)];
-   u8 irq_buf[2];
-   u8 ctrl_buf[64];
+   u8 * irq_buf;
+   u8 * ctrl_buf;//[64];
struct usb_ctrlrequest ctrl_dr;
 
struct timer_list timer;
@@ -637,7 +637,7 @@
if (netdev-flags  IFF_PROMISC) {
memset(catc-multicast, 0xff, 64);
rx |= (!catc-is_f5u011) ? RxPromisc : AltRxPromisc;
-   } 
+   }
 
if (netdev-flags  IFF_ALLMULTI) {
memset(catc-multicast, 0xff, 64);
@@ -671,7 +671,7 @@
 {
 struct catc *catc = dev-priv;
 u32 cmd;
-
+
 if (get_user(cmd, (u32 *)useraddr))
 return -EFAULT;
 
@@ -690,17 +690,17 @@
/* get settings */
case ETHTOOL_GSET:
if (catc-is_f5u011) {
-   struct ethtool_cmd ecmd = { ETHTOOL_GSET, 
-   SUPPORTED_10baseT_Half | 
SUPPORTED_TP, 
-   ADVERTISED_10baseT_Half | 
ADVERTISED_TP, 
-   SPEED_10, 
-   DUPLEX_HALF, 
-   PORT_TP, 
-   0, 
-   XCVR_INTERNAL, 
-   AUTONEG_DISABLE, 
-   1, 
-   1 
+   struct ethtool_cmd ecmd = { ETHTOOL_GSET,
+   SUPPORTED_10baseT_Half | 
SUPPORTED_TP,
+   ADVERTISED_10baseT_Half | 
ADVERTISED_TP,
+   SPEED_10,
+   DUPLEX_HALF,
+   PORT_TP,
+   0,
+   XCVR_INTERNAL,
+   AUTONEG_DISABLE,
+   1,
+   1
};
if (copy_to_user(useraddr, ecmd, sizeof(ecmd)))
return -EFAULT;
@@ -718,7 +718,7 @@
 return 0;
 }
}
-
+
 return -EOPNOTSUPP;
 }
 
@@ -797,8 +797,23 @@
 
memset(catc, 0, sizeof(struct catc));
 
+   catc-irq_buf = kmalloc(2, GFP_KERNEL);
+   if (!catc-irq_buf) {
+   kfree(catc);
+   return -ENOMEM;
+ 

[linux-usb-devel] Re: drivers folded into usbnet

2003-08-14 Thread David Brownell
Oliver Neukum wrote:
Hi David,

which drivers have you incorporated into usbnet?
Only the ones that there now.  The recent additions
have been the Zaurus models, and CDC Ethernet.
David Hollis has also started to look at merging in
the ax8817x support, net saving about 1500 LOC (his
estimate) and gaining various features, but that's
not usable yet.
If very many drivers start to build on that same
core framework -- which I think is probably very
reasonable, since the critical bulk queueing
paths are almost identical -- we'll want to be
able to modularize the minidrivers on top of
taht core, much like Greg did with usb-serial.

More specifically is catc.c worth fixing with respect
to dma coherency?
I'm not sure what you mean.  It could avoid memcpy()
and do DMA right from the skb data, but that's not
in itself a dma coherency issue.
- Dave



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [patch 2.6.0-test2] usb_start_wait_urb() rewrite

2003-08-14 Thread Oliver Neukum
Am Samstag, 9. August 2003 02:04 schrieb David Brownell:
 The code that manges the synchronous control/bulk calls has
 been a mess for ages.  This patch rewrites it using:
 
   - struct completion instead of a usb-internal clone therof,
   - prepare_to_wait()/finish_wait() instead of the tangled
 mess it now uses (or a new wait_event_timeout call, as in
 previous versions of this patch).

If you don't want wait_event_timeout, it seems to me that only
struct completion should be used like this:

 message.c |   76 --
 1 files changed, 35 insertions(+), 41 deletions(-)


diff -Nru a/drivers/usb/core/message.c b/drivers/usb/core/message.c
--- a/drivers/usb/core/message.cSat Aug  9 10:15:31 2003
+++ b/drivers/usb/core/message.cSat Aug  9 10:15:31 2003
@@ -16,77 +16,71 @@
 #include linux/slab.h
 #include linux/init.h
 #include linux/mm.h
+#include linux/timer.h
 #include asm/byteorder.h
 
 #include hcd.h   /* for usbcore internals */
 #include usb.h
 
 struct usb_api_data {
-   wait_queue_head_t wqh;
-   int done;
+   struct completion cpl;
+   int timeout;
 };
 
 static void usb_api_blocking_completion(struct urb *urb, struct pt_regs *regs)
 {
-   struct usb_api_data *awd = (struct usb_api_data *)urb-context;
+   struct usb_api_data *ct = (struct usb_api_data *)urb-context;
+   
+   ct-timeout = (urb-status == -ECONNRESET);
+   complete(ct-cpl);
+}
+
 
-   awd-done = 1;
-   wmb();
-   wake_up(awd-wqh);
+static void timeout_kill (unsigned long d)
+{
+   struct urb *u = (struct urb *)d;
+   
+   usb_unlink_urb(u);
 }
 
 // Starts urb and waits for completion or timeout
 static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length)
 { 
-   DECLARE_WAITQUEUE(wait, current);
struct usb_api_data awd;
+   struct timer_list timeout_killer;
int status;
 
-   init_waitqueue_head(awd.wqh);  
-   awd.done = 0;
-
-   set_current_state(TASK_UNINTERRUPTIBLE);
-   add_wait_queue(awd.wqh, wait);
+   init_completion(awd.cpl);  
 
urb-context = awd;
-   status = usb_submit_urb(urb, GFP_ATOMIC);
-   if (status) {
-   // something went wrong
-   usb_free_urb(urb);
-   set_current_state(TASK_RUNNING);
-   remove_wait_queue(awd.wqh, wait);
-   return status;
-   }
+   urb-transfer_flags |= URB_ASYNC_UNLINK;
+   status = usb_submit_urb(urb, GFP_NOIO);
+   if (status)
+   goto out_err;
+   
+   init_timer(timeout_killer);
+   timeout_killer.expires = jiffies + (timeout ? timeout : MAX_SCHEDULE_TIMEOUT);
+   timeout_killer.data = (unsigned long)urb;
+   timeout_killer.function = timeout_kill;
+   add_timer(timeout_killer);
 
-   while (timeout  !awd.done)
-   {
-   timeout = schedule_timeout(timeout);
-   set_current_state(TASK_UNINTERRUPTIBLE);
-   rmb();
-   }
+   wait_for_completion(awd.cpl);
 
-   set_current_state(TASK_RUNNING);
-   remove_wait_queue(awd.wqh, wait);
+   del_timer_sync(timeout_killer);
 
-   if (!timeout  !awd.done) {
-   if (urb-status != -EINPROGRESS) {  /* No callback?!! */
-   printk(KERN_ERR usb: raced timeout, 
-   pipe 0x%x status %d time left %d\n,
-   urb-pipe, urb-status, timeout);
-   status = urb-status;
-   } else {
-   warn(usb_control/bulk_msg: timeout);
-   usb_unlink_urb(urb);  // remove urb safely
-   status = -ETIMEDOUT;
-   }
-   } else
+   if (!awd.timeout) {
status = urb-status;
+   } else {
+   warn(usb_control/bulk_msg: timeout);
+   status = -ETIMEDOUT;
+   }
 
if (actual_length)
*actual_length = urb-actual_length;
 
+out_err:
usb_free_urb(urb);
-   return status;
+   return status;
 }
 
 /*---*/



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Newbie: tarballs, 2.6 and building a driver

2003-08-14 Thread Alan Cox
On Iau, 2003-08-07 at 20:33, Simon Block wrote:
 I need to extract the kernel tarball to my home directory for development.
 Where is the kernel tarball? I presume it is a kernel-xxx-xx-xx.tar.Z type
 file? I have the RedHat 9 disks so I presume it is on one of them or on my
 system already?

The kernel src.rpm file contains a base kernel tarball and then all the
Red Hat patches applied to that kernel. The kernel-src i386 rpm drops a
set of kernel headers matching the build into /usr/src/linux/.. so you
can build other modules

For Red Hat Doug Ledford has a device driver building kit



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Re: 2.6-test3 compusa USB optical mouse

2003-08-14 Thread David Brownell
Warren Togami wrote:

More useful information would come from modifying that
usb_set_configuration() diagnostic (message.c) to also
call usb_show_device(dev).
If indeed that device has illegal descriptors, it might
be a good idea to make Linux explicitly allow that case.


Please suggest patches and procedures for me to do in order to collect
the necessary information.
You mean, in more detail than I already did?

I won't send information saying how to apply patches, build
kernels, install them, etc; that's widely available.  But
here's the diagnostic patch I described.  Apply, run; and
send the resulting kernel messages.
- Dave



= drivers/usb/core/message.c 1.34 vs edited =
--- 1.34/drivers/usb/core/message.c Mon Aug 11 07:56:25 2003
+++ edited/drivers/usb/core/message.c   Tue Aug 12 07:54:19 2003
@@ -1055,6 +1055,7 @@
}
if ((!cp  configuration != 0) || (cp  configuration == 0)) {
warn(selecting invalid configuration %d, configuration);
+   usb_show_device(dev);
return -EINVAL;
}
 


[linux-usb-devel] Newbie: tarballs, 2.6 and building a driver

2003-08-14 Thread Simon Block
Hi All,

I'm new to building Linux drivers but not new to device drivers, o I need
some specific help for the RedHat platform. I have RH 9 (2.4) installed and
setup for driver development. I have all the CD's.

I need to extract the kernel tarball to my home directory for development.
Where is the kernel tarball? I presume it is a kernel-xxx-xx-xx.tar.Z type
file? I have the RedHat 9 disks so I presume it is on one of them or on my
system already?

I have worked out how to build the drivers tree I think and I discovered the
binaries under the /lib directory. Once I have my driver's source code under
my own directory under usb/serial, how do I build it? Do I have to go and
add an entry for it to all the Makefiles and configuration files or can I
just write a Makefile for my single driver? Does someone have a development
Makefile for this purpose?

Ok, how do I go about getting 2.6 kernel? The auto-update application thingy
in RH gives me the option to update the kernel and sources to a later
version of 2.4, but not 2.6. I guess version 2.6 is still experimental? 

How can I update the kernel and sources? Will this overwrite the sources in
/usr/src or add another directory and symbolically link to it? Will there be
a tarball somewhere I can then use to build my own development directory
from the 2.6 kernel?

Cheers and thanks for any help!

SAB.

 



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH]return to old timeout handling

2003-08-14 Thread Daniel Blueman
Haha...yea, I guess some things are like this.

Maybe, it's just that the timing contraints for the USB stack may be a
little tight for this printer's USB implementation, so parts of the stack _rely_
on having to retry to get the data through?

Dan

 Am Sonntag, 10. August 2003 14:08 schrieb Daniel Blueman:
  Thanks Oliver - I can confirm this patch does fix printing...excellent!
 
 Now I wish I'd understand why they work.
 
   Regards
   Oliver
 

-- 
Daniel J Blueman

COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Developing an USB driver

2003-08-14 Thread Brad Hards
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Wed, 6 Aug 2003 07:39 am, Fernando hualpa wrote:
 I am writing you because I want to develop a driver
 that manages the communication between 2 computers
 using a bidireccional usb 1.0 cable, but i the usb
 documentation I have read I find how to write driver
 that connect usb ports to devices but not between 2
 computers unsing only their respective usb ports. I
 would appreciate any guiadance on this.
Many of the cables are already supported - who makes the one you have?
If you need to add one, look at the latest usbnet code, which provides much 
of the infrastructure you'll need.

Brad
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE/MO3iW6pHgIdAuOMRAr3aAJ0d7EImYOXSP1Lm7RA8jyxm88F01gCgrT1S
Byo0OzF2c8OUnLT5z34FxZg=
=HpAk
-END PGP SIGNATURE-


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] synchronous ops with urbs

2003-08-14 Thread David Brownell
David Brownell wrote:
There's another wait/synchronize primitive that
I found at one point, I think the block layer
used it, which involved a bit less inlined code
and didn't necessarily require everything to be
interruptible.  I lost track of it though.
Found it again, also in linux/wait.h:

  prepare_to_wait(..., TASK_{UN,}INTERRUPTIBLE);
  ... do stuff
  finish_wait(...);
The stuff can include schedule_timeout() and so on.

- Dave



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH] More USB fixes for 2.6.0-test2

2003-08-14 Thread Greg KH
ChangeSet 1.1119.1.1, 2003/08/06 13:40:52-07:00, [EMAIL PROTECTED]

[PATCH] USB: remove some vendor specific stuff from the pl2303 driver to get other 
devices to work.


 drivers/usb/serial/pl2303.c |9 -
 1 files changed, 9 deletions(-)


diff -Nru a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
--- a/drivers/usb/serial/pl2303.c   Fri Aug  8 17:06:30 2003
+++ b/drivers/usb/serial/pl2303.c   Fri Aug  8 17:06:30 2003
@@ -285,12 +285,6 @@
 buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
 
 
-   i = usb_control_msg (serial-dev, usb_sndctrlpipe (serial-dev, 0),
-VENDOR_WRITE_REQUEST, VENDOR_WRITE_REQUEST_TYPE,
-0, 1, NULL, 0, 100);
-
-   dbg (0x40:1:0:1  %d, i);
-
if (cflag  CSIZE) {
switch (cflag  CSIZE) {
case CS5:   buf[6] = 5; break;
@@ -428,9 +422,6 @@
SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0x0404, 1);
FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0);
FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8383, 0);
-   SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0, 1);
-   SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 1, 0xc0);
-   SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 2, 4);
 
/* Setup termios */
if (port-tty) {



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Fwd: PROBLEM: EHCI Driver hard-locks systemwhen USB devices plugged. (2.4.21 2.6.0-test2)

2003-08-14 Thread Alexander Markley
Somebody tipped me off to continue this bug report on linux-usb-devel. 
If you guys need another copy of the original bug report, let me know.

 Then there's also the USB FAQ, which tells you among other things
 that we need to know about the device being plugged in ... in your
It doesn't matter what device I plug in. The devices work in other 
machines, in this machine running windows, and in this machine running 
linux with EHCI disabled.

When you plug your device into a USB port with just the UHCI driver
loaded, does it work?  If so, make your bug report include
/proc/bus/usb/devices output.
Aye, the devices work like a charm with UHCI only.

[EMAIL PROTECTED] alex]# cat /proc/bus/usb/devices
T:  Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=118/900 us (13%), #Int=  1, #Iso=  0
D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor= ProdID= Rev= 0.00
S:  Product=USB UHCI Root Hub
S:  SerialNumber=dc00
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms
T:  Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=047b ProdID=0001 Rev= 1.21
S:  Manufacturer=SILITEK
S:  Product=USB Keyboard
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 50mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=hid
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=24ms
T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor= ProdID= Rev= 0.00
S:  Product=USB UHCI Root Hub
S:  SerialNumber=d800
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms
T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor= ProdID= Rev= 0.00
S:  Product=USB UHCI Root Hub
S:  SerialNumber=d400
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms
[EMAIL PROTECTED] alex]#
^^^ That is my current, minimal USB setup. As you can see, the only 
device is the keyboard that I am currently typing on. If I enable EHCI, 
the kernel won't boot! If I unplug the keyboard (and all other USB 
devices), it will boot, but will crash as soon as I plug it back in.

 try the usual:  boot with pci=noacpi or acpi=off, disable
 APIC usage, etc.
Umm, did you mean ACPI? If so, that is already disabled.

 What'd be ideal then is to build your kernel with CONFIG_USB_DEBUG

It is already built in.

The boot messages that I copied down were from a formerly-booting, 
suddenly-crashed kernel with CONFIG_USB_DEBUG turned on.

 and use some console other than X11 so you can collect more information.

X had not come up by the time the kernel crashed. (Neither had the 
partitions mounted, or anything else that normally happens after EHCI 
loads.)

 such a problem without knowing basics like whether this was an oops
 or some other kind of problem.
The boot-time text console reflects no fatal errors or warnings.

 Don't use 2.4.21 EHCI; use at least 2.4.22-pre1.

This problem also occurs with 2.6.0-test2. However, I will download 
2.4.22-whateverisnewest overnight tonight.

TIA

--Alex



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Re: [PATCH] More USB fixes for 2.6.0-test2

2003-08-14 Thread Alan Cox
On Sad, 2003-08-09 at 01:15, Greg KH wrote:
 ChangeSet 1.1119.1.9, 2003/08/06 15:51:53-07:00, [EMAIL PROTECTED]
 
 [PATCH] USB: use of __devinit in st5481
 
  But you CAN NOT mark the usb_device_id table as __devinitdata or
  __initdata as that will be touched later on if a new USB device is
  added, or if a new usb module is loaded.
 
 So these need to go.
 
   - remove __devinit from anything called from probe()

Please explain why - __devinit is not deleted if anything hot pluggable
is present. Surely USB implies hot pluggability otherwise you may hit 
__devinit code elsewhere in the system when you try and do stuff like
remove devices ?



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] usb-storage: WIN_SECURITY_UNLOCK

2003-08-14 Thread Andries Brouwer
On Sat, Aug 09, 2003 at 02:00:06PM +0100, Phoenix wrote:

 Is it possible to send ATAPI commands to usb-storage hard-disks, like
 WIN_SECURITY_UNLOCK, through the scsi inteface?
 
 I have an ALI5621 chipset that supports SCSI transparent command set
 only and I didn't find anything in SCSI-2 that is related to the ATAPI
 security features.

I think the general answer will be No.

A similar question is whether ide-floppy is superfluous and one can
do everything via ide-scsi. Again I think the answer will be No.

Indeed, ide-scsi uses the Packet command A0 of ATAPI to send
SCSI command packets to the ATAPI device. But there is no reason
to expect that all ATAPI commands are covered this way.
The first example is already A1: IDENTIFY PACKET DEVICE.
SCSI has INQUIRY, but that is not the same.

I have some ancient patches to ide-floppy.c that allow one
to switch an Iomega ZIP drive between large floppy and removable disk.
I do not know of a way to send these same commands via ide-scsi.

Andries



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] use of __devinit in st5481

2003-08-14 Thread Alan Stern
On Wed, 6 Aug 2003, Soewono Effendi wrote:

 As far as I understand, __init / __devinit is only relevant for device
 driver (codes) that are statically linked. In the case of USB Device
 Driver (not usbcore / usbhost ), one should actually not use
 __init/__devinit, since USB probe can happen at any time, unless the
 device is static, i.e., not unplugable (I don't know if this word does
 exist :) ).

From Documentation/pci.txt:

Please mark the initialization and cleanup functions where appropriate
(the corresponding macros are defined in linux/init.h):

__init  Initialization code. Thrown away after the driver
initializes.
__exit  Exit code. Ignored for non-modular drivers.
__devinit   Device initialization code. Identical to __init if
the kernel is not compiled with CONFIG_HOTPLUG, normal
function otherwise.
__devexit   The same for __exit.

Tips:
The module_init()/module_exit() functions (and all initialization
functions called only from these) should be marked __init/exit.
The struct pci_driver shouldn't be marked with any of these tags.
The ID table array should be marked __devinitdata.
The probe() and remove() functions (and all initialization
functions called only from these) should be marked __devinit/exit.
If you are sure the driver is not a hotplug driver then use only 
__init/exit __initdata/exitdata.

Pointers to functions marked as __devexit must be created using
__devexit_p(function_name).  That will generate the function
name or NULL if the __devexit function will be discarded.


The upshot is that for USB, which is hotpluggable, __devinit and __devexit 
are useless.  __init and __exit should be used for module initialization 
and removal routines, not for probing and disconnecting.

Alan Stern



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Re: [usb-storage] Re: Linux 2.4.22-rc1

2003-08-14 Thread Fridtjof Busse
* David Brownell [EMAIL PROTECTED]:
  Drive is connected to PCI device 10de:0068 (nVidia Corporation)

 Doesn't look like it.  There was no storage device in what you sent.

OK, today I'm much more awake...
So here's plain -rc2:

interrupts:
  3:  4  XT-PIC  ehci_hcd
 10: 93  XT-PIC  usb-ohci
 11: 13  XT-PIC  usb-ohci, eth0

lspci:
00:02.0 USB Controller: nVidia Corporation nForce2 USB Controller (rev 
a3) (prog-if 10 [OHCI])
Subsystem: Holco Enterprise Co, Ltd/Shuttle Computer: Unknown device 
f541
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz+ UDF- FastB2B+ ParErr- DEVSEL=fast TAbort- TAbort- 
MAbort- SERR- PERR-
Latency: 0 (750ns min, 250ns max)
Interrupt: pin A routed to IRQ 10
Region 0: Memory at ee086000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [44] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA 
PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:02.1 USB Controller: nVidia Corporation nForce2 USB Controller (rev 
a3) (prog-if 10 [OHCI])
Subsystem: Holco Enterprise Co, Ltd/Shuttle Computer: Unknown device 
f541
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz+ UDF- FastB2B+ ParErr- DEVSEL=fast TAbort- TAbort- 
MAbort- SERR- PERR-
Latency: 0 (750ns min, 250ns max)
Interrupt: pin B routed to IRQ 11
Region 0: Memory at ee082000 (32-bit, non-prefetchable) [size=4K]
Capabilities: [44] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA 
PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:02.2 USB Controller: nVidia Corporation nForce2 USB Controller (rev 
a3) (prog-if 20 [EHCI])
Subsystem: Holco Enterprise Co, Ltd/Shuttle Computer: Unknown device 
f541
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B-
Status: Cap+ 66Mhz+ UDF- FastB2B+ ParErr- DEVSEL=fast TAbort- TAbort- 
MAbort- SERR- PERR-
Latency: 0 (750ns min, 250ns max)
Interrupt: pin C routed to IRQ 3
Region 0: Memory at ee085000 (32-bit, non-prefetchable) [size=256]
Capabilities: [44] #0a [2080]
Capabilities: [80] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA 
PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-


dmesg (plug-in, mount, dump):
Aug 11 07:49:05 artus kernel: ehci_hcd 00:02.2: GetStatus port 1 status 
003802 POWER OWNER sig=j  CSC
Aug 11 07:49:05 artus kernel: hub.c: port 1, portstatus 0, change 1, 12 
Mb/s
Aug 11 07:49:05 artus kernel: hub.c: port 1 connection change
Aug 11 07:49:05 artus kernel: hub.c: port 1, portstatus 0, change 1, 12 
Mb/s
Aug 11 07:49:05 artus kernel: ehci_hcd 00:02.2: GetStatus port 2 status 
001803 POWER sig=j  CSC CONNECT
Aug 11 07:49:05 artus kernel: hub.c: port 2, portstatus 501, change 1, 
480 Mb/s
Aug 11 07:49:05 artus kernel: hub.c: port 2 connection change
Aug 11 07:49:05 artus kernel: hub.c: port 2, portstatus 501, change 1, 
480 Mb/s
Aug 11 07:49:05 artus kernel: hub.c: port 2, portstatus 501, change 0, 
480 Mb/s
Aug 11 07:49:05 artus last message repeated 3 times
Aug 11 07:49:05 artus kernel: hub.c: port 2, portstatus 511, change 0, 
480 Mb/s
Aug 11 07:49:05 artus kernel: hub.c: port 2 of hub 1 not reset yet, 
waiting 10ms
Aug 11 07:49:05 artus kernel: hub.c: port 2, portstatus 511, change 0, 
480 Mb/s
Aug 11 07:49:05 artus kernel: hub.c: port 2 of hub 1 not reset yet, 
waiting 10ms
Aug 11 07:49:05 artus kernel: ehci_hcd 00:02.2: port 2 high speed
Aug 11 07:49:05 artus kernel: ehci_hcd 00:02.2: GetStatus port 2 status 
001005 POWER sig=se0  PE CONNECT
Aug 11 07:49:05 artus kernel: hub.c: port 2, portstatus 503, change 10, 
480 Mb/s
Aug 11 07:49:05 artus kernel: hub.c: new USB device 00:02.2-2, assigned 
address 4
Aug 11 07:49:05 artus kernel: usb.c: kmalloc IF deeb3400, numif 1
Aug 11 07:49:05 artus kernel: usb.c: new device strings: Mfr=0, 
Product=1, SerialNumber=0
Aug 11 07:49:05 artus kernel: usb.c: USB device number 4 default 
language ID 0x409
Aug 11 07:49:05 artus kernel: Product: USB TO IDE
Aug 11 07:49:05 artus kernel: scsi1 : SCSI emulation for USB Mass 
Storage devices
Aug 11 07:49:05 artus kernel:   Vendor: Maxtor 6  Model: Y120L0
Rev: 0811
Aug 11 07:49:05 artus kernel:   Type:   Direct-Access  
ANSI SCSI revision: 02
Aug 11 07:49:05 artus kernel: Attached scsi disk sda at scsi1, channel 
0, id 0, lun 0
Aug 11 07:49:05 artus kernel: SCSI device sda: 240121728 512-byte hdwr 
sectors (122942 MB)
Aug 11 07:49:05 artus kernel:  /dev/scsi/host1/bus0/target0/lun0: p1
Aug 11 07:49:05 artus kernel: WARNING: USB Mass Storage 

[linux-usb-devel] [PATCH] usb-2.4 and usb-2.5 - ftdi_sio - VID/PID for ID TECH IDT1221U USB to RS-232 adapter

2003-08-14 Thread Ian Abbott
Ehlo all,

These patches are against clones of Greg's usb-2.4 and usb-2.5 BK 
repositories.  It's the first time I've used BK, so I've probably 
done something wrong

Either patch should apply cleanly to either tree, but I've generated 
one for each, just in case.

This patch adds support for ID TECH's IDT1221U USB to RS-232 adapter 
(intended for use and/or supplied with some of their magnetic/smart 
card readers).  The VID and PID were provided by Steve Briggs on 
the ftdi-usb-sio-devel list.

-- 
-=( Ian Abbott @ MEV Ltd.E-mail: [EMAIL PROTECTED])=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587 )=-
# This is a BitKeeper generated patch for the following project:
# Project Name: greg k-h's linux 2.4 USB kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	   ChangeSet	1.1105  - 1.1106 
#	drivers/usb/serial/ftdi_sio.c	1.45- 1.46   
#	drivers/usb/serial/ftdi_sio.h	1.17- 1.18   
#
# The following is the BitKeeper ChangeSet Log
# 
# 03/08/05	[EMAIL PROTECTED]	1.1106
# Added VID/PID for ID TECH IDT1221U USB to RS-232 adapter.
# 
#
diff -Nru a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
--- a/drivers/usb/serial/ftdi_sio.c	Thu Aug  7 11:38:53 2003
+++ b/drivers/usb/serial/ftdi_sio.c	Thu Aug  7 11:38:54 2003
@@ -17,6 +17,10 @@
  * See http://ftdi-usb-sio.sourceforge.net for upto date testing info
  *	and extra documentation
  *
+ * (05/Aug/2003) Ian Abbott
+ *  Added VID/PID for ID TECH IDT1221U USB to RS-232 adapter.
+ *  VID/PID provided by Steve Briggs.
+ *
  * (23/Jul/2003) Ian Abbott
  *  Added PIDs for CrystalFontz 547, 633, 631, 635, 640 and 640 from
  *  Wayne Wylupski.
@@ -317,6 +321,7 @@
 	{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_6_PID, 0, 0x3ff) },
 	{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_7_PID, 0, 0x3ff) },
 	{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_8_PID, 0, 0x3ff) },
+	{ USB_DEVICE_VER(IDTECH_VID, IDTECH_IDT1221U_PID, 0, 0x3ff) },
 	{ }		/* Terminating entry */
 };
 
@@ -388,6 +393,7 @@
 	{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_6_PID, 0x400, 0x) },
 	{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_7_PID, 0x400, 0x) },
 	{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_8_PID, 0x400, 0x) },
+	{ USB_DEVICE_VER(IDTECH_VID, IDTECH_IDT1221U_PID, 0x400, 0x) },
 	{ }		/* Terminating entry */
 };
 
@@ -472,6 +478,7 @@
 	{ USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_6_PID) },
 	{ USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_7_PID) },
 	{ USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_8_PID) },
+	{ USB_DEVICE(IDTECH_VID, IDTECH_IDT1221U_PID) },
 	{ USB_DEVICE_VER(FTDI_VID, FTDI_HE_TIRA1_PID, 0x400, 0x) },
 	{ USB_DEVICE(FTDI_VID, FTDI_USB_UIRT_PID) },
 	{ }		/* Terminating entry */
diff -Nru a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
--- a/drivers/usb/serial/ftdi_sio.h	Thu Aug  7 11:38:54 2003
+++ b/drivers/usb/serial/ftdi_sio.h	Thu Aug  7 11:38:54 2003
@@ -127,6 +127,12 @@
 /* http://home.earthlink.net/~jrhees/USBUIRT/index.htm */
 #define FTDI_USB_UIRT_PID	0xF850	/* Product Id */
 
+/*
+ * Definitions for ID TECH (www.idt-net.com) devices
+ */
+#define IDTECH_VID		0x0ACD	/* ID TECH Vendor ID */
+#define IDTECH_IDT1221U_PID	0x0300	/* IDT1221U USB to RS-232 adapter */
+
 /* Commands */
 #define FTDI_SIO_RESET 		0 /* Reset the port */
 #define FTDI_SIO_MODEM_CTRL 	1 /* Set the modem control register */
# This is a BitKeeper generated patch for the following project:
# Project Name: greg k-h's linux 2.5 USB kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	   ChangeSet	1.2229  - 1.2230 
#	drivers/usb/serial/ftdi_sio.c	1.54- 1.55   
#	drivers/usb/serial/ftdi_sio.h	1.14- 1.15   
#
# The following is the BitKeeper ChangeSet Log
# 
# 03/08/07	[EMAIL PROTECTED]	1.2230
# Added VID/PID for ID TECH IDT1221U USB to RS-232 adapter.
# VID/PID provided by Steve Briggs.
# 
#
diff -Nru a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
--- a/drivers/usb/serial/ftdi_sio.c	Thu Aug  7 11:51:09 2003
+++ b/drivers/usb/serial/ftdi_sio.c	Thu Aug  7 11:51:09 2003
@@ -17,6 +17,10 @@
  * See http://ftdi-usb-sio.sourceforge.net for upto date testing info
  *	and extra documentation
  *
+ * (05/Aug/2003) Ian Abbott
+ *  Added VID/PID for ID TECH IDT1221U USB to RS-232 adapter.
+ *  VID/PID provided by Steve Briggs.
+ *
  * (23/Jul/2003) Ian Abbott
  *  Added PIDs for CrystalFontz 547, 633, 631, 635, 640 and 640 from
  *  Wayne Wylupski.
@@ -324,6 +328,7 @@
 	{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_6_PID, 0, 0x3ff) },
 	{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_7_PID, 0, 0x3ff) },
 	{ USB_DEVICE_VER(SEALEVEL_VID, 

[linux-usb-devel] Re: [PATCH] More USB fixes for 2.6.0-test2

2003-08-14 Thread Greg KH
ChangeSet 1.1119.1.9, 2003/08/06 15:51:53-07:00, [EMAIL PROTECTED]

[PATCH] USB: use of __devinit in st5481

 But you CAN NOT mark the usb_device_id table as __devinitdata or
 __initdata as that will be touched later on if a new USB device is
 added, or if a new usb module is loaded.

So these need to go.

  - remove __devinit from anything called from probe()


 drivers/isdn/hisax/st5481_b.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff -Nru a/drivers/isdn/hisax/st5481_b.c b/drivers/isdn/hisax/st5481_b.c
--- a/drivers/isdn/hisax/st5481_b.c Fri Aug  8 17:05:24 2003
+++ b/drivers/isdn/hisax/st5481_b.c Fri Aug  8 17:05:24 2003
@@ -245,7 +245,7 @@
}
 }
 
-static int __devinit st5481_setup_b_out(struct st5481_bcs *bcs)
+static int st5481_setup_b_out(struct st5481_bcs *bcs)
 {
struct usb_device *dev = bcs-adapter-usb_dev;
struct usb_host_interface *altsetting;
@@ -279,7 +279,7 @@
st5481_release_isocpipes(b_out-urb);
 }
 
-int __devinit st5481_setup_b(struct st5481_bcs *bcs)
+int st5481_setup_b(struct st5481_bcs *bcs)
 {
int retval;
 



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] USB mass storage stopped working in 2.6?

2003-08-14 Thread Alessandro Fiorino
I installed the 2.6 kernel to test it and I have some problems with the USB
mass storage driver: my external HD enclousure doesn't work anymore (the
device works perfectly with the 2.4.21 version).
My computer is an Acer TravelMate 521TE with an ALI USB 1.1 controller, the
device is an USB2 2.5 HD enclousure.
When I plug it the kernel detects it, but it gives a lots of errors and I
can't access the drive content.
I've tested it with the 2.6.0-test2 kernel version, attached there are the
lsusb output (from 2.4.21) for the device and the kernel log (compiled with
usb mass storage debug enabled).
Thank you in advance.
Alessandro Fiorino


Bus 001 Device 002: ID 05e3:0702 Genesys Logic, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 Interface
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x05e3 Genesys Logic, Inc.
idProduct 0x0702
bcdDevice 0.02
iManufacturer 0
iProduct 1 USB TO IDE
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 33
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 96mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 8 Mass Storage
bInterfaceSubClass 6 SCSI
bInterfaceProtocol 80 Bulk (Zip)
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type none
wMaxPacketSize 64
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type none
wMaxPacketSize 64
bInterval 0
junk at config descriptor end: 04
Language IDs: (length=4)
0409 English(US)

drivers/usb/core/usb.c: registered new driver usbfs
drivers/usb/core/usb.c: registered new driver hub
ohci-hcd: 2003 Feb 24 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
ohci-hcd: block sizes: ed 64 td 64
ohci-hcd :00:14.0: ALi Corporation USB 1.1 Controller
ohci-hcd :00:14.0: irq 11, pci mem cc824000
ohci-hcd :00:14.0: new USB bus registered, assigned bus number 1
hub 1-0:0: USB hub found
hub 1-0:0: 2 ports detected
drivers/usb/core/usb.c: registered new driver hiddev
drivers/usb/core/usb.c: registered new driver hid
drivers/usb/input/hid-core.c: v2.0:USB HID core driver
hub 1-0:0: debounce: port 1: delay 100ms stable 4 status 0x101
hub 1-0:0: new USB device on port 1, assigned address 2
Initializing USB Mass Storage driver...
usb-storage: USB Mass Storage device detected
usb-storage: act_altsetting is 0, id_index is 96
usb-storage: -- associate_dev
usb-storage: Transport: Bulk
usb-storage: Protocol: Transparent SCSI
usb-storage: Endpoints: In: 0xc8a492e0 Out: 0xc8a492f4 Int: 0x
(Period 0)
usb-storage: usb_stor_control_msg: rq=fe rqtype=a1 value= index=00 len=1
usb-storage: GetMaxLUN command result is 1, data is 0
usb-storage: *** thread sleeping.
scsi1 : SCSI emulation for USB Mass Storage devices
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command INQUIRY (6 bytes)
usb-storage: 12 00 00 00 24 00
usb-storage: Bulk command S 0x43425355 T 0x3 Trg 0 LUN 0 L 36 F 128 CL 6
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf: xfer 36 bytes
usb-storage: Status code 0; transferred 36/36
usb-storage: -- transfer complete
usb-storage: Bulk data transfer result 0x0
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x3 R 0 Stat 0x0
usb-storage: Fixing INQUIRY data to show SCSI rev 2 - was 0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command INQUIRY (6 bytes)
usb-storage: 12 00 00 00 25 00
usb-storage: Bulk command S 0x43425355 T 0x4 Trg 0 LUN 0 L 37 F 128 CL 6
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
usb-storage: usb_stor_bulk_transfer_buf: xfer 37 bytes
usb-storage: Status code 0; transferred 36/37
usb-storage: -- short transfer
usb-storage: Bulk data transfer result 0x1
usb-storage: Attempting to get CSW...
usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes
usb-storage: Status code 0; transferred 13/13
usb-storage: -- transfer complete
usb-storage: Bulk status result = 0
usb-storage: Bulk status Sig 0x53425355 T 0x4 R 0 Stat 0x0
usb-storage: Fixing INQUIRY data to show SCSI rev 2 - was 0
usb-storage: scsi cmd done, result=0x0
usb-storage: *** thread 

Re: [linux-usb-devel] Mass-storage hardware writeprotection problem

2003-08-14 Thread Matthew Dharm
2.5/6 fixes this.

Do an 'eject /dev/sda' (or whatever the right /dev/ node is) when you
insert the new pendrive.

Matt

On Sun, Aug 10, 2003 at 04:39:56AM +0200, Lazy wrote:
 Hello
 
 The problem is that emulated scsi disc doesn't reenable writing
 after inserting write protected USB Pendrive. Afther that
 eaven if the drive isn't writeprotected it stays read-only.
 Reloading mass-storage driver fixes this problem.
 
 The device is PQI Traveling disc, it uses generic mass-storage driver 
 from 2.4.21.
 
 I browsed the code but all this scsi stuff gets me confused ;D.
 
 I want to fix it but i dont know where the problem lays. Bad device 
 freeing on device removal, some bug in generic block routines ...
 
 So please direct me or fix it if ;)
 
 If it helps can send the logs.
 __
 Michal Grzedzicki
 
 
 
 
 ---
 This SF.Net email sponsored by: Free pre-built ASP.NET sites including
 Data Reports, E-commerce, Portals, and Forums are available now.
 Download today and enter to win an XBOX or Visual Studio .NET.
 http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
 ___
 [EMAIL PROTECTED]
 To unsubscribe, use the last form field at:
 https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

-- 
Matthew Dharm  Home: [EMAIL PROTECTED] 
Maintainer, Linux USB Mass Storage Driver

C:  They kicked your ass, didn't they?
S:  They were cheating!
-- The Chief and Stef
User Friendly, 11/19/1997


pgp0.pgp
Description: PGP signature


Re: [linux-usb-devel] Re: Suggested reorganization of usb_reset_device()etc.

2003-08-14 Thread David Brownell
Oliver Neukum wrote:
Am Sonntag, 10. August 2003 17:40 schrieb Alan Stern:

That makes sense.  What about if the set-config message fails?  Go ahead 
and rebind anyway, using the old configuration?


Yes, what else is there to do?
Invoke disconnect processing, and force re-enumeration.

You _know_ the device isn't acting like the current usbcore
state expects.
- Dave





---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] More USB fixes for 2.6.0-test2

2003-08-14 Thread Greg KH
ChangeSet 1.1119.1.12, 2003/08/06 16:02:14-07:00, [EMAIL PROTECTED]

[PATCH] USB: fixes for usb-skeleton.c

I've found minor errors in usb-skeleton.c. First, there is no valid
value of interface-minor in assignment to dev-minor. Second, when
calling usb_deregister_dev the interface-minor must be valid or else
minor isn't deregistered.


 drivers/usb/usb-skeleton.c |5 +
 1 files changed, 1 insertion(+), 4 deletions(-)


diff -Nru a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
--- a/drivers/usb/usb-skeleton.cFri Aug  8 17:04:58 2003
+++ b/drivers/usb/usb-skeleton.cFri Aug  8 17:04:58 2003
@@ -526,7 +526,6 @@
init_MUTEX (dev-sem);
dev-udev = udev;
dev-interface = interface;
-   dev-minor = interface-minor;
 
/* set up the endpoint information */
/* check out the endpoints */
@@ -606,6 +605,7 @@
goto error;
}
 
+   dev-minor = interface-minor;
 
/* let the user know what node this device is now attached to */
info (USB Skeleton device now attached to USBSkel-%d, dev-minor);
@@ -640,9 +640,6 @@
usb_set_intfdata (interface, NULL);
 
down (dev-sem);
-
-   /* disable open() */
-   interface-minor = -1;
 
minor = dev-minor;
 



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Re: Comments/questions about the Gadget API

2003-08-14 Thread Oliver Neukum
Am Donnerstag, 7. August 2003 21:37 schrieb David Brownell:
 Oliver Neukum wrote:
 Halt endpoints by doing a wrong direction I/O ... read from an IN endpoint
 (instead of writing to the host), or write to an OUT endpoint (instead of
 reading what it wrote).  ...
  
  That depends on whether you want to design a clean API, or you are
  driven by avoiding ioctl, which is a valid part of the Unix API, at all cost
  and your overriding concern are shell scripts.
 
 Think of it instead as portability.  The main barrier to being
 able to use this should be knowing USB -- not whether your
 chosen programming environment supports POSIX-specific APIs.
 
 Remember that _today_ you can write fully realistic user mode
 gadget drivers in C, C++, Python, Java, and other languages
 (including BASH!).  Not all of those have, or want, ioctl().

Firstly, you are unlikely to see gadgetfs ported to anything that
doesn't have ioctl.

Secondly, remembering to write/read in the wrong direction to halt
an endpoint requires as much knowledge not about USB than an
ioctl. In fact a little more as you have to know about data direction
which is immaterial to halting as such.

Thirdly and most importantly, kernel code shall be designed
independently of user space language. It is designed to meet
SuS and more importantely, the spirit of Unix, in which the io
primitives have clear meaning. Read  write do the obvious things
their names suggest. And for manipulation of io devices as such,
not involving data transfers, there is ioctl.
Read  write are not supposed to have side effects as the only
effect. Such effects are supposed to be only secondary effects of
processing data read or written, like a device becoming busy.

A portable API is an API that uses POSIX like it is intended to be
used. Not abusing ioctl to do things that read or write should do,
but neither pushing the semantics of ioctl onto read and write.
What do you do if the next special operation needs to be accomodated?

Kernel interfaces are supposed to follow Unix, not some language's
castrated oppinion of how io shall be performed. If you want more
portability write a shared library to make available a function like
gadget_halt_endpoint(). But that doesn't change the need of having
a cleanly designed kernel interface.

Sorry for being so long
Oliver



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Re: OHCI problems with suspend/resume

2003-08-14 Thread Pavel Machek
Hi!
  Is not disk spin-down policy, and thus belonging to userspace? Having
  daemon poll for inactivity of hubs once every 5 minutes and sending
  them to sleep should not hurt, too...
  Pavel
 
 Taking precedents into account it is the kernel's job.
 Screen blanking is done in kernel, as is afaik floppy
 motor control.

Floppy motor was not designed to be always on, and screen gets physically damaged
if you don't turn it off. OTOH harddrives were designed for always on, and if you spin 
up/down
too much you shorten their lives...
-- 
Pavel
Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [patch 2.6.0-test3] usb hcd-pci suspend/resume updates

2003-08-14 Thread David Brownell
This patch has some updates to the hcd pci power management glue:

 - removes now-obsolete comments (driver model now exists)

 - better state transitions:
 * suspending dead controllers needn't oops
 * multi-resume case (pm bug) simplified
 * multi-suspend case likewise (not always a bug)
 * should handle transitions other than D0-D3{hot,cold}
 - prepares for usb remote wake up support, which will be
   wanting the driver model suspend/resume code to be ready.
Please merge to test4.

- Dave

--- 1.19/drivers/usb/core/hcd-pci.c Wed Aug  6 04:52:20 2003
+++ edited/drivers/usb/core/hcd-pci.c   Tue Aug 12 16:19:01 2003
@@ -257,33 +257,6 @@
 
 #ifdef CONFIG_PM
 
-/*
- * Some sleep power levels imply updating struct usb_driver
- * to include a callback asking hcds to do their bit by checking
- * if all the drivers can suspend.  Gets involved with remote wakeup.
- *
- * If there are pending urbs, then HCs will need to access memory,
- * causing extra power drain.  New sleep()/wakeup() PM calls might
- * be needed, beyond PCI suspend()/resume().  The root hub timer
- * still be accessing memory though ...
- *
- * FIXME:  USB should have some power budgeting support working with
- * all kinds of hubs.
- *
- * FIXME:  This assumes only D0-D3 suspend and D3-D0 resume.
- * D1 and D2 states should do something, yes?
- *
- * FIXME:  Should provide generic enable_wake(), calling pci_enable_wake()
- * for all supported states, so that USB remote wakeup can work for any
- * devices that support it (and are connected via powered hubs).
- *
- * FIXME:  resume doesn't seem to work right any more...
- */
-
-
-// 2.4 kernels have issued concurrent resumes (w/APM)
-// we defend against that error; PCI doesn't yet.
-
 /**
  * usb_hcd_pci_suspend - power management suspend of a PCI-based HCD
  * @dev: USB Host Controller being suspended
@@ -294,20 +267,29 @@
 int usb_hcd_pci_suspend (struct pci_dev *dev, u32 state)
 {
struct usb_hcd  *hcd;
-   int retval;
+   int retval = 0;
 
hcd = pci_get_drvdata(dev);
-   dev_info (hcd-controller, suspend to state %d\n, state);
-
-   pci_save_state (dev, hcd-pci_state);
-
-   // FIXME for all connected devices, leaf-to-root:
-   // driver-suspend()
-   // proposed new 2.5 driver model will automate that
-
-   /* driver may want to disable DMA etc */
-   retval = hcd-driver-suspend (hcd, state);
-   hcd-state = USB_STATE_SUSPENDED;
+   switch (hcd-state) {
+   case USB_STATE_HALT:
+   dev_dbg (hcd-controller, halted; hcd not suspended\n);
+   break;
+   case USB_STATE_SUSPENDED:
+   dev_dbg (hcd-controller, suspend D%d -- D%d\n,
+   dev-current_state, state);
+   break;
+   default:
+   dev_dbg (hcd-controller, suspend to state %d\n, state);
+
+   /* remote wakeup needs hub-suspend() cooperation */
+   // pci_enable_wake (dev, 3, 1);
+
+   pci_save_state (dev, hcd-pci_state);
+
+   /* driver may want to disable DMA etc */
+   retval = hcd-driver-suspend (hcd, state);
+   hcd-state = USB_STATE_SUSPENDED;
+   }
 
pci_set_power_state (dev, state);
return retval;
@@ -326,39 +308,24 @@
int retval;
 
hcd = pci_get_drvdata(dev);
-   dev_info (hcd-controller, resume\n);
-
-   /* guard against multiple resumes (APM bug?) */
-   atomic_inc (hcd-resume_count);
-   if (atomic_read (hcd-resume_count) != 1) {
-   dev_err (hcd-controller, concurrent PCI resumes\n);
-   retval = 0;
-   goto done;
-   }
-
-   retval = -EBUSY;
if (hcd-state != USB_STATE_SUSPENDED) {
dev_dbg (hcd-controller, can't resume, not suspended!\n);
-   goto done;
+   return -EL3HLT;
}
hcd-state = USB_STATE_RESUMING;
 
pci_set_power_state (dev, 0);
pci_restore_state (dev, hcd-pci_state);
 
+   /* remote wakeup needs hub-suspend() cooperation */
+   // pci_enable_wake (dev, 3, 0);
+
retval = hcd-driver-resume (hcd);
if (!HCD_IS_RUNNING (hcd-state)) {
dev_dbg (hcd-controller, resume fail, retval %d\n, retval);
usb_hc_died (hcd);
-// FIXME:  recover, reset etc.
-   } else {
-   // FIXME for all connected devices, root-to-leaf:
-   // driver-resume ();
-   // proposed new 2.5 driver model will automate that
}
 
-done:
-   atomic_dec (hcd-resume_count);
return retval;
 }
 EXPORT_SYMBOL (usb_hcd_pci_resume);
--- 1.32/drivers/usb/core/hcd.h Fri Aug  1 05:03:12 2003
+++ edited/drivers/usb/core/hcd.h   Tue Aug 12 16:13:35 2003
@@ -82,7 +82,6 @@
 #ifdef CONFIG_PCI
int region; /* pci region for regs */
   

Re: [linux-usb-devel] Re: [usb-storage] Re: Linux 2.4.22-rc1

2003-08-14 Thread David Brownell
That report wasn't very helpful.  I recommend reviewing the
How do I report a bug? FAQ at www.linux-usb.org next time,
and for now forward:


Sorry for that, someone on usb-users told me he already reported the 
bug, so I basically wanted to say Hey, got the same problem.
Well, reported to who knows where.  Not the right place, for sure.


 - /proc/bus/usb/devices content showing your host controllers
   and the problem device.


...
T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 6
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS= 8 #Cfgs=  1
P:  Vendor= ProdID= Rev= 2.04
S:  Manufacturer=Linux 2.4.21-ow2 ehci-hcd
S:  Product=PCI device 10de:0068 (nVidia Corporation)
S:  SerialNumber=00:02.2
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=256ms
Drive is connected to PCI device 10de:0068 (nVidia Corporation)
Doesn't look like it.  There was no storage device in what you sent.
And I don't know this ow2 patch ... are you sure it's a superset
of 2.4.22-rc1?  Doesn't look like one...

00:02.2 USB Controller: nVidia Corporation nForce2 USB Controller (rev a3) (prog-if 20 
[EHCI])
Subsystem: Holco Enterprise Co, Ltd/Shuttle Computer: Unknown device f541
An SN41G2?  :)

Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- 
SERR- FastB2B-
Status: Cap+ 66Mhz+ UDF- FastB2B+ ParErr- DEVSEL=fast TAbort- TAbort- MAbort- 
SERR- PERR-
Latency: 0 (750ns min, 250ns max)
Interrupt: pin C routed to IRQ 3
Region 0: Memory at ee085000 (32-bit, non-prefetchable) [size=256]
Capabilities: [44] #0a [2080]
Capabilities: [80] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA 
PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-

 - dmesg output including all EHCI messages, with the usb code
   compiled with CONFIG_USB_DEBUG.  The most important bits
   will be any problems it reports, near when the scsi layer
   gets unhappy.


According to Alan, the output didn't contain anything useful.
Here's the log, it starts shortly before the drive goes wild:
Right, that's useless.  You're certain that had CONFIG_USB_DEBUG enabled?
Those messages would be much earlier in /var/log/kernel (or wherever you
keep your KERN_DEBUG output).  Try running with the attached patch; it
just spits out information about things that get unlinked due to timeouts.

 - Results of using the same drivers on 2.6.0-test3, which has
   much better code in the layers over the ehci driver.


Would love to, but 2.6.0 doesn't work too well for me.
Curious.  You should report the problems to LKML.  Works fine for me,
on hardware that seems to be almost identical to yours.

Would also have been great to get bug report before
we reached 2.4.22-rc1 of course.


I reported this twice to LKML (pre5 and pre8 IIRC) and once to usb-users 
(-pre5).
Never got a reply on any of my posts, this is my fourth try and the 
first one with a response.
Hint:  This is the first one you sent to linux-usb-devel ... :)

If you need anything else, just let me know. :)
Seems like this diagnostic patch should turn up anything that's to
be turned up, if it's a real issue in the EHCI code.
- Dave



--- 1.16/drivers/usb/host/ehci-q.c  Thu Jun 19 06:51:52 2003
+++ edited/ehci-q.c Sun Aug 10 12:06:53 2003
@@ -267,6 +267,7 @@
unsignedcount = 0;
int do_status = 0;
u8  state;
+   u8  dumped = 0;
 
if (unlikely (list_empty (qh-qtd_list)))
return count;
@@ -347,6 +348,19 @@
do_status = 0;
continue;
}
+#if 1
+   switch (urb-status) {
+   default:
+   break;
+   case -ECONNRESET:   /* canceled */
+   case -ENOENT:
+   if (!dumped) {
+   dumped = 1;
+   dbg_qh (cancel, ehci, qh);
+   }
+   dbg_qtd (cancel, ehci, qtd);
+   }
+#endif
 
/* token in overlay may be most current */
if (state == QH_STATE_IDLE


Re: [linux-usb-devel] Re: [usb-storage] Re: Linux 2.4.22-rc1

2003-08-14 Thread David Brownell
Fridtjof Busse wrote:
Aug 11 07:49:05 artus kernel: hub.c: port 2, portstatus 503, change 10, 
480 Mb/s
Aug 11 07:49:05 artus kernel: hub.c: new USB device 00:02.2-2, assigned 
address 4
Aug 11 07:49:05 artus kernel: usb.c: kmalloc IF deeb3400, numif 1
Aug 11 07:49:05 artus kernel: usb.c: new device strings: Mfr=0, 
Product=1, SerialNumber=0
Aug 11 07:49:05 artus kernel: usb.c: USB device number 4 default 
language ID 0x409
Aug 11 07:49:05 artus kernel: Product: USB TO IDE
Looking like one of the currently-problematic GeneSys adapters...


Aug 11 07:49:05 artus kernel: scsi1 : SCSI emulation for USB Mass 
Storage devices
Aug 11 07:49:05 artus kernel:   Vendor: Maxtor 6  Model: Y120L0
Rev: 0811
Aug 11 07:49:05 artus kernel:   Type:   Direct-Access  
ANSI SCSI revision: 02
Aug 11 07:49:05 artus kernel: Attached scsi disk sda at scsi1, channel 
0, id 0, lun 0
Aug 11 07:49:05 artus kernel: SCSI device sda: 240121728 512-byte hdwr 
sectors (122942 MB)
Aug 11 07:49:05 artus kernel:  /dev/scsi/host1/bus0/target0/lun0: p1
Aug 11 07:49:05 artus kernel: WARNING: USB Mass Storage data integrity 
not assured
Aug 11 07:49:05 artus kernel: USB Mass Storage device found at 4
Aug 11 07:49:05 artus kernel: usb.c: usb-storage driver claimed 
interface deeb3400
...
All that was normal.

If I'm translating these bitmasks right, this 4KB ep2out-bulk
transfer worked fine for three packets (512 bytes each) and
then the device started to NAK every PING it was sent.
Which caused a timeout.
Unclear why it stopped accepting more OUT data.


Aug 11 07:51:46 artus kernel: ehci_hcd 00:02.2: cancel qh dfe13100 
n1fe13002 info 42002204 4000 qtd 1fe120c0
Aug 11 07:51:46 artus kernel: ehci_hcd 00:02.2: overlay td dfe13110 
n1fe12060 0003 t8a008c81 p0=176e3600
Aug 11 07:51:46 artus kernel: ehci_hcd 00:02.2: cancel td dfe120c0 
n1fe12060 0001 t10008c80 p0=176e3000
Aug 11 07:51:51 artus kernel: usb_control/bulk_msg: timeout
This next one is going to ep0.  Timeout on the status (IN) stage of
some control OUT request ... but there's no message about timeout,
which is curious.  (Maybe it doesn't use usb_control_msg to clear
the endpoint halts.)
Aug 11 07:51:51 artus kernel: ehci_hcd 00:02.2: cancel qh dfe13080 
n1fe13002 info 40406004 4000 qtd 1fe121e0
Aug 11 07:51:51 artus kernel: ehci_hcd 00:02.2: overlay td dfe13090 
n1fe120c0 001f t80008d80 p0=
Aug 11 07:51:51 artus kernel: ehci_hcd 00:02.2: cancel td dfe121e0 
n1fe120c0 0001 t80008d80 p0=
This next one is ep2out-bulk again, with 0x01f (31) bytes timing
out.  No OUT packets are being accepted by this device, it's still
reporting that it's NAKing all PING requests.  So, timeout; but
this is the normal route, as if from usb_bulk_msg.
Aug 11 07:52:01 artus kernel: ehci_hcd 00:02.2: cancel qh dfe13100 
n1fe13002 info 42002204 4000 qtd 1fe12060
Aug 11 07:52:01 artus kernel: ehci_hcd 00:02.2: overlay td dfe13110 
n1fe12120 0005 t801f8c81 p0=1eeb3740
Aug 11 07:52:01 artus kernel: ehci_hcd 00:02.2: cancel td dfe12060 
n1fe12120 0001 t001f8c80 p0=1eeb3740
Aug 11 07:52:06 artus kernel: usb_control/bulk_msg: timeout
Again timing out on the status stage (zero length) of some ep0
transfer, except this time status is OUT so it's a control-IN.
Aug 11 07:52:06 artus kernel: ehci_hcd 00:02.2: cancel qh dfe13080 
n1fe13002 info 40406004 4000 qtd 1fe121e0
Aug 11 07:52:06 artus kernel: ehci_hcd 00:02.2: overlay td dfe13090 
n1fe12060 0001 t80008d80 p0=
Aug 11 07:52:06 artus kernel: ehci_hcd 00:02.2: cancel td dfe121e0 
n1fe12060 0001 t80008d80 p0=
Aug 11 07:52:11 artus kernel: usb_control/bulk_msg: timeout
And again timing out on an ep0in status stage.

Aug 11 07:52:11 artus kernel: ehci_hcd 00:02.2: cancel qh dfe13080 
n1fe13002 info 40406004 4000 qtd 1fe121e0
Aug 11 07:52:11 artus kernel: ehci_hcd 00:02.2: overlay td dfe13090 
n1fe120c0 0005 t80008d80 p0=
Aug 11 07:52:11 artus kernel: ehci_hcd 00:02.2: cancel td dfe121e0 
n1fe120c0 0001 t80008d80 p0=
Then more wierdness happens right here.  It's as if usb-storage decided to
reset the port used by that device, and it came back as full speed
instead of high speed ... that's odd at an electical level, not just
in terms of why did storage do that.
Which would jive with some sort of hardware problem in those USB-to-IDE
adapters, as I've been suspecting since this round of problem reports
started.  Even if part of the problem here were to be a bug in ehci-hcd,
I think this particular wierdness suggests hardware/firmware issues.
Aug 11 07:52:11 artus kernel: hub.c: port 2, portstatus 511, change 0, 
480 Mb/s
Aug 11 07:52:11 artus kernel: hub.c: port 2 of hub 1 not reset yet, 
waiting 10ms
Aug 11 07:52:11 artus kernel: hub.c: port 2, portstatus 511, change 0, 
480 Mb/s
Aug 11 07:52:11 artus kernel: hub.c: port 2 of hub 1 not reset yet, 
waiting 10ms
Aug 11 07:52:11 artus kernel: ehci_hcd 00:02.2: port 2 full speed -- 
companion

Re: [linux-usb-devel] [patch 2.6.0-test2] usb_start_wait_urb() rewrite

2003-08-14 Thread Oliver Neukum

 For the urb to complete.  The schedule_timeout() returned without
 that completion.  We only forced the completion path to start, with
 the unlink; if it wasn't already starting (maybe on another CPU).

So you are doing the conventional wait stuff only to implement
the timeout, aren't you?
This seems kind of convoluted to me. May I suggest doing the
timeout explicitely like this:

diff -Nru a/drivers/usb/core/message.c b/drivers/usb/core/message.c
--- a/drivers/usb/core/message.cSat Aug  9 10:15:31 2003
+++ b/drivers/usb/core/message.cSat Aug  9 10:15:31 2003
@@ -16,77 +16,71 @@
 #include linux/slab.h
 #include linux/init.h
 #include linux/mm.h
+#include linux/timer.h
 #include asm/byteorder.h
 
 #include hcd.h   /* for usbcore internals */
 #include usb.h
 
 struct usb_api_data {
-   wait_queue_head_t wqh;
-   int done;
+   struct completion cpl;
+   int timeout;
 };
 
 static void usb_api_blocking_completion(struct urb *urb, struct pt_regs *regs)
 {
-   struct usb_api_data *awd = (struct usb_api_data *)urb-context;
+   struct usb_api_data *ct = (struct usb_api_data *)urb-context;
+   
+   ct-timeout = (urb-status == -ECONNRESET);
+   complete(ct-cpl);
+}
+
 
-   awd-done = 1;
-   wmb();
-   wake_up(awd-wqh);
+static void timeout_kill (unsigned long d)
+{
+   struct urb *u = (struct urb *)d;
+   
+   usb_unlink_urb(u);
 }
 
 // Starts urb and waits for completion or timeout
 static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length)
 { 
-   DECLARE_WAITQUEUE(wait, current);
struct usb_api_data awd;
+   struct timer_list timeout_killer;
int status;
 
-   init_waitqueue_head(awd.wqh);  
-   awd.done = 0;
-
-   set_current_state(TASK_UNINTERRUPTIBLE);
-   add_wait_queue(awd.wqh, wait);
+   init_completion(awd.cpl);  
 
urb-context = awd;
-   status = usb_submit_urb(urb, GFP_ATOMIC);
-   if (status) {
-   // something went wrong
-   usb_free_urb(urb);
-   set_current_state(TASK_RUNNING);
-   remove_wait_queue(awd.wqh, wait);
-   return status;
-   }
+   urb-transfer_flags |= URB_ASYNC_UNLINK;
+   status = usb_submit_urb(urb, GFP_NOIO);
+   if (status)
+   goto out_err;
+   
+   init_timer(timeout_killer);
+   timeout_killer.expires = jiffies + (timeout ? timeout : MAX_SCHEDULE_TIMEOUT);
+   timeout_killer.data = (unsigned long)urb;
+   timeout_killer.function = timeout_kill;
+   add_timer(timeout_killer);
 
-   while (timeout  !awd.done)
-   {
-   timeout = schedule_timeout(timeout);
-   set_current_state(TASK_UNINTERRUPTIBLE);
-   rmb();
-   }
+   wait_for_completion(awd.cpl);
 
-   set_current_state(TASK_RUNNING);
-   remove_wait_queue(awd.wqh, wait);
+   del_timer_sync(timeout_killer);
 
-   if (!timeout  !awd.done) {
-   if (urb-status != -EINPROGRESS) {  /* No callback?!! */
-   printk(KERN_ERR usb: raced timeout, 
-   pipe 0x%x status %d time left %d\n,
-   urb-pipe, urb-status, timeout);
-   status = urb-status;
-   } else {
-   warn(usb_control/bulk_msg: timeout);
-   usb_unlink_urb(urb);  // remove urb safely
-   status = -ETIMEDOUT;
-   }
-   } else
+   if (!awd.timeout) {
status = urb-status;
+   } else {
+   warn(usb_control/bulk_msg: timeout);
+   status = -ETIMEDOUT;
+   }
 
if (actual_length)
*actual_length = urb-actual_length;
 
+out_err:
usb_free_urb(urb);
-   return status;
+   return status;
 }
 
 /*---*/




---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH]correct error handling in usb_driver_claim_interface()

2003-08-14 Thread Oliver Neukum
Am Montag, 11. August 2003 22:58 schrieb Greg KH:
 On Mon, Aug 11, 2003 at 10:49:05PM +0200, Oliver Neukum wrote:
  Am Montag, 11. August 2003 22:20 schrieb Greg KH:
   On Mon, Aug 11, 2003 at 09:44:42PM +0200, Oliver Neukum wrote:
Hi,

this function races with itself, doesn't return errors and races with
releasing interfaces. This patch fixes it by changing the function
prototype, introducing locking and having a correct order in
releasing interfaces.
   
   So you're using the fact that lock_kernel() can recurse here, right?
   That's not pretty :(
  
  Actually no. It's just not worth introducing another dedicated lock
  and we are in -test where I strive for minimal changes in core
  code.
 
 I strive for correctness :)
 Is there a better way you can think of solving this without using the
 BKL?

Not without touching messy parts of usbfs.

   Hm, I _really_ hate this function in the first place, but I can see how
   it could be necessary for some devices.  Since currently probe() is
   called sequentially for a device (no other interfaces on the same device
   can be called at the same time), this lock isn't really necessary,
   right?
  
  Not so, interfaces are claimed by usbfs as well.
 
 Bleah, I keep forgetting about usbfs...

At some point you pay for having two ways to determine ownership
of interfaces.
 
   I really don't want to add lock_kernel() here if we can avoid it.
  
  Usbfs assumes BKL here.
 
 But the probe() sequence doesn't, right?  So we are just protecting
 ourself from usbfs, correct?  If so, how about a nice comment about that
 here, as that's all we are trying to prevent the race for.

You shall have your comment. However I object in principle against
exporting generic racy APIs.

The question about reliance is a good one generically speaking.
2.4 does again in usbfs depend on BKL. Somebody will have to audit
all those code paths. However as I will get onto a bus tomorrow
leaving my laptop at home, if all goes well, that won't be me in the
forseeable future.

Regards
Oliver

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===


[EMAIL PROTECTED], 2003-08-11 23:08:16+02:00, [EMAIL PROTECTED]
  - update commentary


 usb.c |1 +
 1 files changed, 1 insertion(+)


diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
--- a/drivers/usb/core/usb.cMon Aug 11 23:09:09 2003
+++ b/drivers/usb/core/usb.cMon Aug 11 23:09:09 2003
@@ -268,6 +268,7 @@
if (!iface || !driver)
return -EINVAL;
 
+   /* this is mainly to lock against usbfs */
lock_kernel();
if (iface-driver) {
unlock_kernel();

===


This BitKeeper patch contains the following changesets:
1.2217
## Wrapped with gzip_uu ##


begin 664 bkpatch25317
M'XL(`/4%.#\``\U4T6K;,!1]MK[B0M]:8E])EFT9/+IU8QL;+3K!\BR@?'
M5K'DC8`_?DHRCK2CG4O$Q)Z4KG'AT==`WSHQE9+;[V8D%_#!.E](ZG
[EMAIL PROTECTED],[KD-N96W():WM37(\D'P;C7)ZOSD:A*V+)77+82,*R,:\X5
MO[LW9;1Z]_[V\^L5(54%-ZT:UN:K\5!5I.ZNF\ELXVZTJMU7FQ_2,T.DE#*!
M714S*S@/)UIAG43PH;E\J[.)[EMAIL PROTECTED]@+S(B5O@:,T1R0
M)[EMAIL PROTECTED])18ES:Z0E8CP-#145@@0/_SO^:%C`=-\H;T#;OC#5^..?((]
M2TF6)\'(XB\;(:B0O#K#LAGW5W-)+W]B/6);8J29C/CJ4AGG3%C1!%$TK7B
M*)Z1Y!DMJ,YX1ZD9Q2+(#W-IH=?'!^_WE3O)#N^;X`UTJN6393'D(?SF%
M_6X4E/^'48Z:?H'%^./0P\,OGY#W!1;ZR'($2J+D$GR[1!ZKS;[EMAIL PROTECTED]PM;J
D#M0ZS)V'4.'[EMAIL PROTECTED]:W3GIKZJ1:TY\IS\!'I*7`]X!```
`
end



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] about usb device on PXA255

2003-08-14 Thread Robert Schwebel
On Wed, Aug 13, 2003 at 01:53:49AM +, agikor M wrote:
 I am a newbie on usb device.Now I have a task about the usb device on
 PXA255.we have designed a HPC which based on PXA255 and we want to use
 the HPC as a mass storage device(a usb removable disk) through the usb
 on pxa255.  Would you like to tell me how I can get a start and
 introduce me the steps to work? Are there have some reference?

You have to write a gadget driver: use the pxa2xx_udc controller driver
(which talks to the hardware and handles all the hardware access stuff),
on top of that you should write something that implements the
specification for storage devices. Look at the existing gadget drivers
(gadget_ether, gadget_zero) to see how things work... 

Robert
-- 
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
 Hornemannstraße 12,  31137 Hildesheim, Germany
Phone: +49-5121-28619-0 |  Fax: +49-5121-28619-4


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [2.6.0-test3] printing failures...

2003-08-14 Thread Daniel Blueman
Testing printing with linux-2.6.0-test3 is still failing in a similar manner
- prints 20% then stops.

Logs included - Dan.

--- [ printer registered ]

usb 2-1: new device strings: Mfr=1, Product=2, SerialNumber=3
drivers/usb/core/message.c: USB device number 2 default language ID 0x409
usb 2-1: Product: USB Printer
usb 2-1: Manufacturer: EPSON
usb 2-1: SerialNumber: ABCDE0212160438390
usb 2-1: usb_new_device - registering interface 2-1:0
usblp 2-1:0: usb_probe_interface
usblp 2-1:0: usb_probe_interface - got id
drivers/usb/class/usblp.c: usblp0: USB Bidirectional printer dev 2 if 0 alt
0 proto 2 vid 0x04B8 pid 0x0005
drivers/usb/core/file.c: looking for a minor, starting at 0

--- [ printing started ]

ohci-hcd :00:02.3: urb decfb938 path 1 ep2in 93d2 cc 9 -- status
-121
usb 2-1: hcd_unlink_urb ded159c4 fail -22
usb 2-1: hcd_unlink_urb decfb938 fail -22
usb 2-1: hcd_unlink_urb ded159c4 fail -22
usb 2-1: hcd_unlink_urb ded159c4 fail -22
ohci-hcd :00:02.3: urb decfb938 path 1 ep2in 92d2 cc 9 -- status
-121
usb 2-1: hcd_unlink_urb ded159c4 fail -22
usb 2-1: hcd_unlink_urb decfb938 fail -22
ohci-hcd :00:02.3: urb decfb938 path 1 ep2in 93d2 cc 9 -- status
-121
usb 2-1: hcd_unlink_urb decfb938 fail -22
ohci-hcd :00:02.3: urb decfb938 path 1 ep2in 92d2 cc 9 -- status
-121
usb 2-1: hcd_unlink_urb ded159c4 fail -22
usb 2-1: hcd_unlink_urb decfb938 fail -22
ohci-hcd :00:02.3: urb decfb938 path 1 ep2in 93d2 cc 9 -- status
-121

--- [ printer disconnected ]
drivers/usb/class/usblp.c: usblp0: error -110 reading printer status
ohci-hcd :00:02.3: urb d2d233c0 path 1 ep0in 5ec2 cc 5 -- status
-110
repeated 211 times
ohci-hcd :00:02.3: GetStatus roothub.portstatus [1] = 0x00030100 PESC
CSC PPS
hub 2-0:0: port 1, status 100, change 3, 12 Mb/s
usb 2-1: USB disconnect, address 2'fail -22' errors...
drivers/usb/core/message.c: nuking URBs for device 2-1
ohci-hcd :00:02.3: shutdown urb d2d233c0 pipe 8280 ep0in
ohci-hcd :00:02.3: urb d2d233c0 path 1 ep0in 5ec2 cc 5 -- status
-110
drivers/usb/class/usblp.c: usblp0: error -108 reading printer status
drivers/usb/class/usblp.c: usblp0: error -19 reading printer status
repeated 75 times
usb 2-1: unregistering interfaces
drivers/usb/core/file.c: removing 0 minor
drivers/usb/class/usblp.c: usblp0: error -19 reading printer status
usb 2-1: hcd_unlink_urb ded159c4 fail -22
usb 2-1: hcd_unlink_urb decfb938 fail -22
usb 2-1: unregistering device
ohci-hcd :00:02.3: GetStatus roothub.portstatus [1] = 0x00020100 PESC
PPS
hub 2-0:0: port 1 enable change, status 100
drivers/usb/class/usblp.c: usblp0: removed
Unable to handle kernel paging request at virtual address dee350e4
 printing eip:
c029fc64
*pde = 0007a067
*pte = 1ee35000
Oops:  [#1]
CPU:0
EIP:0060:[c029fc64]Not tainted
EFLAGS: 00010282
EIP is at usb_buffer_free+0xd/0x46
eax: dee35004   ebx: def8e004   ecx: de32e000   edx: cb954000
esi: def8e008   edi: dedec098   ebp: cb955f1c   esp: cb955f0c
ds: 007b   es: 007b   ss: 0068
Process usb (pid: 1055, threadinfo=cb954000 task=ce03f000)
Stack: ce03f000 def8e004 def8e008 dedec098 cb955f38 c02b6db1 dee35004
2000
   decd8000 1ecd8000 def8e004 cb955f50 c02b6eb3 def8e004 0077
cb0dc004
   dffe61dc cb955f70 c016319b dedec098 cb0dc004 dce49004 cb0dc004
ce4d1004
Call Trace:
 [c02b6db1] usblp_cleanup+0x43/0xa2
 [c02b6eb3] usblp_release+0x6b/0x6d
 [c016319b] __fput+0xb5/0xc4
 [c01612c4] filp_close+0x4b/0x74
 [c01613f0] sys_close+0x103/0x226
 [c01621d9] sys_read+0x3f/0x5d
 [c010a0e1] sysenter_past_esp+0x52/0x71
 
Code: 8b 90 e0 00 00 00 85 d2 74 0e 8b 4a 20 85 c9 74 07 8b 41 18

-- 
Daniel J Blueman

COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] 2.4.22-rc1-ac1 versus 2.6.0-test2-ac1 and broken usb-storage/Clie

2003-08-14 Thread Robert L. Harris


Bah, it went to kern.log.  Attaching that compressed.  If this isn't
what you want or is too much debugging let me know.  This is the whole
log file incase something is mixed in the middle.



Thus spake Alan Stern ([EMAIL PROTECTED]):

 On Sat, 9 Aug 2003, Robert L. Harris wrote:
 
  Attaching the messages file from the 2 boots.  On both runs I boot the
  system, load usb-storage and plugin/turn on my archos jukebox.  On the
  2.6 run I tried to init6 but I have to SysRq the system for a reboot.
 
 I just had a chance to look at your log messages.  They don't include any 
 debugging information.  Either you didn't have 
 CONFIG_USB_STORAGE_DEBUGGING set in your kernels or you had syslogd 
 configured to ignore debugging messages.
 
 Alan Stern

:wq!
---
Robert L. Harris | GPG Key ID: E344DA3B
 @ x-hkp://pgp.mit.edu
DISCLAIMER:
  These are MY OPINIONS ALONE.  I speak for no-one else.

Life is not a destination, it's a journey.
  Microsoft produces 15 car pileups on the highway.
Don't stop traffic to stand and gawk at the tragedy.


kern.log.0.bz2
Description: Binary data


pgp0.pgp
Description: PGP signature


Re: [linux-usb-devel] 2.6.0-test2-mm5 and USB

2003-08-14 Thread Greg KH
On Thu, Aug 07, 2003 at 06:44:25PM -0400, Robert L. Harris wrote:
 
 
   I'm having considerable problems with my Archos Jukebox and my Sony
 Clie.  They seem to have the same problem when I use them.  In both
 instances when I install the hardware and try to load the module the
 modprobe hangs.  The device is unusable and on previous kernels the
 machine would effectively lock up even though I could reboot it with
 the sysrq commands.

Does 2.6.0-test2 have these same problems?

thanks,

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: dvb usb driver sleeping in interrupt

2003-08-14 Thread Holger Waechtler
Oliver Neukum wrote:
Hi,

submitting an URB in a completion handler requires GFP_ATOMIC to be
used.
thanks for the fix, we'll apply it.

Holger



Regards
Oliver
You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.
===

[EMAIL PROTECTED], 2003-08-06 21:05:08+02:00, [EMAIL PROTECTED]
  - usb_submit_urb must use GFP_ATOMIC in interrupt
 dvb-ttusb-budget.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
diff -Nru a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c	Wed Aug  6 21:06:39 2003
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c	Wed Aug  6 21:06:39 2003
@@ -788,7 +788,7 @@
 		}
 	}
 #if LINUX_VERSION_CODE = KERNEL_VERSION(2,5,0)
-	usb_submit_urb(urb, GFP_KERNEL);
+	usb_submit_urb(urb, GFP_ATOMIC);
 #endif
 }
 

===

This BitKeeper patch contains the following changesets:
1.2153
## Wrapped with gzip_uu ##
begin 664 bkpatch27305
M'XL(`+]1,3\``\54VVK,!!]7GW%0%Y:4MNZ6++LXK+IIDE#$[)LDZ=2%E^T
M]K+Q.LA22L$?7WD-N=`+W92V0L:C7GFZ,RQ#NZ4SJ9M#?K.Z71`;QO.Y-,
MG-W84FW]K;(;V_BMKEQLT;[EMAIL PROTECTED]/[EMAIL PROTECTED]
M(3Z[]YBOMRJ9+-Z=7I\?+1!*4YC5V;92'Y6!-$7Y9EI:=-O=)O50[G^/MQ3
MC`DAE/!$]E8R%/1$X+YU9TBAY2)(Z#I#Y`_36PQ)2$SB7M84W0,
MQ*$,\`LP#+``BA),$^P/,0TP1A^GAH.[EMAIL PROTECTED]@F%QV-F_69FEU
M#HWMC/,I.#V9+X^N+B_.9K#NFF4UO;[EMAIL PROTECTED];P]!T([EMAIL PROTECTED]
MT_$`1=M\I:?^U(/9^^1I7K+CO\L8H=VY+2ME!H?WV.$7(\1E42$+1N
MZ:CN9Y6F9`BHU8[KZ!:?/+2FQ(#'FF/A8YCL-+9WJD+_Y*'OU(LW#'`
M1V%_IVK^ZHF_U758PLOP=-?=M.I=+Y_-Y_Q*QQ',0SL;7YGR%^YY]0CU
;R]/5UY1JV+3V29EDG`9,HJ^`;'[\H)!0``
`
end


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] some analysis of a hang

2003-08-14 Thread Alan Stern
On Tue, 12 Aug 2003, Oliver Neukum wrote:

 Am Dienstag, 12. August 2003 17:57 schrieb Alan Stern:
  
  Maybe it's an attempt to protect against the device-morphed possibility.  
  I'm planning a re-write of that whole area.  For now, it would probably be 
  okay to remove the down_read() and up_read() in usb_reset_device().
 
 No, it is a guard against probe() which is bound to fail during a reset.

But Andries's problem is that now reset is bound to fail during probe().

What probe() does it protect against?  Are you concerned that a driver 
bound to one interface might reset the device while another interface is 
being probed?

Alan Stern



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH]cleanup of cpia_usb.c

2003-08-14 Thread Oliver Neukum
Hi,

the following points:

1. Checking for an active waitqueue before waking is either
unnecessary or a race condition
2. usb_set_interface() in the release code path may fail, but
   you must not abort in that case or there is a memleak
3. don't use interruptible_sleep_on() or friends
4. you must not pass a buffer on the stack to usb_bulk_msg()
   and friends

Regards
Oliver

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===


[EMAIL PROTECTED], 2003-08-09 14:19:14+02:00, [EMAIL PROTECTED]
  - no DMA on stack
  - cleanup of waiting
  - fix memleak in race with physical disconnect


 cpia_usb.c |   28 +++-
 1 files changed, 19 insertions(+), 9 deletions(-)


diff -Nru a/drivers/media/video/cpia_usb.c b/drivers/media/video/cpia_usb.c
--- a/drivers/media/video/cpia_usb.cSat Aug  9 14:19:51 2003
+++ b/drivers/media/video/cpia_usb.cSat Aug  9 14:19:51 2003
@@ -161,8 +161,7 @@
ucpia-workbuff-status = FRAME_EMPTY;
ucpia-workbuff-length = 0;
  
-   if (waitqueue_active(ucpia-wq_stream))
-   wake_up_interruptible(ucpia-wq_stream);
+   wake_up_interruptible(ucpia-wq_stream);
}
}
}
@@ -348,7 +347,10 @@
databytes = (((int)command[7])8) | command[6];
 
if (command[0] == DATA_IN) {
-   u8 buffer[8];
+   u8 *buffer;
+   buffer = kmalloc(8, GFP_KERNEL);
+   if (!buffer)
+   return -ENOMEM;
 
if (!data) {
DBG(Internal driver error: data is NULL\n);
@@ -356,10 +358,13 @@
}
 
err = ReadPacket(udev, command, buffer, 8);
-   if (err  0)
+   if (err  0) {
+   kfree(buffer);
return err;
+   }
 
memcpy(data, buffer, databytes);
+   kfree(buffer);
} else if(command[0] == DATA_OUT)
WritePacket(udev, command, data, databytes);
else {
@@ -390,15 +395,22 @@
 {
struct usb_cpia *ucpia = (struct usb_cpia *) privdata;
struct framebuf *mybuff;
+   DEFINE_WAIT(wait);
 
if (!ucpia || !ucpia-present)
return -1;
-  
+   
+   prepare_to_wait(ucpia-wq_stream, wait, TASK_INTERRUPTIBLE);  
if (ucpia-curbuff-status != FRAME_READY)
-   interruptible_sleep_on(ucpia-wq_stream);
+   schedule();
else
DBG(Frame already waiting!\n);
+   finish_wait(ucpia-wq_stream, wait);
+   if (signal_pending(current))
+   return -EINTR;
+   
 
+   
mybuff = ucpia-curbuff;
 
if (!mybuff)
@@ -434,7 +446,6 @@
ret = usb_set_interface(ucpia-dev, ucpia-iface, 0);
if (ret  0) {
printk(KERN_ERR usb_set_interface error (ret = %d)\n, ret);
-   return;
}
}
 
@@ -616,8 +627,7 @@
 
ucpia-curbuff-status = FRAME_ERROR;
 
-   if (waitqueue_active(ucpia-wq_stream))
-   wake_up_interruptible(ucpia-wq_stream);
+   wake_up_interruptible(ucpia-wq_stream);
 
udev = interface_to_usbdev(intf);
usb_driver_release_interface(cpia_driver,

===


This BitKeeper patch contains the following changesets:
1.2214
## Wrapped with gzip_uu ##


begin 664 bkpatch28640
M'XL(`.?F-#\``ZU5;8_:1A#^S/Z*J2*ET/RZS=LKD1W21%]Q)$./[EMAIL PROTECTED]
M6/B%KMA*.2_=]:^7IKZ7IM8R%YF)UG9^;99]8OX+9$-6H5:?()%7L!OQ2E
M'K7(SJH8\WZ.U:[*^H7:T-JB*AMLTR'#2`P5([EMAIL PROTECTED]:`JV4
MHY;HV_[EMAIL PROTECTED],[EMAIL PROTECTED]';+4[CRM,^SM5R*W)=KI?
M/EFR$LE]NN)]R3Y=NVQ(7\5DQM8P6*^\@T4;LX;%1DW\)M[G/7LJPA
M'YX[EMAIL PROTECTED]@]X`,(9B6`DG%?G$.37OGC_``KP3T.'L#_[_F
MMRR'N0%3*XOH,BAU#+:U;XH19E7RC6))3O)-[5XGOT.2WN(,E!R0CA
[EMAIL PROTECTED]',HEDG%21D68Z39)3B^)5PV_THUZ_W+AS$N.7O]2*^Q,@[EMAIL PROTECTED]
M1`X^)[EMAIL PROTECTED])$T(^^$N#PP/).CNWXWBE8^=**43JNC./[EMAIL PROTECTED],-
MA4(4ZV[?E!+:NG8]K[7OT\G!/J]^1PP=S^4GR[9OU:ES1]H4CQ'DP'T
[EMAIL PROTECTED]/84@C+88[4I(=([EMAIL PROTECTED]/AC56)Y((J)ZW%),\BEVEZK(%D%)'4
M*MJO48%JR/LLMK9A15[EMAIL PROTECTED]:5:7.?]3D,L+76_R+^)-HU+57BK%,,R1=R'
M%[EMAIL PROTECTED]]L)D$F::[EMAIL PROTECTED]I:HPQJV-B-!HQE!27:2YJ-D=YDDU*(QI+AJU
M?(.M0_TOG\'X3S'R9G(CP'[EMAIL PROTECTED]MBY(S7\IL'VR\JDZ;T^_!:66J',
M.F=L8KN0#/S@A;[EMAIL PROTECTED];NC=OPGLVV_^_?S/+Z)FM4Q(D:VC\T
M1V36ZN5`Z]ZV'[EMAIL PROTECTED]/-'/P#OPV2!V:[K:VW=;G%DQ^LV
MOAC3JLT'(4'MGTS?S6ZFX:\7LV7;W%YU/X%7IZ.72=:X5[J3#416AB'K+0
MA9=FH0O+BX^7XQF.5TL;N?+V9NK:,PSI-UOZ=3$E236NB$]3B4/C0KRM

Re: [linux-usb-devel] Suggested reorganization of usb_reset_device() etc.

2003-08-14 Thread Oliver Neukum

 After usb_device_reset() and usb_set_configuration() carry out their
 physical actions, they merely need to disable all the endpoints on the
 device (except maybe ep0), set the state to the correct value, and post
 the state_change request.  The hub thread will handle all the rest.

No, you must disable the endpoints before you do the requested action.
Otherwise there's a race where drivers will send data to endpoints belonging
to interfaces they no longer own.

Regards
Oliver



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH]return to old timeout handling

2003-08-14 Thread Oliver Neukum
Am Sonntag, 10. August 2003 14:08 schrieb Daniel Blueman:
 Thanks Oliver - I can confirm this patch does fix printing...excellent!

Now I wish I'd understand why they work.

Regards
Oliver



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] 2.4.21 USB printer failure w/ HP PSC750

2003-08-14 Thread Peter Denison
Having just upgraded to 2.4.21, the first time I tried to print, the
following happened. The printer started to print, but gave up after a
while and spat out just about 1 of image. Needless to say, it all worked
fine under 2.4.20.

Intel 82801BA based MB, running stock 2.4.21 (compiled with gcc 3.3.1)
with uhci driver (all on Debian testing)

This debugging code was introduced during 2.4.20-2.4.21, but I'm afraid I
don't know what the significance of it is. (Happens when td-dma_handle !=
(qh-element  ~UHCI_PTR_BITS) )

Can anyone tell me what's going on? I am happy to provide more information
as necessary.


Aug  6 18:45:19 ptal-mlcd: SYSLOG at /home/msp/src/debian/hpoj/hpoj-0.90/mlcd/
bp/ex/ExMgr.h:564, dev=mlc:usb:PSC_750@/dev/usb/lp0, pid=287, e=19
 ptal-mlcd successfully activated, mode=1284.4.
Aug  6 18:45:22 kernel: [d7b0b120] link (17b0b092) element (166d9270)
[following lines all the same time]
kernel:  Element != First TD
kernel:   0: [d66d9000] link (166d9030) e3 SPD Length=3f MaxLen=3f DT0 EndPt=1
 Dev=2, PID=e1(OUT) (buf=15f5c000)
kernel:   1: [d66d9030] link (166d9060) e3 SPD Length=3f MaxLen=3f DT1 EndPt=1
 Dev=2, PID=e1(OUT) (buf=15f5c040)
kernel:   2: [d66d9060] link (166d9090) e3 SPD Length=3f MaxLen=3f DT0 EndPt=1
 Dev=2, PID=e1(OUT) (buf=15f5c080)
kernel:   3: [d66d9090] link (166d90c0) e3 SPD Length=3f MaxLen=3f DT1 EndPt=1
 Dev=2, PID=e1(OUT) (buf=15f5c0c0)
kernel:   4: [d66d90c0] link (166d90f0) e3 SPD Length=3f MaxLen=3f DT0 EndPt=1
 Dev=2, PID=e1(OUT) (buf=15f5c100)
kernel:   5: [d66d90f0] link (166d9120) e3 SPD Length=3f MaxLen=3f DT1 EndPt=1
 Dev=2, PID=e1(OUT) (buf=15f5c140)
kernel:   6: [d66d9120] link (166d9150) e3 SPD Length=3f MaxLen=3f DT0 EndPt=1
 Dev=2, PID=e1(OUT) (buf=15f5c180)
kernel:   7: [d66d9150] link (166d9180) e2 SPD Length=3f MaxLen=3f DT1 EndPt=1
 Dev=2, PID=e1(OUT) (buf=15f5c1c0)
kernel:   8: [d66d9180] link (166d91b0) e3 SPD Length=3f MaxLen=3f DT0 EndPt=1
 Dev=2, PID=e1(OUT) (buf=15f5c200)
kernel:   9: [d66d91b0] link (166d91e0) e3 SPD Length=3f MaxLen=3f DT1 EndPt=1
 Dev=2, PID=e1(OUT) (buf=15f5c240)
kernel:   10: [d66d91e0] link (166d9210) e3 SPD Length=3f MaxLen=3f DT0 EndPt=1
 Dev=2, PID=e1(OUT) (buf=15f5c280)
kernel:   11: [d66d9210] link (166d9240) e3 SPD Length=3f MaxLen=3f DT1 EndPt=1
 Dev=2, PID=e1(OUT) (buf=15f5c2c0)
kernel:   12: [d66d9240] link (166d9270) e3 SPD Length=3f MaxLen=3f DT0 EndPt=1
 Dev=2, PID=e1(OUT) (buf=15f5c300)
kernel:   13: [d66d9270] link (166d92a0) e0 SPD Stalled CRC/Timeo Length=3f
 MaxLen=3f DT1 EndPt=1 Dev=2, PID=e1(OUT) (buf=15f5c340)
kernel:   14: [d66d92a0] link (166d92d0) e3 SPD Active Length=0 MaxLen=3f DT0
 EndPt=1 Dev=2, PID=e1(OUT) (buf=15f5c380)
kernel:   15: [d66d92d0] link (0001) e3 SPD IOC Active Length=0 MaxLen=3d
 DT1 EndPt=1 Dev=2, PID=e1(OUT) (buf=15f5c3c0)
kernel:
kernel: printer.c: usblp0: nonzero read/write bulk status received: -110

Aug  6 18:46:16 kernel: [d7b0b0c0] link (17b0b062) element (166d9030)
kernel:  Element != First TD
kernel:   0: [d66d9000] link (166d9030) e3 Length=7 MaxLen=7 DT0 EndPt=0 Dev=2,
 PID=2d(SETUP) (buf=161364e0)
kernel:   1: [d66d9030] link (166d9060) e0 SPD Stalled CRC/Timeo Length=7ff
 MaxLen=0 DT1 EndPt=0 Dev=2, PID=69(IN) (buf=167dbf67)
kernel:   2: [d66d9060] link (0001) e3 IOC Active Length=0 MaxLen=7ff DT1
 EndPt=0 Dev=2, PID=e1(OUT) (buf=)
kernel:

This last stanza is then repeated, every 41-160 seconds, presumably each
time CUPS tries again to print the data.

-- 
Peter Denison peterd at marshadder dot uklinux dot net
Please use this address only for personal mail, not copied to lists
gatewayed to news or web pages unless the addresses are removed.



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: Linux 2.6.0-test3

2003-08-14 Thread Oliver Neukum
Am Samstag, 9. August 2003 23:14 schrieb Jacek Kawa:
 Linus Torvalds wrote:
 
 [...]
 
  Oliver Neukum:
o USB: error return codes in usblp
o USB: cleanup of usblp (release and poll)
o USB: fix race condition in usblp_write
 
 [...]
 
 Well, I cannot finish printing anything now and I believe, that one of
 above is responsible. 
 It looks as if printer gets some amount of data but then communication 
 'stops' and printer waits for more data (usually I have about 2cm 
 of page printed, paper locked and later printer error leds start
 blinking happily :)

In addition, could you determine the wchan of the lpd task?

Regards
Oliver



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Oops when unplugging a USB2.0 pccard

2003-08-14 Thread David Brownell
Oliver Neukum wrote:
this is with 2.6.0-test2, no devices attached to the bus, on UP.
Is it a known problem?
No, hadn't seen it -- but then, last time I tried a CardBus adapter
it had major PCI problems.  It's been quite a while since I've seen
those work correctly with 2.5 kernels, maybe since about 2.5.70.
If it's working for you even that well, it's significant progress.
I'll see if it happens for me in recent test2 kernels.
- Dave



Aug  1 15:01:45 vermuden kernel: ehci_hcd :02:00.2: stop
Aug  1 15:01:45 vermuden kernel: ehci_hcd :02:00.2: reset command  park=3 ithresh=63 LReset IAAD Async Periodic period=?? R
Aug  1 15:01:45 vermuden kernel: Unable to handle kernel NULL pointer dereference at virtual address 0048
Aug  1 15:01:45 vermuden kernel:  printing eip:
Aug  1 15:01:45 vermuden kernel: c02ce90a
Aug  1 15:01:45 vermuden kernel: *pde = 
Aug  1 15:01:45 vermuden kernel: Oops:  [#1]
Aug  1 15:01:45 vermuden kernel: CPU:0
Aug  1 15:01:45 vermuden kernel: EIP:0060:[c02ce90a]Not tainted
Aug  1 15:01:45 vermuden kernel: EFLAGS: 00010006
Aug  1 15:01:45 vermuden kernel: EIP is at scan_async+0x3a/0x120
Aug  1 15:01:45 vermuden kernel: eax:    ebx: d93ed400   ecx: d93a2868   edx: 0003
Aug  1 15:01:45 vermuden kernel: esi:    edi: d93ed400   ebp: d9e38000   esp: d9e39e1c
Aug  1 15:01:45 vermuden kernel: ds: 007b   es: 007b   ss: 0068
Aug  1 15:01:45 vermuden kernel: Process pccardd (pid: 1862, threadinfo=d9e38000 task=d9e3b940)
Aug  1 15:01:45 vermuden kernel: Stack: c01892fb d9e39e28 d912b140   d93ed400  dd38cc00 
Aug  1 15:01:45 vermuden kernel:d9e38000 c02d0adc d93ed400  d93ed4ac d93ed400 c02d0755 d93ed400 
Aug  1 15:01:45 vermuden kernel: dd38ccda d90d68c0 dd38c8f0 dd38cc54 dd38c8f0 dd38cc54 c020aaaf 
Aug  1 15:01:45 vermuden kernel: Call Trace:
Aug  1 15:01:45 vermuden kernel:  [c01892fb] sysfs_get_dentry+0x6b/0x80
Aug  1 15:01:45 vermuden kernel:  [c02d0adc] ehci_work+0x2c/0xb0
Aug  1 15:01:45 vermuden kernel:  [c02d0755] ehci_stop+0xf5/0x200
Aug  1 15:01:45 vermuden kernel:  [c020aaaf] kobject_del+0x6f/0x80
Aug  1 15:01:45 vermuden kernel:  [c020a85a] unlink+0x7a/0x90
Aug  1 15:01:45 vermuden kernel:  [c026a292] device_del+0x62/0xa0
Aug  1 15:01:45 vermuden kernel:  [c026a2e0] device_unregister+0x10/0x20
Aug  1 15:01:45 vermuden kernel:  [c02bdbe7] usb_disconnect+0x127/0x170
Aug  1 15:01:45 vermuden kernel:  [c02c6790] usb_hcd_pci_remove+0xc0/0x1b0
Aug  1 15:01:45 vermuden kernel:  [c02184e6] pci_device_remove+0x36/0x40
Aug  1 15:01:45 vermuden kernel:  [c026b9a6] device_release_driver+0x66/0x70
Aug  1 15:01:45 vermuden kernel:  [c026baee] bus_remove_device+0x5e/0xb0
Aug  1 15:01:45 vermuden kernel:  [c026a287] device_del+0x57/0xa0
Aug  1 15:01:45 vermuden kernel:  [c026a2e0] device_unregister+0x10/0x20
Aug  1 15:01:45 vermuden kernel:  [c0215cab] pci_destroy_dev+0x1b/0x70
Aug  1 15:01:45 vermuden kernel:  [c0215ddb] pci_remove_behind_bridge+0x2b/0x40
Aug  1 15:01:45 vermuden kernel:  [e5e04358] shutdown_socket+0x88/0x120 [pcmcia_core]
Aug  1 15:01:45 vermuden kernel:  [e5e049f0] socket_remove+0x10/0x40 [pcmcia_core]
Aug  1 15:01:45 vermuden kernel:  [e5e04a93] socket_detect_change+0x73/0x80 [pcmcia_core]
Aug  1 15:01:45 vermuden kernel:  [e5e04c28] pccardd+0x188/0x1b0 [pcmcia_core]
Aug  1 15:01:45 vermuden kernel:  [c011e090] default_wake_function+0x0/0x30
Aug  1 15:01:45 vermuden kernel:  [c010b102] ret_from_fork+0x6/0x14
Aug  1 15:01:45 vermuden kernel:  [c011e090] default_wake_function+0x0/0x30
Aug  1 15:01:45 vermuden kernel:  [e5e04aa0] pccardd+0x0/0x1b0 [pcmcia_core]
Aug  1 15:01:45 vermuden kernel:  [c0109245] kernel_thread_helper+0x5/0x10
Aug  1 15:01:45 vermuden kernel: 
Aug  1 15:01:45 vermuden kernel: Code: 8b 70 48 85 f6 74 76 8b 56 4c 8d 6e 4c 39 ea 74 45 8b 87 20 




---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [PATCH] fixes for usb-skeleton.c

2003-08-14 Thread Greg KH
On Wed, Aug 06, 2003 at 12:52:16PM +0200, Michal Sojka wrote:
 Hello,
 
 I've found minor errors in usb-skeleton.c. First, there is no valid
 value of interface-minor in assignment to dev-minor. Second, when
 calling usb_deregister_dev the interface-minor must be valid or else
 minor isn't deregistered.

Next time CC: me so I don't miss patches like this.

Applied, thanks.

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] 2.6.0-test2-mm5 and USB

2003-08-14 Thread Robert L. Harris


Mine is compiled UHCI as per the output of the lspci -v.  Got a
usbsniffer and the command line options you want run (presuming it's a
software thing and not a hardware sniffer)?




Thus spake David Brownell ([EMAIL PROTECTED]):

 Robert L. Harris wrote:
 Thus spake Greg KH ([EMAIL PROTECTED]):
 On Thu, Aug 07, 2003 at 06:44:25PM -0400, Robert L. Harris wrote:
 
 Bus 001 Device 004: ID 04e6:0704 SCM Microsystems, Inc. 
 cannot get string descriptor 1, error = Broken pipe(32)
 cannot get string descriptor 2, error = Broken pipe(32)
 cannot get string descriptor 5, error = Broken pipe(32)
 
 That's a busted device :(
 
 
 Bus 001 Device 002: ID 0451:2046 Texas Instruments, Inc. TUSB2046 Hub
  Language IDs: none (cannot get min. string descriptor; got len=-1,
 error=32:Broken pipe)
 
 Hm, so is that.
 
 
 I can access the device under Windows and back on a 2.4.20ish kernel.
 
 
 Alan Stern and I have been exchanging a bit of email offline...
 
 It seems that the uhci-hcd driver is reporting some transfers
 as stalls (EPIPE, errno 32) that it shouldn't be.  Unclear why;
 someone needs a USB sniffer to show what's up.  But it is clear
 that the same device reports stalls with uhci-hcd, yet it works
 without any errors when ohci-hcd is used.  Using OHCI vs UHCI
 being the only variable.
 
 - Dave

:wq!
---
Robert L. Harris | GPG Key ID: E344DA3B
 @ x-hkp://pgp.mit.edu
DISCLAIMER:
  These are MY OPINIONS ALONE.  I speak for no-one else.

Life is not a destination, it's a journey.
  Microsoft produces 15 car pileups on the highway.
Don't stop traffic to stand and gawk at the tragedy.


pgp0.pgp
Description: PGP signature


[linux-usb-devel] Re: [PATCH]remove GFP_DMA from pegasus

2003-08-14 Thread Greg KH
On Wed, Aug 06, 2003 at 12:35:04AM +0200, Oliver Neukum wrote:
 Hi,
 
 GFP_DMA has no place in USB drivers, as its meaning is inconsistent
 across architectures.

Applied, thanks.

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Re: Suggested reorganization of usb_reset_device() etc.

2003-08-14 Thread Oliver Neukum

 I'm not sure about your first example.  Configuration changes would take 
 place immediately under my scheme, but unbinding the old interface drivers 
 and probing the new interfaces would be deferred.  Is anything wrong with 

That is deadly. Drivers would work on the wrong interfaces. You cannot
block ep 0, so blocking endpoints immediately won't help you. You
need to unbind before you send the crucial control message.

 that?  When the config change is initiated through usbfs the deferral is 
 unnecessary, but when it's initiated by a driver the deferral is 
 essential.  It's not clear to me how to distinguish the two cases within 
 usb_set_configuration(), or if we even need to.

It is needed. In the second case you should defer for one interface only.

 Your second example, usb_set_interface() would remain practically
 unchanged.  It doesn't require unbinding anything, so it doesn't have to
 do anything fancy.  The only alteration is that I would like to separate
 out the actual message-sending -- usb_set_interface_physical() -- so that
 it could be shared by usb_reset_device() in the device-didn't-morph path.
 
 Actually, that suggests an unanswered question.  What should we do if the 
 device didn't morph, and we can restore the prior configuration, but for 
 some reason we can't restore an interface's prior altsetting?

Unbind and reprobe.
 
Regards
Oliver



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: Another Gadget-related question

2003-08-14 Thread Alan Stern
On Fri, 8 Aug 2003, David Brownell wrote:

 Alan Stern wrote:
  David:
  
  This question is somewhat theoretical; I don't expect it to come up.  But
  I'm curious.
  
  Do the slave controller drivers maintain message boundaries for bulk-out 
  endpoints, even if the gadget's request size doesn't match the host's 
  packet size?  
 
 Yes, modulo overflows and hardware mis-designs.

snip

 USB talks in terms of packets, and that's how both host and device
 side APIs talk.  If you want to accomodate the two sides disagreeing
 on how much data is sent, then each side needs to avoid issuing short
 reads ... and have some strategy for coping with that disagreement.

Like I said, the question was theoretical.  The reason for it has to do
with efficient buffering.  The host sends out messages composed of
sectors, each 512 bytes, starting at an arbitrary sector number.  But the
slave wants its buffer to contain sector numbers aligned at a page
boundary (multiple of 4K).  Since the USB bulk data transfer is just a
stream, the simplest way to get the desired alignment is make the first
request be for just enough sectors to reach a page boundary, then make
subsequent requests fill the entire buffer.

So long as the maxpacket size divides the sector size, this scheme ought 
to work okay.  Fortunately, the gadget driver is in charge of the 
maxpacket value.  I assume anything = the controller's limit will be 
acceptable.

Alan Stern



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH]remove GFP_DMA from pegasus

2003-08-14 Thread Petko Manolov
On Wed, 6 Aug 2003, Oliver Neukum wrote:

 Am Mittwoch, 6. August 2003 08:24 schrieb Petko Manolov:
  On Wed, 6 Aug 2003, Oliver Neukum wrote:
 
   GFP_DMA has no place in USB drivers, as its meaning is inconsistent
   across architectures.
 
  The patch looks ok to me, although GFP_DMA used to mean that the allocated
  memory will be contiguous and taken from the dma-able memory.  If this is
  no longer needed then it's better if GFP_DMA go away.

 GFP_DMA means capable of DMA on an ISA bus.

Well, not necessarily.  I used to work with a MIPS based SOC where the
only dma-able memory was sram which was on the same die.  It had nothing
to do with ISA or any other bus.
Anyway, GFP_DMA was doing the right thing there.


Petko


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Re: Comments/questions about the Gadget API

2003-08-14 Thread Greg KH
On Wed, Aug 06, 2003 at 10:48:22PM +0200, Oliver Neukum wrote:
 Am Mittwoch, 6. August 2003 22:09 schrieb David Brownell:
  Alan Stern wrote:
   David:
   
   A few things have come while planning my gadget driver.
   
   The gadgetfs API still looks a bit preliminary.  Judging by the source,
   there doesn't even appear to be any way to halt an endpoint!  Anyway, I
   decided not to use it; the performance penalties would make it a bad model 
   for this purpose in any case.
  
  Halt endpoints by doing a wrong direction I/O ... read from an IN endpoint
  (instead of writing to the host), or write to an OUT endpoint (instead of
  reading what it wrote).  This idiom avoids use of ioctls, and makes use
  of a code path that would otherwise just return an error.
 
 That is worse than an ioctl.

No.

 Read and write should transfer data, not change status of an io channel.

Sounds like a valid thing for a special purpose fs to do (is simple, and
can be done in any language, and doesn't require special thunking ioctl
layer.)

thanks,

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [patch 2.6.0-test3] ov511 sysfs conversion (3/3)

2003-08-14 Thread Greg KH
On Wed, Aug 13, 2003 at 07:15:11AM -0700, Mark McClelland wrote:
 This patch adds some read-only files to ov511's sysfs directory. The 
 read/write attributes will be added in a future patch. For now, the 
 read/write-related code is #if'd out to prevent warnings.
 
 Please apply.

Applied, thanks.

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] use of __devinit in st5481

2003-08-14 Thread Greg KH
On Wed, Aug 06, 2003 at 11:44:00AM -0400, Alan Stern wrote:
 On Wed, 6 Aug 2003, Soewono Effendi wrote:
 
  On Wed, 6 Aug 2003 10:47:15 -0400 (EDT)
  Alan Stern [EMAIL PROTECTED] wrote:
  
   The upshot is that for USB, which is hotpluggable, __devinit and __devexit 
   are useless.  
  
  useless - danger! if usb modules are statically linked to kernel, since
  the functions with __init are removed! unless __devinit is used and
  hotplug is enabled.
 
 Dangerous yes, unless hotplug is enabled.  But hotplug should _always_ be 
 enabled when USB support is present.

No, this is not necessary.  See my other message about why this is so.

I think it's time to just always enable CONFIG_HOTPLUG as it doesn't
really buy us much these days...

thanks,

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] USB printer failure reports

2003-08-14 Thread Alan Stern
Peter and Daniel:

You two may be seeing the same (or related) errors.  Check out:

http://sourceforge.net/mailarchive/forum.php?thread_id=2912739forum_id=5398

http://sourceforge.net/mailarchive/forum.php?thread_id=2913755forum_id=5398

http://sourceforge.net/mailarchive/forum.php?thread_id=2914416forum_id=5398

http://sourceforge.net/mailarchive/forum.php?thread_id=2914267forum_id=5398

http://sourceforge.net/mailarchive/forum.php?thread_id=2916134forum_id=5398

Alan Stern



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: dvb usb driver sleeping in interrupt

2003-08-14 Thread Greg KH
On Wed, Aug 06, 2003 at 09:09:23PM +0200, Oliver Neukum wrote:
 Hi,
 
 submitting an URB in a completion handler requires GFP_ATOMIC to be
 used.

Applied, thanks.

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: Linux 2.6.0-test3

2003-08-14 Thread Jacek Kawa
Linus Torvalds wrote:

[...]

 Oliver Neukum:
   o USB: error return codes in usblp
   o USB: cleanup of usblp (release and poll)
   o USB: fix race condition in usblp_write

[...]

Well, I cannot finish printing anything now and I believe, that one of
above is responsible. 
It looks as if printer gets some amount of data but then communication 
'stops' and printer waits for more data (usually I have about 2cm 
of page printed, paper locked and later printer error leds start
blinking happily :)

Not sure, if it's directly related, but system seems to be less 
responsive later.

Version of usblp.c from 2.6.0-test2 compiled with 2.6.0-test3 does
not work as I expected (I can load module, but printer is not 
detected - no usual 'usblp0: USB Unidirectional printer dev 3 if 0 alt 1
proto 2 vid 0x03F0 pid' message in logs).

I traced my problem down to -test2-bk2 (with bk1 everything works
correctly).

o Printer is connected to /dev/usb/lp0; it's HP840c
o ver_linux output: http://zeus.polsl.gliwice.pl/kernel/2.6.0-test3/ver_linux
o config: http://zeus.polsl.gliwice.pl/kernel/2.6.0-test3/config
o dmesg: http://zeus.polsl.gliwice.pl/kernel/2.6.0-test3/dmesg
o /proc/bus/usb/devices: http://zeus.polsl.gliwice.pl/kernel/2.6.0-test3/devices
o some related logs: http://zeus.polsl.gliwice.pl/kernel/2.6.0-test3/logs

Any suggestions are welcome :)

jk

-- 
Jacek Kawa


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [patch 2.6.0-test2] usb_start_wait_urb() rewrite

2003-08-14 Thread David Brownell
Oliver Neukum wrote:
It's never a NOP unless the unlink somehow completed already.
As I said:  using async unlinks because I want to see all the
synchronization right here, clearly visible, no hidden magic.


OK, maybe I am dense, but this doesn't make sense.
Let's have another closer look:
+   /* abnormal: timed out, so force completion via unlink */
+   } else {
+   status = usb_unlink_urb(urb);
+   switch (status) {
+   case -EINPROGRESS:  /* normal */
+   case -EBUSY:/* already completing */
+   dev_err(urb-dev-dev, control/bulk timeout\n);
+   break;
+   default:
+   /* shouldn't happen */
+   dev_err(urb-dev-dev, c/b unlink err %d\n, status);
+   break;
}
-   } else
-   status = urb-status;
+   wait_for_completion(done);
What for? You already waited with schedule_timeout.
For the urb to complete.  The schedule_timeout() returned without
that completion.  We only forced the completion path to start, with
the unlink; if it wasn't already starting (maybe on another CPU).








---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Usb in 2.6 breaks proc

2003-08-14 Thread Matthew Dharm
It is a known SCSI issue.  I'm told that there are pending patches to
address this.

Matt

On Thu, Aug 07, 2003 at 04:49:32PM -0700, Greg KH wrote:
 On Thu, Aug 07, 2003 at 07:17:40PM -0400, Pete Zaitcev wrote:
  Greg, Matt  folks:
  
  There was a tangential report from one of our users that /proc
  seems to get corrupt when usb-storage is rmmod-ed and inserted again.
  
  Kernel 2.6.0-0.test2.1.29 (Arjan's -test2 based RPM).
  
  Problem looks like this:
  
  [EMAIL PROTECTED] scsi]# pwd
  /proc/scsi
  [EMAIL PROTECTED] scsi]# find
  .
  ./usb-storage
  ./usb-storage/2
  ./usb-storage
  ./usb-storage/2
  ./device_info
  ./scsi
 
 Ouch, could this be a scsi issue?  I know a bunch of patches are pending
 to get into Linus's tree with regards to scsi reference counting and
 such.
 
 thanks,
 
 greg k-h
 -
 To unsubscribe from this list: send the line unsubscribe linux-scsi in
 the body of a message to [EMAIL PROTECTED]
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Matthew Dharm  Home: [EMAIL PROTECTED] 
Maintainer, Linux USB Mass Storage Driver

We can customize our colonels.
-- Tux
User Friendly, 12/1/1998


pgp0.pgp
Description: PGP signature


[linux-usb-devel] Re: Another Gadget-related question

2003-08-14 Thread David Brownell
Alan Stern wrote:

So long as the maxpacket size divides the sector size, this scheme ought 
to work okay.  Fortunately, the gadget driver is in charge of the 
maxpacket value.  I assume anything = the controller's limit will be 
acceptable.
Well, there are bulk maxpacket size constraints in the USB protocol.
They're all powers of two, and at high speed it's fixed at 512.
So yes, if you're streaming sectors of 2^N bytes it'll be hard to have
any problems in that area.  Unless N  3, which would be perverse!
- Dave





---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [patch 2.6.0-test3] ov511 sysfs conversion (2/3)

2003-08-14 Thread Mark McClelland
This patch converts ov511 to dynamically allocate struct video_device, 
using the new interfaces in videodev.[ch]. This is required to safely 
support sysfs without races.

Please apply.

--
Mark McClelland
[EMAIL PROTECTED]

===


[EMAIL PROTECTED], 2003-08-13 06:50:45-07:00, [EMAIL PROTECTED]
  ov511: convert struct video_device to dynamic allocation


 ov511.c |   59 +++---
 ov511.h |4 ---
 2 files changed, 35 insertions, 28 deletions


# This is a BitKeeper generated patch for the following project:
# Project Name: greg k-h's linux 2.5 USB kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#  ChangeSet1.2254  - 1.2255 
#   drivers/usb/media/ov511.h   1.20- 1.21   
#   drivers/usb/media/ov511.c   1.56- 1.57   
#
# The following is the BitKeeper ChangeSet Log
# 
# 03/08/13  [EMAIL PROTECTED]   1.2255
# ov511: convert struct video_device to dynamic allocation
# 
#
diff -Nru a/drivers/usb/media/ov511.c b/drivers/usb/media/ov511.c
--- a/drivers/usb/media/ov511.c Wed Aug 13 06:54:22 2003
+++ b/drivers/usb/media/ov511.c Wed Aug 13 06:54:22 2003
@@ -45,6 +45,7 @@
 #include asm/semaphore.h
 #include asm/processor.h
 #include linux/mm.h
+#include linux/device.h
 
 #if defined (__i386__)
#include asm/cpufeature.h
@@ -4042,7 +4043,7 @@
 ov51x_v4l1_open(struct inode *inode, struct file *file)
 {
struct video_device *vdev = video_devdata(file);
-   struct usb_ov511 *ov = vdev-priv;
+   struct usb_ov511 *ov = video_get_drvdata(vdev);
int err, i;
 
PDEBUG(4, opening);
@@ -4099,7 +4100,7 @@
 ov51x_v4l1_close(struct inode *inode, struct file *file)
 {
struct video_device *vdev = file-private_data;
-   struct usb_ov511 *ov = vdev-priv;
+   struct usb_ov511 *ov = video_get_drvdata(vdev);
 
PDEBUG(4, ov511_close);
 
@@ -4141,7 +4142,7 @@
  unsigned int cmd, void *arg)
 {
struct video_device *vdev = file-private_data;
-   struct usb_ov511 *ov = vdev-priv;
+   struct usb_ov511 *ov = video_get_drvdata(vdev);
PDEBUG(5, IOCtl: 0x%X, cmd);
 
if (!ov-dev)
@@ -4542,7 +4543,7 @@
 
memset(vu, 0, sizeof(struct video_unit));
 
-   vu-video = ov-vdev.minor;
+   vu-video = ov-vdev-minor;
vu-vbi = VIDEO_NO_UNIT;
vu-radio = VIDEO_NO_UNIT;
vu-audio = VIDEO_NO_UNIT;
@@ -4581,7 +4582,7 @@
 unsigned int cmd, unsigned long arg)
 {
struct video_device *vdev = file-private_data;
-   struct usb_ov511 *ov = vdev-priv;
+   struct usb_ov511 *ov = video_get_drvdata(vdev);
int rc;
 
if (down_interruptible(ov-lock))
@@ -4599,7 +4600,7 @@
struct video_device *vdev = file-private_data;
int noblock = file-f_flagsO_NONBLOCK;
unsigned long count = cnt;
-   struct usb_ov511 *ov = vdev-priv;
+   struct usb_ov511 *ov = video_get_drvdata(vdev);
int i, rc = 0, frmx = -1;
struct ov511_frame *frame;
 
@@ -4753,7 +4754,7 @@
struct video_device *vdev = file-private_data;
unsigned long start = vma-vm_start;
unsigned long size  = vma-vm_end - vma-vm_start;
-   struct usb_ov511 *ov = vdev-priv;
+   struct usb_ov511 *ov = video_get_drvdata(vdev);
unsigned long page, pos;
 
if (ov-dev == NULL)
@@ -4805,6 +4806,8 @@
.type = VID_TYPE_CAPTURE,
.hardware = VID_HARDWARE_OV511,
.fops = ov511_fops,
+   .release =  video_device_release,
+   .minor =-1,
 };
 
 /
@@ -5688,7 +5691,6 @@
struct usb_interface_descriptor *idesc;
struct usb_ov511 *ov;
int i;
-   int registered = 0;
 
PDEBUG(1, probing for device...);
 
@@ -5748,7 +5750,7 @@
break;
default:
err(Unknown product ID 0x%04x, dev-descriptor.idProduct);
-   goto error_dealloc;
+   goto error;
}
 
info(USB %s video device found, symbolic(brglist, ov-bridge));
@@ -5765,7 +5767,7 @@
 
if (usb_make_path(dev, ov-usb_path, OV511_USB_PATH_LEN)  0) {
err(usb_make_path error);
-   goto error_dealloc;
+   goto error;
}
 
/* Allocate control transfer buffer. */
@@ -5807,36 +5809,46 @@
}
 #endif
 
-   memcpy(ov-vdev, vdev_template, sizeof(vdev_template));
-   ov-vdev.priv = ov;
+   ov-vdev = video_device_alloc();
+   if (!ov-vdev)
+   goto error;
+
+   memcpy(ov-vdev, vdev_template, sizeof(*ov-vdev));
+  

Re: [linux-usb-devel] some analysis of a hang

2003-08-14 Thread Alan Stern
On Tue, 12 Aug 2003, David Brownell wrote:

 Alan Stern wrote:
 
  Maybe it's an attempt to protect against the device-morphed possibility.  
  I'm planning a re-write of that whole area.  For now, it would probably be 
  okay to remove the down_read() and up_read() in usb_reset_device().
 
 That morphed branch looks rather broken to me -- is there any
 reason to believe it ever worked?

No.  It never worked, and there's no reason to believe it ever worked.

  For now I'm assuming that it
 would be better implemented as a dev_warn() and usb_disconnect().
 (And most of those error paths should usb_disconnect, instead
 of what they now do ..)

That would still cause a lock-up for Andries, because it's occurring 
during probe().

 I'm thinking that all the config change logic for a given device
 should be synchronizing using dev-serialize ... that seems to
 be used only in usbfs right now, so it's useless except to keep
 two user mode tasks from stepping on each other.
 
 Any routine that issues SET_CONFIGURATION or SET_INTERFACE should
 probably lock against routines affecting that same device.  That
 serialize lock has the right scope:  device, not all-of-usb.
 Getting that scope right should make this hang vanish.

Using dev-serialize was part of my proposal for the reset_device()  
reorganization.  However, the locking may not be as necessary as you
think.  Following Oliver's suggestion, set_configuration() would unbind
all interfaces other than the one making the request before doing anything
else.

Of course, that still leaves the problem of requests coming by way of
usbfs or sysfs.  My proposal addressed that too.  The usb_device structure
would get a new flag, state_change_pending.  If the flag was already set,
usb_reset_device(), usb_set_configuration(), and usb_set_interface() --
and now also usb_reset_configuration() -- would merely return -EBUSY.

Alan Stern




---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: Comments/questions about the Gadget API

2003-08-14 Thread David Brownell
Alan Stern wrote:
David:

A few things have come while planning my gadget driver.

The gadgetfs API still looks a bit preliminary.  Judging by the source,
there doesn't even appear to be any way to halt an endpoint!  Anyway, I
decided not to use it; the performance penalties would make it a bad model 
for this purpose in any case.
Halt endpoints by doing a wrong direction I/O ... read from an IN endpoint
(instead of writing to the host), or write to an OUT endpoint (instead of
reading what it wrote).  This idiom avoids use of ioctls, and makes use
of a code path that would otherwise just return an error.
It's a bit preliminary mostly in the sense that it's not been widely used
yet, and I want to change how SET_CONFIGURATION gets handled (as I mentioned).
But otherwise it's behaved well enough, except for some of the 2.4 hacks.
Yes, I tend to think that userspace isn't the right place for a mass storage
gadget driver to live.  Even things like automounting usually limit the
userspace hooks to directory lookups, instead of bulk i/o.  On the other
hand there's a lot to be said for drivers that won't oops because they
aren't in the kernel ... :)

The kerneldoc for usb_ep_set_halt() says that the endpoint will remain
halted until the host clears it.  Is that really true, the gadget driver
can't clear the HALT feature?  The kerneldoc says that usb_ep_clear_halt()  
should be used when changing altsettings; if it works then, why doesn't it
work at other times?  This could use clarification.
Basically it does remain halted until the host clears it ... changing
altsettings is done only at host request!  :)
But yes, that's worth some clarifying.  The main trouble spot today is
that some hardware (pxa2xx_udc for example) doesn't support it in any case
(and can't use altsettings).

usb_ep_queue() says it will return an error if the endpoint is halted.
This isn't acceptable; we have to be able to queue bulk-in data on a
halted endpoint, at the very least
You'll be glad to know that's not correct ... none of the drivers even
check, since they don't (can't) know if the endpoint is halted.  Doc
fix is needed.

A related issue has to do with setting the HALT feature when the host
tries to read/write too much.  The premature end of a bulk-in transfer can
be indicated by a short or zero-length packet.  But you recommend avoiding
ZLPs, and if the total transfer length is divisible by the packet size
then there won't be a short packet.  The correct thing to do is to halt
the endpoint when the slave receives an excess IN PID.  But we don't want
The device will be NAKing in such cases, when the host asks for a packet
and there's no data.  Avoiding ZLPs is mostly a practical matter for protocols,
since not all hardware handles them ... if you're working with hardware that
handles them, and with a device protocol where the host will read them, by all
means write a ZLP to the host.  It ought to work just fine.
Sending an automagic STALL response to the host would be wrong; the controller
driver can't even know if an IN is excess or just early (before the
gadget driver had quite finished preparing the data).
Example:  if the host writes READ_10, the gadget driver will read that and
start processing it.  The host will usually try to read the data bytes next,
but the gadget might not be able to write any until a disk delivers the data.
It would be incorrect to STALL ... but it's very correct to NAK.

to halt if there is no excess IN request, because in that case the host
shouldn't have to clear the halt.  That means there has to be a way to set
the state of a bulk endpoint so that it responds to the host by halting
but otherwise remains running, a conditionally halted state.  And of 
course, the gadget needs to be able to take the endpoint out of this state 
back to its normal running state.
Again, seems like NAK is the answer.  And the way to make the gadget stop
NAKing is to provide some data for it to deliver to the host:   submit
a request to that IN endpoint, with its data buffer.
If a STALL is the right response, then halt the endpoint.  Otherwise the
only non-error responses are to NAK, or to provide the requested DATA.


Similar reasoning applies to OUT transfers.  We don't want the controller
to ACK (and store in its FIFO) excess data that the gadget can't accept;  
we want it to stall.  In fact, to avoid races it would be good to add an
extra flag bit to struct usb_request, saying that as soon as the request
finishes normally the endpoint should be placed in this conditional-halt  
state.  (For bulk-in requests such a flag isn't necessary because we
aren't racing the hardware, but it would be nice to have.)
This case is a lot harder.  The symmetrical answer is that the device
NAKs the OUT transfer (or, at high speed, the PING) until you issue a
read ... but it seems like the people designing hardware don't often
support that flow control model.  (Likely because it increases latencies,
and isn't actually necessary.)
So 

[linux-usb-devel] usb_bulk_msg

2003-08-14 Thread McGivern, Damien

I've added a couple extra ioctl's within hiddev.c to allow me to read and
write char arrays but I'm having problems with my read code. Could someone
please tell me what's wrong with the code below, as it always times out even
if I increase the timeout value and I know there's data being send back up
as i have a USB anyliser that can see the data flow between the OS and the
device.

Damien

// hiddev_ioctl

struct dmg_response resp;
int pipe = usb_rcvbulkpipe( dev, 0x01);
int bytes_read = 0;
int bytes_to_read = 64;
int reply;

char * in_buffer = kmalloc( sizeof(char)*64, GFP_KERNEL );

// read
reply = usb_bulk_msg(  dev, // usb device
pipe,   // pipe
in_buffer,  // data buffer
bytes_to_read,  // number of bytes to read
(64)
bytes_read,// number of bytes read
10*HZ); // timeout value (10
seconds)


printk(reply = %d\t bytes_read = %d\n, reply, bytes_read);


// set response
resp.data_length = bytes_read;
if( reply == 0  bytes_read  0)
memcpy(resp.data, in_buffer, bytes_read);


if( copy_to_user( (void *)arg, resp, sizeof(resp) ) )
printk(unable to copy to user space\n);


kfree(in_buffer);
return reply;


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: 2.6-test3 compusa USB optical mouse

2003-08-14 Thread David Brownell

I tested this patch on kernel-2.6.0-test3 and this happens when I plug
in the CompUSA Optical USB Notebook Mouse.
hub 1-0:0: debounce: port 2: delay 100ms stable 4 status 0x301
hub 1-0:0: new USB device on port 2, assigned address 5
usb 1-2: illegal descriptors, for config #0
drivers/usb/core/message.c: error getting string descriptor 0
(error=-75)
Then it seems that all USB devices seize to function, including my
Logitech USB keyboard.  If I am not in X I am able to use my laptop's
internal PS/2 keyboard to poweroff.  If I am in X it freezes completely.
With no more messages from USB at all?  That's quite odd,
it shouldn't be acting that rudely.  Does 2.4 do that too?

Any other suggestions?
Unless someone else has bright ideas, just return that hardware
as defective.  The illegal descriptors seem to be paired with
other flaws.
- Dave



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] USB_ST_DATAOVERRUN with ohci and ISO-OUT, 2.4.21 kernel

2003-08-14 Thread Pete Zaitcev
  I get occaisonally the error flag USB_ST_DATAOVERRUN when the interrupt 
  handler is called with an ISO-out transmission. This only happens with 
  the ohci driver. Especially strange that it happens in the interrupt 
  handler and with ISO which has no ACK.

Are you on SMP in 2.4? Worse, HT?

-- Pete


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Re: [PATCH] oops in sd_shutdown

2003-08-14 Thread Mike Anderson
Greg KH [EMAIL PROTECTED] wrote:
 On Tue, Aug 12, 2003 at 07:53:53AM +0100, Christoph Hellwig wrote:
  On Tue, Aug 12, 2003 at 12:28:44AM +0200, Andries Brouwer wrote:
   I see an Oops in the SCSI code, caused by the fact that sdkp is NULL
   in sd_shutdown. How can that be?, you will ask - dev-driver_data was set
   in sd_probe. But in my case sd_probe never finished. An insmod usb-storage
   hangs forever, or at least for more than six hours, giving ample opportunity
   to observe this race between sd_probe and sd_shutdown.
   (Of course sd_probe hangs in sd_revalidate disk.)
  
  Well, this same problem could show upb in any other driver.  Could
  you instead send a patch to Pat that the driver model never calls
  the shutdown method for a driver that hasn't finished -probe?
 
 I think it already will not do that due to taking the bus-subsys.rwsem
 before calling either probe() or remove().
 

Is the shutdown being called directly? The shutdown call is protected by
a different rwsem. Depending on the call graph setting dev-driver on
return of probe may provide a solution. I have not looked at all probe
routines to understand if this would cause any bad side effects.

Andries,
Can you send the oops output?

-andmike
--
Michael Anderson
[EMAIL PROTECTED]



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Re: [PATCH] oops in sd_shutdown

2003-08-14 Thread Greg KH
On Mon, Aug 11, 2003 at 11:35:26PM -0700, Jeff Woods wrote:
 At +0200 04:49 AM 8/12/2003, Andries Brouwer wrote:
 On Mon, Aug 11, 2003 at 06:13:50PM -0700, Jeff Woods wrote:
 
 Looking only at the above code snippet, I'd suggest something more like:
 
 +   if (!sdp ||
 
 This is not meaningful.
 
 How is it not meaningful?  The next action in the expression is to 
 dereference the pointer and if it has a NULL value then I expect the 
 dereference to fail.  [But I am a complete newbie with respect to Linux 
 kernel and driver code so perhaps my understanding is in error.  If so, 
 please enlighten me.]

sdp can not be NULL in this case.  That is why it is not meaningful to
try to check for it.

thanks,

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: 2.6-test3 compusa USB optical mouse

2003-08-14 Thread Warren Togami
On Sun, 2003-08-10 at 18:52, Andrew Morton wrote:
 Warren Togami [EMAIL PROTECTED] wrote:
 
  I normally use Logitech optical USB mice in Linux.  I bought a CompUSA
  Optical USB Notebook Mouse for $14 and the following happens in dmesg
  in kernel-2.6.0-test3.
  
  Known bug?  Should I Bugzilla this?
  
  hub 1-1:0: debounce: port 2: delay 100ms stable 4 status 0x301
  hub 1-1:0: new USB device on port 2, assigned address 8
  drivers/usb/core/message.c: selecting invalid configuration 0
  usb 1-1.2: failed to set device 8 default configuration (error=-22)
  hub 1-1:0: new USB device on port 2, assigned address 9
  drivers/usb/core/message.c: selecting invalid configuration 0
  usb 1-1.2: failed to set device 9 default configuration (error=-22)
 
 You don't state whether the mouse actually works.
 
 Assuming it doesn't, yes, please bugzilla it, or bug the folks at
 [EMAIL PROTECTED]

http://bugzilla.kernel.org/show_bug.cgi?id=1077
Filed Bugzilla.  Indeed the mouse does not work.

Thanks,
Warren Togami
[EMAIL PROTECTED]



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Re: [PATCH]remove GFP_DMA from pegasus

2003-08-14 Thread Alan Cox
On Mer, 2003-08-06 at 07:24, Petko Manolov wrote:
 On Wed, 6 Aug 2003, Oliver Neukum wrote:
 
  GFP_DMA has no place in USB drivers, as its meaning is inconsistent
  across architectures.
 
 The patch looks ok to me, although GFP_DMA used to mean that the allocated
 memory will be contiguous and taken from the dma-able memory.  If this is
 no longer needed then it's better if GFP_DMA go away.

GFP_DMA means ISA DMAable memory (low 16Mb), its obsolete and you should
be using the pci_alloc/dma_alloc interfaces in 2.6-test



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] 2.4.22-rc1-ac1 versus 2.6.0-test2-ac1 andbroken usb-storage/Clie

2003-08-14 Thread Alan Stern
On Sat, 9 Aug 2003, Robert L. Harris wrote:

 Attaching the messages file from the 2 boots.  On both runs I boot the
 system, load usb-storage and plugin/turn on my archos jukebox.  On the
 2.6 run I tried to init6 but I have to SysRq the system for a reboot.

I just had a chance to look at your log messages.  They don't include any 
debugging information.  Either you didn't have 
CONFIG_USB_STORAGE_DEBUGGING set in your kernels or you had syslogd 
configured to ignore debugging messages.

Alan Stern



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] 2.4.22-rc1-ac1 versus 2.6.0-test2-ac1 andbroken usb-storage/Clie

2003-08-14 Thread Alan Stern
On Mon, 11 Aug 2003, Robert L. Harris wrote:

 Bah, it went to kern.log.  Attaching that compressed.  If this isn't
 what you want or is too much debugging let me know.  This is the whole
 log file incase something is mixed in the middle.

Okay, I see the problem with 2.6.  It stems from a change I made but 
didn't examine carefully enough.  The attached patch ought to fix things, 
bringing 2.6 up to the performance level of 2.4 -- I know that's not 
saying very much!  But at least it's a start.  If the patch works I'll 
submit it, so send another kernel log.

The problem with 2.4 wasn't apparent from your log.  It may be a problem 
involving the SCSI layer.  usb-storage succeeded in probing and 
registering the drive and then didn't receive any more requests until you 
rmmod'ed it 30 seconds later.

Alan Stern


# This is a BitKeeper generated patch for the following project:
# Project Name: greg k-h's linux 2.5 USB kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#  ChangeSet1.1659  - 1.1660 
#   drivers/usb/storage/isd200.c1.41- 1.42   
#
# The following is the BitKeeper ChangeSet Log
# 
# 03/08/12  [EMAIL PROTECTED]   1.1660
# Don't do DMA into the middle of a structure (info-drive).
# Don't use I/O buffers for two different purposes simultaneously
#   (info-ATARegs, regs, us-iobuf).
# 
#
diff -Nru a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c
--- a/drivers/usb/storage/isd200.c  Tue Aug 12 16:11:14 2003
+++ b/drivers/usb/storage/isd200.c  Tue Aug 12 16:11:14 2003
@@ -272,8 +272,9 @@
 
 struct isd200_info {
struct inquiry_data InquiryData;
-   struct hd_driveid drive;
+   struct hd_driveid *drive;
struct isd200_config ConfigData;
+   unsigned char *RegsBuf;
unsigned char ATARegs[8];
unsigned char DeviceHead;
unsigned char DeviceFlags;
@@ -473,7 +474,7 @@
ata.generic.RegisterSelect = REG_COMMAND;
ata.write.CommandByte = WIN_IDENTIFY;
srb-sc_data_direction = SCSI_DATA_READ;
-   srb-request_buffer = (void *)info-drive;
+   srb-request_buffer = (void *) info-drive;
srb-request_bufflen = sizeof(struct hd_driveid);
break;
 
@@ -513,11 +514,12 @@
US_DEBUGP(Entering isd200_IssueATAReadRegs\n);
 
transferStatus = isd200_action( us, ACTION_READ_STATUS,
-   info-ATARegs, sizeof(info-ATARegs) );
+   info-RegsBuf, sizeof(info-ATARegs) );
if (transferStatus != ISD200_TRANSPORT_GOOD) {
US_DEBUGP(   Error reading ATA registers\n);
retStatus = ISD200_ERROR;
} else {
+   memcpy(info-ATARegs, info-RegsBuf, sizeof(info-ATARegs));
US_DEBUGP(   Got ATA Register[IDE_ERROR_OFFSET] = 0x%x\n, 
  info-ATARegs[IDE_ERROR_OFFSET]);
}
@@ -835,9 +837,9 @@
   int detect )
 {
int status = ISD200_GOOD;
-   unsigned char *regs = us-iobuf;
unsigned long endTime;
struct isd200_info *info = (struct isd200_info *)us-extra;
+   unsigned char *regs = info-RegsBuf;
int recheckAsMaster = FALSE;
 
if ( detect )
@@ -984,6 +986,7 @@
 {
struct isd200_info *info = (struct isd200_info *)us-extra;
int retStatus = ISD200_GOOD;
+   struct hd_driveid *drive = info-drive;
 
US_DEBUGP(Entering isd200_get_inquiry_data\n);
 
@@ -1000,7 +1003,7 @@
/* this must be an ATA device */
/* perform an ATA Command Identify */
transferStatus = isd200_action( us, ACTION_IDENTIFY,
-   info-drive, 
+   drive, 
sizeof(struct hd_driveid) );
if (transferStatus != ISD200_TRANSPORT_GOOD) {
/* Error issuing ATA Command Identify */
@@ -1010,35 +1013,35 @@
/* ATA Command Identify successful */
int i;
__u16 *src, *dest;
-   ide_fix_driveid(info-drive);
+   ide_fix_driveid(drive);
 
US_DEBUGP(   Identify Data Structure:\n);
-   US_DEBUGP(  config = 0x%x\n, info-drive.config);
-   US_DEBUGP(  cyls = 0x%x\n, info-drive.cyls);
-   US_DEBUGP(  heads = 0x%x\n, info-drive.heads);
-   US_DEBUGP(  track_bytes = 0x%x\n, 

[linux-usb-devel] Continuing hid problems with 2.6.0-test2-mm4

2003-08-14 Thread David T Hollis
Problems with 2.6.0-test2-mm4 hid are continuing.  My usual temporary 
remedy was to remove hid and reload it which reactivated my usb mouse.  
Today I got this dump and rmmod hung trying to remove hid:

drivers/usb/core/usb.c: deregistering driver hiddev
drivers/usb/core/usb.c: deregistering driver hid
drivers/usb/core/usb.c: registered new driver hiddev
input: USB HID v1.00 Mouse [Microsoft Microsoft 3-Button Mouse with 
IntelliEye?] on usb-:02:0e.0-2
drivers/usb/core/usb.c: registered new driver hid
drivers/usb/input/hid-core.c: v2.0:USB HID core driver
drivers/usb/core/usb.c: deregistering driver hiddev
drivers/usb/core/usb.c: deregistering driver hid
drivers/usb/core/usb.c: registered new driver hiddev
input: USB HID v1.00 Mouse [Microsoft Microsoft 3-Button Mouse with 
IntelliEye?] on usb-:02:0e.0-2
drivers/usb/core/usb.c: registered new driver hid
drivers/usb/input/hid-core.c: v2.0:USB HID core driver
drivers/usb/core/usb.c: deregistering driver hiddev
drivers/usb/core/usb.c: deregistering driver hid
drivers/usb/core/usb.c: registered new driver hiddev
ohci-hcd :02:0e.0: OHCI Unrecoverable Error, disabled
pci_pool_destroy :02:0e.0/ohci_td, f78a9000 busy
pci_pool_destroy :02:0e.0/ohci_ed, f78aa000 busy
hub 3-0:0: debounce: port 3: delay 100ms stable 4 status 0x501
usb: raced timeout, pipe 0x8380 status -108 time left 0
drivers/usb/input/hid-core.c: usb_submit_urb(ctrl) failed

I'm rebuilding the kernel as we speak with USB_DEBUG enabled to see if 
it tells me anything further.  2.6.0-test2-mm2 works just fine, as have 
all other 2.5/2.6s to this point. 



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH]genelink_tx_fixup fails to check for memory allocation failure

2003-08-14 Thread Greg KH
On Mon, Aug 11, 2003 at 10:01:01PM +0200, Oliver Neukum wrote:
 Hi,
 
 this can oops.

Applied, thanks.

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH] oops in sd_shutdown

2003-08-14 Thread Andries Brouwer
I see an Oops in the SCSI code, caused by the fact that sdkp is NULL
in sd_shutdown. How can that be?, you will ask - dev-driver_data was set
in sd_probe. But in my case sd_probe never finished. An insmod usb-storage
hangs forever, or at least for more than six hours, giving ample opportunity
to observe this race between sd_probe and sd_shutdown.
(Of course sd_probe hangs in sd_revalidate disk.)

Perhaps the obvious test is a good idea.
Locking seems meaningless - sd_probe will never finish.

Andries

[Probably the init of usb_storage should start probing the devices in separate
threads, in parallel, and return immediately.]

The obvious patch (with whitespace damage)

diff -u --recursive --new-file -X /linux/dontdiff a/drivers/scsi/sd.c 
b/drivers/scsi/sd.c
--- a/drivers/scsi/sd.c Mon Jul 28 05:39:31 2003
+++ b/drivers/scsi/sd.c Tue Aug 12 01:24:51 2003
@@ -1351,10 +1351,14 @@
 static void sd_shutdown(struct device *dev)
 {
struct scsi_device *sdp = to_scsi_device(dev);
-   struct scsi_disk *sdkp = dev_get_drvdata(dev);
+   struct scsi_disk *sdkp;
struct scsi_request *sreq;
int retries, res;
 
+   sdkp = dev_get_drvdata(dev);
+   if (!sdkp)
+   return; /* this can happen */
+
if (!sdp-online || !sdkp-WCE)
return;
 



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [patch 2.6.0-test3] usb hc cleanup-after-death, oops fix

2003-08-14 Thread David Brownell
Recently we've seen some oopses reported in code that cleaned
up HCs after they died ... like pci-pm not letting ohci-hcd
suspend until after the hardware was partly disabled, or users
removing a Cardbus adapter with ehci-hcd.  One root cause was
that the cleanup called hcd-stop() too many times.
This patch just does the cleanup that's reasonable to do
before the (dead) root hub is cleaned up:  it disconnects
the other devices.  And based on a suggestion from Pavel,
a diagnostic always appears -- avoiding mystery.
Please merge for test4; thanks in advance!

- Dave

--- 1.71/drivers/usb/core/hcd.c Tue Aug  5 09:46:38 2003
+++ edited/drivers/usb/core/hcd.c   Tue Aug 12 16:07:44 2003
@@ -1494,8 +1494,16 @@
 
 static void hcd_panic (void *_hcd)
 {
-   struct usb_hcd *hcd = _hcd;
-   hcd-driver-stop (hcd);
+   struct usb_hcd  *hcd = _hcd;
+   struct usb_device   *hub = hcd-self.root_hub;
+   unsignedi;
+
+   /* hc's root hub is removed later removed in hcd-stop() */
+   hub-state = USB_STATE_NOTATTACHED;
+   for (i = 0; i  hub-maxchild; i++) {
+   if (hub-children [i])
+   usb_disconnect (hub-children [i]);
+   }
 }
 
 /**
@@ -1508,29 +1516,9 @@
  */
 void usb_hc_died (struct usb_hcd *hcd)
 {
-   struct list_head*devlist, *urblist;
-   struct hcd_dev  *dev;
-   struct urb  *urb;
-   unsigned long   flags;
-   
-   /* flag every pending urb as done */
-   spin_lock_irqsave (hcd_data_lock, flags);
-   list_for_each (devlist, hcd-dev_list) {
-   dev = list_entry (devlist, struct hcd_dev, dev_list);
-   list_for_each (urblist, dev-urb_list) {
-   urb = list_entry (urblist, struct urb, urb_list);
-   dev_dbg (hcd-controller, shutdown %s urb %p pipe %x, current 
status %d\n,
-   hcd-self.bus_name, urb, urb-pipe, urb-status);
-   if (urb-status == -EINPROGRESS)
-   urb-status = -ESHUTDOWN;
-   }
-   }
-   urb = (struct urb *) hcd-rh_timer.data;
-   if (urb)
-   urb-status = -ESHUTDOWN;
-   spin_unlock_irqrestore (hcd_data_lock, flags);
+   dev_err (hcd-controller, HC died; cleaning up\n);
 
-   /* hcd-stop() needs a task context */
+   /* clean up old urbs and devices; needs a task context */
INIT_WORK (hcd-work, hcd_panic, hcd);
(void) schedule_work (hcd-work);
 }


Re: [linux-usb-devel] Re: [usb-storage] Re: Linux 2.4.22-rc1

2003-08-14 Thread Alan Stern
On Sun, 10 Aug 2003, Fridtjof Busse wrote:

 
- dmesg output including all EHCI messages, with the usb code
  compiled with CONFIG_USB_DEBUG.  The most important bits
  will be any problems it reports, near when the scsi layer
  gets unhappy.
 
 According to Alan, the output didn't contain anything useful.
 Here's the log, it starts shortly before the drive goes wild:

That log was made with CONFIG_USB_STORAGE_DEBUG.  David is asking you for 
CONFIG_USB_DEBUG.  They're two different settings.

Alan Stern



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH]correct error handling in usb_driver_claim_interface()

2003-08-14 Thread Greg KH
On Mon, Aug 11, 2003 at 09:44:42PM +0200, Oliver Neukum wrote:
 Hi,
 
 this function races with itself, doesn't return errors and races with
 releasing interfaces. This patch fixes it by changing the function
 prototype, introducing locking and having a correct order in
 releasing interfaces.

So you're using the fact that lock_kernel() can recurse here, right?
That's not pretty :(

Hm, I _really_ hate this function in the first place, but I can see how
it could be necessary for some devices.  Since currently probe() is
called sequentially for a device (no other interfaces on the same device
can be called at the same time), this lock isn't really necessary,
right?

I really don't want to add lock_kernel() here if we can avoid it.

thanks,

greg k-h


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


  1   2   3   >