Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1155906imu; Thu, 13 Dec 2018 10:13:02 -0800 (PST) X-Google-Smtp-Source: AFSGD/Ux7p3zVbHoVllccnoSbdoBhAvbrd9xTu6w1RzNbDfn+DJ4rEaFD3XmTvJUgMgrwYY+bZPd X-Received: by 2002:a63:e20a:: with SMTP id q10mr22098227pgh.206.1544724782603; Thu, 13 Dec 2018 10:13:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544724782; cv=none; d=google.com; s=arc-20160816; b=rOdi8sbdWEw1EBuSI7hllJz5Duu1EayToJTZBw40MJNg32hU6y419Hvfr1TYY7Znb1 boIDPKZRdpGkJZJpwGoHV9tj6XCWueuUp9wlx5c6/4W2s2HBRL/FDAyDA5e892KktSw6 yiJMaGjAIJTmNJw7L5HHd4w0c0KT2N7JmUJug604VWxcSPQRQkQhlLr7fKiSbp4fAQsC FtVaqG6Wmc+zeCqx7WOiL68gnMw9KwcqfwPhk/Yu/LJuxsp+A4p46jRQ6zlRQ8t4+s93 YBGh8XlRCCa4yj3ROs49F6GF89qmXeZUCQSw/rDVz0FVN7pUA1X/H31ceTMggY5yH6cO 2HNw== 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=qDBwkOTOn0HjUuprDA0mac7GDunlvK4TugoO8opAnqA=; b=g1UP7H5Sb2ns9BMq0MCfv1ELr6Vv/JTXdCbOAG/Ci8097pLqsNzFG8Z4AhGBGbO4zS kRO2WLvVpAHmyqqw2T1+ode+N9M+lPNx7VnsrWhkS9em1gaeQKwqWtXFbdv9rIDoGO7B nVYjp8h9Yg7PXI9Z+kjW0gL7uZgdv4nY/NKi7M4CxLhpZWUJB5nvsAq9LhK0VvwiiUYm 8+bTPdjOCU8LfKStimubeyRlgure9+3HBO9XvO1xIYMOvifKMxEv2DZ9UbxMU1Ahrz4f dWudzYDiTPoAGX3J1taHAdBZqq539ou1CTIsvwZNiLSxu21GhmbPwFDEa4SSzikJChJ+ C84A== 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 11si1995815pgy.408.2018.12.13.10.12.40; Thu, 13 Dec 2018 10:13:02 -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 S1728133AbeLMSJ1 (ORCPT + 99 others); Thu, 13 Dec 2018 13:09:27 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:42803 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727618AbeLMSJ1 (ORCPT ); Thu, 13 Dec 2018 13:09:27 -0500 Received: by mail-oi1-f196.google.com with SMTP id w13so2363399oiw.9 for ; Thu, 13 Dec 2018 10:09:27 -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=qDBwkOTOn0HjUuprDA0mac7GDunlvK4TugoO8opAnqA=; b=XM/j3IbljFQ/V9yUlK2Ez9ga6md1kxTQjWekjuPTG9AIfNgr+cATiB1k7ev23Bk6Lz Z60MZ3XF/+1lCQ+e3OzwRnRAkF5JUQ/8+cwW2RiNkAEXrbFjpp6YB3F9lLX29OdfheFO V6XQbq3Fk9B4um2EANdEVBtp9VaR36/rJRyxYIm/ExTA11uuqAG6v+tflQcP31YaKSAP UO6bGBYdKw7t1qkTBA9e+STliuMQe6vwRVvVUufcJ3oZc4iuk2Jks/H+WSZqYfXEH5w6 EjQtY0S7It7Ewa0OPVcWWvbI7EDEf3+1vgDGms/IgZ880q0sIvE2D3hA9M5mgOT0rYQ+ kqaQ== X-Gm-Message-State: AA+aEWYdaa2sZI5KmsfG7O8FMHGZtxB7G4upLMnbS+6vqqRrG4ij5vWs DLTCCBFod8uICAXkBNKMteG6ngeGP46CAzZDukQ= X-Received: by 2002:aca:a698:: with SMTP id t24mr2522192oij.76.1544724566459; Thu, 13 Dec 2018 10:09:26 -0800 (PST) MIME-Version: 1.0 References: <20181210084653.7268-1-daniel.vetter@ffwll.ch> <20181213095814.GC21184@phenom.ffwll.local> In-Reply-To: From: "Rafael J. Wysocki" Date: Thu, 13 Dec 2018 19:09:15 +0100 Message-ID: Subject: Re: [PATCH] drivers/base: use a worker for sysfs unbind To: Daniel Vetter Cc: "Rafael J. Wysocki" , Linux Kernel Mailing List , dri-devel , ramalingam.c@intel.com, Greg Kroah-Hartman , 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 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. Cheers, Rafael