Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1361627

Re: [PATCH] usb: xhci: Fix incomplete PM resume operation due to XHCI commmand timeout

From Mathias Nyman <mathias.nyman@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] usb: xhci: Fix incomplete PM resume operation due to XHCI commmand timeout
Date 2016-03-21 10:10 +0100
Message-ID <rf40y-3pN-13@gated-at.bofh.it> (permalink)
References <re0BI-4Vd-21@gated-at.bofh.it> <re0BI-4Vd-19@gated-at.bofh.it> <reZNg-ue-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 21.03.2016 06:18, Rajesh Bhagat wrote:
>
>
>>
>> Hi
>>
>> I think clearing the whole command ring is a bit too much in this case.
>> It may cause issues for all attached devices when one command times out.
>>
>
> Hi Mathias,
>
> I understand your point, But I want to understand how would completion handler be called
> if a command is timed out and xhci_abort_cmd_ring is successful. In this case all the code
> would be waiting on completion handler forever.
> 	
>
> 2. xhci_handle_command_timeout -> xhci_abort_cmd_ring(failure) -> xhci_cleanup_command_queue -> xhci_complete_del_and_free_cmd
>
> In our case command is timed out, Hence we hit the case #2 but xhci_abort_cmd_ring is success which
> does not calls complete.

xhci_abort_cmd_ring() will write CA bit (CMD_RING_ABORT) to CRCR register.
This will generate a command completion event with status "command aborted" for the pending command.
This event is then followed by a "command ring stopped" command completion event.

See xHCI specs 5.4.5 and 4.6.1.2

handle_cmd_completion() will check if cmd_comp_code == COMP_CMD_ABORT, goto event_handled, and call
xhci_complete_del_and_free_cmd(cmd, cmd_comp_code) for the aborted command.

If xHCI already processed the aborted command, we might only get a command ring stopped event, in this
case handle_cmd_completion() will call xhci_handle_stopped_cmd_ring(xhci, cmd), which will turn the
commands that were tagged for "abort" that still remain on the command ring to NO-OP commands.

The completion callback will be called for these NO-OP command later when we get a command completion event
for them.
  
>> What kernel version, and what xhci vendor was this triggered on?
>>
>
> We are using 4.1.8 kernel
>

Are you able to try a more recent version?

-Mathias

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] usb: xhci: Fix incomplete PM resume operation due to  XHCI commmand timeout Mathias Nyman <mathias.nyman@linux.intel.com> - 2016-03-18 12:20 +0100
  RE: [PATCH] usb: xhci: Fix incomplete PM resume operation due to XHCI  commmand timeout Rajesh Bhagat <rajesh.bhagat@nxp.com> - 2016-03-21 05:40 +0100
    Re: [PATCH] usb: xhci: Fix incomplete PM resume operation due to  XHCI commmand timeout Mathias Nyman <mathias.nyman@intel.com> - 2016-03-21 10:10 +0100
      RE: [PATCH] usb: xhci: Fix incomplete PM resume operation due to XHCI  commmand timeout Rajesh Bhagat <rajesh.bhagat@nxp.com> - 2016-03-22 06:30 +0100
        Re: [PATCH] usb: xhci: Fix incomplete PM resume operation due to  XHCI commmand timeout Mathias Nyman <mathias.nyman@linux.intel.com> - 2016-03-22 13:00 +0100
          RE: [PATCH] usb: xhci: Fix incomplete PM resume operation due to XHCI  commmand timeout Rajesh Bhagat <rajesh.bhagat@nxp.com> - 2016-03-23 05:00 +0100
            Re: [PATCH] usb: xhci: Fix incomplete PM resume operation due to  XHCI commmand timeout Mathias Nyman <mathias.nyman@linux.intel.com> - 2016-03-23 15:20 +0100
              RE: [PATCH] usb: xhci: Fix incomplete PM resume operation due to XHCI  commmand timeout Rajesh Bhagat <rajesh.bhagat@nxp.com> - 2016-03-28 08:20 +0200
                Re: [PATCH] usb: xhci: Fix incomplete PM resume operation due to  XHCI commmand timeout Mathias Nyman <mathias.nyman@linux.intel.com> - 2016-03-29 19:20 +0200
                RE: [PATCH] usb: xhci: Fix incomplete PM resume operation due to XHCI  commmand timeout Rajesh Bhagat <rajesh.bhagat@nxp.com> - 2016-03-31 06:10 +0200
                Re: [PATCH] usb: xhci: Fix incomplete PM resume operation due to  XHCI commmand timeout Mathias Nyman <mathias.nyman@linux.intel.com> - 2016-03-31 16:40 +0200
                RE: [PATCH] usb: xhci: Fix incomplete PM resume operation due to XHCI  commmand timeout Rajesh Bhagat <rajesh.bhagat@nxp.com> - 2016-04-01 06:00 +0200
                Re: [PATCH] usb: xhci: Fix incomplete PM resume operation due to  XHCI commmand timeout Mathias Nyman <mathias.nyman@linux.intel.com> - 2016-04-01 12:50 +0200

csiph-web