Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3066047imu; Mon, 17 Dec 2018 12:40:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/WIcAue5dQkc/TME2gRTeGcUnULdYE3r/kEbwLD9BgdMChJaDqp4ts0QcViFzKAofdlQ9V5 X-Received: by 2002:a63:26c1:: with SMTP id m184mr12530909pgm.367.1545079230896; Mon, 17 Dec 2018 12:40:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545079230; cv=none; d=google.com; s=arc-20160816; b=odvKFW+SY6XijeYKPfi2PcpIBk1AXKCgWc4ELqamEXIlDORMbqIi4EfZYOs7ekpSs5 ZGWQuSaplsMGvaYVb5hghpQKlRkAU6MRHlW8V7PA8Gu2+IQK5QW9gL4LCfXAjCnU9Kd4 Mp97hB+NzPTEai49aoJvptlikVtN2mlRfIIHoKOQ9uiwm6VDjvk7yeavqfUik34QiAMY DxpZQNrH2C3tvuStTrS1JzTsiNsz2AJG/1ppORsXAS6z7oIC4ZjGiWb+3MVYwqZme791 V3DP8+kNG/KCs0GwJzc70Ez6r16/CBBZoV1DMDn300qrkLOBVARoW0K8zz8uDjZWsFbD 5zFw== 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:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=iQkrog+vb9Zo11bWvBko2zaFnQCAnh4XM6dFqZhRm9A=; b=LHzZSm75BOHRhjBSx1oivn40C5eY1+7u0LpXlRsLqmymcDZhk2HRJhuWFhwywCVwYr 3IH8iIAqARkccHWgYuRB/0duuI0vQhoXCIQh+0zbaxVjvtrccdD/sYkI3BR6EEnLcl6T OX+VNxlidu91ddOVivxztGlOqW8CEoyOFmscYf/D63rNd2DG//peijVkmbnbyW/ifynC wI9ELY5Aw0+mqJ+rSWePu+768TsYsof96vOuBGzvouatwPj/iP1arGJ39GlLxSzI/KbQ iVmz2wdmesJ6qjFVUpJDA97dP/5RGBx2bHL1hZRBQWH7vusZqSpjTvPyV5W1Y59mivUK Vk7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=UgUMEmDJ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si11658750plh.426.2018.12.17.12.40.15; Mon, 17 Dec 2018 12:40:30 -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; dkim=fail header.i=@ffwll.ch header.s=google header.b=UgUMEmDJ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388434AbeLQTsL (ORCPT + 99 others); Mon, 17 Dec 2018 14:48:11 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:42050 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726660AbeLQTsI (ORCPT ); Mon, 17 Dec 2018 14:48:08 -0500 Received: by mail-ed1-f65.google.com with SMTP id y20so5657193edw.9 for ; Mon, 17 Dec 2018 11:48:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=iQkrog+vb9Zo11bWvBko2zaFnQCAnh4XM6dFqZhRm9A=; b=UgUMEmDJQYveHj+Jciy4klehxYubIVTs6qkUiYBFqXZdK8rEw+2s4lujN2pZFytvkT iKpKCGlolyV4M6EOGCAQbzcmFna1S90Q6ycXWBD7WzdcvFRSgw1dRdtgVqURXzQeYkV0 Yg1FoJTDd6d+bszveT2DBELSr6EXGtcDfEx7k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=iQkrog+vb9Zo11bWvBko2zaFnQCAnh4XM6dFqZhRm9A=; b=DD0aOyJ3wfGvh02WLbU4BmAs8spKoNv0AQplLucQCV4G6/qQQzSUUwtp4u3GlShUq1 +VYS1rNz2oJ1wgkaKv8Fh35zYYPud0I4zmr0sAA5RXxRNawZr6SVq+V65kOqPZYFNKZz mkng1R1+tFtcl7D6DjzxiyGxhxBg30er0jAnNKTTTUq5SOblVx2CW2+ls6eTrRgppdBe DgU2DUpdcY1BuBC38ZymjsPWT1eHoo/V9qtu8GSMxvl1ilLFkT4GIuy0m0O80YUIvY9/ u0Y34AKb6HYKwfg6Eqsxke4/NOpt+yf5aQTNO/6AsKk+lJY01J+zsc+G4mItxJIF3pJV 2aMg== X-Gm-Message-State: AA+aEWZPX5REiu12hPXDSROoV19pWltPF1fLHwDL2GfqqMbV1MCTemRE F3GutAHL0DFKL7Bm/KctqizCTg== X-Received: by 2002:a50:8e95:: with SMTP id w21mr13598462edw.198.1545076087341; Mon, 17 Dec 2018 11:48:07 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id w56sm4044343edb.72.2018.12.17.11.48.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Dec 2018 11:48:06 -0800 (PST) Date: Mon, 17 Dec 2018 20:48:04 +0100 From: Daniel Vetter To: "Rafael J. Wysocki" Cc: Daniel Vetter , Linux Kernel Mailing List , dri-devel , ramalingam.c@intel.com, Greg Kroah-Hartman , Daniel Vetter Subject: Re: [PATCH] drivers/base: use a worker for sysfs unbind Message-ID: <20181217194804.GJ21184@phenom.ffwll.local> Mail-Followup-To: "Rafael J. Wysocki" , Linux Kernel Mailing List , dri-devel , ramalingam.c@intel.com, Greg Kroah-Hartman , Daniel Vetter References: <20181210084653.7268-1-daniel.vetter@ffwll.ch> <20181213095814.GC21184@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 4.18.0-2-amd64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? btw threading somehow broke apart, Chris Wilson r-b stamped this one on intel-gfx: https://patchwork.freedesktop.org/patch/267220/ Reviewed-by: Chris Wilson Thanks, Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch