From patchwork Thu Apr 8 07:03:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liulongfang X-Patchwork-Id: 417952 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CE34C433B4 for ; Thu, 8 Apr 2021 07:06:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0659561157 for ; Thu, 8 Apr 2021 07:06:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229996AbhDHHGj (ORCPT ); Thu, 8 Apr 2021 03:06:39 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:16824 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229552AbhDHHGi (ORCPT ); Thu, 8 Apr 2021 03:06:38 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FGC1B3Mvyz93XJ; Thu, 8 Apr 2021 15:04:14 +0800 (CST) Received: from huawei.com (10.67.165.24) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Thu, 8 Apr 2021 15:06:19 +0800 From: Longfang Liu To: , , , CC: , , , , Subject: [PATCH] USB:ehci:fix ehci hardware problem Date: Thu, 8 Apr 2021 15:03:45 +0800 Message-ID: <1617865425-28782-1-git-send-email-liulongfang@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org When rebooting the EHCI driver, ehci_shutdown() will be called. if the sbrn flag is 0, ehci_shutdown() will return directly. Our EHCI hardware does not define the SBRN register, which cause its value to default to 0. The sbrn flag being 0 will cause the EHCI interrupt signal to not be turned off after reboot. An interrupt that is not closed will cause an exception to the device sharing the interrupt. Currently, our hardware has this problem. We hope to solve this problem by skipping reading the sbrn register value. On the next generation of hardware, we will define this SBRN register in accordance with the controller standard. Signed-off-by: Longfang Liu --- drivers/usb/host/ehci-pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index 3c3820a..5dc6821 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c @@ -291,6 +291,8 @@ static int ehci_pci_setup(struct usb_hcd *hcd) if (pdev->vendor == PCI_VENDOR_ID_STMICRO && pdev->device == PCI_DEVICE_ID_STMICRO_USB_HOST) ; /* ConneXT has no sbrn register */ + else if (pdev->vendor == PCI_VENDOR_ID_HUAWEI) + ; /* sbrn register is undefined */ else pci_read_config_byte(pdev, 0x60, &ehci->sbrn);