Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3491483pxb; Wed, 13 Oct 2021 07:07:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyau4ouNy45K8tHQ5aai3dXqopjuVe4oSHBzVEs6WO1DJfpUlMAt66Pz8sZ2QfY4PcSCmu X-Received: by 2002:a17:90a:ac14:: with SMTP id o20mr13758287pjq.219.1634134068793; Wed, 13 Oct 2021 07:07:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634134068; cv=none; d=google.com; s=arc-20160816; b=ePDSHs8Ro7JsHToxWu5bg4MQsYmf1+3atV7mYBk+Y1q6wVPSIm/sJT9sl/FtrxXl21 GXz5jCwvU/dut7Lu1I/FZFQkZSP3A1ADOdMpBhIW+1KulHzn/wEXE2L1NR3Fa59CDY95 FHJ7ktohsY8s5kcVNcZuuC50YCx7VwFNzB2UU8cKWQbaLjcGn0HPx8CJymRD0+PiFOyc bxIRSawA1zGelR3VKZ40/43V/dElVsysQHm9/+B3jnkeU2QF4DXS0Vil7tHlLORF1E6a 5uqc2jz8wzrf1ro0Z3BbJW5XGS7ljQiSRaKi5V3lj6dVcn53bLaoy9BbuEnAacSra8G2 ml3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=7WkOkbd88jFnznsg2CnvO5bl6MKEvFpKBgkE1pD51IE=; b=M8TrWiyaex/UmhbmHFBKaFSnXVCe3O3hh0mBW1f3E6mbcJHPTb4Wk8QC7gITdiET68 Ukp3m293GntEC+9Oe7KystDH0O3CFepvWaH9SjIJjyfVy2JkGq92nBF3xVQAlEPf+HDk d76sjGA+KXmQzHbPswttGZssfBRMcViO1zT+edSfF60z4ojWHxcYsV46sY68jEyk9hq4 +40MTTfVAQxZsY3Bf3cioXbJ25/Qyq+bL7YgiUZOID7jcm/joxVai+/ZX9eAPvOsHp0R 6l7d5tblQX3owomS4M8HvizM+dt7Hv7Spde4jhcFTPe90eRHmaIzAq948R2AWJyU9oD6 Nb8w== 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 b6si20350823pgi.463.2021.10.13.07.07.34; Wed, 13 Oct 2021 07:07:48 -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; 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 S235581AbhJMOI1 (ORCPT + 99 others); Wed, 13 Oct 2021 10:08:27 -0400 Received: from netrider.rowland.org ([192.131.102.5]:54745 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S230347AbhJMOI0 (ORCPT ); Wed, 13 Oct 2021 10:08:26 -0400 Received: (qmail 893839 invoked by uid 1000); 13 Oct 2021 10:06:22 -0400 Date: Wed, 13 Oct 2021 10:06:22 -0400 From: Alan Stern To: Yinbo Zhu Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Patchwork Bot Subject: Re: [PATCH v6] usb: ohci: disable start-of-frame interrupt in ohci_rh_suspend Message-ID: <20211013140622.GA893308@rowland.harvard.edu> References: <1634095928-29639-1-git-send-email-zhuyinbo@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1634095928-29639-1-git-send-email-zhuyinbo@loongson.cn> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 13, 2021 at 11:32:08AM +0800, Yinbo Zhu wrote: > While going into S3 or S4 suspend, an OHCI host controller can > generate interrupt requests if the INTR_SF enable flag is set. The > interrupt handler routine isn't prepared for this and it doesn't turn > off the flag, causing an interrupt storm. > > To fix this problem, make ohci_rh_suspend() always disable INTR_SF > interrupts after processing the done list and the ED unlinks but > before the controller goes into the suspended (non-UsbOperational) > state. There's no reason to leave the flag enabled, since a > suspended controller doesn't generate Start-of-Frame packets. > > Signed-off-by: Yinbo Zhu > --- Acked-by: Alan Stern > Change in v6: > 1. Rework the commit log information. > 2. Move the key change code after ohci_work in > ohci_rh_suspend. > > > drivers/usb/host/ohci-hub.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c > index f474f2f..90cee19 100644 > --- a/drivers/usb/host/ohci-hub.c > +++ b/drivers/usb/host/ohci-hub.c > @@ -91,6 +91,9 @@ static int ohci_rh_suspend (struct ohci_hcd *ohci, int autostop) > update_done_list(ohci); > ohci_work(ohci); > > + /* All ED unlinks should be finished, no need for SOF interrupts */ > + ohci_writel(ohci, OHCI_INTR_SF, &ohci->regs->intrdisable); > + > /* > * Some controllers don't handle "global" suspend properly if > * there are unsuspended ports. For these controllers, put all > -- > 1.8.3.1 >