mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
To: Jim Harris <jim.harris@samsung.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Leon Romanovsky <leonro@nvidia.com>,
	Jason Gunthorpe <jgg@nvidia.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	"pierre.cregut@orange.com" <pierre.cregut@orange.com>
Subject: Re: [PATCH v2 2/2] pci/iov: fix kobject_uevent() ordering in sriov_enable()
Date: Fri, 9 Feb 2024 19:22:17 -0800	[thread overview]
Message-ID: <d9c89ad1-990d-4a4c-a16d-27d978673e57@linux.intel.com> (raw)
In-Reply-To: <170752273749.1693615.1293677023514112939.stgit@bgt-140510-bm01.eng.stellus.in>


On 2/9/24 3:52 PM, Jim Harris wrote:
> Wait to call kobject_uevent() until all of the associated changes are done,
> including updating the num_VFs value. This avoids any possibility of
> userspace responding to the event and getting a stale value (although
> probably impossible to actually happen).
>
> Suggested-by: Leon Romanovsky <leonro@nvidia.com>
> Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
> Signed-off-by: Jim Harris <jim.harris@samsung.com>
> ---

It looks fine to me.

Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

>  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 0ca20cd518d5..c00b0f822526 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;
>  
>
-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer


  reply	other threads:[~2024-02-10  3:22 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240209235208uscas1p26c658c64cc85711cd3aa6312224164fc@uscas1p2.samsung.com>
2024-02-09 23:52 ` [PATCH v2 0/2] PCI/IOV: sriov_numvfs bug fixes Jim Harris
     [not found]   ` <CGME20240209235213uscas1p2e8de2bdf05e6e7cba51bd41ddb42a8e4@uscas1p2.samsung.com>
2024-02-09 23:52     ` [PATCH v2 1/2] PCI/IOV: Revert "PCI/IOV: Serialize sysfs sriov_numvfs reads vs writes" Jim Harris
2024-02-10  3:20       ` Kuppuswamy Sathyanarayanan
2024-02-11  8:48         ` Leon Romanovsky
2024-02-11 19:15           ` Kuppuswamy Sathyanarayanan
2024-02-12  9:31             ` Leon Romanovsky
2024-02-12 20:27           ` Bjorn Helgaas
     [not found]             ` <CGME20240212225904uscas1p19a3d7743607a0abe3627fb8c4829f27b@uscas1p1.samsung.com>
2024-02-12 22:59               ` Jim Harris
2024-02-13  7:37                 ` Leon Romanovsky
2024-02-13  9:40                 ` pierre.cregut
2024-02-13 14:59                 ` Jason Gunthorpe
2024-02-13  7:34             ` Leon Romanovsky
2024-02-13 15:59               ` Bjorn Helgaas
2024-02-13 17:46                 ` Leon Romanovsky
2024-02-13 18:00                   ` Kuppuswamy Sathyanarayanan
2024-02-13 19:45                   ` Bjorn Helgaas
2024-02-14  7:16                     ` Leon Romanovsky
     [not found]                       ` <CGME20240214170409uscas1p1e04d5916cb91670ea7f6413f0347d9ca@uscas1p1.samsung.com>
2024-02-14 17:04                         ` Jim Harris
2024-02-14 17:50                           ` Bjorn Helgaas
     [not found]                             ` <CGME20240214225538uscas1p2d6502c3bd144e4d90d4506acf4847159@uscas1p2.samsung.com>
2024-02-14 22:55                               ` Jim Harris
     [not found]   ` <CGME20240209235218uscas1p2d0978af6623037fa1b9358a2ad2320c5@uscas1p2.samsung.com>
2024-02-09 23:52     ` [PATCH v2 2/2] pci/iov: fix kobject_uevent() ordering in sriov_enable() Jim Harris
2024-02-10  3:22       ` Kuppuswamy Sathyanarayanan [this message]
2024-02-12 15:17         ` Keith Busch
2024-02-12 15:29           ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d9c89ad1-990d-4a4c-a16d-27d978673e57@linux.intel.com \
    --to=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=alex.williamson@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=jgg@nvidia.com \
    --cc=jim.harris@samsung.com \
    --cc=leonro@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=pierre.cregut@orange.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®