Re: USB scanner stops working with xhci_hcd URB transfer length is wrong, xHC issue? req. len = 0, act. len = 4294967288

2015-11-27 Thread Orion Poplawski
On 11/09/2015 06:46 AM, Mathias Nyman wrote: On 07.11.2015 05:50, Orion Poplawski wrote: On 11/06/2015 10:34 AM, Felipe Balbi wrote: Hi, Orion Poplawski writes: See https://bugzilla.kernel.org/show_bug.cgi?id=107331 Trying to use my scanner. Worked for a while, but

Re: [PATCH v5 7/7] usb: gadget: f_midi: pre-allocate IN requests

2015-11-27 Thread Felipe Ferreri Tonello
Hi Clemens On 27/11/15 09:05, Clemens Ladisch wrote: > Felipe Ferreri Tonello wrote: >> On 13/11/15 08:55, Clemens Ladisch wrote: >>> Felipe F. Tonello wrote: +static void f_midi_transmit(struct f_midi *midi) +{ +... + len = kfifo_peek(>in_req_fifo, ); +

Re: [PATCH v5 7/7] usb: gadget: f_midi: pre-allocate IN requests

2015-11-27 Thread Clemens Ladisch
Felipe Ferreri Tonello wrote: > One thing to consider is that the ALSA rawmidi device buffer is > sequential and our USB request buffer is not. This means that our 32 > (qlen) * 256 (buflen) = 8KB of data is non-linear. Some requests might > have 3 or 4 bytes (average size of a normal MIDI

[PATCH v2 28/29] usb: gadget: f_printer: conversion to new API

2015-11-27 Thread Robert Baldyga
Generate descriptors in new format and attach them to USB function in prep_descs(). Implement prep_vendor_descs() to supply class specific descriptors. Change set_alt() implementation and implement clear_alt() operation. Remove boilerplate code. Signed-off-by: Robert Baldyga

[PATCH v2 25/29] usb: gadget: f_acm: conversion to new API

2015-11-27 Thread Robert Baldyga
Generate descriptors in new format and attach them to USB function in prep_descs(). Implement prep_vendor_descs() to supply class specific descriptors. Change set_alt() implementation and implement clear_alt() operation. Remove boilerplate code. Signed-off-by: Robert Baldyga

[PATCH v2 26/29] usb: gadget: f_eem: conversion to new API

2015-11-27 Thread Robert Baldyga
Generate descriptors in new format and attach them to USB function in prep_descs(). Implement prep_vendor_descs() to supply class specific descriptors. Change set_alt() implementation and implement clear_alt() operation. Remove boilerplate code. Signed-off-by: Robert Baldyga

[PATCH v2 03/29] usb: gadget: f_loopback: free requests in loopback_disable()

2015-11-27 Thread Robert Baldyga
USB requests in Loopback function are allocated in loopback_get_alt() function, so we prefer to free them rather in loopback_disable() than in loopback_complete() when request is completed with error. It provides better symetry in resource management and improves code readability. Signed-off-by:

Re: [PATCH 1/3] usb: musb: convert printk to pr_*

2015-11-27 Thread Sergei Shtylyov
Hello. On 11/27/2015 1:38 PM, Rasmus Villemoes wrote: This file already uses pr_debug in a few places; this converts the remaining printks. Are you aware that printk(KERN_DEBUG, ...) and pr_debug() are not equivalent? Signed-off-by: Rasmus Villemoes [...]

[PATCH v2 02/29] usb: gadget: f_sourcesink: free requests in sourcesink_disable()

2015-11-27 Thread Robert Baldyga
USB requests in SourceSink function are allocated in sourcesink_get_alt() function, so we prefer to free them rather in sourcesink_disable() than in source_sink_complete() when request is completed with error. It provides better symetry in resource management and improves code readability.

[PATCH v2 00/29] usb: gadget: composite: introduce new function API

2015-11-27 Thread Robert Baldyga
Hi Felipe, Here is my new patch series doing some changes in composite framework and modifying USB Function API. Some of concepts changed significantly, for example bind process is done automatically inside composite framework after collecting descriptors from all Functions. Hence bind()

[PATCH v2 01/29] usb: gadget: f_sourcesink: make ISO altset user-selectable

2015-11-27 Thread Robert Baldyga
So far it was decided during the bind process whether is iso altsetting included to f_sourcesink function or not. This decision was based on availability of isochronous endpoints. Since we can assemble gadget driver using composite framework and configfs from many different functions,

[PATCH v2 06/29] usb: gadget: composite: add functions for descriptors handling

2015-11-27 Thread Robert Baldyga
Introduce functions and macros allowing to create and assign descriptors to function easily. Macros build structure hierarchy using pointers to USB descriptors, while functions assigning them to gadget make a deep copy. It allows for easy conversion of USB functions to make them using new

[PATCH v2 11/29] usb: gadget: composite: disable eps before calling disable() callback

2015-11-27 Thread Robert Baldyga
Changes meaning of disable() operation for functions using new API. Before calling disable() callback composite automatically disables endpoints of active altsettings of given USB function. This reduces amount of boilerplate code in USB functions. Signed-off-by: Robert Baldyga

[PATCH v2 09/29] usb: gadget: composite: handle vendor descs

2015-11-27 Thread Robert Baldyga
After binding all configurations in gadget, call prep_vendor_descs() for each function which uses new API and implements this callback. Signed-off-by: Robert Baldyga --- drivers/usb/gadget/composite.c | 31 +++ include/linux/usb/composite.h |

[PATCH v2 05/29] usb: gadget: composite: introduce new descriptors format

2015-11-27 Thread Robert Baldyga
Introduce new structures designed to contain information about descriptors. It splits descriptors in two categories: 1. Entity descs - interface and endpoint descriptors 2. Vendor descs - all other vendor and class specific descriptors Entity descriptors are embedded in hierarchy of structures

[PATCH v2 10/29] usb: gadget: composite: generate old descs for compatibility

2015-11-27 Thread Robert Baldyga
For now we generate descriptor arrays for each speed as it is done by old API functions, to allow use mixed new and old API based functions in single configurations. This will be removed after complete switch to new API. Signed-off-by: Robert Baldyga ---

[PATCH v2 08/29] usb: gadget: composite: handle function bind

2015-11-27 Thread Robert Baldyga
As now USB function supplies entity descriptors to composite in prep_descs() callback, we can perform bind inside composite framework without involving bind() callback (which now is unused and will be removed after converting all functions in kernel to new API). For now we bind each configuration

[PATCH v2 07/29] usb: gadget: composite: introduce new USB function ops

2015-11-27 Thread Robert Baldyga
Introduce two new USB function operations: 1. prep_descs() prepares and assigns entity (interface and endpoint) descriptors to USB function. It's mandatory, in the new function API, as each USB function should have at least minimalistic set of entity descriptors. The minimum is single inferface

[PATCH v2 17/29] usb: gadget: composite: enable adding USB functions using new API

2015-11-27 Thread Robert Baldyga
Enable adding USB functions which use new API. Check if all necessary function ops are supplied and call prep_descs() to allow function register it's entity descriptors. Notice that bind() function is not called for USB functions using new API, as now bind procedure is handled for them in

[PATCH v2 15/29] usb: gadget: composite: add usb_function_get_ep() function

2015-11-27 Thread Robert Baldyga
Introduce function returning endpoint of given index in active altsetting of specified interface. It's intended to be used in set_alt() callback to obtain endpoints of currently selected altsetting. Signed-off-by: Robert Baldyga --- drivers/usb/gadget/composite.c | 33

[PATCH v2 16/29] usb: gadget: composite: add usb_get_interface_id() function

2015-11-27 Thread Robert Baldyga
Introduce function returning id of interface at given index in function. The id value is equal bInterfaceNumber field in interface descriptor. This value can be useful during preparation of class or vendor specific descriptors in prep_vendor_descs() callback. It can be also necessary to handle

[PATCH v2 22/29] usb: gadget: f_rndis: conversion to new API

2015-11-27 Thread Robert Baldyga
Generate descriptors in new format and attach them to USB function in prep_descs(). Implement prep_vendor_descs() to supply class specific descriptors. Change set_alt() implementation and implement clear_alt() operation. Remove boilerplate code. Change USB request lifetime management - now it's

[PATCH v2 21/29] usb: gadget: f_ecm: conversion to new API

2015-11-27 Thread Robert Baldyga
Generate descriptors in new format and attach them to USB function in prep_descs(). Implement prep_vendor_descs() to supply class specific descriptors. Change set_alt() implementation and implement clear_alt() operation. Get rid of get_alt() which now is handled automatically. Remove boilerplate

[PATCH v2 04/29] usb: gadget: configfs: fix error path

2015-11-27 Thread Robert Baldyga
As usb_gstrings_attach() failure can happen when some USB functions are are already added to some configurations (in previous loop iterations), we should always call purge_configs_funcs() to be sure that failure is be handled properly. Signed-off-by: Robert Baldyga ---

[PATCH v2 12/29] usb: gadget: composite: enable eps before calling set_alt() callback

2015-11-27 Thread Robert Baldyga
Change set_alt() behavior for functions using new API. Before we call set_alt() callback, we disable endpoints of previously selected altsetting, and enable endpoints of currently selected altsetting, which reduces amount of boilerplate code in USB functions. We also calculate index of interface

[PATCH v2 14/29] usb: gadget: composite: handle get_alt() automatically

2015-11-27 Thread Robert Baldyga
As now we store current altsetting number for each interface, we can handle USB_REQ_GET_INTERFACE automatically. Signed-off-by: Robert Baldyga --- drivers/usb/gadget/composite.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git

[PATCH v2 13/29] usb: gadget: composite: introduce clear_alt() operation

2015-11-27 Thread Robert Baldyga
Introduce clear_alt() callback, which is called when prevoiusly set altsetting is cleared. This can take place in two situations: - when another altsetting is selected, - during function disable. Thanks to symetry to set_alt(), clear_alt() simplifies managing of resources allocated in set_alt().

[PATCH v2 29/29] usb: gadget: f_serial: conversion to new API

2015-11-27 Thread Robert Baldyga
Generate descriptors in new format and attach them to USB function in prep_descs(). Change set_alt() implementation and implement clear_alt() operation. Remove boilerplate code. Signed-off-by: Robert Baldyga --- drivers/usb/gadget/function/f_serial.c | 122

[PATCH v2 27/29] usb: gadget: f_ncm: conversion to new API

2015-11-27 Thread Robert Baldyga
Generate descriptors in new format and attach them to USB function in prep_descs(). Implement prep_vendor_descs() to supply class specific descriptors. Change set_alt() implementation and implement clear_alt() operation. Remove boilerplate code. Signed-off-by: Robert Baldyga

[PATCH v2 20/29] usb: gadget: f_sourcesink: convert to new API

2015-11-27 Thread Robert Baldyga
Generate descriptors in new format and attach them to USB function in prep_descs(). Change set_alt() implementation and implement clear_alt() operation. Get rid of get_alt() callback, as now USB_REQ_GET_INTERFACE is handled automatically by composite framwework. Remove unnecessary boilerplate

[PATCH v2 18/29] usb: gadget: configfs: add new composite API support

2015-11-27 Thread Robert Baldyga
Handle functions using new API properly. Signed-off-by: Robert Baldyga --- drivers/usb/gadget/configfs.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c index 0557f80..153adf7 100644

[PATCH v2 24/29] usb: gadget: f_hid: conversion to new API

2015-11-27 Thread Robert Baldyga
Generate descriptors in new format and attach them to USB function in prep_descs(). Implement prep_vendor_descs() to supply class specific descriptors. Change set_alt() implementation and implement clear_alt() operation. Move cdev initialization to hidg_alloc(). Remove boilerplate code.

[PATCH v2 19/29] usb: gadget: f_loopback: convert to new API

2015-11-27 Thread Robert Baldyga
Generate descriptors in new format and attach them to USB function in prep_descs(). Change set_alt() implementation and implement clear_alt() operation. Remove unnecessary boilerplate code. Call usb_config_do_bind() in legacy gadget zero, because it uses usb_add_config_only() instead of

[PATCH v2 23/29] usb: gadget: f_hid: handle requests lifetime properly

2015-11-27 Thread Robert Baldyga
So far USB requests allocated in hidg_set_alt() were not freed. Now we free them in case of hidg_set_alt() failure (when we are not able to allocate and enqueue all the requests) or in hidg_disable() function. Signed-off-by: Robert Baldyga ---

[PATCH] xhci: Fix memory leak in xhci_pme_acpi_rtd3_enable()

2015-11-27 Thread Mika Westerberg
There is a memory leak because acpi_evaluate_dsm() actually returns an object which the caller is supposed to release. Fix this by calling ACPI_FREE() for the returned object (this expands to kfree() so passing NULL there is fine as well). While there correct indentation in !CONFIG_ACPI case.

patch - VID/PID for Yaesu SCU-18 cable for ftdi-usb-sio

2015-11-27 Thread Harald Linden
Add PID for Yaesu SCU-18 data cable, modify definitions for RATOC products to fit general scheme. --- ./drivers/usb/serial/ftdi_sio.c.orig 2015-11-28 00:14:58.411681897 +0100 +++ ./drivers/usb/serial/ftdi_sio.c 2015-11-28 00:15:28.112310588 +0100 @@ -823,7 +823,8 @@ static const struct

Re: [PATCH v1 0/1] ioctl to disallow detaching kernel USB drivers

2015-11-27 Thread Greg KH
On Fri, Nov 27, 2015 at 09:44:45AM +0100, Krzysztof Opasiak wrote: > > > On 11/26/2015 06:29 PM, Greg KH wrote: > >On Thu, Nov 26, 2015 at 10:19:29AM +0100, Krzysztof Opasiak wrote: > >> > >> > >>On 11/25/2015 04:45 PM, Emilio López wrote: > >>>Hi everyone, > >>> > >>>This patch introduces a new

Re: [PATCH 1/3] usb: musb: convert printk to pr_*

2015-11-27 Thread Greg Kroah-Hartman
On Fri, Nov 27, 2015 at 03:23:33PM +0300, Sergei Shtylyov wrote: > Hello. > > On 11/27/2015 1:38 PM, Rasmus Villemoes wrote: > > >This file already uses pr_debug in a few places; this converts the > >remaining printks. > >Are you aware that printk(KERN_DEBUG, ...) and pr_debug() are not >

Reply Me For Details

2015-11-27 Thread HS09912HH3
Good day, I wish to contact you personally for an important proposal that might be of interest to you. I am sending this mail just to know if this email address is functional. I have something absolutely essential to discuss with you. Contact me for details through my private email:

Re: patch - VID/PID for Yaesu SCU-18 cable for ftdi-usb-sio

2015-11-27 Thread Greg KH
On Sat, Nov 28, 2015 at 12:20:59AM +0100, Harald Linden wrote: > Add PID for Yaesu SCU-18 data cable, modify definitions for RATOC products > to fit general scheme. > > --- ./drivers/usb/serial/ftdi_sio.c.orig 2015-11-28 00:14:58.411681897 > +0100 > +++ ./drivers/usb/serial/ftdi_sio.c

Re: [PATCH v5 7/7] usb: gadget: f_midi: pre-allocate IN requests

2015-11-27 Thread Clemens Ladisch
Felipe Ferreri Tonello wrote: > On 13/11/15 08:55, Clemens Ladisch wrote: >> Felipe F. Tonello wrote: >>> +static void f_midi_transmit(struct f_midi *midi) >>> +{ >>> +... >>> + len = kfifo_peek(>in_req_fifo, ); >>> + ... >>> + if (req->length > 0) { >>> +

Re: [PATCH v1 0/1] ioctl to disallow detaching kernel USB drivers

2015-11-27 Thread Krzysztof Opasiak
On 11/26/2015 06:29 PM, Greg KH wrote: On Thu, Nov 26, 2015 at 10:19:29AM +0100, Krzysztof Opasiak wrote: On 11/25/2015 04:45 PM, Emilio López wrote: Hi everyone, This patch introduces a new ioctl, USBDEVFS_DROP_PRIVILEGES, to voluntarily forgo the ability to issue ioctls which may

Re: [linux-sunxi] Re: [PATCH v3 1/2] phy-sun4i-usb: Use of_match_node to get model specific config data

2015-11-27 Thread Maxime Ripard
On Thu, Nov 26, 2015 at 01:11:32PM +0100, Hans de Goede wrote: > >>+enum sun4i_usb_phy_type { > >>+ sun4i_a10_phy, > >>+ sun8i_a33_phy, > >>+}; > >>+ > >>+struct sun4i_usb_phy_cfg { > >>+ int num_phys; > >>+ u32 disc_thresh; > >>+ enum sun4i_usb_phy_type type; > >>+

[PATCH 2/3] usb: musb: remove always-empty string from debug output

2015-11-27 Thread Rasmus Villemoes
aDate is always empty, hence pointless. Signed-off-by: Rasmus Villemoes --- drivers/usb/musb/musb_core.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index

[PATCH 3/3] usb: musb: remove redundant stack buffer

2015-11-27 Thread Rasmus Villemoes
aRevision is only used once, so we might as well do the formatting as part of the pr_debug. This eliminates the stack buffer, and avoids doing the formatting at all when pr_debug is compiled out. Signed-off-by: Rasmus Villemoes --- drivers/usb/musb/musb_core.c | 12

Re: [linux-sunxi] Re: [PATCH v3 1/2] phy-sun4i-usb: Use of_match_node to get model specific config data

2015-11-27 Thread Hans de Goede
Hi, On 27-11-15 09:53, Maxime Ripard wrote: On Thu, Nov 26, 2015 at 01:11:32PM +0100, Hans de Goede wrote: +enum sun4i_usb_phy_type { + sun4i_a10_phy, + sun8i_a33_phy, +}; + +struct sun4i_usb_phy_cfg { + int num_phys; + u32 disc_thresh; + enum sun4i_usb_phy_type

[PATCH 1/3] usb: musb: convert printk to pr_*

2015-11-27 Thread Rasmus Villemoes
This file already uses pr_debug in a few places; this converts the remaining printks. Signed-off-by: Rasmus Villemoes --- drivers/usb/musb/musb_core.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/usb/musb/musb_core.c

Re: [linux-sunxi] Re: [PATCH v3 1/2] phy-sun4i-usb: Use of_match_node to get model specific config data

2015-11-27 Thread Hans de Goede
Hi, On 27-11-15 11:37, Hans de Goede wrote: Hi, On 27-11-15 09:53, Maxime Ripard wrote: On Thu, Nov 26, 2015 at 01:11:32PM +0100, Hans de Goede wrote: +enum sun4i_usb_phy_type { + sun4i_a10_phy, + sun8i_a33_phy, +}; + +struct sun4i_usb_phy_cfg { + int num_phys; + u32