Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1326311rdb; Fri, 9 Feb 2024 19:22:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2PwuJ+jeBmiz6A44Zpcb/16YJGJq2vFSo+PHI6c5wQSEWB33+/ljB2ORZ4H6a5d2fW6eC X-Received: by 2002:a05:6870:4204:b0:219:9f7f:be98 with SMTP id u4-20020a056870420400b002199f7fbe98mr1169323oac.2.1707535351109; Fri, 09 Feb 2024 19:22:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707535351; cv=pass; d=google.com; s=arc-20160816; b=hNnim5uXaZ1ptdhGgkCRakKhqMSZ66eGNu6Z32Q6FWDuDE2NPz4ZqKWMYLgz+8XW8E R7zTFBqokuM9Ouzm3rVrUZL8tfaWQN6+GNOK12iuklxKFDK4iLdD8uU1o6S90G6yjUFp iMMJFmUJaOSyQ+aLlQr1zx13wKq+cAQjqqddksHeeuz5EtzvCXSZ8tM80XtSKyqDgdAU khzljg7g5PxRef4axj69TVXs3CNwLRS7bNV9TI33kWaUNMKStZXy93rQtTF0zLGzgbht 22QXLmbvM7yfZHQKmvgn4R+ITyP6ojHzAHQGqWOk0Sta6LEq1mQYD7bW3abVzhoaKBIa zhsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=1tupBGCm9M+RjJsnQ8NJBTqLXcuyozy0phtdJ9dtPy4=; fh=lDDlhufp1lG10Kylw8CRSjJ37V4k+vpSxwb4578dqq0=; b=o68YEBiTcIRtllssRkOCNbvUNVbE6S5X5kxG6/j2hTEGaL8h+cSxNC6w0i/lkWdoZy 6Su58C/JbOlUebmTIqzzzMhtF5Gke+sUwirRmgpM9sAzqzCBgKRo4LQzuHIWOouXY6FB HlDvXrGwlRC7ECktqpY0fIEqljKooxR32MGI34vSpFwPInsgTFlMjJuI0/AtTuRPatp1 USKgrvrJ7knHmnnY7DDncEdm7fsGY00cAuKVFE4+8LKLP7MjWX3/AJys5vMcc/5nCw4e kyr87ln7imbqjfFaLsjq17oxLp9hB8Y6DDMTwzdqebzfmSlPz8Gk3DuuGjjeaanLddjw MOmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Z3G+UN4d; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-60271-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60271-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCWMjH648CZdyk59cLELsr5LZWNCLSeMQkd5mdn7PiuD7jmekKDOGtSwAN4JwMr3OGha8KyUbQJ28GQvLm9Z13xP+bUM2qw2EVSWDpZa2Q== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g19-20020a05620a219300b007854f7e6c1csi891399qka.405.2024.02.09.19.22.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 19:22:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60271-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Z3G+UN4d; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-60271-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60271-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B861D1C265D9 for ; Sat, 10 Feb 2024 03:22:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DFD08524B; Sat, 10 Feb 2024 03:22:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Z3G+UN4d" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (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 4CF9F1370; Sat, 10 Feb 2024 03:22:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707535341; cv=none; b=Wn+w1Hy+lLNAdzEsNVBuWDkIAT3BOpkRVbdJy6TjmncebFX+JVueJEp/VJCAQu1erHjTd0EhyoqXg2UWw+4hdnk415ctNuoM7DeuZYRXYzr21qppNeu0cPD313zxqjZfVWcBsFLL703v0MpY2zjfXrS1YtvibdDnOotnPgdPTpc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707535341; c=relaxed/simple; bh=xUXJPXsKc7TxHTCdJ+qu0RbaBHZWIuQ+OLNtT4PEDWY=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=X+Hf8qXUBAJe9ik20E19WM4do/hK9uTLnRJz9HU0xr+Xf7qvgtPlQDJM0AnSBUS8zGGcDQSXzl6mvTRXj568hX5dT4UztW7/mL1YTohN9q6szbbCSeiHJ1fhgeJkhYVXZEzpmF4quwaAzlg2IsT5UFM52wSVoa1rAWMgkGM+54k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Z3G+UN4d; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707535340; x=1739071340; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=xUXJPXsKc7TxHTCdJ+qu0RbaBHZWIuQ+OLNtT4PEDWY=; b=Z3G+UN4d0vwItsHGgYzjL9A2Rt1Z7gzh1FXPxzws8auiKqlpbYpu6W5A GppGfCXsMuDqi8ThtEpK7llZPP1ChCAstQp1fp/LM4PjCMcSQcpLGEHU/ TBH4dc3SC0c930IRIG4LeVqngU+Ih4AGVwtolBvzI4NRwEO0AGgY0K9qS Xte1o50VZ/s4fUwiNpcFg9Sk6BnQVCIWTCnQ/Cj22mVjjmiabIJGx+XYz aJ2Dx+v8Q40dat85NmER/CHUa/BpuQ56dwGi8BeBRHM0mqhWLOAfoNfnb UTfBmVmAcv7kZ2Qxc53oKFRKsaQk5+gTbBIwd1t7heHhPlJwoFWpUM1CS Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10979"; a="1671257" X-IronPort-AV: E=Sophos;i="6.05,258,1701158400"; d="scan'208";a="1671257" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2024 19:22:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,258,1701158400"; d="scan'208";a="2086653" Received: from ticela-or-295.amr.corp.intel.com (HELO [10.209.25.188]) ([10.209.25.188]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2024 19:22:18 -0800 Message-ID: Date: Fri, 9 Feb 2024 19:22:17 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/2] pci/iov: fix kobject_uevent() ordering in sriov_enable() Content-Language: en-US To: Jim Harris , Bjorn Helgaas , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Leon Romanovsky , Jason Gunthorpe , Alex Williamson , "pierre.cregut@orange.com" References: <170752254154.1693615.9176696143128338408.stgit@bgt-140510-bm01.eng.stellus.in> <170752273749.1693615.1293677023514112939.stgit@bgt-140510-bm01.eng.stellus.in> From: Kuppuswamy Sathyanarayanan In-Reply-To: <170752273749.1693615.1293677023514112939.stgit@bgt-140510-bm01.eng.stellus.in> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 > Reviewed-by: Leon Romanovsky > Signed-off-by: Jim Harris > --- It looks fine to me. Reviewed-by: Kuppuswamy Sathyanarayanan > 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