From patchwork Wed Dec 20 22:58:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Harris X-Patchwork-Id: 181871 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp64850dyi; Wed, 20 Dec 2023 15:11:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8lMifOHBv+UVAvwh7tu7bkEef5Q3WN21VPBjoRSYnPhfFVGbhqg33BJgfE5Z/RkNMqP2+ X-Received: by 2002:a05:6a20:5089:b0:190:38cf:15b5 with SMTP id l9-20020a056a20508900b0019038cf15b5mr452998pza.20.1703113892470; Wed, 20 Dec 2023 15:11:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703113892; cv=none; d=google.com; s=arc-20160816; b=P9Oo4Tzurq9Zao3b0sH5XGKyBaArbV3x9sROVsfcAZ8K0YcWu5Gord9Ate8XTO+w/9 NRP9WHqjDq3X50CbusWjwPoLof8r1QjFMiruHADy269xGXjilx+2bhgKHffzv1mOk0Gx xs7tw9n0HX6N27KOHyTQBsk0GRZ6fx4W5+muYxWQvrvwNILkcmKWOekBbnEzLNrUBb0W U/SW5XEU7PbhkloZPAyNdolicN9u/FV3PGXQOmtVrLvvczBcExBcFH9DN5RnPGRzLnu8 mlGydI0V5IWpL7y7DqpZjSPCbxw1Gw6RYy6xGEuosNTXsoScAN3xqtzlrBa895y6KrWi F0cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:cms-type:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:content-transfer-encoding:content-id :content-language:accept-language:in-reply-to:message-id:date :thread-index:thread-topic:subject:to:from:dkim-signature :dkim-filter; bh=pWPHRez3lE3xKoymhilbgrompZKvRUVieFbZgZqSp6w=; fh=OtPxTFaFpOC/i6a2eMxR19Qv834xIhrDak+9qqew0ho=; b=qvryTrPAm0bf6IAuYp7of7sEIr54yLBCjoAeA9qL8hWWAa7VHV3theab6smJZCToDv ZxF+zNttloPhpBniv6VhH8q3hUvcYCIQXGjYGaSc67GDh86PbcKqtkKvUxzRua0L2dOF nrvovdwBAyIUA3ZF17hHgkbgIzCBIqkJtfWsFy8JHrSqjHXlOFW8eXXPdOhEM/kirPD+ YkzOG8ExCQlRyWF3L+pI8a3OeMHGB5j2pGVuOh2o8Zf8RoLRZ2w1xhe03/NmVVUhrzpM YScjfAlBLbUN9YF63lCFWA+ovkgsj6HRQ/KoQtCjBSfP4qX7F2cK86wVw4mS542AT16D VgoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=cT6EvW6x; spf=pass (google.com: domain of linux-kernel+bounces-7613-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7613-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bq6-20020a056a02044600b005c69605f795si526570pgb.75.2023.12.20.15.11.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:11:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7613-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=cT6EvW6x; spf=pass (google.com: domain of linux-kernel+bounces-7613-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7613-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3D2322831AC for ; Wed, 20 Dec 2023 23:11:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5375B4E1A8; Wed, 20 Dec 2023 22:58:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="cT6EvW6x" X-Original-To: linux-kernel@vger.kernel.org Received: from mailout2.w2.samsung.com (mailout2.w2.samsung.com [211.189.100.12]) (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 99DB14B5D0; Wed, 20 Dec 2023 22:58:26 +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 Received: from uscas1p2.samsung.com (unknown [182.198.245.207]) by mailout2.w2.samsung.com (KnoxPortal) with ESMTP id 20231220225819usoutp02a2b7636fa1a1a83d085f37470b58fa99~irFcombhy3179731797usoutp02i; Wed, 20 Dec 2023 22:58:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w2.samsung.com 20231220225819usoutp02a2b7636fa1a1a83d085f37470b58fa99~irFcombhy3179731797usoutp02i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1703113099; bh=pWPHRez3lE3xKoymhilbgrompZKvRUVieFbZgZqSp6w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cT6EvW6x3e7bJAP/IZGn/qKfONUzDEXiOSIWIpj7AMOtUHCAJ5O0z42nG3iAosbwE IcF1QFLncvqdY4gWYMkkSyR7NKvJsLjc1US9k+ZTDSZbjBvlJSx9H43Du097VeWvUP T0EHKnhw+sIZr3xRZAa9b8bodqOsVarz9I6NXpjA= Received: from ussmges1new.samsung.com (u109.gpu85.samsung.co.kr [203.254.195.109]) by uscas1p2.samsung.com (KnoxPortal) with ESMTP id 20231220225818uscas1p24cb8016b3d74556b586b975fc854aa4a~irFcKqyMG1793317933uscas1p2D; Wed, 20 Dec 2023 22:58:18 +0000 (GMT) Received: from uscas1p1.samsung.com ( [182.198.245.206]) by ussmges1new.samsung.com (USCPEMTA) with SMTP id CC.12.09678.A8173856; Wed, 20 Dec 2023 17:58:18 -0500 (EST) Received: from ussmgxs2new.samsung.com (u91.gpu85.samsung.co.kr [203.254.195.91]) by uscas1p1.samsung.com (KnoxPortal) with ESMTP id 20231220225818uscas1p1e01e19bc82953b21b473ae1daf17e839~irFblIfRf2098420984uscas1p1A; Wed, 20 Dec 2023 22:58:18 +0000 (GMT) X-AuditID: cbfec36d-85fff700000025ce-fb-6583718a35d0 Received: from SSI-EX2.ssi.samsung.com ( [105.128.3.66]) by ussmgxs2new.samsung.com (USCPEXMTA) with SMTP id EA.4B.09813.A8173856; Wed, 20 Dec 2023 17:58:18 -0500 (EST) Received: from SSI-EX2.ssi.samsung.com (105.128.2.227) by SSI-EX2.ssi.samsung.com (105.128.2.227) 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:17 -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:17 -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 1/2] Revert "PCI/IOV: Serialize sysfs sriov_numvfs reads vs writes" Thread-Topic: [PATCH 1/2] Revert "PCI/IOV: Serialize sysfs sriov_numvfs reads vs writes" Thread-Index: AQHaM5gFg92cIiE8Xka1UVYgjQ/z/A== Date: Wed, 20 Dec 2023 22:58:17 +0000 Message-ID: <170311309712.2826.11254260046040224092.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: <6B10883F28563046AE2025CE533E93D4@ssi.samsung.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDKsWRmVeSWpSXmKPExsWy7djXc7pdhc2pBtdnGVp8+9/DZrGkKcPi yr89jBabNjxhsbi8aw6bxdl5x9kc2DwWbCr16G1+x+bxft9VNo/Pm+QCWKK4bFJSczLLUov0 7RK4Mj5+/sVYMIu7YseUT4wNjF+4uhg5OSQETCTedB9j7WLk4hASWMkoMe/+IzYIp5VJ4tXS 18wwVd8ePASzhQTWMEq0XnKDKPrEKDH98UQmCGcZo8S3CQ2sIFVsApoSv66sYQKxRQTmMEnM uOAJYgsLhErsO3+PGSIeJbG/8SAbhK0ncWzHO6B6Dg4WAVWJZQ3xIGFegUiJvq2N7CA2J1D5 nyOfwcoZBcQkvp+CGM8sIC5x68l8JohDBSUWzd4DdbSYxL9dD9kgbEWJ+99fsoOMZwY6bf0u fYhWO4kzyw8wQ9iKElO6H7JDrBWUODnzCQtEq6TEwRU3WEBelBDYwyGx7NZrqF0uEv9W9rFC 2NISf+8ug4pnS6xc3wH2ioRAgUTDkSCIsLXEwj/roU7mk/j76xHjBEblWUg+mIVw3Swk181C ct0sJNctYGRdxSheWlycm55abJiXWq5XnJhbXJqXrpecn7uJEZiATv87nLuDccetj3qHGJk4 GA8xSnAwK4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1MLUotgskwcnFINTJ236pmytrnvmLP6T/6R mROLQ6fWTI9N2PTLO3VDI//bndOVc5lyp/scMJv2p7ZPzPjsg2vL9qfdUT52+opZm/qB1P6Z 8lErI+d2ljnFd6xcZVMgKN37u+aA4Z0/gXZXtr7Z6RK7Wthy/ux5EQIKx9OSUz9G9B5e5f9/ 3tldLNNzTpx2/as1Z2nbsex8RdU9QqoVz7+5bQq4ueuo5x4erq1yrj/P3PNK3nLFfLfzbt2j hyRmssTXnno+oZV1M8/3VDOXPb1TN7btmnnuVdDevn/xZ6Nftf1gKjxgKfDfdI094/eTJ2Y7 7fzt7njrYYyeT3PPw6c6b1+ZvmM5NftKSeLHh8fvCb34wnX3hNnrAxvXK7EUZyQaajEXFScC ABZb+LNBAwAA X-CMS-MailID: 20231220225818uscas1p1e01e19bc82953b21b473ae1daf17e839 CMS-TYPE: 301P X-CMS-RootMailID: 20231220225818uscas1p1e01e19bc82953b21b473ae1daf17e839 References: <170311143880.2826.17853753430536108145.stgit@bgt-140510-bm01.eng.stellus.in> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785844353076479468 X-GMAIL-MSGID: 1785844353076479468 The proper way to detect a change to the num_VFs value is to listen for a sysfs event, not to add a device_lock() on the attribute _show() in the kernel. This reverts commit 35ff867b76576e32f34c698ccd11343f7d616204. Revert had a small conflict, the sprintf() is now changed to sysfs_emit(). Suggested-by: Leon Romanovsky Signed-off-by: Jim Harris Reviewed-by: Leon Romanovsky --- drivers/pci/iov.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 25dbe85c4217..d4646bdcd887 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -395,14 +395,8 @@ static ssize_t sriov_numvfs_show(struct device *dev, char *buf) { struct pci_dev *pdev = to_pci_dev(dev); - u16 num_vfs; - - /* Serialize vs sriov_numvfs_store() so readers see valid num_VFs */ - device_lock(&pdev->dev); - num_vfs = pdev->sriov->num_VFs; - device_unlock(&pdev->dev); - return sysfs_emit(buf, "%u\n", num_vfs); + return sysfs_emit(buf, "%u\n", pdev->sriov->num_VFs); } /* 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: 181889 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp69447dyi; Wed, 20 Dec 2023 15:21:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbXD6bVwcbaNQ0SJAfHnnCXwv93wvjgW05wukK4O/dihz7dpc8ta1EClkQWyzY3b2j3XuN X-Received: by 2002:a50:8713:0:b0:553:b9b8:5fa3 with SMTP id i19-20020a508713000000b00553b9b85fa3mr1528578edb.69.1703114496801; Wed, 20 Dec 2023 15:21:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703114496; cv=none; d=google.com; s=arc-20160816; b=U9MSM/dFBQTYSMi8INb6cCME3tjyA1LlkbrPqG1ckBvo/OSCs/MRk9lhTqV/2vI0QN aSv++DKrznFcC/DOQ1NkzQ9xvxVr6V3P0iHKZ/zEm0f9gx+Fg0FxrH1WVNwbTPl5PhHh M97afkEihSJLhiYzldIkvL1AQD+5MXCg2dUcfLLhbrpem6VBHDet/gotiYsEbYuSC2LP Sy2T5+AAi3q2Jx5RvpLTy7GYvo+fiMFqfh3KAoX0l3hKLBxdfsCjQrh7Oofmy/K2DGGe cmkhseTi72M/W4LWxHAzcJsLnICUcBkBHaqsVAPKDVisKCqq9qUhXCUe2OdkWGmvlcil BfQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:cms-type:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:content-transfer-encoding:content-id :content-language:accept-language:in-reply-to:message-id:date :thread-index:thread-topic:subject:to:from:dkim-signature :dkim-filter; bh=j+X1XlpJVazixEjaPvnlQ7y4Y2vct9sGwyqv0nkwLBU=; fh=OtPxTFaFpOC/i6a2eMxR19Qv834xIhrDak+9qqew0ho=; b=L4B9m4yuO9ypMdAJh5Oox8Mik71d/TstgqhkS0ts0uCLm/nlplvavYcMPYsjuYh5WO 9Eto4BczcCWsmytfZkJ8LDVd99HIuu0bY5hBbqQqt4okOW2TCYWbXMUJrxPso6OVerMA lwP04hUaBcTaCmrEQnN/Pkg79PmRQ5pB8wp7kfTDFsTshStCNtpolUsnfUvBmq/OsUwY 18uKP6X9s1yQn+wmDnXo/7x/xWBsmYJ0VTnn4UfUSKZYX5QyW8QivJUPSYujcyJNIMXF HJKmaQp7iimkKHONiM1qWTPFeVd74PISIWgcFb2B+1ddODy7tKcLHSc19HxwIiHTv6MI xPuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=k82YbAhI; spf=pass (google.com: domain of linux-kernel+bounces-7612-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7612-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id x28-20020a50d61c000000b00553eefed8f9si264107edi.395.2023.12.20.15.21.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:21:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7612-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=k82YbAhI; spf=pass (google.com: domain of linux-kernel+bounces-7612-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7612-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9D19C1F2663C for ; Wed, 20 Dec 2023 23:11:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D585D4D5BE; Wed, 20 Dec 2023 22:58:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="k82YbAhI" X-Original-To: linux-kernel@vger.kernel.org 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 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-kernel@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/1kMdzCfx99cjxgmMyrOQ3D8L4b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10vOT93EyMwRk//Oxy5g/HorY96hxiZOBgPMUpwMCuJ8O7tbEoV4k1JrKxKLcqP LyrNSS0+xCjNwaIkznv3gUaqkEB6YklqdmpqQWoRTJaJg1OqgWm6Os/Vmw4z2mMv8mj3iL/7 E3fQ+/CK+J9bGd+/vzbZOOBpy5/ryt+NOuwErt4LKp/nPO+e5wpe7wffLPLudPjrstr/Wt3s ZKnGP2nWoRd6ll4HpsZtOzZHMTDuQ/PeCRtl6syZLH61Wl5/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> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785844986600446544 X-GMAIL-MSGID: 1785844986600446544 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;