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 F220731E83E for ; Thu, 14 May 2026 15:23:27 +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=1778772210; cv=none; b=UvzDs0ftm5d2OlraIEBt8lKt2u4+JnSWpYg1rhzWYTH568ErQ5+lcyDxIxqLk3lwMl6iDUJ+v4tIV2azthWibgyQZLMjl7bjOfly3Ku3WCMUDm0Y1gOM+HYDLUJDauvkjaLNV6OqInnEMd8w5FSRkSWccAbl5oqFvwtfFSgIwqk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778772210; c=relaxed/simple; bh=69LAz44gXqc4NIyDtpSy///c51rYIp3PaLqICN+TdLA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=dV2rTU5cHaLr/BdE1PgcY8QZcUOP13DRvbsesygp9/yPAM+zVlvSiNiild0WOhGreZ4oys1m4fRx+0E4krhD/km9Dj0HPNZ7Rd7ZLfIOHpoOFNBAuuDeCS426Tjm2eM+w8mMDp1ccOy3IJBQrW5R2Le8lhKpBHNBGTHnqYXHAdY= 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=anD7SvoD; 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="anD7SvoD" 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 162A21655; Thu, 14 May 2026 08:23:22 -0700 (PDT) Received: from [10.1.37.28] (e122027.cambridge.arm.com [10.1.37.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8F7D23F836; Thu, 14 May 2026 08:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1778772207; bh=69LAz44gXqc4NIyDtpSy///c51rYIp3PaLqICN+TdLA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=anD7SvoDWSwk/qlgZM/tkS6/ZxmRPeISNNt9sZED/edYJ1MQnY1nnpZqltSdCS/gr GzOY7q1MDSVdfERcDG6VdBkUrTMCFWL0qcqxV1ISsbWzF3ohuXfEeu9xjyi7yhBsND Dc/6ce+TYubrBOD71iWguGbdff0U9WIYqh5yIPtM= Message-ID: Date: Thu, 14 May 2026 16:23:23 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 09/11] drm/panthor: Process FW events in IRQ context To: Boris Brezillon , Liviu Dudau Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20260512-panthor-signal-from-irq-v2-0-95c614a739cb@collabora.com> <20260512-panthor-signal-from-irq-v2-9-95c614a739cb@collabora.com> From: Steven Price Content-Language: en-GB In-Reply-To: <20260512-panthor-signal-from-irq-v2-9-95c614a739cb@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/05/2026 12:37, Boris Brezillon wrote: > Now that everything is set to allow processing FW events in IRQ context, > go for it. This should reduce the dma_fence signaling latency. > > Signed-off-by: Boris Brezillon Reviewed-by: Steven Price > --- > drivers/gpu/drm/panthor/panthor_fw.c | 27 +++++++++++++++++++++++---- > 1 file changed, 23 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c > index f5e0ceca4130..8cfebf180de7 100644 > --- a/drivers/gpu/drm/panthor/panthor_fw.c > +++ b/drivers/gpu/drm/panthor/panthor_fw.c > @@ -1087,9 +1087,29 @@ static void panthor_job_irq_handler(struct panthor_irq *pirq, u32 status) > } > } > > -static irqreturn_t panthor_job_irq_threaded_handler(int irq, void *data) > +static irqreturn_t panthor_job_irq_raw_handler(int irq, void *data) > { > - return panthor_irq_default_threaded_handler(data, panthor_job_irq_handler); > + struct panthor_irq *pirq = data; > + > + if (!gpu_read(pirq->iomem, INT_STAT)) > + return IRQ_NONE; > + > + scoped_guard(spinlock_irqsave, &pirq->mask_lock) { > + if (pirq->state != PANTHOR_IRQ_STATE_ACTIVE) > + return IRQ_NONE; > + > + pirq->state = PANTHOR_IRQ_STATE_PROCESSING; > + } > + > + /* We can use INT_STAT here, because we didn't mask the IRQs. */ > + panthor_job_irq_handler(pirq, gpu_read(pirq->iomem, INT_STAT)); > + > + scoped_guard(spinlock_irqsave, &pirq->mask_lock) { > + if (pirq->state == PANTHOR_IRQ_STATE_PROCESSING) > + pirq->state = PANTHOR_IRQ_STATE_ACTIVE; > + } > + > + return IRQ_HANDLED; > } > > static int panthor_fw_start(struct panthor_device *ptdev) > @@ -1489,8 +1509,7 @@ int panthor_fw_init(struct panthor_device *ptdev) > > ret = panthor_irq_request(ptdev, &fw->irq, irq, 0, > ptdev->iomem + JOB_INT_BASE, "job", > - panthor_irq_default_raw_handler, > - panthor_job_irq_threaded_handler); > + panthor_job_irq_raw_handler, NULL); > if (ret) { > drm_err(&ptdev->base, "failed to request job irq"); > return ret; >