]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: qcom: Override NO_SNOOP attribute for SA8775P RC
authorMrinmay Sarkar <quic_msarkar@quicinc.com>
Mon, 11 Mar 2024 14:11:35 +0000 (19:41 +0530)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 9 Jul 2024 21:52:19 +0000 (16:52 -0500)
commit1d648bf79d4dca909f242b1a0cdc458e4f9d0253
tree112c28b5e3d6599d6b3a7d74e30f40a44ee3587f
parent3c6c8443d45072b43c939eba9e891159a37ed282
PCI: qcom: Override NO_SNOOP attribute for SA8775P RC

Due to some hardware changes, SA8775P has set the NO_SNOOP attribute
in its TLP for all the PCIe controllers. NO_SNOOP attribute when set,
the requester is indicating that no cache coherency issue exist for
the addressed memory on the endpoint i.e., memory is not cached. But
in reality, requester cannot assume this unless there is a complete
control/visibility over the addressed memory on the endpoint.

And worst case, if the memory is cached on the endpoint, it may lead to
memory corruption issues. It should be noted that the caching of memory
on the endpoint is not solely dependent on the NO_SNOOP attribute in TLP.

So to avoid the corruption, this patch overrides the NO_SNOOP attribute
by setting the PCIE_PARF_NO_SNOOP_OVERIDE register. This patch is not
needed for other upstream supported platforms since they do not set
NO_SNOOP attribute by default.

8775 has IP version 1.34.0 so introduce a new cfg(cfg_1_34_0) for this
platform. Assign override_no_snoop flag into struct qcom_pcie_cfg and
set it true in cfg_1_34_0 and enable cache snooping if this particular
flag is true.

Link: https://lore.kernel.org/linux-pci/1710166298-27144-2-git-send-email-quic_msarkar@quicinc.com
Signed-off-by: Mrinmay Sarkar <quic_msarkar@quicinc.com>
Signed-off-by: Krzysztof WilczyƄski <kwilczynski@kernel.org>
[bhelgaas: wrap comments to fit in 80 columns]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/pci/controller/dwc/pcie-qcom.c