Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2965042pxb; Tue, 12 Jan 2021 03:04:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwU2sNZitNPh3DcCi5prkR9iOb1CcCG+G073/qVrt6y3B4zakDzbEjFvvxIkpjQwD36Enlw X-Received: by 2002:a17:906:cf81:: with SMTP id um1mr2892380ejb.122.1610449476878; Tue, 12 Jan 2021 03:04:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610449476; cv=none; d=google.com; s=arc-20160816; b=uNUzY06UwwXwYNOdPucf7tHhvQyDDWxbmLyzJz7ZermLc8hf6BpXhCWfBhr0aHWsvm IjmMx4kzyNGODD5zF2wwxFDDjBZDbE7GsJ/RHiioGQimYZ0drDTHBDFtN7X3TgIBf1UK mssHZ1/pB39uy3xq4m/iThJz+bWwvWeHiO75juFe/BKq0yz2ZzqlrEO/hi05cOnYhQDi Aad7R31qehnx8Xny19tT5Vj+4U7OYHwuBAVGI9JFtgleMlf6mu62O2uH3wF2SCSqOsCK 1CaljTgn+/7vh32yS1/80kKTdjLAvEmu479x0hhw5Zvk1TrxPB8vHAMkS5X7H6GI/8Kf rPhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=dqkp4/jL0lK8d65E7x4ewDpB6PRTw6W1ETzLC5jWpcQ=; b=KLitibnFZ1fDP2FNHlMvZkX4G3tHQF6mz/V9AmH0BNpnF15+TWrNFxs+72exbaJc1G 55yvu+tOsx1XOC/LfwVk9+iBiiX3ZMh7Y8uRkkte+yPccqg4H7FP/4HAV/QbsmWKktQv D+xU6sAXhI/BUzCoCigKXCZbBiFOJ0NKiFkn1JnkCRqOgH3fQ4gb924MsLXstBTDulKU M/1W12XyO7z/7wPHiKp511/SrIKh/3izyEcf7l7gJ3k5sNepWrXFc6J89gax9m10s+UY CxFhtXpD6/lYIs9cfrlRPAnXKnlk09FAY4LdaAhxFNo+ViAo67P8iQXRr8xY5ZaUwBIq CRpA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nt21si970758ejb.739.2021.01.12.03.04.13; Tue, 12 Jan 2021 03:04:36 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729694AbhALCAR (ORCPT + 99 others); Mon, 11 Jan 2021 21:00:17 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:10650 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726076AbhALCAQ (ORCPT ); Mon, 11 Jan 2021 21:00:16 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DFDJC24Dgz15rhs; Tue, 12 Jan 2021 09:58:35 +0800 (CST) Received: from huawei.com (10.67.165.24) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.498.0; Tue, 12 Jan 2021 09:59:28 +0800 From: Longfang Liu To: , CC: , , , Subject: [PATCH v2] USB:ehci:fix an interrupt calltrace error Date: Tue, 12 Jan 2021 09:57:27 +0800 Message-ID: <1610416647-45774-1-git-send-email-liulongfang@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The system that use Synopsys USB host controllers goes to suspend when using USB audio player. This causes the USB host controller continuous send interrupt signal to system, When the number of interrupts exceeds 100000, the system will forcibly close the interrupts and output a calltrace error. When the system goes to suspend, the last interrupt is reported to the driver. At this time, the system has set the state to suspend. This causes the last interrupt to not be processed by the system and not clear the interrupt flag. This uncleared interrupt flag constantly triggers new interrupt event. This causing the driver to receive more than 100,000 interrupts, which causes the system to forcibly close the interrupt report and report the calltrace error. so, when the driver goes to sleep and changes the system state to suspend, the interrupt flag needs to be cleared. Signed-off-by: Longfang Liu Acked-by: Alan Stern --- Changes in v2: - updated cleared registers drivers/usb/host/ehci-hub.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index ce0eaf7..6dfbba1 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c @@ -346,6 +346,9 @@ static int ehci_bus_suspend (struct usb_hcd *hcd) unlink_empty_async_suspended(ehci); + /* Some Synopsys controllers mistakenly leave IAA turned on */ + ehci_writel(ehci, STS_IAA, &ehci->regs->status); + /* Any IAA cycle that started before the suspend is now invalid */ end_iaa_cycle(ehci); ehci_handle_start_intr_unlinks(ehci); -- 2.8.1