Re: [PATCH for-next V3 1/3] RDMA/bnxt_re: Enable global atomic ops if platform supports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux