Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2194001pxb; Mon, 11 Jan 2021 03:35:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwpWqy34+5msPZuQCXZKvTQxlJJ/ywQ2rlWSsn3DtvTD0CNrO2I5X14nCdjxbmK2f5wlWN0 X-Received: by 2002:a50:8b66:: with SMTP id l93mr13268784edl.384.1610364932199; Mon, 11 Jan 2021 03:35:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610364932; cv=none; d=google.com; s=arc-20160816; b=mQj09DqMENL9doMDTddqClBQCjjrEJ3faKObGqf3DRhqX9u5P1BiuaIVT5M3XlMLUU J5Ppbj1YJb1HNG8v/OezRqYno+1h8ZyJBZoAoOAUuT9YOQKvDbM6XLy5LdEy6V6btDat twIi/Zq0LTetRdwSpGA7v0VGk+O74f1LL98UeJ84+qbOD8uPyGmM5cOVBjoSr4C7qqIy LeMkas1nXc16puY92dSHFY6t3N6DdNiOFiMW8FoKGmS8+kbQuxX1KKiJV1QiIeQ40Klx NmMZjp2EAeDv/aUhMwOpBXU6YMwZeKRrj2XgTiBngc25djsqiutbBCpvMpDSVda81Bry fajQ== 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=ZDCtBpLDLOejW5aYOPFcep5yisnXb32Uz5dZNFg0pes=; b=RcwUeijiOUzVZIkonkS+zXC+vj4XGUJKRjfBhGkYq6MbfCA7ZF5jW5W+3T1pNyAGJA wg19T0G46gHVTWMXNnKwooph/UIbpDCjkxezhfYx4riIJyQJrF1+RmVZNuWXWkYILKX6 a0Ij/j5LG7G1aMO+qcrrvZCQmc4ezVZLGr6NI3WCZIzg/HUpKsdNISxcb/y6o+YqA6j9 hoF5TamqcTpsJ2NSuuBMeTc4vD1ZVJ0fL7WF9GC6nMbuebVJRmJVm9IR+qQAb4P5ZBuZ u81zMZBcl+A1sDRXywvLMuOClQa9ttTTi/Ro8tcwa1w7It8fcy5Emfn/mfC/mDa/do5n 23lQ== 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 f5si6447463ejw.117.2021.01.11.03.35.07; Mon, 11 Jan 2021 03:35:32 -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 S1729774AbhAKLcc (ORCPT + 99 others); Mon, 11 Jan 2021 06:32:32 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:10647 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729672AbhAKLcb (ORCPT ); Mon, 11 Jan 2021 06:32:31 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DDs2w5b34z15h8F; Mon, 11 Jan 2021 19:30:48 +0800 (CST) Received: from huawei.com (10.67.165.24) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Mon, 11 Jan 2021 19:31:38 +0800 From: Longfang Liu To: , CC: , , , Subject: [PATCH v2] USB:ehci:fix an interrupt calltrace error Date: Mon, 11 Jan 2021 19:29:37 +0800 Message-ID: <1610364577-11617-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 --- Changes in v2: - updated cleared registers drivers/usb/host/ehci-hub.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index ce0eaf7..a99c1ac 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c @@ -346,8 +346,12 @@ 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); ehci_handle_intr_unlinks(ehci); end_free_itds(ehci); -- 2.8.1