From nobody Tue Nov 26 06:46:43 2024 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55F9C1FA27C for ; Mon, 21 Oct 2024 14:08:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729519712; cv=none; b=GLrkvmhjUBsSrVOrblbJVTTS7coRMbC3a7cnJLAN1rFcXave790jy9zlWPTzCLD+gDPXLycbd9CVdy17FLty2zJ0bvEwP+UkxX9k0TeyY9XVC6N+2SVac68SF9I6fsQlC1jJhLLVRGXkbh9kPjsq9d4fiHzfg/bWoJNRUGyv8Ww= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729519712; c=relaxed/simple; bh=jpnOTkj0fNXVQ3yCGYsDhuDxmQz1B6JkpFLaV5xXSec=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aIzt9C0vzfvw2bby48YxFXHiyDBPdkE6dJcOAbDRBX6ffRDIYiGB57aMCYkZkcGNmlpVhhXt8usOyclaW/76Z4SmBVkqeCToCueMftaHKwlzMHSlwMYK2C4JgvUfuZZ/RGgF4TKN+b5JCdywsUDX7mE0CfFXXnfd+j/Y4u4mEyM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=aykD1+wt; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="aykD1+wt" Received: from [127.0.1.1] (91-157-155-49.elisa-laajakaista.fi [91.157.155.49]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3A12E1A42; Mon, 21 Oct 2024 16:06:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1729519595; bh=jpnOTkj0fNXVQ3yCGYsDhuDxmQz1B6JkpFLaV5xXSec=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=aykD1+wt8oby67aKd/vaulNKzqy7EPtkzQ4YMfPCB/SrjmHdrZbijZDI4humbwkln 8nWDkqwesIbYovnixKBbgXyG0vSJP7Ax8DRxL1yEgt1kUGoyCNJ5hkuMWvtv9NWgtH X+/Vmjmo2Scyu5m0m01HPvm14+DwhIAAsbGm2+3o= From: Tomi Valkeinen Date: Mon, 21 Oct 2024 17:07:51 +0300 Subject: [PATCH 7/7] drm/tidss: Rename 'wait_lock' to 'irq_lock' 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-Transfer-Encoding: quoted-printable Message-Id: <20241021-tidss-irq-fix-v1-7-82ddaec94e4a@ideasonboard.com> References: <20241021-tidss-irq-fix-v1-0-82ddaec94e4a@ideasonboard.com> In-Reply-To: <20241021-tidss-irq-fix-v1-0-82ddaec94e4a@ideasonboard.com> To: Devarsh Thakkar , Jyri Sarha Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jonathan Cormier , Tomi Valkeinen X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4886; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=jpnOTkj0fNXVQ3yCGYsDhuDxmQz1B6JkpFLaV5xXSec=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBnFmBOko8rk+qt7zvORjAV6I1uMYTrQb18qr0eW sWkT9HwM4CJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZxZgTgAKCRD6PaqMvJYe 9U68D/0eolU7amxwxfeLI2ElMHOnplqY+Z42Bf4cHt1sCvjG7FTh1apr/vprUD/a1xxIaBXp0Nj Otf6Vh6nvmOFj4TJt7y9Oh7wYyYr2x7nilhKZoVvIg7MGdN+M/LX6JR1u/Jf7SJaw9hkcm66Vwt XTDgUoAT0bIGURsdSFcrPeirXn4pddVevssWUqwUrTHOF3RcupAOyMmAEGARW8mL76Eb86Oi54S cLjqyI9hl2ePoVB9bCEBoO3gjTd7/PO/I9jkXyZdnKIRyM7UVvydwv1i8jfbV7gI1EBvRondZ63 PO9xD2WGgA2wSJViu+ojDF+F768eqFZhbnQrmEs7hrmhUCOr8KBjXUNmJOhm/Qbzhf9l+kRCJxe DGdlo/vo6wEDTq9g0HdtM6pG96qXor/cCgAsdqbNEkHjr7hGqYxedwlJ+s8McqocAWQk77El0fT kIqVnkSya1dGOHeTPbBBX1jEO2RX3u4LwzXMVD3acQIv85WzmzEQJt44I4+VBFREoiufX+RJ+2o wYe5qRdy+prCX34imZ8OcBU59BYLP5sqja0F8wuYLD3gQm3rODQ1/EaYFw7Dt3POz0Dy852Zed2 EkywHKtTU48z8Tnm5SmqBHzDzWO6xq8AGZZGgVKSNBxGIQ0kHDwV88mL5mgmVZnz4ckbBbFJx0R 5n+rzgKFjcrrVrQ== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 The 'wait_lock' name seems to be a copy-paste from omapdrm, and makes no sense here. Rename it to 'irq_lock'. Also clarify the related comment to make it clear what it protects, and drop any comments related to 'wait_list' which doesn't exist in tidss. Signed-off-by: Tomi Valkeinen Reviewed-by: Aradhya Bhatia Reviewed-by: Devarsh Thakkar --- drivers/gpu/drm/tidss/tidss_dispc.c | 4 ++-- drivers/gpu/drm/tidss/tidss_drv.c | 2 +- drivers/gpu/drm/tidss/tidss_drv.h | 5 +++-- drivers/gpu/drm/tidss/tidss_irq.c | 19 +++++++++---------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/ti= dss_dispc.c index 07f5c26cfa26..cacb5f3d8085 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.c +++ b/drivers/gpu/drm/tidss/tidss_dispc.c @@ -2769,10 +2769,10 @@ static void dispc_softreset_k2g(struct dispc_device= *dispc) { unsigned long flags; =20 - spin_lock_irqsave(&dispc->tidss->wait_lock, flags); + spin_lock_irqsave(&dispc->tidss->irq_lock, flags); dispc_set_irqenable(dispc, 0); dispc_read_and_clear_irqstatus(dispc); - spin_unlock_irqrestore(&dispc->tidss->wait_lock, flags); + spin_unlock_irqrestore(&dispc->tidss->irq_lock, flags); =20 for (unsigned int vp_idx =3D 0; vp_idx < dispc->feat->num_vps; ++vp_idx) VP_REG_FLD_MOD(dispc, vp_idx, DISPC_VP_CONTROL, 0, 0, 0); diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tids= s_drv.c index d15f836dca95..c7de8c9fa12e 100644 --- a/drivers/gpu/drm/tidss/tidss_drv.c +++ b/drivers/gpu/drm/tidss/tidss_drv.c @@ -138,7 +138,7 @@ static int tidss_probe(struct platform_device *pdev) =20 platform_set_drvdata(pdev, tidss); =20 - spin_lock_init(&tidss->wait_lock); + spin_lock_init(&tidss->irq_lock); =20 ret =3D dispc_init(tidss); if (ret) { diff --git a/drivers/gpu/drm/tidss/tidss_drv.h b/drivers/gpu/drm/tidss/tids= s_drv.h index d7f27b0b0315..7f4f4282bc04 100644 --- a/drivers/gpu/drm/tidss/tidss_drv.h +++ b/drivers/gpu/drm/tidss/tidss_drv.h @@ -29,8 +29,9 @@ struct tidss_device { =20 unsigned int irq; =20 - spinlock_t wait_lock; /* protects the irq masks */ - dispc_irq_t irq_mask; /* enabled irqs in addition to wait_list */ + /* protects the irq masks field and irqenable/irqstatus registers */ + spinlock_t irq_lock; + dispc_irq_t irq_mask; /* enabled irqs */ }; =20 #define to_tidss(__dev) container_of(__dev, struct tidss_device, ddev) diff --git a/drivers/gpu/drm/tidss/tidss_irq.c b/drivers/gpu/drm/tidss/tids= s_irq.c index 8af4682ba56b..5abc788781f4 100644 --- a/drivers/gpu/drm/tidss/tidss_irq.c +++ b/drivers/gpu/drm/tidss/tidss_irq.c @@ -15,10 +15,9 @@ #include "tidss_irq.h" #include "tidss_plane.h" =20 -/* call with wait_lock and dispc runtime held */ static void tidss_irq_update(struct tidss_device *tidss) { - assert_spin_locked(&tidss->wait_lock); + assert_spin_locked(&tidss->irq_lock); =20 dispc_set_irqenable(tidss->dispc, tidss->irq_mask); } @@ -31,11 +30,11 @@ void tidss_irq_enable_vblank(struct drm_crtc *crtc) u32 hw_videoport =3D tcrtc->hw_videoport; unsigned long flags; =20 - spin_lock_irqsave(&tidss->wait_lock, flags); + spin_lock_irqsave(&tidss->irq_lock, flags); tidss->irq_mask |=3D DSS_IRQ_VP_VSYNC_EVEN(hw_videoport) | DSS_IRQ_VP_VSYNC_ODD(hw_videoport); tidss_irq_update(tidss); - spin_unlock_irqrestore(&tidss->wait_lock, flags); + spin_unlock_irqrestore(&tidss->irq_lock, flags); } =20 void tidss_irq_disable_vblank(struct drm_crtc *crtc) @@ -46,11 +45,11 @@ void tidss_irq_disable_vblank(struct drm_crtc *crtc) u32 hw_videoport =3D tcrtc->hw_videoport; unsigned long flags; =20 - spin_lock_irqsave(&tidss->wait_lock, flags); + spin_lock_irqsave(&tidss->irq_lock, flags); tidss->irq_mask &=3D ~(DSS_IRQ_VP_VSYNC_EVEN(hw_videoport) | DSS_IRQ_VP_VSYNC_ODD(hw_videoport)); tidss_irq_update(tidss); - spin_unlock_irqrestore(&tidss->wait_lock, flags); + spin_unlock_irqrestore(&tidss->irq_lock, flags); } =20 static irqreturn_t tidss_irq_handler(int irq, void *arg) @@ -60,9 +59,9 @@ static irqreturn_t tidss_irq_handler(int irq, void *arg) unsigned int id; dispc_irq_t irqstatus; =20 - spin_lock(&tidss->wait_lock); + spin_lock(&tidss->irq_lock); irqstatus =3D dispc_read_and_clear_irqstatus(tidss->dispc); - spin_unlock(&tidss->wait_lock); + spin_unlock(&tidss->irq_lock); =20 for (id =3D 0; id < tidss->num_crtcs; id++) { struct drm_crtc *crtc =3D tidss->crtcs[id]; @@ -95,9 +94,9 @@ void tidss_irq_resume(struct tidss_device *tidss) { unsigned long flags; =20 - spin_lock_irqsave(&tidss->wait_lock, flags); + spin_lock_irqsave(&tidss->irq_lock, flags); tidss_irq_update(tidss); - spin_unlock_irqrestore(&tidss->wait_lock, flags); + spin_unlock_irqrestore(&tidss->irq_lock, flags); } =20 int tidss_irq_install(struct drm_device *ddev, unsigned int irq) --=20 2.43.0