Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp11545619rwd; Thu, 22 Jun 2023 15:05:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7CaIhS4U12/BnKbIgvCdjvd4dp9bzQnmhvVdbAe6miuS6Jlti3nIumozH8DPGuatX6jYMM X-Received: by 2002:a9d:62cd:0:b0:6b5:89c8:edf5 with SMTP id z13-20020a9d62cd000000b006b589c8edf5mr11694142otk.31.1687471553562; Thu, 22 Jun 2023 15:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687471553; cv=none; d=google.com; s=arc-20160816; b=o0Iyf+zK0tJxV3gVA6eZBBvW56x3pMAkUEXpR0kNxG2hcNOSEZX2cqR9QYeh/eiLw7 Fe0lHzSAqhgRqnqzrQQ7La19id0POcPruQUYakkRnC4AU5kB0ksop8ObUML+QsDPdsGd EaquZrq2mbGH+Dc9zjyWSQcaByQSxCJma//LP718+cR40T28HzTooBOo2rmh1EJq3gQ1 pSK0WmL83VXoQnXUet+aM/VIGvuUOzSLDyEyc+/WMLiRVUW1Fef9KPBBIgWe3xCONZVA uXzKUVSSJDHnWPzT8q9tG2uNlBTQFGsL8zOIvMVV8hU52X5kl36PShwNkw6sYu+vT7Qf Wv7A== 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=mct+MjskHmp1861YXk1+D0YXFOLYL8JUgQjp5yHMie8=; b=VQ5qiJ6MV2JZPYsjQFiVuP9LkUf0RXWtV+TtPs07m4br0n5Ap5SUDpJxnmQUSdZd0l w+SY2uzJc6UIOtM9ei2atpeklMCNLV05gbNuM8KvyCbEpaa1NW25TGSDfAcOMXTl/L87 g7D4Zu++c1AifkSykG7Oe+UOYhxDNajN/t77h+c65/DLnHZD7IwOdzFg+BLgkkU68qSq pQgvnYbVSmtXRieDbeOvc1rTPxSEThKcsBEJnUR4ij6E/XnNGK1LJ5YbATtaeumv35Md FKjkIAVQBnmrv24gVTdVFFEY2HlI3i6agqceZnI5RAZb/8vA3n6GR4D+J++uheIFwXx/ bwOw== 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 x29-20020a63b21d000000b0053fb3688fadsi1658563pge.144.2023.06.22.15.05.40; Thu, 22 Jun 2023 15:05:53 -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 S230421AbjFVVmy (ORCPT + 99 others); Thu, 22 Jun 2023 17:42:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231280AbjFVVmv (ORCPT ); Thu, 22 Jun 2023 17:42:51 -0400 Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [IPv6:2a01:37:1000::53df:5f64:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75D342107; Thu, 22 Jun 2023 14:42:49 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (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 bmailout1.hostsharing.net (Postfix) with ESMTPS id 9029730003C66; Thu, 22 Jun 2023 23:42:47 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 806E94C73E; Thu, 22 Jun 2023 23:42:47 +0200 (CEST) Date: Thu, 22 Jun 2023 23:42:47 +0200 From: Lukas Wunner To: Smita Koralahalli Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , oohall@gmail.com, Mahesh J Salgaonkar , Kuppuswamy Sathyanarayanan , Yazen Ghannam , Fontenot Nathan , Jay Cornwall , Felix Kuehling Subject: Re: [PATCH v3 2/2] PCI: pciehp: Clear the optional capabilities in DEVCTL2 on a hot-plug Message-ID: <20230622214247.GB11993@wunner.de> References: <20230621185152.105320-1-Smita.KoralahalliChannabasappa@amd.com> <20230621185152.105320-3-Smita.KoralahalliChannabasappa@amd.com> <20230622063105.GA624@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 [cc += Jay, Felix] On Thu, Jun 22, 2023 at 02:02:12PM -0700, Smita Koralahalli wrote: > Would it be fair to just reuse pci_enable_atomic_ops_to_root() for > Atomic_Ops configuration? Hm, that's a good question. I'm not an expert on that corner of the PCI core. But indeed what you could try is amend that function to not only *set* PCI_EXP_DEVCTL2_ATOMIC_REQ if it's supported, but to also *clear* it if it's not supported. And you'd have to call pci_enable_atomic_ops_to_root() on enumeration, e.g. from pci_init_capabilities(). That should obviate the need to call pci_enable_atomic_ops_to_root() from drivers, so you could probably remove the call from all the drivers which currently call it (amdgpu, infiniband, mellanox), in one separate patch per driver. An then you could drop the EXPORT clause for pci_enable_atomic_ops_to_root() and make it private to the PCI core. So that would be 5 patches (enablement/disablement on enumeration, amendmend of the 3 drivers, making the call private). I'm not sure if anyone will cry foul if you do that but if you want to give it a try, go for it. :) I don't now why commit 430a23689dea, which introduced pci_enable_atomic_ops_to_root(), chose to add it as a library function which is only called from specific drivers, instead of universally enabling the feature for all devices. Adding the commit authors to cc so they can chime in. Thanks, Lukas