[PATCH 14/14] cxl: Add cxl_check_and_switch_mode() API to switch bi-modal cards

Andrew Donnellan andrew.donnellan at au1.ibm.com
Wed Jul 6 13:55:39 AEST 2016


On 04/07/16 23:22, Ian Munsie wrote:
> +static int setup_cxl_protocol_area(struct pci_dev *dev)
> +{
> +	u8 val;
> +	int rc;
> +	int vsec = find_cxl_vsec(dev);
> +
> +	if (!vsec) {
> +		dev_info(&dev->dev, "CXL VSEC not found\n");
> +		return -ENODEV;
> +	}
> +
> +	rc = CXL_READ_VSEC_MODE_CONTROL(dev, vsec, &val);
> +	if (rc) {
> +		dev_err(&dev->dev, "Failed to read current mode control: %i\n", rc);
> +		return rc;
> +	}
> +
> +	if (!(val & CXL_VSEC_PROTOCOL_ENABLE)) {
> +		dev_err(&dev->dev, "Card not in CAPI mode!\n");
> +		return -EIO;
> +	}
> +
> +	/* Still configure the protocol area for single mode cards */

This comment is extraneous and will be dropped in V2.

-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com  IBM Australia Limited



More information about the Linuxppc-dev mailing list