To ensure successive interrupts upon packet reception, it is necessary to clear the remote IRR bit by writing the interrupt number to the EOI register. The base address for this operation is provided by the BIOS and retrieved by the driver by traversing the ASF object's namespace. Co-developed-by: Sanket Goswami <Sanket.Goswami@xxxxxxx> Signed-off-by: Sanket Goswami <Sanket.Goswami@xxxxxxx> Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@xxxxxxx> --- drivers/i2c/busses/i2c-amd-asf-plat.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/i2c/busses/i2c-amd-asf-plat.c b/drivers/i2c/busses/i2c-amd-asf-plat.c index 65904fa895dd..c1b1846dd2b0 100644 --- a/drivers/i2c/busses/i2c-amd-asf-plat.c +++ b/drivers/i2c/busses/i2c-amd-asf-plat.c @@ -40,6 +40,7 @@ static const char *amd_asf_port_name = " port 1"; struct amd_asf_dev { + void __iomem *eoi_base; struct device *dev; struct i2c_adapter adap; struct i2c_client *target; @@ -288,11 +289,13 @@ static irqreturn_t amd_asf_irq_handler(int irq, void *ptr) amd_asf_update_bits(piix4_smba, ASF_SLV_INTR, SMBHSTSTS, true); } + iowrite32(irq, dev->eoi_base); return IRQ_HANDLED; } static int amd_asf_probe(struct platform_device *pdev) { + resource_size_t eoi_addr, eoi_sz; struct resource_entry *rentry; struct amd_asf_dev *asf_dev; struct acpi_device *adev; @@ -327,6 +330,10 @@ static int amd_asf_probe(struct platform_device *pdev) case IORESOURCE_IRQ: irq = rentry->res->start; break; + case IORESOURCE_MEM: + eoi_addr = rentry->res->start; + eoi_sz = resource_size(rentry->res); + break; default: dev_warn(&adev->dev, "Invalid ASF resource\n"); break; @@ -346,6 +353,10 @@ static int amd_asf_probe(struct platform_device *pdev) if (ret) return dev_err_probe(&pdev->dev, ret, "Unable to request irq: %d for use\n", irq); + asf_dev->eoi_base = devm_ioremap(&pdev->dev, eoi_addr, eoi_sz); + if (!asf_dev->eoi_base) + return dev_err_probe(&pdev->dev, -ENOMEM, "Invalid remapped address\n"); + i2c_set_adapdata(&asf_dev->adap, asf_dev); ret = i2c_add_adapter(&asf_dev->adap); if (ret) { -- 2.25.1