mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 06:09:23 -04:00
pci: pci-msm-msi: Update the msi address size
Some targets need to set the MSI address size same as the PCIe data size(bytes) that PCIe core will halt for each write transaction. Hence add a property to pass the exponent (base 2) value for the size. Not setting this value same as PCIe core write halt size results into a deadlock on system bus. Change-Id: Ic94bb9330ac0a78ab273991d786fa2233f9383a6 Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
This commit is contained in:
parent
1c0ece4496
commit
ee19c29dea
1 changed files with 9 additions and 1 deletions
|
|
@ -28,6 +28,7 @@ struct msm_msi {
|
|||
struct irq_domain *inner_domain; /* parent domain; gen irq related */
|
||||
struct irq_domain *msi_domain; /* child domain; pci related */
|
||||
phys_addr_t msi_addr;
|
||||
u32 msi_addr_size;
|
||||
};
|
||||
|
||||
/* structure for each client of MSI controller */
|
||||
|
|
@ -106,7 +107,7 @@ static int msm_msi_domain_prepare(struct irq_domain *domain, struct device *dev,
|
|||
client->msi = msi;
|
||||
client->dev = dev;
|
||||
client->msi_addr = dma_map_resource(client->dev, msi->msi_addr,
|
||||
PAGE_SIZE, DMA_FROM_DEVICE, 0);
|
||||
msi->msi_addr_size, DMA_FROM_DEVICE, 0);
|
||||
if (dma_mapping_error(client->dev, client->msi_addr)) {
|
||||
dev_err(msi->dev, "MSI: failed to map msi address\n");
|
||||
client->msi_addr = 0;
|
||||
|
|
@ -322,6 +323,7 @@ int msm_msi_init(struct device *dev)
|
|||
struct device_node *of_node;
|
||||
const __be32 *prop_val;
|
||||
struct of_phandle_args irq;
|
||||
u32 size_exp = 0;
|
||||
|
||||
if (!dev->of_node) {
|
||||
dev_err(dev, "MSI: missing DT node\n");
|
||||
|
|
@ -370,6 +372,12 @@ int msm_msi_init(struct device *dev)
|
|||
goto err;
|
||||
}
|
||||
|
||||
of_property_read_u32(of_node, "qcom,msi-addr-size-exp", &size_exp);
|
||||
|
||||
size_exp = (size_exp > PAGE_SHIFT) ? size_exp : PAGE_SHIFT;
|
||||
|
||||
msi->msi_addr_size = 1 << size_exp;
|
||||
|
||||
while (of_irq_parse_one(msi->of_node, msi->nr_irqs, &irq) == 0)
|
||||
msi->nr_irqs++;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue