From nobody Sun Feb 8 13:49:22 2026 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 7F772191F89; Mon, 9 Jun 2025 19:02:05 +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=1749495727; cv=none; b=nbucQpXqfG/6TPqI4jQAok2umCFGxL82inBqbUBiDkYGIZDZpznrE8uEqPJ/mTLqc3hf3pDWyp3YhhAF5mMSwJo6CIXIamZu89QA154SVANDTCfVPsI0tT3sdU2y2IuKxIu+GpKWhExlQsO07VPbMZGRG/jIyRJ2OKmrtGfjqTE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749495727; c=relaxed/simple; bh=KZHtGmdBMSdfWI9IcNY1F6osvTSelHgEDN+7hkcS54Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gyNBfyAKmzEwnz0RDJyyU2g46+RjymnyeP1oHPFdXzHa55SxVn962F6rTG4K6kVxorN+XNO0cfNiVFx5aWuUjMEa/jaYJMZHeFXcu4afLPIaUgzwx+jIeZ5KtjI/dIqD/ojiwHypqSgemVFY6zeOQSBRldP691GvAkNdyTTSRQw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (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=DyhvTiAm; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (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="DyhvTiAm" Received: from [192.168.1.102] (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C60E3833; Mon, 9 Jun 2025 21:01:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1749495715; bh=KZHtGmdBMSdfWI9IcNY1F6osvTSelHgEDN+7hkcS54Q=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=DyhvTiAmX+96uW0/G7z7i4BAg9vhl0tkP2jKdyA610iqf9QO9NFFqL2v/f+Sf5vF5 eFs7p9T2WkkyMoMhfhKEjRA75iUfoeDzrcG0xwrOWtprNEndNpFUrJ3VShqGo7L5Ae r0hbvTfUS3A2tU+39QulQkl13HgFBJ4h5wIH4sM8= From: Jacopo Mondi Date: Mon, 09 Jun 2025 21:01:42 +0200 Subject: [PATCH 1/3] media: rcar-fcp: Add rcar_fcp_soft_reset() 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: <20250609-vspx-reset-v1-1-9f17277ff1e2@ideasonboard.com> References: <20250609-vspx-reset-v1-0-9f17277ff1e2@ideasonboard.com> In-Reply-To: <20250609-vspx-reset-v1-0-9f17277ff1e2@ideasonboard.com> To: Laurent Pinchart , Mauro Carvalho Chehab , Kieran Bingham , =?utf-8?q?Niklas_S=C3=B6derlund?= Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Jacopo Mondi X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3700; i=jacopo.mondi+renesas@ideasonboard.com; h=from:subject:message-id; bh=KZHtGmdBMSdfWI9IcNY1F6osvTSelHgEDN+7hkcS54Q=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBoRy+nYn7jMzAuPr7Ye21M4SjPT+++A7ym+m6O7 C3t61SWNhiJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaEcvpwAKCRByNAaPFqFW POJNEACUQCQC2i7YtrdvA/SS18z8RynR5HuHWxA/ze++FhrhSI7HfWB4qqSiIbFgLu0Vr+2Jhsg NX0R/NhykKEEICZ7cl1Ocr0q0nhIBNZt987SnZQ4RJ+iYHYTgH+CB59pcPzpuHY/TgTtjIxhqLv RjEZcv94a1eJj1OfYgdpmQ1Z6Th3oSa8hHkbDdXXNOcLujRYX8Pjpoe19sWZmeBzP1t7fMCJwav hSQ27+CzFAuTTZ8Gz8c38X4zuzxUTA2YHQrIWzCwHHt5BYYSC/nEmRAWYe/kjuUSnzENMhOOupi Ap5xR0a/MbY6JV0O6oIR0H6o9k67+mBaX7SxRyo5yqkQQqX6a1rPVdj2XnRxYFC3aRGuYaQuYP/ IhRO3ryqMH1VRJaqFtC53ougxU0K/EmdVg7j1iDak7yVhusfM6nEwaIsGgrM6HcKjc2lmeJv7BL nFT0kbnF6w/iUnRsC8cf8CK5Whp6QqLWmXKn4troXP2cMYOcR8O28spzgkPxIaSfMuBNN+ekkZQ uZRBeSv/P2SPpF38OzTj0EOPY1VLk0LRPuPnZ2WG/mPmakMN0nZTtH6wI3yKYcmy83gKeaIFjDM SatJrDg5MbyjcoPzAFu0Hk2NT0OsWNzsmudXYjaWXh9fgZpaqZzLJSRqYYkMM5r2HVPzGMEshgh 7doB4Wcaf9RweBw== X-Developer-Key: i=jacopo.mondi+renesas@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B Add a function to perform soft reset of the FCP. It is intended to support the correct stop procedure of the VSPX-FCPVX and VSPD-FCPD pairs according to section "62.3.7.3 Reset Operation" of the R-Car Hardware Manual at revision 1.20. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Tested-by: Niklas S=C3=B6derlund --- drivers/media/platform/renesas/rcar-fcp.c | 41 +++++++++++++++++++++++++++= ++++ include/media/rcar-fcp.h | 5 ++++ 2 files changed, 46 insertions(+) diff --git a/drivers/media/platform/renesas/rcar-fcp.c b/drivers/media/plat= form/renesas/rcar-fcp.c index cee9bbce4e3affb2467dbc28142e1ab2304bf5b0..fefeaf77f0122a2d88ac03a5c42= a892dc284a163 100644 --- a/drivers/media/platform/renesas/rcar-fcp.c +++ b/drivers/media/platform/renesas/rcar-fcp.c @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include #include #include @@ -19,14 +21,30 @@ =20 #include =20 +#define RCAR_FCP_REG_RST 0x0010 +#define RCAR_FCP_REG_RST_SOFTRST BIT(0) +#define RCAR_FCP_REG_STA 0x0018 +#define RCAR_FCP_REG_STA_ACT BIT(0) + struct rcar_fcp_device { struct list_head list; struct device *dev; + void __iomem *base; }; =20 static LIST_HEAD(fcp_devices); static DEFINE_MUTEX(fcp_lock); =20 +static inline u32 rcar_fcp_read(struct rcar_fcp_device *fcp, u32 reg) +{ + return ioread32(fcp->base + reg); +} + +static inline void rcar_fcp_write(struct rcar_fcp_device *fcp, u32 reg, u3= 2 val) +{ + iowrite32(val, fcp->base + reg); +} + /* -----------------------------------------------------------------------= ------ * Public API */ @@ -117,6 +135,25 @@ void rcar_fcp_disable(struct rcar_fcp_device *fcp) } EXPORT_SYMBOL_GPL(rcar_fcp_disable); =20 +int rcar_fcp_soft_reset(struct rcar_fcp_device *fcp) +{ + u32 value; + int ret; + + if (!fcp) + return 0; + + rcar_fcp_write(fcp, RCAR_FCP_REG_RST, RCAR_FCP_REG_RST_SOFTRST); + ret =3D readl_poll_timeout(fcp->base + RCAR_FCP_REG_STA, + value, !(value & RCAR_FCP_REG_STA_ACT), + 0, 100); + if (ret) + dev_err(fcp->dev, "Failed to soft-reset: %d\n", ret); + + return ret; +} +EXPORT_SYMBOL_GPL(rcar_fcp_soft_reset); + /* -----------------------------------------------------------------------= ------ * Platform Driver */ @@ -131,6 +168,10 @@ static int rcar_fcp_probe(struct platform_device *pdev) =20 fcp->dev =3D &pdev->dev; =20 + fcp->base =3D devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(fcp->base)) + return PTR_ERR(fcp->base); + dma_set_max_seg_size(fcp->dev, UINT_MAX); =20 pm_runtime_enable(&pdev->dev); diff --git a/include/media/rcar-fcp.h b/include/media/rcar-fcp.h index 179240fb163bd2e7cc347e559f99bae943bf0e34..6ac9be9f675e667d6482a5a2483= 963fa52a0c622 100644 --- a/include/media/rcar-fcp.h +++ b/include/media/rcar-fcp.h @@ -18,6 +18,7 @@ void rcar_fcp_put(struct rcar_fcp_device *fcp); struct device *rcar_fcp_get_device(struct rcar_fcp_device *fcp); int rcar_fcp_enable(struct rcar_fcp_device *fcp); void rcar_fcp_disable(struct rcar_fcp_device *fcp); +int rcar_fcp_soft_reset(struct rcar_fcp_device *fcp); #else static inline struct rcar_fcp_device *rcar_fcp_get(const struct device_nod= e *np) { @@ -33,6 +34,10 @@ static inline int rcar_fcp_enable(struct rcar_fcp_device= *fcp) return 0; } static inline void rcar_fcp_disable(struct rcar_fcp_device *fcp) { } +static inline int rcar_fcp_soft_reset(struct rcar_fcp_device *fcp) +{ + return 0; +} #endif =20 #endif /* __MEDIA_RCAR_FCP_H__ */ --=20 2.49.0 From nobody Sun Feb 8 13:49:22 2026 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 B9F6D21FF24; Mon, 9 Jun 2025 19:02:07 +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=1749495729; cv=none; b=rvwGd5Rc5c+x96/MBZZOnWosCSNQAq6dQYgRFnLp0fkgVU2ejIbTc/MXB9Maa9lQkEW+vnBPh9ooLpGAahhe4gJe6LEYWCODgIDOEFjfWGGMlOKnUlKTbGwPaY04IIomk4PMw4wT9zDFX+M5OxYsdoXbvYbYlPe0IcZuWk34AoY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749495729; c=relaxed/simple; bh=FKNDgO54yjUnmfXufdKqdJlR/CayNxpUptThAoDjRmU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uR/OvW4wY0vzbFEAU3uXApQLH2PmwUR0nnhQnDRt/y6px4PsbyZaJEXwAgAsOEqeiYneMXPDmFS8hGSPlw0+XDZWlbr0nG5Lufd7qCb/Sij0R3aN8lbJX84LoiPH1AEFGf7z6j4+0paKA4CmP56CjISryODeTJKXDNTDNhcmeY4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (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=neCSZhkD; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (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="neCSZhkD" Received: from [192.168.1.102] (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6CB48C67; Mon, 9 Jun 2025 21:01:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1749495716; bh=FKNDgO54yjUnmfXufdKqdJlR/CayNxpUptThAoDjRmU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=neCSZhkD/gP9tQnDzQJGeLhZswfThxqSYQVyU72Fu7881CD1JdhZg0wN9AuZTJzAF 4dON06f6LR6iOJkRDTp7TqeZnoVDQZLSCfvoI0C/vv58xXo1mas9jZWFJm1/A7ixRD FY1Vw+O5V06mc62KHQPqL70mFKpkc444c0DMInQw= From: Jacopo Mondi Date: Mon, 09 Jun 2025 21:01:43 +0200 Subject: [PATCH 2/3] media: vsp1: Reset FCP for VSPD 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: <20250609-vspx-reset-v1-2-9f17277ff1e2@ideasonboard.com> References: <20250609-vspx-reset-v1-0-9f17277ff1e2@ideasonboard.com> In-Reply-To: <20250609-vspx-reset-v1-0-9f17277ff1e2@ideasonboard.com> To: Laurent Pinchart , Mauro Carvalho Chehab , Kieran Bingham , =?utf-8?q?Niklas_S=C3=B6derlund?= Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Jacopo Mondi , Koji Matsuoka , LUU HOAI X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1527; i=jacopo.mondi+renesas@ideasonboard.com; h=from:subject:message-id; bh=WoeqCO9CgR6c4BjQP9DpdbHpYISdam2AGXUlBv6XQCs=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBoRy+nm/YLX1TI4i1WKAwJlS9kH2TqwkTPwuJPV ngmuwnBqFeJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaEcvpwAKCRByNAaPFqFW PPEbD/wJXDgk1WO9BAU/1B6Vqzim8oiA3xk4NGT0YsP994qgZ+QjBeRgqtqs3+MgzZOxJT+SdX9 K4/WfO4QCN/G3Mk6XB54mMiQzHGpGIhm3hvpLDBnl9F3AiRut52dY38XIukbMqu89PWRAQH2AqF aeIyxHYugIBpnbFlyjBynbcg5mint4wxkd+ZATsBB9wHn/5sJQEr6YzsPV1DGEfFGP/OiRTz246 hwXl8KMo8fHyaFSQfEKkJADI8i6vMBjpzcKFDhqIJHNBZZcIdfhlxACuR5zZ7f4IbzcujVYSsj8 t/4yQezuAGNspSh15OHCaIdQ/gS9OjHBrrmdNVAu1TqUqI4pzsc+6ylbjgojDd5nzZp1z/Sa5mv K0adaoMrIX19TC95c3B0tff6n0A/gBfqpW6IT7j2o13nXqcjptntgc5cuBGyokbLQ9/tDt9MMJ+ tYasNHekDAATwScK2tiaHVd10Ha5jssM2ewNHnRiNGd2CCEwO+fChIhNBGepWRSbwwn0GIhUnK9 1Ztf8B/M8qbupf70tJ/cppapHSxTcNbDnylpzixafrzHl4GAfwSOK9Q+Yxq9ZMEQh9w1hQGBHKM U0ghZygIBFYYwzPfjjvAjr2ffx5YeU03IlP9ooK5odF1RcwXbzM4tm9V4nyVhByGfuBTeSz1F05 Wm03QVLCMuhUNmw== X-Developer-Key: i=jacopo.mondi+renesas@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B From: Koji Matsuoka According to H/W manual v1.00, VSPD must be excecuted FCP_RST.SOFTRST after VI6_SRESET.SRST. So this patch adds it. VSPDL is not applicable. Signed-off-by: Koji Matsuoka Signed-off-by: LUU HOAI Signed-off-by: Jacopo Mondi Tested-by: Niklas S=C3=B6derlund --- drivers/media/platform/renesas/vsp1/vsp1_pipe.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/platform/renesas/vsp1/vsp1_pipe.c b/drivers/medi= a/platform/renesas/vsp1/vsp1_pipe.c index 3cbb768cf6adc8cb182d8d31c5b9a9d3565785e7..a6e5e10f3ef275c1b081c3d957e= 6cf356332afce 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_pipe.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_pipe.c @@ -13,6 +13,7 @@ #include =20 #include +#include #include =20 #include "vsp1.h" @@ -22,6 +23,7 @@ #include "vsp1_hgo.h" #include "vsp1_hgt.h" #include "vsp1_pipe.h" +#include "vsp1_regs.h" #include "vsp1_rwpf.h" #include "vsp1_uds.h" =20 @@ -512,6 +514,11 @@ int vsp1_pipeline_stop(struct vsp1_pipeline *pipe) pipe->state =3D VSP1_PIPELINE_STOPPED; spin_unlock_irqrestore(&pipe->irqlock, flags); } + + if ((vsp1->version & VI6_IP_VERSION_MODEL_MASK) =3D=3D + VI6_IP_VERSION_MODEL_VSPD_GEN3) + ret |=3D rcar_fcp_soft_reset(vsp1->fcp); + } else { /* Otherwise just request a stop and wait. */ spin_lock_irqsave(&pipe->irqlock, flags); --=20 2.49.0 From nobody Sun Feb 8 13:49:22 2026 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 D751021FF55; Mon, 9 Jun 2025 19:02:08 +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=1749495730; cv=none; b=Zkgq8oTlpOssPnJOSmSuoxoUaOmJmzhc7RHqNqe5IXt3YaClyIJ9o88ep3Sfsm/Fh36Pzy3EMoFAB7r8Drp1O4sTD84FIcjXeV+F9AtEyzd0BstLqX3pucQ1KlCjz11WuRUv/Qr84HJ29fso++Tw+mYHhHQtJBkAIC2/B5TV/no= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1749495730; c=relaxed/simple; bh=++BxlHXhGOEFxpcEXo1+jaIVKnUzXa+f4K/H8OJ8/Zo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D9YC159/zFfHyx/RC/4O6QrhgNKs7n4nsH5NRVg1LLwdeoEZUnninHQsXHN68fsYPLQ4VX0j2ITaIfIxO2hD+/uv+alAhsCAry4piqje83WD01b15MbH1IDKIN+H/g+vEESUnh1PoaUES7gFJFUHPHlNt67eyCTw59p6xm/lKXw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (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=aUfHj1xe; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (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="aUfHj1xe" Received: from [192.168.1.102] (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3F1FD10D4; Mon, 9 Jun 2025 21:01:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1749495716; bh=++BxlHXhGOEFxpcEXo1+jaIVKnUzXa+f4K/H8OJ8/Zo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=aUfHj1xe2p2Om5r7FKPmeHkQs5P5QDkcCCLKKpISkIrDOf7D1ZuNyUjMv2LfNsZaW A4i9b+9OvOw6JnAggu4eMNpDDdg0KGOBt25yC308QbmSG6KUD8xns3XTWOqjHJErYj /up5UALlVPl91eXmVxa42CrEM5Z6x0S7GgjQMvQI= From: Jacopo Mondi Date: Mon, 09 Jun 2025 21:01:44 +0200 Subject: [PATCH 3/3] media: vsp1: Reset FCP for VSPX 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: <20250609-vspx-reset-v1-3-9f17277ff1e2@ideasonboard.com> References: <20250609-vspx-reset-v1-0-9f17277ff1e2@ideasonboard.com> In-Reply-To: <20250609-vspx-reset-v1-0-9f17277ff1e2@ideasonboard.com> To: Laurent Pinchart , Mauro Carvalho Chehab , Kieran Bingham , =?utf-8?q?Niklas_S=C3=B6derlund?= Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Jacopo Mondi X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1784; i=jacopo.mondi+renesas@ideasonboard.com; h=from:subject:message-id; bh=++BxlHXhGOEFxpcEXo1+jaIVKnUzXa+f4K/H8OJ8/Zo=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBoRy+oZe7ZGnme2/fjNJjZ3R+Vt8Njd5iT1d64j PFSBl2wQraJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaEcvqAAKCRByNAaPFqFW PN6WEACYKSg2wNAxMuLBXmjMAhfyXN8CPWeuPhlTABtg52NFkvtfWmJ0XPGXKGNPezYEs9uhC4x xnP2d49VltCBiBJLgPcPHL7GmdLilslU58BbSekW1iSYbrdfTQ398LWZvw6fTfMPzp6YpDgCCyg lvB/GYq58S3El4/8epIbv51TDlvpZFX7CQB+hIxyGrG+V+FqxMgPT7EV17ZdzezDx5JSEamrDtN /Jl8CHyVKMRFuqcGPB5wofo7JV3x4pVL6kCnuaCXs+L6tdk8mWBJVlZNvn1WI1f6VpdBmmFTE4G nMHNlJYcWc08Q9r0+InyB8oRzsecWH9Clx2izC8XUHLDypuxFjmCBfHpINP7iI3Y2v5xRtQ3Gpi cJiIUAdQjqoUUx/EZLhD2WCaKCSMxiExKh0pieZoxfUQ4zn75ucnpCRa5ujTJHEpdc27hprzwEd 8qDaOKiR0mo05OPgB+ADC+zrs4zPBrdH7Ig4+9wtmQNhAno5+Zs6/Lpv19k+C67yOVnbfObXWOv pw1Pjn0mi85aurYQOC6vPK/w7kHoggA23/znjM9sL8cwGbQ5CHOVWbhAHuuQjdKyAsuqn/ilcYu HMDNnvUzWWHjTz56Yhuny2SkKQ+K7EowD5G7piov90Zro1Wl8KF9W4oN/4wLOc/AJVMKfM7vzJq /iIqNTjjCoH3wMQ== X-Developer-Key: i=jacopo.mondi+renesas@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B According section "62.3.7.1 "Operation Control Setting IP set VSPX+FCPVX" of the R-Car Gen4 Hardware Manual, FCPX has to be reset when stopping the image processing. Softawre reset the FCPX after the vsp1 pipe has stopped. Signed-off-by: Jacopo Mondi Tested-by: Niklas S=C3=B6derlund --- drivers/media/platform/renesas/vsp1/vsp1_pipe.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/renesas/vsp1/vsp1_pipe.c b/drivers/medi= a/platform/renesas/vsp1/vsp1_pipe.c index a6e5e10f3ef275c1b081c3d957e6cf356332afce..c6f2417aabc479384012ab8ab99= 556029ede1f44 100644 --- a/drivers/media/platform/renesas/vsp1/vsp1_pipe.c +++ b/drivers/media/platform/renesas/vsp1/vsp1_pipe.c @@ -499,6 +499,7 @@ bool vsp1_pipeline_stopped(struct vsp1_pipeline *pipe) int vsp1_pipeline_stop(struct vsp1_pipeline *pipe) { struct vsp1_device *vsp1 =3D pipe->output->entity.vsp1; + u32 version =3D vsp1->version & VI6_IP_VERSION_MODEL_MASK; struct vsp1_entity *entity; unsigned long flags; int ret; @@ -515,8 +516,7 @@ int vsp1_pipeline_stop(struct vsp1_pipeline *pipe) spin_unlock_irqrestore(&pipe->irqlock, flags); } =20 - if ((vsp1->version & VI6_IP_VERSION_MODEL_MASK) =3D=3D - VI6_IP_VERSION_MODEL_VSPD_GEN3) + if (version =3D=3D VI6_IP_VERSION_MODEL_VSPD_GEN3) ret |=3D rcar_fcp_soft_reset(vsp1->fcp); =20 } else { @@ -529,6 +529,9 @@ int vsp1_pipeline_stop(struct vsp1_pipeline *pipe) ret =3D wait_event_timeout(pipe->wq, vsp1_pipeline_stopped(pipe), msecs_to_jiffies(500)); ret =3D ret =3D=3D 0 ? -ETIMEDOUT : 0; + + if (version =3D=3D VI6_IP_VERSION_MODEL_VSPX_GEN4) + ret |=3D rcar_fcp_soft_reset(vsp1->fcp); } =20 list_for_each_entry(entity, &pipe->entities, list_pipe) { --=20 2.49.0