From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 526A142640C for ; Thu, 13 Aug 2026 06:43:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786603431; cv=none; b=LWluEPbi/qHGAke02WKbvsP43g2lDr7fSps3KN6BPwS/YosPNIiJDcnBaIsrdqk+Fi1cX8pIsYnWF1CFfOgVmbRONoZJUuZoH+jILJd+BgT3o5H6M79G9I9S9/reqsCgGhD13EsdpejZj0rruMW111PQ4p7jx+F7bNWrqmWmg+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786603431; c=relaxed/simple; bh=WfwzxP/46Y4S4zlHDBIREjvNQy40+0qUGvsvtjoek3I=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=EUK8Zztmx0TjO6CliwM3wHJUXJ2q39v/xVs3IAYjSHkJadYZE7ZSBo/w6TnFw9Cv2IDO3Ht7wAf0NGwFA4gOcbeZLbwJk4qVwf4cHjjtXEr19yL4TLA27l6PMIQeVT9nuQovVNCEEAIa/eDhyE7XFLJ4APnAtOVozk0t8X11+Zc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TeMnT1w1; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TeMnT1w1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 253F81F00A3A; Thu, 13 Aug 2026 06:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786603425; bh=XFgKbxGCajP3coDmnIYjkiHQjHBbDuCyITOEdlOzPWE=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=TeMnT1w1ZOfCKqhC28oZV/K31yfax4HzC23rO12QjLHxAgapoZX/0bdkgVXoDeNrs V+mnJ8AXxwP5Pqyza+qmSXlWpv1o8ZStUFq2BNpD8Q8TTE5bJabWc6GQi4ta9Sqn7a JeaHFvymVHFDCQDsTW2tnn7C523ebHSi9BANynD45Ljh1HN3zxyt9kxnexDuXMMGvg 50CKQORLSEg1qxp8UK19UflEWJpax63AnKqf0kurzZ78XTMeJK7Xr7P9gSzrAJ8fHx xZlRJAnny8uinUMmfxq+lzia1EaoZYrR8gBVAlu/LOszrxry2pe5cLYujLbXCvjznC Ku4Y5vWEU0mDw== Message-ID: <94e0d202-ad52-475c-89c6-69f7b77e0ccf@kernel.org> Date: Thu, 13 Aug 2026 08:43:39 +0200 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] powerpc/pseries/pci: Fix misleading VF limit error message To: Jiangshan Yi , maddy@linux.ibm.com Cc: mpe@ellerman.id.au, npiggin@gmail.com, nayna@linux.ibm.com, gcwilson@linux.ibm.com, kees@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, 13667453960@163.com References: <20260813063731.399598-1-yijiangshan@kylinos.cn> Content-Language: fr-FR From: "Christophe Leroy (CS GROUP)" In-Reply-To: <20260813063731.399598-1-yijiangshan@kylinos.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 13/08/2026 à 08:37, Jiangshan Yi a écrit : > When the number of requested VFs exceeds MAX_VFS_FOR_MAP_PE, the > message prints that limit but labels it "Configurable VFs". Report > the configurable VF limit and the PE mapping limit with separate > error messages. > > Suggested-by: Christophe Leroy > Signed-off-by: Jiangshan Yi reviewed-by: Christophe Leroy > --- > v2: > - rework as suggested by Christophe Leroy: split the two limit checks > into separate blocks, each with its own dev_err and error return > > arch/powerpc/platforms/pseries/pci.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c > index d11a64a086c1..6fc13f4a79a3 100644 > --- a/arch/powerpc/platforms/pseries/pci.c > +++ b/arch/powerpc/platforms/pseries/pci.c > @@ -132,11 +132,14 @@ static int pseries_pci_sriov_enable(struct pci_dev *pdev, u16 num_vfs) > > /* First integer stores max config */ > max_config_vfs = of_read_number(&max_vfs[0], 1); > - if (max_config_vfs < num_vfs || num_vfs > MAX_VFS_FOR_MAP_PE) { > - dev_err(&pdev->dev, > - "Num VFs %x > %x Configurable VFs\n", > - num_vfs, (num_vfs > MAX_VFS_FOR_MAP_PE) ? > - MAX_VFS_FOR_MAP_PE : max_config_vfs); > + if (max_config_vfs < num_vfs) { > + dev_err(&pdev->dev, "Num VFs %x > %x Configurable VFs\n", > + num_vfs, max_config_vfs); > + return -EINVAL; > + } > + if (num_vfs > MAX_VFS_FOR_MAP_PE) { > + dev_err(&pdev->dev, "Num VFs %x > %x PE mapping limit\n", > + num_vfs, MAX_VFS_FOR_MAP_PE); > return -EINVAL; > } >