Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3092761ybt; Mon, 29 Jun 2020 15:09:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzS9CqvLDGyrMCb67hCAWbmXjPMswkKfu+gnRMRYHb5InJw+ja4HuvCH0j8ypCUAqO2skAn X-Received: by 2002:a50:e047:: with SMTP id g7mr19363606edl.290.1593468595416; Mon, 29 Jun 2020 15:09:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593468595; cv=none; d=google.com; s=arc-20160816; b=mGsE6kkq1rxbOZw3T1V2ubYFqKK5LVlSJBEzC0towS8axYr9ptLbRB1G+oC3w+/vAv 1gYMVDCC4bvtFKog1ztASXMMXfqKcBHBz2BWDYaPP2B6y4K18GpeKAHZvhaU0D1UpHRz 1dsQyUvZZbUl9NRdvIKJHqRr5fPhlFCd8unaGVsRWb+jI5K+PSn7d2S9CyysJ1OyYxnk 9fC5ZEup/c/sp/kG6rRhQ0B4GQ7vrHf60BMcuLTBG8V/zQ/8RcTQ5Kk71CSnZpBk/9WA PmrH+kchS12vxhOtZLKlNbDhNG2tlejmDCS1f9nbU4S8ghE2pTpSrIrsF4u6MVogD76/ Fohg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2YWAECJYFgzQbcxiyDqBTzy/3D4/aWh+lHD+qQNF8qo=; b=R3bNWmvHf6dglUXrhCpUWj0rw0HKKCS+w14Gj4RJwT5GqXfBmB1u7eQLLZtkkMAJoy 7xEHfqAIDiALAaf/cjrRDNgIZ3dKeLY/+Xp9RIdIL7ucLeSFIim1nq33E1zLJK4TjGuw CcUu59mSufR6UGWmrVvf1MRFp2C9lilSSuDcCtyWamH+wGgRpSBXHPzLroqxbvWRzcLZ tIDU6y+9VFAyH/Psc0Fv8Ei56QojajtpBnGNWpS1NGq3Tldh+uxt2M2oJEzTOffmwjiH 1qf37QSFPEjRNy2tKkU0VMTEAWkUTHjzPKLWpz4kqJrEp7lbrZdw9vsSWbcKRUPiAIzN xyuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Vy7Cd39v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si558492ejd.449.2020.06.29.15.09.32; Mon, 29 Jun 2020 15:09:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Vy7Cd39v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390519AbgF2WGW (ORCPT + 99 others); Mon, 29 Jun 2020 18:06:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:56782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726139AbgF2SfS (ORCPT ); Mon, 29 Jun 2020 14:35:18 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9982B2463E; Mon, 29 Jun 2020 15:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593443963; bh=giJcWPoG0KotqrnpuGv7hPNXaJdUSSdszAHKNZgTzbM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vy7Cd39v+FzTDA5bGXmgHFUPODXOxZ4lE3AOvS1AA8s1j/ieJTowEMgcb+eMazd6F XZ8/l67eJ3V3lchRg2scldaOJ4uit+ERhWyxZhCRi+qKETQz4JxeKt1M7Ax36IvRP6 iRRglGCNS76S+lDmCl9ooFlV92/7igWiq4WMLkbw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Longfang Liu , Alan Stern , Greg Kroah-Hartman Subject: [PATCH 5.7 066/265] USB: ehci: reopen solution for Synopsys HC bug Date: Mon, 29 Jun 2020 11:14:59 -0400 Message-Id: <20200629151818.2493727-67-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200629151818.2493727-1-sashal@kernel.org> References: <20200629151818.2493727-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.7.7-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.7.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.7.7-rc1 X-KernelTest-Deadline: 2020-07-01T15:14+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Longfang Liu commit 1ddcb71a3edf0e1682b6e056158e4c4b00325f66 upstream. A Synopsys USB2.0 core used in Huawei Kunpeng920 SoC has a bug which might cause the host controller not issuing ping. Bug description: After indicating an Interrupt on Async Advance, the software uses the doorbell mechanism to delete the Next Link queue head of the last executed queue head. At this time, the host controller still references the removed queue head(the queue head is NULL). NULL reference causes the host controller to lose the USB device. Solution: After deleting the Next Link queue head, when has_synopsys_hc_bug set to 1,the software can write one of the valid queue head addresses to the ASYNCLISTADDR register to allow the host controller to get the valid queue head. in order to solve that problem, this patch set the flag for Huawei Kunpeng920 There are detailed instructions and solutions in this patch: commit 2f7ac6c19997 ("USB: ehci: add workaround for Synopsys HC bug") Signed-off-by: Longfang Liu Cc: stable Acked-by: Alan Stern Link: https://lore.kernel.org/r/1591588019-44284-1-git-send-email-liulongfang@huawei.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/ehci-pci.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index 1a48ab1bd3b2a..7ff2cbdcd0b22 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c @@ -216,6 +216,13 @@ static int ehci_pci_setup(struct usb_hcd *hcd) ehci_info(ehci, "applying MosChip frame-index workaround\n"); ehci->frame_index_bug = 1; break; + case PCI_VENDOR_ID_HUAWEI: + /* Synopsys HC bug */ + if (pdev->device == 0xa239) { + ehci_info(ehci, "applying Synopsys HC workaround\n"); + ehci->has_synopsys_hc_bug = 1; + } + break; } /* optional debug port, normally in the first BAR */ -- 2.25.1