All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Devesh Sharma <devesh.sharma@broadcom.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH for-next V3 1/3] RDMA/bnxt_re: Enable global atomic ops if platform supports
Date: Tue, 1 Jun 2021 11:46:43 -0300	[thread overview]
Message-ID: <20210601144643.GA4168406@nvidia.com> (raw)
In-Reply-To: <20210526153629.872796-2-devesh.sharma@broadcom.com>

On Wed, May 26, 2021 at 09:06:27PM +0530, Devesh Sharma wrote:
> +bool bnxt_qplib_determine_atomics(struct pci_dev *dev)
> +{
> +	u16 ctl2;
> +
> +	if(pci_enable_atomic_ops_to_root(dev, PCI_EXP_DEVCAP2_ATOMIC_COMP32) &&
> +	   pci_enable_atomic_ops_to_root(dev, PCI_EXP_DEVCAP2_ATOMIC_COMP64))
> +		return true; /* Failure */
> +	pcie_capability_read_word(dev, PCI_EXP_DEVCTL2, &ctl2);
> +	if (ctl2 & PCI_EXP_DEVCTL2_ATOMIC_REQ)
> +		return 0; /* Success */
> +	pcie_capability_set_word(dev, PCI_EXP_DEVCTL2,
> +				 PCI_EXP_DEVCTL2_ATOMIC_REQ);
> +	return 0; /* Success */
> +}

true on failure, 0 on success and the error code is thrown away??
Please return -ENOTSUPP or something on error

Jason

  reply	other threads:[~2021-06-01 14:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 15:36 [PATCH for-next V3 0/3] Broadcom's driver add global atomics Devesh Sharma
2021-05-26 15:36 ` [PATCH for-next V3 1/3] RDMA/bnxt_re: Enable global atomic ops if platform supports Devesh Sharma
2021-06-01 14:46   ` Jason Gunthorpe [this message]
2021-06-02  3:43     ` Devesh Sharma
2021-06-02 14:44       ` Jason Gunthorpe
2021-05-26 15:36 ` [PATCH for-next V3 2/3] bnxt_re: Update maintainers list Devesh Sharma
2021-05-26 15:36 ` [PATCH for-next V3 3/3] RDMA/bnxt_re: update ABI to pass wqe-mode to user space Devesh Sharma

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=20210601144643.GA4168406@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=devesh.sharma@broadcom.com \
    --cc=linux-rdma@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.