Skip to contentSkip to conversation

irqchip: Add IMX MU MSI controller driver

DISCUSSION Colin King (gmail) 3 participants 3 messages Oct 4, 2022

lore
Share & tools
lore
#0 lore raw

Hi,

Static analysis with clang scan-build detected an issue with the following commit in linux-next:

commit 70afdab904d2d1e68bffe75fe08e7e48e0b0ff8e

Author: Frank Li <[email protected]>
Date:   Thu Sep 22 11:12:43 2022 -0500

irqchip: Add IMX MU MSI controller driver

The issue is as follows in source drivers/irqchip/irq-imx-mu-msi.c :

static const struct imx_mu_dcfg imx_mu_cfg_imx8ulp = {
        .type   = IMX_MU_V2,
        .xTR    = 0x200,
        .xRR    = 0x280,
        .xSR    = {
                        [IMX_MU_SR]  = 0xC,
                        [IMX_MU_GSR] = 0x118,
                        [IMX_MU_GSR] = 0x124,    /* <--- issue here */
                        [IMX_MU_RSR] = 0x12C,
                  },
        .xCR    = {
                        [IMX_MU_GIER] = 0x110,
                        [IMX_MU_GCR]  = 0x114,
                        [IMX_MU_TCR]  = 0x120,
                        [IMX_MU_RCR]  = 0x128
                  },
};

The .xSR object with index IMX_MU_GSR is being set twice, once with 0x118 and again with 0x128. I believe the first one should be IMX_MU_TSR but w/o the datasheet I don't want to make any assumptions.

Colin

#1 lore raw
Quoted 33 lines · Colin King (gmail)

Hi,

Static analysis with clang scan-build detected an issue with the following commit in linux-next:

commit 70afdab904d2d1e68bffe75fe08e7e48e0b0ff8e

Author: Frank Li <[email protected]>
Date:   Thu Sep 22 11:12:43 2022 -0500

irqchip: Add IMX MU MSI controller driver

The issue is as follows in source drivers/irqchip/irq-imx-mu-msi.c :

static const struct imx_mu_dcfg imx_mu_cfg_imx8ulp = {
        .type   = IMX_MU_V2,
        .xTR    = 0x200,
        .xRR    = 0x280,
        .xSR    = {
                        [IMX_MU_SR]  = 0xC,
                        [IMX_MU_GSR] = 0x118,
                        [IMX_MU_GSR] = 0x124,    /* <--- issue here */
                        [IMX_MU_RSR] = 0x12C,
                  },
        .xCR    = {
                        [IMX_MU_GIER] = 0x110,
                        [IMX_MU_GCR]  = 0x114,
                        [IMX_MU_TCR]  = 0x120,
                        [IMX_MU_RCR]  = 0x128
                  },
};
Quoted 3 lines

The .xSR object with index IMX_MU_GSR is being set twice, once with 0x118 and again with 0x128. I believe the first one should be IMX_MU_TSR but w/o the datasheet I don't want to make any assumptions.

Huh, nice catch.

Frank, can you please provide a fix for this ASAP?

Thanks,

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
#2 lore raw
Quoted 50 lines

-----Original Message-----
From: Marc Zyngier <[email protected]>
Sent: Tuesday, October 4, 2022 2:44 PM
To: Colin King (gmail) <[email protected]>; Frank Li <[email protected]>
Cc: Thomas Gleixner <[email protected]>; Shawn Guo <[email protected]>; Sascha Hauer <[email protected]>; Pengutronix Kernel Team <[email protected]>; Fabio Estevam <[email protected]>; dl-linux-imx <[email protected]>; linux- [email protected]
Subject: [EXT] Re: irqchip: Add IMX MU MSI controller driver

Caution: EXT Email

Quoted 33 lines · Colin King (gmail)

Hi,

Static analysis with clang scan-build detected an issue with the following commit in linux-next:

commit 70afdab904d2d1e68bffe75fe08e7e48e0b0ff8e

Author: Frank Li <[email protected]>
Date:   Thu Sep 22 11:12:43 2022 -0500

irqchip: Add IMX MU MSI controller driver

The issue is as follows in source drivers/irqchip/irq-imx-mu-msi.c :

static const struct imx_mu_dcfg imx_mu_cfg_imx8ulp = {
        .type   = IMX_MU_V2,
        .xTR    = 0x200,
        .xRR    = 0x280,
        .xSR    = {
                        [IMX_MU_SR]  = 0xC,
                        [IMX_MU_GSR] = 0x118,
                        [IMX_MU_GSR] = 0x124,    /* <--- issue here */
                        [IMX_MU_RSR] = 0x12C,
                  },
        .xCR    = {
                        [IMX_MU_GIER] = 0x110,
                        [IMX_MU_GCR]  = 0x114,
                        [IMX_MU_TCR]  = 0x120,
                        [IMX_MU_RCR]  = 0x128
                  },
};
Quoted 7 lines
Quoted 3 lines

The .xSR object with index IMX_MU_GSR is being set twice, once with 0x118 and again with 0x128. I believe the first one should be IMX_MU_TSR but w/o the datasheet I don't want to make any assumptions.

Huh, nice catch.

Frank, can you please provide a fix for this ASAP?

[Frank Li] Okay, will fix today.

Quoted 7 lines

Thanks,

        M.

--
Without deviation from the norm, progress is not possible.