Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-21 Thread OGAWA Hirofumi
r record (no chance to make patch I myself for now, sorry), while checking locking slightly, I noticed unrelated missing locking. xhci_cleanup_command_queue() We are calling it without locking, but we need to lock for accessing list. Thanks. -- OGAWA Hirofumi -- To unsubscribe from this lis

Re: [PATCH 2/2] usb: host: xhci: Handle the right timeout command

2016-12-21 Thread OGAWA Hirofumi
linus only > 3. remove unnecessary second abort try as a separate patch, send to usb-next > 4. remove polling for the Command ring running (CRR), waiting for completion > is enough, if completion times out then we can check CRR. for usb-next I think we should check both of CRR and e

Re: [PATCH 3/3] xhci: Remove busy loop from xhci_abort_cmd_ring()

2016-12-14 Thread OGAWA Hirofumi
Mathias Nyman writes: > On 14.12.2016 01:40, OGAWA Hirofumi wrote: >> ping about [PATCH 1/3, 2/3, 3/3]? >> > > 1/3 and 2/3 will be sent to 4.10 usb-linus after rc1, > 3/3 maybe to usb-next after that Thanks. -- OGAWA Hirofumi -- To unsubscribe from this list: send the

Re: [PATCH 3/3] xhci: Remove busy loop from xhci_abort_cmd_ring()

2016-12-13 Thread OGAWA Hirofumi
ping about [PATCH 1/3, 2/3, 3/3]? OGAWA Hirofumi writes: > Mathias Nyman writes: > >>> - Add xhci_handshake_sleep(), and use it. >> >> This seems a but overkill, I'd rather don't have xhci_handshake(), >> xhci_handshake_sleep() and __xhci_handshake()

Re: [PATCH 2/3 v3] xhci: Fix race related to abort operation

2016-12-05 Thread OGAWA Hirofumi
an say though is that after about 5 boots *with* your patch is > that I had no boot failure nor xhci warnings, so at least no obvious > regression either. Thanks for testing. Looks like that root abort cause itself was fixed somewhere. I think that workaround is not needed anymore though, Math

Re: [PATCH 2/3 v3] xhci: Fix race related to abort operation

2016-11-28 Thread OGAWA Hirofumi
/vpelletier/linux/tree/ts651_4.9-rc7 > Please do check I did not do mistakes when resolving conflicts (the 2 > last commits). Your ts651_4.9-rc7 (latest commit) is broken somehow. The following incremental patch for ts651_4.9-rc7 is to fix it. With this, xhci will become same with mine. Th

Re: [PATCH 2/3 v3] xhci: Fix race related to abort operation

2016-11-28 Thread OGAWA Hirofumi
OGAWA Hirofumi writes: >> I succeed to build 4.9-rc9 vanilla (starting from the same .config as >> with 4.8.9) but it then fails to load produced modules. During the >> build I have the following warnings: >> WARNING: "_copy_from_user" [drivers/hid/

Re: [PATCH 2/3 v3] xhci: Fix race related to abort operation

2016-11-28 Thread OGAWA Hirofumi
e same .config as > with 4.8.9) but it then fails to load produced modules. During the > build I have the following warnings: > WARNING: "_copy_from_user" [drivers/hid/hid.ko] has no CRC! Looks like, CONFIG_MODVERSIONS is broken. CONFIG_MODVERSIONS=n may

Re: [PATCH 3/3] xhci: Remove busy loop from xhci_abort_cmd_ring()

2016-11-24 Thread OGAWA Hirofumi
k; if (result == done) return 0; + if (usec <= 0) + break; udelay(1); usec--; - } while (usec > 0); + } return -ETIMEDOUT; } Thanks. -- OGAWA Hirofumi -- To unsubscri

Re: [PATCH 2/3 v3] xhci: Fix race related to abort operation

2016-11-24 Thread OGAWA Hirofumi
Vincent Pelletier writes: > On Wed, 23 Nov 2016 22:48:35 +0900, OGAWA Hirofumi > wrote: >> ping? > > FWIW, I intend to run this patch on the hardware which caused the > issue (thanks Mathias for the CC !). > > So far, in the very short attempt I made, I failed to ev

Re: [PATCH 2/3 v3] xhci: Fix race related to abort operation

2016-11-23 Thread OGAWA Hirofumi
ping? OGAWA Hirofumi writes: > Current abort operation has race. > > xhci_handle_command_timeout() > xhci_abort_cmd_ring() > xhci_write_64(CMD_RING_ABORT) > xhci_handshake(5s) > do { > check CMD_RING_RUNNIN

[PATCH 2/3 v3] xhci: Fix race related to abort operation

2016-11-16 Thread OGAWA Hirofumi
operation] Signed-off-by: OGAWA Hirofumi --- drivers/usb/host/xhci-mem.c |1 drivers/usb/host/xhci-ring.c | 163 ++ drivers/usb/host/xhci.h |1 3 files changed, 88 insertions(+), 77 deletions(-) diff -puN drivers/usb/host/xhci-mem.c~xhci-fix

Re: [PATCH 2/3 v2] xhci: Fix race related to abort operation

2016-11-16 Thread OGAWA Hirofumi
_head cmd_list; >> unsigned intcmd_ring_reserved_trbs; >> struct delayed_work cmd_timer; >> +struct completion stop_completion; > > Tiny thing, but maybe change stop_completion to > cmd_ring_stop_completion. to avoid mixing it with stopping host > controller, stop endpoint, stop device etc OK. -- OGAWA Hirofumi -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 2/3 v2] xhci: Fix race related to abort operation

2016-11-16 Thread OGAWA Hirofumi
operation] Signed-off-by: OGAWA Hirofumi --- drivers/usb/host/xhci-mem.c |1 drivers/usb/host/xhci-ring.c | 162 ++ drivers/usb/host/xhci.h |1 3 files changed, 87 insertions(+), 77 deletions(-) diff -puN drivers/usb/host/xhci-mem.c~xhci-fix

Re: [PATCH 2/3] xhci: Fix race related to abort operation

2016-11-16 Thread OGAWA Hirofumi
Felipe Balbi writes: > Hi, Hi, > OGAWA Hirofumi writes: >> diff -puN drivers/usb/host/xhci-ring.c~xhci-fix-abort-race2 >> drivers/usb/host/xhci-ring.c >> --- xhci/drivers/usb/host/xhci-ring.c~xhci-fix-abort-race2 2016-11-16 >> 13:36:07.219329211 +0900 >>

[PATCH 3/3] xhci: Remove busy loop from xhci_abort_cmd_ring()

2016-11-15 Thread OGAWA Hirofumi
ptr); /* check result */ udelay(1); <= meaningless delay return -ETIMEDOUT; Instead of above, this changes to do result = readl(ptr); /* check result */ udelay(1); result = readl(ptr); /* check result */ return -ETIMEDOUT; Signed-off-by: OGAWA Hi

[PATCH 2/3] xhci: Fix race related to abort operation

2016-11-15 Thread OGAWA Hirofumi
operation] Signed-off-by: OGAWA Hirofumi --- drivers/usb/host/xhci-mem.c |1 drivers/usb/host/xhci-ring.c | 163 ++ drivers/usb/host/xhci.h |1 3 files changed, 88 insertions(+), 77 deletions(-) diff -puN drivers/usb/host/xhci-mem.c~xhci-fix

[PATCH 1/3] xhci: Use delayed_work instead of timer for command timeout

2016-11-15 Thread OGAWA Hirofumi
This is preparation to fix abort operation race (See "xhci: Fix race related to abort operation"). To make timeout sleepable, use delayed_work instead of timer. Signed-off-by: OGAWA Hirofumi --- drivers/usb/host/xhci-mem.c |7 +++ drivers/usb/host/xhci-rin

Re: [PATCH] xhci: Fix dereference from empty xhci->cmd_list

2016-10-18 Thread OGAWA Hirofumi
Mathias Nyman writes: >> OGAWA Hirofumi writes: >>> If race with timeout or stop event on empty cmd_list was happened, >>> handle_cmd_completion() deferences wrong pointer from xhci->cmd_list. >>> >>> So this makes sure we don't deref

[PATCH] xhci: Fix dereference from empty xhci->cmd_list

2016-10-18 Thread OGAWA Hirofumi
If race with timeout or stop event on empty cmd_list was happened, handle_cmd_completion() deferences wrong pointer from xhci->cmd_list. So this makes sure we don't dereference wrong pointer from empty xhci->cmd_list. Signed-off-by: OGAWA Hirofumi --- drivers/usb/host/xhci-ri