Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3996198ybz; Mon, 20 Apr 2020 13:28:32 -0700 (PDT) X-Google-Smtp-Source: APiQypJwPl84XintBbUbNy86oJ+L0WGILZfkin2szwcYFJeGc2qWMedFl0tBKtyqXgiywXZCaWAU X-Received: by 2002:a50:bb2a:: with SMTP id y39mr15268653ede.292.1587414511902; Mon, 20 Apr 2020 13:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587414511; cv=none; d=google.com; s=arc-20160816; b=lYISQKoXQfcGUfDogWEscT8xO7xJ0gsnvLxYw/8jnT0ejifurtXSS8GhNnCyOZNvBH gpPeLXHr7XGfj6dPcOYPwDJIzOeO+IdGGEzo6GaaqRp7flXCGnpw8sqtmetpNbYwekQV EsjdnSPnU3Vk7O3yrroXBRI09zkAtjZ5sJjJbYNpl8jfk/WzgGj1rqxvhpDbDE6tL34z RW8kysYvJtmCfwLYsm06oWYL5fNTBg8F1ypGcy/AShP1cHCGa/ZZTRdGIAr3mHDzXxn6 a+cJEpbPLnhJgAzNYOqjuyEFFJmbxoikrf3lv6l3UGlSyrNaZS79WpMLMpxW1yjtEMXi g5CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=E4dgc+y3wVC8SC6PeHDjizaJYyvnUVnVVIuWGoZ+7+4=; b=gzub+ez1fFTgjnqw1kVz/wKo5B9tkCyGd8ICo2kqky/ZPr0hw4QbfWBi+1QS3epILj yCTT3F/JbWHLVx5++LsJvH77EXpMCwAYglrer4CYoeAOnDCOCxv6vLHNblCDjRxVGPjb 2xdPY5Fx2rpld20P2HMSCaWld4jc6c7wYnbBD7vegt9nAlVb4Ak6LY2Y8wl/jGlQOuIk ZVIKKjAx+t2WVQ6RoWLyIPj2r5T8XLsRrZ9fG2uTj1w8Zyn6NVosUQ8gGt2xVKDiLZ1Y sIXxEle326PQ1sI9g25T+ZDV+VTozdRW8IZlvq9xRuk7X9HnhRDjuzhcCd0l6OqQnIgi KbKA== 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 l2si209153ejz.185.2020.04.20.13.28.08; Mon, 20 Apr 2020 13:28:31 -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 S1728225AbgDTU0s (ORCPT + 99 others); Mon, 20 Apr 2020 16:26:48 -0400 Received: from netrider.rowland.org ([192.131.102.5]:44977 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1728224AbgDTU0r (ORCPT ); Mon, 20 Apr 2020 16:26:47 -0400 Received: (qmail 23111 invoked by uid 500); 20 Apr 2020 16:26:45 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 20 Apr 2020 16:26:45 -0400 Date: Mon, 20 Apr 2020 16:26:45 -0400 (EDT) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: Qais Yousef , "Rafael J. Wysocki" cc: Oliver Neukum , Greg Kroah-Hartman , USB list , Linux-pm mailing list , Kernel development list Subject: Re: lockdep warning in urb.c:363 usb_submit_urb In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 25 Mar 2020, Alan Stern wrote: > On Wed, 25 Mar 2020, Qais Yousef wrote: > > > Thanks for all the hints Alan. > > > > I think I figured it out, the below patch seems to fix it for me. Looking > > at other drivers resume functions it seems we're missing the > > pm_runtime_disable()->set_active()->enable() dance. Doing that fixes the > > warning and the dev_err() in driver/base/power. > > Ah, yes. This should have been added years ago; guess I forgot. :-( > > > I don't see xhci-plat.c doing that, I wonder if it needs it too. > > > > I'm not well versed about the details and the rules here. So my fix could be > > a hack, though it does seem the right thing to do. > > > > I wonder why the power core doesn't handle this transparently.. > > Initially, we didn't want the PM core to do this automatically because > we thought some devices might want to remain runtime-suspended > following a system resume, and only the device driver would know what > to do. Qais: So it looks like the discussion with Rafael will lead to changes in the PM core, but they won't go into the -stable kernels, and they won't directly fix the problem here. In the meantime, why don't you write up your patch below and submit it properly? Even better, create similar patches for ehci-platform.c and xhci-plat.c and submit them too. Alan Stern > > diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c > > index 7addfc2cbadc..eb92c8092fae 100644 > > --- a/drivers/usb/host/ohci-platform.c > > +++ b/drivers/usb/host/ohci-platform.c > > @@ -299,6 +299,10 @@ static int ohci_platform_resume(struct device *dev) > > } > > > > ohci_resume(hcd, false); > > + > > + pm_runtime_disable(dev); > > + pm_runtime_set_active(dev); > > + pm_runtime_enable(dev); > > return 0; > > } > > #endif /* CONFIG_PM_SLEEP */ > > > > > > Thanks > > > > -- > > Qais Yousef > > >