Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1761225rwn; Fri, 9 Sep 2022 03:47:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR7zWX5famha+esXS0OL5BeYucebJPGICRSPtcM6uzu6UmPnKErYbRevoxozqluH1ZKoSx4R X-Received: by 2002:a17:907:2d14:b0:779:fa1d:1aac with SMTP id gs20-20020a1709072d1400b00779fa1d1aacmr1285499ejc.585.1662720467032; Fri, 09 Sep 2022 03:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662720467; cv=none; d=google.com; s=arc-20160816; b=u6pbKKvfqoC1Pj0vPwq85X43IWnHM1gpJdjhcMnBc3VkcKXSyejcxZYlPOjHCTSvYO xrduMn7qhd2QjOQHp1fD6PIS4mQlxhBoC5494TC2NgnQRzASe5fGa1ItJIm+XWKIUNR6 jUqYMLeIn5IVFEbxArnJqqh9xJTWB+45wD0iY1K5HkqhQ81rGcz8oVX8FJ4LhDtqOodT LCjeUxOyECRyN0olJIudKiyCR19qoXO7NLbcfyoyAnRKO6POky7ED4rZvJceEsMpymIB ixbcxiOi3+nBRk4sHMGKJO2/6X4lQCRJsRUYlWxtKuFbiZR9sNXWogvfEzhMMSNaRYtL FKzA== 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=bIT14Sq729knXt42Tkfe1slSSN2F7uoV922MNowijtg=; b=ywLKL+amxj8p4z3CQlyISQeoc25CVibUejPisO90KZofV8Wbil2RSin/YD+5XnPEQO 7Q/XL/Am9bNinH0T4G+y7aapMnaYMXVU+rsoCl2QnbJu6xE4eypiB52WIyf+ii3lpH1a G0FG41rXQA8XdtRGPSVCDULkkwJijNwOD+wmzyemI4SsvI7q2pLeAaOVDGd0MVgsB1Re Dk/7lQ5udM0UlomSgbFGmAX2ZXrq5GWkntnioJriEtbxUH0CYYOqjUoJKDhbQ2QTQ1yW G6i1xDqLZKxmFvWAQZ8Ctmbr2MDynxy/dG2GB+RNdjy1PyoKxkehVUnV6POI/Foz0GQ2 fVag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OR7JgDg7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb26-20020a1709077e9a00b007315a1c65b8si200166ejc.329.2022.09.09.03.47.19; Fri, 09 Sep 2022 03:47:47 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OR7JgDg7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230047AbiIIKUb (ORCPT + 99 others); Fri, 9 Sep 2022 06:20:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbiIIKU3 (ORCPT ); Fri, 9 Sep 2022 06:20:29 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16C4E6F25F; Fri, 9 Sep 2022 03:20:29 -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 ams.source.kernel.org (Postfix) with ESMTPS id BD575B82485; Fri, 9 Sep 2022 10:20:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 712FEC433D7; Fri, 9 Sep 2022 10:20:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662718826; bh=8Sn8WrNoUZJkKYo6rTUp7rYpe1gjGfheWMeOFH/9gwM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OR7JgDg7bdffNymnK5Ogz4vTx4lz76/qHZsuCZ80REXdSETL5vt5nKzl8YAV/hzUI fXqIwBRjzwbf5bq+MVx812yeQG4W8001z+ML1zRBiPO8ZCBhaXeB8j04MwlSSxDa00 rOY4yCDnT8uK+eJRPRsYwon77m2OW5UURaWMYVS9867PlRjUhjIsoU5eXbWW3RKJRs iLfLuzp8yGAcfl0vbzg89BTU9HOAMr2XBK8AJkGQeQz4lx2FS+ORLn3tv0Zoq0oN/j lJd4AmC1IaMInJ3ddDOcHJt9Zj9oqlGyF8wFsNhiC4UL9p1xBf9mEw/vXKBU3h0heH 6u399K72zzGrg== Date: Fri, 9 Sep 2022 12:20:19 +0200 From: Lorenzo Pieralisi To: Manivannan Sadhasivam Cc: Kishon Vijay Abraham I , bhelgaas@google.com, kw@linux.com, robh@kernel.org, vidyas@nvidia.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] PCI: endpoint: Use link_up() callback in place of LINK_UP notifier Message-ID: References: <20220811094237.77632-1-manivannan.sadhasivam@linaro.org> <20220811094237.77632-3-manivannan.sadhasivam@linaro.org> <20220831082025.GC5076@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220831082025.GC5076@thinkpad> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 On Wed, Aug 31, 2022 at 01:50:25PM +0530, Manivannan Sadhasivam wrote: > On Thu, Aug 25, 2022 at 03:47:10PM +0530, Kishon Vijay Abraham I wrote: > > Hi Mani, > > > > On 11/08/22 15:12, Manivannan Sadhasivam wrote: > > > As a part of the transition towards callback mechanism for signalling the > > > events from EPC to EPF, let's use the link_up() callback in the place of > > > the LINK_UP notifier. This also removes the notifier support completely > > > from the PCI endpoint framework. > > > > > > Signed-off-by: Manivannan Sadhasivam > > > --- > > > drivers/pci/endpoint/functions/pci-epf-test.c | 33 ++++++------------- > > > drivers/pci/endpoint/pci-epc-core.c | 8 +++-- > > > include/linux/pci-epc.h | 8 ----- > > > include/linux/pci-epf.h | 8 ++--- > > > 4 files changed, 18 insertions(+), 39 deletions(-) > > > > > > > . > > . > > > > . > > . > > > diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c > > > index 805f3d64f93b..a51ba9f158c3 100644 > > > --- a/drivers/pci/endpoint/pci-epc-core.c > > > +++ b/drivers/pci/endpoint/pci-epc-core.c > > > @@ -690,10 +690,15 @@ EXPORT_SYMBOL_GPL(pci_epc_remove_epf); > > > */ > > > void pci_epc_linkup(struct pci_epc *epc) > > > { > > > + struct pci_epf *epf; > > > + > > > if (!epc || IS_ERR(epc)) > > > return; > > > > > > - atomic_notifier_call_chain(&epc->notifier, LINK_UP, NULL); > > > + list_for_each_entry(epf, &epc->pci_epf, list) { > > > + if (epf->event_ops->link_up) > > > + epf->event_ops->link_up(epf); > > > + } > > > > how do you ensure there is no race while invoking the call back > > functions during add/remove of epf? > > > > Good catch! These should be guarded by epf->lock. I shall wait for v2 then and mark this one as "Changes requested". Lorenzo