Am 23.02.2011 19:26, schrieb Alan Stern: > On Wed, 23 Feb 2011, Flynn Marquardt wrote: > >>> The solution is to fix synce-hal. It should request a 512-byte or >>> 1024-byte transfer, not a 256-byte transfer. >>> >>> You should report this bug to the Synce project. >>> >> I tried to fix it myself and searched for 256-byte buffer and did not >> find any ... >> >> But I fixed it anyway: the problem is the bulk_in_size in >> drivers/usb/serial/ipaq.c: >> >> .bulk_in_size = 256, >> >> I increased these values to 512: >> >> .bulk_in_size = 512, >> >> and it works now and is faster! Some other serial usb drivers also have >> this increased >> value, so it should be safe. diff is attached. > I didn't realize you were using the ipaq driver. > > Here's a more general patch that should help with all the USB serial > drivers. Can you try using this one instead of your own? > > Alan Stern > > > > Index: usb-2.6/include/linux/usb/serial.h > =================================================================== > --- usb-2.6.orig/include/linux/usb/serial.h > +++ usb-2.6/include/linux/usb/serial.h > @@ -191,7 +191,8 @@ static inline void usb_set_serial_data(s > * @id_table: pointer to a list of usb_device_id structures that define all > * of the devices this structure can support. > * @num_ports: the number of different ports this device will have. > - * @bulk_in_size: bytes to allocate for bulk-in buffer (0 = end-point size) > + * @bulk_in_size: minimum number of bytes to allocate for bulk-in buffer > + * (0 = end-point size) > * @bulk_out_size: bytes to allocate for bulk-out buffer (0 = end-point size) > * @calc_num_ports: pointer to a function to determine how many ports this > * device has dynamically. It will be called after the probe() > Index: usb-2.6/drivers/usb/serial/usb-serial.c > =================================================================== > --- usb-2.6.orig/drivers/usb/serial/usb-serial.c > +++ usb-2.6/drivers/usb/serial/usb-serial.c > @@ -911,9 +911,8 @@ int usb_serial_probe(struct usb_interfac > dev_err(&interface->dev, "No free urbs available\n"); > goto probe_error; > } > - buffer_size = serial->type->bulk_in_size; > - if (!buffer_size) > - buffer_size = le16_to_cpu(endpoint->wMaxPacketSize); > + buffer_size = max_t(int, serial->type->bulk_in_size, > + le16_to_cpu(endpoint->wMaxPacketSize)); > port->bulk_in_size = buffer_size; > port->bulk_in_endpointAddress = endpoint->bEndpointAddress; > port->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL); > I've tested it and it works also! Flynn
Attachment:
signature.asc
Description: OpenPGP digital signature