Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1456697rdg; Sat, 12 Aug 2023 01:52:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEltNIGf0xvKMwgC+9rOAvvX/tTOnYogBaH3HoivGAiAHM5msDijI7ziFn3WK2VxaCsvSvj X-Received: by 2002:a17:902:ea0c:b0:1b6:68bb:6ad0 with SMTP id s12-20020a170902ea0c00b001b668bb6ad0mr5828256plg.55.1691830372521; Sat, 12 Aug 2023 01:52:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691830372; cv=none; d=google.com; s=arc-20160816; b=ikyKVJgNu102GJjyWgRCIUyhg6Ks2jtF+s8j51Hk6SxbYon5hHh122dEggnpfsJLqt n7LUCL4VQzvuMGTmaS/flz0p4ydCDCXK4auOdEATcgYI9P5aCGK3wb/wCWI+r+/H9Vlx N+A5nVmtsKlfpAOKaAmqWrrj3xGDE96IImvo+RSJkp4JqMHjChw7xd7WHKvvA0qNtrrs 4PqUKQfiRzrEGPpo7zIwD2P9z6VlWxaww3WHszSQ62fFJIlc4FnKUllKluX5WvjnICSw 5HoPXsoOioctrjQiWB4TxLRJiYKmhfbwR9IU6aNQfZg8Y8ey+tjqVNWQebxgnIcnNpC0 LzAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=0lMiLygKb4RS1bZ2fJj3q0pmY3M8d7JBOfaVzC8R+8k=; fh=ltVRPf79i4Nb7L8epxhkny4DZtTqJz5niM5xduo5+tE=; b=PfQ3pXPKxEUqU4S5UFQQFmN/cgW5rrOTieIJijRZEAgTs4fuB3S/keA+xKII6AFadK DM5ePe5+e4wDlGilmSLyTsf4NWgtxAShvYM+DDiZgScfn1KDeVskhyLNfIc6qrhVg9fu xolQ1UMI2/W6SHI24CD2aKIwzBsD4vf/GTGJoVTNGoV2FZ+NMKyt/irFTn0vodz7EJ3E L20357lettKhInrovSeEPQOZl6G6A297AhVLtkG3tyoWpEqo92JzEhUS3sVxNZImdo6I 0ZwcVz2a0Ih42OzHC/LaRzLUlBm2nqW54/60+hG1+1+T4W8FJJIrMlPiTV9iKjHzRuc1 3g1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q13-20020a170902f34d00b001bba90f8b73si4516546ple.78.2023.08.12.01.52.38; Sat, 12 Aug 2023 01:52:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235184AbjHLIIF (ORCPT + 99 others); Sat, 12 Aug 2023 04:08:05 -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) X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_NONE autolearn=no 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 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