From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 52B3921195BD0 for ; Mon, 26 Nov 2018 17:44:16 -0800 (PST) Received: by mail-ot1-x341.google.com with SMTP id t5so18705379otk.1 for ; Mon, 26 Nov 2018 17:44:16 -0800 (PST) MIME-Version: 1.0 References: <154170028986.12967.2108024712555179678.stgit@ahduyck-desk1.jf.intel.com> <154170041590.12967.4367086895437513524.stgit@ahduyck-desk1.jf.intel.com> In-Reply-To: <154170041590.12967.4367086895437513524.stgit@ahduyck-desk1.jf.intel.com> From: Dan Williams Date: Mon, 26 Nov 2018 17:44:05 -0800 Message-ID: Subject: Re: [driver-core PATCH v6 3/9] device core: Consolidate locking and unlocking of parent and device List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: alexander.h.duyck@linux.intel.com Cc: "Brown, Len" , bvanassche@acm.org, Linux-pm mailing list , Greg KH , linux-nvdimm , jiangshanlai@gmail.com, Linux Kernel Mailing List , Pavel Machek , zwisler@kernel.org, Tejun Heo , Andrew Morton , "Rafael J. Wysocki" List-ID: On Thu, Nov 8, 2018 at 10:06 AM Alexander Duyck wrote: > > Try to consolidate all of the locking and unlocking of both the parent and > device when attaching or removing a driver from a given device. > > To do that I first consolidated the lock pattern into two functions > __device_driver_lock and __device_driver_unlock. After doing that I then > created functions specific to attaching and detaching the driver while > acquiring these locks. By doing this I was able to reduce the number of > spots where we touch need_parent_lock from 12 down to 4. > > Reviewed-by: Bart Van Assche > Reviewed-by: Rafael J. Wysocki > Signed-off-by: Alexander Duyck I was going to complain about the new addition of "This function" in the kernel-doc, but there are other occurrences in the file so that can wait for some future cleanup. I missed the __device_driver_unlock comment that Jane caught. With that fixed up. Reviewed-by: Dan Williams _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm