Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Harendra Gautam" <harendra.gautam@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v6 03/10] ASoC: qcom: Add QAIF hardware register map
Date: Fri, 11 Sep 2026 09:34:25 +0000	[thread overview]
Message-ID: <20260911093426.473F61F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260911-b4-qaif-shikra-audio-v6-3-e9addb358201@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] Incorrect register offset for QAIF_EE_CODEC_WRDMA_MAP_REG due to likely hex addition error.
- [Low] Missing '_REG' suffix on ERR_RSP_IRQ_RAW_STAT macros.
- [Low] Misleading parameter name `i` in IRQ register macros creates an API trap.
--

commit 408d3c905e0252b19f0ed0b72abd0544e15097a3
Author: Harendra Gautam <harendra.gautam@oss.qualcomm.com>

ASoC: qcom: Add QAIF hardware register map

Add qaif-reg.h to define the MMIO register offsets for the Qualcomm Audio
Interface (QAIF) hardware block. This driver needs a common register map
to program the core registers, audio interfaces, DMA channels, interrupts, 
and SID maps based on the DAI ID.

> diff --git a/sound/soc/qcom/qaif-reg.h b/sound/soc/qcom/qaif-reg.h
> new file mode 100644
> index 0000000000000..84a9c0285289e
> --- /dev/null
> +++ b/sound/soc/qcom/qaif-reg.h

[ ... ]

> +#define QAIF_EE_RDDMA_MAP_REG(v)			(0x1920 + (0x1000 * ((v)->ee)))
> +#define QAIF_EE_WRDMA_MAP_REG(v)			(0x1940 + (0x1000 * ((v)->ee)))
> +#define QAIF_EE_INTF_MAP_REG(v)				(0x1960 + (0x1000 * ((v)->ee)))
> +#define QAIF_EE_CODEC_RDDMA_MAP_REG(v)			(0x1980 + (0x1000 * ((v)->ee)))
> +#define QAIF_EE_CODEC_WRDMA_MAP_REG(v)			(0x1A00 + (0x1000 * ((v)->ee)))

[Severity: Medium]
Is this offset correct? The previous registers in this block use a stride of
0x20, which would make the next offset 0x19A0. If this is a hexadecimal
addition error (mixing up 0x80 + 0x20 = 0xA0 with decimal 80 + 20 = 100 ->
0x100), writing to 0x1A00 could silently fail to map codec capture channels
and potentially corrupt unrelated hardware state during device probe.

[ ... ]

> +/* RDDMA Period Interrupts */
> +#define QAIF_EE_RDDMA_PERIOD_IRQ_EN_REG(v, i)		qaif_rddma_irq_reg_addr(v, i, 0x00)

[Severity: Low]
Does the parameter name i create a potential API trap here? In this macro,
i is passed as the dma_type parameter to qaif_rddma_irq_reg_addr(). Using
i typically implies a channel index, which might lead future developers to
accidentally pass a DMA channel index instead of the expected qaif_irq_type.

> +#define QAIF_EE_RDDMA_PERIOD_IRQ_STAT_REG(v, i)		qaif_rddma_irq_reg_addr(v, i, 0x08)
> +#define QAIF_EE_RDDMA_PERIOD_IRQ_RAW_STAT_REG(v, i)	qaif_rddma_irq_reg_addr(v, i, 0x10)
> +#define QAIF_EE_RDDMA_PERIOD_IRQ_CLR_REG(v, i)		qaif_rddma_irq_reg_addr(v, i, 0x18)
> +#define QAIF_EE_RDDMA_PERIOD_IRQ_FORCE_REG(v, i)	qaif_rddma_irq_reg_addr(v, i, 0x20)

[ ... ]

> +/* RDDMA Error Response Interrupts */
> +#define QAIF_EE_RDDMA_ERR_RSP_IRQ_EN_REG(v, i)		qaif_rddma_irq_reg_addr(v, i, 0x50)
> +#define QAIF_EE_RDDMA_ERR_RSP_IRQ_STAT_REG(v, i)	qaif_rddma_irq_reg_addr(v, i, 0x58)
> +#define QAIF_EE_RDDMA_ERR_RSP_IRQ_RAW_STAT(v, i)	qaif_rddma_irq_reg_addr(v, i, 0x60)

[Severity: Low]
Should this macro be named QAIF_EE_RDDMA_ERR_RSP_IRQ_RAW_STAT_REG? It
appears to be missing the _REG suffix used by the other macros in this file,
which could cause naming inconsistencies for future development.

> +#define QAIF_EE_RDDMA_ERR_RSP_IRQ_CLR_REG(v, i)		qaif_rddma_irq_reg_addr(v, i, 0x68)
> +#define QAIF_EE_RDDMA_ERR_RSP_IRQ_FORCE_REG(v, i)	qaif_rddma_irq_reg_addr(v, i, 0x70)

[ ... ]

> +/* WRDMA Error Response Interrupts */
> +#define QAIF_EE_WRDMA_ERR_RSP_IRQ_EN_REG(v, i)		qaif_wrdma_irq_reg_addr(v, i, 0x50)
> +#define QAIF_EE_WRDMA_ERR_RSP_IRQ_STAT_REG(v, i)	qaif_wrdma_irq_reg_addr(v, i, 0x58)
> +#define QAIF_EE_WRDMA_ERR_RSP_IRQ_RAW_STAT(v, i)	qaif_wrdma_irq_reg_addr(v, i, 0x60)

[Severity: Low]
Should this macro also be named QAIF_EE_WRDMA_ERR_RSP_IRQ_RAW_STAT_REG to
maintain the consistent _REG suffix convention?

> +#define QAIF_EE_WRDMA_ERR_RSP_IRQ_CLR_REG(v, i)		qaif_wrdma_irq_reg_addr(v, i, 0x68)
> +#define QAIF_EE_WRDMA_ERR_RSP_IRQ_FORCE_REG(v, i)	qaif_wrdma_irq_reg_addr(v, i, 0x70)

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260911-b4-qaif-shikra-audio-v6-0-e9addb358201@oss.qualcomm.com?part=3

  reply	other threads:[~2026-09-11  9:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11  9:17 [PATCH v6 00/10] ASoC: qcom: Add QAIF driver for Shikra audio platform Harendra Gautam
2026-09-11  9:17 ` [PATCH v6 01/10] ASoC: dt-bindings: qcom,shikra-qaif-cpu: Add binding Harendra Gautam
2026-09-11  9:17 ` [PATCH v6 02/10] ASoC: qcom: Add QAIF shared data structures and variant interface Harendra Gautam
2026-09-11  9:17 ` [PATCH v6 03/10] ASoC: qcom: Add QAIF hardware register map Harendra Gautam
2026-09-11  9:34   ` sashiko-bot [this message]
2026-09-11  9:17 ` [PATCH v6 04/10] ASoC: qcom: Add QAIF CPU DAI ops, regmap, DT parsing and platform init Harendra Gautam
2026-09-11  9:17 ` [PATCH v6 05/10] ASoC: soc-core: Add snd_soc_of_xlate_dai_name() generic helper Harendra Gautam
2026-09-11  9:32   ` sashiko-bot
2026-09-11  9:17 ` [PATCH v6 06/10] ASoC: qcom: Switch lpass-cpu and qaif-cpu to snd_soc_of_xlate_dai_name() Harendra Gautam
2026-09-11  9:40   ` sashiko-bot
2026-09-11  9:17 ` [PATCH v6 07/10] ASoC: qcom: Add QAIF PCM operations Harendra Gautam
2026-09-11  9:39   ` sashiko-bot
2026-09-11  9:17 ` [PATCH v6 08/10] ASoC: qcom: Add QAIF IRQ handling and platform register Harendra Gautam
2026-09-11  9:40   ` sashiko-bot
2026-09-11  9:17 ` [PATCH v6 09/10] ASoC: qcom: Add Shikra QAIF support Harendra Gautam
2026-09-11  9:17 ` [PATCH v6 10/10] MAINTAINERS: Add Qualcomm QAIF driver entry Harendra Gautam

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=20260911093426.473F61F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=harendra.gautam@oss.qualcomm.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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