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

2017-01-02 Thread Baolin Wang
On 2 January 2017 at 22:57, Mathias Nyman wrote: > On 27.12.2016 05:07, Baolin Wang wrote: >> >> Hi, >> >> On 21 December 2016 at 21:00, Mathias Nyman >> wrote: >>> >>> On 21.12.2016 04:22, Baolin Wang wrote: Hi

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

2017-01-02 Thread Mathias Nyman
On 27.12.2016 05:07, Baolin Wang wrote: Hi, On 21 December 2016 at 21:00, Mathias Nyman wrote: On 21.12.2016 04:22, Baolin Wang wrote: Hi Mathias, On 20 December 2016 at 23:13, Mathias Nyman wrote: On 20.12.2016 09:30, Baolin

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

2016-12-26 Thread Baolin Wang
Hi, On 21 December 2016 at 21:00, Mathias Nyman wrote: > On 21.12.2016 04:22, Baolin Wang wrote: >> >> Hi Mathias, >> >> On 20 December 2016 at 23:13, Mathias Nyman >> wrote: >>> >>> On 20.12.2016 09:30, Baolin Wang wrote: >>> ...

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

2016-12-23 Thread Mathias Nyman
On 22.12.2016 03:46, Lu Baolu wrote: Hi, On 12/21/2016 11:18 PM, OGAWA Hirofumi wrote: Mathias Nyman writes: We set CMD_RING_STATE_ABORTED state under locking. I'm not checking what is for taking lock for register though, I guess it should be enough just lock

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

2016-12-21 Thread Lu Baolu
Hi, On 12/21/2016 11:18 PM, OGAWA Hirofumi wrote: > Mathias Nyman writes: > >>> We set CMD_RING_STATE_ABORTED state under locking. I'm not checking what >>> is for taking lock for register though, I guess it should be enough just >>> lock around of read=>write of

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

2016-12-21 Thread Lu Baolu
Hi, On 12/21/2016 08:48 PM, Mathias Nyman wrote: > On 21.12.2016 08:17, Lu Baolu wrote: >> Hi Mathias, >> >> I have some comments for the implementation of xhci_abort_cmd_ring() below. >> >> On 12/20/2016 11:13 PM, Mathias Nyman wrote: >>> On 20.12.2016 09:30, Baolin Wang wrote: >>> ... >>> >>>

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

2016-12-21 Thread Lu Baolu
Hi, On 12/21/2016 08:57 PM, Mathias Nyman wrote: > On 21.12.2016 08:57, Lu Baolu wrote: >> Hi Mathias, >> >> I have some comments for the implementation of >> xhci_handle_command_timeout() as well. >> >> On 12/20/2016 11:13 PM, Mathias Nyman wrote: >>> On 20.12.2016 09:30, Baolin Wang wrote: >>>

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

2016-12-21 Thread OGAWA Hirofumi
Mathias Nyman writes: >> We set CMD_RING_STATE_ABORTED state under locking. I'm not checking what >> is for taking lock for register though, I guess it should be enough just >> lock around of read=>write of ->cmd_ring if need lock. > > After your patch it should be

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

2016-12-21 Thread Mathias Nyman
On 21.12.2016 16:10, OGAWA Hirofumi wrote: Mathias Nyman writes: Below is the latest code. I put my comments in line. 322 static int xhci_abort_cmd_ring(struct xhci_hcd *xhci) 323 { 324 u64 temp_64; 325 int ret; 326 327

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

2016-12-21 Thread OGAWA Hirofumi
Mathias Nyman writes: >> Below is the latest code. I put my comments in line. >> >> 322 static int xhci_abort_cmd_ring(struct xhci_hcd *xhci) >> 323 { >> 324 u64 temp_64; >> 325 int ret; >> 326 >> 327 xhci_dbg(xhci, "Abort

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

2016-12-21 Thread Mathias Nyman
On 21.12.2016 04:22, Baolin Wang wrote: Hi Mathias, On 20 December 2016 at 23:13, Mathias Nyman wrote: On 20.12.2016 09:30, Baolin Wang wrote: ... Alright, I gathered all current work related to xhci races and timeouts and put them into a branch:

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

2016-12-21 Thread Mathias Nyman
On 21.12.2016 08:57, Lu Baolu wrote: Hi Mathias, I have some comments for the implementation of xhci_handle_command_timeout() as well. On 12/20/2016 11:13 PM, Mathias Nyman wrote: On 20.12.2016 09:30, Baolin Wang wrote: ... Alright, I gathered all current work related to xhci races and

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

2016-12-21 Thread Mathias Nyman
On 21.12.2016 08:17, Lu Baolu wrote: Hi Mathias, I have some comments for the implementation of xhci_abort_cmd_ring() below. On 12/20/2016 11:13 PM, Mathias Nyman wrote: On 20.12.2016 09:30, Baolin Wang wrote: ... Alright, I gathered all current work related to xhci races and timeouts and

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

2016-12-20 Thread Lu Baolu
Hi Mathias, I have some comments for the implementation of xhci_handle_command_timeout() as well. On 12/20/2016 11:13 PM, Mathias Nyman wrote: > On 20.12.2016 09:30, Baolin Wang wrote: > ... > > Alright, I gathered all current work related to xhci races and timeouts > and put them into a branch:

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

2016-12-20 Thread Lu Baolu
Hi Mathias, I have some comments for the implementation of xhci_abort_cmd_ring() below. On 12/20/2016 11:13 PM, Mathias Nyman wrote: > On 20.12.2016 09:30, Baolin Wang wrote: > ... > > Alright, I gathered all current work related to xhci races and timeouts > and put them into a branch: > >

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

2016-12-20 Thread Baolin Wang
Hi Mathias, On 20 December 2016 at 23:13, Mathias Nyman wrote: > On 20.12.2016 09:30, Baolin Wang wrote: > ... > > Alright, I gathered all current work related to xhci races and timeouts > and put them into a branch: > >

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

2016-12-20 Thread Mathias Nyman
On 20.12.2016 09:30, Baolin Wang wrote: ... Alright, I gathered all current work related to xhci races and timeouts and put them into a branch: git://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git timeout_race_fixes Its based on 4.9 It includes a few other patches just to avoid

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

2016-12-19 Thread Baolin Wang
Hi, On 20 December 2016 at 15:18, Lu Baolu wrote: > Hi, > > On 12/20/2016 02:46 PM, Baolin Wang wrote: >> On 20 December 2016 at 14:39, Lu Baolu wrote: >>> Hi, >>> >>> On 12/20/2016 02:06 PM, Baolin Wang wrote: Hi, On 20

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

2016-12-19 Thread Lu Baolu
Hi, On 12/20/2016 02:46 PM, Baolin Wang wrote: > On 20 December 2016 at 14:39, Lu Baolu wrote: >> Hi, >> >> On 12/20/2016 02:06 PM, Baolin Wang wrote: >>> Hi, >>> >>> On 20 December 2016 at 12:29, Lu Baolu wrote: Hi Mathias, On

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

2016-12-19 Thread Baolin Wang
On 20 December 2016 at 14:39, Lu Baolu wrote: > Hi, > > On 12/20/2016 02:06 PM, Baolin Wang wrote: >> Hi, >> >> On 20 December 2016 at 12:29, Lu Baolu wrote: >>> Hi Mathias, >>> >>> On 12/19/2016 08:13 PM, Mathias Nyman wrote: On

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

2016-12-19 Thread Lu Baolu
Hi, On 12/20/2016 02:06 PM, Baolin Wang wrote: > Hi, > > On 20 December 2016 at 12:29, Lu Baolu wrote: >> Hi Mathias, >> >> On 12/19/2016 08:13 PM, Mathias Nyman wrote: >>> On 19.12.2016 13:34, Baolin Wang wrote: Hi Mathias, On 19 December 2016 at 18:33,

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

2016-12-19 Thread Baolin Wang
Hi, On 20 December 2016 at 12:29, Lu Baolu wrote: > Hi Mathias, > > On 12/19/2016 08:13 PM, Mathias Nyman wrote: >> On 19.12.2016 13:34, Baolin Wang wrote: >>> Hi Mathias, >>> >>> On 19 December 2016 at 18:33, Mathias Nyman >>> wrote:

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

2016-12-19 Thread Lu Baolu
Hi Mathias, On 12/19/2016 08:13 PM, Mathias Nyman wrote: > On 19.12.2016 13:34, Baolin Wang wrote: >> Hi Mathias, >> >> On 19 December 2016 at 18:33, Mathias Nyman >> wrote: >>> On 13.12.2016 05:21, Baolin Wang wrote: Hi Mathias, On 12 December

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

2016-12-19 Thread Baolin Wang
On 19 December 2016 at 20:13, Mathias Nyman wrote: > On 19.12.2016 13:34, Baolin Wang wrote: >> >> Hi Mathias, >> >> On 19 December 2016 at 18:33, Mathias Nyman >> wrote: >>> >>> On 13.12.2016 05:21, Baolin Wang wrote: Hi

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

2016-12-19 Thread Mathias Nyman
On 19.12.2016 13:34, Baolin Wang wrote: Hi Mathias, On 19 December 2016 at 18:33, Mathias Nyman wrote: On 13.12.2016 05:21, Baolin Wang wrote: Hi Mathias, On 12 December 2016 at 23:52, Mathias Nyman wrote: On 05.12.2016

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

2016-12-19 Thread Baolin Wang
Hi Mathias, On 19 December 2016 at 18:33, Mathias Nyman wrote: > On 13.12.2016 05:21, Baolin Wang wrote: >> >> Hi Mathias, >> >> On 12 December 2016 at 23:52, Mathias Nyman >> wrote: >>> >>> On 05.12.2016 09:51, Baolin Wang wrote:

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

2016-12-19 Thread Mathias Nyman
On 13.12.2016 05:21, Baolin Wang wrote: Hi Mathias, On 12 December 2016 at 23:52, Mathias Nyman wrote: On 05.12.2016 09:51, Baolin Wang wrote: If a command event is found on the event ring during an interrupt, we need to stop the command timer with

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

2016-12-12 Thread Baolin Wang
Hi Mathias, On 12 December 2016 at 23:52, Mathias Nyman wrote: > On 05.12.2016 09:51, Baolin Wang wrote: >> >> If a command event is found on the event ring during an interrupt, >> we need to stop the command timer with del_timer(). Since del_timer() >> can fail if

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

2016-12-12 Thread Mathias Nyman
On 05.12.2016 09:51, Baolin Wang wrote: If a command event is found on the event ring during an interrupt, we need to stop the command timer with del_timer(). Since del_timer() can fail if the timer is running and waiting on the xHCI lock, then it maybe get the wrong timeout command in

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

2016-12-05 Thread Baolin Wang
If a command event is found on the event ring during an interrupt, we need to stop the command timer with del_timer(). Since del_timer() can fail if the timer is running and waiting on the xHCI lock, then it maybe get the wrong timeout command in xhci_handle_command_timeout() if host fetched a new