Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp958750pxb; Fri, 22 Apr 2022 15:19:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD8LCiEXHw6Cf0dl3fhv14RaI77ael3t4ZP96v11ANQG8AC2rMJJikn9HIkr59EnkyGVl4 X-Received: by 2002:a17:90b:3882:b0:1d5:8f13:9ac3 with SMTP id mu2-20020a17090b388200b001d58f139ac3mr7660149pjb.186.1650665985752; Fri, 22 Apr 2022 15:19:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650665985; cv=none; d=google.com; s=arc-20160816; b=BNn7bgjiLUWD3qt24Ls4h3BX89sOs2tzgXoRcNMYYRGDGUjNPQPqdfswYSNsF81RRV 9nOypX9cLiof3y+EXi0pwhqiLbDNlu6kWV4zkZbVsJLDY9Zv+2IFm+5LiiVJGX1ImoQt bdW1AISysazOt3seMIIRA98ZBhZPKGQeAMKliPsFLVgG2MGZgWZCZgUZVWe7FjEkuLrd 9d7RQzsf3FQREW8UZ8MlVmgvxpfDdwIBhjbGwNavTUG2g2wZZn4JJ4WngJMJP9K5sFP+ mxj5JtTCuaqFZXQVubRCOOAiLT69rjzTOQTEr6e1F+rXT4aGBMqqJuh5RYFiEVrzEPJ4 fRzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3uGlrtQGJfwcSzXCuN+v7Vx+pehjU7L/NVAYrQbWntw=; b=oG3Psi3WaHt3Y4V68P+jigNSa6ts6s19TRAPXyu0l7rF8V/toWbZy0t3iW+fTeDsPi IOMj05ZHn3vXRMnw/h8SsrXTy+5J0epc7jyfq/Ynyy4yXz2adCRu5m9LFUIcPKq/qtHO cUHh+UTLrb/NanHFsb3qP1sJYStrZyc9oC84INgwhCJNkWMMtagCBlepbyh3uhM9QxU7 ng5C9N51RviGZX7FUtQnzaPIcEGMIPtyr+Ft49KAJWscjTDbtHRVkfawn1HuCzfowz8w OJXFFmzPLT0xZnm8Vq62WI84Cb/rWxUYg9kwlBrr3U8u4ps8cNjahiB8dDMpQtE+EYNC 8mBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HO8CoV6Y; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o8-20020a056a0015c800b0050a4ae72df4si9552000pfu.361.2022.04.22.15.19.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 15:19:45 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HO8CoV6Y; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D6DA026BE82; Fri, 22 Apr 2022 13:24:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230074AbiDUQ2m (ORCPT + 99 others); Thu, 21 Apr 2022 12:28:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232415AbiDUQNF (ORCPT ); Thu, 21 Apr 2022 12:13:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2286B1FCF0; Thu, 21 Apr 2022 09:10:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B368A61568; Thu, 21 Apr 2022 16:10:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75C9CC385A1; Thu, 21 Apr 2022 16:10:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650557415; bh=iLVPxAK/KMYALe2s91jOF3emo6JFCgR6wtoMr9gWDqQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HO8CoV6YBMRZ8WhObFwrc5WtxrTzISLhbGlUPOx//29pdnSD1cQzF360meDAD2pMr gIGvbG0nldbun5OcOZNVWCQivl1bFq+nHxs00LTADFARN4Tn0xdG7HkGAALgKm3piw Ah1fVQ3rILvZcg104/BdUEm2q0EKYLt45Dqgsi2U= Date: Thu, 21 Apr 2022 18:10:12 +0200 From: Greg Kroah-Hartman To: Dan Williams Cc: linux-cxl@vger.kernel.org, Peter Zijlstra , "Rafael J. Wysocki" , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Alison Schofield , Vishal Verma , Ira Weiny , Ben Widawsky , Jonathan Cameron , nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/8] cxl/acpi: Add root device lockdep validation Message-ID: References: <165055518776.3745911.9346998911322224736.stgit@dwillia2-desk3.amr.corp.intel.com> <165055519869.3745911.10162603933337340370.stgit@dwillia2-desk3.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <165055519869.3745911.10162603933337340370.stgit@dwillia2-desk3.amr.corp.intel.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 21, 2022 at 08:33:18AM -0700, Dan Williams wrote: > The CXL "root" device, ACPI0017, is an attach point for coordinating > platform level CXL resources and is the parent device for a CXL port > topology tree. As such it has distinct locking rules relative to other > CXL subsystem objects, but because it is an ACPI device the lock class > is established well before it is given to the cxl_acpi driver. > > However, the lockdep API does support changing the lock class "live" for > situations like this. Add a device_lock_set_class() helper that a driver > can use in ->probe() to set a custom lock class, and > device_lock_reset_class() to return to the default "no validate" class > before the custom lock class key goes out of scope after ->remove(). > > Note the helpers are all macros to support dead code elimination in the > CONFIG_PROVE_LOCKING=n case. > > Suggested-by: Peter Zijlstra > Cc: Greg Kroah-Hartman > Cc: "Rafael J. Wysocki" > Cc: Ingo Molnar > Cc: Will Deacon > Cc: Waiman Long > Cc: Boqun Feng > Cc: Alison Schofield > Cc: Vishal Verma > Cc: Ira Weiny > Cc: Ben Widawsky > Cc: Jonathan Cameron > Signed-off-by: Dan Williams > --- > drivers/cxl/acpi.c | 15 +++++++++++++++ > include/linux/device.h | 25 +++++++++++++++++++++++++ > 2 files changed, 40 insertions(+) Much simpler, great work. Reviewed-by: Greg Kroah-Hartman