Re: [PATCH 00/21] On-demand device registration

2015-06-22 Thread Tomeu Vizoso
On 28 May 2015 at 06:33, Rob Herring robherri...@gmail.com wrote: On Mon, May 25, 2015 at 9:53 AM, Tomeu Vizoso tomeu.viz...@collabora.com wrote: Hello, I have a problem with the panel on my Tegra Chromebook taking longer than expected to be ready during boot (Stéphane Marchesin reported

Re: ax88179_178a: ethernet to usb dongle disconnect crash

2015-06-22 Thread Greg KH
On Mon, Jun 22, 2015 at 04:09:05PM +0530, Vivek Bhagat wrote: Hello Greg, Please find comments inline below- On Jun 17, 2015 6:23 PM, Greg KH gre...@linuxfoundation.org wrote: On Wed, Jun 17, 2015 at 10:31:40AM +0530, Vivek Bhagat wrote: Hi All, I have connected my pc and TV

Re: [PATCH] USB: storage: add no SYNCHRONIZE CACHE quirk

2015-06-22 Thread Alan Stern
On Mon, 22 Jun 2015, James Bottomley wrote: I'm not sure I entirely like this: we are back again treating data corruption problems silently. However, I also believe treating a single flush failure as a critical filesystem error is also wrong: The data's all there correctly; all it does

Re: [PATCH] USB: storage: add no SYNCHRONIZE CACHE quirk

2015-06-22 Thread James Bottomley
On Mon, 2015-06-22 at 13:30 -0400, Alan Stern wrote: On Mon, 22 Jun 2015, James Bottomley wrote: I'm not sure I entirely like this: we are back again treating data corruption problems silently. However, I also believe treating a single flush failure as a critical filesystem error is

Re: [PATCH 2/3] phy: rcar-gen2 usb: Add Host/Function switching for USB0

2015-06-22 Thread Kishon Vijay Abraham I
+Laurent On Monday 22 June 2015 08:12 PM, Phil Edworthy wrote: Instead of statically selecting the PHY connection to either the USBHS (Function) or PCI0 (Host) IP blocks, this change allows the dts to specifiy gpio pins for the vbus and id signals. Additional gpio pins are used to control power

Re: [PATCH 1/3] usb: renesas_usbhs: Allow an OTG PHY driver to provide VBUS

2015-06-22 Thread Sergei Shtylyov
Hello. On 06/22/2015 05:42 PM, Phil Edworthy wrote: These changes allow a PHY driver to trigger a VBUS interrupt and to provide the value of VBUS. Signed-off-by: Phil Edworthy phil.edwor...@renesas.com --- drivers/usb/renesas_usbhs/common.h | 2 ++ drivers/usb/renesas_usbhs/mod.c

Re: Locking issues w/ functionfs gadget and aio?

2015-06-22 Thread John Stultz
On Sat, Jun 20, 2015 at 10:24 PM, Al Viro v...@zeniv.linux.org.uk wrote: On Fri, Jun 12, 2015 at 05:51:12PM -0700, John Stultz wrote: I'm not super sure what the right fix is, but if do something like the following (sorry, whitespace corrupted via copy/paste), I don't seem to run into the

Re: [PATCH 0/2] FTDI CBUS GPIO support

2015-06-22 Thread Johan Hovold
On Sun, Jun 21, 2015 at 12:12:55AM +0200, Stefan Agner wrote: Yet another FTDI GPIO patchset. Yet somewhat different to previous implementations... There are three GPIO modes supported by FTDI devices: 1. Asynchronous Bit Bang Mode (used in Sacha's patch) 2. Synchronous Bit Bang Mode (used

Re: [PATCH] USB: storage: add no SYNCHRONIZE CACHE quirk

2015-06-22 Thread James Bottomley
On Mon, 2015-06-22 at 10:55 -0400, Alan Stern wrote: Some USB mass-storage devices claim to have a write-back cache but don't support the SYNCHRONIZE CACHE command, which means there is no way to tell these devices to flush their caches out to permanent storage. Unfortunately, there is

[PATCH 2/3] phy: rcar-gen2 usb: Add Host/Function switching for USB0

2015-06-22 Thread Phil Edworthy
Instead of statically selecting the PHY connection to either the USBHS (Function) or PCI0 (Host) IP blocks, this change allows the dts to specifiy gpio pins for the vbus and id signals. Additional gpio pins are used to control power to an external OTG device and an override to turn vbus on/off.

[PATCH 1/3] usb: renesas_usbhs: Allow an OTG PHY driver to provide VBUS

2015-06-22 Thread Phil Edworthy
These changes allow a PHY driver to trigger a VBUS interrupt and to provide the value of VBUS. Signed-off-by: Phil Edworthy phil.edwor...@renesas.com --- drivers/usb/renesas_usbhs/common.h | 2 ++ drivers/usb/renesas_usbhs/mod.c| 3 +++ drivers/usb/renesas_usbhs/mod_gadget.c | 38

[PATCH 3/3] arm: koelsch: make USB0 perform Host/Function switching

2015-06-22 Thread Phil Edworthy
Both USB Host (pci0) and Function (USBHS) drivers are enabled. The USB PHY driver determines which IP block should be connected based on vbus and id signals read via gpios. Signed-off-by: Phil Edworthy phil.edwor...@renesas.com --- arch/arm/boot/dts/r8a7791-koelsch.dts | 7 --- 1 file

Re: [PATCH 2/5] usb: gadget: mass_storage: Enforce contiguous LUN ids

2015-06-22 Thread Alan Stern
On Mon, 22 Jun 2015, Michal Nazarewicz wrote: On Mon, Jun 22 2015, Krzysztof Opasiak wrote: According to mass storage specification: Logical Unit Numbers on the device shall be numbered contiguously starting from LUN 0 to a maximum LUN of 15 (Fh) So don't allow to bind ms function

[PATCH] USB: storage: add no SYNCHRONIZE CACHE quirk

2015-06-22 Thread Alan Stern
Some USB mass-storage devices claim to have a write-back cache but don't support the SYNCHRONIZE CACHE command, which means there is no way to tell these devices to flush their caches out to permanent storage. Unfortunately, there is nothing we can do about this. Until recently this deficiency

Re: [PATCH 5/5] usb: gadget: mass_storage: Send correct number of LUNs to host

2015-06-22 Thread Krzysztof Opasiak
On 06/22/2015 04:34 PM, Michal Nazarewicz wrote: On Mon, Jun 22 2015, Krzysztof Opasiak wrote: GET_MAX_LUN request should return number of realy created LUNs not the size of preallocated array. This patch changes fsg_common_set_nluns() to fsg_common_set_max_luns() which now only allocates an

[PATCH 0/3] R-Car Gen2 USB0 Host/Function switching

2015-06-22 Thread Phil Edworthy
This patch set adds support for USB Host/Function switching using external gpios to get the vbus and id signals. I am aware that the dt binding for the USB phy will need updating, but wanted to get this patch set out first to see whether this is the best way to implement this. Phil Phil

Re: [PATCH] USB: storage: add no SYNCHRONIZE CACHE quirk

2015-06-22 Thread Alan Stern
On Mon, 22 Jun 2015, Markus Rathgeb wrote: Maybe your patch will be acceptable, though. We'll have to hear from Markus and Matt. We'll probably have to take this to fsdevel as well ... they might have opinions about whether the FS wants to be informed about flush failure. So, it

[PATCH v5 4/5] usb: gadget: legacy: don't use __init/__exit attributes for bind/unbind path

2015-06-22 Thread Ruslan Bilovol
In order to prepare to independent gadgets and gadget drivers registration in udc-core, some of the functions can't have __init/__exit attributes (almost only bind/unbind callbacks are affected) Tested-by: Maxime Ripard maxime.rip...@free-electrons.com Signed-off-by: Ruslan Bilovol

[PATCH v5 5/5] usb: gadget: udc-core: independent registration of gadgets and gadget drivers

2015-06-22 Thread Ruslan Bilovol
Change behavior during registration of gadgets and gadget drivers in udc-core. Instead of previous approach when for successful probe of usb gadget driver at least one usb gadget should be already registered use another one where gadget drivers and gadgets can be registered in udc-core

[PATCH v5 3/5] usb: gadget: udc-core: remove unused usb_udc_attach_driver()

2015-06-22 Thread Ruslan Bilovol
Now when last user of usb_udc_attach_driver() is switched to passing UDC name via usb_gadget_driver struct, it's safe to remove this function Tested-by: Maxime Ripard maxime.rip...@free-electrons.com Signed-off-by: Ruslan Bilovol ruslan.bilo...@gmail.com --- drivers/usb/gadget/udc/udc-core.c |

[PATCH v5 2/5] usb: gadget: configfs: pass UDC name via usb_gadget_driver struct

2015-06-22 Thread Ruslan Bilovol
Now when udc-core supports binding to specific UDC by passing its name via 'udc_name' member of usb_gadget_driver struct, switch to this generic approach. Tested-by: Maxime Ripard maxime.rip...@free-electrons.com Signed-off-by: Ruslan Bilovol ruslan.bilo...@gmail.com ---

[PATCH RFC] 2/2 huawei_cdc_ncm: introduce new TX ncm stack

2015-06-22 Thread Enrico Mioso
This patch introduces a new NCM tx engine, able to operate in standard- and huawei-style mode. In the first case, the NDP is disposed after the initial headers and before any datagram. What works: - is able to communicate with compliant NCM devices: I tested this with a board running the

Re: [PATCH 00/21] On-demand device registration

2015-06-22 Thread Rob Herring
On Mon, Jun 22, 2015 at 10:23 AM, Tomeu Vizoso tomeu.viz...@collabora.com wrote: On 28 May 2015 at 06:33, Rob Herring robherri...@gmail.com wrote: On Mon, May 25, 2015 at 9:53 AM, Tomeu Vizoso tomeu.viz...@collabora.com wrote: Hello, I have a problem with the panel on my Tegra Chromebook

[PATCH v5 0/5] usb/gadget: independent registration of gadgets and gadget drivers

2015-06-22 Thread Ruslan Bilovol
This patchset adds independent registration of gadgets and gadget drivers to udc-core. This is very useful for built-in modules into kernel case since it's possible situation that gadget driver is probing at a time when no gadgets are registered in udc-core. In this case instead of silently

[PATCH 3/3] USB: dwc2: Don't turn off the usbphy in suspend if wakeup is enabled

2015-06-22 Thread Douglas Anderson
If the 'snps,need-phy-for-wake' is set in the device tree then: - We know that we can wakeup, so call device_set_wakeup_capable(). The USB core will use this knowledge to enable wakeup by default. - We know that we should keep the PHY on during suspend if something on our root hub needs

[PATCH 0/3] dwc2 patches to allow wakeup on Rockchip rk3288

2015-06-22 Thread Douglas Anderson
This series of patches, together with https://patchwork.kernel.org/patch/6652341/ from Chris Zhong and a dts change allow us to wake up from a USB device on rk3288 boards. The patches were tested on rk3288-jerry in the chromeos-3.14 kernel. The chromeos-3.14 kernel tested included a full set of

[PATCH 1/3] USB: Export usb_wakeup_enabled_descendants()

2015-06-22 Thread Douglas Anderson
In (e583d9d USB: global suspend and remote wakeup don't mix) we introduced wakeup_enabled_descendants() as a static function. We'd like to use this function in USB controller drivers to know if we should keep the controller on during suspend time, since doing so has a power impact.

[PATCH v5 1/5] usb: gadget: bind UDC by name passed via usb_gadget_driver structure

2015-06-22 Thread Ruslan Bilovol
Introduce new 'udc_name' member to usb_gadget_driver structure. The 'udc_name' is a name of UDC that usb_gadget_driver should be bound to. If udc_name is NULL, it will be bound to any available UDC. Tested-by: Maxime Ripard maxime.rip...@free-electrons.com Signed-off-by: Ruslan Bilovol

Re: [PATCH v5 00/22] usb: third series of updates for dwc2 driver

2015-06-22 Thread Doug Anderson
Hi, On Thu, Jun 4, 2015 at 6:12 AM, Kaukab, Yousaf yousaf.kau...@intel.com wrote: Tested-by: Heiko Stuebner he...@sntech.de -- 8 -- [ 19.799200] BUG: sleeping function called from invalid context at mm/slab.c:2863 Will I see a patch for fixing this ?

[PATCH RFC] 1/2 cdc_ncm: export cdc_ncm_align_tail

2015-06-22 Thread Enrico Mioso
Export this function to allow for reusing it in other drivers needing NCM frames alignment, such as the huawei_cdc_ncm one. Signed-off-by: Enrico Mioso mrkiko...@gmail.com --- drivers/net/usb/cdc_ncm.c | 3 ++- include/linux/usb/cdc_ncm.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)

[PATCH RFC 0/2] huawei_cdc_ncm: new NCM TX stack for Huawei-style NCM

2015-06-22 Thread Enrico Mioso
This is an ALFA version of my new NCM TX engine, built with huawei-style NCM and flexibility in mind. The main goal is to allow foreasily re-ordering NCM frame content. Basic communication works - but an usbnet EVENT_RX_MEMORY will stop the process after some packets. Any idea or comment about

Re: [Patch v1] ax88179_178a: add reset functionality in reset_resume

2015-06-22 Thread Oliver Neukum
On Sun, 2015-06-21 at 11:46 +0530, Vivek Bhagat wrote: Without reset functionality in reset_resume, iperf connection does not establish after suspend/resume however ping works at the same time. iperf connection fails with wrong checksum error shown by tcpdump. reset function inside

Re: [PATCH v6] usb: common: add API to set usb otg capabilities by device tree

2015-06-22 Thread Li Jun
On Mon, Jun 22, 2015 at 12:41:22PM +0300, Roger Quadros wrote: On Thu, 18 Jun 2015 21:37:04 +0800 Li Jun b47...@freescale.com wrote: On Thu, Jun 18, 2015 at 03:07:48PM +0300, Roger Quadros wrote: On Thu, 18 Jun 2015 16:47:48 +0800 Li Jun b47...@freescale.com wrote: On Thu, Jun

RE: Configfs usb mass_storage device always reports 8 LUNs ?

2015-06-22 Thread David Fisher
This works for ok for me. Can we also remove the misleading (too early) instances of : pr_info(Number of LUNs=%d\n, common-nluns); in fsg_common_set_luns() and fsg_common_create_lun() Thanks, David -Original Message- From: Mike Nazarewicz [mailto:m...@google.com] On Behalf Of Michal

linux-4.1/drivers/usb/serial/io_edgeport.c: 7 * redundant conditions ?

2015-06-22 Thread David Binderman
Hello there, 1. [linux-4.1/drivers/usb/serial/io_edgeport.c:1049]: (style) Redundant condition: edge_serial.is_epic. 'A (!A || B)' is equivalent to 'A || B'    if ((!edge_serial-is_epic) ||     ((edge_serial-is_epic) (edge_serial-epic_descriptor.Supports.IOSPChase))) { Maybe   

Re: [PATCH v6] usb: common: add API to set usb otg capabilities by device tree

2015-06-22 Thread Li Jun
On Mon, Jun 22, 2015 at 12:43:37PM +0300, Roger Quadros wrote: On Thu, 18 Jun 2015 16:47:48 +0800 Li Jun b47...@freescale.com wrote: On Thu, Jun 18, 2015 at 10:36:50AM +0300, Roger Quadros wrote: Lin, You can use --in-reply-to message id of v5 of this path so that it appears

Re: [PATCH v6 3/3] USB: io_ti: Add heartbeat to keep idle Edgeport ports from disconnecting

2015-06-22 Thread Johan Hovold
On Thu, Jun 18, 2015 at 06:43:36AM -0500, Peter E. Berger wrote: From: Peter E. Berger pber...@brimson.com When using newer Edgeport devices such as the EP/416, idle ports are automatically bounced (disconnected and then reconnected) approximately every 60 seconds. This breaks programs

RE: linux-4.1/drivers/usb/serial/io_edgeport.c: 7 * redundant conditions ?

2015-06-22 Thread David Binderman
Hello there Johan, Yes, that is a redundant test. Thanks for the confirmation. Care to fix these instances and submit a proper patch that we can apply? My success rate with kernel patches is 0.0%, despite many attempts over the years. I am happy for

Re: [PATCH v6] usb: common: add API to set usb otg capabilities by device tree

2015-06-22 Thread Roger Quadros
On Thu, 18 Jun 2015 16:47:48 +0800 Li Jun b47...@freescale.com wrote: On Thu, Jun 18, 2015 at 10:36:50AM +0300, Roger Quadros wrote: Lin, You can use --in-reply-to message id of v5 of this path so that it appears together with the other patches in peoples mailboxes. + * the

Re: [PATCH v6 1/3] USB: io_ti: Increase insufficient timeout for firmware downloads

2015-06-22 Thread Johan Hovold
On Thu, Jun 18, 2015 at 06:43:34AM -0500, Peter E. Berger wrote: From: Peter E. Berger pber...@brimson.com The io_ti driver fails to download firmware to Edgeport devices such as the EP/416. One of the problems is that the default 1 second timeout in ti_vsend_sync() is insufficient for

Re: [PATCH v6 2/3] USB: io_ti: Move request_firmware() calls out of download_fw()

2015-06-22 Thread Johan Hovold
On Thu, Jun 18, 2015 at 06:43:35AM -0500, Peter E. Berger wrote: From: Peter E. Berger pber...@brimson.com The io_ti driver fails to download firmware to Edgeport devices such as the EP/416, even when the on-disk firmware image (/lib/firmware/edgeport/down3.bin) is more current than the

Re: [PATCH v6] usb: common: add API to set usb otg capabilities by device tree

2015-06-22 Thread Roger Quadros
On Thu, 18 Jun 2015 21:37:04 +0800 Li Jun b47...@freescale.com wrote: On Thu, Jun 18, 2015 at 03:07:48PM +0300, Roger Quadros wrote: On Thu, 18 Jun 2015 16:47:48 +0800 Li Jun b47...@freescale.com wrote: On Thu, Jun 18, 2015 at 10:36:50AM +0300, Roger Quadros wrote: Lin,

Re: linux-4.1/drivers/usb/serial/io_edgeport.c: 7 * redundant conditions ?

2015-06-22 Thread Johan Hovold
On Mon, Jun 22, 2015 at 08:40:51AM +, David Binderman wrote: Hello there, 1. [linux-4.1/drivers/usb/serial/io_edgeport.c:1049]: (style) Redundant condition: edge_serial.is_epic. 'A (!A || B)' is equivalent to 'A || B'    if ((!edge_serial-is_epic) ||    

Re: [PATCH 3/3] arm: koelsch: make USB0 perform Host/Function switching

2015-06-22 Thread Sergei Shtylyov
Hello. On 06/22/2015 05:42 PM, Phil Edworthy wrote: Both USB Host (pci0) and Function (USBHS) drivers are enabled. The USB PHY driver determines which IP block should be connected based on vbus and id signals read via gpios. Signed-off-by: Phil Edworthy phil.edwor...@renesas.com ---

Re: [PATCH] USB: storage: add no SYNCHRONIZE CACHE quirk

2015-06-22 Thread Markus Rathgeb
Maybe your patch will be acceptable, though. We'll have to hear from Markus and Matt. We'll probably have to take this to fsdevel as well ... they might have opinions about whether the FS wants to be informed about flush failure. So, it is okay to wait for the end of that discussion

Re: [PATCH] USB: storage: add no SYNCHRONIZE CACHE quirk

2015-06-22 Thread James Bottomley
On Mon, 2015-06-22 at 13:48 -0400, Alan Stern wrote: On Mon, 22 Jun 2015, James Bottomley wrote: On Mon, 2015-06-22 at 13:30 -0400, Alan Stern wrote: On Mon, 22 Jun 2015, James Bottomley wrote: I'm not sure I entirely like this: we are back again treating data corruption

Re: [PATCH] USB: storage: add no SYNCHRONIZE CACHE quirk

2015-06-22 Thread Markus Rathgeb
Please test it now. I'd like to know if it fixes your problem, regardless of how the discussion goes. Seems to be working, I also attached the kernel log. The flush failed will grow with disc activity (but that was to be expected). Jun 22 23:24:50 m3800 kernel: usb 1-3: new high-speed USB

Re: [PATCH] USB: storage: add no SYNCHRONIZE CACHE quirk

2015-06-22 Thread Alan Stern
On Mon, 22 Jun 2015, James Bottomley wrote: On Mon, 2015-06-22 at 13:30 -0400, Alan Stern wrote: On Mon, 22 Jun 2015, James Bottomley wrote: I'm not sure I entirely like this: we are back again treating data corruption problems silently. However, I also believe treating a

Re: [PATCH 0/2] FTDI CBUS GPIO support

2015-06-22 Thread Stefan Agner
On 2015-06-22 19:26, Johan Hovold wrote: On Sun, Jun 21, 2015 at 12:12:55AM +0200, Stefan Agner wrote: snip Bit Bang mode, the pins need to be reprogrammed to I/O mode first (EEPROM). All three modes are supported from userspace by libftdi afaik. Is there a way to retrieve the settings from

Re: [PATCH 3/3] arm: koelsch: make USB0 perform Host/Function switching

2015-06-22 Thread Sergei Shtylyov
Hello. On 06/22/2015 08:43 PM, Sergei Shtylyov wrote: Both USB Host (pci0) and Function (USBHS) drivers are enabled. The USB PHY driver determines which IP block should be connected based on vbus and id signals read via gpios. Signed-off-by: Phil Edworthy phil.edwor...@renesas.com ---

[PATCH] functionfs: Avoid aio locking problem

2015-06-22 Thread John Stultz
The functionfs aio logic seems broken. When using functionfs, I was seeing frequent hangs, and enabling spinlock debugging, I got: g_ffs gadget: g_ffs ready ci_hdrc ci_hdrc.0: CI_HDRC_CONTROLLER_RESET_EVENT received BUG: spinlock lockup suspected on CPU#0, adbd/2791 lock: 0xe7764880, .magic:

Re: [PATCH] usb: ci_hdrc_imx: add optional hub clock

2015-06-22 Thread Peter Chen
On Mon, Jun 22, 2015 at 12:54:14AM +0800, Maciej S. Szmigiero wrote: This patch adds ability to define optional clock of connected USB hub to ChipIdea i.MX usb controller driver. This is needed for example for UDOO board. Previously, this board DT file used a fact that non-core registers of

[PATCH] USB: atm: cxacru: fix blank line after declaration

2015-06-22 Thread Aaron Raimist
Fixed a coding style issue. Adds blank lines after declarations. Signed-off-by: Aaron Raimist aaronraim...@riseup.net --- drivers/usb/atm/cxacru.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index 813d4d3..1173f9c

Re: Configfs usb mass_storage device always reports 8 LUNs ?

2015-06-22 Thread Krzysztof Opasiak
On 06/20/2015 12:18 AM, Michal Nazarewicz wrote: On Fri, Jun 19 2015, Felipe Balbi wrote: the fact is that this needs to be configurable from configfs. If user sets up a single lun, then this should be as you said, however, if 2 luns are configured, I still want to have those 2 working.

[PATCH 2/5] usb: gadget: mass_storage: Enforce contiguous LUN ids

2015-06-22 Thread Krzysztof Opasiak
According to mass storage specification: Logical Unit Numbers on the device shall be numbered contiguously starting from LUN 0 to a maximum LUN of 15 (Fh) So don't allow to bind ms function unless we have at least LUN0 and LUNs ids are contiguous. Signed-off-by: Krzysztof Opasiak

[PATCH 0/5] Mass storage fixes and improvements

2015-06-22 Thread Krzysztof Opasiak
Hello, This series fix a few bugs in mass storage function and disallows to bind function with not contiguous LUN ids. Last patch in this series fix GET_MAX_LUNS request to return actual number of luns, not the number of prealocated space. Best regards, -- Krzysztof Opasiak Samsung RD

[PATCH 1/5] usb: gadget: mass_storage: Free buffers if create lun fails

2015-06-22 Thread Krzysztof Opasiak
Creation of LUN 0 may fail (for example due to ENOMEM). As fsg_common_set_num_buffers() does some memory allocation we should free it before it becomes unavailable. Signed-off-by: Krzysztof Opasiak k.opas...@samsung.com Cc: sta...@vger.kernel.org # 3.13+ ---

[PATCH 3/5] usb: gadget: mass_storage: Place EXPORT_SYMBOL_GPL() after func definition

2015-06-22 Thread Krzysztof Opasiak
EXPORT_SYMBOL_GPL() is usually placed after function definition not before. Signed-off-by: Krzysztof Opasiak k.opas...@samsung.com --- drivers/usb/gadget/function/f_mass_storage.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_mass_storage.c

[PATCH 5/5] usb: gadget: mass_storage: Send correct number of LUNs to host

2015-06-22 Thread Krzysztof Opasiak
GET_MAX_LUN request should return number of realy created LUNs not the size of preallocated array. This patch changes fsg_common_set_nluns() to fsg_common_set_max_luns() which now only allocates an empty array for luns and set nluns to 0. While LUNS are create we simply count them and store

[PATCH 4/5] usb: gadget: storage-common: Set FSG_MAX_LUNS to 16

2015-06-22 Thread Krzysztof Opasiak
Mass storage spec allows up to 16 LUNs, so let's don't add some more restrictive limits. Signed-off-by: Krzysztof Opasiak k.opas...@samsung.com --- drivers/usb/gadget/function/storage_common.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH v6] usb: common: add API to set usb otg capabilities by device tree

2015-06-22 Thread Roger Quadros
On Mon, 22 Jun 2015 18:45:37 +0800 Li Jun b47...@freescale.com wrote: On Mon, Jun 22, 2015 at 12:41:22PM +0300, Roger Quadros wrote: On Thu, 18 Jun 2015 21:37:04 +0800 Li Jun b47...@freescale.com wrote: On Thu, Jun 18, 2015 at 03:07:48PM +0300, Roger Quadros wrote: On Thu, 18 Jun

Re: [PATCH v6] usb: common: add API to set usb otg capabilities by device tree

2015-06-22 Thread Roger Quadros
On Mon, 22 Jun 2015 18:56:18 +0800 Li Jun b47...@freescale.com wrote: On Mon, Jun 22, 2015 at 12:43:37PM +0300, Roger Quadros wrote: On Thu, 18 Jun 2015 16:47:48 +0800 Li Jun b47...@freescale.com wrote: On Thu, Jun 18, 2015 at 10:36:50AM +0300, Roger Quadros wrote: Lin,

Re: Configfs usb mass_storage device always reports 8 LUNs ?

2015-06-22 Thread Michal Nazarewicz
On Mon, Jun 22 2015, David Fisher wrote: This works for ok for me. Can we also remove the misleading (too early) instances of : pr_info(Number of LUNs=%d\n, common-nluns); in fsg_common_set_luns() and fsg_common_create_lun() I’m assuming you mean fsg_common_set_nluns and

Re: Configfs usb mass_storage device always reports 8 LUNs ?

2015-06-22 Thread Michal Nazarewicz
On Mon, Jun 22 2015, Krzysztof Opasiak wrote: On 06/20/2015 12:18 AM, Michal Nazarewicz wrote: On Fri, Jun 19 2015, Felipe Balbi wrote: the fact is that this needs to be configurable from configfs. If user sets up a single lun, then this should be as you said, however, if 2 luns are

Re: [PATCH 1/5] usb: gadget: mass_storage: Free buffers if create lun fails

2015-06-22 Thread Michal Nazarewicz
On Mon, Jun 22 2015, Krzysztof Opasiak wrote: Creation of LUN 0 may fail (for example due to ENOMEM). As fsg_common_set_num_buffers() does some memory allocation we should free it before it becomes unavailable. Signed-off-by: Krzysztof Opasiak k.opas...@samsung.com Cc: sta...@vger.kernel.org

Re: [PATCH 3/5] usb: gadget: mass_storage: Place EXPORT_SYMBOL_GPL() after func definition

2015-06-22 Thread Michal Nazarewicz
On Mon, Jun 22 2015, Krzysztof Opasiak wrote: EXPORT_SYMBOL_GPL() is usually placed after function definition not before. Signed-off-by: Krzysztof Opasiak k.opas...@samsung.com Acked-by: Michal Nazarewicz min...@mina86.com --- drivers/usb/gadget/function/f_mass_storage.c |2 +- 1

Re: optimal io size / custom alignment

2015-06-22 Thread Alan Stern
On Sun, 21 Jun 2015, Tom Yan wrote: I was not saying RAIDs are virtual devices. I just mentioned it because I saw things like virtio-blk or zram use blk_queue_io_opt(). I know they all use VPDs, but the main point is whether those hardware RAIDs or so are handled by sd_mod, and whether

[PATCH v2] usb: class: Use USB_CLASS_PRINTER instead of number 7

2015-06-22 Thread Krzysztof Opasiak
Kernel provides very nice defines for USB device class so it's a good idea to use them in suitable places. It is much easier to grep for such define instead of 7. Signed-off-by: Krzysztof Opasiak k.opas...@samsung.com --- Changes since v1: - Fix also all other occurences

Re: Configfs usb mass_storage device always reports 8 LUNs ?

2015-06-22 Thread Krzysztof Opasiak
On 06/22/2015 04:24 PM, Michal Nazarewicz wrote: On Mon, Jun 22 2015, Krzysztof Opasiak wrote: On 06/20/2015 12:18 AM, Michal Nazarewicz wrote: On Fri, Jun 19 2015, Felipe Balbi wrote: the fact is that this needs to be configurable from configfs. If user sets up a single lun, then this

Re: [PATCH 4/5] usb: gadget: storage-common: Set FSG_MAX_LUNS to 16

2015-06-22 Thread Michal Nazarewicz
On Mon, Jun 22 2015, Krzysztof Opasiak wrote: Mass storage spec allows up to 16 LUNs, so let's don't add some more restrictive limits. Signed-off-by: Krzysztof Opasiak k.opas...@samsung.com Acked-by: Michal Nazarewicz min...@mina86.com --- drivers/usb/gadget/function/storage_common.h |

Re: [PATCH 5/5] usb: gadget: mass_storage: Send correct number of LUNs to host

2015-06-22 Thread Michal Nazarewicz
On Mon, Jun 22 2015, Krzysztof Opasiak wrote: GET_MAX_LUN request should return number of realy created LUNs not the size of preallocated array. This patch changes fsg_common_set_nluns() to fsg_common_set_max_luns() which now only allocates an empty array for luns and set nluns to 0. While

Re: [PATCH v6] usb: common: add API to set usb otg capabilities by device tree

2015-06-22 Thread Li Jun
On Mon, Jun 22, 2015 at 04:32:56PM +0300, Roger Quadros wrote: On Mon, 22 Jun 2015 18:45:37 +0800 Li Jun b47...@freescale.com wrote: On Mon, Jun 22, 2015 at 12:41:22PM +0300, Roger Quadros wrote: On Thu, 18 Jun 2015 21:37:04 +0800 Li Jun b47...@freescale.com wrote: On Thu, Jun

Re: [PATCH 2/5] usb: gadget: mass_storage: Enforce contiguous LUN ids

2015-06-22 Thread Michal Nazarewicz
On Mon, Jun 22 2015, Krzysztof Opasiak wrote: According to mass storage specification: Logical Unit Numbers on the device shall be numbered contiguously starting from LUN 0 to a maximum LUN of 15 (Fh) So don't allow to bind ms function unless we have at least LUN0 and LUNs ids are