From: Pavel Machek <pavel@denx.de>
To: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Cc: cip-dev@lists.cip-project.org,
Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
Pavel Machek <pavel@denx.de>,
Biju Das <biju.das.jz@bp.renesas.com>
Subject: Re: [PATCH v2 5.10.y-cip 11/28] media: platform: Add Renesas RZ/G2L CRU driver
Date: Tue, 5 Nov 2024 12:32:39 +0100 [thread overview]
Message-ID: <ZyoCV4ZzNVrcO3rg@duo.ucw.cz> (raw)
In-Reply-To: <20241101125746.33222-12-prabhakar.mahadev-lad.rj@bp.renesas.com>
[-- Attachment #1: Type: text/plain, Size: 2733 bytes --]
Hi!
> commit 07fc05bd0a797dcc34620869933993e1cbf56b98 upstream.
>
> Add v4l driver for Renesas RZ/G2L Camera data Receiving Unit.
>
> Based on a patch in the BSP by Hien Huynh
> <hien.huynh.px@renesas.com>
> +/**
> + * struct rzg2l_cru_dev - Renesas CRU device structure
> + * @dev: (OF) device
> + * @base: device I/O register space remapped to virtual memory
> + * @info: info about CRU instance
> + *
...
> + * @num_buf: Holds the current number of buffers enabled
> + * @ip: Image processing subdev info
Holds-> holds, Image->image, for consistency with the rest.
> +void rzg2l_cru_stop_image_processing(struct rzg2l_cru_dev *cru)
> +{
> + u32 amnfifopntr, amnfifopntr_w, amnfifopntr_r_y;
> + unsigned int retries = 0;
> + unsigned long flags;
> + u32 icnms;
> +
> + spin_lock_irqsave(&cru->qlock, flags);
> +
> + /* Disable and clear the interrupt */
> + rzg2l_cru_write(cru, CRUnIE, 0);
> + rzg2l_cru_write(cru, CRUnINTS, 0x001F0F0F);
...
> + /* Wait until the FIFO becomes empty */
> + for (retries = 5; retries > 0; retries--) {
> + amnfifopntr = rzg2l_cru_read(cru, AMnFIFOPNTR);
> +
> + amnfifopntr_w = amnfifopntr & AMnFIFOPNTR_FIFOWPNTR;
> + amnfifopntr_r_y =
> + (amnfifopntr & AMnFIFOPNTR_FIFORPNTR_Y) >> 16;
> + if (amnfifopntr_w == amnfifopntr_r_y)
> + break;
> +
> + usleep_range(10, 20);
We are running with interrupts disabled here, we should use udelay(),
not sleep.
> + }
> +
> + /* Notify that FIFO is not empty here */
> + if (!retries)
> + dev_err(cru->dev, "Failed to empty FIFO\n");
> +
> + /* Stop AXI bus */
> + rzg2l_cru_write(cru, AMnAXISTP, AMnAXISTP_AXI_STOP);
> +
> + /* Wait until the AXI bus stop */
> + for (retries = 5; retries > 0; retries--) {
> + if (rzg2l_cru_read(cru, AMnAXISTPACK) &
> + AMnAXISTPACK_AXI_STOP_ACK)
> + break;
> +
> + usleep_range(10, 20);
Same here.
> +static int rzg2l_cru_open(struct file *file)
> +{
> + struct rzg2l_cru_dev *cru = video_drvdata(file);
> + int ret;
> +
> + ret = mutex_lock_interruptible(&cru->lock);
> + if (ret)
> + return ret;
> +
> + file->private_data = cru;
> + ret = v4l2_fh_open(file);
> + if (ret)
> + goto err_unlock;
> +
> + mutex_unlock(&cru->lock);
> +
> + return 0;
> +
> +err_unlock:
> + mutex_unlock(&cru->lock);
> +
> + return ret;
> +}
This can be simplified. You already have "ret = 0" in the normal path,
so this can be deleted:
> + if (ret)
> + goto err_unlock;
> +
> + mutex_unlock(&cru->lock);
> +
> + return 0;
Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2024-11-05 11:32 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-01 12:57 [PATCH v2 5.10.y-cip 00/28] Add CRU, CSI support for Renesas RZ/{G2L, V2L} SoCs Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 01/28] media: i2c: ov5645: Drop fetching the clk reference by name Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 02/28] media: i2c: ov5645: Use runtime PM Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 03/28] media: i2c: ov5645: Drop empty comment Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 04/28] media: i2c: ov5645: Make sure to call PM functions Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 05/28] media: i2c: ov5645: Call ov5645_entity_init_cfg() before registering the subdev Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 06/28] media: i2c: ov5645: Remove software reset entry from ov5645_global_init_setting Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 07/28] media: v4l: subdev: Add pre_streamon and post_streamoff callbacks Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 08/28] media: dt-bindings: Document Renesas RZ/G2L CSI-2 block Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 09/28] media: dt-bindings: Document Renesas RZ/G2L CRU block Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 10/28] media: platform: Add Renesas RZ/G2L MIPI CSI-2 receiver driver Lad Prabhakar
2024-11-05 11:27 ` Pavel Machek
2024-11-05 11:35 ` Prabhakar Mahadev Lad
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 11/28] media: platform: Add Renesas RZ/G2L CRU driver Lad Prabhakar
2024-11-05 11:32 ` Pavel Machek [this message]
2024-11-05 12:22 ` Prabhakar Mahadev Lad
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 12/28] media: rzg2l-cru: Remove unnecessary shadowing of ret in rzg2l_csi2_s_stream() Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 13/28] media: platform: renesas: rzg2l-cru: Add missing documentation for image_conv_irq Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 14/28] media: rzg2l-cru: Fix missing error code in rzg2l_cru_start_streaming_vq() Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 15/28] media: rzg2l-cru: fix a test for timeout Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 16/28] media: rzg2l-cru: Remove unneeded semicolon Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 17/28] media: platform: rzg2l-cru: rzg2l-csi2: Enclose the macro in parentheses Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 18/28] media: platform: rzg2l-cru: rzg2l-csi2: Switch to RUNTIME_PM_OPS() Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 19/28] media: platform: rzg2l-cru: rzg2l-ip: Add delay after D-PHY reset Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 20/28] media: platform: rzg2l-cru: rzg2l-video: Fix image processing initialization Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 21/28] media: platform: rzg2l-cru: rzg2l-csi2: Restructure vclk handling Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 22/28] media: platform: rzg2l-cru: rzg2l-video: Fix start reception procedure Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 23/28] media: platform: rzg2l-cru: rzg2l-csi2: Add missing MODULE_DEVICE_TABLE Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 24/28] clk: renesas: r9a07g044: Add clock and reset entries for CRU Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 25/28] arm64: dts: renesas: r9a07g044: Add CSI and CRU nodes Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 26/28] arm64: dts: renesas: r9a07g054: " Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 27/28] arm64: dts: renesas: rzg2l-smarc: Enable CRU, CSI support Lad Prabhakar
2024-11-01 12:57 ` [PATCH v2 5.10.y-cip 28/28] arm64: defconfig: Enable RZ/G2L MIPI CSI-2 and CRU support Lad Prabhakar
2024-11-05 11:19 ` [PATCH v2 5.10.y-cip 00/28] Add CRU, CSI support for Renesas RZ/{G2L, V2L} SoCs Pavel Machek
2024-11-06 11:24 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZyoCV4ZzNVrcO3rg@duo.ucw.cz \
--to=pavel@denx.de \
--cc=biju.das.jz@bp.renesas.com \
--cc=cip-dev@lists.cip-project.org \
--cc=nobuhiro1.iwamatsu@toshiba.co.jp \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox