From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4D92C04A94 for ; Sat, 12 Aug 2023 08:08:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235472AbjHLIIG (ORCPT ); Sat, 12 Aug 2023 04:08:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234095AbjHLIIB (ORCPT ); Sat, 12 Aug 2023 04:08:01 -0400 Received: from bmailout2.hostsharing.net (bmailout2.hostsharing.net [IPv6:2a01:37:3000::53df:4ef0:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0228B10F; Sat, 12 Aug 2023 01:08:01 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL Global TLS RSA4096 SHA256 2022 CA1" (verified OK)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id 7D40A2800BBD7; Sat, 12 Aug 2023 10:07:59 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 647FD10177; Sat, 12 Aug 2023 10:07:59 +0200 (CEST) Date: Sat, 12 Aug 2023 10:07:59 +0200 From: Lukas Wunner To: Alistair Francis Cc: bhelgaas@google.com, linux-pci@vger.kernel.org, Jonathan.Cameron@huawei.com, alex.williamson@redhat.com, christian.koenig@amd.com, kch@nvidia.com, gregkh@linuxfoundation.org, logang@deltatee.com, linux-kernel@vger.kernel.org, chaitanyak@nvidia.com, rdunlap@infradead.org, Alistair Francis Subject: Re: [PATCH v5] PCI/DOE: Expose the DOE protocols via sysfs Message-ID: <20230812080759.GB9469@wunner.de> References: <20230812004453.1241736-1-alistair.francis@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230812004453.1241736-1-alistair.francis@wdc.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 11, 2023 at 08:44:53PM -0400, Alistair Francis wrote: > + ret = devm_device_add_group(&pdev->dev, &pci_dev_doe_proto_group); > + if (ret) { > + pci_err(pdev, "can't create DOE goup: %d\n", ret); > + return ret; > + } You cannot use devm_* functions in the PCI core. Anything done through devm_* will be undone when the device's driver unbinds. User space can unbind and rebind the driver at any time through sysfs. They'll lose your DOE attributes the first time they do this because of your use of devm_device_add_group(). Thanks, Lukas