RE: [PATCH 18/28] usb: dwc3: ep0: fix Data Phase for transfer sizes aligned to wMaxPacketSize

2014-10-21 Thread David Laight
From: Alan Stern > > > From: linux-usb-ow...@vger.kernel.org > > > [mailto:linux-usb-ow...@vger.kernel.org] On Behalf Of David Laight > > > Sent: Monday, October 20, 2014 2:48 AM > > > > > > From: Felipe Balbi > > > > According to Section 8

RE: [PATCH v2 2/4] usb: chipidea: add hw_wait_phy_stable for getting stable status

2014-10-22 Thread David Laight
From: Peter Chen > The phy needs some delay to output the stable status from low > power mode. And for OTGSC, the status inputs are debounced > using a 1 ms time constant, so, delay 2ms for controller to get > the stable status(like vbus and id) when the phy leaves low power. > > Signed-off-by: Pe

RE: xhci handling ring expansion

2014-06-17 Thread David Laight
From: vichy > hi david: > > >> platform-xhci platform-xhci.0: ERROR no room on ep ring, try ring expansion > >> platform-xhci platform-xhci.0: ring expansion succeed, now has 4 segments > >> platform-xhci platform-xhci.0: ERROR Transfer event TRB DMA ptr not > >> part of current TD > >> > >> und

RE: xhci handling ring expansion

2014-06-18 Thread David Laight
From: vichy > hi david: ... > > From one of the patches (not applied) I sent last November ... > > Include the unknown address when the DMA pointer from an event isn't part > > of the current TD. This will happen if the error code is "TRB error". > do you mean below patch? > http://markmail.org/m

RE: [PATCH 2/2] usb: musb: cppi41: fire hrtimer according to programmed channel length

2014-06-18 Thread David Laight
From: Of Daniel Mack > Sent: 18 June 2014 10:28 > To: ba...@ti.com; george.cher...@ti.com; bige...@linutronix.de > Cc: sebastian.reim...@googlemail.com; linux-usb@vger.kernel.org; Daniel Mack > Subject: [PATCH 2/2] usb: musb: cppi41: fire hrtimer according to programmed > channel length > > The m

RE: xhci handling ring expansion

2014-06-18 Thread David Laight
From: vichy ... > and I get error message as > platform-xhci: ERROR Transfer event TRB DMA ptr 483702160 not part of current > TD > platform-xhci: trb_comp_code = 0x1, event status -115, buffer > 1cd4b590, len 100, flags 1038001 > > that seems wired. > complete code is success and not short p

RE: [PATCH 2/2] usb: musb: cppi41: fire hrtimer according to programmed channel length

2014-06-19 Thread David Laight
From: Daniel Mack [mailto:dan...@zonque.org] > On 06/19/2014 05:07 PM, Felipe Balbi wrote: > > On Wed, Jun 18, 2014 at 11:36:43AM +0200, Daniel Mack wrote: > >> On 06/18/2014 11:32 AM, David Laight wrote: > >>> From: Of Daniel Mack > >>>> Sen

RE: some question about xhci skip_isoc_td

2014-06-23 Thread David Laight
From: vichy > hi all: > when i trace xhci source, I found in skip_isoc_td, there is a > possibility to increase de-queue pointer twice. > > in skip_isoc_td: > /* Update ring dequeue pointer */ > while (ep_ring->dequeue != td->last_trb) > inc_deq(xhci, ep_ring); >

RE: [PATCH 1/5] xhci: Use correct SLOT ID when handling a reset device command

2014-06-24 Thread David Laight
From: Of Mathias Nyman > Command completion events normally include command completion status, > SLOT_ID, and a pointer to the original command. Reset device command > completion SLOT_ID may be zero according to xhci specs 4.6.11. > > VIA controllers set the SLOT_ID to zero, triggering a WARN_ON i

RE: [PATCH] USB: ehci-pci: USB host controller support for Intel Quark X1000

2014-06-25 Thread David Laight
From: Chen, Alvin > > On Tue, Jun 24, 2014 at 08:51:43AM -0700, Chen, Alvin wrote: > > > diff --git a/drivers/usb/host/pci-quirks.c > > > b/drivers/usb/host/pci-quirks.c index 00661d3..1ea8803 100644 > > > --- a/drivers/usb/host/pci-quirks.c > > > +++ b/drivers/usb/host/pci-quirks.c > > > @@ -823,6

RE: dwc2: usb/ethernet dongle does not work

2014-06-25 Thread David Laight
From: Dinh Nguyen > I was wondering if you have ever tested this driver with a USB/ethernet > dongle? I'm using the apple usb/ethernet dongle, which is basically just > the ASIX AX88xxx Based Ethernet Adapter. From brief debugging, it > appears that Bulk and Interrupt endpoint data are getting corr

RE: [PATCH v2] USB: ehci-pci: USB host controller support for Intel Quark X1000

2014-06-27 Thread David Laight
From: Jingoo Han ... > /* The maximal threshold value is 0x80, which means 512 bytes */ > #define EHCI_THRESHOLD_512BYTES 0x80 > #define EHCI_THRESHOLD_508BYTES 0x79 It would be better to define these using expressions. So: #define EHCI_THRESHOLD_512BYTES (512u

RE: [PATCHv2] usb: gadget: serial: replace hardcoded ttyGS with PREFIX

2014-06-30 Thread David Laight
From: Of Richard Leitner > Replaces all hardcoded ttyGS strings with the PREFIX macro. > Due to the fact the strings are spread over different source files the > PREFIX definition is moved to u_serial.h Lots of changes like: > - DBG(cdev, "acm ttyGS%d completion, err %d\n", > -

RE: [PATCHv2] usb: gadget: serial: replace hardcoded ttyGS with PREFIX

2014-06-30 Thread David Laight
From: Richard Leitner > On Mon, 30 Jun 2014 08:41:18 + > David Laight wrote: > > > From: Of Richard Leitner > > > Replaces all hardcoded ttyGS strings with the PREFIX macro. > > > Due to the fact the strings are spread over different source files the &g

RE: [PATCH] usb: gadget: f_fs: OS descriptors support

2014-07-02 Thread David Laight
From: Andrzej Pietrasiewicz > Sent: 02 July 2014 12:20 > To: linux-usb@vger.kernel.org; Michal Nazarewicz; Felipe Balbi; Greg > Kroah-Hartman; Marek Szyprowski > Subject: Re: [PATCH] usb: gadget: f_fs: OS descriptors support > > W dniu 02.07.2014 13:04, Peter Stuge pisze: > > Andrzej Pietrasiewic

RE: DMA over USB

2014-07-02 Thread David Laight
From: Raghavendra > Thank you for responding Peter, > > Raghavendra wrote: > >> I have a query regarding DMA(Direct Memory Access) for the usb devices. > > USB devices never do DMA. > > > >> As far as Linux is concerned, how the DMA action being taking place for > >> USB devices. > > It doesn't tak

RE: [PATCH] usb: gadget: f_fs: OS descriptors support

2014-07-02 Thread David Laight
From: Michal Nazarewicz ... > > Alternatively it shouldn't be 'packed', and a full audit of the > > other structures done to determine which ones can ever be misaligned > > and then determine whether that should actually be allowed. > > All of the structures describe a wire protocol, whether we th

RE: [PATCH][RFC] USB: zerocopy support for usbfs

2014-07-03 Thread David Laight
From: Stefan Klug ... > Is there any way to check if the host controller supports arbitrary > alignment? > If I read the xhci spec correctly arbitrary alignment is explicitly > permitted. Not entirely. The xhci spec has a few limits on the alignment of transfer buffer. They seem to be designed to

RE: Problem with Mobile Broadband on ubuntu

2014-07-04 Thread David Laight
> I've already told him (off the list) to upgrade to Ubuntu 14.04. > Ubuntu 12.04 which is an LTS distro is hopeless behind in drivers and > their usb_modeswitch > version is two and a half years old. > The Ubuntu maintainers seems to have their own definition of LTS. Not as back as RHEL5 (2.6.18

RE: [PATCH 2/2] hso: fix deadlock when receiving bursts of data

2014-07-07 Thread David Laight
From: Olivier Sobrie > When the module sends bursts of data, sometimes a deadlock happens in > the hso driver when the tty buffer doesn't get the chance to be flushed > quickly enough. > > To avoid this, first, we remove the endless while loop in > put_rx_bufdata() which is the root cause of the d

RE: [PATCH 2/2] hso: fix deadlock when receiving bursts of data

2014-07-07 Thread David Laight
From: Olivier Sobrie > Hi David, > > On Mon, Jul 07, 2014 at 09:13:53AM +0000, David Laight wrote: > > From: Olivier Sobrie > > > When the module sends bursts of data, sometimes a deadlock happens in > > > the hso driver when the tty buffer doesn't get

RE: dummy scsi read or scsi command periodically for external USB Hard Disk

2014-07-07 Thread David Laight
From: Lars Melin ... > sgread is not included in BusyBox but you should have "touch". > Create a dummy file on the disk and let cron touch it every 4 minutes. You don't need 'touch' a shell redirect eg ": >file" will do open(..., O_CREAT|O_TRUNC). However that still might not force an actual disc

RE: Possible bug in xhci-ring.c

2014-07-08 Thread David Laight
From: Julius Werner ... > Also, really the only reason later kernels work for that controller is > because we don't handle the case where a TD wraps all the way around a > whole multi-segment ring back to the same segment. That is allowed because it would then be impossible to add another ring seg

RE: Possible bug in xhci-ring.c

2014-07-08 Thread David Laight
From: David Laight > From: Julius Werner > ... > > Also, really the only reason later kernels work for that controller is > > because we don't handle the case where a TD wraps all the way around a > > whole multi-segment ring back to the same segment. > > That

RE: dummy scsi read or scsi command periodically for external USB Hard Disk

2014-07-09 Thread David Laight
From: loody ... > but what it really do is read sector, not media_change or test_unit_ready. Maybe one of the programs that reads the mbr partition table can be persuaded to do a direct read? David

RE: [PATCH 2/2] hso: fix deadlock when receiving bursts of data

2014-07-10 Thread David Laight
From: Olivier Sobrie ... > The function put_rxbuf_data() is called from the urb completion handler. > It puts the data of the urb transfer in the tty buffer with > tty_insert_flip_string_flags() and schedules a work queue in order to > push the data to the ldisc. > Problem is that we are in a urb c

RE: [PATCH 2/2] hso: fix deadlock when receiving bursts of data

2014-07-10 Thread David Laight
From: One Thousand Gnomes > On Thu, 10 Jul 2014 14:37:37 + > David Laight wrote: > > > From: Olivier Sobrie > > ... > > > The function put_rxbuf_data() is called from the urb completion handler. > > > It puts the data of

RE: [PATCH 2/2] hso: fix deadlock when receiving bursts of data

2014-07-11 Thread David Laight
From: Olivier Sobrie Olivier Sobrie > Hi Alan and Davids, > > On Thu, Jul 10, 2014 at 04:50:03PM +0100, One Thousand Gnomes wrote: > > On Thu, 10 Jul 2014 14:37:37 + > > David Laight wrote: > > > > > From: Olivier Sobrie > > > ... > > >

RE: [RFC] USB: Fix persist resume of some SS USB devices

2014-07-15 Thread David Laight
From: Alan Stern > On Tue, 15 Jul 2014, Pratyush Anand wrote: ... > > +static int wait_for_ss_port_enable(struct usb_device *udev, > > + struct usb_hub *hub, > > + int *port1, > > + u16 *portchange

RE: [PATCH 07/12] usb: dwc2: Move gadget interrupts to common interrupt handler

2014-07-17 Thread David Laight
From: Felipe Balbi > On Wed, Jul 16, 2014 at 09:32:21PM +, Paul Zimmerman wrote: > > > From: dingu...@altera.com [mailto:dingu...@altera.com] > > > Sent: Wednesday, July 16, 2014 1:33 PM > > > > > > Update dwc2_handle_common_intr() to handle both hcd and gadget interrupts. > > > > > > Signed-of

RE: [RFC] USB: Fix persist resume of some SS USB devices

2014-07-17 Thread David Laight
From: Pratyush Anand ... > Only side effect of long timeout: If a device was connected before > suspend, and was removed while system was asleep, then the penalty > would be the timeout ie 2000 ms. I do not see a way to handle this. I > can put a FIXME note for this in patch. ... Can't you use the

RE: [PATCH 2/3] xhci: Log ep-index and comp-code on TRB DMA ptr not part of current TD

2014-07-18 Thread David Laight
From: Hans de Goede > These errors should never happen, so lets add some extra info when they happen > to make figuring out what is going on easier. I've previously posted a patch that include the 'DMA ptr' itself. IIRC I was generating one of the error events where the pointer is the address of a

RE: [PATCH 1/3] xhci: Print hcc params, version and quirks on init

2014-07-18 Thread David Laight
From: Hans de Goede > To help debugging xhci problems. > > Signed-off-by: Hans de Goede > --- > drivers/usb/host/xhci.c | 4 > drivers/usb/host/xhci.h | 2 ++ > 2 files changed, 6 insertions(+) > > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c > index 7436d5f..7d02e1b 1006

RE: Problem with D-Link USB 3.0 to Gigabit Ethernet Adapter DUB-1312

2014-07-22 Thread David Laight
> I would like to draw attention to another potential problem which concerns > combination of USB ethernet and xHCI driver in Linux kernel. I have serious > problem with D-Link USB 3.0 Gigabit Ethernet Adapter DUB-1312. I am not > able to assign the IPv4 address through DHCP client or even manually

RE: Problem with D-Link USB 3.0 to Gigabit Ethernet Adapter DUB-1312

2014-07-22 Thread David Laight
From: Marek Uher > Hi David, > > thank you very much for your explanation. My answers to your questions > follow: > > * Yes, I have ASMedia ASM1042 SuperSpeed USB Host (XHCI) Controller > in my computer. > > * Yes, D-Link DUB-1312 is using asix88179_178a linux kernel driver. > > Based on infor

RE: [PATCH] usb: xhci: Fix Set TR Dequeue Pointer cycle state for quirky xHCs

2014-08-11 Thread David Laight
> It's starting to get a bit too complicated. > xhci find_new_dequeue_state() now has four places where it can toggle the > cycle bit > in addition to the cycle toggle in find_trb_seg(). > > In the end we really just want to do it max once. > > I'll see if I can simplify the whole cycle bit code

RE: [RFTv2 PATCH] xhci: rework cycle bit checking for new dequeue pointers

2014-08-11 Thread David Laight
> (Also, I'm wondering if we should just drop the code that skips whole > segments to make it simpler, since I can hardly think of any > real-world examples where a single TD would cover a whole segment.) That can happen, raw access to USB disks can generate very long fragment lists. OTOH simplify

RE: XHCI_TRUST_TX_LENGTH quirk?

2014-08-11 Thread David Laight
From: Behalf Of Evan Langlois > Sorry if this is answered somewhere, but I couldn't find anything > specific on Google as far as how to determine if this quirk is needed > or if its configurable at boot/run-time. Its an HP laptop, and it > looks like other HP models have the problem. > > I most

Transient USB disconnects

2014-08-13 Thread David Laight
We are seeing some transient USB disconnects, these cause serious grief if we use the xhci driver, so the ports are all forced to use ehci (bios config). Even with ehci they are slightly problematic, partially resolved by using a 'bond' interface to stop the ethernet interface and address disappea

RE: Transient USB disconnects

2014-08-15 Thread David Laight
> > Have you used a bus analyzer on the wire connected to the parent hub's > > upstream port? If you do, you should be able to see the events leading > > up to a reset. My guess is that they will all look normal until at some > > point the HID device stops responding to packets. Probably the hub

RE: test program to check usb hid devices

2014-08-15 Thread David Laight
From: loody > Is there any test program we can use to capture input data send from > usb keyboard/mouse? google usbmon David

RE: usbserial_generic

2014-08-18 Thread David Laight
> > > Do you know what the three interfaces are used for by the way? And do you > > > have any idea about whether the other products using the same PID also > > > have six bulk endpoints (three tty interfaces)? Interestingly I've a modern Asmedia motherboard for the haswell cpu that has 5 RS232 po

RE: Transient USB disconnects

2014-08-19 Thread David Laight
From: Alan Stern > On Fri, 15 Aug 2014, David Laight wrote: > > > With all the usb dynamic-debug enabled the first errors I see are 'detected > > XactErr' > > len 0/1522 and len 2048/18944 (all 32 retries). > > Then some '3strikes'

RE: [PATCH v2 2/9] mailbox: Add NVIDIA Tegra XUSB mailbox driver

2014-08-26 Thread David Laight
From: Thierry Reding ... > > Is _nocache required? I don't see other drivers using it. I assume there's > > nothing special about the mbox registers. > > Most drivers should be using devm_ioremap_resource() which will use the > _nocache variant of devm_ioremap() when appropriate. Usually the regio

RE: RES: RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-26 Thread David Laight
From: Alan Stern > On Mon, 25 Aug 2014, Alfredo Dal Ava Junior wrote: > > > Well, it is causing problems anyway... from user perspective, it's a > > Linux compatibility issue, as it works "fine" on Windows. I'm not an > > expert, but I'm wondering that if usb-storage could set capacity as > > "UND

RE: [RFC PATCH 19/20] xhci: v1.0 scatterlist enqueue support (td-fragment rework)

2014-08-26 Thread David Laight
From: Alan Stern > On Fri, 22 Aug 2014, Dan Williams wrote: > > > v1.0 hosts require that TD-fragments (portions of a TD that do not end > > on a MPB boundary) not cross a TRB segment boundary. This constraint is > > in addition to the constraint that a TRB may not specify a transfer that > > cro

RE: [RFC PATCH 09/20] xhci: introduce ring ops to handle event vs non-event rings

2014-08-26 Thread David Laight
From: Dan Williams > It's confusing (to me at least) to keep on remembering the differences > between event rings (managed by the hardware) and non-event rings > managed by the host. Replace "if (ring->type == FOO)" branches with > ring ops that are specific to the type of ring. > > This is a tra

RE: [RFC PATCH 00/20] xhci: implement xhci-v1+ td-fragment rules, test

2014-08-26 Thread David Laight
From: Dan Williams > Sending as an RFC primarily to get feedback on the unit testing approach > while there's still time to yell at me in person at LinuxCon. Including > Rusty in pursuit of comments on how to do mocked interfaces for testing > purposes in-tree. > > === > > This series updates th

RE: [RFC PATCH 19/20] xhci: v1.0 scatterlist enqueue support (td-fragment rework)

2014-08-26 Thread David Laight
From: Dan Williams > v1.0 hosts require that TD-fragments (portions of a TD that do not end > on a MPB boundary) not cross a TRB segment boundary. This constraint is > in addition to the constraint that a TRB may not specify a transfer that > crosses a 64K boundary. This enabling permits the driver

RE: RES: RES: AS2105-based enclosure size issues with >2TB HDDs

2014-08-26 Thread David Laight
From Oliver Neukum [mailto:oneu...@suse.de] > On Tue, 2014-08-26 at 09:58 +0000, David Laight wrote: > > > Part of the problem is that usb-storage has no way to know that > > > anything strange is going on. It's normal for READ CAPACITY(16) to > > > fail (this

RE: [RFC PATCH 09/20] xhci: introduce ring ops to handle event vs non-event rings

2014-08-26 Thread David Laight
From: Dan Williams [mailto:dan.j.willi...@intel.com] > On Tue, Aug 26, 2014 at 3:37 AM, David Laight wrote: > > From: Dan Williams > >> It's confusing (to me at least) to keep on remembering the differences > >> between event rings (managed by the hardware) and non

RE: [PATCH] usb: gadget: ffs: don't allow to open with O_NONBLOCK flag

2015-04-07 Thread David Laight
From: Robert Baldyga > Hi Michal, > > On 04/01/2015 05:17 PM, Michal Nazarewicz wrote: > > On Wed, Apr 01 2015, Robert Baldyga wrote: > >> FunctionFS can't support O_NONBLOCK because read/write operatons are > >> directly translated into USB requests which are asynchoronous, so we > >> can't know

RE: [PATCH v2 RESEND 7/9] xhci: remove XHCI_TRUST_TX_LENGTH quirk and handle it as default

2015-06-09 Thread David Laight
From: Mathias Nyman > Now including Renesas uPD720201 we got four xhci vendors that return > Success instead of short transfer when there are still unstraferred bytes > left. The driver anyway checks the untransferred bytes and suggest adding > the quirk if needed, so we can as well make it default

RE: FX3 on Linux

2015-06-15 Thread David Laight
From: philip.jos...@microchip.com > Knowing that you have experts in USB 3.0 support for Linux, I am writing to > your organization hoping > that you may be able to offer some direction on a problem I have encountered. > > I am trying to track down a problem I am having with a USB 3.0 PCIe-x1 car

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

2015-06-23 Thread David Laight
From: Of James Bottomley > Sent: 22 June 2015 18:36 > To: Alan Stern ... > > > Obviously, for a disk with a writeback cache that can't do flush, that > > > window is much wider and the real solution should be to try to switch > > > the cache to write through. > > > > I agree. Doing the switch manu

RE: 64 byte EP0 OUT data transfer issue on Chipidea highspeed dual role controller

2015-06-26 Thread David Laight
From: Steve Calfee > Sent: 26 June 2015 15:59 > > On the host (Wandboard iMX6q) the test app opens /dev/hidraw0 and > > write 64 bytes with report ID (1). The HID device has no Interrupt OUT > > ep, therefore uses control endpoint ep0 for the 64 bytes transfer to > > gadget (Wandboard iMX6q) using

RE: [PATCH 1/2] usb: chipidea: Reduce ULPI PHY reset pulse to datasheet spec of 1us

2015-07-02 Thread David Laight
From: Peter Chen > Sent: 30 June 2015 03:06 > On Fri, Jun 26, 2015 at 03:47:03PM +0200, Mike Looijmans wrote: > > The datasheet for the 334x PHY mentions that a reset can be performed: > > "... by bringing the pin low for a minimum of 1 microsecond and > > then high." > > A delay of 5ms to implemen

RE: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-28 Thread David Laight
From: Rafael J. Wysocki > Sent: 27 September 2015 15:09 ... > > > Say you have three adjacent fields in a structure, x, y, z, each one byte > > > long. > > > Initially, all of them are equal to 0. > > > > > > CPU A writes 1 to x and CPU B writes 2 to y at the same time. > > > > > > What's the resu

RE: question about potential integer truncation in r8a66597_hub_descriptor

2015-09-28 Thread David Laight
From: PaX Team > Sent: 26 September 2015 14:47 > hi all, > > drivers/usb/host/r8a66597-hcd.c:r8a66597_hub_descriptor can truncate > r8a66597.max_root_hub (of type unsigned int) to an unsigned char: > > desc->bNbrPorts = r8a66597->max_root_hub; > > based on the surrounding code my guess is

RE: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-28 Thread David Laight
From: James Bottomley [mailto:james.bottom...@hansenpartnership.com] > Sent: 28 September 2015 15:27 > On Mon, 2015-09-28 at 08:58 +, David Laight wrote: > > From: Rafael J. Wysocki > > > Sent: 27 September 2015 15:09 > > ... > > > > > Say you have thr

RE: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-28 Thread David Laight
From: James Bottomley > Sent: 28 September 2015 16:12 > > > > The x86 cpus will also do 32bit wide rmw cycles for the 'bit' > > > > operations. > > > > > > That's different: it's an atomic RMW operation. The problem with the > > > alpha was that the operation wasn't atomic (meaning that it can't

RE: [PATCH] usb: gadget: Add the console support for usb-to-serial port

2015-11-18 Thread David Laight
From: Baolin Wang > Sent: 18 November 2015 10:45 > On 18 November 2015 at 17:32, Andy Shevchenko > wrote: > > On Wed, Nov 18, 2015 at 4:15 AM, Baolin Wang wrote: > >> On 17 November 2015 at 21:34, Andy Shevchenko > >> wrote: > >>> On Mon, Nov 16, 2015 at 9:05 AM, Baolin Wang > >>> wrote: > >

RE: Infrastructure for zerocopy I/O

2015-11-18 Thread David Laight
From: Christoph Hellwig > Sent: 18 November 2015 14:02 > On Tue, Nov 17, 2015 at 02:07:58PM -0500, Alan Stern wrote: > > If we really want to do zerocopy I/O then we should not use a bounce > > buffer. But the only way to avoid bounce buffers may be to give user > > programs a way of allocating me

RE: Unable to reap urb after receiving signal using usbfs.

2015-02-12 Thread David Laight
From: Dave Mielke > Okay. Found it. Yes, I was indeed making an assumption. When a signalfd file > descriptor is closed, it doesn't remove any of the signals that were in its > queue. The next time a signalfd file descriptor is opened for the same signal, > therefore, the signal from the closing of

RE: [PATCH V6 03/10] USB: f81232: implement RX bulk-in ep

2015-02-17 Thread David Laight
From: Greg KH > > + for (i = 0 ; i < urb->actual_length ; i += 2) { > > + tty_flag = TTY_NORMAL; > > + > > + if (unlikely(data[i+0] & UART_LSR_BRK_ERROR_BITS)) { > > Never use unlikely() unless you can prove that it actually matters if > you use it. Hint, it's almost impossi

RE: [PATCH] UAS: fix alignment of scatter/gather segments

2019-04-29 Thread David Laight
From: Oliver Neukum > Sent: 29 April 2019 13:20 > This is the UAS version of > > 747668dbc061b3e62bc1982767a3a1f9815fcf0e > usb-storage: Set virt_boundary_mask to avoid SG overflows > > We are not as likely to be vulnerable as storage, as it is unlikelier > that UAS is run over a controller witho

RE: [PATCH] UAS: fix alignment of scatter/gather segments

2019-04-29 Thread David Laight
From: Oliver Neukum > Sent: 29 April 2019 14:38 > On Mo, 2019-04-29 at 13:31 +, David Laight wrote: > > From: Oliver Neukum > > > > > > + * USB has unusual scatter-gather requirements: the length of each > > > + * scatterlist element except the last m

RE: [PATCH] UAS: fix alignment of scatter/gather segments

2019-04-29 Thread David Laight
From: Oliver Neukum > On Mo, 2019-04-29 at 14:19 +0000, David Laight wrote: > > From: Oliver Neukum > > > Sent: 29 April 2019 14:38 > > > On Mo, 2019-04-29 at 13:31 +, David Laight wrote: > > > > From: Oliver Neukum > > > > > > > >

RE: [PATCH] UAS: fix alignment of scatter/gather segments

2019-04-30 Thread David Laight
From: Alan Stern > Sent: 29 April 2019 18:55 > On Mon, 29 Apr 2019, Oliver Neukum wrote: > > > On Mo, 2019-04-29 at 12:08 -0400, Alan Stern wrote: > > > On Mon, 29 Apr 2019, Oliver Neukum wrote: > > > > > > > On Mo, 2019-04-29 at 15:06 +, David

RE: [PATCH] usb: Replace a < b ? a : b construct with min_t(type, a, b) in drivers/usb

2019-06-18 Thread David Laight
From: d...@turingmachine.org > Sent: 18 June 2019 00:31 > Use min_t to find the minimum of two values instead of using the ?: operator. > > This change does not alter functionality. It is merely cosmetic intended to > improve the readability of the code. > > Signed-off-by: Daniel M German > ---

RE: [PATCH] usb: devio: fix mmap() on non-coherent DMA architectures

2019-08-05 Thread David Laight
From: gavi...@thegavinli.com > Sent: 01 August 2019 23:02 > > On architectures that are not (or are optionally) DMA coherent, > dma_alloc_coherent() returns an address into the vmalloc space, > and calling virt_to_phys() on this address returns an unusable > physical address. So? what is the code

RE: Type-C port on the Asmedia ASM1142

2017-10-02 Thread David Laight
From: Adrian Bocaniciu > Sent: 30 September 2017 09:18 > On Fri, 29 Sep 2017 09:06:16 +0000 > David Laight wrote: > > > > The correct names used in the new specification for the 4 speeds that can > > > be supported by a USB 3 > > > interface are: . >

RE: [PATCH] usb: quirks: add quirk for WORLDE MINI MIDI keyboard

2017-10-03 Thread David Laight
From: Felipe Balbi > Sent: 03 October 2017 09:17 > This keyboard doesn't implement Get String descriptors properly even > though string indexes are valid. What happens is that when requesting > for the String descriptor, the device disconnects and > reconnects. Without this quirk, this loop will co

RE: [PATCH 02/13] xhci: add port speed ID to portsc tracing

2017-10-05 Thread David Laight
From: Mathias Nyman > Sent: 05 October 2017 09:22 > Shows the port speed protocol speed ID (PSID) in use. > speed ID may map to custom speeds, but in most cases it uses default > > 1 = Full-Speed12 MB/s > 2 = Low-Speed 1.5 Mb/s > 3 = High-speed480 Mb/s > 4 = SuperSpeed

RE: the imfamous asix ax88179 iommu error

2017-10-06 Thread David Laight
> >> It appears that my ax88179 is working just fine now with the vendor > >> driver. So perhaps it's possible to revert the old commit in the linux > >> kernel and allow the use of scatter gather ? (perhaps for non-intel > >> hosts ? I'm not sure if this device is effected by intel xhci errata) >

RE: VL805 xHCI DMA read faults

2017-10-10 Thread David Laight
From: Robin Murphy > Sent: 09 October 2017 18:39 ... > > - without the IOMMU, block sizes >=128K all settle down into a > >suspiciously-periodic error every 2048 sectors. That stinks of being a problem where either the link TRB is part way through a USB packet or where a buffer fragment cross

RE: VL805 xHCI DMA read faults

2017-10-10 Thread David Laight
From: Mathias Nyman > Sent: 10 October 2017 15:13 ... > [ 428.409645] print_req_error: I/O error, dev sdb, sector 128 > [ 428.426612] arm-smmu 2b50.iommu: Unhandled context fault: fsr=0x8, > iova=0xff0b1000, > fsynr=0x183, cb=0 > > a ring segment is 256 TRBS, each *16 bytes, that ring last

RE: VL805 xHCI DMA read faults

2017-10-10 Thread David Laight
From: Robin Murphy > Sent: 10 October 2017 16:25 ... > > That could 'just' be the hardware doing a 'readahead' of the ring. > > Somewhat annoying if it is doing that across page boundaries. > > > Although, in that case, the read values wouldn't be used because the > > last TRB is a link. > > So tha

RE: [PATCH] xhci: Cope with VIA VL805 readahead

2017-10-11 Thread David Laight
From: Robin Murphy > Sent: 10 October 2017 19:09 > > The VIA VL805 host controller is well-known for causing problems on > systems with IOMMUs enabled, ranging from triggering endless streams of > fault messages to locking itself up completely. It appears that the root > of the problem might be an

RE: [PATCH] xhci: Cope with VIA VL805 readahead

2017-10-11 Thread David Laight
From: Mathias Nyman > Sent: 11 October 2017 15:41 .. > If possible I'd like to try and find some other solution before chopping the > Segment > size to smaller than 256. > I think that your first proposal of adding the guard page to the segment pool > could be an option. Would be a waste of a pa

RE: [PATCH] usb: gadget: goku_udc: mark expected switch fall-throughs

2017-10-24 Thread David Laight
From: Gustavo A. R. Silva > Sent: 24 October 2017 04:46 > In preparation to enabling -Wimplicit-fallthrough, mark switch cases > where we are expecting to fall through. > > Addresses-Coverity-ID: 145713 > Signed-off-by: Gustavo A. R. Silva > --- > drivers/usb/gadget/udc/goku_udc.c | 14 +

RE: [PATCH] USB: serial: io_edgeport: mark expected switch fall-throughs

2017-10-30 Thread David Laight
From: Bjørn Mork > Sent: 28 October 2017 11:57 > > In preparation to enabling -Wimplicit-fallthrough, mark switch cases > > where we are expecting to fall through. > > > > Notice that in this particular case I replaced "...drop on through" > > comments with a proper "fall through" comment on its ow

RE: [PATCH v3] usb: document that URB transfer_buffer should be aligned

2017-04-07 Thread David Laight
From: Mauro Carvalho Chehab > Sent: 05 April 2017 14:53 > Several host controllers, commonly found on ARM, like dwc2, > require buffers that are CPU-word aligned for they to work. > > Failing to do that will cause buffer overflows at the caller > drivers, with could cause data corruption. > > Suc

RE: [PATCH 3/3] usb: dwc3: ep0: improve handling of unaligned OUT requests

2017-04-11 Thread David Laight
From: Felipe Balbi > Sent: 07 April 2017 12:37 > Just like we did for all other endpoint types, let's rely on a chained > TRB pointing to ep0_bounce_addr in order to align transfer size. This > will make the code simpler. ... Is the dwc3 similar enough to xhci to have an 'immediate data' bit? If s

RE: [PATCH 3/3] usb: dwc3: ep0: improve handling of unaligned OUT requests

2017-04-12 Thread David Laight
From: Felipe Balbi > Sent: 12 April 2017 06:55 > David Laight writes: > > > From: Felipe Balbi > >> Sent: 07 April 2017 12:37 > >> Just like we did for all other endpoint types, let's rely on a chained > >> TRB pointing to ep0_bounce_addr in order

RE: [PATCH 3/3] usb: dwc3: ep0: improve handling of unaligned OUT requests

2017-04-12 Thread David Laight
From: Felipe > Sent: 12 April 2017 06:57 > Felipe Balbi writes: > >> From: Felipe Balbi > >>> Sent: 07 April 2017 12:37 > >>> Just like we did for all other endpoint types, let's rely on a chained > >>> TRB pointing to ep0_bounce_addr in order to align transfer size. This > >>> will make the code

RE: [PATCH 3/3] usb: dwc3: ep0: improve handling of unaligned OUT requests

2017-04-12 Thread David Laight
From: Felipe Balbi > David Laight writes: > >> > From: Felipe Balbi > >> >> Sent: 07 April 2017 12:37 > >> >> Just like we did for all other endpoint types, let's rely on a chained > >> >> TRB pointing to ep0_bounce_addr in orde

RE: [PATCH 1/3] usb: dwc3: gadget: Prevent losing events in event cache

2017-04-18 Thread David Laight
From: Bjorn Helgaas > Sent: 12 April 2017 16:05 ... > >> So we mask the interrupt in the TH and a short time later, the > >> interrupt de-assertion packet is sent on PCIe bus and if that's not > >> seen right away we may already have another call to TH before the BH > >> gets scheduled. > > > > not

RE: [PATCH 1/1] usb: host: xhci: print correct command ring address

2017-04-19 Thread David Laight
From: Peter Chen > Print correct command ring address using 'val_64'. > > Cc: stable > Signed-off-by: Peter Chen > --- > drivers/usb/host/xhci-mem.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c > index de1503

RE: Asmedia USB 1343 crashes

2017-05-02 Thread David Laight
From: Thomas Fjellstrom > Sent: 01 May 2017 14:40 > I've got a 970 Pro gaming aura motherboard with an Asmedia 1343 Usb 3.1 > controller. It's been consistently throwing errors and eventually crashing and > becomming unresponsive. ... I've an earlier Asmedia 1042 controller. It has a bug (which I

RE: [PATCH 5/7] usb: dwc3: debug: remove static char buffer from dwc3_decode_event()

2017-05-09 Thread David Laight
From: Felipe Balbi > Sent: 09 May 2017 08:07 > Instead, we can require caller to pass a buffer for the function to > use. This cleans things quite a bit. ... > -dwc3_gadget_event_string(const struct dwc3_event_devt *event) > +dwc3_gadget_event_string(char *str, const struct dwc3_event_devt *event)

RE: [PATCH] xhci: remove GFP_DMA flag from allocation

2017-05-09 Thread David Laight
From: Mathias Nyman > Sent: 09 May 2017 12:24 > On 08.05.2017 09:26, Mathias Nyman wrote: > > On 05.05.2017 15:05, Matthias Lange wrote: > >> There is no reason to restrict allocations to the first 16MB ISA DMA > >> addresses. ... What about the 4G boundary? IIRC dma_alloc_coherent() is most likel

RE: [PATCH] xhci: remove GFP_DMA flag from allocation

2017-05-11 Thread David Laight
From: Mathias Nyman > Sent: 11 May 2017 15:45 > On 09.05.2017 18:38, David Laight wrote: > > From: Mathias Nyman > >> Sent: 09 May 2017 12:24 > >> On 08.05.2017 09:26, Mathias Nyman wrote: > >>> On 05.05.2017 15:05, Matthias Lange wrote: > >>&

RE: [PATCH] USB: core: replace %p with %pK

2017-05-17 Thread David Laight
From: Greg KH > Sent: 16 May 2017 11:19 > Format specifier %p can leak kernel addresses while not valuing the > kptr_restrict system settings. When kptr_restrict is set to (1), kernel > pointers printed using the %pK format specifier will be replaced with > Zeros. Debugging Note : &pK prints only Z

RE: [PATCH v2 6/9] usb: dwc3: debug: remove static char buffer from dwc3_decode_event()

2017-05-18 Thread David Laight
From: Felipe Balbi > Sent: 17 May 2017 14:06 > Instead, we can require caller to pass a buffer for the function to > use. This cleans things quite a bit. This is 2017 not 1982, you just can't pass an unsized char[] through to code that is (presumably) going to do an sprint() into it. You could de

RE: [PATCH 6/8] xhci: remove GFP_DMA flag from allocation

2017-05-19 Thread David Laight
From: Mathias Nyman > Sent: 17 May 2017 16:32 > There is no reason to restrict allocations to the first 16MB ISA DMA > addresses. > > It is causing problems in a virtualization setup with enabled IOMMU > (x86_64). The result is that USB is not working in the VM. ... > diff --git a/drivers/usb/host

RE: [RFC V1 1/1] net: cdc_ncm: Reduce memory use when kernel memory low

2017-05-19 Thread David Laight
From: linux-usb-ow...@vger.kernel.org [mailto:linux-usb-ow...@vger.kernel.org] On Behalf Of Jim Baxter > Sent: 16 May 2017 18:41 > > The CDC-NCM driver can require large amounts of memory to create > skb's and this can be a problem when the memory becomes fragmented. > > This especially affects

RE: [PATCH 6/8] xhci: remove GFP_DMA flag from allocation

2017-05-19 Thread David Laight
From: Mathias Nyman > Sent: 19 May 2017 10:49 > To: David Laight; gre...@linuxfoundation.org > Cc: linux-usb@vger.kernel.org; Matthias Lange; sta...@vger.kernel.org > Subject: Re: [PATCH 6/8] xhci: remove GFP_DMA flag from allocation > > On 19.05.2017 12:10, David Laight wrote:

RE: [RFC V1 1/1] net: cdc_ncm: Reduce memory use when kernel memory low

2017-05-19 Thread David Laight
From: Bjørn Mork > Sent: 19 May 2017 14:56 ... > Unless someone has a nice way to just collect a list of skbs and have > them converted to proper framing on the fly when transmitting, without > having to care about USB packet boundaries. skb can be linked into arbitrary chains (or even trees), but

RE: [PATCH v3 0/2] usb: Check for DMA capable buffer sanity

2017-05-31 Thread David Laight
From: Wolfram Sang > Sent: 28 May 2017 17:04 > > On Fri, May 05, 2017 at 02:08:31PM -0700, Florian Fainelli wrote: > > On 04/25/2017 05:56 PM, Florian Fainelli wrote: > > > Changes in v3: > > > > > > - added check in usb_gadget_map_request_by_dev (Felipe), new patch > > > - improved commit message

<    1   2   3   4   5   6   >