Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3234297imu; Mon, 17 Dec 2018 16:05:55 -0800 (PST) X-Google-Smtp-Source: AFSGD/WxhGYiNz8eVV8ht1fvyjzNuQId7JqjaxUb+rqURn/oUdHrWj1dUYI2oTfpzAUNtBJ1wcss X-Received: by 2002:a17:902:7d90:: with SMTP id a16mr13827751plm.249.1545091555113; Mon, 17 Dec 2018 16:05:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545091555; cv=none; d=google.com; s=arc-20160816; b=vLlj9FFF4pGB4kNwX8GDdXhjLUjckphW45rTqy1NQkrkBbNIMTPIi/BdlsiMlIRkm2 GHsif7LSd+V2G6lqjvBEueZcXx9PDMe6Jbymtb2IgtvDS1OaBPEXbYlPBohEM19clTtr K1WNYr7f2e97UWCZKI9ufDtNoFkp8kC4BZFuNKE9L9ugEL37ZPK1jaG6DpBy/e+fXFXV yT2POV3TUiBcAVTCuOPtirFN0T8Kmkx/HPSNfTVnC/6rIUaZQHM8M0efHGg1mKRTPj3d K0K5EcAKoXPxMtRC8ZFJ0pH6tnNe+QI9JkKS/YXlisAew7RsvoTNJ7VdOaA3TELRbpTR OZaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=gIFMyLgmyom6suLlz/HLtiekX9eZbEG7ouiW+z0GYjE=; b=tBPpXRgbMQ75haGcTCqawX/Kot04+3A8+AQyvUpiCRl+wCz9vJMLu5Eq31wyZhRQaA dVrPPqoanKu63DEE7G+ZbLhqlUF2xuHLeS7tksUJ0wp1zs0GEy8gnXtD5jl8Csqqkfrc H1N0GnI75GXKh89+C/CBdsMgDiHhz+hLr2OTY+uYjhOUafkLsSxaKgq/C+b0ThbdIUIL vjmxdfAQ8pyUkNXnhGJSg/jLakbOwhSO/DXM+O4sQNPhsuWk7ooPDFYY0STPNx/w0mV7 3QNstyUPkTCvKDPj7Nm6i0x1pOrajQJPA22ewbX85awHQN6jDbOGi7v4yfBoX0PgWohg EDhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17si12774167pfc.198.2018.12.17.16.05.39; Mon, 17 Dec 2018 16:05:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726379AbeLRADd (ORCPT + 99 others); Mon, 17 Dec 2018 19:03:33 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:39058 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726282AbeLRADc (ORCPT ); Mon, 17 Dec 2018 19:03:32 -0500 Received: by mail-ot1-f68.google.com with SMTP id n8so13980395otl.6 for ; Mon, 17 Dec 2018 16:03:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gIFMyLgmyom6suLlz/HLtiekX9eZbEG7ouiW+z0GYjE=; b=hDjQLVYMH/jpMH0en46cQsURai21MvyleZYSJkMsoy5YfD6sGiaihuYeUbJgOE6XgC v+8mEvdzrc5WAC1pGb/lhyqobIW1Ct+3SnYXVbWhn+ZtK8PprEZElT4B5rfFieBbp73H LPnlTA8PO1GixjIprG2jCqv2yhoEgNHdpoB4Ko9BS1dTGl5W/sKWHjFyQXucGVHslcT/ dFItP5FnrxGOSL93/g8V3vz9AKdZ4gb+JLF8VIIsCC0f35hVbbZnHhu+bccqE79WkrV+ e8QKXQuO2qTgqs4vVcnQW/u7w8UGrEsSPxPbP2ZBbcP1kReQE4Unr9X/HqerWSk7oP71 YxFg== X-Gm-Message-State: AA+aEWY9EhhiO2g+sE5y7+RzcGUmR10a3v3KtkXyuToylyeyYZCjhe/t z8Zei0oIdmsUV8IeZfu6kIfSXseodWQ/4gr/4dsQ7w== X-Received: by 2002:a9d:5f06:: with SMTP id f6mr11351895oti.258.1545091411581; Mon, 17 Dec 2018 16:03:31 -0800 (PST) MIME-Version: 1.0 References: <20181210084653.7268-1-daniel.vetter@ffwll.ch> <20181213095814.GC21184@phenom.ffwll.local> <20181217194804.GJ21184@phenom.ffwll.local> In-Reply-To: <20181217194804.GJ21184@phenom.ffwll.local> From: "Rafael J. Wysocki" Date: Tue, 18 Dec 2018 01:03:20 +0100 Message-ID: Subject: Re: [PATCH] drivers/base: use a worker for sysfs unbind To: "Rafael J. Wysocki" , Linux Kernel Mailing List , dri-devel , ramalingam.c@intel.com, Greg Kroah-Hartman , Daniel Vetter Cc: Daniel Vetter Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 17, 2018 at 8:48 PM Daniel Vetter wrote: > > On Thu, Dec 13, 2018 at 07:09:15PM +0100, Rafael J. Wysocki wrote: > > On Thu, Dec 13, 2018 at 5:25 PM Daniel Vetter wrote: > > > > > > On Thu, Dec 13, 2018 at 5:18 PM Rafael J. Wysocki wrote: > > > > > > > > On Thu, Dec 13, 2018 at 1:36 PM Daniel Vetter wrote: > > > > [cut] > > > > > > > I can do the old code exactly, but afaict the non-NULL parent just > > > > > takes care of the parent bus locking for us, instead of hand-rolling > > > > > it in the caller. But if I missed something, I can easily undo that > > > > > part. > > > > > > > > It is different if device links are present, but I'm not worried about > > > > that case honestly. :-) > > > > > > What would change with device links? We have some cleanup plans to > > > remove our usage for early/late s/r hooks with a device link, to make > > > sure i915 resumes before snd_hda_intel. Digging more into the code I > > > only see the temporary dropping of the parent's device_lock, but I > > > have no idea what that even implies ... > > > > That's just it (which is why I said I was not worried). > > > > Running device_links_unbind_consumers() with the parent lock held may > > deadlock if another child of the same parent also is a consumer of the > > current device (which really is a corner case), but the current code > > has this problem - it goes away with your change. > > > > But dev->bus->need_parent_lock checks are missing in there AFAICS, let > > me cut a patch to fix that. > > With your patch before this one, are you ok with mine? Or want me to > respin with a different flavour? Having reconsidered this a bit I'm leaning towards annotating the locks - if that works. After all, what is problematic is the lockdep false-positive and addressing it that way would be most natural IMO. Thanks, Rafael