Skip to content

Commit e3c2ef4

Browse files
committed
Merge tag 'pci-v4.5-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI fixes from Bjorn Helgaas: "Freescale Layerscape host bridge driver: Fix MSG TLP drop setting (Minghuan Lian) TI Keystone host bridge driver: Fix MSI code that retrieves struct pcie_port pointer (Murali Karicheri)" * tag 'pci-v4.5-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: layerscape: Fix MSG TLP drop setting PCI: keystone: Fix MSI code that retrieves struct pcie_port pointer
2 parents c2687cf + 1195c10 commit e3c2ef4

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

drivers/pci/host/pci-keystone-dw.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@
5858

5959
#define to_keystone_pcie(x) container_of(x, struct keystone_pcie, pp)
6060

61-
static inline struct pcie_port *sys_to_pcie(struct pci_sys_data *sys)
62-
{
63-
return sys->private_data;
64-
}
65-
6661
static inline void update_reg_offset_bit_pos(u32 offset, u32 *reg_offset,
6762
u32 *bit_pos)
6863
{
@@ -108,7 +103,7 @@ static void ks_dw_pcie_msi_irq_ack(struct irq_data *d)
108103
struct pcie_port *pp;
109104

110105
msi = irq_data_get_msi_desc(d);
111-
pp = sys_to_pcie(msi_desc_to_pci_sysdata(msi));
106+
pp = (struct pcie_port *) msi_desc_to_pci_sysdata(msi);
112107
ks_pcie = to_keystone_pcie(pp);
113108
offset = d->irq - irq_linear_revmap(pp->irq_domain, 0);
114109
update_reg_offset_bit_pos(offset, &reg_offset, &bit_pos);
@@ -146,7 +141,7 @@ static void ks_dw_pcie_msi_irq_mask(struct irq_data *d)
146141
u32 offset;
147142

148143
msi = irq_data_get_msi_desc(d);
149-
pp = sys_to_pcie(msi_desc_to_pci_sysdata(msi));
144+
pp = (struct pcie_port *) msi_desc_to_pci_sysdata(msi);
150145
ks_pcie = to_keystone_pcie(pp);
151146
offset = d->irq - irq_linear_revmap(pp->irq_domain, 0);
152147

@@ -167,7 +162,7 @@ static void ks_dw_pcie_msi_irq_unmask(struct irq_data *d)
167162
u32 offset;
168163

169164
msi = irq_data_get_msi_desc(d);
170-
pp = sys_to_pcie(msi_desc_to_pci_sysdata(msi));
165+
pp = (struct pcie_port *) msi_desc_to_pci_sysdata(msi);
171166
ks_pcie = to_keystone_pcie(pp);
172167
offset = d->irq - irq_linear_revmap(pp->irq_domain, 0);
173168

drivers/pci/host/pci-layerscape.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ static void ls_pcie_fix_class(struct ls_pcie *pcie)
7777
iowrite16(PCI_CLASS_BRIDGE_PCI, pcie->dbi + PCI_CLASS_DEVICE);
7878
}
7979

80+
/* Drop MSG TLP except for Vendor MSG */
81+
static void ls_pcie_drop_msg_tlp(struct ls_pcie *pcie)
82+
{
83+
u32 val;
84+
85+
val = ioread32(pcie->dbi + PCIE_STRFMR1);
86+
val &= 0xDFFFFFFF;
87+
iowrite32(val, pcie->dbi + PCIE_STRFMR1);
88+
}
89+
8090
static int ls1021_pcie_link_up(struct pcie_port *pp)
8191
{
8292
u32 state;
@@ -97,7 +107,7 @@ static int ls1021_pcie_link_up(struct pcie_port *pp)
97107
static void ls1021_pcie_host_init(struct pcie_port *pp)
98108
{
99109
struct ls_pcie *pcie = to_ls_pcie(pp);
100-
u32 val, index[2];
110+
u32 index[2];
101111

102112
pcie->scfg = syscon_regmap_lookup_by_phandle(pp->dev->of_node,
103113
"fsl,pcie-scfg");
@@ -116,13 +126,7 @@ static void ls1021_pcie_host_init(struct pcie_port *pp)
116126

117127
dw_pcie_setup_rc(pp);
118128

119-
/*
120-
* LS1021A Workaround for internal TKT228622
121-
* to fix the INTx hang issue
122-
*/
123-
val = ioread32(pcie->dbi + PCIE_STRFMR1);
124-
val &= 0xffff;
125-
iowrite32(val, pcie->dbi + PCIE_STRFMR1);
129+
ls_pcie_drop_msg_tlp(pcie);
126130
}
127131

128132
static int ls_pcie_link_up(struct pcie_port *pp)
@@ -147,6 +151,7 @@ static void ls_pcie_host_init(struct pcie_port *pp)
147151
iowrite32(1, pcie->dbi + PCIE_DBI_RO_WR_EN);
148152
ls_pcie_fix_class(pcie);
149153
ls_pcie_clear_multifunction(pcie);
154+
ls_pcie_drop_msg_tlp(pcie);
150155
iowrite32(0, pcie->dbi + PCIE_DBI_RO_WR_EN);
151156
}
152157

0 commit comments

Comments
 (0)