Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55b858b4 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] cobalt: allow fewer than 8 PCIe lanes



Currently the cobalt driver refuses to load if fewer than 8 PCIe lanes
are assigned. This patch changes this and just issues a warning. The
only time it will refuse to load is if the number of assigned lanes is less
than what the PCIe host is capable of since this suggests that the card
isn't seated correctly in the slot.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 810c168c
Loading
Loading
Loading
Loading
+6 −5
Original line number Original line Diff line number Diff line
@@ -339,16 +339,17 @@ static int cobalt_setup_pci(struct cobalt *cobalt, struct pci_dev *pci_dev,
	}
	}


	if (pcie_link_get_lanes(cobalt) != 8) {
	if (pcie_link_get_lanes(cobalt) != 8) {
		cobalt_err("PCI Express link width is not 8 lanes (%d)\n",
		cobalt_warn("PCI Express link width is %d lanes.\n",
				pcie_link_get_lanes(cobalt));
				pcie_link_get_lanes(cobalt));
		if (pcie_bus_link_get_lanes(cobalt) < 8)
		if (pcie_bus_link_get_lanes(cobalt) < 8)
			cobalt_err("The current slot only supports %d lanes, at least 8 are needed\n",
			cobalt_warn("The current slot only supports %d lanes, for best performance 8 are needed\n",
					pcie_bus_link_get_lanes(cobalt));
					pcie_bus_link_get_lanes(cobalt));
		else
		if (pcie_link_get_lanes(cobalt) != pcie_bus_link_get_lanes(cobalt)) {
			cobalt_err("The card is most likely not seated correctly in the PCIe slot\n");
			cobalt_err("The card is most likely not seated correctly in the PCIe slot\n");
			ret = -EIO;
			ret = -EIO;
			goto err_disable;
			goto err_disable;
		}
		}
	}


	if (pci_set_dma_mask(pci_dev, DMA_BIT_MASK(64))) {
	if (pci_set_dma_mask(pci_dev, DMA_BIT_MASK(64))) {
		ret = pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32));
		ret = pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32));