Linux ATA/IDE development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Paolo Pisati" <p.pisati@gmail.com>
Cc: linux-ide@vger.kernel.org, mfd@lists.linux.dev,
	dlemoal@kernel.org, cassel@kernel.org, lee@kernel.org
Subject: Re: [PATCH v1 4/7] zorro: warp mfd: add the dual-port RAM command channel and expose the board identity
Date: Wed, 11 Nov 2026 17:23:21 +0000	[thread overview]
Message-ID: <sashiko-outbox-209405@kernel.org> (raw)
In-Reply-To: <20261111163735.227286-5-p.pisati@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] zorro: warp-mfd: stale reg_cr irq flags not cleared in
  warp_send_msg()
--

commit 4b5b6213bfa8c6be415c4e81b0b8ac501eb8e890
Author: Paolo Pisati <p.pisati@gmail.com>

zorro: warp mfd: add the dual-port RAM command channel and expose the board identity

This commit adds the dual-port RAM command channel and interrupt handling
to communicate with the ARM co-processor, exposing boardname, fmwver, and
hwver in sysfs.

> diff --git a/drivers/zorro/warp-mfd.c b/drivers/zorro/warp-mfd.c
> index 94af7c9d0ea5e..61866f678b613 100644
> --- a/drivers/zorro/warp-mfd.c
> +++ b/drivers/zorro/warp-mfd.c

[ ... ]

> +/* send a message to the ARM coprocessor, optionally waiting for a reply */
> +static int warp_send_msg(struct warp_mfd *warp, bool wait_reply)
> +{
> +	struct completion *done = wait_reply ? &warp->reply : &warp->recv;
> +	long ret;
> +
> +	/* a previous exchange may have timed out and completed late */
> +	reinit_completion(done);
> +
> +	/* enable 68k & ARM interrupts */
> +	z_writel(DPREG_CR_SET | DPREG_CR_IE_68K | DPREG_CR_IE_ARM, warp->reg_cr);
> +
> +	/* send irq to ARM */
> +	z_writel(DPREG_CR_SET | DPREG_CR_MP_ARM, warp->reg_cr);
> +
> +	/* wait for a reply, or just wait for a receiver ack */
> +	ret = wait_for_completion_interruptible_timeout(done,
> +							WARP_MSG_TIMEOUT);
> +
> +	/* disable ARM & 68k interrupts */
> +	z_writel(DPREG_CR_CLR | DPREG_CR_IE_68K | DPREG_CR_IE_ARM, warp->reg_cr);

[Severity: Medium]
Can an interrupted or timed-out wait leave DPREG_CR_MR_ARM and
DPREG_CR_MP_68K latched in warp->reg_cr?

When wait_for_completion_interruptible_timeout() returns early (such as on
a signal during a sysfs read), warp_send_msg() clears DPREG_CR_IE_68K
while the ARM is still processing the command.  When the ARM finishes, its
status flags stay latched in warp->reg_cr because the interrupt is
disabled.  On the next command, enabling DPREG_CR_IE_68K after
reinit_completion(done) immediately triggers warp_irq() from the stale
flags before the ARM processes the new request, so warp_exec_cmd() reads
back the command opcode still in warp->dpram and warp_get_status() fails
with -EIO.

Clearing DPREG_CR_MR_ARM and DPREG_CR_MP_68K before reinit_completion()
and enabling DPREG_CR_IE_68K would avoid completing on a stale flag.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261111163735.227286-1-p.pisati@gmail.com?part=4

  reply	other threads:[~2026-11-11 17:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 16:37 [PATCH v1 0/7] zorro: add a CS-Lab Warp 1260 MFD Paolo Pisati
2026-11-11 16:37 ` [PATCH v1 1/7] zorro: warp mfd: add the CS-Lab Warp multifunction parent Paolo Pisati
2026-11-11 17:03   ` sashiko-bot
2026-11-11 18:04     ` Lee Jones
2026-11-11 16:37 ` [PATCH v1 2/7] ata: pata_cswarp: bind to the Warp mfd cell instead of the Zorro device Paolo Pisati
2026-11-11 17:12   ` sashiko-bot
2026-11-11 16:37 ` [PATCH v1 3/7] m68k: defconfig: enable WARP_MFD Paolo Pisati
2026-11-11 16:37 ` [PATCH v1 4/7] zorro: warp mfd: add the dual-port RAM command channel and expose the board identity Paolo Pisati
2026-11-11 17:23   ` sashiko-bot [this message]
2026-11-11 16:37 ` [PATCH v1 5/7] zorro: warp mfd: expose the voltage and temperature sensors Paolo Pisati
2026-11-11 16:37 ` [PATCH v1 6/7] zorro: warp mfd: expose the fan duty cycle Paolo Pisati
2026-11-11 16:37 ` [PATCH v1 7/7] zorro: warp mfd: expose the Kickstart slot selection Paolo Pisati

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=sashiko-outbox-209405@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=mfd@lists.linux.dev \
    --cc=p.pisati@gmail.com \
    --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