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

2016-12-21 Thread OGAWA Hirofumi
nterrupt > handler. Just for 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 Hirof

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

2016-12-21 Thread OGAWA Hirofumi
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 even of stop

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

2016-12-14 Thread OGAWA Hirofumi
Mathias Nyman <mathias.ny...@linux.intel.com> 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 Hirofum

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 <hirof...@mail.parknet.co.jp> writes: > Mathias Nyman <mathias.ny...@linux.intel.com> writes: > >>> - Add xhci_handshake_sleep(), and use it. >> >> This seems a but overkill, I'd rather don't have xh

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

2016-12-05 Thread OGAWA Hirofumi
d somewhere. I think that workaround is not needed anymore though, Mathias will decide whether removing or not. Thanks. -- OGAWA Hirofumi <hirof...@mail.parknet.co.jp> -- 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

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

2016-11-28 Thread OGAWA Hirofumi
elletier/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. Thanks. -

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

2016-11-28 Thread OGAWA Hirofumi
OGAWA Hirofumi <hirof...@mail.parknet.co.jp> 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_

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

2016-11-28 Thread OGAWA Hirofumi
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/hid.ko] has no CRC! Looks like, CONFIG_MODVERSIONS is broken. CONFIG_MODVERSIONS=n ma

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

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

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

2016-11-24 Thread OGAWA Hirofumi
Vincent Pelletier <plr.vinc...@gmail.com> writes: > On Wed, 23 Nov 2016 22:48:35 +0900, OGAWA Hirofumi > <hirof...@mail.parknet.co.jp> wrote: >> ping? > > FWIW, I intend to run this patch on the hardware which caused the > issue (thanks Mathias for the CC !). >

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

2016-11-23 Thread OGAWA Hirofumi
ping? OGAWA Hirofumi <hirof...@mail.parknet.co.jp> writes: > Current abort operation has race. > > xhci_handle_command_timeout() > xhci_abort_cmd_ring() > xhci_write_64(CMD_RING_ABORT) > xhci_handshake(5s) > do { >

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

2016-11-16 Thread OGAWA Hirofumi
operation] Signed-off-by: OGAWA Hirofumi <hirof...@mail.parknet.co.jp> --- 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 drive

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

2016-11-16 Thread OGAWA Hirofumi
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 <hirof...@mail.parknet.co.jp> -- 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 <hirof...@mail.parknet.co.jp> --- 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 drive

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

2016-11-16 Thread OGAWA Hirofumi
Felipe Balbi <felipe.ba...@linux.intel.com> writes: > Hi, Hi, > OGAWA Hirofumi <hirof...@mail.parknet.co.jp> 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

[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 Hirofumi

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

2016-11-15 Thread OGAWA Hirofumi
operation] Signed-off-by: OGAWA Hirofumi <hirof...@mail.parknet.co.jp> --- 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 drive

[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 <hirof...@mail.parknet.co.jp> --- drivers/usb/host/xhci-mem.c |7 +++ drive

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

2016-10-18 Thread OGAWA Hirofumi
Mathias Nyman <mathias.ny...@intel.com> writes: >> OGAWA Hirofumi <hirof...@mail.parknet.co.jp> writes: >>> If race with timeout or stop event on empty cmd_list was happened, >>> handle_cmd_completion() deferences wrong pointer from xhci->cmd_list. >>

[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 <hirof...@mail.parknet.co.jp> ---