linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Moritz Fischer <mdf@kernel.org>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org, moritzf@google.com,
	"Brian Foley" <bpfoley@google.com>,
	"Krzysztof Wilczyński" <kw@linux.com>
Subject: Re: [PATCH RESEND v2] PCI/IOV: Clarify error message for unbound devices
Date: Thu, 27 May 2021 18:12:53 -0500	[thread overview]
Message-ID: <20210527231253.GA1442161@bjorn-Precision-5520> (raw)
In-Reply-To: <20210327175140.682708-1-mdf@kernel.org>

On Sat, Mar 27, 2021 at 10:51:40AM -0700, Moritz Fischer wrote:
> Be more verbose to disambiguate the error case when trying to configure
> SRIOV with no driver bound vs. a driver that does not implement the
> SRIOV callback.
> 
> Reported-by: Brian Foley <bpfoley@google.com>
> Reviewed-by: Krzysztof Wilczyński <kw@linux.com>
> Signed-off-by: Moritz Fischer <mdf@kernel.org>

Applied to pci/virtualization for v5.14, thanks!

> ---
> Changes from v1:
> - Added Krzysztof's Reviewed-by
> ---
>  drivers/pci/iov.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
> index 4afd4ee4f7f0..f9ecc691daf5 100644
> --- a/drivers/pci/iov.c
> +++ b/drivers/pci/iov.c
> @@ -304,8 +304,15 @@ static ssize_t sriov_numvfs_store(struct device *dev,
>  	if (num_vfs == pdev->sriov->num_VFs)
>  		goto exit;
>  
> +	/* is PF driver loaded */
> +	if (!pdev->driver) {
> +		pci_info(pdev, "No driver bound to device. Cannot configure SRIOV\n");
> +		ret = -ENOENT;
> +		goto exit;
> +	}
> +
>  	/* is PF driver loaded w/callback */
> -	if (!pdev->driver || !pdev->driver->sriov_configure) {
> +	if (!pdev->driver->sriov_configure) {
>  		pci_info(pdev, "Driver does not support SRIOV configuration via sysfs\n");
>  		ret = -ENOENT;
>  		goto exit;
> -- 
> 2.30.2
> 

      reply	other threads:[~2021-05-27 23:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-27 17:51 [PATCH RESEND v2] PCI/IOV: Clarify error message for unbound devices Moritz Fischer
2021-05-27 23:12 ` Bjorn Helgaas [this message]

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=20210527231253.GA1442161@bjorn-Precision-5520 \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=bpfoley@google.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mdf@kernel.org \
    --cc=moritzf@google.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;
as well as URLs for NNTP newsgroup(s).