Skip to content

Commit 62d4911

Browse files
claudiubezneaMani-Sadhasivam
authored andcommitted
PCI: rzg3s-host: Drop the lock on RZG3S_PCI_MSIRS and RZG3S_PCI_PINTRCVIS
The RZG3S_PCI_MSIRS and RZG3S_PCI_PINTRCVIS registers are of the R/W1C type. According to the RZ/G3S HW Manual, Rev. 1.10, chapter 34.2.1 Register Type, R/W1C register bits are cleared to 0b by writing 1b, while writing 0b has no effect. Therefore, there is no need to take a lock around writes to these registers. Drop the locking. Along with this, add a note about the R/W1C register type to the register offset definitions. Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Signed-off-by: Manivannan Sadhasivam <mani@kernel.org> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://patch.msgid.link/20251217111510.138848-3-claudiu.beznea.uj@bp.renesas.com
1 parent 4b86eff commit 62d4911

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

drivers/pci/controller/pcie-rzg3s-host.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
#define RZG3S_PCI_PINTRCVIE_INTX(i) BIT(i)
7474
#define RZG3S_PCI_PINTRCVIE_MSI BIT(4)
7575

76+
/* Register is R/W1C, it doesn't require locking. */
7677
#define RZG3S_PCI_PINTRCVIS 0x114
7778
#define RZG3S_PCI_PINTRCVIS_INTX(i) BIT(i)
7879
#define RZG3S_PCI_PINTRCVIS_MSI BIT(4)
@@ -114,6 +115,8 @@
114115
#define RZG3S_PCI_MSIRE_ENA BIT(0)
115116

116117
#define RZG3S_PCI_MSIRM(id) (0x608 + (id) * 0x10)
118+
119+
/* Register is R/W1C, it doesn't require locking. */
117120
#define RZG3S_PCI_MSIRS(id) (0x60c + (id) * 0x10)
118121

119122
#define RZG3S_PCI_AWBASEL(id) (0x1000 + (id) * 0x20)
@@ -507,8 +510,6 @@ static void rzg3s_pcie_msi_irq_ack(struct irq_data *d)
507510
u8 reg_bit = d->hwirq % RZG3S_PCI_MSI_INT_PER_REG;
508511
u8 reg_id = d->hwirq / RZG3S_PCI_MSI_INT_PER_REG;
509512

510-
guard(raw_spinlock_irqsave)(&host->hw_lock);
511-
512513
writel_relaxed(BIT(reg_bit), host->axi + RZG3S_PCI_MSIRS(reg_id));
513514
}
514515

@@ -840,8 +841,6 @@ static void rzg3s_pcie_intx_irq_ack(struct irq_data *d)
840841
{
841842
struct rzg3s_pcie_host *host = irq_data_get_irq_chip_data(d);
842843

843-
guard(raw_spinlock_irqsave)(&host->hw_lock);
844-
845844
rzg3s_pcie_update_bits(host->axi, RZG3S_PCI_PINTRCVIS,
846845
RZG3S_PCI_PINTRCVIS_INTX(d->hwirq),
847846
RZG3S_PCI_PINTRCVIS_INTX(d->hwirq));

0 commit comments

Comments
 (0)