Linux ATA/IDE development
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: Paolo Pisati <p.pisati@gmail.com>,
	linux-ide@vger.kernel.org, mfd@lists.linux.dev,
	dlemoal@kernel.org, cassel@kernel.org
Subject: Re: [PATCH v1 1/7] zorro: warp mfd: add the CS-Lab Warp multifunction parent
Date: Wed, 11 Nov 2026 18:04:42 +0000	[thread overview]
Message-ID: <20261111180442.GE6323@joneslee-macbookpro.roam.internal> (raw)
In-Reply-To: <sashiko-outbox-209365@kernel.org>

On Wed, 11 Nov 2026, sashiko-bot@kernel.org wrote:

> Thank you for your contribution! Sashiko AI review found 4 potential
> issues to consider:
> - [Low] mfd: warp_mfd_probe() places new MFD core driver in
>   drivers/zorro/
> - [Low] mfd: warp_mfd_driver hard-codes mfd in names and uses wrong
>   subject prefix
> - [Low] mfd: warp_mfd_cells registers only a single child cell and
>   Kconfig mismatches code
> - [Low] mfd: warp_mfd_probe() passes z->dev.id instead of
>   PLATFORM_DEVID_AUTO

All of these are hard blockers.

Why are you adding a whole new subsystem for your device?

This clearly lives in drivers/mfd.

> --
> 
> commit 9af1a8469b32d3686430ab985b8dd9f3f752e76e
> Author: Paolo Pisati <p.pisati@gmail.com>
> 
> zorro: warp mfd: add the CS-Lab Warp multifunction parent
> 
> This commit adds a Zorro parent driver for the CS-Lab Warp 1260 board that
> registers the on-board IDE window as an mfd cell for pata_cswarp.
> 
> > diff --git a/drivers/zorro/Kconfig b/drivers/zorro/Kconfig
> > index 41475ad46e45f..c9ab9fb4b9ee7 100644
> > --- a/drivers/zorro/Kconfig
> > +++ b/drivers/zorro/Kconfig
> > @@ -17,3 +17,33 @@ config ZORRO_NAMES
> >  
> >  	  When in doubt, say Y.
> >  
> > +# Zorro multifunction drivers
> > +
> > +config WARP_MFD
> > +	tristate "CS-Lab Warp multifunction driver"
> > +	depends on ZORRO
> > +	select MFD_CORE
> [ ... ]
> > +	  This driver hands the IDE window to pata_cswarp - which needs
> > +	  idemode=native set in Warp Configuration to be of any use - and
> > +	  exposes the configuration and telemetry reachable over the dual-port
> > +	  RAM in sysfs: voltages, temperatures, fan, firmware version and
> > +	  Kickstart slot. Nothing else on the list has a driver yet.
> [ ... ]
> > diff --git a/drivers/zorro/Makefile b/drivers/zorro/Makefile
> > index 91ba82e633e76..6fe7cc1822dc1 100644
> > --- a/drivers/zorro/Makefile
> > +++ b/drivers/zorro/Makefile
> > @@ -7,6 +7,8 @@ obj-$(CONFIG_ZORRO)	+= zorro.o zorro-driver.o zorro-sysfs.o
> >  obj-$(CONFIG_PROC_FS)	+= proc.o
> >  obj-$(CONFIG_ZORRO_NAMES) +=  names.o
> >  
> > +obj-$(CONFIG_WARP_MFD) += warp-mfd.o
> 
> [Severity: Low]
> Should this driver and its local header live under drivers/mfd/ instead of
> drivers/zorro/?  Per the mfd subsystem guidelines, new core mfd drivers
> that call mfd_add_devices() or devm_mfd_add_devices(), along with headers
> shared only between the parent and its children, belong in drivers/mfd/.
> 
> > diff --git a/drivers/zorro/warp-mfd.c b/drivers/zorro/warp-mfd.c
> > new file mode 100644
> > index 0000000000000..94af7c9d0ea5e
> > --- /dev/null
> > +++ b/drivers/zorro/warp-mfd.c
> [ ... ]
> > +static const struct mfd_cell warp_mfd_cells[] = {
> > +	{
> > +		.name		= "warp-pata",
> > +		.num_resources  = 1,
> > +		.resources	= (const struct resource []) {
> > +			DEFINE_RES_MEM_NAMED(WARP_OFFSET_ATA, WARP_ATA_SIZE,
> > +					     "pata"),
> > +		}
> > +	}
> > +};
> 
> [Severity: Low]
> Is an mfd driver appropriate when warp_mfd_cells[] only registers a single
> child device?  The mfd subsystem guidelines require mfd to be used only for
> devices registering multiple children across different subsystems.
> 
> In addition, the Kconfig help text states that this driver exposes
> dual-port RAM configuration and telemetry in sysfs (voltages, temperatures,
> fan, firmware version, and Kickstart slot), none of which is present in
> this commit, and drivers/zorro/warp-mfd.h defines dual-port RAM offsets and
> sizes that have no users here.  Even later in the series, telemetry is
> added as custom sysfs attributes on the parent Zorro device rather than as
> a child device in the appropriate subsystem such as hwmon.
> 
> > +static int warp_mfd_probe(struct zorro_dev *z,
> > +			  const struct zorro_device_id *ent)
> > +{
> > +	int error;
> > +
> > +	dev_info(&z->dev, "Warp at %pR\n", &z->resource);
> > +
> > +	error = mfd_add_devices(&z->dev, z->dev.id, warp_mfd_cells,
> > +				ARRAY_SIZE(warp_mfd_cells), &z->resource,
> > +				0, NULL);
> > +	if (error) {
> > +		dev_err(&z->dev, "mfd_add_devices() failed %d\n", error);
> > +		return error;
> > +	}
> > +	return 0;
> > +}
> > +
> > +static void warp_mfd_remove(struct zorro_dev *z)
> > +{
> > +	mfd_remove_devices(&z->dev);
> > +}
> 
> [Severity: Low]
> This isn't a bug, but mfd guidelines prefer automatic platform device IDs
> over passing z->dev.id to mfd_add_devices() when subdevices do not require
> explicit numbering.  Using devm_mfd_add_devices() would also drop
> warp_mfd_remove() and keep child teardown ordered with devres resources
> added later in the series.
> 
> Similarly, warp_mfd_cells[] could use the standard mfd cell resource helper
> macro instead of open-coding .num_resources and a compound literal, and
> warp_mfd_init() / warp_mfd_exit() could use module_driver().
> 
> [ ... ]
> 
> > +static struct zorro_driver warp_mfd_driver = {
> > +	.name		= "warp-mfd",
> > +	.id_table	= warp_mfd_ids,
> > +	.probe		= warp_mfd_probe,
> > +	.remove		= warp_mfd_remove
> > +};
> 
> [Severity: Low]
> This isn't a bug, but mfd subsystem conventions avoid hard-coding "mfd" in
> driver, symbol, Kconfig, and file names (such as "warp-mfd",
> warp_mfd_driver, and warp-mfd.c), and expect commit subjects in the form
> "mfd: <driver>: <Capitalized description>".
> 
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/20261111163735.227286-1-p.pisati@gmail.com?part=1

-- 
Lee Jones

  reply	other threads:[~2026-11-11 18:04 UTC|newest]

Thread overview: 13+ 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 [this message]
2026-11-12 15:21       ` Paolo Pisati
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
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=20261111180442.GE6323@joneslee-macbookpro.roam.internal \
    --to=lee@kernel.org \
    --cc=cassel@kernel.org \
    --cc=dlemoal@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