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

Commit 37b19336 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cnss2: Add debugfs entry for IO coherency"

parents c2ba663c 9830ab7c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -615,6 +615,9 @@ static int cnss_show_quirks_state(struct seq_file *s,
		case DISABLE_DRV:
			seq_puts(s, "DISABLE_DRV");
			continue;
		case DISABLE_IO_COHERENCY:
			seq_puts(s, "DISABLE_IO_COHERENCY");
			continue;
		}

		seq_printf(s, "UNKNOWN-%d", i);
+1 −1
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
#define CNSS_EVENT_PENDING		2989
#define COLD_BOOT_CAL_SHUTDOWN_DELAY_MS	50

#define CNSS_QUIRKS_DEFAULT		0
#define CNSS_QUIRKS_DEFAULT		BIT(DISABLE_IO_COHERENCY)
#ifdef CONFIG_CNSS_EMULATION
#define CNSS_MHI_TIMEOUT_DEFAULT	90000
#else
+1 −0
Original line number Diff line number Diff line
@@ -239,6 +239,7 @@ enum cnss_debug_quirks {
	FBC_BYPASS,
	ENABLE_DAEMON_SUPPORT,
	DISABLE_DRV,
	DISABLE_IO_COHERENCY,
};

enum cnss_bdf_type {
+16 −9
Original line number Diff line number Diff line
@@ -2902,6 +2902,7 @@ int cnss_smmu_map(struct device *dev,
		  phys_addr_t paddr, uint32_t *iova_addr, size_t size)
{
	struct cnss_pci_data *pci_priv = cnss_get_pci_priv(to_pci_dev(dev));
	struct cnss_plat_data *plat_priv;
	unsigned long iova;
	size_t len;
	int ret = 0;
@@ -2919,6 +2920,8 @@ int cnss_smmu_map(struct device *dev,
		return -EINVAL;
	}

	plat_priv = pci_priv->plat_priv;

	len = roundup(size + paddr - rounddown(paddr, PAGE_SIZE), PAGE_SIZE);
	iova = roundup(pci_priv->smmu_iova_ipa_start, PAGE_SIZE);

@@ -2931,16 +2934,20 @@ int cnss_smmu_map(struct device *dev,
		return -ENOMEM;
	}

	if (!test_bit(DISABLE_IO_COHERENCY,
		      &plat_priv->ctrl_params.quirks)) {
		root_port = pci_find_pcie_root_port(pci_priv->pci_dev);
		root_of_node = root_port->dev.of_node;
		if (root_of_node->parent) {
		dma_coherent = of_property_read_bool(root_of_node->parent,
			dma_coherent =
				of_property_read_bool(root_of_node->parent,
						      "dma-coherent");
			cnss_pr_dbg("dma-coherent is %s\n",
				    dma_coherent ? "enabled" : "disabled");
			if (dma_coherent)
				flag |= IOMMU_CACHE;
		}
	}

	ret = iommu_map(pci_priv->iommu_domain, iova,
			rounddown(paddr, PAGE_SIZE), len, flag);