linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Arnd Bergmann <arnd@arndb.de>, Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>, Ian Ray <ian.ray@ge.com>,
	linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org,
	devicetree@vger.kernel.org, kernel@collabora.com
Subject: Re: [PATCHv4 1/6] spi: add ancillary device support
Date: Fri, 11 Jun 2021 19:22:09 +0200	[thread overview]
Message-ID: <20210611172209.acbrpwxg75k4v4je@earth.universe> (raw)
In-Reply-To: <YMMnrYbuwe4z/s3h@kroah.com>

[-- Attachment #1: Type: text/plain, Size: 1623 bytes --]

Hi Greg,

On Fri, Jun 11, 2021 at 11:06:53AM +0200, Greg Kroah-Hartman wrote:
> On Wed, Jun 09, 2021 at 05:12:30PM +0200, Sebastian Reichel wrote:
> > Introduce support for ancillary devices, similar to existing
> > implementation for I2C. This is useful for devices having
> > multiple chip-selects, for example some microcontrollers
> > provide a normal SPI interface and a flashing SPI interface.
> > 
> > Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> > ---
> > [...]
> > +static int spi_add_device_locked(struct spi_device *spi)
> > +{
> > +	struct spi_controller *ctlr = spi->controller;
> > +	struct device *dev = ctlr->dev.parent;
> > +
> > +	/* Chipselects are numbered 0..max; validate. */
> > +	if (spi->chip_select >= ctlr->num_chipselect) {
> > +		dev_err(dev, "cs%d >= max %d\n", spi->chip_select,
> > +			ctlr->num_chipselect);
> > +		return -EINVAL;
> > +	}
> > +
> > +	/* Set the bus ID string */
> > +	spi_dev_set_name(spi);
> > +
> > +	WARN_ON(!mutex_is_locked(&spi_add_lock));
> 
> So you just rebooted a machine that has panic-on-warn set.  Not
> nice.
> 
> If this really can happen, test for it and recover, do not reboot
> devices.
> 
> If this really can never happen, why are you testing for it?

This is reached when ancillary device is not registered in
the main SPI device's probe routine, which would be a driver
bug. The gehc-achc driver calls it in the right place, so
this is not reached with this patchset, but the function to
register ancillary devices is generic and is expected to be
also used by others.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-06-11 17:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 15:12 [PATCHv4 0/6] GE Healthcare PPD firmware upgrade driver for ACHC Sebastian Reichel
2021-06-09 15:12 ` [PATCHv4 1/6] spi: add ancillary device support Sebastian Reichel
2021-06-11  9:06   ` Greg Kroah-Hartman
2021-06-11 17:22     ` Sebastian Reichel [this message]
2021-06-13 14:18   ` Andy Shevchenko
2021-06-17 12:51   ` Mark Brown
2021-06-09 15:12 ` [PATCHv4 2/6] spi: dt-bindings: support devices with multiple chipselects Sebastian Reichel
2021-06-09 15:12 ` [PATCHv4 3/6] dt-bindings: misc: ge-achc: Convert to DT schema format Sebastian Reichel
2021-06-10 16:41   ` Rob Herring
2021-06-09 15:12 ` [PATCHv4 4/6] ARM: dts: imx53-ppd: Fix ACHC entry Sebastian Reichel
2021-06-09 15:12 ` [PATCHv4 5/6] misc: nxp-ezport: introduce EzPort support Sebastian Reichel
2021-06-11  9:05   ` Greg Kroah-Hartman
2021-06-11  9:45     ` Greg Kroah-Hartman
2021-06-09 15:12 ` [PATCHv4 6/6] misc: gehc-achc: new driver Sebastian Reichel
2021-06-11  9:02   ` Greg Kroah-Hartman
2021-06-22 15:14 ` (subset) [PATCHv4 0/6] GE Healthcare PPD firmware upgrade driver for ACHC Mark Brown

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=20210611172209.acbrpwxg75k4v4je@earth.universe \
    --to=sebastian.reichel@collabora.com \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ian.ray@ge.com \
    --cc=kernel@collabora.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).