From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32E0A385CAA for ; Tue, 16 Dec 2025 12:52:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765889563; cv=none; b=Xt9Du8vT5+vRvkNgHVlZdHybtv2dMam8gLdZ0aTxndSROQf9JjFwIViSdVxURdQ/KM66z2Z3/7LsAGyaWv0NncoV9ILPQhOLanUzbOWSEsQ7rRgRYP5KEGlHBiptZ5/q6oFzK115iAbTBkSL2cIqhOgaJ++Sn/aNvmT2gY0DJis= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765889563; c=relaxed/simple; bh=0j7urbOJvWg/AIYQWGTuPxNStPUnPR1+WoiIVCRuWsQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RkvDxToz+8q42Pv7DBL30PcgdbVsjst1iKCHF/tTpzDrLilq83fX5mCKFlFSoOCTArvORdrlmkzSTs2h0hX9kUtL7Ok5jP4GAOw8AU7U62LOL5Ca4ICkDZDDBr8g4a46b3X2nCisTgKmz1+HYrpI84MITOqWR9ga+Azl9otWOlE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 50E6CFEC for ; Tue, 16 Dec 2025 04:52:34 -0800 (PST) Received: from e142607.local (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3DBEF3F73B for ; Tue, 16 Dec 2025 04:52:41 -0800 (PST) Date: Tue, 16 Dec 2025 12:51:53 +0000 From: Liviu Dudau To: Karunika Choo Cc: dri-devel@lists.freedesktop.org, nd@arm.com, Boris Brezillon , Steven Price , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , linux-kernel@vger.kernel.org, aishwarya.tcv@arm.com Subject: Re: [PATCH] drm/panthor: Fix NULL pointer dereference on panthor_fw_unplug Message-ID: References: <20251215203312.1084182-1-karunika.choo@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20251215203312.1084182-1-karunika.choo@arm.com> On Mon, Dec 15, 2025 at 08:33:12PM +0000, Karunika Choo wrote: > This patch removes the MCU halt and wait for halt procedures during > panthor_fw_unplug() as the MCU can be in a variety of states or the FW > may not even be loaded/initialized at all, the latter of which can lead > to a NULL pointer dereference. > > It should be safe on unplug to just disable the MCU without waiting for > it to halt as it may not be able to. > > Fixes: 514072549865 ("drm/panthor: Support GLB_REQ.STATE field for Mali-G1 GPUs") > Suggested-by: Boris Brezillon > Signed-off-by: Karunika Choo Reviewed-by: Liviu Dudau Best regards, Liviu > --- > drivers/gpu/drm/panthor/panthor_fw.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c > index 4beaa589ba66..a64ec8756bed 100644 > --- a/drivers/gpu/drm/panthor/panthor_fw.c > +++ b/drivers/gpu/drm/panthor/panthor_fw.c > @@ -1261,10 +1261,6 @@ void panthor_fw_unplug(struct panthor_device *ptdev) > if (ptdev->fw->irq.irq) > panthor_job_irq_suspend(&ptdev->fw->irq); > > - panthor_fw_halt_mcu(ptdev); > - if (!panthor_fw_wait_mcu_halted(ptdev)) > - drm_warn(&ptdev->base, "Failed to halt MCU on unplug"); > - > panthor_fw_stop(ptdev); > } > > -- > 2.49.0 >