Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp37996ybz; Tue, 21 Apr 2020 04:17:14 -0700 (PDT) X-Google-Smtp-Source: APiQypIC1e+TClRIaMy8Gcr1O2f1+81Bi7eB+D8dpdu/hCUyxaQWqigr5vqseCpxGzAONVWQGxou X-Received: by 2002:a17:906:16ca:: with SMTP id t10mr21234284ejd.122.1587467834094; Tue, 21 Apr 2020 04:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587467834; cv=none; d=google.com; s=arc-20160816; b=J37ky2Z5CgT960GBcRc53M7djKRowIdaH5R0LyuLeniX2Y/RJtJqrxmTcYXp7h45SV POO1GGsMQpywnWSN/gOVPOv1PGb7tagL47thHaXTie74UQKfIOnK1oEp61WBw/Wy2Hpt 84xU2H92bCmmdcdqCI46F6J1POA7EQKYuu7uIQ602744rndxrYblS9vroZSlsnHH9sJV C9gQQQbXKlRyYtB2dtWiAcu/IHAdXIweRAb32giss9SYztg7sxvQFQO7LhK/JTY96Vn5 KdrrhX756itgnZl0k4lpKX1rBbLRI07cZg5n8HYRqkBaIIacmTI3JNuzaxZVOwNs3mcZ k3OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=rbn28lJiAF+TAnS+Y/2M9etHUMY214biXUfBHpFash0=; b=u+7yeknQ48pJq6rVKaj29vxDURzhdIrSRMVa82+uxZwgfHNKotIpxxOa174uuAQjvl e4BuZI6piEiRMwDDCP/Hs1rd24B5mWcUaP4hEXrNzzYikD0Bm/638upFU3EMthaTpb7K HoLwGWCcJIdBsOTE5vhTqfhIRSGUfAA89tcXYnRfuMewskYVLdSMYPPwrHkM6yNja7+C n4RSeptDu05Q4cNq1G8DyoR4hSrZAe2fzMjavGO4FalGKHdg+/NindJHv9dDCvUg50lD mDi656FIrbLZE2Sg04nQmObTLqbXOwX819WpgnOcF8tfJW7fbK4ScD4M3eWxnOynhxAt 0Y8g== 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 f12si1394460eja.218.2020.04.21.04.16.49; Tue, 21 Apr 2020 04:17:14 -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 S1728548AbgDULPS (ORCPT + 99 others); Tue, 21 Apr 2020 07:15:18 -0400 Received: from foss.arm.com ([217.140.110.172]:33308 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726018AbgDULPS (ORCPT ); Tue, 21 Apr 2020 07:15:18 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A0F0C1FB; Tue, 21 Apr 2020 04:15:17 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9217C3F73D; Tue, 21 Apr 2020 04:15:16 -0700 (PDT) Date: Tue, 21 Apr 2020 12:15:14 +0100 From: Qais Yousef To: Alan Stern Cc: "Rafael J. Wysocki" , 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 Message-ID: <20200421111513.fy3oqebij6fnvbnc@e107158-lin.cambridge.arm.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/20/20 16:26, Alan Stern wrote: > 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. Sure. Thanks -- Qais Yousef > > 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 > > > > > > >