|
73 | 73 | #define RZG3S_PCI_PINTRCVIE_INTX(i) BIT(i) |
74 | 74 | #define RZG3S_PCI_PINTRCVIE_MSI BIT(4) |
75 | 75 |
|
| 76 | +/* Register is R/W1C, it doesn't require locking. */ |
76 | 77 | #define RZG3S_PCI_PINTRCVIS 0x114 |
77 | 78 | #define RZG3S_PCI_PINTRCVIS_INTX(i) BIT(i) |
78 | 79 | #define RZG3S_PCI_PINTRCVIS_MSI BIT(4) |
|
114 | 115 | #define RZG3S_PCI_MSIRE_ENA BIT(0) |
115 | 116 |
|
116 | 117 | #define RZG3S_PCI_MSIRM(id) (0x608 + (id) * 0x10) |
| 118 | + |
| 119 | +/* Register is R/W1C, it doesn't require locking. */ |
117 | 120 | #define RZG3S_PCI_MSIRS(id) (0x60c + (id) * 0x10) |
118 | 121 |
|
119 | 122 | #define RZG3S_PCI_AWBASEL(id) (0x1000 + (id) * 0x20) |
@@ -439,28 +442,9 @@ static void __iomem *rzg3s_pcie_root_map_bus(struct pci_bus *bus, |
439 | 442 | return host->pcie + where; |
440 | 443 | } |
441 | 444 |
|
442 | | -/* Serialized by 'pci_lock' */ |
443 | | -static int rzg3s_pcie_root_write(struct pci_bus *bus, unsigned int devfn, |
444 | | - int where, int size, u32 val) |
445 | | -{ |
446 | | - struct rzg3s_pcie_host *host = bus->sysdata; |
447 | | - int ret; |
448 | | - |
449 | | - /* Enable access control to the CFGU */ |
450 | | - writel_relaxed(RZG3S_PCI_PERM_CFG_HWINIT_EN, |
451 | | - host->axi + RZG3S_PCI_PERM); |
452 | | - |
453 | | - ret = pci_generic_config_write(bus, devfn, where, size, val); |
454 | | - |
455 | | - /* Disable access control to the CFGU */ |
456 | | - writel_relaxed(0, host->axi + RZG3S_PCI_PERM); |
457 | | - |
458 | | - return ret; |
459 | | -} |
460 | | - |
461 | 445 | static struct pci_ops rzg3s_pcie_root_ops = { |
462 | 446 | .read = pci_generic_config_read, |
463 | | - .write = rzg3s_pcie_root_write, |
| 447 | + .write = pci_generic_config_write, |
464 | 448 | .map_bus = rzg3s_pcie_root_map_bus, |
465 | 449 | }; |
466 | 450 |
|
@@ -526,8 +510,6 @@ static void rzg3s_pcie_msi_irq_ack(struct irq_data *d) |
526 | 510 | u8 reg_bit = d->hwirq % RZG3S_PCI_MSI_INT_PER_REG; |
527 | 511 | u8 reg_id = d->hwirq / RZG3S_PCI_MSI_INT_PER_REG; |
528 | 512 |
|
529 | | - guard(raw_spinlock_irqsave)(&host->hw_lock); |
530 | | - |
531 | 513 | writel_relaxed(BIT(reg_bit), host->axi + RZG3S_PCI_MSIRS(reg_id)); |
532 | 514 | } |
533 | 515 |
|
@@ -859,8 +841,6 @@ static void rzg3s_pcie_intx_irq_ack(struct irq_data *d) |
859 | 841 | { |
860 | 842 | struct rzg3s_pcie_host *host = irq_data_get_irq_chip_data(d); |
861 | 843 |
|
862 | | - guard(raw_spinlock_irqsave)(&host->hw_lock); |
863 | | - |
864 | 844 | rzg3s_pcie_update_bits(host->axi, RZG3S_PCI_PINTRCVIS, |
865 | 845 | RZG3S_PCI_PINTRCVIS_INTX(d->hwirq), |
866 | 846 | RZG3S_PCI_PINTRCVIS_INTX(d->hwirq)); |
@@ -1065,14 +1045,14 @@ static int rzg3s_pcie_config_init(struct rzg3s_pcie_host *host) |
1065 | 1045 | writel_relaxed(0xffffffff, host->pcie + RZG3S_PCI_CFG_BARMSK00L); |
1066 | 1046 | writel_relaxed(0xffffffff, host->pcie + RZG3S_PCI_CFG_BARMSK00U); |
1067 | 1047 |
|
| 1048 | + /* Disable access control to the CFGU */ |
| 1049 | + writel_relaxed(0, host->axi + RZG3S_PCI_PERM); |
| 1050 | + |
1068 | 1051 | /* Update bus info */ |
1069 | 1052 | writeb_relaxed(primary_bus, host->pcie + PCI_PRIMARY_BUS); |
1070 | 1053 | writeb_relaxed(secondary_bus, host->pcie + PCI_SECONDARY_BUS); |
1071 | 1054 | writeb_relaxed(subordinate_bus, host->pcie + PCI_SUBORDINATE_BUS); |
1072 | 1055 |
|
1073 | | - /* Disable access control to the CFGU */ |
1074 | | - writel_relaxed(0, host->axi + RZG3S_PCI_PERM); |
1075 | | - |
1076 | 1056 | return 0; |
1077 | 1057 | } |
1078 | 1058 |
|
@@ -1162,7 +1142,8 @@ static int rzg3s_pcie_resets_prepare_and_get(struct rzg3s_pcie_host *host) |
1162 | 1142 |
|
1163 | 1143 | static int rzg3s_pcie_host_parse_port(struct rzg3s_pcie_host *host) |
1164 | 1144 | { |
1165 | | - struct device_node *of_port = of_get_next_child(host->dev->of_node, NULL); |
| 1145 | + struct device_node *of_port __free(device_node) = |
| 1146 | + of_get_next_child(host->dev->of_node, NULL); |
1166 | 1147 | struct rzg3s_pcie_port *port = &host->port; |
1167 | 1148 | int ret; |
1168 | 1149 |
|
|
0 commit comments