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 13D803DF019 for ; Fri, 26 Jun 2026 09:13:21 +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=1782465203; cv=none; b=VTVcvHAvEzk3Hhooj4/mkT7GwIcGwIux9g5zcN+d5zScQQvWsO023yp/3S+Z/oaMf5qY4cK/IhLlOhELMRYxAOO7VpXLQ6zc40CqyTHPZQfByGWI/evVo2UvHQCIMdbfg69v9EFSoFVr7teQ1auQOiJ/duGd8UT6I4QnMIzfbzs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782465203; c=relaxed/simple; bh=mHqoRBqCubvAn4NQxEzT9fZCFvPwJirqUm1aU7D11N4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=c26RZ89SC5hJIJr8rOBEet8ZZhGEQroLWZc2Uo8fiHJ4qvGtq3iWIReArq8ffXG8+oK1auNZVa4CGAfR5tlJ3Rv9EAynfezUsTgpZ3scZu8DcH6JyYzJGCAxcTBvAzKrZImKf72+x5fNI4u2czV/S8fl1UyEPc3E22sxQZyufEo= 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; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=oq/9K1hx; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="oq/9K1hx" 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 E51511655 for ; Fri, 26 Jun 2026 02:13:16 -0700 (PDT) Received: from [192.168.0.1] (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 417383F836 for ; Fri, 26 Jun 2026 02:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1782465201; bh=mHqoRBqCubvAn4NQxEzT9fZCFvPwJirqUm1aU7D11N4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oq/9K1hx58tck0PN8mUB6/xQdC9FD3RPAXbTHjMtmG8SXfauVnzQOqixG665EFHqi hVTWprFfejorS4V1R0i5+It6vgf1pyTUCfmwV++71p3WadCPhkr8+j5NMPPU4RN6u4 g03rENZYPEVsi1IjklmozDSNW41m9SURtjA+T2oE= Date: Fri, 26 Jun 2026 10:13:09 +0100 From: Liviu Dudau To: Boris Brezillon Cc: Steven Price , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Nicolas Frattaroli , Chia-I Wu , Karunika Choo , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, sashiko-bot@kernel.org Subject: Re: [PATCH 02/11] drm/panthor: Keep the reset work disabled until everything is initialized Message-ID: References: <20260625-panthor-misc-fixes-v1-0-b67ed973fea6@collabora.com> <20260625-panthor-misc-fixes-v1-2-b67ed973fea6@collabora.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 Content-Transfer-Encoding: 8bit In-Reply-To: <20260625-panthor-misc-fixes-v1-2-b67ed973fea6@collabora.com> On Thu, Jun 25, 2026 at 02:40:28PM +0200, Boris Brezillon wrote: > The reset work will sub-component reset helpers, which might not be > ready if the reset happens during initialization, leading to NULL > pointer dereferences or worse. > > Avoid that by keeping the reset work disabled while we're initializing > those sub-components. > > Fixes: 5fe909cae118 ("drm/panthor: Add the device logical block") > Reported-by: sashiko-bot@kernel.org > Closes: https://sashiko.dev/#/patchset/20260625-panthor-signal-from-irq-v5-0-8836a74e0ef9@collabora.com?part=4 > Signed-off-by: Boris Brezillon Reviewed-by: Liviu Dudau Best regards, Liviu > --- > drivers/gpu/drm/panthor/panthor_device.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/gpu/drm/panthor/panthor_device.c b/drivers/gpu/drm/panthor/panthor_device.c > index bd417d6ae8c0..0b25abebb803 100644 > --- a/drivers/gpu/drm/panthor/panthor_device.c > +++ b/drivers/gpu/drm/panthor/panthor_device.c > @@ -207,6 +207,7 @@ int panthor_device_init(struct panthor_device *ptdev) > *dummy_page_virt = 1; > > INIT_WORK(&ptdev->reset.work, panthor_device_reset_work); > + disable_work(&ptdev->reset.work); > ptdev->reset.wq = alloc_ordered_workqueue("panthor-reset-wq", 0); > if (!ptdev->reset.wq) > return -ENOMEM; > @@ -285,6 +286,9 @@ int panthor_device_init(struct panthor_device *ptdev) > > panthor_gem_init(ptdev); > > + /* Now that everything is initialized, we can enable the reset work. */ > + enable_work(&ptdev->reset.work); > + > /* ~3 frames */ > pm_runtime_set_autosuspend_delay(ptdev->base.dev, 50); > pm_runtime_use_autosuspend(ptdev->base.dev); > > -- > 2.54.0 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯