Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1426646pxf; Fri, 9 Apr 2021 08:09:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0vVceXpcmtV3vPjubhfsv1z6uPjUq/lfYmg+nIlgFwBdx1lzpBzjmuiUm8czbLmSCfOJ8 X-Received: by 2002:a17:906:86c2:: with SMTP id j2mr5962738ejy.257.1617980973316; Fri, 09 Apr 2021 08:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617980973; cv=none; d=google.com; s=arc-20160816; b=sPvHoZkO7WwfnSheGUUbwaZZN6iM0JvDtDRbLYXM0O8Bh8PrTqk9fC9/VZlZgiDLXG j08vENsHIr+pZYKltI+8eX7Tt6Uz9Q6B6mgiTriBURXDbOku4OgIZ99J61tunBLuwjom oyEJuJ6xkyZJLq5CNJNKzdWUs5zHihZrwbypPKB/baCREZ390O+2WpCc7BqGzeAEHhr/ 3+IKpD2rixhZA3Uvm3Fqy9SSMPe17BPBixQGqr5M/UPck3U4hhvGE19zC3BvjSgzFaaw bvagNvNiVujuYYLoFP/T9T35MZJJkUjz+taZ+h7arTzeAKqK3wdjMy3OJTL5i0VKDnU6 mz/w== 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=fIzfzOMXgQB8HEtCcy4S8e4OHRlVqdLKIaXoFIA5F74=; b=e3lRMgvV6qmynz28PTUOHrzSp+Jgu6rZgQKXsOmm0dL32V/UmrTC8wTUGhk8uN+gaS /cHKHbfKrJHdACRQnSBq9OvhQGeaSpOFaevAAAGIY7SWXGyftUbYA4Pp/Nm5+ZWn1pcw LdDqeJojv7Aq47s/4w6R44rQHTABShaFK9wYXCJfAkpxJLtovEoRuKQ11bG7JcwKH9j0 Q8HqUhLZUAiSH/5JCUzPYlbGrGdyMrCxG6XVXrET3Yu+xM/o/sG5kAYJK4/oy2w/teRR 15aHAO76wc3k1/xhIzXRFM2vWmt8VuDf019xQiPfZ80iKHoS/4nMh9fIBRZGJHe3+Q1t RD8g== 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 v1si2255322ejq.201.2021.04.09.08.09.10; Fri, 09 Apr 2021 08:09:33 -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 S234082AbhDIPH7 (ORCPT + 99 others); Fri, 9 Apr 2021 11:07:59 -0400 Received: from netrider.rowland.org ([192.131.102.5]:37493 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S234072AbhDIPH6 (ORCPT ); Fri, 9 Apr 2021 11:07:58 -0400 Received: (qmail 1334309 invoked by uid 1000); 9 Apr 2021 11:07:44 -0400 Date: Fri, 9 Apr 2021 11:07:44 -0400 From: Alan Stern To: Longfang Liu Cc: gregkh@linuxfoundation.org, mathias.nyman@intel.com, liudongdong3@huawei.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, kong.kongxinwei@hisilicon.com, yisen.zhuang@huawei.com Subject: Re: [PATCH v2] USB:ohci:fix ohci interruption problem Message-ID: <20210409150744.GB1333284@rowland.harvard.edu> References: <1617954422-36617-1-git-send-email-liulongfang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1617954422-36617-1-git-send-email-liulongfang@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 09, 2021 at 03:47:02PM +0800, Longfang Liu wrote: > The operating method of the system entering S4 sleep mode: > echo reboot > /sys/power/disk > echo disk > /sys/power/state > > When OHCI enters the S4 sleep state, check the log and find that > the USB sleep process will call check_root_hub_suspend() and > ohci_bus_suspend() instead ohci_suspend() and ohci_bus_suspend(), > which will cause the OHCI interrupt to not be closed. > > At this time, if just one device interrupt is reported. the > driver will not process and close this device interrupt. It will cause > the entire system to be stuck during sleep, causing the device to > fail to respond. > > When the abnormal interruption reaches 100,000 times, the system will > forcibly close the interruption and make the device unusable. > > Because the root cause of the problem is that ohci_suspend is not > called to perform normal interrupt shutdown operations when the system > enters S4 sleep mode. > > Therefore, our solution is to specify freeze interface in this mode to > perform normal suspend_common() operations, and call ohci_suspend() > after check_root_hub_suspend() is executed through the suspend_common() > operation. > > Signed-off-by: Longfang Liu > --- > > Changes in V2: > - Modify comment and patch version information. Please, instead of sending the same incorrect patch over and over again, spend some time figuring out what is really going wrong. I have already explained why this patch is not the right thing to do. You have to determine why the poweroff callback in hcd-pci.c (which points to hcd_pci_suspend) isn't getting called. That's the real explanation for your problem. Alan Stern > Changes in V1: > - Call suspend_common by adding the hcd_pci_freeze function turn off > the interrupt instead of adding a shutdown operation in ohci_bus_suspend > to turn off the interrupt. > > drivers/usb/core/hcd-pci.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c > index 1547aa6..c5844a3 100644 > --- a/drivers/usb/core/hcd-pci.c > +++ b/drivers/usb/core/hcd-pci.c > @@ -509,6 +509,11 @@ static int resume_common(struct device *dev, int event) > > #ifdef CONFIG_PM_SLEEP > > +static int hcd_pci_freeze(struct device *dev) > +{ > + return suspend_common(dev, device_may_wakeup(dev)); > +} > + > static int hcd_pci_suspend(struct device *dev) > { > return suspend_common(dev, device_may_wakeup(dev)); > @@ -605,7 +610,7 @@ const struct dev_pm_ops usb_hcd_pci_pm_ops = { > .suspend_noirq = hcd_pci_suspend_noirq, > .resume_noirq = hcd_pci_resume_noirq, > .resume = hcd_pci_resume, > - .freeze = check_root_hub_suspended, > + .freeze = hcd_pci_freeze, > .freeze_noirq = check_root_hub_suspended, > .thaw_noirq = NULL, > .thaw = NULL, > -- > 2.8.1 >