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


Groups > linux.kernel > #1258768

Re: [PATCH v2 1/1] usb: xhci: fix checking ep busy for CFC

From Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/1] usb: xhci: fix checking ep busy for CFC
Date 2015-10-29 14:00 +0100
Message-ID <qoUYa-gQ-7@gated-at.bofh.it> (permalink)
References <qoLrP-2HA-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello.

On 10/29/2015 5:46 AM, Lu Baolu wrote:

> Function ep_ring_is_processing() checks the dequeue pointer
> in endpoint context to know whether an endpoint is busy with
> processing TRBs. This is not correct since dequeue pointer
> field in an endpoint context is only valid when the endpoint
> is in Halted or Stopped states. This buggy code causes audio
> noise when playing sound with USB headset connected to host
> controllers which support CFC (one of xhci 1.1 features).
>
> This patch should exist in stable kernel since v4.3.
>
> Reported-and-tested-by: YD Tseng <yd_tseng@asmedia.com.tw>
> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
>
> ---
> v1->v2:
> Implement the logic in xhci_queue_isoc_tx_prepare() instead of
> a seperated function as suggested by Mathias.
>
> ---
>   drivers/usb/host/xhci-ring.c | 32 ++++++--------------------------
>   1 file changed, 6 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
> index fa83625..8edc286 100644
> --- a/drivers/usb/host/xhci-ring.c
> +++ b/drivers/usb/host/xhci-ring.c
[...]
> @@ -3983,10 +3961,12 @@ int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags,
>   	}
>
>   	/* Calculate the start frame and put it in urb->start_frame. */
> -	if (HCC_CFC(xhci->hcc_params) &&
> -			ep_ring_is_processing(xhci, slot_id, ep_index)) {
> -		urb->start_frame = xep->next_frame_id;
> -		goto skip_start_over;
> +	if (HCC_CFC(xhci->hcc_params)) {
> +		if ((le32_to_cpu(ep_ctx->ep_info) & EP_STATE_MASK)
> +					== EP_STATE_RUNNING &&
> +				!list_empty(&ep_ring->td_list))
> +			urb->start_frame = xep->next_frame_id;
> +			goto skip_start_over;

    Forgot {}?

>   	}
>
>   	start_frame = readl(&xhci->run_regs->microframe_index);

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH v2 1/1] usb: xhci: fix checking ep busy for CFC Lu Baolu <baolu.lu@linux.intel.com> - 2015-10-29 03:50 +0100
  Re: [PATCH v2 1/1] usb: xhci: fix checking ep busy for CFC Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-10-29 14:00 +0100
    Re: [PATCH v2 1/1] usb: xhci: fix checking ep busy for CFC "Lu, Baolu" <baolu.lu@linux.intel.com> - 2015-10-29 14:00 +0100
      Re: [PATCH v2 1/1] usb: xhci: fix checking ep busy for CFC Mathias Nyman <mathias.nyman@linux.intel.com> - 2015-10-29 15:10 +0100
        Re: [PATCH v2 1/1] usb: xhci: fix checking ep busy for CFC "Lu, Baolu" <baolu.lu@linux.intel.com> - 2015-10-29 15:30 +0100

csiph-web