From patchwork Wed Dec 20 22:58:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Harris X-Patchwork-Id: 13500738 X-Patchwork-Delegate: bhelgaas@google.com Received: from mailout1.w2.samsung.com (mailout1.w2.samsung.com [211.189.100.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 871A74CB4A; Wed, 20 Dec 2023 22:58:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="k82YbAhI" Received: from uscas1p1.samsung.com (unknown [182.198.245.206]) by mailout1.w2.samsung.com (KnoxPortal) with ESMTP id 20231220225824usoutp012c7c73bfb55c20ff424025315b29b139~irFhK4VKv1791017910usoutp01X; Wed, 20 Dec 2023 22:58:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w2.samsung.com 20231220225824usoutp012c7c73bfb55c20ff424025315b29b139~irFhK4VKv1791017910usoutp01X DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1703113104; bh=j+X1XlpJVazixEjaPvnlQ7y4Y2vct9sGwyqv0nkwLBU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=k82YbAhIjpIMe7pTwzPc/gpGaZ8kvR2FKGjr6CIxOhwUCs9v0tvkxi3icR1K+GI/N yYHOQ1n7sar128O/vE+4fg/+4vWas6r+CWl2zPShYLpm3G9ZvNlgKKEDHSvbeTDo+A VGBFH51ZOkGX5gNspqzZg1PycwhfvNBpwfpfhib0= Received: from ussmges1new.samsung.com (u109.gpu85.samsung.co.kr [203.254.195.109]) by uscas1p2.samsung.com (KnoxPortal) with ESMTP id 20231220225823uscas1p2b31e7c1c80b31311e5909e41927dc4ff~irFg01EsS1791717917uscas1p2D; Wed, 20 Dec 2023 22:58:23 +0000 (GMT) Received: from uscas1p1.samsung.com ( [182.198.245.206]) by ussmges1new.samsung.com (USCPEMTA) with SMTP id 7F.12.09678.F8173856; Wed, 20 Dec 2023 17:58:23 -0500 (EST) Received: from ussmgxs1new.samsung.com (u89.gpu85.samsung.co.kr [203.254.195.89]) by uscas1p1.samsung.com (KnoxPortal) with ESMTP id 20231220225823uscas1p12d012a034806edd76fbc66a8d04e15ee~irFgnoO9m2997329973uscas1p1D; Wed, 20 Dec 2023 22:58:23 +0000 (GMT) X-AuditID: cbfec36d-85fff700000025ce-0b-6583718f50a0 Received: from SSI-EX1.ssi.samsung.com ( [105.128.3.66]) by ussmgxs1new.samsung.com (USCPEXMTA) with SMTP id 78.DE.09930.F8173856; Wed, 20 Dec 2023 17:58:23 -0500 (EST) Received: from SSI-EX2.ssi.samsung.com (105.128.2.227) by SSI-EX1.ssi.samsung.com (105.128.2.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.2375.24; Wed, 20 Dec 2023 14:58:22 -0800 Received: from SSI-EX2.ssi.samsung.com ([105.128.2.227]) by SSI-EX2.ssi.samsung.com ([105.128.2.227]) with mapi id 15.01.2375.024; Wed, 20 Dec 2023 14:58:22 -0800 From: Jim Harris To: Bjorn Helgaas , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Leon Romanovsky , "Jason Gunthorpe" , Alex Williamson Subject: [PATCH 2/2] pci/iov: fix kobject_uevent() ordering in sriov_enable() Thread-Topic: [PATCH 2/2] pci/iov: fix kobject_uevent() ordering in sriov_enable() Thread-Index: AQHaM5gIymu+QAnEL0auqBpjRq8bEQ== Date: Wed, 20 Dec 2023 22:58:22 +0000 Message-ID: <170311310235.2826.17048185824437453415.stgit@bgt-140510-bm01.eng.stellus.in> In-Reply-To: <170311143880.2826.17853753430536108145.stgit@bgt-140510-bm01.eng.stellus.in> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-ID: <56EA0B30ADDB974295D9DFBCB54F5162@ssi.samsung.com> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFKsWRmVeSWpSXmKPExsWy7djXc7r9hc2pBq3bTCy+/e9hs1jSlGFx 5d8eRotNG56wWFzeNYfN4uy842wObB4LNpV69Da/Y/N4v+8qm8fnTXIBLFFcNimpOZllqUX6 dglcGTfu6RdsYq/ou3mOpYFxBnsXIyeHhICJxN7/T1i6GLk4hARWMko0PO1ihXBamST6/21m hKk6cv81I0RiDaPEtMfPoZxPjBJfv71gg3CWMUp8f/WMBaSFTUBT4teVNUwgtojAHCaJGRc8 QWxhAX+JP/1tUPEQiQtr5rNA2HoSv8+cYAWxWQRUJfbdvs8MYvMKRErs3zcLrJ5TIEriz5HP bCA2o4CYxPdTEPOZBcQlbj2ZzwRxqqDEotl7mCFsMYl/ux6yQdiKEve/vwR6mgOoXlNi/S59 CNNO4sKTTIgpihJTuh+yQ2wVlDg58wkLRKekxMEVN8BBJCGwg0Ni3+LFjCC9EgIuEg0vOCFq pCWuXp8KtTVbYuX6DiaIkgKJhiNBEGFriYV/1kMdzCfx99cjxgmMyrOQ3D8L4bZZCLfNQnLb LCS3LWBkXcUoXlpcnJueWmyYl1quV5yYW1yal66XnJ+7iRGYfE7/O5y7g3HHrY96hxiZOBgP MUpwMCuJ8O7tbEoV4k1JrKxKLcqPLyrNSS0+xCjNwaIkzmtoezJZSCA9sSQ1OzW1ILUIJsvE wSnVwLQjeu32llV3T7UVSxw7/6THe2uHzUnBHyXnDV5xn5rRXalrOdG+id/XunmSYF/oqh0u P34wnH8g1zNZPVa3fVZp8fLqm9Y2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61Wl5/0f2zvOT2veNRM1IjwqVe73me tajgb7zfx61331dtqF0wXyz1KZOf9P3bK+bu2GfhWrv8WOYD7w+e+98l6slKCd3bbmxl8+yn alpD392DugULnRWkftZ1L2iYV9G8bH6Cy5NburemudW7T+2ylp988mnc5IrXq+v2BFys7FNN 0tW7zSXTarLqbJp76t6iA3N116u/nfq19NEBUbPvIkW/3v5OyvytxFKckWioxVxUnAgArbBk WUADAAA= X-CMS-MailID: 20231220225823uscas1p12d012a034806edd76fbc66a8d04e15ee CMS-TYPE: 301P X-CMS-RootMailID: 20231220225823uscas1p12d012a034806edd76fbc66a8d04e15ee References: <170311143880.2826.17853753430536108145.stgit@bgt-140510-bm01.eng.stellus.in> Wait to call kobject_uevent() until all of the associated changes are done, including updating the num_VFs value. Suggested by: Leon Romanovsky Signed-off-by: Jim Harris Reviewed-by: Leon Romanovsky --- drivers/pci/iov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index d4646bdcd887..7a0f33ef1826 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -677,8 +677,8 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn) if (rc) goto err_pcibios; - kobject_uevent(&dev->dev.kobj, KOBJ_CHANGE); iov->num_VFs = nr_virtfn; + kobject_uevent(&dev->dev.kobj, KOBJ_CHANGE); return 0;