From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: Dafna Hirschfeld <dafna@fastmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Heiko Stuebner <heiko@sntech.de>,
Paul Elder <paul.elder@ideasonboard.com>,
Alexander Stein <alexander.stein@ew.tq-group.com>,
kieran.bingham@ideasonboard.com, umang.jain@ideasonboard.com,
aford173@gmail.com, linux-media@vger.kernel.org,
linux-rockchip@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/4] media: rkisp1: Store IRQ lines
Date: Thu, 7 Dec 2023 16:42:10 +0200 [thread overview]
Message-ID: <20231207144210.GE15521@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20231207-rkisp-irq-fix-v3-3-358a2c871a3c@ideasonboard.com>
Hi Tomi,
Thank you for the patch.
On Thu, Dec 07, 2023 at 09:57:47AM +0200, Tomi Valkeinen wrote:
> Store the IRQ lines used by the driver for easy access. These are needed
> in future patches which fix IRQ race issues.
>
> Tested-by: Adam Ford <aford173@gmail.com> #imx8mp-beacon
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/platform/rockchip/rkisp1/rkisp1-common.h | 11 ++++++++++-
> drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 17 +++++++++++++----
> 2 files changed, 23 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
> index 1e7cea1bea5e..2d7f06281c39 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h
> @@ -61,6 +61,14 @@ struct dentry;
> RKISP1_CIF_ISP_EXP_END | \
> RKISP1_CIF_ISP_HIST_MEASURE_RDY)
>
> +/* IRQ lines */
> +enum rkisp1_irq_line {
> + RKISP1_IRQ_ISP = 0,
> + RKISP1_IRQ_MI,
> + RKISP1_IRQ_MIPI,
> + RKISP1_NUM_IRQS,
> +};
> +
> /* enum for the resizer pads */
> enum rkisp1_rsz_pad {
> RKISP1_RSZ_PAD_SINK,
> @@ -423,7 +431,6 @@ struct rkisp1_debug {
> * struct rkisp1_device - ISP platform device
> *
> * @base_addr: base register address
> - * @irq: the irq number
> * @dev: a pointer to the struct device
> * @clk_size: number of clocks
> * @clks: array of clocks
> @@ -441,6 +448,7 @@ struct rkisp1_debug {
> * @stream_lock: serializes {start/stop}_streaming callbacks between the capture devices.
> * @debug: debug params to be exposed on debugfs
> * @info: version-specific ISP information
> + * @irqs: IRQ line numbers
> */
> struct rkisp1_device {
> void __iomem *base_addr;
> @@ -461,6 +469,7 @@ struct rkisp1_device {
> struct mutex stream_lock; /* serialize {start/stop}_streaming cb between capture devices */
> struct rkisp1_debug debug;
> const struct rkisp1_info *info;
> + int irqs[RKISP1_NUM_IRQS];
> };
>
> /*
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> index 22b2ae0e89c4..c3fa40976140 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
> @@ -114,6 +114,7 @@
> struct rkisp1_isr_data {
> const char *name;
> irqreturn_t (*isr)(int irq, void *ctx);
> + u32 line_mask;
> };
>
> /* ----------------------------------------------------------------------------
> @@ -471,9 +472,9 @@ static const char * const px30_isp_clks[] = {
> };
>
> static const struct rkisp1_isr_data px30_isp_isrs[] = {
> - { "isp", rkisp1_isp_isr },
> - { "mi", rkisp1_capture_isr },
> - { "mipi", rkisp1_csi_isr },
> + { "isp", rkisp1_isp_isr, BIT(RKISP1_IRQ_ISP) },
> + { "mi", rkisp1_capture_isr, BIT(RKISP1_IRQ_MI) },
> + { "mipi", rkisp1_csi_isr, BIT(RKISP1_IRQ_MIPI) },
> };
>
> static const struct rkisp1_info px30_isp_info = {
> @@ -492,7 +493,7 @@ static const char * const rk3399_isp_clks[] = {
> };
>
> static const struct rkisp1_isr_data rk3399_isp_isrs[] = {
> - { NULL, rkisp1_isr },
> + { NULL, rkisp1_isr, BIT(RKISP1_IRQ_ISP) | BIT(RKISP1_IRQ_MI) | BIT(RKISP1_IRQ_MIPI) },
> };
>
> static const struct rkisp1_info rk3399_isp_info = {
> @@ -543,6 +544,9 @@ static int rkisp1_probe(struct platform_device *pdev)
> if (IS_ERR(rkisp1->base_addr))
> return PTR_ERR(rkisp1->base_addr);
>
> + for (unsigned int il = 0; il < ARRAY_SIZE(rkisp1->irqs); ++il)
> + rkisp1->irqs[il] = -1;
> +
> for (i = 0; i < info->isr_size; i++) {
> irq = info->isrs[i].name
> ? platform_get_irq_byname(pdev, info->isrs[i].name)
> @@ -550,6 +554,11 @@ static int rkisp1_probe(struct platform_device *pdev)
> if (irq < 0)
> return irq;
>
> + for (unsigned int il = 0; il < ARRAY_SIZE(rkisp1->irqs); ++il) {
> + if (info->isrs[i].line_mask & BIT(il))
> + rkisp1->irqs[il] = irq;
> + }
> +
> ret = devm_request_irq(dev, irq, info->isrs[i].isr, 0,
> dev_driver_string(dev), dev);
> if (ret) {
>
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2023-12-07 14:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-07 7:57 [PATCH v3 0/4] media: rkisp1: Fix IRQ related issues Tomi Valkeinen
2023-12-07 7:57 ` [PATCH v3 1/4] media: rkisp1: Drop IRQF_SHARED Tomi Valkeinen
2023-12-07 7:57 ` [PATCH v3 2/4] media: rkisp1: Fix IRQ handler return values Tomi Valkeinen
2023-12-07 7:57 ` [PATCH v3 3/4] media: rkisp1: Store IRQ lines Tomi Valkeinen
2023-12-07 14:42 ` Laurent Pinchart [this message]
2023-12-07 7:57 ` [PATCH v3 4/4] media: rkisp1: Fix IRQ disable race issue Tomi Valkeinen
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=20231207144210.GE15521@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=aford173@gmail.com \
--cc=alexander.stein@ew.tq-group.com \
--cc=dafna@fastmail.com \
--cc=heiko@sntech.de \
--cc=kieran.bingham@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=paul.elder@ideasonboard.com \
--cc=tomi.valkeinen@ideasonboard.com \
--cc=umang.jain@ideasonboard.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
all inboxes | Powered by JetHome®