From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796137643; b=pokKKRAjRxtgGDJBuk6eT8uYbHV+Bn06ZcH1Woi9gMASgOn+CewDnyhPBdXoshFLf1sT vDjDrTEpOlRAW0G3bnUJQqK4NPSBVtEMi7Er8y0uXMd5VaqxZDvm3oCPx318wCIUSL7AU IxHguZBtVpIKFVhEOpmyo+8iINUlkZu/gzk7oC4A283ulNSWJXozjS1hRsUexhLaZBpP9 ymQtTj1yVvLDmSUEIFFV7nR2Sy046hciShIgOlJjP05fG3rh/asU0BoGdOdkKW6wBeEM3 1Eg6Y7SQIoYnMRL6K0DdRQVBQ6MVZtACx3soV8SFTUkkLDnjE2cwqV24gtwJEKc6IPw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796137643; h=Received:DKIM-Signature:From:To:Cc:Subject:In-Reply-To:References: Date:Message-ID:MIME-Version:Content-Type; bh=SA/sWuOKULfiPOgWxRyjv/XO5RLQc0w/bfESA5OazxQ=; b=uFbDk3x/8l2ffzE8mMDKYIRD78TrHX8uTsOOoUCeqT64VXj20U52r46djuH5OVfZg9Fu H+9RBjdQdWoxoE715iAFsyC5yEPaykxzfuIenJuZ0PUeNLZjdDq5tpah667SVGYEpqR0X CTmiQ4VEODO5WQuWhhZQh9QnMZq9FCMQJ7mnV8LJiuNZHc7gJpCSxrFxURAP7lVNvgTZX 0pX8KiENDWwDqNLmY4mTxU2Td8aMfMqBKk9VUTcHqc/0C+2gwDkjwswWu6l7z+xBuUC/e HF4HNAlSH22ZvC0hrU431MKDcS2Id49IUlYDs7F0kBY/6OWIGIz5YyZvZThjYidfXjg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DPIUMTOo; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B37E606A31A; Tue, 1 Dec 2026 15:07:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DPIUMTOo Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A4121F000C1; Tue, 1 Dec 2026 15:07:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796137643; bh=SA/sWuOKULfiPOgWxRyjv/XO5RLQc0w/bfESA5OazxQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=DPIUMTOoplSCIpwhA6A2iXY6jA/wFU+nAb1/vi90k2epTDC6ZJ+COdOyImUraki7u 67iK8l1BHKA+it0qO3KGvIjAlvzrdUVr6EaehwYLO28wp0mKOk+yNIx63M995XYqYd apG9RSkXcqe8+YDVzTmgftVvB0BOP/+Oyk0dzLQN74tt3aDFPW307XQYiX5IcjgWxu 3SvLIK4Y62M6/ucM5nIO8KK/B8ukqIQ7bYnIjDZz3u4BhSeaHT7iDAvahQzm3jw7LS tQ0mbo9D4K2NR/scfhxe/KCA42tMIkP3Uu2opzr5FoprjbCFU2hYkzYvIwdcwO1wnQ qeW/v+S0HogLw== From: Thomas Gleixner To: Gregory CLEMENT , Vladimir Kondratiev , =?utf-8?Q?Beno=C3=AEt?= Monin , =?utf-8?Q?Th=C3=A9o?= Lebrun , Radu Rendec , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thomas Bogendoerfer Cc: Thomas Petazzoni , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Gregory CLEMENT Subject: Re: [PATCH v4 2/5] irqchip: irq-eyeq5-msi: add EyeQ5 PCIe MSI controller driver In-Reply-To: <20261116-eyeq5_msi-v4-2-2e1233b014b0@bootlin.com> References: <20261116-eyeq5_msi-v4-0-2e1233b014b0@bootlin.com> <20261116-eyeq5_msi-v4-2-2e1233b014b0@bootlin.com> Date: Tue, 01 Dec 2026 16:07:19 +0100 Message-ID: <87y0a9ox94.ffs@fw13> X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain On Mon, Nov 16 2026 at 14:58, Gregory CLEMENT wrote: > +static void eyeq_msi_isr(struct irq_desc *desc) > +{ > + struct irq_chip *parent_chip = irq_desc_get_chip(desc); > + struct eyeq_msi *msi = irq_desc_get_handler_data(desc); > + void __iomem *status_reg; > + unsigned long pending; > + unsigned int bit; Please put the variables into the scope in which they are actually used. > + > + guard_chained_irq(parent_chip, desc); > + > + status_reg = msi->gcsr_base + GCSR_IRQSTATUS; > + > + while (true) { > + pending = FIELD_GET(GCSR_IRQSTATUS_MASK, readw(status_reg)); > + if (!pending) > + break; > + > + /* > + * Write-one-to-clear status register. > + */ > + writew(FIELD_PREP(GCSR_IRQSTATUS_MASK, pending), status_reg); > + > + for_each_set_bit(bit, &pending, EYEQ_MSI_MAX_VECTORS) { > + if (!generic_handle_demux_domain_irq(msi->msi_domain, bit)) > + pr_err_ratelimited("unmapped MSI interrupt %u\n", bit); > + } > + } How is this supposed to work in a situation where the driver invokes disable_irq() for one of those interrupts? disable_irq() defaults to lazy disable, which means the interrupt is not masked in hardware. So if an interrupt is raised by the device after the lazy disable, then the edge handler will mask it and set the pending bit. enable_irq() will then unmask and observe the pending bit and tries to resend the interrupt by walking the hierarchy to find a chip with a irq_retrigger() callback. If that's not available then it falls back to software resend, which requires CONFIG_HARDIRQS_SW_RESEND=y. That's not set by the mobileye platform. (It's only selected by BMIPS_GENERIC). So in that case the interrupt is lost because from a device POV edge interrupts are fire and forget. You can't fix that by marking the chip with DISABLE_UNLAZY either because the interrupt might be pending and cleared on a different CPU right before the mask write hits the hardware. The handler then runs into the same situation as with the lazy masking. So either you can retrigger or you need to use software resend to handle this. > +} > +static int eyeq_msi_probe(struct platform_device *pdev, struct device_node *parent) > +{ > + struct device_node *node = pdev->dev.of_node; > + struct eyeq_msi *msi; > + bool is_rc; > + int ret; > + > + msi = devm_kzalloc(&pdev->dev, sizeof(*msi), GFP_KERNEL); > + if (!msi) > + return -ENOMEM; > + > + raw_spin_lock_init(&msi->lock); > + bitmap_zero(msi->used, EYEQ_MSI_MAX_VECTORS); > + msi->irq = -1; > + > + msi->gcsr_base = of_iomap(node, 0); devm_of_iomap() ? > + if (!msi->gcsr_base) { > + pr_err("failed to map GCSR registers\n"); > + return -ENOMEM; > + } > + > + msi->msi_base = of_iomap(node, 1); Ditto Thanks, tglx