From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9338C001DC for ; Mon, 31 Jul 2023 12:15:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232207AbjGaMPq (ORCPT ); Mon, 31 Jul 2023 08:15:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231504AbjGaMPn (ORCPT ); Mon, 31 Jul 2023 08:15:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5A9F197 for ; Mon, 31 Jul 2023 05:15:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 539796108C for ; Mon, 31 Jul 2023 12:15:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45D7EC433C8; Mon, 31 Jul 2023 12:15:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1690805740; bh=pz6WXZM0fcblV+mnVxnM5mWxy+n9xcLvwgRNUYXz6w0=; h=Subject:To:Cc:From:Date:From; b=If0mG46xU8h14G4FWn0dxVIG/Y7hzeQeEPcyIUB4JrcHlCKh3kGTMh3Lgl+/oM1+I IOJX37LySSuFS2MdUOeB7AlJ0zBZl7Fq93s+WbwZ3LMPvz0Dd9ZxUJUO53sj5eP/MB xDSB5eiAYCMwBCIlRhl/FaZON/Q3WRlc4Mskb9j8= Subject: FAILED: patch "[PATCH] Revert "xhci: add quirk for host controllers that don't" failed to apply to 5.10-stable tree To: oneukum@suse.com, gregkh@linuxfoundation.org, stable@kernel.org Cc: From: Date: Mon, 31 Jul 2023 14:15:36 +0200 Message-ID: <2023073136-reward-diner-6aeb@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x 5bef4b3cb95a5b883dfec8b3ffc0d671323d55bb # git commit -s git send-email --to '' --in-reply-to '2023073136-reward-diner-6aeb@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: 5bef4b3cb95a ("Revert "xhci: add quirk for host controllers that don't update endpoint DCS"") 5255660b208a ("xhci: add quirk for host controllers that don't update endpoint DCS") d1658268e439 ("usb: pci-quirks: disable D3cold on xhci suspend for s2idle on AMD Renoir") a4a251f8c235 ("usb: xhci: do not perform Soft Retry for some xHCI hosts") d1dbfb942c33 ("xhci: introduce a new move_dequeue_past_td() function to replace old code.") 9ebf30007858 ("xhci: Fix halted endpoint at stop endpoint command completion") 674f8438c121 ("xhci: split handling halted endpoints into two steps") 7c6c334e6fc8 ("xhci: move and rename xhci_cleanup_halted_endpoint()") 4db356924a50 ("xhci: turn cancelled td cleanup to its own function") a6ccd1fd4bd4 ("xhci: store TD status in the td struct instead of passing it along") e1a298390e98 ("xhci: use xhci_td_cleanup() helper when giving back cancelled URBs") 69eaf9e79fa7 ("xhci: move xhci_td_cleanup so it can be called by more functions") d8ac95001bea ("xhci: Add xhci_reset_halted_ep() helper function") b1adc42d440d ("xhci: add xhci_get_virt_ep() helper") a181030703df ("xhci: remove unused event parameter from completion handlers") d70f4231b81e ("xhci: adjust parameters passed to cleanup_halted_endpoint()") d4dff8043ea5 ("xhci: get isochronous ring directly from endpoint structure") ab58f3bb6aaa ("xhci: Avoid parsing transfer events several times") bac1ec551434 ("usb: xhci: Set quirk for XHCI_SG_TRB_CACHE_SIZE_QUIRK") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 5bef4b3cb95a5b883dfec8b3ffc0d671323d55bb Mon Sep 17 00:00:00 2001 From: Oliver Neukum Date: Thu, 13 Jul 2023 13:28:10 +0200 Subject: [PATCH] Revert "xhci: add quirk for host controllers that don't update endpoint DCS" This reverts commit 5255660b208aebfdb71d574f3952cf48392f4306. This quirk breaks at least the following hardware: 0b:00.0 0c03: 1106:3483 (rev 01) (prog-if 30 [XHCI]) Subsystem: 1106:3483 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR- Fixes: 5255660b208a ("xhci: add quirk for host controllers that don't update endpoint DCS") Cc: stable Link: https://lore.kernel.org/r/20230713112830.21773-1-oneukum@suse.com Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index c6742bae41c0..b9ae5c2a2527 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -479,10 +479,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) pdev->device == 0x3432) xhci->quirks |= XHCI_BROKEN_STREAMS; - if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) { + if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) xhci->quirks |= XHCI_LPM_SUPPORT; - xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS; - } if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && pdev->device == PCI_DEVICE_ID_ASMEDIA_1042_XHCI) { diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 646ff125def5..1dde53f6eb31 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -626,11 +626,8 @@ static int xhci_move_dequeue_past_td(struct xhci_hcd *xhci, struct xhci_ring *ep_ring; struct xhci_command *cmd; struct xhci_segment *new_seg; - struct xhci_segment *halted_seg = NULL; union xhci_trb *new_deq; int new_cycle; - union xhci_trb *halted_trb; - int index = 0; dma_addr_t addr; u64 hw_dequeue; bool cycle_found = false; @@ -668,27 +665,7 @@ static int xhci_move_dequeue_past_td(struct xhci_hcd *xhci, hw_dequeue = xhci_get_hw_deq(xhci, dev, ep_index, stream_id); new_seg = ep_ring->deq_seg; new_deq = ep_ring->dequeue; - - /* - * Quirk: xHC write-back of the DCS field in the hardware dequeue - * pointer is wrong - use the cycle state of the TRB pointed to by - * the dequeue pointer. - */ - if (xhci->quirks & XHCI_EP_CTX_BROKEN_DCS && - !(ep->ep_state & EP_HAS_STREAMS)) - halted_seg = trb_in_td(xhci, td->start_seg, - td->first_trb, td->last_trb, - hw_dequeue & ~0xf, false); - if (halted_seg) { - index = ((dma_addr_t)(hw_dequeue & ~0xf) - halted_seg->dma) / - sizeof(*halted_trb); - halted_trb = &halted_seg->trbs[index]; - new_cycle = halted_trb->generic.field[3] & 0x1; - xhci_dbg(xhci, "Endpoint DCS = %d TRB index = %d cycle = %d\n", - (u8)(hw_dequeue & 0x1), index, new_cycle); - } else { - new_cycle = hw_dequeue & 0x1; - } + new_cycle = hw_dequeue & 0x1; /* * We want to find the pointer, segment and cycle state of the new trb