From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9FED9C52D7C for ; Fri, 23 Aug 2024 09:24:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=24J3LwGj3ucClo1k4z1zRF9+mX66KCx2iT9UBQPzfFI=; b=qwjkYSwgg67bGEwAmz60DMbuQI /8joDwCU06DVPS4DEYfwPKvDgvMPPt1YqVYoJmAkoQXTUtjpS0Haul4WBV8cP/LxW4+QqTGZ2jSDY koRKvJWibI+cO74lmWfsXqJL3poIF9d4fj02xsKQ0hR+bR1xmLBfPjPNi7TTt7yJaXrN8jb1XN47y 93y1mhf4JwORf38OZkmGP37XISiLHC/vNA3uiFE9LsgGpZ1vC9bcLoiQgOHr969WyP6Q3MqYTxfOm llnEXLM7YUtf/8bMfBLIqq8Zr/XjCPGeNETtN5o69+xRYbuLaeVbtNXOhvjKo+A9L1r+4Fet6tNi6 Vn0p5TpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shQWP-0000000G5zP-29ux; Fri, 23 Aug 2024 09:23:53 +0000 Received: from galois.linutronix.de ([193.142.43.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shQTv-0000000G5Hg-2vhs for linux-arm-kernel@lists.infradead.org; Fri, 23 Aug 2024 09:21:23 +0000 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1724404877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=24J3LwGj3ucClo1k4z1zRF9+mX66KCx2iT9UBQPzfFI=; b=11mE0MhPyS73Qtfr7TTCrS7Z4g0p0eNOdqFzX3QmOuYLSPD5mlqWonzIfy+eRv6f579jAu YDzv3NJOAP4OTHKrUzP5wrqm5hZZusZS5+Bpl7yTWdNo1SHOFNIDZYtgBEcCJ9KAkyJcgA dJqJk6viK8AKaQoyzhOsbUvAr3Jc+QnWuYg0YFs9BbkdKDSqHHVgoEpnygLyLxTZV9zp4f dujvYKuyJx8gNecofodB94RZUvObJ0lGEfuY7n1mCmhafst0eC8UVXlCxi/pmVF9mJOoRu 64ijTBYPtJa18jvgvSjYPB+psHAMFNpVuJS20c0gQdZT2E6u425asmluCBLS2A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1724404877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=24J3LwGj3ucClo1k4z1zRF9+mX66KCx2iT9UBQPzfFI=; b=+D3i2fTSLgVUDx/Mf1mqkmLWNz+gbMnh0UakGoqO2q7OrLn16gGLKcLJF5mnlxsE0FZDdk FhErrsAxlRbACkAA== To: Maxime Chevallier , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Russell King Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Thomas Petazzoni Subject: Re: Regression on Macchiatobin from the irqchip driver In-Reply-To: <20240821165034.1af97bad@fedora-3.home> References: <20240821165034.1af97bad@fedora-3.home> Date: Fri, 23 Aug 2024 11:21:16 +0200 Message-ID: <87frqvh9wz.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_022119_902460_7A9ED025 X-CRM114-Status: GOOD ( 19.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Aug 21 2024 at 16:50, Maxime Chevallier wrote: > By looking at the msi_lib_irq_domain_select() implementation however, I > notice that it appears to be expected that these ops can be NULL by > looking at the check in the return line : > > return ops && !!(ops->bus_select_mask & busmask); > > However, the line above dereferences the ops pointer without prior > check : > > /* Handle pure domain searches */ > if (bus_token == ops->bus_select_token) > return 1; Oops. > As I said, this area of the kernel isn't very familiar to me, but I got > my board to boot with the following patch : > > --- a/drivers/irqchip/irq-msi-lib.c > +++ b/drivers/irqchip/irq-msi-lib.c > @@ -128,6 +128,9 @@ int msi_lib_irq_domain_select(struct irq_domain *d, struct irq_fwspec *fwspec, > const struct msi_parent_ops *ops = d->msi_parent_ops; > u32 busmask = BIT(bus_token); > > + if (!ops) > + return 0; > + > if (fwspec->fwnode != d->fwnode || fwspec->param_count != 0) > return 0; > > @@ -135,6 +138,6 @@ int msi_lib_irq_domain_select(struct irq_domain *d, struct irq_fwspec *fwspec, > if (bus_token == ops->bus_select_token) > return 1; > > - return ops && !!(ops->bus_select_mask & busmask); > + return !!(ops->bus_select_mask & busmask); > > ---------------------------- > > I have zero confidence that this is the correct solution to the issue > so feel free to ditch that solution :) I'll gladly test any > patch for that on the MCBIN. It obviously is the proper solution check after use is pretty pointless as you demonstrated. Care to send a proper patch? Thanks, tglx