diff mbox series

[V7,1/7] spi: Add stacked and parallel memories support in SPI core

Message ID 20230406065336.10980-2-amit.kumar-mahapatra@amd.com (mailing list archive)
State Superseded
Headers show
Series spi: Add support for stacked/parallel memories | expand

Commit Message

Mahapatra, Amit Kumar April 6, 2023, 6:53 a.m. UTC
For supporting multiple CS the SPI device need to be aware of all the CS
values. So, the "chip_select" member in the spi_device structure is now an
array that holds all the CS values.

spi_device structure now has a "cs_index_mask" member. This acts as an
index to the chip_select array. If nth bit of spi->cs_index_mask is set
then the driver would assert spi->chip_select[n].

In parallel mode all the chip selects are asserted/de-asserted
simultaneously and each byte of data is stored in both devices, the even
bits in one, the odd bits in the other. The split is automatically handled
by the GQSPI controller. The GQSPI controller supports a maximum of two
flashes connected in parallel mode. A SPI_CONTROLLER_MULTI_CS flag bit is
added in the spi controntroller flags, through ctlr->flags the spi core
will make sure that the controller is capable of handling multiple chip
selects at once.

For supporting multiple CS via GPIO the cs_gpiod member of the spi_device
structure is now an array that holds the gpio descriptor for each
chipselect.

Multi CS support using GPIO is not tested due to unavailability of
necessary hardware setup.

Multi CS configuration with one native CS and one GPIO CS is not supported
as this configuration could not be tested due to unavailability of
necessary hardware setup.

Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
---
 drivers/spi/spi.c       | 226 ++++++++++++++++++++++++++++------------
 include/linux/spi/spi.h |  32 ++++--
 2 files changed, 183 insertions(+), 75 deletions(-)

Comments

Stefan Binding April 6, 2023, 1:43 p.m. UTC | #1
Hi,

> -----Original Message-----
> From: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
> Sent: Thursday, April 6, 2023 7:54 AM
> To: broonie@kernel.org; tudor.ambarus@linaro.org;
> pratyush@kernel.org; michael@walle.cc; miquel.raynal@bootlin.com;
> richard@nod.at; vigneshr@ti.com
> Cc: git@amd.com; sbinding@opensource.cirrus.com; linux-
> spi@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> mtd@lists.infradead.org; nicolas.ferre@microchip.com;
> alexandre.belloni@bootlin.com; claudiu.beznea@microchip.com;
> michal.simek@amd.com; linux-arm-kernel@lists.infradead.org;
> amitrkcian2002@gmail.com; Amit Kumar Mahapatra <amit.kumar-
> mahapatra@amd.com>
> Subject: [PATCH V7 1/7] spi: Add stacked and parallel memories
support
> in SPI core
> 
> For supporting multiple CS the SPI device need to be aware of all
the CS
> values. So, the "chip_select" member in the spi_device structure is
now
> an
> array that holds all the CS values.
> 
> spi_device structure now has a "cs_index_mask" member. This acts as
an
> index to the chip_select array. If nth bit of spi->cs_index_mask is
set
> then the driver would assert spi->chip_select[n].
> 
> In parallel mode all the chip selects are asserted/de-asserted
> simultaneously and each byte of data is stored in both devices, the
even
> bits in one, the odd bits in the other. The split is automatically
handled
> by the GQSPI controller. The GQSPI controller supports a maximum of
> two
> flashes connected in parallel mode. A SPI_CONTROLLER_MULTI_CS flag
> bit is
> added in the spi controntroller flags, through ctlr->flags the spi
core
> will make sure that the controller is capable of handling multiple
chip
> selects at once.
> 
> For supporting multiple CS via GPIO the cs_gpiod member of the
> spi_device
> structure is now an array that holds the gpio descriptor for each
> chipselect.
> 
> Multi CS support using GPIO is not tested due to unavailability of
> necessary hardware setup.
> 
> Multi CS configuration with one native CS and one GPIO CS is not
> supported
> as this configuration could not be tested due to unavailability of
> necessary hardware setup.

I've tested this chain on a released laptop (HP EliteBook 840 G9)
which uses
SPI to interface to 2 amps, one amp uses a native CS and the other
uses a
GPIO CS, and I noticed that when using this chain, the second amp no
longer
works.

Thanks,
Stefan Binding

> 
> Signed-off-by: Amit Kumar Mahapatra <amit.kumar-
> mahapatra@amd.com>
> ---
>  drivers/spi/spi.c       | 226
++++++++++++++++++++++++++++------------
>  include/linux/spi/spi.h |  32 ++++--
>  2 files changed, 183 insertions(+), 75 deletions(-)
> 
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 9036d7a50674..04d7322170c4 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -612,10 +612,24 @@ static int spi_dev_check(struct device *dev,
> void *data)
>  {
>  	struct spi_device *spi = to_spi_device(dev);
>  	struct spi_device *new_spi = data;
> +	int idx, nw_idx;
> 
> -	if (spi->controller == new_spi->controller &&
> -	    spi_get_chipselect(spi, 0) == spi_get_chipselect(new_spi,
0))
> -		return -EBUSY;
> +	if (spi->controller == new_spi->controller) {
> +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> +			for (nw_idx = 0; nw_idx < SPI_CS_CNT_MAX;
> nw_idx++) {
> +				if ((idx != 0 &&
!spi_get_chipselect(spi,
> idx)) ||
> +				    (nw_idx != 0 &&
> !spi_get_chipselect(spi, nw_idx))) {
> +					continue;
> +				} else if (spi_get_chipselect(spi,
idx) ==
> +				    spi_get_chipselect(new_spi,
nw_idx))
> {
> +					dev_err(dev,
> +						"chipselect %d already
> in use\n",
> +
> 	spi_get_chipselect(new_spi, nw_idx));
> +					return -EBUSY;
> +				}
> +			}
> +		}
> +	}
>  	return 0;
>  }
> 
> @@ -629,7 +643,7 @@ static int __spi_add_device(struct spi_device
> *spi)
>  {
>  	struct spi_controller *ctlr = spi->controller;
>  	struct device *dev = ctlr->dev.parent;
> -	int status;
> +	int status, idx;
> 
>  	/*
>  	 * We need to make sure there's no other device with this
> @@ -638,8 +652,6 @@ static int __spi_add_device(struct spi_device
> *spi)
>  	 */
>  	status = bus_for_each_dev(&spi_bus_type, NULL, spi,
> spi_dev_check);
>  	if (status) {
> -		dev_err(dev, "chipselect %d already in use\n",
> -				spi_get_chipselect(spi, 0));
>  		return status;
>  	}
> 
> @@ -649,8 +661,10 @@ static int __spi_add_device(struct spi_device
> *spi)
>  		return -ENODEV;
>  	}
> 
> -	if (ctlr->cs_gpiods)
> -		spi_set_csgpiod(spi, 0, ctlr-
> >cs_gpiods[spi_get_chipselect(spi, 0)]);
> +	if (ctlr->cs_gpiods) {
> +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
> +			spi_set_csgpiod(spi, idx, ctlr-
> >cs_gpiods[spi_get_chipselect(spi, idx)]);
> +	}
> 
>  	/*
>  	 * Drivers may modify this initial i/o setup, but will
> @@ -690,13 +704,15 @@ int spi_add_device(struct spi_device *spi)
>  {
>  	struct spi_controller *ctlr = spi->controller;
>  	struct device *dev = ctlr->dev.parent;
> -	int status;
> +	int status, idx;
> 
> -	/* Chipselects are numbered 0..max; validate. */
> -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
> -		dev_err(dev, "cs%d >= max %d\n",
> spi_get_chipselect(spi, 0),
> -			ctlr->num_chipselect);
> -		return -EINVAL;
> +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> +		/* Chipselects are numbered 0..max; validate. */
> +		if (spi_get_chipselect(spi, idx) >=
ctlr->num_chipselect) {
> +			dev_err(dev, "cs%d >= max %d\n",
> spi_get_chipselect(spi, idx),
> +				ctlr->num_chipselect);
> +			return -EINVAL;
> +		}
>  	}
> 
>  	/* Set the bus ID string */
> @@ -713,12 +729,15 @@ static int spi_add_device_locked(struct
> spi_device *spi)
>  {
>  	struct spi_controller *ctlr = spi->controller;
>  	struct device *dev = ctlr->dev.parent;
> +	int idx;
> 
> -	/* Chipselects are numbered 0..max; validate. */
> -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
> -		dev_err(dev, "cs%d >= max %d\n",
> spi_get_chipselect(spi, 0),
> -			ctlr->num_chipselect);
> -		return -EINVAL;
> +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> +		/* Chipselects are numbered 0..max; validate. */
> +		if (spi_get_chipselect(spi, idx) >=
ctlr->num_chipselect) {
> +			dev_err(dev, "cs%d >= max %d\n",
> spi_get_chipselect(spi, idx),
> +				ctlr->num_chipselect);
> +			return -EINVAL;
> +		}
>  	}
> 
>  	/* Set the bus ID string */
> @@ -966,58 +985,118 @@ static void spi_res_release(struct
> spi_controller *ctlr, struct spi_message *mes
>  static void spi_set_cs(struct spi_device *spi, bool enable, bool
force)
>  {
>  	bool activate = enable;
> +	u32 cs_num = __ffs(spi->cs_index_mask);
> +	int idx;
> 
>  	/*
> -	 * Avoid calling into the driver (or doing delays) if the chip
select
> -	 * isn't actually changing from the last time this was called.
> +	 * In parallel mode all the chip selects are
asserted/de-asserted
> +	 * at once
>  	 */
> -	if (!force && ((enable && spi->controller->last_cs ==
> spi_get_chipselect(spi, 0)) ||
> -		       (!enable && spi->controller->last_cs !=
> spi_get_chipselect(spi, 0))) &&
> -	    (spi->controller->last_cs_mode_high == (spi->mode &
> SPI_CS_HIGH)))
> -		return;
> -
> -	trace_spi_set_cs(spi, activate);
> -
> -	spi->controller->last_cs = enable ? spi_get_chipselect(spi, 0)
: -1;
> -	spi->controller->last_cs_mode_high = spi->mode &
> SPI_CS_HIGH;
> -
> -	if ((spi_get_csgpiod(spi, 0) ||
!spi->controller->set_cs_timing)
> && !activate)
> -		spi_delay_exec(&spi->cs_hold, NULL);
> -
> -	if (spi->mode & SPI_CS_HIGH)
> -		enable = !enable;
> +	if ((spi->cs_index_mask & SPI_PARALLEL_CS_MASK) ==
> SPI_PARALLEL_CS_MASK) {
> +		spi->controller->last_cs_mode_high = spi->mode &
> SPI_CS_HIGH;
> +
> +		if ((spi_get_csgpiod(spi, 0) || !spi->controller-
> >set_cs_timing) && !activate)
> +			spi_delay_exec(&spi->cs_hold, NULL);
> +
> +		if (spi->mode & SPI_CS_HIGH)
> +			enable = !enable;
> +
> +		if (spi_get_csgpiod(spi, 0) && spi_get_csgpiod(spi,
1)) {
> +			if (!(spi->mode & SPI_NO_CS)) {
> +				/*
> +				 * Historically ACPI has no means of
the
> GPIO polarity and
> +				 * thus the SPISerialBus() resource
> defines it on the per-chip
> +				 * basis. In order to avoid a chain of
> negations, the GPIO
> +				 * polarity is considered being Active
> High. Even for the cases
> +				 * when _DSD() is involved (in the
> updated versions of ACPI)
> +				 * the GPIO CS polarity must be
defined
> Active High to avoid
> +				 * ambiguity. That's why we use
enable,
> that takes SPI_CS_HIGH
> +				 * into account.
> +				 */
> +				if (has_acpi_companion(&spi->dev)) {
> +					for (idx = 0; idx <
> SPI_CS_CNT_MAX; idx++)
> +
> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
> +
> !enable);
> +				} else {
> +					for (idx = 0; idx <
> SPI_CS_CNT_MAX; idx++)
> +						/* Polarity handled by
> GPIO library */
> +
> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
> +
> activate);
> +				}
> +			}
> +			/* Some SPI masters need both GPIO CS &
> slave_select */
> +			if ((spi->controller->flags &
> SPI_MASTER_GPIO_SS) &&
> +			    spi->controller->set_cs)
> +				spi->controller->set_cs(spi, !enable);
> +		} else if (spi->controller->set_cs) {
> +			spi->controller->set_cs(spi, !enable);
> +		}
> 
> -	if (spi_get_csgpiod(spi, 0)) {
> -		if (!(spi->mode & SPI_NO_CS)) {
> -			/*
> -			 * Historically ACPI has no means of the GPIO
> polarity and
> -			 * thus the SPISerialBus() resource defines it
on
> the per-chip
> -			 * basis. In order to avoid a chain of
negations,
> the GPIO
> -			 * polarity is considered being Active High.
Even
> for the cases
> -			 * when _DSD() is involved (in the updated
> versions of ACPI)
> -			 * the GPIO CS polarity must be defined Active
> High to avoid
> -			 * ambiguity. That's why we use enable, that
> takes SPI_CS_HIGH
> -			 * into account.
> -			 */
> -			if (has_acpi_companion(&spi->dev))
> -
> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), !enable);
> +		if (spi_get_csgpiod(spi, 0) || spi_get_csgpiod(spi, 1)
||
> +		    !spi->controller->set_cs_timing) {
> +			if (activate)
> +				spi_delay_exec(&spi->cs_setup, NULL);
>  			else
> -				/* Polarity handled by GPIO library */
> -
> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), activate);
> +				spi_delay_exec(&spi->cs_inactive,
> NULL);
>  		}
> -		/* Some SPI masters need both GPIO CS & slave_select
> */
> -		if ((spi->controller->flags & SPI_MASTER_GPIO_SS) &&
> -		    spi->controller->set_cs)
> +	} else {
> +		/*
> +		 * Avoid calling into the driver (or doing delays) if
the
> chip select
> +		 * isn't actually changing from the last time this was
> called.
> +		 */
> +		if (!force && ((enable && spi->controller->last_cs ==
> +				spi_get_chipselect(spi, cs_num)) ||
> +				(!enable && spi->controller->last_cs
!=
> +				 spi_get_chipselect(spi, cs_num))) &&
> +		    (spi->controller->last_cs_mode_high ==
> +		     (spi->mode & SPI_CS_HIGH)))
> +			return;
> +
> +		trace_spi_set_cs(spi, activate);
> +
> +		spi->controller->last_cs = enable ?
> spi_get_chipselect(spi, cs_num) : -1;
> +		spi->controller->last_cs_mode_high = spi->mode &
> SPI_CS_HIGH;
> +
> +		if ((spi_get_csgpiod(spi, cs_num) || !spi->controller-
> >set_cs_timing) && !activate)
> +			spi_delay_exec(&spi->cs_hold, NULL);
> +
> +		if (spi->mode & SPI_CS_HIGH)
> +			enable = !enable;
> +
> +		if (spi_get_csgpiod(spi, cs_num)) {
> +			if (!(spi->mode & SPI_NO_CS)) {
> +				/*
> +				 * Historically ACPI has no means of
the
> GPIO polarity and
> +				 * thus the SPISerialBus() resource
> defines it on the per-chip
> +				 * basis. In order to avoid a chain of
> negations, the GPIO
> +				 * polarity is considered being Active
> High. Even for the cases
> +				 * when _DSD() is involved (in the
> updated versions of ACPI)
> +				 * the GPIO CS polarity must be
defined
> Active High to avoid
> +				 * ambiguity. That's why we use
enable,
> that takes SPI_CS_HIGH
> +				 * into account.
> +				 */
> +				if (has_acpi_companion(&spi->dev))
> +
> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
> +
> !enable);
> +				else
> +					/* Polarity handled by GPIO
> library */
> +
> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
> +
> activate);
> +			}
> +			/* Some SPI masters need both GPIO CS &
> slave_select */
> +			if ((spi->controller->flags &
> SPI_MASTER_GPIO_SS) &&
> +			    spi->controller->set_cs)
> +				spi->controller->set_cs(spi, !enable);
> +		} else if (spi->controller->set_cs) {
>  			spi->controller->set_cs(spi, !enable);
> -	} else if (spi->controller->set_cs) {
> -		spi->controller->set_cs(spi, !enable);
> -	}
> +		}
> 
> -	if (spi_get_csgpiod(spi, 0) ||
!spi->controller->set_cs_timing) {
> -		if (activate)
> -			spi_delay_exec(&spi->cs_setup, NULL);
> -		else
> -			spi_delay_exec(&spi->cs_inactive, NULL);
> +		if (spi_get_csgpiod(spi, cs_num) || !spi->controller-
> >set_cs_timing) {
> +			if (activate)
> +				spi_delay_exec(&spi->cs_setup, NULL);
> +			else
> +				spi_delay_exec(&spi->cs_inactive,
> NULL);
> +		}
>  	}
>  }
> 
> @@ -2246,8 +2325,8 @@ static void of_spi_parse_dt_cs_delay(struct
> device_node *nc,
>  static int of_spi_parse_dt(struct spi_controller *ctlr, struct
spi_device
> *spi,
>  			   struct device_node *nc)
>  {
> -	u32 value;
> -	int rc;
> +	u32 value, cs[SPI_CS_CNT_MAX] = {0};
> +	int rc, idx;
> 
>  	/* Mode (clock phase/polarity/etc.) */
>  	if (of_property_read_bool(nc, "spi-cpha"))
> @@ -2320,13 +2399,21 @@ static int of_spi_parse_dt(struct
> spi_controller *ctlr, struct spi_device *spi,
>  	}
> 
>  	/* Device address */
> -	rc = of_property_read_u32(nc, "reg", &value);
> -	if (rc) {
> +	rc = of_property_read_variable_u32_array(nc, "reg", &cs[0], 1,
> +						 SPI_CS_CNT_MAX);
> +	if (rc < 0 || rc > ctlr->num_chipselect) {
>  		dev_err(&ctlr->dev, "%pOF has no valid 'reg' property
> (%d)\n",
>  			nc, rc);
>  		return rc;
> +	} else if ((of_property_read_bool(nc, "parallel-memories")) &&
> +		   (!(ctlr->flags & SPI_CONTROLLER_MULTI_CS))) {
> +		dev_err(&ctlr->dev, "SPI controller doesn't support
multi
> CS\n");
> +		return -EINVAL;
>  	}
> -	spi_set_chipselect(spi, 0, value);
> +	for (idx = 0; idx < rc; idx++)
> +		spi_set_chipselect(spi, idx, cs[idx]);
> +	/* By default set the spi->cs_index_mask as 1 */
> +	spi->cs_index_mask = 0x01;
> 
>  	/* Device speed */
>  	if (!of_property_read_u32(nc, "spi-max-frequency", &value))
> @@ -3907,7 +3994,8 @@ static int __spi_validate(struct spi_device
> *spi, struct spi_message *message)
>  	 * cs_change is set for each transfer.
>  	 */
>  	if ((spi->mode & SPI_CS_WORD) && (!(ctlr->mode_bits &
> SPI_CS_WORD) ||
> -					  spi_get_csgpiod(spi, 0))) {
> +					  spi_get_csgpiod(spi, 0) ||
> +					  spi_get_csgpiod(spi, 1))) {
>  		size_t maxsize;
>  		int ret;
> 
> diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
> index 873ced6ae4ca..6453b246e0af 100644
> --- a/include/linux/spi/spi.h
> +++ b/include/linux/spi/spi.h
> @@ -19,6 +19,11 @@
>  #include <linux/acpi.h>
>  #include <linux/u64_stats_sync.h>
> 
> +/* Max no. of CS supported per spi device */
> +#define SPI_CS_CNT_MAX 2
> +
> +/* chip select mask */
> +#define SPI_PARALLEL_CS_MASK	(BIT(0) | BIT(1))
>  struct dma_chan;
>  struct software_node;
>  struct ptp_system_timestamp;
> @@ -166,6 +171,7 @@ extern void
> spi_transfer_cs_change_delay_exec(struct spi_message *msg,
>   *	deasserted. If @cs_change_delay is used from @spi_transfer,
> then the
>   *	two delays will be added up.
>   * @pcpu_statistics: statistics for the spi_device
> + * @cs_index_mask: Bit mask of the active chipselect(s) in the
> chipselect array
>   *
>   * A @spi_device is used to interchange data between an SPI slave
>   * (usually a discrete chip) and CPU memory.
> @@ -181,7 +187,7 @@ struct spi_device {
>  	struct spi_controller	*controller;
>  	struct spi_controller	*master;	/* Compatibility layer
*/
>  	u32			max_speed_hz;
> -	u8			chip_select;
> +	u8			chip_select[SPI_CS_CNT_MAX];
>  	u8			bits_per_word;
>  	bool			rt;
>  #define SPI_NO_TX	BIT(31)		/* No transmit wire */
> @@ -202,7 +208,7 @@ struct spi_device {
>  	void			*controller_data;
>  	char			modalias[SPI_NAME_SIZE];
>  	const char		*driver_override;
> -	struct gpio_desc	*cs_gpiod;	/* Chip select gpio
desc
> */
> +	struct gpio_desc	*cs_gpiod[SPI_CS_CNT_MAX];	/*
Chip
> select gpio desc */
>  	struct spi_delay	word_delay; /* Inter-word delay */
>  	/* CS delays */
>  	struct spi_delay	cs_setup;
> @@ -212,6 +218,13 @@ struct spi_device {
>  	/* The statistics */
>  	struct spi_statistics __percpu	*pcpu_statistics;
> 
> +	/* Bit mask of the chipselect(s) that the driver need to use
from
> +	 * the chipselect array.When the controller is capable to
handle
> +	 * multiple chip selects & memories are connected in parallel
> +	 * then more than one bit need to be set in cs_index_mask.
> +	 */
> +	u32			cs_index_mask : SPI_CS_CNT_MAX;
> +
>  	/*
>  	 * likely need more hooks for more protocol options affecting
> how
>  	 * the controller talks to each chip, like:
> @@ -268,22 +281,22 @@ static inline void *spi_get_drvdata(const
> struct spi_device *spi)
> 
>  static inline u8 spi_get_chipselect(const struct spi_device *spi,
u8 idx)
>  {
> -	return spi->chip_select;
> +	return spi->chip_select[idx];
>  }
> 
>  static inline void spi_set_chipselect(struct spi_device *spi, u8
idx, u8
> chipselect)
>  {
> -	spi->chip_select = chipselect;
> +	spi->chip_select[idx] = chipselect;
>  }
> 
>  static inline struct gpio_desc *spi_get_csgpiod(const struct
spi_device
> *spi, u8 idx)
>  {
> -	return spi->cs_gpiod;
> +	return spi->cs_gpiod[idx];
>  }
> 
>  static inline void spi_set_csgpiod(struct spi_device *spi, u8 idx,
struct
> gpio_desc *csgpiod)
>  {
> -	spi->cs_gpiod = csgpiod;
> +	spi->cs_gpiod[idx] = csgpiod;
>  }
> 
>  /**
> @@ -388,6 +401,8 @@ extern struct spi_device
> *spi_new_ancillary_device(struct spi_device *spi, u8 ch
>   * @bus_lock_spinlock: spinlock for SPI bus locking
>   * @bus_lock_mutex: mutex for exclusion of multiple callers
>   * @bus_lock_flag: indicates that the SPI bus is locked for
exclusive use
> + * @multi_cs_cap: indicates that the SPI Controller can
assert/de-assert
> + *	more than one chip select at once.
>   * @setup: updates the device mode and clocking records used by a
>   *	device's SPI controller; protocol code may call this.  This
>   *	must fail if an unrecognized or unsupported mode is requested.
> @@ -554,6 +569,11 @@ struct spi_controller {
>  #define SPI_CONTROLLER_MUST_TX		BIT(4)	/* Requires tx
> */
> 
>  #define SPI_MASTER_GPIO_SS		BIT(5)	/* GPIO CS must select
> slave */
> +	/*
> +	 * The spi-controller has multi chip select capability and can
> +	 * assert/de-assert more than one chip select at once.
> +	 */
> +#define SPI_CONTROLLER_MULTI_CS		BIT(6)
> 
>  	/* Flag indicating if the allocation of this struct is devres-
> managed */
>  	bool			devm_allocated;
> --
> 2.17.1
Mahapatra, Amit Kumar April 11, 2023, 9:07 a.m. UTC | #2
Hello Stefan,

> -----Original Message-----
> From: Stefan Binding <sbinding@opensource.cirrus.com>
> Sent: Thursday, April 6, 2023 7:14 PM
> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
> vigneshr@ti.com
> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
> claudiu.beznea@microchip.com; Simek, Michal <michal.simek@amd.com>;
> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
> Subject: RE: [PATCH V7 1/7] spi: Add stacked and parallel memories support
> in SPI core
> 
> Hi,
> 
> > -----Original Message-----
> > From: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
> > Sent: Thursday, April 6, 2023 7:54 AM
> > To: broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
> > michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
> > vigneshr@ti.com
> > Cc: git@amd.com; sbinding@opensource.cirrus.com; linux-
> > spi@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> > mtd@lists.infradead.org; nicolas.ferre@microchip.com;
> > alexandre.belloni@bootlin.com; claudiu.beznea@microchip.com;
> > michal.simek@amd.com; linux-arm-kernel@lists.infradead.org;
> > amitrkcian2002@gmail.com; Amit Kumar Mahapatra <amit.kumar-
> > mahapatra@amd.com>
> > Subject: [PATCH V7 1/7] spi: Add stacked and parallel memories
> support
> > in SPI core
> >
> > For supporting multiple CS the SPI device need to be aware of all
> the CS
> > values. So, the "chip_select" member in the spi_device structure is
> now
> > an
> > array that holds all the CS values.
> >
> > spi_device structure now has a "cs_index_mask" member. This acts as
> an
> > index to the chip_select array. If nth bit of spi->cs_index_mask is
> set
> > then the driver would assert spi->chip_select[n].
> >
> > In parallel mode all the chip selects are asserted/de-asserted
> > simultaneously and each byte of data is stored in both devices, the
> even
> > bits in one, the odd bits in the other. The split is automatically
> handled
> > by the GQSPI controller. The GQSPI controller supports a maximum of
> > two flashes connected in parallel mode. A SPI_CONTROLLER_MULTI_CS flag
> > bit is added in the spi controntroller flags, through ctlr->flags the
> > spi
> core
> > will make sure that the controller is capable of handling multiple
> chip
> > selects at once.
> >
> > For supporting multiple CS via GPIO the cs_gpiod member of the
> > spi_device structure is now an array that holds the gpio descriptor
> > for each chipselect.
> >
> > Multi CS support using GPIO is not tested due to unavailability of
> > necessary hardware setup.
> >
> > Multi CS configuration with one native CS and one GPIO CS is not
> > supported as this configuration could not be tested due to
> > unavailability of necessary hardware setup.
> 
> I've tested this chain on a released laptop (HP EliteBook 840 G9) which uses
> SPI to interface to 2 amps, one amp uses a native CS and the other uses a
> GPIO CS, and I noticed that when using this chain, the second amp no longer
> works.

Thank you for testing this patch series on GPIO CS setup. As I don't have a 
GPIO CS setup, is it possible for you debug the failure and share more 
details/logs where the problem is?

Regards,
Amit

> 
> Thanks,
> Stefan Binding
> 
> >
> > Signed-off-by: Amit Kumar Mahapatra <amit.kumar-
> mahapatra@amd.com>
> > ---
> >  drivers/spi/spi.c       | 226
> ++++++++++++++++++++++++++++------------
> >  include/linux/spi/spi.h |  32 ++++--
> >  2 files changed, 183 insertions(+), 75 deletions(-)
> >
> > diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index
> > 9036d7a50674..04d7322170c4 100644
> > --- a/drivers/spi/spi.c
> > +++ b/drivers/spi/spi.c
> > @@ -612,10 +612,24 @@ static int spi_dev_check(struct device *dev,
> > void *data)  {
> >  	struct spi_device *spi = to_spi_device(dev);
> >  	struct spi_device *new_spi = data;
> > +	int idx, nw_idx;
> >
> > -	if (spi->controller == new_spi->controller &&
> > -	    spi_get_chipselect(spi, 0) == spi_get_chipselect(new_spi,
> 0))
> > -		return -EBUSY;
> > +	if (spi->controller == new_spi->controller) {
> > +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> > +			for (nw_idx = 0; nw_idx < SPI_CS_CNT_MAX;
> > nw_idx++) {
> > +				if ((idx != 0 &&
> !spi_get_chipselect(spi,
> > idx)) ||
> > +				    (nw_idx != 0 &&
> > !spi_get_chipselect(spi, nw_idx))) {
> > +					continue;
> > +				} else if (spi_get_chipselect(spi,
> idx) ==
> > +				    spi_get_chipselect(new_spi,
> nw_idx))
> > {
> > +					dev_err(dev,
> > +						"chipselect %d already
> > in use\n",
> > +
> > 	spi_get_chipselect(new_spi, nw_idx));
> > +					return -EBUSY;
> > +				}
> > +			}
> > +		}
> > +	}
> >  	return 0;
> >  }
> >
> > @@ -629,7 +643,7 @@ static int __spi_add_device(struct spi_device
> > *spi)
> >  {
> >  	struct spi_controller *ctlr = spi->controller;
> >  	struct device *dev = ctlr->dev.parent;
> > -	int status;
> > +	int status, idx;
> >
> >  	/*
> >  	 * We need to make sure there's no other device with this @@ -638,8
> > +652,6 @@ static int __spi_add_device(struct spi_device
> > *spi)
> >  	 */
> >  	status = bus_for_each_dev(&spi_bus_type, NULL, spi,
> spi_dev_check);
> >  	if (status) {
> > -		dev_err(dev, "chipselect %d already in use\n",
> > -				spi_get_chipselect(spi, 0));
> >  		return status;
> >  	}
> >
> > @@ -649,8 +661,10 @@ static int __spi_add_device(struct spi_device
> > *spi)
> >  		return -ENODEV;
> >  	}
> >
> > -	if (ctlr->cs_gpiods)
> > -		spi_set_csgpiod(spi, 0, ctlr-
> > >cs_gpiods[spi_get_chipselect(spi, 0)]);
> > +	if (ctlr->cs_gpiods) {
> > +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
> > +			spi_set_csgpiod(spi, idx, ctlr-
> > >cs_gpiods[spi_get_chipselect(spi, idx)]);
> > +	}
> >
> >  	/*
> >  	 * Drivers may modify this initial i/o setup, but will @@ -690,13
> > +704,15 @@ int spi_add_device(struct spi_device *spi)  {
> >  	struct spi_controller *ctlr = spi->controller;
> >  	struct device *dev = ctlr->dev.parent;
> > -	int status;
> > +	int status, idx;
> >
> > -	/* Chipselects are numbered 0..max; validate. */
> > -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
> > -		dev_err(dev, "cs%d >= max %d\n",
> > spi_get_chipselect(spi, 0),
> > -			ctlr->num_chipselect);
> > -		return -EINVAL;
> > +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> > +		/* Chipselects are numbered 0..max; validate. */
> > +		if (spi_get_chipselect(spi, idx) >=
> ctlr->num_chipselect) {
> > +			dev_err(dev, "cs%d >= max %d\n",
> > spi_get_chipselect(spi, idx),
> > +				ctlr->num_chipselect);
> > +			return -EINVAL;
> > +		}
> >  	}
> >
> >  	/* Set the bus ID string */
> > @@ -713,12 +729,15 @@ static int spi_add_device_locked(struct
> > spi_device *spi)  {
> >  	struct spi_controller *ctlr = spi->controller;
> >  	struct device *dev = ctlr->dev.parent;
> > +	int idx;
> >
> > -	/* Chipselects are numbered 0..max; validate. */
> > -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
> > -		dev_err(dev, "cs%d >= max %d\n",
> > spi_get_chipselect(spi, 0),
> > -			ctlr->num_chipselect);
> > -		return -EINVAL;
> > +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> > +		/* Chipselects are numbered 0..max; validate. */
> > +		if (spi_get_chipselect(spi, idx) >=
> ctlr->num_chipselect) {
> > +			dev_err(dev, "cs%d >= max %d\n",
> > spi_get_chipselect(spi, idx),
> > +				ctlr->num_chipselect);
> > +			return -EINVAL;
> > +		}
> >  	}
> >
> >  	/* Set the bus ID string */
> > @@ -966,58 +985,118 @@ static void spi_res_release(struct
> > spi_controller *ctlr, struct spi_message *mes  static void
> > spi_set_cs(struct spi_device *spi, bool enable, bool
> force)
> >  {
> >  	bool activate = enable;
> > +	u32 cs_num = __ffs(spi->cs_index_mask);
> > +	int idx;
> >
> >  	/*
> > -	 * Avoid calling into the driver (or doing delays) if the chip
> select
> > -	 * isn't actually changing from the last time this was called.
> > +	 * In parallel mode all the chip selects are
> asserted/de-asserted
> > +	 * at once
> >  	 */
> > -	if (!force && ((enable && spi->controller->last_cs ==
> > spi_get_chipselect(spi, 0)) ||
> > -		       (!enable && spi->controller->last_cs !=
> > spi_get_chipselect(spi, 0))) &&
> > -	    (spi->controller->last_cs_mode_high == (spi->mode &
> > SPI_CS_HIGH)))
> > -		return;
> > -
> > -	trace_spi_set_cs(spi, activate);
> > -
> > -	spi->controller->last_cs = enable ? spi_get_chipselect(spi, 0)
> : -1;
> > -	spi->controller->last_cs_mode_high = spi->mode &
> > SPI_CS_HIGH;
> > -
> > -	if ((spi_get_csgpiod(spi, 0) ||
> !spi->controller->set_cs_timing)
> > && !activate)
> > -		spi_delay_exec(&spi->cs_hold, NULL);
> > -
> > -	if (spi->mode & SPI_CS_HIGH)
> > -		enable = !enable;
> > +	if ((spi->cs_index_mask & SPI_PARALLEL_CS_MASK) ==
> > SPI_PARALLEL_CS_MASK) {
> > +		spi->controller->last_cs_mode_high = spi->mode &
> > SPI_CS_HIGH;
> > +
> > +		if ((spi_get_csgpiod(spi, 0) || !spi->controller-
> > >set_cs_timing) && !activate)
> > +			spi_delay_exec(&spi->cs_hold, NULL);
> > +
> > +		if (spi->mode & SPI_CS_HIGH)
> > +			enable = !enable;
> > +
> > +		if (spi_get_csgpiod(spi, 0) && spi_get_csgpiod(spi,
> 1)) {
> > +			if (!(spi->mode & SPI_NO_CS)) {
> > +				/*
> > +				 * Historically ACPI has no means of
> the
> > GPIO polarity and
> > +				 * thus the SPISerialBus() resource
> > defines it on the per-chip
> > +				 * basis. In order to avoid a chain of
> > negations, the GPIO
> > +				 * polarity is considered being Active
> > High. Even for the cases
> > +				 * when _DSD() is involved (in the
> > updated versions of ACPI)
> > +				 * the GPIO CS polarity must be
> defined
> > Active High to avoid
> > +				 * ambiguity. That's why we use
> enable,
> > that takes SPI_CS_HIGH
> > +				 * into account.
> > +				 */
> > +				if (has_acpi_companion(&spi->dev)) {
> > +					for (idx = 0; idx <
> > SPI_CS_CNT_MAX; idx++)
> > +
> > 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
> > +
> > !enable);
> > +				} else {
> > +					for (idx = 0; idx <
> > SPI_CS_CNT_MAX; idx++)
> > +						/* Polarity handled by
> > GPIO library */
> > +
> > 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
> > +
> > activate);
> > +				}
> > +			}
> > +			/* Some SPI masters need both GPIO CS &
> > slave_select */
> > +			if ((spi->controller->flags &
> > SPI_MASTER_GPIO_SS) &&
> > +			    spi->controller->set_cs)
> > +				spi->controller->set_cs(spi, !enable);
> > +		} else if (spi->controller->set_cs) {
> > +			spi->controller->set_cs(spi, !enable);
> > +		}
> >
> > -	if (spi_get_csgpiod(spi, 0)) {
> > -		if (!(spi->mode & SPI_NO_CS)) {
> > -			/*
> > -			 * Historically ACPI has no means of the GPIO
> > polarity and
> > -			 * thus the SPISerialBus() resource defines it
> on
> > the per-chip
> > -			 * basis. In order to avoid a chain of
> negations,
> > the GPIO
> > -			 * polarity is considered being Active High.
> Even
> > for the cases
> > -			 * when _DSD() is involved (in the updated
> > versions of ACPI)
> > -			 * the GPIO CS polarity must be defined Active
> > High to avoid
> > -			 * ambiguity. That's why we use enable, that
> > takes SPI_CS_HIGH
> > -			 * into account.
> > -			 */
> > -			if (has_acpi_companion(&spi->dev))
> > -
> > 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), !enable);
> > +		if (spi_get_csgpiod(spi, 0) || spi_get_csgpiod(spi, 1)
> ||
> > +		    !spi->controller->set_cs_timing) {
> > +			if (activate)
> > +				spi_delay_exec(&spi->cs_setup, NULL);
> >  			else
> > -				/* Polarity handled by GPIO library */
> > -
> > 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), activate);
> > +				spi_delay_exec(&spi->cs_inactive,
> > NULL);
> >  		}
> > -		/* Some SPI masters need both GPIO CS & slave_select
> > */
> > -		if ((spi->controller->flags & SPI_MASTER_GPIO_SS) &&
> > -		    spi->controller->set_cs)
> > +	} else {
> > +		/*
> > +		 * Avoid calling into the driver (or doing delays) if
> the
> > chip select
> > +		 * isn't actually changing from the last time this was
> > called.
> > +		 */
> > +		if (!force && ((enable && spi->controller->last_cs ==
> > +				spi_get_chipselect(spi, cs_num)) ||
> > +				(!enable && spi->controller->last_cs
> !=
> > +				 spi_get_chipselect(spi, cs_num))) &&
> > +		    (spi->controller->last_cs_mode_high ==
> > +		     (spi->mode & SPI_CS_HIGH)))
> > +			return;
> > +
> > +		trace_spi_set_cs(spi, activate);
> > +
> > +		spi->controller->last_cs = enable ?
> > spi_get_chipselect(spi, cs_num) : -1;
> > +		spi->controller->last_cs_mode_high = spi->mode &
> > SPI_CS_HIGH;
> > +
> > +		if ((spi_get_csgpiod(spi, cs_num) || !spi->controller-
> > >set_cs_timing) && !activate)
> > +			spi_delay_exec(&spi->cs_hold, NULL);
> > +
> > +		if (spi->mode & SPI_CS_HIGH)
> > +			enable = !enable;
> > +
> > +		if (spi_get_csgpiod(spi, cs_num)) {
> > +			if (!(spi->mode & SPI_NO_CS)) {
> > +				/*
> > +				 * Historically ACPI has no means of
> the
> > GPIO polarity and
> > +				 * thus the SPISerialBus() resource
> > defines it on the per-chip
> > +				 * basis. In order to avoid a chain of
> > negations, the GPIO
> > +				 * polarity is considered being Active
> > High. Even for the cases
> > +				 * when _DSD() is involved (in the
> > updated versions of ACPI)
> > +				 * the GPIO CS polarity must be
> defined
> > Active High to avoid
> > +				 * ambiguity. That's why we use
> enable,
> > that takes SPI_CS_HIGH
> > +				 * into account.
> > +				 */
> > +				if (has_acpi_companion(&spi->dev))
> > +
> > 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
> > +
> > !enable);
> > +				else
> > +					/* Polarity handled by GPIO
> > library */
> > +
> > 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
> > +
> > activate);
> > +			}
> > +			/* Some SPI masters need both GPIO CS &
> > slave_select */
> > +			if ((spi->controller->flags &
> > SPI_MASTER_GPIO_SS) &&
> > +			    spi->controller->set_cs)
> > +				spi->controller->set_cs(spi, !enable);
> > +		} else if (spi->controller->set_cs) {
> >  			spi->controller->set_cs(spi, !enable);
> > -	} else if (spi->controller->set_cs) {
> > -		spi->controller->set_cs(spi, !enable);
> > -	}
> > +		}
> >
> > -	if (spi_get_csgpiod(spi, 0) ||
> !spi->controller->set_cs_timing) {
> > -		if (activate)
> > -			spi_delay_exec(&spi->cs_setup, NULL);
> > -		else
> > -			spi_delay_exec(&spi->cs_inactive, NULL);
> > +		if (spi_get_csgpiod(spi, cs_num) || !spi->controller-
> > >set_cs_timing) {
> > +			if (activate)
> > +				spi_delay_exec(&spi->cs_setup, NULL);
> > +			else
> > +				spi_delay_exec(&spi->cs_inactive,
> > NULL);
> > +		}
> >  	}
> >  }
> >
> > @@ -2246,8 +2325,8 @@ static void of_spi_parse_dt_cs_delay(struct
> > device_node *nc,  static int of_spi_parse_dt(struct spi_controller
> > *ctlr, struct
> spi_device
> > *spi,
> >  			   struct device_node *nc)
> >  {
> > -	u32 value;
> > -	int rc;
> > +	u32 value, cs[SPI_CS_CNT_MAX] = {0};
> > +	int rc, idx;
> >
> >  	/* Mode (clock phase/polarity/etc.) */
> >  	if (of_property_read_bool(nc, "spi-cpha")) @@ -2320,13 +2399,21
> @@
> > static int of_spi_parse_dt(struct spi_controller *ctlr, struct
> > spi_device *spi,
> >  	}
> >
> >  	/* Device address */
> > -	rc = of_property_read_u32(nc, "reg", &value);
> > -	if (rc) {
> > +	rc = of_property_read_variable_u32_array(nc, "reg", &cs[0], 1,
> > +						 SPI_CS_CNT_MAX);
> > +	if (rc < 0 || rc > ctlr->num_chipselect) {
> >  		dev_err(&ctlr->dev, "%pOF has no valid 'reg' property
> (%d)\n",
> >  			nc, rc);
> >  		return rc;
> > +	} else if ((of_property_read_bool(nc, "parallel-memories")) &&
> > +		   (!(ctlr->flags & SPI_CONTROLLER_MULTI_CS))) {
> > +		dev_err(&ctlr->dev, "SPI controller doesn't support
> multi
> > CS\n");
> > +		return -EINVAL;
> >  	}
> > -	spi_set_chipselect(spi, 0, value);
> > +	for (idx = 0; idx < rc; idx++)
> > +		spi_set_chipselect(spi, idx, cs[idx]);
> > +	/* By default set the spi->cs_index_mask as 1 */
> > +	spi->cs_index_mask = 0x01;
> >
> >  	/* Device speed */
> >  	if (!of_property_read_u32(nc, "spi-max-frequency", &value)) @@
> > -3907,7 +3994,8 @@ static int __spi_validate(struct spi_device *spi,
> > struct spi_message *message)
> >  	 * cs_change is set for each transfer.
> >  	 */
> >  	if ((spi->mode & SPI_CS_WORD) && (!(ctlr->mode_bits &
> > SPI_CS_WORD) ||
> > -					  spi_get_csgpiod(spi, 0))) {
> > +					  spi_get_csgpiod(spi, 0) ||
> > +					  spi_get_csgpiod(spi, 1))) {
> >  		size_t maxsize;
> >  		int ret;
> >
> > diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index
> > 873ced6ae4ca..6453b246e0af 100644
> > --- a/include/linux/spi/spi.h
> > +++ b/include/linux/spi/spi.h
> > @@ -19,6 +19,11 @@
> >  #include <linux/acpi.h>
> >  #include <linux/u64_stats_sync.h>
> >
> > +/* Max no. of CS supported per spi device */ #define SPI_CS_CNT_MAX 2
> > +
> > +/* chip select mask */
> > +#define SPI_PARALLEL_CS_MASK	(BIT(0) | BIT(1))
> >  struct dma_chan;
> >  struct software_node;
> >  struct ptp_system_timestamp;
> > @@ -166,6 +171,7 @@ extern void
> > spi_transfer_cs_change_delay_exec(struct spi_message *msg,
> >   *	deasserted. If @cs_change_delay is used from @spi_transfer,
> > then the
> >   *	two delays will be added up.
> >   * @pcpu_statistics: statistics for the spi_device
> > + * @cs_index_mask: Bit mask of the active chipselect(s) in the
> > chipselect array
> >   *
> >   * A @spi_device is used to interchange data between an SPI slave
> >   * (usually a discrete chip) and CPU memory.
> > @@ -181,7 +187,7 @@ struct spi_device {
> >  	struct spi_controller	*controller;
> >  	struct spi_controller	*master;	/* Compatibility layer
> */
> >  	u32			max_speed_hz;
> > -	u8			chip_select;
> > +	u8			chip_select[SPI_CS_CNT_MAX];
> >  	u8			bits_per_word;
> >  	bool			rt;
> >  #define SPI_NO_TX	BIT(31)		/* No transmit wire */
> > @@ -202,7 +208,7 @@ struct spi_device {
> >  	void			*controller_data;
> >  	char			modalias[SPI_NAME_SIZE];
> >  	const char		*driver_override;
> > -	struct gpio_desc	*cs_gpiod;	/* Chip select gpio
> desc
> > */
> > +	struct gpio_desc	*cs_gpiod[SPI_CS_CNT_MAX];	/*
> Chip
> > select gpio desc */
> >  	struct spi_delay	word_delay; /* Inter-word delay */
> >  	/* CS delays */
> >  	struct spi_delay	cs_setup;
> > @@ -212,6 +218,13 @@ struct spi_device {
> >  	/* The statistics */
> >  	struct spi_statistics __percpu	*pcpu_statistics;
> >
> > +	/* Bit mask of the chipselect(s) that the driver need to use
> from
> > +	 * the chipselect array.When the controller is capable to
> handle
> > +	 * multiple chip selects & memories are connected in parallel
> > +	 * then more than one bit need to be set in cs_index_mask.
> > +	 */
> > +	u32			cs_index_mask : SPI_CS_CNT_MAX;
> > +
> >  	/*
> >  	 * likely need more hooks for more protocol options affecting how
> >  	 * the controller talks to each chip, like:
> > @@ -268,22 +281,22 @@ static inline void *spi_get_drvdata(const struct
> > spi_device *spi)
> >
> >  static inline u8 spi_get_chipselect(const struct spi_device *spi,
> u8 idx)
> >  {
> > -	return spi->chip_select;
> > +	return spi->chip_select[idx];
> >  }
> >
> >  static inline void spi_set_chipselect(struct spi_device *spi, u8
> idx, u8
> > chipselect)
> >  {
> > -	spi->chip_select = chipselect;
> > +	spi->chip_select[idx] = chipselect;
> >  }
> >
> >  static inline struct gpio_desc *spi_get_csgpiod(const struct
> spi_device
> > *spi, u8 idx)
> >  {
> > -	return spi->cs_gpiod;
> > +	return spi->cs_gpiod[idx];
> >  }
> >
> >  static inline void spi_set_csgpiod(struct spi_device *spi, u8 idx,
> struct
> > gpio_desc *csgpiod)
> >  {
> > -	spi->cs_gpiod = csgpiod;
> > +	spi->cs_gpiod[idx] = csgpiod;
> >  }
> >
> >  /**
> > @@ -388,6 +401,8 @@ extern struct spi_device
> > *spi_new_ancillary_device(struct spi_device *spi, u8 ch
> >   * @bus_lock_spinlock: spinlock for SPI bus locking
> >   * @bus_lock_mutex: mutex for exclusion of multiple callers
> >   * @bus_lock_flag: indicates that the SPI bus is locked for
> exclusive use
> > + * @multi_cs_cap: indicates that the SPI Controller can
> assert/de-assert
> > + *	more than one chip select at once.
> >   * @setup: updates the device mode and clocking records used by a
> >   *	device's SPI controller; protocol code may call this.  This
> >   *	must fail if an unrecognized or unsupported mode is requested.
> > @@ -554,6 +569,11 @@ struct spi_controller {
> >  #define SPI_CONTROLLER_MUST_TX		BIT(4)	/* Requires tx
> > */
> >
> >  #define SPI_MASTER_GPIO_SS		BIT(5)	/* GPIO CS must
> select
> > slave */
> > +	/*
> > +	 * The spi-controller has multi chip select capability and can
> > +	 * assert/de-assert more than one chip select at once.
> > +	 */
> > +#define SPI_CONTROLLER_MULTI_CS		BIT(6)
> >
> >  	/* Flag indicating if the allocation of this struct is devres-
> > managed */
> >  	bool			devm_allocated;
> > --
> > 2.17.1
>
Stefan Binding April 12, 2023, 3:03 p.m. UTC | #3
Hi,

On 11/04/2023 10:07, Mahapatra, Amit Kumar wrote:
> Hello Stefan,
>
>> -----Original Message-----
>> From: Stefan Binding <sbinding@opensource.cirrus.com>
>> Sent: Thursday, April 6, 2023 7:14 PM
>> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
>> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
>> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
>> vigneshr@ti.com
>> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org; linux-
>> kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
>> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
>> claudiu.beznea@microchip.com; Simek, Michal <michal.simek@amd.com>;
>> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
>> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
>> Subject: RE: [PATCH V7 1/7] spi: Add stacked and parallel memories support
>> in SPI core
>>
>> Hi,
>>
>>> -----Original Message-----
>>> From: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
>>> Sent: Thursday, April 6, 2023 7:54 AM
>>> To: broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
>>> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
>>> vigneshr@ti.com
>>> Cc: git@amd.com; sbinding@opensource.cirrus.com; linux-
>>> spi@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
>>> mtd@lists.infradead.org; nicolas.ferre@microchip.com;
>>> alexandre.belloni@bootlin.com; claudiu.beznea@microchip.com;
>>> michal.simek@amd.com; linux-arm-kernel@lists.infradead.org;
>>> amitrkcian2002@gmail.com; Amit Kumar Mahapatra <amit.kumar-
>>> mahapatra@amd.com>
>>> Subject: [PATCH V7 1/7] spi: Add stacked and parallel memories
>> support
>>> in SPI core
>>>
>>> For supporting multiple CS the SPI device need to be aware of all
>> the CS
>>> values. So, the "chip_select" member in the spi_device structure is
>> now
>>> an
>>> array that holds all the CS values.
>>>
>>> spi_device structure now has a "cs_index_mask" member. This acts as
>> an
>>> index to the chip_select array. If nth bit of spi->cs_index_mask is
>> set
>>> then the driver would assert spi->chip_select[n].
>>>
>>> In parallel mode all the chip selects are asserted/de-asserted
>>> simultaneously and each byte of data is stored in both devices, the
>> even
>>> bits in one, the odd bits in the other. The split is automatically
>> handled
>>> by the GQSPI controller. The GQSPI controller supports a maximum of
>>> two flashes connected in parallel mode. A SPI_CONTROLLER_MULTI_CS flag
>>> bit is added in the spi controntroller flags, through ctlr->flags the
>>> spi
>> core
>>> will make sure that the controller is capable of handling multiple
>> chip
>>> selects at once.
>>>
>>> For supporting multiple CS via GPIO the cs_gpiod member of the
>>> spi_device structure is now an array that holds the gpio descriptor
>>> for each chipselect.
>>>
>>> Multi CS support using GPIO is not tested due to unavailability of
>>> necessary hardware setup.
>>>
>>> Multi CS configuration with one native CS and one GPIO CS is not
>>> supported as this configuration could not be tested due to
>>> unavailability of necessary hardware setup.
>> I've tested this chain on a released laptop (HP EliteBook 840 G9) which uses
>> SPI to interface to 2 amps, one amp uses a native CS and the other uses a
>> GPIO CS, and I noticed that when using this chain, the second amp no longer
>> works.
> Thank you for testing this patch series on GPIO CS setup. As I don't have a
> GPIO CS setup, is it possible for you debug the failure and share more
> details/logs where the problem is?
>
> Regards,
> Amit

We are willing and able to debug this failure and share the failure logs.
The first issue that I see is a kernel crash when trying to set the GPIO CS:

[    2.951658] general protection fault, probably for non-canonical 
address 0xdead000000000122: 0000 [#1] PREEMPT SMP NOPTI
[    2.951771] CPU: 9 PID: 379 Comm: systemd-udevd Tainted: G       
A           6.3.0-rc3+ #30
[    2.951826] Hardware name: HP /896D, BIOS U70 Ver. 89.33.02 10/29/2021
[    2.951882] RIP: 0010:gpiod_set_value_cansleep+0x21/0xa0
[    2.951941] Code: 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 48 85 ff 
74 3e 55 48 89 e5 41 55 41 89 f5 41 54 49 89 fc 48 81 ff 00 f0 ff ff 77 
2c <48> 8b 3f 48 85 ff 74 53 48 83 bf 68 03 00 00 00 74 34 44 89 ee 4c
[    2.952043] RSP: 0018:ffffc008c0deb928 EFLAGS: 00010287
[    2.952080] RAX: 0000000000000001 RBX: ffffa0a489534c00 RCX: 
0000000000000000
[    2.952124] RDX: dead000000000122 RSI: 0000000000000001 RDI: 
dead000000000122
[    2.952167] RBP: ffffc008c0deb938 R08: 0000000000000000 R09: 
ffffc008c0deb868
[    2.952211] R10: ffffffffffffffff R11: 00000000000000b0 R12: 
dead000000000122
[    2.952256] R13: 0000000000000001 R14: 0000000000000000 R15: 
0000000000000000
[    2.952299] FS:  00007f7fa5b5b880(0000) GS:ffffa0a81f840000(0000) 
knlGS:0000000000000000
[    2.952369] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    2.952407] CR2: 000055d648427100 CR3: 000000010e960003 CR4: 
0000000000770ee0
[    2.952451] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 
0000000000000000
[    2.952492] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7: 
0000000000000400
[    2.952533] PKRU: 55555554
[    2.952561] Call Trace:
[    2.952579]  <TASK>
[    2.952598]  spi_set_cs+0x257/0x4a0
[    2.952630]  spi_setup+0x1a2/0x500
[    2.952667]  __spi_add_device+0x88/0x160
[    2.952710]  spi_add_device+0x60/0x90
[    2.952738]  smi_spi_probe+0x178/0x370 [serial_multi_instantiate]
[    2.952792]  smi_probe+0xcf/0x110 [serial_multi_instantiate]
[    2.952854]  platform_probe+0x42/0xb0
[    2.952885]  really_probe+0x1b2/0x420
[    2.952914]  __driver_probe_device+0x7e/0x180
[    2.952947]  driver_probe_device+0x23/0xa0
[    2.952993]  __driver_attach+0xe4/0x1e0
[    2.953021]  ? __pfx___driver_attach+0x10/0x10
[    2.953061]  bus_for_each_dev+0x7a/0xd0
[    2.953088]  driver_attach+0x1e/0x30
[    2.953123]  bus_add_driver+0x11c/0x220
[    2.953150]  driver_register+0x64/0x130
[    2.953174]  ? __pfx_init_module+0x10/0x10 [serial_multi_instantiate]
[    2.953221]  __platform_driver_register+0x1e/0x30
[    2.953251]  smi_driver_init+0x1c/0xff0 [serial_multi_instantiate]
[    2.953310]  do_one_initcall+0x46/0x220
[    2.953339]  ? kmalloc_trace+0x2a/0xa0
[    2.953375]  do_init_module+0x52/0x220
[    2.953411]  load_module+0x223c/0x2460
[    2.953450]  __do_sys_finit_module+0xc8/0x140
[    2.953479]  ? __do_sys_finit_module+0xc8/0x140
[    2.953510]  __x64_sys_finit_module+0x18/0x20
[    2.953538]  do_syscall_64+0x38/0x90
[    2.953574]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
[    2.953606] RIP: 0033:0x7f7fa5d7476d
[    2.953639] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 
48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 
05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f3 36 0d 00 f7 d8 64 89 01 48
[    2.953739] RSP: 002b:00007fff1f8dd3b8 EFLAGS: 00000246 ORIG_RAX: 
0000000000000139
[    2.956833] RAX: ffffffffffffffda RBX: 000055d648654ab0 RCX: 
00007f7fa5d7476d
[    2.959202] RDX: 0000000000000000 RSI: 00007f7fa5c54ded RDI: 
0000000000000006
[    2.961542] RBP: 0000000000020000 R08: 0000000000000000 R09: 
0000000000000000
[    2.964312] R10: 0000000000000006 R11: 0000000000000246 R12: 
00007f7fa5c54ded
[    2.966694] R13: 0000000000000000 R14: 000055d6483f41a0 R15: 
000055d648654ab0
[    2.967668] resource: resource sanity check: requesting [mem 
0x00000000fedc0000-0x00000000fedcffff], which spans more than pnp 00:04 
[mem 0xfedc0000-0xfedc7fff]
[    2.968998]  </TASK>
[    2.971615] caller igen6_probe+0x178/0x8e0 [igen6_edac] mapping 
multiple BARs
[    2.975014] Modules linked in: igen6_edac(+) fjes(-) 
serial_multi_instantiate(+) int3403_thermal sch_fq_codel 
int340x_thermal_zone int3400_thermal intel_hid acpi_thermal_rel acpi_tad 
sparse_keymap acpi_pad mac_hid msr parport_pc ppdev lp parport drm 
ramoops reed_solomon efi_pstore ip_tables x_tables autofs4 
spi_pxa2xx_platform dw_dmac dw_dmac_core nvme intel_lpss_pci intel_lpss 
crc32_pclmul thunderbolt i2c_i801 xhci_pci idma64 nvme_core i2c_smbus 
virt_dma xhci_pci_renesas video wmi pinctrl_tigerlake
[    2.987901] ---[ end trace 0000000000000000 ]---
[    3.157030] RIP: 0010:gpiod_set_value_cansleep+0x21/0xa0
[    3.159077] Code: 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 48 85 ff 
74 3e 55 48 89 e5 41 55 41 89 f5 41 54 49 89 fc 48 81 ff 00 f0 ff ff 77 
2c <48> 8b 3f 48 85 ff 74 53 48 83 bf 68 03 00 00 00 74 34 44 89 ee 4c
[    3.161461] RSP: 0018:ffffc008c0deb928 EFLAGS: 00010287
[    3.164005] RAX: 0000000000000001 RBX: ffffa0a489534c00 RCX: 
0000000000000000
[    3.166354] RDX: dead000000000122 RSI: 0000000000000001 RDI: 
dead000000000122
[    3.168499] RBP: ffffc008c0deb938 R08: 0000000000000000 R09: 
ffffc008c0deb868
[    3.170609] R10: ffffffffffffffff R11: 00000000000000b0 R12: 
dead000000000122
[    3.172893] R13: 0000000000000001 R14: 0000000000000000 R15: 
0000000000000000
[    3.175335] FS:  00007f7fa5b5b880(0000) GS:ffffa0a81f840000(0000) 
knlGS:0000000000000000
[    3.180434] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    3.183356] CR2: 000055d648427100 CR3: 000000010e960003 CR4: 
0000000000770ee0
[    3.185107] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 
0000000000000000
[    3.186840] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7: 
0000000000000400
[    3.188647] PKRU: 55555554

Thanks,

Stefan

>
>> Thanks,
>> Stefan Binding
>>
>>> Signed-off-by: Amit Kumar Mahapatra <amit.kumar-
>> mahapatra@amd.com>
>>> ---
>>>   drivers/spi/spi.c       | 226
>> ++++++++++++++++++++++++++++------------
>>>   include/linux/spi/spi.h |  32 ++++--
>>>   2 files changed, 183 insertions(+), 75 deletions(-)
>>>
>>> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index
>>> 9036d7a50674..04d7322170c4 100644
>>> --- a/drivers/spi/spi.c
>>> +++ b/drivers/spi/spi.c
>>> @@ -612,10 +612,24 @@ static int spi_dev_check(struct device *dev,
>>> void *data)  {
>>>   	struct spi_device *spi = to_spi_device(dev);
>>>   	struct spi_device *new_spi = data;
>>> +	int idx, nw_idx;
>>>
>>> -	if (spi->controller == new_spi->controller &&
>>> -	    spi_get_chipselect(spi, 0) == spi_get_chipselect(new_spi,
>> 0))
>>> -		return -EBUSY;
>>> +	if (spi->controller == new_spi->controller) {
>>> +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>>> +			for (nw_idx = 0; nw_idx < SPI_CS_CNT_MAX;
>>> nw_idx++) {
>>> +				if ((idx != 0 &&
>> !spi_get_chipselect(spi,
>>> idx)) ||
>>> +				    (nw_idx != 0 &&
>>> !spi_get_chipselect(spi, nw_idx))) {
>>> +					continue;
>>> +				} else if (spi_get_chipselect(spi,
>> idx) ==
>>> +				    spi_get_chipselect(new_spi,
>> nw_idx))
>>> {
>>> +					dev_err(dev,
>>> +						"chipselect %d already
>>> in use\n",
>>> +
>>> 	spi_get_chipselect(new_spi, nw_idx));
>>> +					return -EBUSY;
>>> +				}
>>> +			}
>>> +		}
>>> +	}
>>>   	return 0;
>>>   }
>>>
>>> @@ -629,7 +643,7 @@ static int __spi_add_device(struct spi_device
>>> *spi)
>>>   {
>>>   	struct spi_controller *ctlr = spi->controller;
>>>   	struct device *dev = ctlr->dev.parent;
>>> -	int status;
>>> +	int status, idx;
>>>
>>>   	/*
>>>   	 * We need to make sure there's no other device with this @@ -638,8
>>> +652,6 @@ static int __spi_add_device(struct spi_device
>>> *spi)
>>>   	 */
>>>   	status = bus_for_each_dev(&spi_bus_type, NULL, spi,
>> spi_dev_check);
>>>   	if (status) {
>>> -		dev_err(dev, "chipselect %d already in use\n",
>>> -				spi_get_chipselect(spi, 0));
>>>   		return status;
>>>   	}
>>>
>>> @@ -649,8 +661,10 @@ static int __spi_add_device(struct spi_device
>>> *spi)
>>>   		return -ENODEV;
>>>   	}
>>>
>>> -	if (ctlr->cs_gpiods)
>>> -		spi_set_csgpiod(spi, 0, ctlr-
>>>> cs_gpiods[spi_get_chipselect(spi, 0)]);
>>> +	if (ctlr->cs_gpiods) {
>>> +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
>>> +			spi_set_csgpiod(spi, idx, ctlr-
>>>> cs_gpiods[spi_get_chipselect(spi, idx)]);
>>> +	}
>>>
>>>   	/*
>>>   	 * Drivers may modify this initial i/o setup, but will @@ -690,13
>>> +704,15 @@ int spi_add_device(struct spi_device *spi)  {
>>>   	struct spi_controller *ctlr = spi->controller;
>>>   	struct device *dev = ctlr->dev.parent;
>>> -	int status;
>>> +	int status, idx;
>>>
>>> -	/* Chipselects are numbered 0..max; validate. */
>>> -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
>>> -		dev_err(dev, "cs%d >= max %d\n",
>>> spi_get_chipselect(spi, 0),
>>> -			ctlr->num_chipselect);
>>> -		return -EINVAL;
>>> +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>>> +		/* Chipselects are numbered 0..max; validate. */
>>> +		if (spi_get_chipselect(spi, idx) >=
>> ctlr->num_chipselect) {
>>> +			dev_err(dev, "cs%d >= max %d\n",
>>> spi_get_chipselect(spi, idx),
>>> +				ctlr->num_chipselect);
>>> +			return -EINVAL;
>>> +		}
>>>   	}
>>>
>>>   	/* Set the bus ID string */
>>> @@ -713,12 +729,15 @@ static int spi_add_device_locked(struct
>>> spi_device *spi)  {
>>>   	struct spi_controller *ctlr = spi->controller;
>>>   	struct device *dev = ctlr->dev.parent;
>>> +	int idx;
>>>
>>> -	/* Chipselects are numbered 0..max; validate. */
>>> -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
>>> -		dev_err(dev, "cs%d >= max %d\n",
>>> spi_get_chipselect(spi, 0),
>>> -			ctlr->num_chipselect);
>>> -		return -EINVAL;
>>> +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>>> +		/* Chipselects are numbered 0..max; validate. */
>>> +		if (spi_get_chipselect(spi, idx) >=
>> ctlr->num_chipselect) {
>>> +			dev_err(dev, "cs%d >= max %d\n",
>>> spi_get_chipselect(spi, idx),
>>> +				ctlr->num_chipselect);
>>> +			return -EINVAL;
>>> +		}
>>>   	}
>>>
>>>   	/* Set the bus ID string */
>>> @@ -966,58 +985,118 @@ static void spi_res_release(struct
>>> spi_controller *ctlr, struct spi_message *mes  static void
>>> spi_set_cs(struct spi_device *spi, bool enable, bool
>> force)
>>>   {
>>>   	bool activate = enable;
>>> +	u32 cs_num = __ffs(spi->cs_index_mask);
>>> +	int idx;
>>>
>>>   	/*
>>> -	 * Avoid calling into the driver (or doing delays) if the chip
>> select
>>> -	 * isn't actually changing from the last time this was called.
>>> +	 * In parallel mode all the chip selects are
>> asserted/de-asserted
>>> +	 * at once
>>>   	 */
>>> -	if (!force && ((enable && spi->controller->last_cs ==
>>> spi_get_chipselect(spi, 0)) ||
>>> -		       (!enable && spi->controller->last_cs !=
>>> spi_get_chipselect(spi, 0))) &&
>>> -	    (spi->controller->last_cs_mode_high == (spi->mode &
>>> SPI_CS_HIGH)))
>>> -		return;
>>> -
>>> -	trace_spi_set_cs(spi, activate);
>>> -
>>> -	spi->controller->last_cs = enable ? spi_get_chipselect(spi, 0)
>> : -1;
>>> -	spi->controller->last_cs_mode_high = spi->mode &
>>> SPI_CS_HIGH;
>>> -
>>> -	if ((spi_get_csgpiod(spi, 0) ||
>> !spi->controller->set_cs_timing)
>>> && !activate)
>>> -		spi_delay_exec(&spi->cs_hold, NULL);
>>> -
>>> -	if (spi->mode & SPI_CS_HIGH)
>>> -		enable = !enable;
>>> +	if ((spi->cs_index_mask & SPI_PARALLEL_CS_MASK) ==
>>> SPI_PARALLEL_CS_MASK) {
>>> +		spi->controller->last_cs_mode_high = spi->mode &
>>> SPI_CS_HIGH;
>>> +
>>> +		if ((spi_get_csgpiod(spi, 0) || !spi->controller-
>>>> set_cs_timing) && !activate)
>>> +			spi_delay_exec(&spi->cs_hold, NULL);
>>> +
>>> +		if (spi->mode & SPI_CS_HIGH)
>>> +			enable = !enable;
>>> +
>>> +		if (spi_get_csgpiod(spi, 0) && spi_get_csgpiod(spi,
>> 1)) {
>>> +			if (!(spi->mode & SPI_NO_CS)) {
>>> +				/*
>>> +				 * Historically ACPI has no means of
>> the
>>> GPIO polarity and
>>> +				 * thus the SPISerialBus() resource
>>> defines it on the per-chip
>>> +				 * basis. In order to avoid a chain of
>>> negations, the GPIO
>>> +				 * polarity is considered being Active
>>> High. Even for the cases
>>> +				 * when _DSD() is involved (in the
>>> updated versions of ACPI)
>>> +				 * the GPIO CS polarity must be
>> defined
>>> Active High to avoid
>>> +				 * ambiguity. That's why we use
>> enable,
>>> that takes SPI_CS_HIGH
>>> +				 * into account.
>>> +				 */
>>> +				if (has_acpi_companion(&spi->dev)) {
>>> +					for (idx = 0; idx <
>>> SPI_CS_CNT_MAX; idx++)
>>> +
>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
>>> +
>>> !enable);
>>> +				} else {
>>> +					for (idx = 0; idx <
>>> SPI_CS_CNT_MAX; idx++)
>>> +						/* Polarity handled by
>>> GPIO library */
>>> +
>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
>>> +
>>> activate);
>>> +				}
>>> +			}
>>> +			/* Some SPI masters need both GPIO CS &
>>> slave_select */
>>> +			if ((spi->controller->flags &
>>> SPI_MASTER_GPIO_SS) &&
>>> +			    spi->controller->set_cs)
>>> +				spi->controller->set_cs(spi, !enable);
>>> +		} else if (spi->controller->set_cs) {
>>> +			spi->controller->set_cs(spi, !enable);
>>> +		}
>>>
>>> -	if (spi_get_csgpiod(spi, 0)) {
>>> -		if (!(spi->mode & SPI_NO_CS)) {
>>> -			/*
>>> -			 * Historically ACPI has no means of the GPIO
>>> polarity and
>>> -			 * thus the SPISerialBus() resource defines it
>> on
>>> the per-chip
>>> -			 * basis. In order to avoid a chain of
>> negations,
>>> the GPIO
>>> -			 * polarity is considered being Active High.
>> Even
>>> for the cases
>>> -			 * when _DSD() is involved (in the updated
>>> versions of ACPI)
>>> -			 * the GPIO CS polarity must be defined Active
>>> High to avoid
>>> -			 * ambiguity. That's why we use enable, that
>>> takes SPI_CS_HIGH
>>> -			 * into account.
>>> -			 */
>>> -			if (has_acpi_companion(&spi->dev))
>>> -
>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), !enable);
>>> +		if (spi_get_csgpiod(spi, 0) || spi_get_csgpiod(spi, 1)
>> ||
>>> +		    !spi->controller->set_cs_timing) {
>>> +			if (activate)
>>> +				spi_delay_exec(&spi->cs_setup, NULL);
>>>   			else
>>> -				/* Polarity handled by GPIO library */
>>> -
>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), activate);
>>> +				spi_delay_exec(&spi->cs_inactive,
>>> NULL);
>>>   		}
>>> -		/* Some SPI masters need both GPIO CS & slave_select
>>> */
>>> -		if ((spi->controller->flags & SPI_MASTER_GPIO_SS) &&
>>> -		    spi->controller->set_cs)
>>> +	} else {
>>> +		/*
>>> +		 * Avoid calling into the driver (or doing delays) if
>> the
>>> chip select
>>> +		 * isn't actually changing from the last time this was
>>> called.
>>> +		 */
>>> +		if (!force && ((enable && spi->controller->last_cs ==
>>> +				spi_get_chipselect(spi, cs_num)) ||
>>> +				(!enable && spi->controller->last_cs
>> !=
>>> +				 spi_get_chipselect(spi, cs_num))) &&
>>> +		    (spi->controller->last_cs_mode_high ==
>>> +		     (spi->mode & SPI_CS_HIGH)))
>>> +			return;
>>> +
>>> +		trace_spi_set_cs(spi, activate);
>>> +
>>> +		spi->controller->last_cs = enable ?
>>> spi_get_chipselect(spi, cs_num) : -1;
>>> +		spi->controller->last_cs_mode_high = spi->mode &
>>> SPI_CS_HIGH;
>>> +
>>> +		if ((spi_get_csgpiod(spi, cs_num) || !spi->controller-
>>>> set_cs_timing) && !activate)
>>> +			spi_delay_exec(&spi->cs_hold, NULL);
>>> +
>>> +		if (spi->mode & SPI_CS_HIGH)
>>> +			enable = !enable;
>>> +
>>> +		if (spi_get_csgpiod(spi, cs_num)) {
>>> +			if (!(spi->mode & SPI_NO_CS)) {
>>> +				/*
>>> +				 * Historically ACPI has no means of
>> the
>>> GPIO polarity and
>>> +				 * thus the SPISerialBus() resource
>>> defines it on the per-chip
>>> +				 * basis. In order to avoid a chain of
>>> negations, the GPIO
>>> +				 * polarity is considered being Active
>>> High. Even for the cases
>>> +				 * when _DSD() is involved (in the
>>> updated versions of ACPI)
>>> +				 * the GPIO CS polarity must be
>> defined
>>> Active High to avoid
>>> +				 * ambiguity. That's why we use
>> enable,
>>> that takes SPI_CS_HIGH
>>> +				 * into account.
>>> +				 */
>>> +				if (has_acpi_companion(&spi->dev))
>>> +
>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
>>> +
>>> !enable);
>>> +				else
>>> +					/* Polarity handled by GPIO
>>> library */
>>> +
>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
>>> +
>>> activate);
>>> +			}
>>> +			/* Some SPI masters need both GPIO CS &
>>> slave_select */
>>> +			if ((spi->controller->flags &
>>> SPI_MASTER_GPIO_SS) &&
>>> +			    spi->controller->set_cs)
>>> +				spi->controller->set_cs(spi, !enable);
>>> +		} else if (spi->controller->set_cs) {
>>>   			spi->controller->set_cs(spi, !enable);
>>> -	} else if (spi->controller->set_cs) {
>>> -		spi->controller->set_cs(spi, !enable);
>>> -	}
>>> +		}
>>>
>>> -	if (spi_get_csgpiod(spi, 0) ||
>> !spi->controller->set_cs_timing) {
>>> -		if (activate)
>>> -			spi_delay_exec(&spi->cs_setup, NULL);
>>> -		else
>>> -			spi_delay_exec(&spi->cs_inactive, NULL);
>>> +		if (spi_get_csgpiod(spi, cs_num) || !spi->controller-
>>>> set_cs_timing) {
>>> +			if (activate)
>>> +				spi_delay_exec(&spi->cs_setup, NULL);
>>> +			else
>>> +				spi_delay_exec(&spi->cs_inactive,
>>> NULL);
>>> +		}
>>>   	}
>>>   }
>>>
>>> @@ -2246,8 +2325,8 @@ static void of_spi_parse_dt_cs_delay(struct
>>> device_node *nc,  static int of_spi_parse_dt(struct spi_controller
>>> *ctlr, struct
>> spi_device
>>> *spi,
>>>   			   struct device_node *nc)
>>>   {
>>> -	u32 value;
>>> -	int rc;
>>> +	u32 value, cs[SPI_CS_CNT_MAX] = {0};
>>> +	int rc, idx;
>>>
>>>   	/* Mode (clock phase/polarity/etc.) */
>>>   	if (of_property_read_bool(nc, "spi-cpha")) @@ -2320,13 +2399,21
>> @@
>>> static int of_spi_parse_dt(struct spi_controller *ctlr, struct
>>> spi_device *spi,
>>>   	}
>>>
>>>   	/* Device address */
>>> -	rc = of_property_read_u32(nc, "reg", &value);
>>> -	if (rc) {
>>> +	rc = of_property_read_variable_u32_array(nc, "reg", &cs[0], 1,
>>> +						 SPI_CS_CNT_MAX);
>>> +	if (rc < 0 || rc > ctlr->num_chipselect) {
>>>   		dev_err(&ctlr->dev, "%pOF has no valid 'reg' property
>> (%d)\n",
>>>   			nc, rc);
>>>   		return rc;
>>> +	} else if ((of_property_read_bool(nc, "parallel-memories")) &&
>>> +		   (!(ctlr->flags & SPI_CONTROLLER_MULTI_CS))) {
>>> +		dev_err(&ctlr->dev, "SPI controller doesn't support
>> multi
>>> CS\n");
>>> +		return -EINVAL;
>>>   	}
>>> -	spi_set_chipselect(spi, 0, value);
>>> +	for (idx = 0; idx < rc; idx++)
>>> +		spi_set_chipselect(spi, idx, cs[idx]);
>>> +	/* By default set the spi->cs_index_mask as 1 */
>>> +	spi->cs_index_mask = 0x01;
>>>
>>>   	/* Device speed */
>>>   	if (!of_property_read_u32(nc, "spi-max-frequency", &value)) @@
>>> -3907,7 +3994,8 @@ static int __spi_validate(struct spi_device *spi,
>>> struct spi_message *message)
>>>   	 * cs_change is set for each transfer.
>>>   	 */
>>>   	if ((spi->mode & SPI_CS_WORD) && (!(ctlr->mode_bits &
>>> SPI_CS_WORD) ||
>>> -					  spi_get_csgpiod(spi, 0))) {
>>> +					  spi_get_csgpiod(spi, 0) ||
>>> +					  spi_get_csgpiod(spi, 1))) {
>>>   		size_t maxsize;
>>>   		int ret;
>>>
>>> diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index
>>> 873ced6ae4ca..6453b246e0af 100644
>>> --- a/include/linux/spi/spi.h
>>> +++ b/include/linux/spi/spi.h
>>> @@ -19,6 +19,11 @@
>>>   #include <linux/acpi.h>
>>>   #include <linux/u64_stats_sync.h>
>>>
>>> +/* Max no. of CS supported per spi device */ #define SPI_CS_CNT_MAX 2
>>> +
>>> +/* chip select mask */
>>> +#define SPI_PARALLEL_CS_MASK	(BIT(0) | BIT(1))
>>>   struct dma_chan;
>>>   struct software_node;
>>>   struct ptp_system_timestamp;
>>> @@ -166,6 +171,7 @@ extern void
>>> spi_transfer_cs_change_delay_exec(struct spi_message *msg,
>>>    *	deasserted. If @cs_change_delay is used from @spi_transfer,
>>> then the
>>>    *	two delays will be added up.
>>>    * @pcpu_statistics: statistics for the spi_device
>>> + * @cs_index_mask: Bit mask of the active chipselect(s) in the
>>> chipselect array
>>>    *
>>>    * A @spi_device is used to interchange data between an SPI slave
>>>    * (usually a discrete chip) and CPU memory.
>>> @@ -181,7 +187,7 @@ struct spi_device {
>>>   	struct spi_controller	*controller;
>>>   	struct spi_controller	*master;	/* Compatibility layer
>> */
>>>   	u32			max_speed_hz;
>>> -	u8			chip_select;
>>> +	u8			chip_select[SPI_CS_CNT_MAX];
>>>   	u8			bits_per_word;
>>>   	bool			rt;
>>>   #define SPI_NO_TX	BIT(31)		/* No transmit wire */
>>> @@ -202,7 +208,7 @@ struct spi_device {
>>>   	void			*controller_data;
>>>   	char			modalias[SPI_NAME_SIZE];
>>>   	const char		*driver_override;
>>> -	struct gpio_desc	*cs_gpiod;	/* Chip select gpio
>> desc
>>> */
>>> +	struct gpio_desc	*cs_gpiod[SPI_CS_CNT_MAX];	/*
>> Chip
>>> select gpio desc */
>>>   	struct spi_delay	word_delay; /* Inter-word delay */
>>>   	/* CS delays */
>>>   	struct spi_delay	cs_setup;
>>> @@ -212,6 +218,13 @@ struct spi_device {
>>>   	/* The statistics */
>>>   	struct spi_statistics __percpu	*pcpu_statistics;
>>>
>>> +	/* Bit mask of the chipselect(s) that the driver need to use
>> from
>>> +	 * the chipselect array.When the controller is capable to
>> handle
>>> +	 * multiple chip selects & memories are connected in parallel
>>> +	 * then more than one bit need to be set in cs_index_mask.
>>> +	 */
>>> +	u32			cs_index_mask : SPI_CS_CNT_MAX;
>>> +
>>>   	/*
>>>   	 * likely need more hooks for more protocol options affecting how
>>>   	 * the controller talks to each chip, like:
>>> @@ -268,22 +281,22 @@ static inline void *spi_get_drvdata(const struct
>>> spi_device *spi)
>>>
>>>   static inline u8 spi_get_chipselect(const struct spi_device *spi,
>> u8 idx)
>>>   {
>>> -	return spi->chip_select;
>>> +	return spi->chip_select[idx];
>>>   }
>>>
>>>   static inline void spi_set_chipselect(struct spi_device *spi, u8
>> idx, u8
>>> chipselect)
>>>   {
>>> -	spi->chip_select = chipselect;
>>> +	spi->chip_select[idx] = chipselect;
>>>   }
>>>
>>>   static inline struct gpio_desc *spi_get_csgpiod(const struct
>> spi_device
>>> *spi, u8 idx)
>>>   {
>>> -	return spi->cs_gpiod;
>>> +	return spi->cs_gpiod[idx];
>>>   }
>>>
>>>   static inline void spi_set_csgpiod(struct spi_device *spi, u8 idx,
>> struct
>>> gpio_desc *csgpiod)
>>>   {
>>> -	spi->cs_gpiod = csgpiod;
>>> +	spi->cs_gpiod[idx] = csgpiod;
>>>   }
>>>
>>>   /**
>>> @@ -388,6 +401,8 @@ extern struct spi_device
>>> *spi_new_ancillary_device(struct spi_device *spi, u8 ch
>>>    * @bus_lock_spinlock: spinlock for SPI bus locking
>>>    * @bus_lock_mutex: mutex for exclusion of multiple callers
>>>    * @bus_lock_flag: indicates that the SPI bus is locked for
>> exclusive use
>>> + * @multi_cs_cap: indicates that the SPI Controller can
>> assert/de-assert
>>> + *	more than one chip select at once.
>>>    * @setup: updates the device mode and clocking records used by a
>>>    *	device's SPI controller; protocol code may call this.  This
>>>    *	must fail if an unrecognized or unsupported mode is requested.
>>> @@ -554,6 +569,11 @@ struct spi_controller {
>>>   #define SPI_CONTROLLER_MUST_TX		BIT(4)	/* Requires tx
>>> */
>>>
>>>   #define SPI_MASTER_GPIO_SS		BIT(5)	/* GPIO CS must
>> select
>>> slave */
>>> +	/*
>>> +	 * The spi-controller has multi chip select capability and can
>>> +	 * assert/de-assert more than one chip select at once.
>>> +	 */
>>> +#define SPI_CONTROLLER_MULTI_CS		BIT(6)
>>>
>>>   	/* Flag indicating if the allocation of this struct is devres-
>>> managed */
>>>   	bool			devm_allocated;
>>> --
>>> 2.17.1
Mahapatra, Amit Kumar April 20, 2023, 9:04 a.m. UTC | #4
Hello Stefan,

> -----Original Message-----
> From: Stefan Binding <sbinding@opensource.cirrus.com>
> Sent: Wednesday, April 12, 2023 8:33 PM
> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
> vigneshr@ti.com
> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
> claudiu.beznea@microchip.com; Simek, Michal <michal.simek@amd.com>;
> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
> Subject: Re: [PATCH V7 1/7] spi: Add stacked and parallel memories support
> in SPI core
> 
> Hi,
> 
> On 11/04/2023 10:07, Mahapatra, Amit Kumar wrote:
> > Hello Stefan,
> >
> >> -----Original Message-----
> >> From: Stefan Binding <sbinding@opensource.cirrus.com>
> >> Sent: Thursday, April 6, 2023 7:14 PM
> >> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
> >> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
> >> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
> >> vigneshr@ti.com
> >> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org; linux-
> >> kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
> >> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
> >> claudiu.beznea@microchip.com; Simek, Michal
> <michal.simek@amd.com>;
> >> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
> >> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
> >> Subject: RE: [PATCH V7 1/7] spi: Add stacked and parallel memories
> >> support in SPI core
> >>
> >> Hi,
> >>
> >>> -----Original Message-----
> >>> From: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
> >>> Sent: Thursday, April 6, 2023 7:54 AM
> >>> To: broonie@kernel.org; tudor.ambarus@linaro.org;
> >>> pratyush@kernel.org; michael@walle.cc; miquel.raynal@bootlin.com;
> >>> richard@nod.at; vigneshr@ti.com
> >>> Cc: git@amd.com; sbinding@opensource.cirrus.com; linux-
> >>> spi@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> >>> mtd@lists.infradead.org; nicolas.ferre@microchip.com;
> >>> alexandre.belloni@bootlin.com; claudiu.beznea@microchip.com;
> >>> michal.simek@amd.com; linux-arm-kernel@lists.infradead.org;
> >>> amitrkcian2002@gmail.com; Amit Kumar Mahapatra <amit.kumar-
> >>> mahapatra@amd.com>
> >>> Subject: [PATCH V7 1/7] spi: Add stacked and parallel memories
> >> support
> >>> in SPI core
> >>>
> >>> For supporting multiple CS the SPI device need to be aware of all
> >> the CS
> >>> values. So, the "chip_select" member in the spi_device structure is
> >> now
> >>> an
> >>> array that holds all the CS values.
> >>>
> >>> spi_device structure now has a "cs_index_mask" member. This acts as
> >> an
> >>> index to the chip_select array. If nth bit of spi->cs_index_mask is
> >> set
> >>> then the driver would assert spi->chip_select[n].
> >>>
> >>> In parallel mode all the chip selects are asserted/de-asserted
> >>> simultaneously and each byte of data is stored in both devices, the
> >> even
> >>> bits in one, the odd bits in the other. The split is automatically
> >> handled
> >>> by the GQSPI controller. The GQSPI controller supports a maximum of
> >>> two flashes connected in parallel mode. A SPI_CONTROLLER_MULTI_CS
> >>> flag bit is added in the spi controntroller flags, through
> >>> ctlr->flags the spi
> >> core
> >>> will make sure that the controller is capable of handling multiple
> >> chip
> >>> selects at once.
> >>>
> >>> For supporting multiple CS via GPIO the cs_gpiod member of the
> >>> spi_device structure is now an array that holds the gpio descriptor
> >>> for each chipselect.
> >>>
> >>> Multi CS support using GPIO is not tested due to unavailability of
> >>> necessary hardware setup.
> >>>
> >>> Multi CS configuration with one native CS and one GPIO CS is not
> >>> supported as this configuration could not be tested due to
> >>> unavailability of necessary hardware setup.
> >> I've tested this chain on a released laptop (HP EliteBook 840 G9)
> >> which uses SPI to interface to 2 amps, one amp uses a native CS and
> >> the other uses a GPIO CS, and I noticed that when using this chain,
> >> the second amp no longer works.
> > Thank you for testing this patch series on GPIO CS setup. As I don't
> > have a GPIO CS setup, is it possible for you debug the failure and
> > share more details/logs where the problem is?
> >
> > Regards,
> > Amit
> 
> We are willing and able to debug this failure and share the failure logs.
> The first issue that I see is a kernel crash when trying to set the GPIO CS:
> 
> [    2.951658] general protection fault, probably for non-canonical address
> 0xdead000000000122: 0000 [#1] PREEMPT SMP NOPTI [    2.951771] CPU: 9
> PID: 379 Comm: systemd-udevd Tainted: G A           6.3.0-rc3+ #30
> [    2.951826] Hardware name: HP /896D, BIOS U70 Ver. 89.33.02 10/29/2021
> [    2.951882] RIP: 0010:gpiod_set_value_cansleep+0x21/0xa0
> [    2.951941] Code: 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 48 85 ff
> 74 3e 55 48 89 e5 41 55 41 89 f5 41 54 49 89 fc 48 81 ff 00 f0 ff ff 77 2c <48>
> 8b 3f 48 85 ff 74 53 48 83 bf 68 03 00 00 00 74 34 44 89 ee 4c [    2.952043]
> RSP: 0018:ffffc008c0deb928 EFLAGS: 00010287 [    2.952080] RAX:
> 0000000000000001 RBX: ffffa0a489534c00 RCX:
> 0000000000000000
> [    2.952124] RDX: dead000000000122 RSI: 0000000000000001 RDI:
> dead000000000122
> [    2.952167] RBP: ffffc008c0deb938 R08: 0000000000000000 R09:
> ffffc008c0deb868
> [    2.952211] R10: ffffffffffffffff R11: 00000000000000b0 R12:
> dead000000000122
> [    2.952256] R13: 0000000000000001 R14: 0000000000000000 R15:
> 0000000000000000
> [    2.952299] FS:  00007f7fa5b5b880(0000) GS:ffffa0a81f840000(0000)
> knlGS:0000000000000000
> [    2.952369] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [    2.952407] CR2: 000055d648427100 CR3: 000000010e960003 CR4:
> 0000000000770ee0
> [    2.952451] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> 0000000000000000
> [    2.952492] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
> 0000000000000400
> [    2.952533] PKRU: 55555554
> [    2.952561] Call Trace:
> [    2.952579]  <TASK>
> [    2.952598]  spi_set_cs+0x257/0x4a0
> [    2.952630]  spi_setup+0x1a2/0x500
> [    2.952667]  __spi_add_device+0x88/0x160
> [    2.952710]  spi_add_device+0x60/0x90
> [    2.952738]  smi_spi_probe+0x178/0x370 [serial_multi_instantiate]
> [    2.952792]  smi_probe+0xcf/0x110 [serial_multi_instantiate]
> [    2.952854]  platform_probe+0x42/0xb0
> [    2.952885]  really_probe+0x1b2/0x420
> [    2.952914]  __driver_probe_device+0x7e/0x180
> [    2.952947]  driver_probe_device+0x23/0xa0
> [    2.952993]  __driver_attach+0xe4/0x1e0 [    2.953021]  ?
> __pfx___driver_attach+0x10/0x10
> [    2.953061]  bus_for_each_dev+0x7a/0xd0
> [    2.953088]  driver_attach+0x1e/0x30
> [    2.953123]  bus_add_driver+0x11c/0x220
> [    2.953150]  driver_register+0x64/0x130 [    2.953174]  ?
> __pfx_init_module+0x10/0x10 [serial_multi_instantiate]
> [    2.953221]  __platform_driver_register+0x1e/0x30
> [    2.953251]  smi_driver_init+0x1c/0xff0 [serial_multi_instantiate]
> [    2.953310]  do_one_initcall+0x46/0x220 [    2.953339]  ?
> kmalloc_trace+0x2a/0xa0 [    2.953375]  do_init_module+0x52/0x220
> [    2.953411]  load_module+0x223c/0x2460
> [    2.953450]  __do_sys_finit_module+0xc8/0x140 [    2.953479]  ?
> __do_sys_finit_module+0xc8/0x140
> [    2.953510]  __x64_sys_finit_module+0x18/0x20
> [    2.953538]  do_syscall_64+0x38/0x90
> [    2.953574]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
> [    2.953606] RIP: 0033:0x7f7fa5d7476d
> [    2.953639] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa
> 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f
> 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f3 36 0d 00 f7 d8 64 89 01 48
> [    2.953739] RSP: 002b:00007fff1f8dd3b8 EFLAGS: 00000246 ORIG_RAX:
> 0000000000000139
> [    2.956833] RAX: ffffffffffffffda RBX: 000055d648654ab0 RCX:
> 00007f7fa5d7476d
> [    2.959202] RDX: 0000000000000000 RSI: 00007f7fa5c54ded RDI:
> 0000000000000006
> [    2.961542] RBP: 0000000000020000 R08: 0000000000000000 R09:
> 0000000000000000
> [    2.964312] R10: 0000000000000006 R11: 0000000000000246 R12:
> 00007f7fa5c54ded
> [    2.966694] R13: 0000000000000000 R14: 000055d6483f41a0 R15:
> 000055d648654ab0
> [    2.967668] resource: resource sanity check: requesting [mem
> 0x00000000fedc0000-0x00000000fedcffff], which spans more than pnp 00:04
> [mem 0xfedc0000-0xfedc7fff] [    2.968998]  </TASK> [    2.971615] caller
> igen6_probe+0x178/0x8e0 [igen6_edac] mapping multiple BARs [    2.975014]
> Modules linked in: igen6_edac(+) fjes(-)
> serial_multi_instantiate(+) int3403_thermal sch_fq_codel
> int340x_thermal_zone int3400_thermal intel_hid acpi_thermal_rel acpi_tad
> sparse_keymap acpi_pad mac_hid msr parport_pc ppdev lp parport drm
> ramoops reed_solomon efi_pstore ip_tables x_tables autofs4
> spi_pxa2xx_platform dw_dmac dw_dmac_core nvme intel_lpss_pci
> intel_lpss crc32_pclmul thunderbolt i2c_i801 xhci_pci idma64 nvme_core
> i2c_smbus virt_dma xhci_pci_renesas video wmi pinctrl_tigerlake
> [    2.987901] ---[ end trace 0000000000000000 ]--- [    3.157030] RIP:
> 0010:gpiod_set_value_cansleep+0x21/0xa0
> [    3.159077] Code: 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 48 85 ff
> 74 3e 55 48 89 e5 41 55 41 89 f5 41 54 49 89 fc 48 81 ff 00 f0 ff ff 77 2c <48>
> 8b 3f 48 85 ff 74 53 48 83 bf 68 03 00 00 00 74 34 44 89 ee 4c [    3.161461]
> RSP: 0018:ffffc008c0deb928 EFLAGS: 00010287 [    3.164005] RAX:
> 0000000000000001 RBX: ffffa0a489534c00 RCX:
> 0000000000000000
> [    3.166354] RDX: dead000000000122 RSI: 0000000000000001 RDI:
> dead000000000122
> [    3.168499] RBP: ffffc008c0deb938 R08: 0000000000000000 R09:
> ffffc008c0deb868
> [    3.170609] R10: ffffffffffffffff R11: 00000000000000b0 R12:
> dead000000000122
> [    3.172893] R13: 0000000000000001 R14: 0000000000000000 R15:
> 0000000000000000
> [    3.175335] FS:  00007f7fa5b5b880(0000) GS:ffffa0a81f840000(0000)
> knlGS:0000000000000000
> [    3.180434] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [    3.183356] CR2: 000055d648427100 CR3: 000000010e960003 CR4:
> 0000000000770ee0
> [    3.185107] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> 0000000000000000
> [    3.186840] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
> 0000000000000400
> [    3.188647] PKRU: 55555554

Thank you for sharing the logs.
As per our analysis the spi->cs_gpiod[0] is getting messed up while 
setting it in __spi_add_device( ).
Is it possible for you to do the following changes on top of this patch 
series & re-run your test.

After applying this patch series, in drivers/spi/spi.c file replace the 
following code snippet in __spi_add_device( ) function defination.

if (ctlr->cs_gpiods) {
        for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
                spi_set_csgpiod(spi, idx, ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]);
}

with the below code snippet

if (ctlr->cs_gpiods) {
        for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
                if (!(idx != 0 && !spi_get_chipselect(spi, idx)))
                        spi_set_csgpiod(spi, idx, ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]);
        }
} 

then re-run your test.

Regards,
Amit
> 
> Thanks,
> 
> Stefan
> 
> >
> >> Thanks,
> >> Stefan Binding
> >>
> >>> Signed-off-by: Amit Kumar Mahapatra <amit.kumar-
> >> mahapatra@amd.com>
> >>> ---
> >>>   drivers/spi/spi.c       | 226
> >> ++++++++++++++++++++++++++++------------
> >>>   include/linux/spi/spi.h |  32 ++++--
> >>>   2 files changed, 183 insertions(+), 75 deletions(-)
> >>>
> >>> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index
> >>> 9036d7a50674..04d7322170c4 100644
> >>> --- a/drivers/spi/spi.c
> >>> +++ b/drivers/spi/spi.c
> >>> @@ -612,10 +612,24 @@ static int spi_dev_check(struct device *dev,
> >>> void *data)  {
> >>>   	struct spi_device *spi = to_spi_device(dev);
> >>>   	struct spi_device *new_spi = data;
> >>> +	int idx, nw_idx;
> >>>
> >>> -	if (spi->controller == new_spi->controller &&
> >>> -	    spi_get_chipselect(spi, 0) == spi_get_chipselect(new_spi,
> >> 0))
> >>> -		return -EBUSY;
> >>> +	if (spi->controller == new_spi->controller) {
> >>> +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> >>> +			for (nw_idx = 0; nw_idx < SPI_CS_CNT_MAX;
> >>> nw_idx++) {
> >>> +				if ((idx != 0 &&
> >> !spi_get_chipselect(spi,
> >>> idx)) ||
> >>> +				    (nw_idx != 0 &&
> >>> !spi_get_chipselect(spi, nw_idx))) {
> >>> +					continue;
> >>> +				} else if (spi_get_chipselect(spi,
> >> idx) ==
> >>> +				    spi_get_chipselect(new_spi,
> >> nw_idx))
> >>> {
> >>> +					dev_err(dev,
> >>> +						"chipselect %d already
> >>> in use\n",
> >>> +
> >>> 	spi_get_chipselect(new_spi, nw_idx));
> >>> +					return -EBUSY;
> >>> +				}
> >>> +			}
> >>> +		}
> >>> +	}
> >>>   	return 0;
> >>>   }
> >>>
> >>> @@ -629,7 +643,7 @@ static int __spi_add_device(struct spi_device
> >>> *spi)
> >>>   {
> >>>   	struct spi_controller *ctlr = spi->controller;
> >>>   	struct device *dev = ctlr->dev.parent;
> >>> -	int status;
> >>> +	int status, idx;
> >>>
> >>>   	/*
> >>>   	 * We need to make sure there's no other device with this @@
> >>> -638,8
> >>> +652,6 @@ static int __spi_add_device(struct spi_device
> >>> *spi)
> >>>   	 */
> >>>   	status = bus_for_each_dev(&spi_bus_type, NULL, spi,
> >> spi_dev_check);
> >>>   	if (status) {
> >>> -		dev_err(dev, "chipselect %d already in use\n",
> >>> -				spi_get_chipselect(spi, 0));
> >>>   		return status;
> >>>   	}
> >>>
> >>> @@ -649,8 +661,10 @@ static int __spi_add_device(struct spi_device
> >>> *spi)
> >>>   		return -ENODEV;
> >>>   	}
> >>>
> >>> -	if (ctlr->cs_gpiods)
> >>> -		spi_set_csgpiod(spi, 0, ctlr-
> >>>> cs_gpiods[spi_get_chipselect(spi, 0)]);
> >>> +	if (ctlr->cs_gpiods) {
> >>> +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
> >>> +			spi_set_csgpiod(spi, idx, ctlr-
> >>>> cs_gpiods[spi_get_chipselect(spi, idx)]);
> >>> +	}
> >>>
> >>>   	/*
> >>>   	 * Drivers may modify this initial i/o setup, but will @@ -690,13
> >>> +704,15 @@ int spi_add_device(struct spi_device *spi)  {
> >>>   	struct spi_controller *ctlr = spi->controller;
> >>>   	struct device *dev = ctlr->dev.parent;
> >>> -	int status;
> >>> +	int status, idx;
> >>>
> >>> -	/* Chipselects are numbered 0..max; validate. */
> >>> -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
> >>> -		dev_err(dev, "cs%d >= max %d\n",
> >>> spi_get_chipselect(spi, 0),
> >>> -			ctlr->num_chipselect);
> >>> -		return -EINVAL;
> >>> +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> >>> +		/* Chipselects are numbered 0..max; validate. */
> >>> +		if (spi_get_chipselect(spi, idx) >=
> >> ctlr->num_chipselect) {
> >>> +			dev_err(dev, "cs%d >= max %d\n",
> >>> spi_get_chipselect(spi, idx),
> >>> +				ctlr->num_chipselect);
> >>> +			return -EINVAL;
> >>> +		}
> >>>   	}
> >>>
> >>>   	/* Set the bus ID string */
> >>> @@ -713,12 +729,15 @@ static int spi_add_device_locked(struct
> >>> spi_device *spi)  {
> >>>   	struct spi_controller *ctlr = spi->controller;
> >>>   	struct device *dev = ctlr->dev.parent;
> >>> +	int idx;
> >>>
> >>> -	/* Chipselects are numbered 0..max; validate. */
> >>> -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
> >>> -		dev_err(dev, "cs%d >= max %d\n",
> >>> spi_get_chipselect(spi, 0),
> >>> -			ctlr->num_chipselect);
> >>> -		return -EINVAL;
> >>> +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> >>> +		/* Chipselects are numbered 0..max; validate. */
> >>> +		if (spi_get_chipselect(spi, idx) >=
> >> ctlr->num_chipselect) {
> >>> +			dev_err(dev, "cs%d >= max %d\n",
> >>> spi_get_chipselect(spi, idx),
> >>> +				ctlr->num_chipselect);
> >>> +			return -EINVAL;
> >>> +		}
> >>>   	}
> >>>
> >>>   	/* Set the bus ID string */
> >>> @@ -966,58 +985,118 @@ static void spi_res_release(struct
> >>> spi_controller *ctlr, struct spi_message *mes  static void
> >>> spi_set_cs(struct spi_device *spi, bool enable, bool
> >> force)
> >>>   {
> >>>   	bool activate = enable;
> >>> +	u32 cs_num = __ffs(spi->cs_index_mask);
> >>> +	int idx;
> >>>
> >>>   	/*
> >>> -	 * Avoid calling into the driver (or doing delays) if the chip
> >> select
> >>> -	 * isn't actually changing from the last time this was called.
> >>> +	 * In parallel mode all the chip selects are
> >> asserted/de-asserted
> >>> +	 * at once
> >>>   	 */
> >>> -	if (!force && ((enable && spi->controller->last_cs ==
> >>> spi_get_chipselect(spi, 0)) ||
> >>> -		       (!enable && spi->controller->last_cs !=
> >>> spi_get_chipselect(spi, 0))) &&
> >>> -	    (spi->controller->last_cs_mode_high == (spi->mode &
> >>> SPI_CS_HIGH)))
> >>> -		return;
> >>> -
> >>> -	trace_spi_set_cs(spi, activate);
> >>> -
> >>> -	spi->controller->last_cs = enable ? spi_get_chipselect(spi, 0)
> >> : -1;
> >>> -	spi->controller->last_cs_mode_high = spi->mode &
> >>> SPI_CS_HIGH;
> >>> -
> >>> -	if ((spi_get_csgpiod(spi, 0) ||
> >> !spi->controller->set_cs_timing)
> >>> && !activate)
> >>> -		spi_delay_exec(&spi->cs_hold, NULL);
> >>> -
> >>> -	if (spi->mode & SPI_CS_HIGH)
> >>> -		enable = !enable;
> >>> +	if ((spi->cs_index_mask & SPI_PARALLEL_CS_MASK) ==
> >>> SPI_PARALLEL_CS_MASK) {
> >>> +		spi->controller->last_cs_mode_high = spi->mode &
> >>> SPI_CS_HIGH;
> >>> +
> >>> +		if ((spi_get_csgpiod(spi, 0) || !spi->controller-
> >>>> set_cs_timing) && !activate)
> >>> +			spi_delay_exec(&spi->cs_hold, NULL);
> >>> +
> >>> +		if (spi->mode & SPI_CS_HIGH)
> >>> +			enable = !enable;
> >>> +
> >>> +		if (spi_get_csgpiod(spi, 0) && spi_get_csgpiod(spi,
> >> 1)) {
> >>> +			if (!(spi->mode & SPI_NO_CS)) {
> >>> +				/*
> >>> +				 * Historically ACPI has no means of
> >> the
> >>> GPIO polarity and
> >>> +				 * thus the SPISerialBus() resource
> >>> defines it on the per-chip
> >>> +				 * basis. In order to avoid a chain of
> >>> negations, the GPIO
> >>> +				 * polarity is considered being Active
> >>> High. Even for the cases
> >>> +				 * when _DSD() is involved (in the
> >>> updated versions of ACPI)
> >>> +				 * the GPIO CS polarity must be
> >> defined
> >>> Active High to avoid
> >>> +				 * ambiguity. That's why we use
> >> enable,
> >>> that takes SPI_CS_HIGH
> >>> +				 * into account.
> >>> +				 */
> >>> +				if (has_acpi_companion(&spi->dev)) {
> >>> +					for (idx = 0; idx <
> >>> SPI_CS_CNT_MAX; idx++)
> >>> +
> >>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
> >>> +
> >>> !enable);
> >>> +				} else {
> >>> +					for (idx = 0; idx <
> >>> SPI_CS_CNT_MAX; idx++)
> >>> +						/* Polarity handled by
> >>> GPIO library */
> >>> +
> >>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
> >>> +
> >>> activate);
> >>> +				}
> >>> +			}
> >>> +			/* Some SPI masters need both GPIO CS &
> >>> slave_select */
> >>> +			if ((spi->controller->flags &
> >>> SPI_MASTER_GPIO_SS) &&
> >>> +			    spi->controller->set_cs)
> >>> +				spi->controller->set_cs(spi, !enable);
> >>> +		} else if (spi->controller->set_cs) {
> >>> +			spi->controller->set_cs(spi, !enable);
> >>> +		}
> >>>
> >>> -	if (spi_get_csgpiod(spi, 0)) {
> >>> -		if (!(spi->mode & SPI_NO_CS)) {
> >>> -			/*
> >>> -			 * Historically ACPI has no means of the GPIO
> >>> polarity and
> >>> -			 * thus the SPISerialBus() resource defines it
> >> on
> >>> the per-chip
> >>> -			 * basis. In order to avoid a chain of
> >> negations,
> >>> the GPIO
> >>> -			 * polarity is considered being Active High.
> >> Even
> >>> for the cases
> >>> -			 * when _DSD() is involved (in the updated
> >>> versions of ACPI)
> >>> -			 * the GPIO CS polarity must be defined Active
> >>> High to avoid
> >>> -			 * ambiguity. That's why we use enable, that
> >>> takes SPI_CS_HIGH
> >>> -			 * into account.
> >>> -			 */
> >>> -			if (has_acpi_companion(&spi->dev))
> >>> -
> >>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), !enable);
> >>> +		if (spi_get_csgpiod(spi, 0) || spi_get_csgpiod(spi, 1)
> >> ||
> >>> +		    !spi->controller->set_cs_timing) {
> >>> +			if (activate)
> >>> +				spi_delay_exec(&spi->cs_setup, NULL);
> >>>   			else
> >>> -				/* Polarity handled by GPIO library */
> >>> -
> >>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), activate);
> >>> +				spi_delay_exec(&spi->cs_inactive,
> >>> NULL);
> >>>   		}
> >>> -		/* Some SPI masters need both GPIO CS & slave_select
> >>> */
> >>> -		if ((spi->controller->flags & SPI_MASTER_GPIO_SS) &&
> >>> -		    spi->controller->set_cs)
> >>> +	} else {
> >>> +		/*
> >>> +		 * Avoid calling into the driver (or doing delays) if
> >> the
> >>> chip select
> >>> +		 * isn't actually changing from the last time this was
> >>> called.
> >>> +		 */
> >>> +		if (!force && ((enable && spi->controller->last_cs ==
> >>> +				spi_get_chipselect(spi, cs_num)) ||
> >>> +				(!enable && spi->controller->last_cs
> >> !=
> >>> +				 spi_get_chipselect(spi, cs_num))) &&
> >>> +		    (spi->controller->last_cs_mode_high ==
> >>> +		     (spi->mode & SPI_CS_HIGH)))
> >>> +			return;
> >>> +
> >>> +		trace_spi_set_cs(spi, activate);
> >>> +
> >>> +		spi->controller->last_cs = enable ?
> >>> spi_get_chipselect(spi, cs_num) : -1;
> >>> +		spi->controller->last_cs_mode_high = spi->mode &
> >>> SPI_CS_HIGH;
> >>> +
> >>> +		if ((spi_get_csgpiod(spi, cs_num) || !spi->controller-
> >>>> set_cs_timing) && !activate)
> >>> +			spi_delay_exec(&spi->cs_hold, NULL);
> >>> +
> >>> +		if (spi->mode & SPI_CS_HIGH)
> >>> +			enable = !enable;
> >>> +
> >>> +		if (spi_get_csgpiod(spi, cs_num)) {
> >>> +			if (!(spi->mode & SPI_NO_CS)) {
> >>> +				/*
> >>> +				 * Historically ACPI has no means of
> >> the
> >>> GPIO polarity and
> >>> +				 * thus the SPISerialBus() resource
> >>> defines it on the per-chip
> >>> +				 * basis. In order to avoid a chain of
> >>> negations, the GPIO
> >>> +				 * polarity is considered being Active
> >>> High. Even for the cases
> >>> +				 * when _DSD() is involved (in the
> >>> updated versions of ACPI)
> >>> +				 * the GPIO CS polarity must be
> >> defined
> >>> Active High to avoid
> >>> +				 * ambiguity. That's why we use
> >> enable,
> >>> that takes SPI_CS_HIGH
> >>> +				 * into account.
> >>> +				 */
> >>> +				if (has_acpi_companion(&spi->dev))
> >>> +
> >>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
> >>> +
> >>> !enable);
> >>> +				else
> >>> +					/* Polarity handled by GPIO
> >>> library */
> >>> +
> >>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
> >>> +
> >>> activate);
> >>> +			}
> >>> +			/* Some SPI masters need both GPIO CS &
> >>> slave_select */
> >>> +			if ((spi->controller->flags &
> >>> SPI_MASTER_GPIO_SS) &&
> >>> +			    spi->controller->set_cs)
> >>> +				spi->controller->set_cs(spi, !enable);
> >>> +		} else if (spi->controller->set_cs) {
> >>>   			spi->controller->set_cs(spi, !enable);
> >>> -	} else if (spi->controller->set_cs) {
> >>> -		spi->controller->set_cs(spi, !enable);
> >>> -	}
> >>> +		}
> >>>
> >>> -	if (spi_get_csgpiod(spi, 0) ||
> >> !spi->controller->set_cs_timing) {
> >>> -		if (activate)
> >>> -			spi_delay_exec(&spi->cs_setup, NULL);
> >>> -		else
> >>> -			spi_delay_exec(&spi->cs_inactive, NULL);
> >>> +		if (spi_get_csgpiod(spi, cs_num) || !spi->controller-
> >>>> set_cs_timing) {
> >>> +			if (activate)
> >>> +				spi_delay_exec(&spi->cs_setup, NULL);
> >>> +			else
> >>> +				spi_delay_exec(&spi->cs_inactive,
> >>> NULL);
> >>> +		}
> >>>   	}
> >>>   }
> >>>
> >>> @@ -2246,8 +2325,8 @@ static void of_spi_parse_dt_cs_delay(struct
> >>> device_node *nc,  static int of_spi_parse_dt(struct spi_controller
> >>> *ctlr, struct
> >> spi_device
> >>> *spi,
> >>>   			   struct device_node *nc)
> >>>   {
> >>> -	u32 value;
> >>> -	int rc;
> >>> +	u32 value, cs[SPI_CS_CNT_MAX] = {0};
> >>> +	int rc, idx;
> >>>
> >>>   	/* Mode (clock phase/polarity/etc.) */
> >>>   	if (of_property_read_bool(nc, "spi-cpha")) @@ -2320,13 +2399,21
> >> @@
> >>> static int of_spi_parse_dt(struct spi_controller *ctlr, struct
> >>> spi_device *spi,
> >>>   	}
> >>>
> >>>   	/* Device address */
> >>> -	rc = of_property_read_u32(nc, "reg", &value);
> >>> -	if (rc) {
> >>> +	rc = of_property_read_variable_u32_array(nc, "reg", &cs[0], 1,
> >>> +						 SPI_CS_CNT_MAX);
> >>> +	if (rc < 0 || rc > ctlr->num_chipselect) {
> >>>   		dev_err(&ctlr->dev, "%pOF has no valid 'reg' property
> >> (%d)\n",
> >>>   			nc, rc);
> >>>   		return rc;
> >>> +	} else if ((of_property_read_bool(nc, "parallel-memories")) &&
> >>> +		   (!(ctlr->flags & SPI_CONTROLLER_MULTI_CS))) {
> >>> +		dev_err(&ctlr->dev, "SPI controller doesn't support
> >> multi
> >>> CS\n");
> >>> +		return -EINVAL;
> >>>   	}
> >>> -	spi_set_chipselect(spi, 0, value);
> >>> +	for (idx = 0; idx < rc; idx++)
> >>> +		spi_set_chipselect(spi, idx, cs[idx]);
> >>> +	/* By default set the spi->cs_index_mask as 1 */
> >>> +	spi->cs_index_mask = 0x01;
> >>>
> >>>   	/* Device speed */
> >>>   	if (!of_property_read_u32(nc, "spi-max-frequency", &value)) @@
> >>> -3907,7 +3994,8 @@ static int __spi_validate(struct spi_device *spi,
> >>> struct spi_message *message)
> >>>   	 * cs_change is set for each transfer.
> >>>   	 */
> >>>   	if ((spi->mode & SPI_CS_WORD) && (!(ctlr->mode_bits &
> >>> SPI_CS_WORD) ||
> >>> -					  spi_get_csgpiod(spi, 0))) {
> >>> +					  spi_get_csgpiod(spi, 0) ||
> >>> +					  spi_get_csgpiod(spi, 1))) {
> >>>   		size_t maxsize;
> >>>   		int ret;
> >>>
> >>> diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index
> >>> 873ced6ae4ca..6453b246e0af 100644
> >>> --- a/include/linux/spi/spi.h
> >>> +++ b/include/linux/spi/spi.h
> >>> @@ -19,6 +19,11 @@
> >>>   #include <linux/acpi.h>
> >>>   #include <linux/u64_stats_sync.h>
> >>>
> >>> +/* Max no. of CS supported per spi device */ #define SPI_CS_CNT_MAX
> >>> +2
> >>> +
> >>> +/* chip select mask */
> >>> +#define SPI_PARALLEL_CS_MASK	(BIT(0) | BIT(1))
> >>>   struct dma_chan;
> >>>   struct software_node;
> >>>   struct ptp_system_timestamp;
> >>> @@ -166,6 +171,7 @@ extern void
> >>> spi_transfer_cs_change_delay_exec(struct spi_message *msg,
> >>>    *	deasserted. If @cs_change_delay is used from @spi_transfer,
> >>> then the
> >>>    *	two delays will be added up.
> >>>    * @pcpu_statistics: statistics for the spi_device
> >>> + * @cs_index_mask: Bit mask of the active chipselect(s) in the
> >>> chipselect array
> >>>    *
> >>>    * A @spi_device is used to interchange data between an SPI slave
> >>>    * (usually a discrete chip) and CPU memory.
> >>> @@ -181,7 +187,7 @@ struct spi_device {
> >>>   	struct spi_controller	*controller;
> >>>   	struct spi_controller	*master;	/* Compatibility layer
> >> */
> >>>   	u32			max_speed_hz;
> >>> -	u8			chip_select;
> >>> +	u8			chip_select[SPI_CS_CNT_MAX];
> >>>   	u8			bits_per_word;
> >>>   	bool			rt;
> >>>   #define SPI_NO_TX	BIT(31)		/* No transmit wire */
> >>> @@ -202,7 +208,7 @@ struct spi_device {
> >>>   	void			*controller_data;
> >>>   	char			modalias[SPI_NAME_SIZE];
> >>>   	const char		*driver_override;
> >>> -	struct gpio_desc	*cs_gpiod;	/* Chip select gpio
> >> desc
> >>> */
> >>> +	struct gpio_desc	*cs_gpiod[SPI_CS_CNT_MAX];	/*
> >> Chip
> >>> select gpio desc */
> >>>   	struct spi_delay	word_delay; /* Inter-word delay */
> >>>   	/* CS delays */
> >>>   	struct spi_delay	cs_setup;
> >>> @@ -212,6 +218,13 @@ struct spi_device {
> >>>   	/* The statistics */
> >>>   	struct spi_statistics __percpu	*pcpu_statistics;
> >>>
> >>> +	/* Bit mask of the chipselect(s) that the driver need to use
> >> from
> >>> +	 * the chipselect array.When the controller is capable to
> >> handle
> >>> +	 * multiple chip selects & memories are connected in parallel
> >>> +	 * then more than one bit need to be set in cs_index_mask.
> >>> +	 */
> >>> +	u32			cs_index_mask : SPI_CS_CNT_MAX;
> >>> +
> >>>   	/*
> >>>   	 * likely need more hooks for more protocol options affecting how
> >>>   	 * the controller talks to each chip, like:
> >>> @@ -268,22 +281,22 @@ static inline void *spi_get_drvdata(const
> >>> struct spi_device *spi)
> >>>
> >>>   static inline u8 spi_get_chipselect(const struct spi_device *spi,
> >> u8 idx)
> >>>   {
> >>> -	return spi->chip_select;
> >>> +	return spi->chip_select[idx];
> >>>   }
> >>>
> >>>   static inline void spi_set_chipselect(struct spi_device *spi, u8
> >> idx, u8
> >>> chipselect)
> >>>   {
> >>> -	spi->chip_select = chipselect;
> >>> +	spi->chip_select[idx] = chipselect;
> >>>   }
> >>>
> >>>   static inline struct gpio_desc *spi_get_csgpiod(const struct
> >> spi_device
> >>> *spi, u8 idx)
> >>>   {
> >>> -	return spi->cs_gpiod;
> >>> +	return spi->cs_gpiod[idx];
> >>>   }
> >>>
> >>>   static inline void spi_set_csgpiod(struct spi_device *spi, u8 idx,
> >> struct
> >>> gpio_desc *csgpiod)
> >>>   {
> >>> -	spi->cs_gpiod = csgpiod;
> >>> +	spi->cs_gpiod[idx] = csgpiod;
> >>>   }
> >>>
> >>>   /**
> >>> @@ -388,6 +401,8 @@ extern struct spi_device
> >>> *spi_new_ancillary_device(struct spi_device *spi, u8 ch
> >>>    * @bus_lock_spinlock: spinlock for SPI bus locking
> >>>    * @bus_lock_mutex: mutex for exclusion of multiple callers
> >>>    * @bus_lock_flag: indicates that the SPI bus is locked for
> >> exclusive use
> >>> + * @multi_cs_cap: indicates that the SPI Controller can
> >> assert/de-assert
> >>> + *	more than one chip select at once.
> >>>    * @setup: updates the device mode and clocking records used by a
> >>>    *	device's SPI controller; protocol code may call this.  This
> >>>    *	must fail if an unrecognized or unsupported mode is requested.
> >>> @@ -554,6 +569,11 @@ struct spi_controller {
> >>>   #define SPI_CONTROLLER_MUST_TX		BIT(4)	/* Requires tx
> >>> */
> >>>
> >>>   #define SPI_MASTER_GPIO_SS		BIT(5)	/* GPIO CS must
> >> select
> >>> slave */
> >>> +	/*
> >>> +	 * The spi-controller has multi chip select capability and can
> >>> +	 * assert/de-assert more than one chip select at once.
> >>> +	 */
> >>> +#define SPI_CONTROLLER_MULTI_CS		BIT(6)
> >>>
> >>>   	/* Flag indicating if the allocation of this struct is devres-
> >>> managed */
> >>>   	bool			devm_allocated;
> >>> --
> >>> 2.17.1
Stefan Binding April 25, 2023, 12:20 p.m. UTC | #5
Hi,

On 20/04/2023 10:04, Mahapatra, Amit Kumar wrote:
> Hello Stefan,
>
>> -----Original Message-----
>> From: Stefan Binding <sbinding@opensource.cirrus.com>
>> Sent: Wednesday, April 12, 2023 8:33 PM
>> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
>> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
>> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
>> vigneshr@ti.com
>> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org; linux-
>> kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
>> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
>> claudiu.beznea@microchip.com; Simek, Michal <michal.simek@amd.com>;
>> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
>> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
>> Subject: Re: [PATCH V7 1/7] spi: Add stacked and parallel memories support
>> in SPI core
>>
>> Hi,
>>
>> On 11/04/2023 10:07, Mahapatra, Amit Kumar wrote:
>>> Hello Stefan,
>>>
>>>> -----Original Message-----
>>>> From: Stefan Binding <sbinding@opensource.cirrus.com>
>>>> Sent: Thursday, April 6, 2023 7:14 PM
>>>> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
>>>> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
>>>> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
>>>> vigneshr@ti.com
>>>> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org; linux-
>>>> kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
>>>> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
>>>> claudiu.beznea@microchip.com; Simek, Michal
>> <michal.simek@amd.com>;
>>>> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
>>>> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
>>>> Subject: RE: [PATCH V7 1/7] spi: Add stacked and parallel memories
>>>> support in SPI core
>>>>
>>>> Hi,
>>>>
>>>>> -----Original Message-----
>>>>> From: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
>>>>> Sent: Thursday, April 6, 2023 7:54 AM
>>>>> To: broonie@kernel.org; tudor.ambarus@linaro.org;
>>>>> pratyush@kernel.org; michael@walle.cc; miquel.raynal@bootlin.com;
>>>>> richard@nod.at; vigneshr@ti.com
>>>>> Cc: git@amd.com; sbinding@opensource.cirrus.com; linux-
>>>>> spi@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
>>>>> mtd@lists.infradead.org; nicolas.ferre@microchip.com;
>>>>> alexandre.belloni@bootlin.com; claudiu.beznea@microchip.com;
>>>>> michal.simek@amd.com; linux-arm-kernel@lists.infradead.org;
>>>>> amitrkcian2002@gmail.com; Amit Kumar Mahapatra <amit.kumar-
>>>>> mahapatra@amd.com>
>>>>> Subject: [PATCH V7 1/7] spi: Add stacked and parallel memories
>>>> support
>>>>> in SPI core
>>>>>
>>>>> For supporting multiple CS the SPI device need to be aware of all
>>>> the CS
>>>>> values. So, the "chip_select" member in the spi_device structure is
>>>> now
>>>>> an
>>>>> array that holds all the CS values.
>>>>>
>>>>> spi_device structure now has a "cs_index_mask" member. This acts as
>>>> an
>>>>> index to the chip_select array. If nth bit of spi->cs_index_mask is
>>>> set
>>>>> then the driver would assert spi->chip_select[n].
>>>>>
>>>>> In parallel mode all the chip selects are asserted/de-asserted
>>>>> simultaneously and each byte of data is stored in both devices, the
>>>> even
>>>>> bits in one, the odd bits in the other. The split is automatically
>>>> handled
>>>>> by the GQSPI controller. The GQSPI controller supports a maximum of
>>>>> two flashes connected in parallel mode. A SPI_CONTROLLER_MULTI_CS
>>>>> flag bit is added in the spi controntroller flags, through
>>>>> ctlr->flags the spi
>>>> core
>>>>> will make sure that the controller is capable of handling multiple
>>>> chip
>>>>> selects at once.
>>>>>
>>>>> For supporting multiple CS via GPIO the cs_gpiod member of the
>>>>> spi_device structure is now an array that holds the gpio descriptor
>>>>> for each chipselect.
>>>>>
>>>>> Multi CS support using GPIO is not tested due to unavailability of
>>>>> necessary hardware setup.
>>>>>
>>>>> Multi CS configuration with one native CS and one GPIO CS is not
>>>>> supported as this configuration could not be tested due to
>>>>> unavailability of necessary hardware setup.
>>>> I've tested this chain on a released laptop (HP EliteBook 840 G9)
>>>> which uses SPI to interface to 2 amps, one amp uses a native CS and
>>>> the other uses a GPIO CS, and I noticed that when using this chain,
>>>> the second amp no longer works.
>>> Thank you for testing this patch series on GPIO CS setup. As I don't
>>> have a GPIO CS setup, is it possible for you debug the failure and
>>> share more details/logs where the problem is?
>>>
>>> Regards,
>>> Amit
>> We are willing and able to debug this failure and share the failure logs.
>> The first issue that I see is a kernel crash when trying to set the GPIO CS:
>>
>> [    2.951658] general protection fault, probably for non-canonical address
>> 0xdead000000000122: 0000 [#1] PREEMPT SMP NOPTI [    2.951771] CPU: 9
>> PID: 379 Comm: systemd-udevd Tainted: G A           6.3.0-rc3+ #30
>> [    2.951826] Hardware name: HP /896D, BIOS U70 Ver. 89.33.02 10/29/2021
>> [    2.951882] RIP: 0010:gpiod_set_value_cansleep+0x21/0xa0
>> [    2.951941] Code: 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 48 85 ff
>> 74 3e 55 48 89 e5 41 55 41 89 f5 41 54 49 89 fc 48 81 ff 00 f0 ff ff 77 2c <48>
>> 8b 3f 48 85 ff 74 53 48 83 bf 68 03 00 00 00 74 34 44 89 ee 4c [    2.952043]
>> RSP: 0018:ffffc008c0deb928 EFLAGS: 00010287 [    2.952080] RAX:
>> 0000000000000001 RBX: ffffa0a489534c00 RCX:
>> 0000000000000000
>> [    2.952124] RDX: dead000000000122 RSI: 0000000000000001 RDI:
>> dead000000000122
>> [    2.952167] RBP: ffffc008c0deb938 R08: 0000000000000000 R09:
>> ffffc008c0deb868
>> [    2.952211] R10: ffffffffffffffff R11: 00000000000000b0 R12:
>> dead000000000122
>> [    2.952256] R13: 0000000000000001 R14: 0000000000000000 R15:
>> 0000000000000000
>> [    2.952299] FS:  00007f7fa5b5b880(0000) GS:ffffa0a81f840000(0000)
>> knlGS:0000000000000000
>> [    2.952369] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>> [    2.952407] CR2: 000055d648427100 CR3: 000000010e960003 CR4:
>> 0000000000770ee0
>> [    2.952451] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
>> 0000000000000000
>> [    2.952492] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
>> 0000000000000400
>> [    2.952533] PKRU: 55555554
>> [    2.952561] Call Trace:
>> [    2.952579]  <TASK>
>> [    2.952598]  spi_set_cs+0x257/0x4a0
>> [    2.952630]  spi_setup+0x1a2/0x500
>> [    2.952667]  __spi_add_device+0x88/0x160
>> [    2.952710]  spi_add_device+0x60/0x90
>> [    2.952738]  smi_spi_probe+0x178/0x370 [serial_multi_instantiate]
>> [    2.952792]  smi_probe+0xcf/0x110 [serial_multi_instantiate]
>> [    2.952854]  platform_probe+0x42/0xb0
>> [    2.952885]  really_probe+0x1b2/0x420
>> [    2.952914]  __driver_probe_device+0x7e/0x180
>> [    2.952947]  driver_probe_device+0x23/0xa0
>> [    2.952993]  __driver_attach+0xe4/0x1e0 [    2.953021]  ?
>> __pfx___driver_attach+0x10/0x10
>> [    2.953061]  bus_for_each_dev+0x7a/0xd0
>> [    2.953088]  driver_attach+0x1e/0x30
>> [    2.953123]  bus_add_driver+0x11c/0x220
>> [    2.953150]  driver_register+0x64/0x130 [    2.953174]  ?
>> __pfx_init_module+0x10/0x10 [serial_multi_instantiate]
>> [    2.953221]  __platform_driver_register+0x1e/0x30
>> [    2.953251]  smi_driver_init+0x1c/0xff0 [serial_multi_instantiate]
>> [    2.953310]  do_one_initcall+0x46/0x220 [    2.953339]  ?
>> kmalloc_trace+0x2a/0xa0 [    2.953375]  do_init_module+0x52/0x220
>> [    2.953411]  load_module+0x223c/0x2460
>> [    2.953450]  __do_sys_finit_module+0xc8/0x140 [    2.953479]  ?
>> __do_sys_finit_module+0xc8/0x140
>> [    2.953510]  __x64_sys_finit_module+0x18/0x20
>> [    2.953538]  do_syscall_64+0x38/0x90
>> [    2.953574]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
>> [    2.953606] RIP: 0033:0x7f7fa5d7476d
>> [    2.953639] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa
>> 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f
>> 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f3 36 0d 00 f7 d8 64 89 01 48
>> [    2.953739] RSP: 002b:00007fff1f8dd3b8 EFLAGS: 00000246 ORIG_RAX:
>> 0000000000000139
>> [    2.956833] RAX: ffffffffffffffda RBX: 000055d648654ab0 RCX:
>> 00007f7fa5d7476d
>> [    2.959202] RDX: 0000000000000000 RSI: 00007f7fa5c54ded RDI:
>> 0000000000000006
>> [    2.961542] RBP: 0000000000020000 R08: 0000000000000000 R09:
>> 0000000000000000
>> [    2.964312] R10: 0000000000000006 R11: 0000000000000246 R12:
>> 00007f7fa5c54ded
>> [    2.966694] R13: 0000000000000000 R14: 000055d6483f41a0 R15:
>> 000055d648654ab0
>> [    2.967668] resource: resource sanity check: requesting [mem
>> 0x00000000fedc0000-0x00000000fedcffff], which spans more than pnp 00:04
>> [mem 0xfedc0000-0xfedc7fff] [    2.968998]  </TASK> [    2.971615] caller
>> igen6_probe+0x178/0x8e0 [igen6_edac] mapping multiple BARs [    2.975014]
>> Modules linked in: igen6_edac(+) fjes(-)
>> serial_multi_instantiate(+) int3403_thermal sch_fq_codel
>> int340x_thermal_zone int3400_thermal intel_hid acpi_thermal_rel acpi_tad
>> sparse_keymap acpi_pad mac_hid msr parport_pc ppdev lp parport drm
>> ramoops reed_solomon efi_pstore ip_tables x_tables autofs4
>> spi_pxa2xx_platform dw_dmac dw_dmac_core nvme intel_lpss_pci
>> intel_lpss crc32_pclmul thunderbolt i2c_i801 xhci_pci idma64 nvme_core
>> i2c_smbus virt_dma xhci_pci_renesas video wmi pinctrl_tigerlake
>> [    2.987901] ---[ end trace 0000000000000000 ]--- [    3.157030] RIP:
>> 0010:gpiod_set_value_cansleep+0x21/0xa0
>> [    3.159077] Code: 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 48 85 ff
>> 74 3e 55 48 89 e5 41 55 41 89 f5 41 54 49 89 fc 48 81 ff 00 f0 ff ff 77 2c <48>
>> 8b 3f 48 85 ff 74 53 48 83 bf 68 03 00 00 00 74 34 44 89 ee 4c [    3.161461]
>> RSP: 0018:ffffc008c0deb928 EFLAGS: 00010287 [    3.164005] RAX:
>> 0000000000000001 RBX: ffffa0a489534c00 RCX:
>> 0000000000000000
>> [    3.166354] RDX: dead000000000122 RSI: 0000000000000001 RDI:
>> dead000000000122
>> [    3.168499] RBP: ffffc008c0deb938 R08: 0000000000000000 R09:
>> ffffc008c0deb868
>> [    3.170609] R10: ffffffffffffffff R11: 00000000000000b0 R12:
>> dead000000000122
>> [    3.172893] R13: 0000000000000001 R14: 0000000000000000 R15:
>> 0000000000000000
>> [    3.175335] FS:  00007f7fa5b5b880(0000) GS:ffffa0a81f840000(0000)
>> knlGS:0000000000000000
>> [    3.180434] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>> [    3.183356] CR2: 000055d648427100 CR3: 000000010e960003 CR4:
>> 0000000000770ee0
>> [    3.185107] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
>> 0000000000000000
>> [    3.186840] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
>> 0000000000000400
>> [    3.188647] PKRU: 55555554
> Thank you for sharing the logs.
> As per our analysis the spi->cs_gpiod[0] is getting messed up while
> setting it in __spi_add_device( ).
> Is it possible for you to do the following changes on top of this patch
> series & re-run your test.
>
> After applying this patch series, in drivers/spi/spi.c file replace the
> following code snippet in __spi_add_device( ) function defination.
>
> if (ctlr->cs_gpiods) {
>          for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
>                  spi_set_csgpiod(spi, idx, ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]);
> }
>
> with the below code snippet
>
> if (ctlr->cs_gpiods) {
>          for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>                  if (!(idx != 0 && !spi_get_chipselect(spi, idx)))
>                          spi_set_csgpiod(spi, idx, ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]);
>          }
> }
>
> then re-run your test.
>
> Regards,
> Amit

I'm still seeing a crash on probe:

[    3.265683] BUG: unable to handle page fault for address: 
00000000fffedfdd
[    3.265744] #PF: supervisor read access in kernel mode
[    3.265781] #PF: error_code(0x0000) - not-present page
[    3.265817] PGD 0 P4D 0
[    3.265840] Oops: 0000 [#1] PREEMPT SMP NOPTI
[    3.265865] CPU: 4 PID: 385 Comm: systemd-udevd Tainted: G       
A           6.3.0-rc3+ #32
[    3.265910] Hardware name: HP /896D, BIOS U70 Ver. 89.33.02 10/29/2021
[    3.265956] RIP: 0010:gpiod_set_raw_value_commit+0x3d/0xf0
[    3.266007] Code: 48 89 e5 41 55 44 0f b6 ee 41 54 53 48 8b 17 48 2b 
82 70 03 00 00 4c 8b a2 68 03 00 00 48 c1 f8 03 48 0f af c1 66 90 48 89 
c6 <49> 8b 44 24 60 44 89 ea 4c 89 e7 ff d0 0f 1f 00 5b 41 5c 41 5d 5d
[    3.266092] RSP: 0018:ffffaad780f6f620 EFLAGS: 00010a03
[    3.266121] RAX: 333330b6bdbad102 RBX: ffff9c8d4a5f6800 RCX: 
cccccccccccccccd
[    3.266156] RDX: ffff9c8d4a5f6d40 RSI: 333330b6bdbad102 RDI: 
ffff9c8d4a5f6d40
[    3.266192] RBP: ffffaad780f6f638 R08: 00000001018c3789 R09: 
0000000000000000
[    3.266228] R10: ffff9c8c4009ee40 R11: 0000000000000000 R12: 
00000000fffedf7d
[    3.266264] R13: 0000000000000000 R14: 0000000000000001 R15: 
0000000000000001
[    3.266299] FS:  00007f98d04de880(0000) GS:ffff9c90df700000(0000) 
knlGS:0000000000000000
[    3.266358] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    3.266388] CR2: 00000000fffedfdd CR3: 000000010b680003 CR4: 
0000000000770ee0
[    3.266422] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 
0000000000000000
[    3.266457] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7: 
0000000000000400
[    3.266490] PKRU: 55555554
[    3.266513] Call Trace:
[    3.266530]  <TASK>
[    3.266546]  gpiod_set_value_nocheck+0x5b/0x70
[    3.266583]  gpiod_set_value_cansleep+0x3e/0xa0
[    3.266609]  spi_set_cs+0x257/0x4a0
[    3.266634]  spi_transfer_one_message+0x49/0x740
[    3.266672]  __spi_pump_transfer_message+0x29b/0x620
[    3.266712]  __spi_sync+0x26f/0x3b0
[    3.266735]  spi_write_then_read+0x157/0x210
[    3.266771]  ? psi_group_change+0x175/0x3b0
[    3.266802]  regmap_spi_read+0xe/0x20
[    3.266826]  _regmap_raw_read+0xe1/0x210
[    3.266861]  _regmap_bus_read+0x3a/0x70
[    3.266887]  _regmap_read+0x66/0x140
[    3.266918]  regmap_read+0x3f/0x70
[    3.266957]  cs35l41_hda_probe+0x553/0xc10 [snd_hda_scodec_cs35l41]
[    3.267027]  cs35l41_hda_spi_probe+0x62/0x80 [snd_hda_scodec_cs35l41_spi]
[    3.267096]  spi_probe+0x55/0x90
[    3.267145]  really_probe+0x1b2/0x420
[    3.267184]  __driver_probe_device+0x7e/0x180
[    3.267227]  driver_probe_device+0x23/0xa0
[    3.267287]  __driver_attach+0xe4/0x1e0
[    3.267326]  ? __pfx___driver_attach+0x10/0x10
[    3.267381]  bus_for_each_dev+0x7a/0xd0
[    3.267406]  driver_attach+0x1e/0x30
[    3.267437]  bus_add_driver+0x11c/0x220
[    3.267461]  driver_register+0x64/0x130
[    3.267483]  ? __pfx_init_module+0x10/0x10 [snd_hda_scodec_cs35l41_spi]
[    3.267525]  __spi_register_driver+0xa1/0xd0
[    3.270712]  ? __pfx_init_module+0x10/0x10 [snd_hda_scodec_cs35l41_spi]
[    3.273446]  cs35l41_spi_driver_init+0x1c/0xff0 
[snd_hda_scodec_cs35l41_spi]
[    3.275119]  do_one_initcall+0x46/0x220
[    3.276828]  ? kmalloc_trace+0x2a/0xa0
[    3.279290]  do_init_module+0x52/0x220
[    3.283593]  load_module+0x223c/0x2460
[    3.283602]  __do_sys_finit_module+0xc8/0x140
[    3.287883]  ? __do_sys_finit_module+0xc8/0x140
[    3.287907]  __x64_sys_finit_module+0x18/0x20
[    3.293156]  do_syscall_64+0x38/0x90
[    3.298937]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
[    3.298945] RIP: 0033:0x7f98d06f776d
[    3.319574] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 
48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 
05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f3 36 0d 00 f7 d8 64 89 01 48
[    3.319579] RSP: 002b:00007ffd988f7a08 EFLAGS: 00000246 ORIG_RAX: 
0000000000000139
[    3.319585] RAX: ffffffffffffffda RBX: 000055af06a7d030 RCX: 
00007f98d06f776d
[    3.319589] RDX: 0000000000000000 RSI: 00007f98d05d7ded RDI: 
0000000000000013
[    3.329520] RBP: 0000000000020000 R08: 0000000000000000 R09: 
0000000000000000
[    3.329523] R10: 0000000000000013 R11: 0000000000000246 R12: 
00007f98d05d7ded
[    3.329525] R13: 0000000000000000 R14: 000055af06cdd040 R15: 
000055af06a7d030
[    3.329531]  </TASK>
[    3.329533] Modules linked in: snd_hda_intel(+) ttm snd_intel_dspcfg 
btusb rapl snd_seq_midi snd_intel_sdw_acpi libarc4 intel_cstate 
binfmt_misc uvcvideo(+) snd_seq_midi_event btrtl 
snd_hda_scodec_cs35l41_spi(+) snd_hda_codec drm_display_helper 
cdc_ncm(+) videobuf2_vmalloc snd_rawmidi btbcm uvc cdc_ether cec btintel 
videobuf2_memops snd_hda_scodec_cs35l41_i2c snd_hda_core videobuf2_v4l2 
uas usbnet rc_core snd_hwdep btmtk snd_hda_scodec_cs35l41 input_leds mii 
wmi_bmof videodev snd_seq processor_thermal_device_pci bluetooth iwlwifi 
drm_kms_helper snd_pcm snd_hda_cs_dsp_ctls processor_thermal_device 
mei_me videobuf2_common snd_seq_device i2c_algo_bit cs_dsp 
processor_thermal_rfim ecdh_generic usb_storage serio_raw mc syscopyarea 
ecc processor_thermal_mbox ucsi_acpi snd_soc_cs35l41_lib 8250_dw mei 
snd_timer cfg80211 sysfillrect typec_ucsi processor_thermal_rapl 
igen6_edac sysimgblt intel_rapl_common typec snd soundcore 
int3403_thermal int340x_thermal_zone serial_multi_instantiate 
int3400_thermal intel_hid acpi_thermal_rel
[    3.338475]  sparse_keymap acpi_tad acpi_pad mac_hid sch_fq_codel msr 
parport_pc ppdev lp parport drm ramoops reed_solomon efi_pstore 
ip_tables x_tables autofs4 spi_pxa2xx_platform dw_dmac dw_dmac_core 
intel_lpss_pci nvme intel_lpss i2c_i801 idma64 crc32_pclmul thunderbolt 
i2c_smbus nvme_core xhci_pci virt_dma xhci_pci_renesas video wmi 
pinctrl_tigerlake
[    3.338514] CR2: 00000000fffedfdd
[    3.338517] ---[ end trace 0000000000000000 ]---
[    3.504965] RIP: 0010:gpiod_set_raw_value_commit+0x3d/0xf0
[    3.504973] Code: 48 89 e5 41 55 44 0f b6 ee 41 54 53 48 8b 17 48 2b 
82 70 03 00 00 4c 8b a2 68 03 00 00 48 c1 f8 03 48 0f af c1 66 90 48 89 
c6 <49> 8b 44 24 60 44 89 ea 4c 89 e7 ff d0 0f 1f 00 5b 41 5c 41 5d 5d
[    3.504975] RSP: 0018:ffffaad780f6f620 EFLAGS: 00010a03
[    3.504978] RAX: 333330b6bdbad102 RBX: ffff9c8d4a5f6800 RCX: 
cccccccccccccccd
[    3.504979] RDX: ffff9c8d4a5f6d40 RSI: 333330b6bdbad102 RDI: 
ffff9c8d4a5f6d40
[    3.504980] RBP: ffffaad780f6f638 R08: 00000001018c3789 R09: 
0000000000000000
[    3.504982] R10: ffff9c8c4009ee40 R11: 0000000000000000 R12: 
00000000fffedf7d
[    3.504983] R13: 0000000000000000 R14: 0000000000000001 R15: 
0000000000000001
[    3.504984] FS:  00007f98d04de880(0000) GS:ffff9c90df700000(0000) 
knlGS:0000000000000000
[    3.504986] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    3.504988] CR2: 00000000fffedfdd CR3: 000000010b680003 CR4: 
0000000000770ee0
[    3.504989] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 
0000000000000000
[    3.504990] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7: 
0000000000000400
[    3.504992] PKRU: 55555554

Thanks,
Stefan

>> Thanks,
>>
>> Stefan
>>
>>>> Thanks,
>>>> Stefan Binding
>>>>
>>>>> Signed-off-by: Amit Kumar Mahapatra <amit.kumar-
>>>> mahapatra@amd.com>
>>>>> ---
>>>>>    drivers/spi/spi.c       | 226
>>>> ++++++++++++++++++++++++++++------------
>>>>>    include/linux/spi/spi.h |  32 ++++--
>>>>>    2 files changed, 183 insertions(+), 75 deletions(-)
>>>>>
>>>>> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index
>>>>> 9036d7a50674..04d7322170c4 100644
>>>>> --- a/drivers/spi/spi.c
>>>>> +++ b/drivers/spi/spi.c
>>>>> @@ -612,10 +612,24 @@ static int spi_dev_check(struct device *dev,
>>>>> void *data)  {
>>>>>    	struct spi_device *spi = to_spi_device(dev);
>>>>>    	struct spi_device *new_spi = data;
>>>>> +	int idx, nw_idx;
>>>>>
>>>>> -	if (spi->controller == new_spi->controller &&
>>>>> -	    spi_get_chipselect(spi, 0) == spi_get_chipselect(new_spi,
>>>> 0))
>>>>> -		return -EBUSY;
>>>>> +	if (spi->controller == new_spi->controller) {
>>>>> +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>>>>> +			for (nw_idx = 0; nw_idx < SPI_CS_CNT_MAX;
>>>>> nw_idx++) {
>>>>> +				if ((idx != 0 &&
>>>> !spi_get_chipselect(spi,
>>>>> idx)) ||
>>>>> +				    (nw_idx != 0 &&
>>>>> !spi_get_chipselect(spi, nw_idx))) {
>>>>> +					continue;
>>>>> +				} else if (spi_get_chipselect(spi,
>>>> idx) ==
>>>>> +				    spi_get_chipselect(new_spi,
>>>> nw_idx))
>>>>> {
>>>>> +					dev_err(dev,
>>>>> +						"chipselect %d already
>>>>> in use\n",
>>>>> +
>>>>> 	spi_get_chipselect(new_spi, nw_idx));
>>>>> +					return -EBUSY;
>>>>> +				}
>>>>> +			}
>>>>> +		}
>>>>> +	}
>>>>>    	return 0;
>>>>>    }
>>>>>
>>>>> @@ -629,7 +643,7 @@ static int __spi_add_device(struct spi_device
>>>>> *spi)
>>>>>    {
>>>>>    	struct spi_controller *ctlr = spi->controller;
>>>>>    	struct device *dev = ctlr->dev.parent;
>>>>> -	int status;
>>>>> +	int status, idx;
>>>>>
>>>>>    	/*
>>>>>    	 * We need to make sure there's no other device with this @@
>>>>> -638,8
>>>>> +652,6 @@ static int __spi_add_device(struct spi_device
>>>>> *spi)
>>>>>    	 */
>>>>>    	status = bus_for_each_dev(&spi_bus_type, NULL, spi,
>>>> spi_dev_check);
>>>>>    	if (status) {
>>>>> -		dev_err(dev, "chipselect %d already in use\n",
>>>>> -				spi_get_chipselect(spi, 0));
>>>>>    		return status;
>>>>>    	}
>>>>>
>>>>> @@ -649,8 +661,10 @@ static int __spi_add_device(struct spi_device
>>>>> *spi)
>>>>>    		return -ENODEV;
>>>>>    	}
>>>>>
>>>>> -	if (ctlr->cs_gpiods)
>>>>> -		spi_set_csgpiod(spi, 0, ctlr-
>>>>>> cs_gpiods[spi_get_chipselect(spi, 0)]);
>>>>> +	if (ctlr->cs_gpiods) {
>>>>> +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
>>>>> +			spi_set_csgpiod(spi, idx, ctlr-
>>>>>> cs_gpiods[spi_get_chipselect(spi, idx)]);
>>>>> +	}
>>>>>
>>>>>    	/*
>>>>>    	 * Drivers may modify this initial i/o setup, but will @@ -690,13
>>>>> +704,15 @@ int spi_add_device(struct spi_device *spi)  {
>>>>>    	struct spi_controller *ctlr = spi->controller;
>>>>>    	struct device *dev = ctlr->dev.parent;
>>>>> -	int status;
>>>>> +	int status, idx;
>>>>>
>>>>> -	/* Chipselects are numbered 0..max; validate. */
>>>>> -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
>>>>> -		dev_err(dev, "cs%d >= max %d\n",
>>>>> spi_get_chipselect(spi, 0),
>>>>> -			ctlr->num_chipselect);
>>>>> -		return -EINVAL;
>>>>> +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>>>>> +		/* Chipselects are numbered 0..max; validate. */
>>>>> +		if (spi_get_chipselect(spi, idx) >=
>>>> ctlr->num_chipselect) {
>>>>> +			dev_err(dev, "cs%d >= max %d\n",
>>>>> spi_get_chipselect(spi, idx),
>>>>> +				ctlr->num_chipselect);
>>>>> +			return -EINVAL;
>>>>> +		}
>>>>>    	}
>>>>>
>>>>>    	/* Set the bus ID string */
>>>>> @@ -713,12 +729,15 @@ static int spi_add_device_locked(struct
>>>>> spi_device *spi)  {
>>>>>    	struct spi_controller *ctlr = spi->controller;
>>>>>    	struct device *dev = ctlr->dev.parent;
>>>>> +	int idx;
>>>>>
>>>>> -	/* Chipselects are numbered 0..max; validate. */
>>>>> -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
>>>>> -		dev_err(dev, "cs%d >= max %d\n",
>>>>> spi_get_chipselect(spi, 0),
>>>>> -			ctlr->num_chipselect);
>>>>> -		return -EINVAL;
>>>>> +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>>>>> +		/* Chipselects are numbered 0..max; validate. */
>>>>> +		if (spi_get_chipselect(spi, idx) >=
>>>> ctlr->num_chipselect) {
>>>>> +			dev_err(dev, "cs%d >= max %d\n",
>>>>> spi_get_chipselect(spi, idx),
>>>>> +				ctlr->num_chipselect);
>>>>> +			return -EINVAL;
>>>>> +		}
>>>>>    	}
>>>>>
>>>>>    	/* Set the bus ID string */
>>>>> @@ -966,58 +985,118 @@ static void spi_res_release(struct
>>>>> spi_controller *ctlr, struct spi_message *mes  static void
>>>>> spi_set_cs(struct spi_device *spi, bool enable, bool
>>>> force)
>>>>>    {
>>>>>    	bool activate = enable;
>>>>> +	u32 cs_num = __ffs(spi->cs_index_mask);
>>>>> +	int idx;
>>>>>
>>>>>    	/*
>>>>> -	 * Avoid calling into the driver (or doing delays) if the chip
>>>> select
>>>>> -	 * isn't actually changing from the last time this was called.
>>>>> +	 * In parallel mode all the chip selects are
>>>> asserted/de-asserted
>>>>> +	 * at once
>>>>>    	 */
>>>>> -	if (!force && ((enable && spi->controller->last_cs ==
>>>>> spi_get_chipselect(spi, 0)) ||
>>>>> -		       (!enable && spi->controller->last_cs !=
>>>>> spi_get_chipselect(spi, 0))) &&
>>>>> -	    (spi->controller->last_cs_mode_high == (spi->mode &
>>>>> SPI_CS_HIGH)))
>>>>> -		return;
>>>>> -
>>>>> -	trace_spi_set_cs(spi, activate);
>>>>> -
>>>>> -	spi->controller->last_cs = enable ? spi_get_chipselect(spi, 0)
>>>> : -1;
>>>>> -	spi->controller->last_cs_mode_high = spi->mode &
>>>>> SPI_CS_HIGH;
>>>>> -
>>>>> -	if ((spi_get_csgpiod(spi, 0) ||
>>>> !spi->controller->set_cs_timing)
>>>>> && !activate)
>>>>> -		spi_delay_exec(&spi->cs_hold, NULL);
>>>>> -
>>>>> -	if (spi->mode & SPI_CS_HIGH)
>>>>> -		enable = !enable;
>>>>> +	if ((spi->cs_index_mask & SPI_PARALLEL_CS_MASK) ==
>>>>> SPI_PARALLEL_CS_MASK) {
>>>>> +		spi->controller->last_cs_mode_high = spi->mode &
>>>>> SPI_CS_HIGH;
>>>>> +
>>>>> +		if ((spi_get_csgpiod(spi, 0) || !spi->controller-
>>>>>> set_cs_timing) && !activate)
>>>>> +			spi_delay_exec(&spi->cs_hold, NULL);
>>>>> +
>>>>> +		if (spi->mode & SPI_CS_HIGH)
>>>>> +			enable = !enable;
>>>>> +
>>>>> +		if (spi_get_csgpiod(spi, 0) && spi_get_csgpiod(spi,
>>>> 1)) {
>>>>> +			if (!(spi->mode & SPI_NO_CS)) {
>>>>> +				/*
>>>>> +				 * Historically ACPI has no means of
>>>> the
>>>>> GPIO polarity and
>>>>> +				 * thus the SPISerialBus() resource
>>>>> defines it on the per-chip
>>>>> +				 * basis. In order to avoid a chain of
>>>>> negations, the GPIO
>>>>> +				 * polarity is considered being Active
>>>>> High. Even for the cases
>>>>> +				 * when _DSD() is involved (in the
>>>>> updated versions of ACPI)
>>>>> +				 * the GPIO CS polarity must be
>>>> defined
>>>>> Active High to avoid
>>>>> +				 * ambiguity. That's why we use
>>>> enable,
>>>>> that takes SPI_CS_HIGH
>>>>> +				 * into account.
>>>>> +				 */
>>>>> +				if (has_acpi_companion(&spi->dev)) {
>>>>> +					for (idx = 0; idx <
>>>>> SPI_CS_CNT_MAX; idx++)
>>>>> +
>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
>>>>> +
>>>>> !enable);
>>>>> +				} else {
>>>>> +					for (idx = 0; idx <
>>>>> SPI_CS_CNT_MAX; idx++)
>>>>> +						/* Polarity handled by
>>>>> GPIO library */
>>>>> +
>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
>>>>> +
>>>>> activate);
>>>>> +				}
>>>>> +			}
>>>>> +			/* Some SPI masters need both GPIO CS &
>>>>> slave_select */
>>>>> +			if ((spi->controller->flags &
>>>>> SPI_MASTER_GPIO_SS) &&
>>>>> +			    spi->controller->set_cs)
>>>>> +				spi->controller->set_cs(spi, !enable);
>>>>> +		} else if (spi->controller->set_cs) {
>>>>> +			spi->controller->set_cs(spi, !enable);
>>>>> +		}
>>>>>
>>>>> -	if (spi_get_csgpiod(spi, 0)) {
>>>>> -		if (!(spi->mode & SPI_NO_CS)) {
>>>>> -			/*
>>>>> -			 * Historically ACPI has no means of the GPIO
>>>>> polarity and
>>>>> -			 * thus the SPISerialBus() resource defines it
>>>> on
>>>>> the per-chip
>>>>> -			 * basis. In order to avoid a chain of
>>>> negations,
>>>>> the GPIO
>>>>> -			 * polarity is considered being Active High.
>>>> Even
>>>>> for the cases
>>>>> -			 * when _DSD() is involved (in the updated
>>>>> versions of ACPI)
>>>>> -			 * the GPIO CS polarity must be defined Active
>>>>> High to avoid
>>>>> -			 * ambiguity. That's why we use enable, that
>>>>> takes SPI_CS_HIGH
>>>>> -			 * into account.
>>>>> -			 */
>>>>> -			if (has_acpi_companion(&spi->dev))
>>>>> -
>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), !enable);
>>>>> +		if (spi_get_csgpiod(spi, 0) || spi_get_csgpiod(spi, 1)
>>>> ||
>>>>> +		    !spi->controller->set_cs_timing) {
>>>>> +			if (activate)
>>>>> +				spi_delay_exec(&spi->cs_setup, NULL);
>>>>>    			else
>>>>> -				/* Polarity handled by GPIO library */
>>>>> -
>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), activate);
>>>>> +				spi_delay_exec(&spi->cs_inactive,
>>>>> NULL);
>>>>>    		}
>>>>> -		/* Some SPI masters need both GPIO CS & slave_select
>>>>> */
>>>>> -		if ((spi->controller->flags & SPI_MASTER_GPIO_SS) &&
>>>>> -		    spi->controller->set_cs)
>>>>> +	} else {
>>>>> +		/*
>>>>> +		 * Avoid calling into the driver (or doing delays) if
>>>> the
>>>>> chip select
>>>>> +		 * isn't actually changing from the last time this was
>>>>> called.
>>>>> +		 */
>>>>> +		if (!force && ((enable && spi->controller->last_cs ==
>>>>> +				spi_get_chipselect(spi, cs_num)) ||
>>>>> +				(!enable && spi->controller->last_cs
>>>> !=
>>>>> +				 spi_get_chipselect(spi, cs_num))) &&
>>>>> +		    (spi->controller->last_cs_mode_high ==
>>>>> +		     (spi->mode & SPI_CS_HIGH)))
>>>>> +			return;
>>>>> +
>>>>> +		trace_spi_set_cs(spi, activate);
>>>>> +
>>>>> +		spi->controller->last_cs = enable ?
>>>>> spi_get_chipselect(spi, cs_num) : -1;
>>>>> +		spi->controller->last_cs_mode_high = spi->mode &
>>>>> SPI_CS_HIGH;
>>>>> +
>>>>> +		if ((spi_get_csgpiod(spi, cs_num) || !spi->controller-
>>>>>> set_cs_timing) && !activate)
>>>>> +			spi_delay_exec(&spi->cs_hold, NULL);
>>>>> +
>>>>> +		if (spi->mode & SPI_CS_HIGH)
>>>>> +			enable = !enable;
>>>>> +
>>>>> +		if (spi_get_csgpiod(spi, cs_num)) {
>>>>> +			if (!(spi->mode & SPI_NO_CS)) {
>>>>> +				/*
>>>>> +				 * Historically ACPI has no means of
>>>> the
>>>>> GPIO polarity and
>>>>> +				 * thus the SPISerialBus() resource
>>>>> defines it on the per-chip
>>>>> +				 * basis. In order to avoid a chain of
>>>>> negations, the GPIO
>>>>> +				 * polarity is considered being Active
>>>>> High. Even for the cases
>>>>> +				 * when _DSD() is involved (in the
>>>>> updated versions of ACPI)
>>>>> +				 * the GPIO CS polarity must be
>>>> defined
>>>>> Active High to avoid
>>>>> +				 * ambiguity. That's why we use
>>>> enable,
>>>>> that takes SPI_CS_HIGH
>>>>> +				 * into account.
>>>>> +				 */
>>>>> +				if (has_acpi_companion(&spi->dev))
>>>>> +
>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
>>>>> +
>>>>> !enable);
>>>>> +				else
>>>>> +					/* Polarity handled by GPIO
>>>>> library */
>>>>> +
>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
>>>>> +
>>>>> activate);
>>>>> +			}
>>>>> +			/* Some SPI masters need both GPIO CS &
>>>>> slave_select */
>>>>> +			if ((spi->controller->flags &
>>>>> SPI_MASTER_GPIO_SS) &&
>>>>> +			    spi->controller->set_cs)
>>>>> +				spi->controller->set_cs(spi, !enable);
>>>>> +		} else if (spi->controller->set_cs) {
>>>>>    			spi->controller->set_cs(spi, !enable);
>>>>> -	} else if (spi->controller->set_cs) {
>>>>> -		spi->controller->set_cs(spi, !enable);
>>>>> -	}
>>>>> +		}
>>>>>
>>>>> -	if (spi_get_csgpiod(spi, 0) ||
>>>> !spi->controller->set_cs_timing) {
>>>>> -		if (activate)
>>>>> -			spi_delay_exec(&spi->cs_setup, NULL);
>>>>> -		else
>>>>> -			spi_delay_exec(&spi->cs_inactive, NULL);
>>>>> +		if (spi_get_csgpiod(spi, cs_num) || !spi->controller-
>>>>>> set_cs_timing) {
>>>>> +			if (activate)
>>>>> +				spi_delay_exec(&spi->cs_setup, NULL);
>>>>> +			else
>>>>> +				spi_delay_exec(&spi->cs_inactive,
>>>>> NULL);
>>>>> +		}
>>>>>    	}
>>>>>    }
>>>>>
>>>>> @@ -2246,8 +2325,8 @@ static void of_spi_parse_dt_cs_delay(struct
>>>>> device_node *nc,  static int of_spi_parse_dt(struct spi_controller
>>>>> *ctlr, struct
>>>> spi_device
>>>>> *spi,
>>>>>    			   struct device_node *nc)
>>>>>    {
>>>>> -	u32 value;
>>>>> -	int rc;
>>>>> +	u32 value, cs[SPI_CS_CNT_MAX] = {0};
>>>>> +	int rc, idx;
>>>>>
>>>>>    	/* Mode (clock phase/polarity/etc.) */
>>>>>    	if (of_property_read_bool(nc, "spi-cpha")) @@ -2320,13 +2399,21
>>>> @@
>>>>> static int of_spi_parse_dt(struct spi_controller *ctlr, struct
>>>>> spi_device *spi,
>>>>>    	}
>>>>>
>>>>>    	/* Device address */
>>>>> -	rc = of_property_read_u32(nc, "reg", &value);
>>>>> -	if (rc) {
>>>>> +	rc = of_property_read_variable_u32_array(nc, "reg", &cs[0], 1,
>>>>> +						 SPI_CS_CNT_MAX);
>>>>> +	if (rc < 0 || rc > ctlr->num_chipselect) {
>>>>>    		dev_err(&ctlr->dev, "%pOF has no valid 'reg' property
>>>> (%d)\n",
>>>>>    			nc, rc);
>>>>>    		return rc;
>>>>> +	} else if ((of_property_read_bool(nc, "parallel-memories")) &&
>>>>> +		   (!(ctlr->flags & SPI_CONTROLLER_MULTI_CS))) {
>>>>> +		dev_err(&ctlr->dev, "SPI controller doesn't support
>>>> multi
>>>>> CS\n");
>>>>> +		return -EINVAL;
>>>>>    	}
>>>>> -	spi_set_chipselect(spi, 0, value);
>>>>> +	for (idx = 0; idx < rc; idx++)
>>>>> +		spi_set_chipselect(spi, idx, cs[idx]);
>>>>> +	/* By default set the spi->cs_index_mask as 1 */
>>>>> +	spi->cs_index_mask = 0x01;
>>>>>
>>>>>    	/* Device speed */
>>>>>    	if (!of_property_read_u32(nc, "spi-max-frequency", &value)) @@
>>>>> -3907,7 +3994,8 @@ static int __spi_validate(struct spi_device *spi,
>>>>> struct spi_message *message)
>>>>>    	 * cs_change is set for each transfer.
>>>>>    	 */
>>>>>    	if ((spi->mode & SPI_CS_WORD) && (!(ctlr->mode_bits &
>>>>> SPI_CS_WORD) ||
>>>>> -					  spi_get_csgpiod(spi, 0))) {
>>>>> +					  spi_get_csgpiod(spi, 0) ||
>>>>> +					  spi_get_csgpiod(spi, 1))) {
>>>>>    		size_t maxsize;
>>>>>    		int ret;
>>>>>
>>>>> diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index
>>>>> 873ced6ae4ca..6453b246e0af 100644
>>>>> --- a/include/linux/spi/spi.h
>>>>> +++ b/include/linux/spi/spi.h
>>>>> @@ -19,6 +19,11 @@
>>>>>    #include <linux/acpi.h>
>>>>>    #include <linux/u64_stats_sync.h>
>>>>>
>>>>> +/* Max no. of CS supported per spi device */ #define SPI_CS_CNT_MAX
>>>>> +2
>>>>> +
>>>>> +/* chip select mask */
>>>>> +#define SPI_PARALLEL_CS_MASK	(BIT(0) | BIT(1))
>>>>>    struct dma_chan;
>>>>>    struct software_node;
>>>>>    struct ptp_system_timestamp;
>>>>> @@ -166,6 +171,7 @@ extern void
>>>>> spi_transfer_cs_change_delay_exec(struct spi_message *msg,
>>>>>     *	deasserted. If @cs_change_delay is used from @spi_transfer,
>>>>> then the
>>>>>     *	two delays will be added up.
>>>>>     * @pcpu_statistics: statistics for the spi_device
>>>>> + * @cs_index_mask: Bit mask of the active chipselect(s) in the
>>>>> chipselect array
>>>>>     *
>>>>>     * A @spi_device is used to interchange data between an SPI slave
>>>>>     * (usually a discrete chip) and CPU memory.
>>>>> @@ -181,7 +187,7 @@ struct spi_device {
>>>>>    	struct spi_controller	*controller;
>>>>>    	struct spi_controller	*master;	/* Compatibility layer
>>>> */
>>>>>    	u32			max_speed_hz;
>>>>> -	u8			chip_select;
>>>>> +	u8			chip_select[SPI_CS_CNT_MAX];
>>>>>    	u8			bits_per_word;
>>>>>    	bool			rt;
>>>>>    #define SPI_NO_TX	BIT(31)		/* No transmit wire */
>>>>> @@ -202,7 +208,7 @@ struct spi_device {
>>>>>    	void			*controller_data;
>>>>>    	char			modalias[SPI_NAME_SIZE];
>>>>>    	const char		*driver_override;
>>>>> -	struct gpio_desc	*cs_gpiod;	/* Chip select gpio
>>>> desc
>>>>> */
>>>>> +	struct gpio_desc	*cs_gpiod[SPI_CS_CNT_MAX];	/*
>>>> Chip
>>>>> select gpio desc */
>>>>>    	struct spi_delay	word_delay; /* Inter-word delay */
>>>>>    	/* CS delays */
>>>>>    	struct spi_delay	cs_setup;
>>>>> @@ -212,6 +218,13 @@ struct spi_device {
>>>>>    	/* The statistics */
>>>>>    	struct spi_statistics __percpu	*pcpu_statistics;
>>>>>
>>>>> +	/* Bit mask of the chipselect(s) that the driver need to use
>>>> from
>>>>> +	 * the chipselect array.When the controller is capable to
>>>> handle
>>>>> +	 * multiple chip selects & memories are connected in parallel
>>>>> +	 * then more than one bit need to be set in cs_index_mask.
>>>>> +	 */
>>>>> +	u32			cs_index_mask : SPI_CS_CNT_MAX;
>>>>> +
>>>>>    	/*
>>>>>    	 * likely need more hooks for more protocol options affecting how
>>>>>    	 * the controller talks to each chip, like:
>>>>> @@ -268,22 +281,22 @@ static inline void *spi_get_drvdata(const
>>>>> struct spi_device *spi)
>>>>>
>>>>>    static inline u8 spi_get_chipselect(const struct spi_device *spi,
>>>> u8 idx)
>>>>>    {
>>>>> -	return spi->chip_select;
>>>>> +	return spi->chip_select[idx];
>>>>>    }
>>>>>
>>>>>    static inline void spi_set_chipselect(struct spi_device *spi, u8
>>>> idx, u8
>>>>> chipselect)
>>>>>    {
>>>>> -	spi->chip_select = chipselect;
>>>>> +	spi->chip_select[idx] = chipselect;
>>>>>    }
>>>>>
>>>>>    static inline struct gpio_desc *spi_get_csgpiod(const struct
>>>> spi_device
>>>>> *spi, u8 idx)
>>>>>    {
>>>>> -	return spi->cs_gpiod;
>>>>> +	return spi->cs_gpiod[idx];
>>>>>    }
>>>>>
>>>>>    static inline void spi_set_csgpiod(struct spi_device *spi, u8 idx,
>>>> struct
>>>>> gpio_desc *csgpiod)
>>>>>    {
>>>>> -	spi->cs_gpiod = csgpiod;
>>>>> +	spi->cs_gpiod[idx] = csgpiod;
>>>>>    }
>>>>>
>>>>>    /**
>>>>> @@ -388,6 +401,8 @@ extern struct spi_device
>>>>> *spi_new_ancillary_device(struct spi_device *spi, u8 ch
>>>>>     * @bus_lock_spinlock: spinlock for SPI bus locking
>>>>>     * @bus_lock_mutex: mutex for exclusion of multiple callers
>>>>>     * @bus_lock_flag: indicates that the SPI bus is locked for
>>>> exclusive use
>>>>> + * @multi_cs_cap: indicates that the SPI Controller can
>>>> assert/de-assert
>>>>> + *	more than one chip select at once.
>>>>>     * @setup: updates the device mode and clocking records used by a
>>>>>     *	device's SPI controller; protocol code may call this.  This
>>>>>     *	must fail if an unrecognized or unsupported mode is requested.
>>>>> @@ -554,6 +569,11 @@ struct spi_controller {
>>>>>    #define SPI_CONTROLLER_MUST_TX		BIT(4)	/* Requires tx
>>>>> */
>>>>>
>>>>>    #define SPI_MASTER_GPIO_SS		BIT(5)	/* GPIO CS must
>>>> select
>>>>> slave */
>>>>> +	/*
>>>>> +	 * The spi-controller has multi chip select capability and can
>>>>> +	 * assert/de-assert more than one chip select at once.
>>>>> +	 */
>>>>> +#define SPI_CONTROLLER_MULTI_CS		BIT(6)
>>>>>
>>>>>    	/* Flag indicating if the allocation of this struct is devres-
>>>>> managed */
>>>>>    	bool			devm_allocated;
>>>>> --
>>>>> 2.17.1
Mahapatra, Amit Kumar April 27, 2023, 5:09 p.m. UTC | #6
Hello Stefan,

> -----Original Message-----
> From: Stefan Binding <sbinding@opensource.cirrus.com>
> Sent: Tuesday, April 25, 2023 5:50 PM
> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
> vigneshr@ti.com
> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
> claudiu.beznea@microchip.com; Simek, Michal <michal.simek@amd.com>;
> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
> Subject: Re: [PATCH V7 1/7] spi: Add stacked and parallel memories support
> in SPI core
> 
> Hi,
> 
> On 20/04/2023 10:04, Mahapatra, Amit Kumar wrote:
> > Hello Stefan,
> >
> >> -----Original Message-----
> >> From: Stefan Binding <sbinding@opensource.cirrus.com>
> >> Sent: Wednesday, April 12, 2023 8:33 PM
> >> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
> >> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
> >> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
> >> vigneshr@ti.com
> >> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org; linux-
> >> kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
> >> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
> >> claudiu.beznea@microchip.com; Simek, Michal
> <michal.simek@amd.com>;
> >> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
> >> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
> >> Subject: Re: [PATCH V7 1/7] spi: Add stacked and parallel memories
> >> support in SPI core
> >>
> >> Hi,
> >>
> >> On 11/04/2023 10:07, Mahapatra, Amit Kumar wrote:
> >>> Hello Stefan,
> >>>
> >>>> -----Original Message-----
> >>>> From: Stefan Binding <sbinding@opensource.cirrus.com>
> >>>> Sent: Thursday, April 6, 2023 7:14 PM
> >>>> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
> >>>> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
> >>>> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
> >>>> vigneshr@ti.com
> >>>> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org;
> >>>> linux- kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
> >>>> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
> >>>> claudiu.beznea@microchip.com; Simek, Michal
> >> <michal.simek@amd.com>;
> >>>> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
> >>>> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
> >>>> Subject: RE: [PATCH V7 1/7] spi: Add stacked and parallel memories
> >>>> support in SPI core
> >>>>
> >>>> Hi,
> >>>>
> >>>>> -----Original Message-----
> >>>>> From: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
> >>>>> Sent: Thursday, April 6, 2023 7:54 AM
> >>>>> To: broonie@kernel.org; tudor.ambarus@linaro.org;
> >>>>> pratyush@kernel.org; michael@walle.cc; miquel.raynal@bootlin.com;
> >>>>> richard@nod.at; vigneshr@ti.com
> >>>>> Cc: git@amd.com; sbinding@opensource.cirrus.com; linux-
> >>>>> spi@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> >>>>> mtd@lists.infradead.org; nicolas.ferre@microchip.com;
> >>>>> alexandre.belloni@bootlin.com; claudiu.beznea@microchip.com;
> >>>>> michal.simek@amd.com; linux-arm-kernel@lists.infradead.org;
> >>>>> amitrkcian2002@gmail.com; Amit Kumar Mahapatra <amit.kumar-
> >>>>> mahapatra@amd.com>
> >>>>> Subject: [PATCH V7 1/7] spi: Add stacked and parallel memories
> >>>> support
> >>>>> in SPI core
> >>>>>
> >>>>> For supporting multiple CS the SPI device need to be aware of all
> >>>> the CS
> >>>>> values. So, the "chip_select" member in the spi_device structure
> >>>>> is
> >>>> now
> >>>>> an
> >>>>> array that holds all the CS values.
> >>>>>
> >>>>> spi_device structure now has a "cs_index_mask" member. This acts
> >>>>> as
> >>>> an
> >>>>> index to the chip_select array. If nth bit of spi->cs_index_mask
> >>>>> is
> >>>> set
> >>>>> then the driver would assert spi->chip_select[n].
> >>>>>
> >>>>> In parallel mode all the chip selects are asserted/de-asserted
> >>>>> simultaneously and each byte of data is stored in both devices,
> >>>>> the
> >>>> even
> >>>>> bits in one, the odd bits in the other. The split is automatically
> >>>> handled
> >>>>> by the GQSPI controller. The GQSPI controller supports a maximum
> >>>>> of two flashes connected in parallel mode. A
> >>>>> SPI_CONTROLLER_MULTI_CS flag bit is added in the spi
> >>>>> controntroller flags, through
> >>>>> ctlr->flags the spi
> >>>> core
> >>>>> will make sure that the controller is capable of handling multiple
> >>>> chip
> >>>>> selects at once.
> >>>>>
> >>>>> For supporting multiple CS via GPIO the cs_gpiod member of the
> >>>>> spi_device structure is now an array that holds the gpio
> >>>>> descriptor for each chipselect.
> >>>>>
> >>>>> Multi CS support using GPIO is not tested due to unavailability of
> >>>>> necessary hardware setup.
> >>>>>
> >>>>> Multi CS configuration with one native CS and one GPIO CS is not
> >>>>> supported as this configuration could not be tested due to
> >>>>> unavailability of necessary hardware setup.
> >>>> I've tested this chain on a released laptop (HP EliteBook 840 G9)
> >>>> which uses SPI to interface to 2 amps, one amp uses a native CS and
> >>>> the other uses a GPIO CS, and I noticed that when using this chain,
> >>>> the second amp no longer works.
> >>> Thank you for testing this patch series on GPIO CS setup. As I don't
> >>> have a GPIO CS setup, is it possible for you debug the failure and
> >>> share more details/logs where the problem is?
> >>>
> >>> Regards,
> >>> Amit
> >> We are willing and able to debug this failure and share the failure logs.
> >> The first issue that I see is a kernel crash when trying to set the GPIO CS:
> >>
> >> [    2.951658] general protection fault, probably for non-canonical
> >> address
> >> 0xdead000000000122: 0000 [#1] PREEMPT SMP NOPTI [    2.951771] CPU:
> 9
> >> PID: 379 Comm: systemd-udevd Tainted: G A           6.3.0-rc3+ #30 [
> >> 2.951826] Hardware name: HP /896D, BIOS U70 Ver. 89.33.02 10/29/2021
> >> [    2.951882] RIP: 0010:gpiod_set_value_cansleep+0x21/0xa0
> >> [    2.951941] Code: 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 48 85
> >> ff
> >> 74 3e 55 48 89 e5 41 55 41 89 f5 41 54 49 89 fc 48 81 ff 00 f0 ff ff
> >> 77 2c <48> 8b 3f 48 85 ff 74 53 48 83 bf 68 03 00 00 00 74 34 44 89
> >> ee 4c [    2.952043]
> >> RSP: 0018:ffffc008c0deb928 EFLAGS: 00010287 [    2.952080] RAX:
> >> 0000000000000001 RBX: ffffa0a489534c00 RCX:
> >> 0000000000000000
> >> [    2.952124] RDX: dead000000000122 RSI: 0000000000000001 RDI:
> >> dead000000000122
> >> [    2.952167] RBP: ffffc008c0deb938 R08: 0000000000000000 R09:
> >> ffffc008c0deb868
> >> [    2.952211] R10: ffffffffffffffff R11: 00000000000000b0 R12:
> >> dead000000000122
> >> [    2.952256] R13: 0000000000000001 R14: 0000000000000000 R15:
> >> 0000000000000000
> >> [    2.952299] FS:  00007f7fa5b5b880(0000) GS:ffffa0a81f840000(0000)
> >> knlGS:0000000000000000
> >> [    2.952369] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [
> >> 2.952407] CR2: 000055d648427100 CR3: 000000010e960003 CR4:
> >> 0000000000770ee0
> >> [    2.952451] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> >> 0000000000000000
> >> [    2.952492] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
> >> 0000000000000400
> >> [    2.952533] PKRU: 55555554
> >> [    2.952561] Call Trace:
> >> [    2.952579]  <TASK>
> >> [    2.952598]  spi_set_cs+0x257/0x4a0 [    2.952630]
> >> spi_setup+0x1a2/0x500 [    2.952667]  __spi_add_device+0x88/0x160 [
> >> 2.952710]  spi_add_device+0x60/0x90 [    2.952738]
> >> smi_spi_probe+0x178/0x370 [serial_multi_instantiate] [    2.952792]
> >> smi_probe+0xcf/0x110 [serial_multi_instantiate] [    2.952854]
> >> platform_probe+0x42/0xb0 [    2.952885]  really_probe+0x1b2/0x420 [
> >> 2.952914]  __driver_probe_device+0x7e/0x180 [    2.952947]
> >> driver_probe_device+0x23/0xa0 [    2.952993]
> >> __driver_attach+0xe4/0x1e0 [    2.953021]  ?
> >> __pfx___driver_attach+0x10/0x10
> >> [    2.953061]  bus_for_each_dev+0x7a/0xd0 [    2.953088]
> >> driver_attach+0x1e/0x30 [    2.953123]  bus_add_driver+0x11c/0x220 [
> >> 2.953150]  driver_register+0x64/0x130 [    2.953174]  ?
> >> __pfx_init_module+0x10/0x10 [serial_multi_instantiate] [    2.953221]
> >> __platform_driver_register+0x1e/0x30
> >> [    2.953251]  smi_driver_init+0x1c/0xff0 [serial_multi_instantiate]
> >> [    2.953310]  do_one_initcall+0x46/0x220 [    2.953339]  ?
> >> kmalloc_trace+0x2a/0xa0 [    2.953375]  do_init_module+0x52/0x220 [
> >> 2.953411]  load_module+0x223c/0x2460 [    2.953450]
> >> __do_sys_finit_module+0xc8/0x140 [    2.953479]  ?
> >> __do_sys_finit_module+0xc8/0x140
> >> [    2.953510]  __x64_sys_finit_module+0x18/0x20 [    2.953538]
> >> do_syscall_64+0x38/0x90 [    2.953574]
> >> entry_SYSCALL_64_after_hwframe+0x72/0xdc
> >> [    2.953606] RIP: 0033:0x7f7fa5d7476d [    2.953639] Code: 00 c3 66
> >> 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa
> >> 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08
> >> 0f
> >> 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f3 36 0d 00 f7 d8 64 89 01
> >> 48 [    2.953739] RSP: 002b:00007fff1f8dd3b8 EFLAGS: 00000246
> ORIG_RAX:
> >> 0000000000000139
> >> [    2.956833] RAX: ffffffffffffffda RBX: 000055d648654ab0 RCX:
> >> 00007f7fa5d7476d
> >> [    2.959202] RDX: 0000000000000000 RSI: 00007f7fa5c54ded RDI:
> >> 0000000000000006
> >> [    2.961542] RBP: 0000000000020000 R08: 0000000000000000 R09:
> >> 0000000000000000
> >> [    2.964312] R10: 0000000000000006 R11: 0000000000000246 R12:
> >> 00007f7fa5c54ded
> >> [    2.966694] R13: 0000000000000000 R14: 000055d6483f41a0 R15:
> >> 000055d648654ab0
> >> [    2.967668] resource: resource sanity check: requesting [mem
> >> 0x00000000fedc0000-0x00000000fedcffff], which spans more than pnp
> >> 00:04 [mem 0xfedc0000-0xfedc7fff] [    2.968998]  </TASK> [
> >> 2.971615] caller
> >> igen6_probe+0x178/0x8e0 [igen6_edac] mapping multiple BARs [
> >> 2.975014] Modules linked in: igen6_edac(+) fjes(-)
> >> serial_multi_instantiate(+) int3403_thermal sch_fq_codel
> >> int340x_thermal_zone int3400_thermal intel_hid acpi_thermal_rel
> >> acpi_tad sparse_keymap acpi_pad mac_hid msr parport_pc ppdev lp
> >> parport drm ramoops reed_solomon efi_pstore ip_tables x_tables
> >> autofs4 spi_pxa2xx_platform dw_dmac dw_dmac_core nvme
> intel_lpss_pci
> >> intel_lpss crc32_pclmul thunderbolt i2c_i801 xhci_pci idma64
> >> nvme_core i2c_smbus virt_dma xhci_pci_renesas video wmi
> >> pinctrl_tigerlake [    2.987901] ---[ end trace 0000000000000000 ]---
> [    3.157030] RIP:
> >> 0010:gpiod_set_value_cansleep+0x21/0xa0
> >> [    3.159077] Code: 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 48 85
> >> ff
> >> 74 3e 55 48 89 e5 41 55 41 89 f5 41 54 49 89 fc 48 81 ff 00 f0 ff ff
> >> 77 2c <48> 8b 3f 48 85 ff 74 53 48 83 bf 68 03 00 00 00 74 34 44 89
> >> ee 4c [    3.161461]
> >> RSP: 0018:ffffc008c0deb928 EFLAGS: 00010287 [    3.164005] RAX:
> >> 0000000000000001 RBX: ffffa0a489534c00 RCX:
> >> 0000000000000000
> >> [    3.166354] RDX: dead000000000122 RSI: 0000000000000001 RDI:
> >> dead000000000122
> >> [    3.168499] RBP: ffffc008c0deb938 R08: 0000000000000000 R09:
> >> ffffc008c0deb868
> >> [    3.170609] R10: ffffffffffffffff R11: 00000000000000b0 R12:
> >> dead000000000122
> >> [    3.172893] R13: 0000000000000001 R14: 0000000000000000 R15:
> >> 0000000000000000
> >> [    3.175335] FS:  00007f7fa5b5b880(0000) GS:ffffa0a81f840000(0000)
> >> knlGS:0000000000000000
> >> [    3.180434] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [
> >> 3.183356] CR2: 000055d648427100 CR3: 000000010e960003 CR4:
> >> 0000000000770ee0
> >> [    3.185107] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> >> 0000000000000000
> >> [    3.186840] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
> >> 0000000000000400
> >> [    3.188647] PKRU: 55555554
> > Thank you for sharing the logs.
> > As per our analysis the spi->cs_gpiod[0] is getting messed up while
> > setting it in __spi_add_device( ).
> > Is it possible for you to do the following changes on top of this
> > patch series & re-run your test.
> >
> > After applying this patch series, in drivers/spi/spi.c file replace
> > the following code snippet in __spi_add_device( ) function defination.
> >
> > if (ctlr->cs_gpiods) {
> >          for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
> >                  spi_set_csgpiod(spi, idx,
> > ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]); }
> >
> > with the below code snippet
> >
> > if (ctlr->cs_gpiods) {
> >          for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> >                  if (!(idx != 0 && !spi_get_chipselect(spi, idx)))
> >                          spi_set_csgpiod(spi, idx, ctlr-
> >cs_gpiods[spi_get_chipselect(spi, idx)]);
> >          }
> > }
> >
> > then re-run your test.
> >
> > Regards,
> > Amit
> 
> I'm still seeing a crash on probe:
> 
> [    3.265683] BUG: unable to handle page fault for address:
> 00000000fffedfdd
> [    3.265744] #PF: supervisor read access in kernel mode [    3.265781] #PF:
> error_code(0x0000) - not-present page [    3.265817] PGD 0 P4D 0
> [    3.265840] Oops: 0000 [#1] PREEMPT SMP NOPTI [    3.265865] CPU: 4 PID:
> 385 Comm: systemd-udevd Tainted: G A           6.3.0-rc3+ #32 [    3.265910]
> Hardware name: HP /896D, BIOS U70 Ver. 89.33.02 10/29/2021 [    3.265956]
> RIP: 0010:gpiod_set_raw_value_commit+0x3d/0xf0
> [    3.266007] Code: 48 89 e5 41 55 44 0f b6 ee 41 54 53 48 8b 17 48 2b
> 82 70 03 00 00 4c 8b a2 68 03 00 00 48 c1 f8 03 48 0f af c1 66 90 48 89
> c6 <49> 8b 44 24 60 44 89 ea 4c 89 e7 ff d0 0f 1f 00 5b 41 5c 41 5d 5d
> [    3.266092] RSP: 0018:ffffaad780f6f620 EFLAGS: 00010a03 [    3.266121]
> RAX: 333330b6bdbad102 RBX: ffff9c8d4a5f6800 RCX:
> cccccccccccccccd
> [    3.266156] RDX: ffff9c8d4a5f6d40 RSI: 333330b6bdbad102 RDI:
> ffff9c8d4a5f6d40
> [    3.266192] RBP: ffffaad780f6f638 R08: 00000001018c3789 R09:
> 0000000000000000
> [    3.266228] R10: ffff9c8c4009ee40 R11: 0000000000000000 R12:
> 00000000fffedf7d
> [    3.266264] R13: 0000000000000000 R14: 0000000000000001 R15:
> 0000000000000001
> [    3.266299] FS:  00007f98d04de880(0000) GS:ffff9c90df700000(0000)
> knlGS:0000000000000000
> [    3.266358] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [    3.266388] CR2: 00000000fffedfdd CR3: 000000010b680003 CR4:
> 0000000000770ee0
> [    3.266422] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> 0000000000000000
> [    3.266457] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
> 0000000000000400
> [    3.266490] PKRU: 55555554
> [    3.266513] Call Trace:
> [    3.266530]  <TASK>
> [    3.266546]  gpiod_set_value_nocheck+0x5b/0x70
> [    3.266583]  gpiod_set_value_cansleep+0x3e/0xa0
> [    3.266609]  spi_set_cs+0x257/0x4a0
> [    3.266634]  spi_transfer_one_message+0x49/0x740
> [    3.266672]  __spi_pump_transfer_message+0x29b/0x620
> [    3.266712]  __spi_sync+0x26f/0x3b0
> [    3.266735]  spi_write_then_read+0x157/0x210 [    3.266771]  ?
> psi_group_change+0x175/0x3b0 [    3.266802]  regmap_spi_read+0xe/0x20
> [    3.266826]  _regmap_raw_read+0xe1/0x210
> [    3.266861]  _regmap_bus_read+0x3a/0x70
> [    3.266887]  _regmap_read+0x66/0x140
> [    3.266918]  regmap_read+0x3f/0x70
> [    3.266957]  cs35l41_hda_probe+0x553/0xc10 [snd_hda_scodec_cs35l41]
> [    3.267027]  cs35l41_hda_spi_probe+0x62/0x80
> [snd_hda_scodec_cs35l41_spi] [    3.267096]  spi_probe+0x55/0x90
> [    3.267145]  really_probe+0x1b2/0x420
> [    3.267184]  __driver_probe_device+0x7e/0x180
> [    3.267227]  driver_probe_device+0x23/0xa0
> [    3.267287]  __driver_attach+0xe4/0x1e0 [    3.267326]  ?
> __pfx___driver_attach+0x10/0x10
> [    3.267381]  bus_for_each_dev+0x7a/0xd0
> [    3.267406]  driver_attach+0x1e/0x30
> [    3.267437]  bus_add_driver+0x11c/0x220
> [    3.267461]  driver_register+0x64/0x130 [    3.267483]  ?
> __pfx_init_module+0x10/0x10 [snd_hda_scodec_cs35l41_spi]
> [    3.267525]  __spi_register_driver+0xa1/0xd0 [    3.270712]  ?
> __pfx_init_module+0x10/0x10 [snd_hda_scodec_cs35l41_spi]
> [    3.273446]  cs35l41_spi_driver_init+0x1c/0xff0
> [snd_hda_scodec_cs35l41_spi]
> [    3.275119]  do_one_initcall+0x46/0x220 [    3.276828]  ?
> kmalloc_trace+0x2a/0xa0 [    3.279290]  do_init_module+0x52/0x220
> [    3.283593]  load_module+0x223c/0x2460
> [    3.283602]  __do_sys_finit_module+0xc8/0x140 [    3.287883]  ?
> __do_sys_finit_module+0xc8/0x140
> [    3.287907]  __x64_sys_finit_module+0x18/0x20
> [    3.293156]  do_syscall_64+0x38/0x90
> [    3.298937]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
> [    3.298945] RIP: 0033:0x7f98d06f776d
> [    3.319574] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa
> 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f
> 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f3 36 0d 00 f7 d8 64 89 01 48
> [    3.319579] RSP: 002b:00007ffd988f7a08 EFLAGS: 00000246 ORIG_RAX:
> 0000000000000139
> [    3.319585] RAX: ffffffffffffffda RBX: 000055af06a7d030 RCX:
> 00007f98d06f776d
> [    3.319589] RDX: 0000000000000000 RSI: 00007f98d05d7ded RDI:
> 0000000000000013
> [    3.329520] RBP: 0000000000020000 R08: 0000000000000000 R09:
> 0000000000000000
> [    3.329523] R10: 0000000000000013 R11: 0000000000000246 R12:
> 00007f98d05d7ded
> [    3.329525] R13: 0000000000000000 R14: 000055af06cdd040 R15:
> 000055af06a7d030
> [    3.329531]  </TASK>
> [    3.329533] Modules linked in: snd_hda_intel(+) ttm snd_intel_dspcfg btusb
> rapl snd_seq_midi snd_intel_sdw_acpi libarc4 intel_cstate binfmt_misc
> uvcvideo(+) snd_seq_midi_event btrtl
> snd_hda_scodec_cs35l41_spi(+) snd_hda_codec drm_display_helper
> cdc_ncm(+) videobuf2_vmalloc snd_rawmidi btbcm uvc cdc_ether cec btintel
> videobuf2_memops snd_hda_scodec_cs35l41_i2c snd_hda_core
> videobuf2_v4l2 uas usbnet rc_core snd_hwdep btmtk
> snd_hda_scodec_cs35l41 input_leds mii wmi_bmof videodev snd_seq
> processor_thermal_device_pci bluetooth iwlwifi drm_kms_helper snd_pcm
> snd_hda_cs_dsp_ctls processor_thermal_device mei_me
> videobuf2_common snd_seq_device i2c_algo_bit cs_dsp
> processor_thermal_rfim ecdh_generic usb_storage serio_raw mc
> syscopyarea ecc processor_thermal_mbox ucsi_acpi snd_soc_cs35l41_lib
> 8250_dw mei snd_timer cfg80211 sysfillrect typec_ucsi
> processor_thermal_rapl igen6_edac sysimgblt intel_rapl_common typec snd
> soundcore int3403_thermal int340x_thermal_zone serial_multi_instantiate
> int3400_thermal intel_hid acpi_thermal_rel [    3.338475]  sparse_keymap
> acpi_tad acpi_pad mac_hid sch_fq_codel msr parport_pc ppdev lp parport
> drm ramoops reed_solomon efi_pstore ip_tables x_tables autofs4
> spi_pxa2xx_platform dw_dmac dw_dmac_core intel_lpss_pci nvme
> intel_lpss i2c_i801 idma64 crc32_pclmul thunderbolt i2c_smbus nvme_core
> xhci_pci virt_dma xhci_pci_renesas video wmi pinctrl_tigerlake [    3.338514]
> CR2: 00000000fffedfdd [    3.338517] ---[ end trace 0000000000000000 ]---
> [    3.504965] RIP: 0010:gpiod_set_raw_value_commit+0x3d/0xf0
> [    3.504973] Code: 48 89 e5 41 55 44 0f b6 ee 41 54 53 48 8b 17 48 2b
> 82 70 03 00 00 4c 8b a2 68 03 00 00 48 c1 f8 03 48 0f af c1 66 90 48 89
> c6 <49> 8b 44 24 60 44 89 ea 4c 89 e7 ff d0 0f 1f 00 5b 41 5c 41 5d 5d
> [    3.504975] RSP: 0018:ffffaad780f6f620 EFLAGS: 00010a03 [    3.504978]
> RAX: 333330b6bdbad102 RBX: ffff9c8d4a5f6800 RCX:
> cccccccccccccccd
> [    3.504979] RDX: ffff9c8d4a5f6d40 RSI: 333330b6bdbad102 RDI:
> ffff9c8d4a5f6d40
> [    3.504980] RBP: ffffaad780f6f638 R08: 00000001018c3789 R09:
> 0000000000000000
> [    3.504982] R10: ffff9c8c4009ee40 R11: 0000000000000000 R12:
> 00000000fffedf7d
> [    3.504983] R13: 0000000000000000 R14: 0000000000000001 R15:
> 0000000000000001
> [    3.504984] FS:  00007f98d04de880(0000) GS:ffff9c90df700000(0000)
> knlGS:0000000000000000
> [    3.504986] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [    3.504988] CR2: 00000000fffedfdd CR3: 000000010b680003 CR4:
> 0000000000770ee0
> [    3.504989] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> 0000000000000000
> [    3.504990] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
> 0000000000000400
> [    3.504992] PKRU: 55555554
> 
> Thanks,
> Stefan

Thanks for the logs.

Could you please confirm that your test case was passing with 
https://github.com/torvalds/linux/commit/303feb3cc06ac0665d0ee9c1414941200e60e8a3 patch
but it is failing with the current patch series ?  

Regarding the failure 
The logs suggest that we are trying to access an invalid pointer while 
calling the gpiod_set_value_cansleep( ) API.
This could be possible if the cs_num is corrupted and we are trying to 
access an invalid spi->cs_gpiod[ ]. 
To confirm the same could you please do the following changes in the 
code and re-test.

After applying this patch series, in drivers/spi/spi.c file replace the 
following code snippet in __spi_add_device( ) function definition.
if (ctlr->cs_gpiods) {
        for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
                spi_set_csgpiod(spi, idx, ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]); 
}

with the below code snippet

if (ctlr->cs_gpiods) {
        for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
                if (!(idx != 0 && !spi_get_chipselect(spi, idx))) {
		printk("%s( ) [%d] cs[%d] = [%d]\n", __func__, __LINE__, idx, spi_get_chipselect(spi, idx));
		spi_set_csgpiod(spi, idx, ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]);
	}
        }
}

And at the start of  spi_set_cs( ) function in drivers/spi/spi.c file add 
the following print statements.

printk("%s( ) [%d] spi->cs_index_mask == [%d]\n", __func__, __LINE__, spi->cs_index_mask);
printk("%s( ) [%d] cs_num == [%d]\n", __func__, __LINE__, cs_num);

Thanks,
Amit
> 
> >> Thanks,
> >>
> >> Stefan
> >>
> >>>> Thanks,
> >>>> Stefan Binding
> >>>>
> >>>>> Signed-off-by: Amit Kumar Mahapatra <amit.kumar-
> >>>> mahapatra@amd.com>
> >>>>> ---
> >>>>>    drivers/spi/spi.c       | 226
> >>>> ++++++++++++++++++++++++++++------------
> >>>>>    include/linux/spi/spi.h |  32 ++++--
> >>>>>    2 files changed, 183 insertions(+), 75 deletions(-)
> >>>>>
> >>>>> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index
> >>>>> 9036d7a50674..04d7322170c4 100644
> >>>>> --- a/drivers/spi/spi.c
> >>>>> +++ b/drivers/spi/spi.c
> >>>>> @@ -612,10 +612,24 @@ static int spi_dev_check(struct device *dev,
> >>>>> void *data)  {
> >>>>>    	struct spi_device *spi = to_spi_device(dev);
> >>>>>    	struct spi_device *new_spi = data;
> >>>>> +	int idx, nw_idx;
> >>>>>
> >>>>> -	if (spi->controller == new_spi->controller &&
> >>>>> -	    spi_get_chipselect(spi, 0) == spi_get_chipselect(new_spi,
> >>>> 0))
> >>>>> -		return -EBUSY;
> >>>>> +	if (spi->controller == new_spi->controller) {
> >>>>> +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> >>>>> +			for (nw_idx = 0; nw_idx < SPI_CS_CNT_MAX;
> >>>>> nw_idx++) {
> >>>>> +				if ((idx != 0 &&
> >>>> !spi_get_chipselect(spi,
> >>>>> idx)) ||
> >>>>> +				    (nw_idx != 0 &&
> >>>>> !spi_get_chipselect(spi, nw_idx))) {
> >>>>> +					continue;
> >>>>> +				} else if (spi_get_chipselect(spi,
> >>>> idx) ==
> >>>>> +				    spi_get_chipselect(new_spi,
> >>>> nw_idx))
> >>>>> {
> >>>>> +					dev_err(dev,
> >>>>> +						"chipselect %d
> already
> >>>>> in use\n",
> >>>>> +
> >>>>> 	spi_get_chipselect(new_spi, nw_idx));
> >>>>> +					return -EBUSY;
> >>>>> +				}
> >>>>> +			}
> >>>>> +		}
> >>>>> +	}
> >>>>>    	return 0;
> >>>>>    }
> >>>>>
> >>>>> @@ -629,7 +643,7 @@ static int __spi_add_device(struct spi_device
> >>>>> *spi)
> >>>>>    {
> >>>>>    	struct spi_controller *ctlr = spi->controller;
> >>>>>    	struct device *dev = ctlr->dev.parent;
> >>>>> -	int status;
> >>>>> +	int status, idx;
> >>>>>
> >>>>>    	/*
> >>>>>    	 * We need to make sure there's no other device with this
> @@
> >>>>> -638,8
> >>>>> +652,6 @@ static int __spi_add_device(struct spi_device
> >>>>> *spi)
> >>>>>    	 */
> >>>>>    	status = bus_for_each_dev(&spi_bus_type, NULL, spi,
> >>>> spi_dev_check);
> >>>>>    	if (status) {
> >>>>> -		dev_err(dev, "chipselect %d already in use\n",
> >>>>> -				spi_get_chipselect(spi, 0));
> >>>>>    		return status;
> >>>>>    	}
> >>>>>
> >>>>> @@ -649,8 +661,10 @@ static int __spi_add_device(struct spi_device
> >>>>> *spi)
> >>>>>    		return -ENODEV;
> >>>>>    	}
> >>>>>
> >>>>> -	if (ctlr->cs_gpiods)
> >>>>> -		spi_set_csgpiod(spi, 0, ctlr-
> >>>>>> cs_gpiods[spi_get_chipselect(spi, 0)]);
> >>>>> +	if (ctlr->cs_gpiods) {
> >>>>> +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
> >>>>> +			spi_set_csgpiod(spi, idx, ctlr-
> >>>>>> cs_gpiods[spi_get_chipselect(spi, idx)]);
> >>>>> +	}
> >>>>>
> >>>>>    	/*
> >>>>>    	 * Drivers may modify this initial i/o setup, but will @@
> >>>>> -690,13
> >>>>> +704,15 @@ int spi_add_device(struct spi_device *spi)  {
> >>>>>    	struct spi_controller *ctlr = spi->controller;
> >>>>>    	struct device *dev = ctlr->dev.parent;
> >>>>> -	int status;
> >>>>> +	int status, idx;
> >>>>>
> >>>>> -	/* Chipselects are numbered 0..max; validate. */
> >>>>> -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
> >>>>> -		dev_err(dev, "cs%d >= max %d\n",
> >>>>> spi_get_chipselect(spi, 0),
> >>>>> -			ctlr->num_chipselect);
> >>>>> -		return -EINVAL;
> >>>>> +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> >>>>> +		/* Chipselects are numbered 0..max; validate. */
> >>>>> +		if (spi_get_chipselect(spi, idx) >=
> >>>> ctlr->num_chipselect) {
> >>>>> +			dev_err(dev, "cs%d >= max %d\n",
> >>>>> spi_get_chipselect(spi, idx),
> >>>>> +				ctlr->num_chipselect);
> >>>>> +			return -EINVAL;
> >>>>> +		}
> >>>>>    	}
> >>>>>
> >>>>>    	/* Set the bus ID string */
> >>>>> @@ -713,12 +729,15 @@ static int spi_add_device_locked(struct
> >>>>> spi_device *spi)  {
> >>>>>    	struct spi_controller *ctlr = spi->controller;
> >>>>>    	struct device *dev = ctlr->dev.parent;
> >>>>> +	int idx;
> >>>>>
> >>>>> -	/* Chipselects are numbered 0..max; validate. */
> >>>>> -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
> >>>>> -		dev_err(dev, "cs%d >= max %d\n",
> >>>>> spi_get_chipselect(spi, 0),
> >>>>> -			ctlr->num_chipselect);
> >>>>> -		return -EINVAL;
> >>>>> +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> >>>>> +		/* Chipselects are numbered 0..max; validate. */
> >>>>> +		if (spi_get_chipselect(spi, idx) >=
> >>>> ctlr->num_chipselect) {
> >>>>> +			dev_err(dev, "cs%d >= max %d\n",
> >>>>> spi_get_chipselect(spi, idx),
> >>>>> +				ctlr->num_chipselect);
> >>>>> +			return -EINVAL;
> >>>>> +		}
> >>>>>    	}
> >>>>>
> >>>>>    	/* Set the bus ID string */
> >>>>> @@ -966,58 +985,118 @@ static void spi_res_release(struct
> >>>>> spi_controller *ctlr, struct spi_message *mes  static void
> >>>>> spi_set_cs(struct spi_device *spi, bool enable, bool
> >>>> force)
> >>>>>    {
> >>>>>    	bool activate = enable;
> >>>>> +	u32 cs_num = __ffs(spi->cs_index_mask);
> >>>>> +	int idx;
> >>>>>
> >>>>>    	/*
> >>>>> -	 * Avoid calling into the driver (or doing delays) if the chip
> >>>> select
> >>>>> -	 * isn't actually changing from the last time this was called.
> >>>>> +	 * In parallel mode all the chip selects are
> >>>> asserted/de-asserted
> >>>>> +	 * at once
> >>>>>    	 */
> >>>>> -	if (!force && ((enable && spi->controller->last_cs ==
> >>>>> spi_get_chipselect(spi, 0)) ||
> >>>>> -		       (!enable && spi->controller->last_cs !=
> >>>>> spi_get_chipselect(spi, 0))) &&
> >>>>> -	    (spi->controller->last_cs_mode_high == (spi->mode &
> >>>>> SPI_CS_HIGH)))
> >>>>> -		return;
> >>>>> -
> >>>>> -	trace_spi_set_cs(spi, activate);
> >>>>> -
> >>>>> -	spi->controller->last_cs = enable ? spi_get_chipselect(spi, 0)
> >>>> : -1;
> >>>>> -	spi->controller->last_cs_mode_high = spi->mode &
> >>>>> SPI_CS_HIGH;
> >>>>> -
> >>>>> -	if ((spi_get_csgpiod(spi, 0) ||
> >>>> !spi->controller->set_cs_timing)
> >>>>> && !activate)
> >>>>> -		spi_delay_exec(&spi->cs_hold, NULL);
> >>>>> -
> >>>>> -	if (spi->mode & SPI_CS_HIGH)
> >>>>> -		enable = !enable;
> >>>>> +	if ((spi->cs_index_mask & SPI_PARALLEL_CS_MASK) ==
> >>>>> SPI_PARALLEL_CS_MASK) {
> >>>>> +		spi->controller->last_cs_mode_high = spi->mode &
> >>>>> SPI_CS_HIGH;
> >>>>> +
> >>>>> +		if ((spi_get_csgpiod(spi, 0) || !spi->controller-
> >>>>>> set_cs_timing) && !activate)
> >>>>> +			spi_delay_exec(&spi->cs_hold, NULL);
> >>>>> +
> >>>>> +		if (spi->mode & SPI_CS_HIGH)
> >>>>> +			enable = !enable;
> >>>>> +
> >>>>> +		if (spi_get_csgpiod(spi, 0) && spi_get_csgpiod(spi,
> >>>> 1)) {
> >>>>> +			if (!(spi->mode & SPI_NO_CS)) {
> >>>>> +				/*
> >>>>> +				 * Historically ACPI has no means of
> >>>> the
> >>>>> GPIO polarity and
> >>>>> +				 * thus the SPISerialBus() resource
> >>>>> defines it on the per-chip
> >>>>> +				 * basis. In order to avoid a chain of
> >>>>> negations, the GPIO
> >>>>> +				 * polarity is considered being Active
> >>>>> High. Even for the cases
> >>>>> +				 * when _DSD() is involved (in the
> >>>>> updated versions of ACPI)
> >>>>> +				 * the GPIO CS polarity must be
> >>>> defined
> >>>>> Active High to avoid
> >>>>> +				 * ambiguity. That's why we use
> >>>> enable,
> >>>>> that takes SPI_CS_HIGH
> >>>>> +				 * into account.
> >>>>> +				 */
> >>>>> +				if (has_acpi_companion(&spi->dev)) {
> >>>>> +					for (idx = 0; idx <
> >>>>> SPI_CS_CNT_MAX; idx++)
> >>>>> +
> >>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
> >>>>> +
> >>>>> !enable);
> >>>>> +				} else {
> >>>>> +					for (idx = 0; idx <
> >>>>> SPI_CS_CNT_MAX; idx++)
> >>>>> +						/* Polarity handled by
> >>>>> GPIO library */
> >>>>> +
> >>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
> >>>>> +
> >>>>> activate);
> >>>>> +				}
> >>>>> +			}
> >>>>> +			/* Some SPI masters need both GPIO CS &
> >>>>> slave_select */
> >>>>> +			if ((spi->controller->flags &
> >>>>> SPI_MASTER_GPIO_SS) &&
> >>>>> +			    spi->controller->set_cs)
> >>>>> +				spi->controller->set_cs(spi, !enable);
> >>>>> +		} else if (spi->controller->set_cs) {
> >>>>> +			spi->controller->set_cs(spi, !enable);
> >>>>> +		}
> >>>>>
> >>>>> -	if (spi_get_csgpiod(spi, 0)) {
> >>>>> -		if (!(spi->mode & SPI_NO_CS)) {
> >>>>> -			/*
> >>>>> -			 * Historically ACPI has no means of the GPIO
> >>>>> polarity and
> >>>>> -			 * thus the SPISerialBus() resource defines it
> >>>> on
> >>>>> the per-chip
> >>>>> -			 * basis. In order to avoid a chain of
> >>>> negations,
> >>>>> the GPIO
> >>>>> -			 * polarity is considered being Active High.
> >>>> Even
> >>>>> for the cases
> >>>>> -			 * when _DSD() is involved (in the updated
> >>>>> versions of ACPI)
> >>>>> -			 * the GPIO CS polarity must be defined Active
> >>>>> High to avoid
> >>>>> -			 * ambiguity. That's why we use enable, that
> >>>>> takes SPI_CS_HIGH
> >>>>> -			 * into account.
> >>>>> -			 */
> >>>>> -			if (has_acpi_companion(&spi->dev))
> >>>>> -
> >>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), !enable);
> >>>>> +		if (spi_get_csgpiod(spi, 0) || spi_get_csgpiod(spi, 1)
> >>>> ||
> >>>>> +		    !spi->controller->set_cs_timing) {
> >>>>> +			if (activate)
> >>>>> +				spi_delay_exec(&spi->cs_setup,
> NULL);
> >>>>>    			else
> >>>>> -				/* Polarity handled by GPIO library */
> >>>>> -
> >>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), activate);
> >>>>> +				spi_delay_exec(&spi->cs_inactive,
> >>>>> NULL);
> >>>>>    		}
> >>>>> -		/* Some SPI masters need both GPIO CS & slave_select
> >>>>> */
> >>>>> -		if ((spi->controller->flags & SPI_MASTER_GPIO_SS) &&
> >>>>> -		    spi->controller->set_cs)
> >>>>> +	} else {
> >>>>> +		/*
> >>>>> +		 * Avoid calling into the driver (or doing delays) if
> >>>> the
> >>>>> chip select
> >>>>> +		 * isn't actually changing from the last time this was
> >>>>> called.
> >>>>> +		 */
> >>>>> +		if (!force && ((enable && spi->controller->last_cs ==
> >>>>> +				spi_get_chipselect(spi, cs_num)) ||
> >>>>> +				(!enable && spi->controller->last_cs
> >>>> !=
> >>>>> +				 spi_get_chipselect(spi, cs_num))) &&
> >>>>> +		    (spi->controller->last_cs_mode_high ==
> >>>>> +		     (spi->mode & SPI_CS_HIGH)))
> >>>>> +			return;
> >>>>> +
> >>>>> +		trace_spi_set_cs(spi, activate);
> >>>>> +
> >>>>> +		spi->controller->last_cs = enable ?
> >>>>> spi_get_chipselect(spi, cs_num) : -1;
> >>>>> +		spi->controller->last_cs_mode_high = spi->mode &
> >>>>> SPI_CS_HIGH;
> >>>>> +
> >>>>> +		if ((spi_get_csgpiod(spi, cs_num) || !spi->controller-
> >>>>>> set_cs_timing) && !activate)
> >>>>> +			spi_delay_exec(&spi->cs_hold, NULL);
> >>>>> +
> >>>>> +		if (spi->mode & SPI_CS_HIGH)
> >>>>> +			enable = !enable;
> >>>>> +
> >>>>> +		if (spi_get_csgpiod(spi, cs_num)) {
> >>>>> +			if (!(spi->mode & SPI_NO_CS)) {
> >>>>> +				/*
> >>>>> +				 * Historically ACPI has no means of
> >>>> the
> >>>>> GPIO polarity and
> >>>>> +				 * thus the SPISerialBus() resource
> >>>>> defines it on the per-chip
> >>>>> +				 * basis. In order to avoid a chain of
> >>>>> negations, the GPIO
> >>>>> +				 * polarity is considered being Active
> >>>>> High. Even for the cases
> >>>>> +				 * when _DSD() is involved (in the
> >>>>> updated versions of ACPI)
> >>>>> +				 * the GPIO CS polarity must be
> >>>> defined
> >>>>> Active High to avoid
> >>>>> +				 * ambiguity. That's why we use
> >>>> enable,
> >>>>> that takes SPI_CS_HIGH
> >>>>> +				 * into account.
> >>>>> +				 */
> >>>>> +				if (has_acpi_companion(&spi->dev))
> >>>>> +
> >>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
> >>>>> +
> >>>>> !enable);
> >>>>> +				else
> >>>>> +					/* Polarity handled by GPIO
> >>>>> library */
> >>>>> +
> >>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
> >>>>> +
> >>>>> activate);
> >>>>> +			}
> >>>>> +			/* Some SPI masters need both GPIO CS &
> >>>>> slave_select */
> >>>>> +			if ((spi->controller->flags &
> >>>>> SPI_MASTER_GPIO_SS) &&
> >>>>> +			    spi->controller->set_cs)
> >>>>> +				spi->controller->set_cs(spi, !enable);
> >>>>> +		} else if (spi->controller->set_cs) {
> >>>>>    			spi->controller->set_cs(spi, !enable);
> >>>>> -	} else if (spi->controller->set_cs) {
> >>>>> -		spi->controller->set_cs(spi, !enable);
> >>>>> -	}
> >>>>> +		}
> >>>>>
> >>>>> -	if (spi_get_csgpiod(spi, 0) ||
> >>>> !spi->controller->set_cs_timing) {
> >>>>> -		if (activate)
> >>>>> -			spi_delay_exec(&spi->cs_setup, NULL);
> >>>>> -		else
> >>>>> -			spi_delay_exec(&spi->cs_inactive, NULL);
> >>>>> +		if (spi_get_csgpiod(spi, cs_num) || !spi->controller-
> >>>>>> set_cs_timing) {
> >>>>> +			if (activate)
> >>>>> +				spi_delay_exec(&spi->cs_setup,
> NULL);
> >>>>> +			else
> >>>>> +				spi_delay_exec(&spi->cs_inactive,
> >>>>> NULL);
> >>>>> +		}
> >>>>>    	}
> >>>>>    }
> >>>>>
> >>>>> @@ -2246,8 +2325,8 @@ static void of_spi_parse_dt_cs_delay(struct
> >>>>> device_node *nc,  static int of_spi_parse_dt(struct spi_controller
> >>>>> *ctlr, struct
> >>>> spi_device
> >>>>> *spi,
> >>>>>    			   struct device_node *nc)
> >>>>>    {
> >>>>> -	u32 value;
> >>>>> -	int rc;
> >>>>> +	u32 value, cs[SPI_CS_CNT_MAX] = {0};
> >>>>> +	int rc, idx;
> >>>>>
> >>>>>    	/* Mode (clock phase/polarity/etc.) */
> >>>>>    	if (of_property_read_bool(nc, "spi-cpha")) @@ -2320,13
> >>>>> +2399,21
> >>>> @@
> >>>>> static int of_spi_parse_dt(struct spi_controller *ctlr, struct
> >>>>> spi_device *spi,
> >>>>>    	}
> >>>>>
> >>>>>    	/* Device address */
> >>>>> -	rc = of_property_read_u32(nc, "reg", &value);
> >>>>> -	if (rc) {
> >>>>> +	rc = of_property_read_variable_u32_array(nc, "reg", &cs[0],
> 1,
> >>>>> +						 SPI_CS_CNT_MAX);
> >>>>> +	if (rc < 0 || rc > ctlr->num_chipselect) {
> >>>>>    		dev_err(&ctlr->dev, "%pOF has no valid 'reg' property
> >>>> (%d)\n",
> >>>>>    			nc, rc);
> >>>>>    		return rc;
> >>>>> +	} else if ((of_property_read_bool(nc, "parallel-memories"))
> &&
> >>>>> +		   (!(ctlr->flags & SPI_CONTROLLER_MULTI_CS))) {
> >>>>> +		dev_err(&ctlr->dev, "SPI controller doesn't support
> >>>> multi
> >>>>> CS\n");
> >>>>> +		return -EINVAL;
> >>>>>    	}
> >>>>> -	spi_set_chipselect(spi, 0, value);
> >>>>> +	for (idx = 0; idx < rc; idx++)
> >>>>> +		spi_set_chipselect(spi, idx, cs[idx]);
> >>>>> +	/* By default set the spi->cs_index_mask as 1 */
> >>>>> +	spi->cs_index_mask = 0x01;
> >>>>>
> >>>>>    	/* Device speed */
> >>>>>    	if (!of_property_read_u32(nc, "spi-max-frequency", &value))
> @@
> >>>>> -3907,7 +3994,8 @@ static int __spi_validate(struct spi_device
> >>>>> *spi, struct spi_message *message)
> >>>>>    	 * cs_change is set for each transfer.
> >>>>>    	 */
> >>>>>    	if ((spi->mode & SPI_CS_WORD) && (!(ctlr->mode_bits &
> >>>>> SPI_CS_WORD) ||
> >>>>> -					  spi_get_csgpiod(spi, 0))) {
> >>>>> +					  spi_get_csgpiod(spi, 0) ||
> >>>>> +					  spi_get_csgpiod(spi, 1))) {
> >>>>>    		size_t maxsize;
> >>>>>    		int ret;
> >>>>>
> >>>>> diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
> >>>>> index 873ced6ae4ca..6453b246e0af 100644
> >>>>> --- a/include/linux/spi/spi.h
> >>>>> +++ b/include/linux/spi/spi.h
> >>>>> @@ -19,6 +19,11 @@
> >>>>>    #include <linux/acpi.h>
> >>>>>    #include <linux/u64_stats_sync.h>
> >>>>>
> >>>>> +/* Max no. of CS supported per spi device */ #define
> >>>>> +SPI_CS_CNT_MAX
> >>>>> +2
> >>>>> +
> >>>>> +/* chip select mask */
> >>>>> +#define SPI_PARALLEL_CS_MASK	(BIT(0) | BIT(1))
> >>>>>    struct dma_chan;
> >>>>>    struct software_node;
> >>>>>    struct ptp_system_timestamp;
> >>>>> @@ -166,6 +171,7 @@ extern void
> >>>>> spi_transfer_cs_change_delay_exec(struct spi_message *msg,
> >>>>>     *	deasserted. If @cs_change_delay is used from
> @spi_transfer,
> >>>>> then the
> >>>>>     *	two delays will be added up.
> >>>>>     * @pcpu_statistics: statistics for the spi_device
> >>>>> + * @cs_index_mask: Bit mask of the active chipselect(s) in the
> >>>>> chipselect array
> >>>>>     *
> >>>>>     * A @spi_device is used to interchange data between an SPI slave
> >>>>>     * (usually a discrete chip) and CPU memory.
> >>>>> @@ -181,7 +187,7 @@ struct spi_device {
> >>>>>    	struct spi_controller	*controller;
> >>>>>    	struct spi_controller	*master;	/* Compatibility layer
> >>>> */
> >>>>>    	u32			max_speed_hz;
> >>>>> -	u8			chip_select;
> >>>>> +	u8			chip_select[SPI_CS_CNT_MAX];
> >>>>>    	u8			bits_per_word;
> >>>>>    	bool			rt;
> >>>>>    #define SPI_NO_TX	BIT(31)		/* No transmit wire */
> >>>>> @@ -202,7 +208,7 @@ struct spi_device {
> >>>>>    	void			*controller_data;
> >>>>>    	char			modalias[SPI_NAME_SIZE];
> >>>>>    	const char		*driver_override;
> >>>>> -	struct gpio_desc	*cs_gpiod;	/* Chip select gpio
> >>>> desc
> >>>>> */
> >>>>> +	struct gpio_desc	*cs_gpiod[SPI_CS_CNT_MAX];	/*
> >>>> Chip
> >>>>> select gpio desc */
> >>>>>    	struct spi_delay	word_delay; /* Inter-word delay */
> >>>>>    	/* CS delays */
> >>>>>    	struct spi_delay	cs_setup;
> >>>>> @@ -212,6 +218,13 @@ struct spi_device {
> >>>>>    	/* The statistics */
> >>>>>    	struct spi_statistics __percpu	*pcpu_statistics;
> >>>>>
> >>>>> +	/* Bit mask of the chipselect(s) that the driver need to use
> >>>> from
> >>>>> +	 * the chipselect array.When the controller is capable to
> >>>> handle
> >>>>> +	 * multiple chip selects & memories are connected in parallel
> >>>>> +	 * then more than one bit need to be set in cs_index_mask.
> >>>>> +	 */
> >>>>> +	u32			cs_index_mask : SPI_CS_CNT_MAX;
> >>>>> +
> >>>>>    	/*
> >>>>>    	 * likely need more hooks for more protocol options affecting
> how
> >>>>>    	 * the controller talks to each chip, like:
> >>>>> @@ -268,22 +281,22 @@ static inline void *spi_get_drvdata(const
> >>>>> struct spi_device *spi)
> >>>>>
> >>>>>    static inline u8 spi_get_chipselect(const struct spi_device
> >>>>> *spi,
> >>>> u8 idx)
> >>>>>    {
> >>>>> -	return spi->chip_select;
> >>>>> +	return spi->chip_select[idx];
> >>>>>    }
> >>>>>
> >>>>>    static inline void spi_set_chipselect(struct spi_device *spi,
> >>>>> u8
> >>>> idx, u8
> >>>>> chipselect)
> >>>>>    {
> >>>>> -	spi->chip_select = chipselect;
> >>>>> +	spi->chip_select[idx] = chipselect;
> >>>>>    }
> >>>>>
> >>>>>    static inline struct gpio_desc *spi_get_csgpiod(const struct
> >>>> spi_device
> >>>>> *spi, u8 idx)
> >>>>>    {
> >>>>> -	return spi->cs_gpiod;
> >>>>> +	return spi->cs_gpiod[idx];
> >>>>>    }
> >>>>>
> >>>>>    static inline void spi_set_csgpiod(struct spi_device *spi, u8
> >>>>> idx,
> >>>> struct
> >>>>> gpio_desc *csgpiod)
> >>>>>    {
> >>>>> -	spi->cs_gpiod = csgpiod;
> >>>>> +	spi->cs_gpiod[idx] = csgpiod;
> >>>>>    }
> >>>>>
> >>>>>    /**
> >>>>> @@ -388,6 +401,8 @@ extern struct spi_device
> >>>>> *spi_new_ancillary_device(struct spi_device *spi, u8 ch
> >>>>>     * @bus_lock_spinlock: spinlock for SPI bus locking
> >>>>>     * @bus_lock_mutex: mutex for exclusion of multiple callers
> >>>>>     * @bus_lock_flag: indicates that the SPI bus is locked for
> >>>> exclusive use
> >>>>> + * @multi_cs_cap: indicates that the SPI Controller can
> >>>> assert/de-assert
> >>>>> + *	more than one chip select at once.
> >>>>>     * @setup: updates the device mode and clocking records used by a
> >>>>>     *	device's SPI controller; protocol code may call this.  This
> >>>>>     *	must fail if an unrecognized or unsupported mode is
> requested.
> >>>>> @@ -554,6 +569,11 @@ struct spi_controller {
> >>>>>    #define SPI_CONTROLLER_MUST_TX		BIT(4)	/* Requires tx
> >>>>> */
> >>>>>
> >>>>>    #define SPI_MASTER_GPIO_SS		BIT(5)	/* GPIO CS must
> >>>> select
> >>>>> slave */
> >>>>> +	/*
> >>>>> +	 * The spi-controller has multi chip select capability and can
> >>>>> +	 * assert/de-assert more than one chip select at once.
> >>>>> +	 */
> >>>>> +#define SPI_CONTROLLER_MULTI_CS		BIT(6)
> >>>>>
> >>>>>    	/* Flag indicating if the allocation of this struct is devres-
> >>>>> managed */
> >>>>>    	bool			devm_allocated;
> >>>>> --
> >>>>> 2.17.1
Stefan Binding April 28, 2023, 2:08 p.m. UTC | #7
Hi,

On 27/04/2023 18:09, Mahapatra, Amit Kumar wrote:
> Hello Stefan,
>
>> -----Original Message-----
>> From: Stefan Binding <sbinding@opensource.cirrus.com>
>> Sent: Tuesday, April 25, 2023 5:50 PM
>> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
>> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
>> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
>> vigneshr@ti.com
>> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org; linux-
>> kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
>> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
>> claudiu.beznea@microchip.com; Simek, Michal <michal.simek@amd.com>;
>> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
>> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
>> Subject: Re: [PATCH V7 1/7] spi: Add stacked and parallel memories support
>> in SPI core
>>
>> Hi,
>>
>> On 20/04/2023 10:04, Mahapatra, Amit Kumar wrote:
>>> Hello Stefan,
>>>
>>>> -----Original Message-----
>>>> From: Stefan Binding <sbinding@opensource.cirrus.com>
>>>> Sent: Wednesday, April 12, 2023 8:33 PM
>>>> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
>>>> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
>>>> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
>>>> vigneshr@ti.com
>>>> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org; linux-
>>>> kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
>>>> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
>>>> claudiu.beznea@microchip.com; Simek, Michal
>> <michal.simek@amd.com>;
>>>> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
>>>> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
>>>> Subject: Re: [PATCH V7 1/7] spi: Add stacked and parallel memories
>>>> support in SPI core
>>>>
>>>> Hi,
>>>>
>>>> On 11/04/2023 10:07, Mahapatra, Amit Kumar wrote:
>>>>> Hello Stefan,
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Stefan Binding <sbinding@opensource.cirrus.com>
>>>>>> Sent: Thursday, April 6, 2023 7:14 PM
>>>>>> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
>>>>>> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
>>>>>> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
>>>>>> vigneshr@ti.com
>>>>>> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org;
>>>>>> linux- kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
>>>>>> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
>>>>>> claudiu.beznea@microchip.com; Simek, Michal
>>>> <michal.simek@amd.com>;
>>>>>> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
>>>>>> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
>>>>>> Subject: RE: [PATCH V7 1/7] spi: Add stacked and parallel memories
>>>>>> support in SPI core
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>> -----Original Message-----
>>>>>>> From: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
>>>>>>> Sent: Thursday, April 6, 2023 7:54 AM
>>>>>>> To: broonie@kernel.org; tudor.ambarus@linaro.org;
>>>>>>> pratyush@kernel.org; michael@walle.cc; miquel.raynal@bootlin.com;
>>>>>>> richard@nod.at; vigneshr@ti.com
>>>>>>> Cc: git@amd.com; sbinding@opensource.cirrus.com; linux-
>>>>>>> spi@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
>>>>>>> mtd@lists.infradead.org; nicolas.ferre@microchip.com;
>>>>>>> alexandre.belloni@bootlin.com; claudiu.beznea@microchip.com;
>>>>>>> michal.simek@amd.com; linux-arm-kernel@lists.infradead.org;
>>>>>>> amitrkcian2002@gmail.com; Amit Kumar Mahapatra <amit.kumar-
>>>>>>> mahapatra@amd.com>
>>>>>>> Subject: [PATCH V7 1/7] spi: Add stacked and parallel memories
>>>>>> support
>>>>>>> in SPI core
>>>>>>>
>>>>>>> For supporting multiple CS the SPI device need to be aware of all
>>>>>> the CS
>>>>>>> values. So, the "chip_select" member in the spi_device structure
>>>>>>> is
>>>>>> now
>>>>>>> an
>>>>>>> array that holds all the CS values.
>>>>>>>
>>>>>>> spi_device structure now has a "cs_index_mask" member. This acts
>>>>>>> as
>>>>>> an
>>>>>>> index to the chip_select array. If nth bit of spi->cs_index_mask
>>>>>>> is
>>>>>> set
>>>>>>> then the driver would assert spi->chip_select[n].
>>>>>>>
>>>>>>> In parallel mode all the chip selects are asserted/de-asserted
>>>>>>> simultaneously and each byte of data is stored in both devices,
>>>>>>> the
>>>>>> even
>>>>>>> bits in one, the odd bits in the other. The split is automatically
>>>>>> handled
>>>>>>> by the GQSPI controller. The GQSPI controller supports a maximum
>>>>>>> of two flashes connected in parallel mode. A
>>>>>>> SPI_CONTROLLER_MULTI_CS flag bit is added in the spi
>>>>>>> controntroller flags, through
>>>>>>> ctlr->flags the spi
>>>>>> core
>>>>>>> will make sure that the controller is capable of handling multiple
>>>>>> chip
>>>>>>> selects at once.
>>>>>>>
>>>>>>> For supporting multiple CS via GPIO the cs_gpiod member of the
>>>>>>> spi_device structure is now an array that holds the gpio
>>>>>>> descriptor for each chipselect.
>>>>>>>
>>>>>>> Multi CS support using GPIO is not tested due to unavailability of
>>>>>>> necessary hardware setup.
>>>>>>>
>>>>>>> Multi CS configuration with one native CS and one GPIO CS is not
>>>>>>> supported as this configuration could not be tested due to
>>>>>>> unavailability of necessary hardware setup.
>>>>>> I've tested this chain on a released laptop (HP EliteBook 840 G9)
>>>>>> which uses SPI to interface to 2 amps, one amp uses a native CS and
>>>>>> the other uses a GPIO CS, and I noticed that when using this chain,
>>>>>> the second amp no longer works.
>>>>> Thank you for testing this patch series on GPIO CS setup. As I don't
>>>>> have a GPIO CS setup, is it possible for you debug the failure and
>>>>> share more details/logs where the problem is?
>>>>>
>>>>> Regards,
>>>>> Amit
>>>> We are willing and able to debug this failure and share the failure logs.
>>>> The first issue that I see is a kernel crash when trying to set the GPIO CS:
>>>>
>>>> [    2.951658] general protection fault, probably for non-canonical
>>>> address
>>>> 0xdead000000000122: 0000 [#1] PREEMPT SMP NOPTI [    2.951771] CPU:
>> 9
>>>> PID: 379 Comm: systemd-udevd Tainted: G A           6.3.0-rc3+ #30 [
>>>> 2.951826] Hardware name: HP /896D, BIOS U70 Ver. 89.33.02 10/29/2021
>>>> [    2.951882] RIP: 0010:gpiod_set_value_cansleep+0x21/0xa0
>>>> [    2.951941] Code: 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 48 85
>>>> ff
>>>> 74 3e 55 48 89 e5 41 55 41 89 f5 41 54 49 89 fc 48 81 ff 00 f0 ff ff
>>>> 77 2c <48> 8b 3f 48 85 ff 74 53 48 83 bf 68 03 00 00 00 74 34 44 89
>>>> ee 4c [    2.952043]
>>>> RSP: 0018:ffffc008c0deb928 EFLAGS: 00010287 [    2.952080] RAX:
>>>> 0000000000000001 RBX: ffffa0a489534c00 RCX:
>>>> 0000000000000000
>>>> [    2.952124] RDX: dead000000000122 RSI: 0000000000000001 RDI:
>>>> dead000000000122
>>>> [    2.952167] RBP: ffffc008c0deb938 R08: 0000000000000000 R09:
>>>> ffffc008c0deb868
>>>> [    2.952211] R10: ffffffffffffffff R11: 00000000000000b0 R12:
>>>> dead000000000122
>>>> [    2.952256] R13: 0000000000000001 R14: 0000000000000000 R15:
>>>> 0000000000000000
>>>> [    2.952299] FS:  00007f7fa5b5b880(0000) GS:ffffa0a81f840000(0000)
>>>> knlGS:0000000000000000
>>>> [    2.952369] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [
>>>> 2.952407] CR2: 000055d648427100 CR3: 000000010e960003 CR4:
>>>> 0000000000770ee0
>>>> [    2.952451] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
>>>> 0000000000000000
>>>> [    2.952492] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
>>>> 0000000000000400
>>>> [    2.952533] PKRU: 55555554
>>>> [    2.952561] Call Trace:
>>>> [    2.952579]  <TASK>
>>>> [    2.952598]  spi_set_cs+0x257/0x4a0 [    2.952630]
>>>> spi_setup+0x1a2/0x500 [    2.952667]  __spi_add_device+0x88/0x160 [
>>>> 2.952710]  spi_add_device+0x60/0x90 [    2.952738]
>>>> smi_spi_probe+0x178/0x370 [serial_multi_instantiate] [    2.952792]
>>>> smi_probe+0xcf/0x110 [serial_multi_instantiate] [    2.952854]
>>>> platform_probe+0x42/0xb0 [    2.952885]  really_probe+0x1b2/0x420 [
>>>> 2.952914]  __driver_probe_device+0x7e/0x180 [    2.952947]
>>>> driver_probe_device+0x23/0xa0 [    2.952993]
>>>> __driver_attach+0xe4/0x1e0 [    2.953021]  ?
>>>> __pfx___driver_attach+0x10/0x10
>>>> [    2.953061]  bus_for_each_dev+0x7a/0xd0 [    2.953088]
>>>> driver_attach+0x1e/0x30 [    2.953123]  bus_add_driver+0x11c/0x220 [
>>>> 2.953150]  driver_register+0x64/0x130 [    2.953174]  ?
>>>> __pfx_init_module+0x10/0x10 [serial_multi_instantiate] [    2.953221]
>>>> __platform_driver_register+0x1e/0x30
>>>> [    2.953251]  smi_driver_init+0x1c/0xff0 [serial_multi_instantiate]
>>>> [    2.953310]  do_one_initcall+0x46/0x220 [    2.953339]  ?
>>>> kmalloc_trace+0x2a/0xa0 [    2.953375]  do_init_module+0x52/0x220 [
>>>> 2.953411]  load_module+0x223c/0x2460 [    2.953450]
>>>> __do_sys_finit_module+0xc8/0x140 [    2.953479]  ?
>>>> __do_sys_finit_module+0xc8/0x140
>>>> [    2.953510]  __x64_sys_finit_module+0x18/0x20 [    2.953538]
>>>> do_syscall_64+0x38/0x90 [    2.953574]
>>>> entry_SYSCALL_64_after_hwframe+0x72/0xdc
>>>> [    2.953606] RIP: 0033:0x7f7fa5d7476d [    2.953639] Code: 00 c3 66
>>>> 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa
>>>> 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08
>>>> 0f
>>>> 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f3 36 0d 00 f7 d8 64 89 01
>>>> 48 [    2.953739] RSP: 002b:00007fff1f8dd3b8 EFLAGS: 00000246
>> ORIG_RAX:
>>>> 0000000000000139
>>>> [    2.956833] RAX: ffffffffffffffda RBX: 000055d648654ab0 RCX:
>>>> 00007f7fa5d7476d
>>>> [    2.959202] RDX: 0000000000000000 RSI: 00007f7fa5c54ded RDI:
>>>> 0000000000000006
>>>> [    2.961542] RBP: 0000000000020000 R08: 0000000000000000 R09:
>>>> 0000000000000000
>>>> [    2.964312] R10: 0000000000000006 R11: 0000000000000246 R12:
>>>> 00007f7fa5c54ded
>>>> [    2.966694] R13: 0000000000000000 R14: 000055d6483f41a0 R15:
>>>> 000055d648654ab0
>>>> [    2.967668] resource: resource sanity check: requesting [mem
>>>> 0x00000000fedc0000-0x00000000fedcffff], which spans more than pnp
>>>> 00:04 [mem 0xfedc0000-0xfedc7fff] [    2.968998]  </TASK> [
>>>> 2.971615] caller
>>>> igen6_probe+0x178/0x8e0 [igen6_edac] mapping multiple BARs [
>>>> 2.975014] Modules linked in: igen6_edac(+) fjes(-)
>>>> serial_multi_instantiate(+) int3403_thermal sch_fq_codel
>>>> int340x_thermal_zone int3400_thermal intel_hid acpi_thermal_rel
>>>> acpi_tad sparse_keymap acpi_pad mac_hid msr parport_pc ppdev lp
>>>> parport drm ramoops reed_solomon efi_pstore ip_tables x_tables
>>>> autofs4 spi_pxa2xx_platform dw_dmac dw_dmac_core nvme
>> intel_lpss_pci
>>>> intel_lpss crc32_pclmul thunderbolt i2c_i801 xhci_pci idma64
>>>> nvme_core i2c_smbus virt_dma xhci_pci_renesas video wmi
>>>> pinctrl_tigerlake [    2.987901] ---[ end trace 0000000000000000 ]---
>> [    3.157030] RIP:
>>>> 0010:gpiod_set_value_cansleep+0x21/0xa0
>>>> [    3.159077] Code: 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 48 85
>>>> ff
>>>> 74 3e 55 48 89 e5 41 55 41 89 f5 41 54 49 89 fc 48 81 ff 00 f0 ff ff
>>>> 77 2c <48> 8b 3f 48 85 ff 74 53 48 83 bf 68 03 00 00 00 74 34 44 89
>>>> ee 4c [    3.161461]
>>>> RSP: 0018:ffffc008c0deb928 EFLAGS: 00010287 [    3.164005] RAX:
>>>> 0000000000000001 RBX: ffffa0a489534c00 RCX:
>>>> 0000000000000000
>>>> [    3.166354] RDX: dead000000000122 RSI: 0000000000000001 RDI:
>>>> dead000000000122
>>>> [    3.168499] RBP: ffffc008c0deb938 R08: 0000000000000000 R09:
>>>> ffffc008c0deb868
>>>> [    3.170609] R10: ffffffffffffffff R11: 00000000000000b0 R12:
>>>> dead000000000122
>>>> [    3.172893] R13: 0000000000000001 R14: 0000000000000000 R15:
>>>> 0000000000000000
>>>> [    3.175335] FS:  00007f7fa5b5b880(0000) GS:ffffa0a81f840000(0000)
>>>> knlGS:0000000000000000
>>>> [    3.180434] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [
>>>> 3.183356] CR2: 000055d648427100 CR3: 000000010e960003 CR4:
>>>> 0000000000770ee0
>>>> [    3.185107] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
>>>> 0000000000000000
>>>> [    3.186840] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
>>>> 0000000000000400
>>>> [    3.188647] PKRU: 55555554
>>> Thank you for sharing the logs.
>>> As per our analysis the spi->cs_gpiod[0] is getting messed up while
>>> setting it in __spi_add_device( ).
>>> Is it possible for you to do the following changes on top of this
>>> patch series & re-run your test.
>>>
>>> After applying this patch series, in drivers/spi/spi.c file replace
>>> the following code snippet in __spi_add_device( ) function defination.
>>>
>>> if (ctlr->cs_gpiods) {
>>>           for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
>>>                   spi_set_csgpiod(spi, idx,
>>> ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]); }
>>>
>>> with the below code snippet
>>>
>>> if (ctlr->cs_gpiods) {
>>>           for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>>>                   if (!(idx != 0 && !spi_get_chipselect(spi, idx)))
>>>                           spi_set_csgpiod(spi, idx, ctlr-
>>> cs_gpiods[spi_get_chipselect(spi, idx)]);
>>>           }
>>> }
>>>
>>> then re-run your test.
>>>
>>> Regards,
>>> Amit
>> I'm still seeing a crash on probe:
>>
>> [    3.265683] BUG: unable to handle page fault for address:
>> 00000000fffedfdd
>> [    3.265744] #PF: supervisor read access in kernel mode [    3.265781] #PF:
>> error_code(0x0000) - not-present page [    3.265817] PGD 0 P4D 0
>> [    3.265840] Oops: 0000 [#1] PREEMPT SMP NOPTI [    3.265865] CPU: 4 PID:
>> 385 Comm: systemd-udevd Tainted: G A           6.3.0-rc3+ #32 [    3.265910]
>> Hardware name: HP /896D, BIOS U70 Ver. 89.33.02 10/29/2021 [    3.265956]
>> RIP: 0010:gpiod_set_raw_value_commit+0x3d/0xf0
>> [    3.266007] Code: 48 89 e5 41 55 44 0f b6 ee 41 54 53 48 8b 17 48 2b
>> 82 70 03 00 00 4c 8b a2 68 03 00 00 48 c1 f8 03 48 0f af c1 66 90 48 89
>> c6 <49> 8b 44 24 60 44 89 ea 4c 89 e7 ff d0 0f 1f 00 5b 41 5c 41 5d 5d
>> [    3.266092] RSP: 0018:ffffaad780f6f620 EFLAGS: 00010a03 [    3.266121]
>> RAX: 333330b6bdbad102 RBX: ffff9c8d4a5f6800 RCX:
>> cccccccccccccccd
>> [    3.266156] RDX: ffff9c8d4a5f6d40 RSI: 333330b6bdbad102 RDI:
>> ffff9c8d4a5f6d40
>> [    3.266192] RBP: ffffaad780f6f638 R08: 00000001018c3789 R09:
>> 0000000000000000
>> [    3.266228] R10: ffff9c8c4009ee40 R11: 0000000000000000 R12:
>> 00000000fffedf7d
>> [    3.266264] R13: 0000000000000000 R14: 0000000000000001 R15:
>> 0000000000000001
>> [    3.266299] FS:  00007f98d04de880(0000) GS:ffff9c90df700000(0000)
>> knlGS:0000000000000000
>> [    3.266358] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>> [    3.266388] CR2: 00000000fffedfdd CR3: 000000010b680003 CR4:
>> 0000000000770ee0
>> [    3.266422] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
>> 0000000000000000
>> [    3.266457] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
>> 0000000000000400
>> [    3.266490] PKRU: 55555554
>> [    3.266513] Call Trace:
>> [    3.266530]  <TASK>
>> [    3.266546]  gpiod_set_value_nocheck+0x5b/0x70
>> [    3.266583]  gpiod_set_value_cansleep+0x3e/0xa0
>> [    3.266609]  spi_set_cs+0x257/0x4a0
>> [    3.266634]  spi_transfer_one_message+0x49/0x740
>> [    3.266672]  __spi_pump_transfer_message+0x29b/0x620
>> [    3.266712]  __spi_sync+0x26f/0x3b0
>> [    3.266735]  spi_write_then_read+0x157/0x210 [    3.266771]  ?
>> psi_group_change+0x175/0x3b0 [    3.266802]  regmap_spi_read+0xe/0x20
>> [    3.266826]  _regmap_raw_read+0xe1/0x210
>> [    3.266861]  _regmap_bus_read+0x3a/0x70
>> [    3.266887]  _regmap_read+0x66/0x140
>> [    3.266918]  regmap_read+0x3f/0x70
>> [    3.266957]  cs35l41_hda_probe+0x553/0xc10 [snd_hda_scodec_cs35l41]
>> [    3.267027]  cs35l41_hda_spi_probe+0x62/0x80
>> [snd_hda_scodec_cs35l41_spi] [    3.267096]  spi_probe+0x55/0x90
>> [    3.267145]  really_probe+0x1b2/0x420
>> [    3.267184]  __driver_probe_device+0x7e/0x180
>> [    3.267227]  driver_probe_device+0x23/0xa0
>> [    3.267287]  __driver_attach+0xe4/0x1e0 [    3.267326]  ?
>> __pfx___driver_attach+0x10/0x10
>> [    3.267381]  bus_for_each_dev+0x7a/0xd0
>> [    3.267406]  driver_attach+0x1e/0x30
>> [    3.267437]  bus_add_driver+0x11c/0x220
>> [    3.267461]  driver_register+0x64/0x130 [    3.267483]  ?
>> __pfx_init_module+0x10/0x10 [snd_hda_scodec_cs35l41_spi]
>> [    3.267525]  __spi_register_driver+0xa1/0xd0 [    3.270712]  ?
>> __pfx_init_module+0x10/0x10 [snd_hda_scodec_cs35l41_spi]
>> [    3.273446]  cs35l41_spi_driver_init+0x1c/0xff0
>> [snd_hda_scodec_cs35l41_spi]
>> [    3.275119]  do_one_initcall+0x46/0x220 [    3.276828]  ?
>> kmalloc_trace+0x2a/0xa0 [    3.279290]  do_init_module+0x52/0x220
>> [    3.283593]  load_module+0x223c/0x2460
>> [    3.283602]  __do_sys_finit_module+0xc8/0x140 [    3.287883]  ?
>> __do_sys_finit_module+0xc8/0x140
>> [    3.287907]  __x64_sys_finit_module+0x18/0x20
>> [    3.293156]  do_syscall_64+0x38/0x90
>> [    3.298937]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
>> [    3.298945] RIP: 0033:0x7f98d06f776d
>> [    3.319574] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa
>> 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f
>> 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f3 36 0d 00 f7 d8 64 89 01 48
>> [    3.319579] RSP: 002b:00007ffd988f7a08 EFLAGS: 00000246 ORIG_RAX:
>> 0000000000000139
>> [    3.319585] RAX: ffffffffffffffda RBX: 000055af06a7d030 RCX:
>> 00007f98d06f776d
>> [    3.319589] RDX: 0000000000000000 RSI: 00007f98d05d7ded RDI:
>> 0000000000000013
>> [    3.329520] RBP: 0000000000020000 R08: 0000000000000000 R09:
>> 0000000000000000
>> [    3.329523] R10: 0000000000000013 R11: 0000000000000246 R12:
>> 00007f98d05d7ded
>> [    3.329525] R13: 0000000000000000 R14: 000055af06cdd040 R15:
>> 000055af06a7d030
>> [    3.329531]  </TASK>
>> [    3.329533] Modules linked in: snd_hda_intel(+) ttm snd_intel_dspcfg btusb
>> rapl snd_seq_midi snd_intel_sdw_acpi libarc4 intel_cstate binfmt_misc
>> uvcvideo(+) snd_seq_midi_event btrtl
>> snd_hda_scodec_cs35l41_spi(+) snd_hda_codec drm_display_helper
>> cdc_ncm(+) videobuf2_vmalloc snd_rawmidi btbcm uvc cdc_ether cec btintel
>> videobuf2_memops snd_hda_scodec_cs35l41_i2c snd_hda_core
>> videobuf2_v4l2 uas usbnet rc_core snd_hwdep btmtk
>> snd_hda_scodec_cs35l41 input_leds mii wmi_bmof videodev snd_seq
>> processor_thermal_device_pci bluetooth iwlwifi drm_kms_helper snd_pcm
>> snd_hda_cs_dsp_ctls processor_thermal_device mei_me
>> videobuf2_common snd_seq_device i2c_algo_bit cs_dsp
>> processor_thermal_rfim ecdh_generic usb_storage serio_raw mc
>> syscopyarea ecc processor_thermal_mbox ucsi_acpi snd_soc_cs35l41_lib
>> 8250_dw mei snd_timer cfg80211 sysfillrect typec_ucsi
>> processor_thermal_rapl igen6_edac sysimgblt intel_rapl_common typec snd
>> soundcore int3403_thermal int340x_thermal_zone serial_multi_instantiate
>> int3400_thermal intel_hid acpi_thermal_rel [    3.338475]  sparse_keymap
>> acpi_tad acpi_pad mac_hid sch_fq_codel msr parport_pc ppdev lp parport
>> drm ramoops reed_solomon efi_pstore ip_tables x_tables autofs4
>> spi_pxa2xx_platform dw_dmac dw_dmac_core intel_lpss_pci nvme
>> intel_lpss i2c_i801 idma64 crc32_pclmul thunderbolt i2c_smbus nvme_core
>> xhci_pci virt_dma xhci_pci_renesas video wmi pinctrl_tigerlake [    3.338514]
>> CR2: 00000000fffedfdd [    3.338517] ---[ end trace 0000000000000000 ]---
>> [    3.504965] RIP: 0010:gpiod_set_raw_value_commit+0x3d/0xf0
>> [    3.504973] Code: 48 89 e5 41 55 44 0f b6 ee 41 54 53 48 8b 17 48 2b
>> 82 70 03 00 00 4c 8b a2 68 03 00 00 48 c1 f8 03 48 0f af c1 66 90 48 89
>> c6 <49> 8b 44 24 60 44 89 ea 4c 89 e7 ff d0 0f 1f 00 5b 41 5c 41 5d 5d
>> [    3.504975] RSP: 0018:ffffaad780f6f620 EFLAGS: 00010a03 [    3.504978]
>> RAX: 333330b6bdbad102 RBX: ffff9c8d4a5f6800 RCX:
>> cccccccccccccccd
>> [    3.504979] RDX: ffff9c8d4a5f6d40 RSI: 333330b6bdbad102 RDI:
>> ffff9c8d4a5f6d40
>> [    3.504980] RBP: ffffaad780f6f638 R08: 00000001018c3789 R09:
>> 0000000000000000
>> [    3.504982] R10: ffff9c8c4009ee40 R11: 0000000000000000 R12:
>> 00000000fffedf7d
>> [    3.504983] R13: 0000000000000000 R14: 0000000000000001 R15:
>> 0000000000000001
>> [    3.504984] FS:  00007f98d04de880(0000) GS:ffff9c90df700000(0000)
>> knlGS:0000000000000000
>> [    3.504986] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>> [    3.504988] CR2: 00000000fffedfdd CR3: 000000010b680003 CR4:
>> 0000000000770ee0
>> [    3.504989] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
>> 0000000000000000
>> [    3.504990] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
>> 0000000000000400
>> [    3.504992] PKRU: 55555554
>>
>> Thanks,
>> Stefan
> Thanks for the logs.
>
> Could you please confirm that your test case was passing with
> https://github.com/torvalds/linux/commit/303feb3cc06ac0665d0ee9c1414941200e60e8a3 patch
> but it is failing with the current patch series ?

I retested with the latest master kernel
https://github.com/torvalds/linux/commit/33afd4b76393627477e878b3b195d606e585d816
and I could see it worked fine. I attached a dmesg log of this.

That particular commit id you posted does not work, due to a different 
issue which was fixed in a later commit.

>
> Regarding the failure
> The logs suggest that we are trying to access an invalid pointer while
> calling the gpiod_set_value_cansleep( ) API.
> This could be possible if the cs_num is corrupted and we are trying to
> access an invalid spi->cs_gpiod[ ].
> To confirm the same could you please do the following changes in the
> code and re-test.
>
> After applying this patch series, in drivers/spi/spi.c file replace the
> following code snippet in __spi_add_device( ) function definition.
> if (ctlr->cs_gpiods) {
>          for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
>                  spi_set_csgpiod(spi, idx, ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]);
> }
>
> with the below code snippet
>
> if (ctlr->cs_gpiods) {
>          for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>                  if (!(idx != 0 && !spi_get_chipselect(spi, idx))) {
> 		printk("%s( ) [%d] cs[%d] = [%d]\n", __func__, __LINE__, idx, spi_get_chipselect(spi, idx));
> 		spi_set_csgpiod(spi, idx, ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]);
> 	}
>          }
> }
>
> And at the start of  spi_set_cs( ) function in drivers/spi/spi.c file add
> the following print statements.
>
> printk("%s( ) [%d] spi->cs_index_mask == [%d]\n", __func__, __LINE__, spi->cs_index_mask);
> printk("%s( ) [%d] cs_num == [%d]\n", __func__, __LINE__, cs_num);

I've attached dmesg log of this. It no longer crashes when using the 
prints (I am unsure why), but it still does not work.
For sanity, I retested these changes with the print lines commented out, 
and the crash returned.

>
> Thanks,
> Amit
>>>> Thanks,
>>>>
>>>> Stefan
>>>>
>>>>>> Thanks,
>>>>>> Stefan Binding
>>>>>>
>>>>>>> Signed-off-by: Amit Kumar Mahapatra <amit.kumar-
>>>>>> mahapatra@amd.com>
>>>>>>> ---
>>>>>>>     drivers/spi/spi.c       | 226
>>>>>> ++++++++++++++++++++++++++++------------
>>>>>>>     include/linux/spi/spi.h |  32 ++++--
>>>>>>>     2 files changed, 183 insertions(+), 75 deletions(-)
>>>>>>>
>>>>>>> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index
>>>>>>> 9036d7a50674..04d7322170c4 100644
>>>>>>> --- a/drivers/spi/spi.c
>>>>>>> +++ b/drivers/spi/spi.c
>>>>>>> @@ -612,10 +612,24 @@ static int spi_dev_check(struct device *dev,
>>>>>>> void *data)  {
>>>>>>>     	struct spi_device *spi = to_spi_device(dev);
>>>>>>>     	struct spi_device *new_spi = data;
>>>>>>> +	int idx, nw_idx;
>>>>>>>
>>>>>>> -	if (spi->controller == new_spi->controller &&
>>>>>>> -	    spi_get_chipselect(spi, 0) == spi_get_chipselect(new_spi,
>>>>>> 0))
>>>>>>> -		return -EBUSY;
>>>>>>> +	if (spi->controller == new_spi->controller) {
>>>>>>> +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>>>>>>> +			for (nw_idx = 0; nw_idx < SPI_CS_CNT_MAX;
>>>>>>> nw_idx++) {
>>>>>>> +				if ((idx != 0 &&
>>>>>> !spi_get_chipselect(spi,
>>>>>>> idx)) ||
>>>>>>> +				    (nw_idx != 0 &&
>>>>>>> !spi_get_chipselect(spi, nw_idx))) {
>>>>>>> +					continue;
>>>>>>> +				} else if (spi_get_chipselect(spi,
>>>>>> idx) ==
>>>>>>> +				    spi_get_chipselect(new_spi,
>>>>>> nw_idx))
>>>>>>> {
>>>>>>> +					dev_err(dev,
>>>>>>> +						"chipselect %d
>> already
>>>>>>> in use\n",
>>>>>>> +
>>>>>>> 	spi_get_chipselect(new_spi, nw_idx));
>>>>>>> +					return -EBUSY;
>>>>>>> +				}
>>>>>>> +			}
>>>>>>> +		}
>>>>>>> +	}
>>>>>>>     	return 0;
>>>>>>>     }
>>>>>>>
>>>>>>> @@ -629,7 +643,7 @@ static int __spi_add_device(struct spi_device
>>>>>>> *spi)
>>>>>>>     {
>>>>>>>     	struct spi_controller *ctlr = spi->controller;
>>>>>>>     	struct device *dev = ctlr->dev.parent;
>>>>>>> -	int status;
>>>>>>> +	int status, idx;
>>>>>>>
>>>>>>>     	/*
>>>>>>>     	 * We need to make sure there's no other device with this
>> @@
>>>>>>> -638,8
>>>>>>> +652,6 @@ static int __spi_add_device(struct spi_device
>>>>>>> *spi)
>>>>>>>     	 */
>>>>>>>     	status = bus_for_each_dev(&spi_bus_type, NULL, spi,
>>>>>> spi_dev_check);
>>>>>>>     	if (status) {
>>>>>>> -		dev_err(dev, "chipselect %d already in use\n",
>>>>>>> -				spi_get_chipselect(spi, 0));
>>>>>>>     		return status;
>>>>>>>     	}
>>>>>>>
>>>>>>> @@ -649,8 +661,10 @@ static int __spi_add_device(struct spi_device
>>>>>>> *spi)
>>>>>>>     		return -ENODEV;
>>>>>>>     	}
>>>>>>>
>>>>>>> -	if (ctlr->cs_gpiods)
>>>>>>> -		spi_set_csgpiod(spi, 0, ctlr-
>>>>>>>> cs_gpiods[spi_get_chipselect(spi, 0)]);
>>>>>>> +	if (ctlr->cs_gpiods) {
>>>>>>> +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
>>>>>>> +			spi_set_csgpiod(spi, idx, ctlr-
>>>>>>>> cs_gpiods[spi_get_chipselect(spi, idx)]);
>>>>>>> +	}
>>>>>>>
>>>>>>>     	/*
>>>>>>>     	 * Drivers may modify this initial i/o setup, but will @@
>>>>>>> -690,13
>>>>>>> +704,15 @@ int spi_add_device(struct spi_device *spi)  {
>>>>>>>     	struct spi_controller *ctlr = spi->controller;
>>>>>>>     	struct device *dev = ctlr->dev.parent;
>>>>>>> -	int status;
>>>>>>> +	int status, idx;
>>>>>>>
>>>>>>> -	/* Chipselects are numbered 0..max; validate. */
>>>>>>> -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
>>>>>>> -		dev_err(dev, "cs%d >= max %d\n",
>>>>>>> spi_get_chipselect(spi, 0),
>>>>>>> -			ctlr->num_chipselect);
>>>>>>> -		return -EINVAL;
>>>>>>> +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>>>>>>> +		/* Chipselects are numbered 0..max; validate. */
>>>>>>> +		if (spi_get_chipselect(spi, idx) >=
>>>>>> ctlr->num_chipselect) {
>>>>>>> +			dev_err(dev, "cs%d >= max %d\n",
>>>>>>> spi_get_chipselect(spi, idx),
>>>>>>> +				ctlr->num_chipselect);
>>>>>>> +			return -EINVAL;
>>>>>>> +		}
>>>>>>>     	}
>>>>>>>
>>>>>>>     	/* Set the bus ID string */
>>>>>>> @@ -713,12 +729,15 @@ static int spi_add_device_locked(struct
>>>>>>> spi_device *spi)  {
>>>>>>>     	struct spi_controller *ctlr = spi->controller;
>>>>>>>     	struct device *dev = ctlr->dev.parent;
>>>>>>> +	int idx;
>>>>>>>
>>>>>>> -	/* Chipselects are numbered 0..max; validate. */
>>>>>>> -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
>>>>>>> -		dev_err(dev, "cs%d >= max %d\n",
>>>>>>> spi_get_chipselect(spi, 0),
>>>>>>> -			ctlr->num_chipselect);
>>>>>>> -		return -EINVAL;
>>>>>>> +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>>>>>>> +		/* Chipselects are numbered 0..max; validate. */
>>>>>>> +		if (spi_get_chipselect(spi, idx) >=
>>>>>> ctlr->num_chipselect) {
>>>>>>> +			dev_err(dev, "cs%d >= max %d\n",
>>>>>>> spi_get_chipselect(spi, idx),
>>>>>>> +				ctlr->num_chipselect);
>>>>>>> +			return -EINVAL;
>>>>>>> +		}
>>>>>>>     	}
>>>>>>>
>>>>>>>     	/* Set the bus ID string */
>>>>>>> @@ -966,58 +985,118 @@ static void spi_res_release(struct
>>>>>>> spi_controller *ctlr, struct spi_message *mes  static void
>>>>>>> spi_set_cs(struct spi_device *spi, bool enable, bool
>>>>>> force)
>>>>>>>     {
>>>>>>>     	bool activate = enable;
>>>>>>> +	u32 cs_num = __ffs(spi->cs_index_mask);
>>>>>>> +	int idx;
>>>>>>>
>>>>>>>     	/*
>>>>>>> -	 * Avoid calling into the driver (or doing delays) if the chip
>>>>>> select
>>>>>>> -	 * isn't actually changing from the last time this was called.
>>>>>>> +	 * In parallel mode all the chip selects are
>>>>>> asserted/de-asserted
>>>>>>> +	 * at once
>>>>>>>     	 */
>>>>>>> -	if (!force && ((enable && spi->controller->last_cs ==
>>>>>>> spi_get_chipselect(spi, 0)) ||
>>>>>>> -		       (!enable && spi->controller->last_cs !=
>>>>>>> spi_get_chipselect(spi, 0))) &&
>>>>>>> -	    (spi->controller->last_cs_mode_high == (spi->mode &
>>>>>>> SPI_CS_HIGH)))
>>>>>>> -		return;
>>>>>>> -
>>>>>>> -	trace_spi_set_cs(spi, activate);
>>>>>>> -
>>>>>>> -	spi->controller->last_cs = enable ? spi_get_chipselect(spi, 0)
>>>>>> : -1;
>>>>>>> -	spi->controller->last_cs_mode_high = spi->mode &
>>>>>>> SPI_CS_HIGH;
>>>>>>> -
>>>>>>> -	if ((spi_get_csgpiod(spi, 0) ||
>>>>>> !spi->controller->set_cs_timing)
>>>>>>> && !activate)
>>>>>>> -		spi_delay_exec(&spi->cs_hold, NULL);
>>>>>>> -
>>>>>>> -	if (spi->mode & SPI_CS_HIGH)
>>>>>>> -		enable = !enable;
>>>>>>> +	if ((spi->cs_index_mask & SPI_PARALLEL_CS_MASK) ==
>>>>>>> SPI_PARALLEL_CS_MASK) {
>>>>>>> +		spi->controller->last_cs_mode_high = spi->mode &
>>>>>>> SPI_CS_HIGH;
>>>>>>> +
>>>>>>> +		if ((spi_get_csgpiod(spi, 0) || !spi->controller-
>>>>>>>> set_cs_timing) && !activate)
>>>>>>> +			spi_delay_exec(&spi->cs_hold, NULL);
>>>>>>> +
>>>>>>> +		if (spi->mode & SPI_CS_HIGH)
>>>>>>> +			enable = !enable;
>>>>>>> +
>>>>>>> +		if (spi_get_csgpiod(spi, 0) && spi_get_csgpiod(spi,
>>>>>> 1)) {
>>>>>>> +			if (!(spi->mode & SPI_NO_CS)) {
>>>>>>> +				/*
>>>>>>> +				 * Historically ACPI has no means of
>>>>>> the
>>>>>>> GPIO polarity and
>>>>>>> +				 * thus the SPISerialBus() resource
>>>>>>> defines it on the per-chip
>>>>>>> +				 * basis. In order to avoid a chain of
>>>>>>> negations, the GPIO
>>>>>>> +				 * polarity is considered being Active
>>>>>>> High. Even for the cases
>>>>>>> +				 * when _DSD() is involved (in the
>>>>>>> updated versions of ACPI)
>>>>>>> +				 * the GPIO CS polarity must be
>>>>>> defined
>>>>>>> Active High to avoid
>>>>>>> +				 * ambiguity. That's why we use
>>>>>> enable,
>>>>>>> that takes SPI_CS_HIGH
>>>>>>> +				 * into account.
>>>>>>> +				 */
>>>>>>> +				if (has_acpi_companion(&spi->dev)) {
>>>>>>> +					for (idx = 0; idx <
>>>>>>> SPI_CS_CNT_MAX; idx++)
>>>>>>> +
>>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
>>>>>>> +
>>>>>>> !enable);
>>>>>>> +				} else {
>>>>>>> +					for (idx = 0; idx <
>>>>>>> SPI_CS_CNT_MAX; idx++)
>>>>>>> +						/* Polarity handled by
>>>>>>> GPIO library */
>>>>>>> +
>>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
>>>>>>> +
>>>>>>> activate);
>>>>>>> +				}
>>>>>>> +			}
>>>>>>> +			/* Some SPI masters need both GPIO CS &
>>>>>>> slave_select */
>>>>>>> +			if ((spi->controller->flags &
>>>>>>> SPI_MASTER_GPIO_SS) &&
>>>>>>> +			    spi->controller->set_cs)
>>>>>>> +				spi->controller->set_cs(spi, !enable);
>>>>>>> +		} else if (spi->controller->set_cs) {
>>>>>>> +			spi->controller->set_cs(spi, !enable);
>>>>>>> +		}
>>>>>>>
>>>>>>> -	if (spi_get_csgpiod(spi, 0)) {
>>>>>>> -		if (!(spi->mode & SPI_NO_CS)) {
>>>>>>> -			/*
>>>>>>> -			 * Historically ACPI has no means of the GPIO
>>>>>>> polarity and
>>>>>>> -			 * thus the SPISerialBus() resource defines it
>>>>>> on
>>>>>>> the per-chip
>>>>>>> -			 * basis. In order to avoid a chain of
>>>>>> negations,
>>>>>>> the GPIO
>>>>>>> -			 * polarity is considered being Active High.
>>>>>> Even
>>>>>>> for the cases
>>>>>>> -			 * when _DSD() is involved (in the updated
>>>>>>> versions of ACPI)
>>>>>>> -			 * the GPIO CS polarity must be defined Active
>>>>>>> High to avoid
>>>>>>> -			 * ambiguity. That's why we use enable, that
>>>>>>> takes SPI_CS_HIGH
>>>>>>> -			 * into account.
>>>>>>> -			 */
>>>>>>> -			if (has_acpi_companion(&spi->dev))
>>>>>>> -
>>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), !enable);
>>>>>>> +		if (spi_get_csgpiod(spi, 0) || spi_get_csgpiod(spi, 1)
>>>>>> ||
>>>>>>> +		    !spi->controller->set_cs_timing) {
>>>>>>> +			if (activate)
>>>>>>> +				spi_delay_exec(&spi->cs_setup,
>> NULL);
>>>>>>>     			else
>>>>>>> -				/* Polarity handled by GPIO library */
>>>>>>> -
>>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), activate);
>>>>>>> +				spi_delay_exec(&spi->cs_inactive,
>>>>>>> NULL);
>>>>>>>     		}
>>>>>>> -		/* Some SPI masters need both GPIO CS & slave_select
>>>>>>> */
>>>>>>> -		if ((spi->controller->flags & SPI_MASTER_GPIO_SS) &&
>>>>>>> -		    spi->controller->set_cs)
>>>>>>> +	} else {
>>>>>>> +		/*
>>>>>>> +		 * Avoid calling into the driver (or doing delays) if
>>>>>> the
>>>>>>> chip select
>>>>>>> +		 * isn't actually changing from the last time this was
>>>>>>> called.
>>>>>>> +		 */
>>>>>>> +		if (!force && ((enable && spi->controller->last_cs ==
>>>>>>> +				spi_get_chipselect(spi, cs_num)) ||
>>>>>>> +				(!enable && spi->controller->last_cs
>>>>>> !=
>>>>>>> +				 spi_get_chipselect(spi, cs_num))) &&
>>>>>>> +		    (spi->controller->last_cs_mode_high ==
>>>>>>> +		     (spi->mode & SPI_CS_HIGH)))
>>>>>>> +			return;
>>>>>>> +
>>>>>>> +		trace_spi_set_cs(spi, activate);
>>>>>>> +
>>>>>>> +		spi->controller->last_cs = enable ?
>>>>>>> spi_get_chipselect(spi, cs_num) : -1;
>>>>>>> +		spi->controller->last_cs_mode_high = spi->mode &
>>>>>>> SPI_CS_HIGH;
>>>>>>> +
>>>>>>> +		if ((spi_get_csgpiod(spi, cs_num) || !spi->controller-
>>>>>>>> set_cs_timing) && !activate)
>>>>>>> +			spi_delay_exec(&spi->cs_hold, NULL);
>>>>>>> +
>>>>>>> +		if (spi->mode & SPI_CS_HIGH)
>>>>>>> +			enable = !enable;
>>>>>>> +
>>>>>>> +		if (spi_get_csgpiod(spi, cs_num)) {
>>>>>>> +			if (!(spi->mode & SPI_NO_CS)) {
>>>>>>> +				/*
>>>>>>> +				 * Historically ACPI has no means of
>>>>>> the
>>>>>>> GPIO polarity and
>>>>>>> +				 * thus the SPISerialBus() resource
>>>>>>> defines it on the per-chip
>>>>>>> +				 * basis. In order to avoid a chain of
>>>>>>> negations, the GPIO
>>>>>>> +				 * polarity is considered being Active
>>>>>>> High. Even for the cases
>>>>>>> +				 * when _DSD() is involved (in the
>>>>>>> updated versions of ACPI)
>>>>>>> +				 * the GPIO CS polarity must be
>>>>>> defined
>>>>>>> Active High to avoid
>>>>>>> +				 * ambiguity. That's why we use
>>>>>> enable,
>>>>>>> that takes SPI_CS_HIGH
>>>>>>> +				 * into account.
>>>>>>> +				 */
>>>>>>> +				if (has_acpi_companion(&spi->dev))
>>>>>>> +
>>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
>>>>>>> +
>>>>>>> !enable);
>>>>>>> +				else
>>>>>>> +					/* Polarity handled by GPIO
>>>>>>> library */
>>>>>>> +
>>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
>>>>>>> +
>>>>>>> activate);
>>>>>>> +			}
>>>>>>> +			/* Some SPI masters need both GPIO CS &
>>>>>>> slave_select */
>>>>>>> +			if ((spi->controller->flags &
>>>>>>> SPI_MASTER_GPIO_SS) &&
>>>>>>> +			    spi->controller->set_cs)
>>>>>>> +				spi->controller->set_cs(spi, !enable);
>>>>>>> +		} else if (spi->controller->set_cs) {
>>>>>>>     			spi->controller->set_cs(spi, !enable);
>>>>>>> -	} else if (spi->controller->set_cs) {
>>>>>>> -		spi->controller->set_cs(spi, !enable);
>>>>>>> -	}
>>>>>>> +		}
>>>>>>>
>>>>>>> -	if (spi_get_csgpiod(spi, 0) ||
>>>>>> !spi->controller->set_cs_timing) {
>>>>>>> -		if (activate)
>>>>>>> -			spi_delay_exec(&spi->cs_setup, NULL);
>>>>>>> -		else
>>>>>>> -			spi_delay_exec(&spi->cs_inactive, NULL);
>>>>>>> +		if (spi_get_csgpiod(spi, cs_num) || !spi->controller-
>>>>>>>> set_cs_timing) {
>>>>>>> +			if (activate)
>>>>>>> +				spi_delay_exec(&spi->cs_setup,
>> NULL);
>>>>>>> +			else
>>>>>>> +				spi_delay_exec(&spi->cs_inactive,
>>>>>>> NULL);
>>>>>>> +		}
>>>>>>>     	}
>>>>>>>     }
>>>>>>>
>>>>>>> @@ -2246,8 +2325,8 @@ static void of_spi_parse_dt_cs_delay(struct
>>>>>>> device_node *nc,  static int of_spi_parse_dt(struct spi_controller
>>>>>>> *ctlr, struct
>>>>>> spi_device
>>>>>>> *spi,
>>>>>>>     			   struct device_node *nc)
>>>>>>>     {
>>>>>>> -	u32 value;
>>>>>>> -	int rc;
>>>>>>> +	u32 value, cs[SPI_CS_CNT_MAX] = {0};
>>>>>>> +	int rc, idx;
>>>>>>>
>>>>>>>     	/* Mode (clock phase/polarity/etc.) */
>>>>>>>     	if (of_property_read_bool(nc, "spi-cpha")) @@ -2320,13
>>>>>>> +2399,21
>>>>>> @@
>>>>>>> static int of_spi_parse_dt(struct spi_controller *ctlr, struct
>>>>>>> spi_device *spi,
>>>>>>>     	}
>>>>>>>
>>>>>>>     	/* Device address */
>>>>>>> -	rc = of_property_read_u32(nc, "reg", &value);
>>>>>>> -	if (rc) {
>>>>>>> +	rc = of_property_read_variable_u32_array(nc, "reg", &cs[0],
>> 1,
>>>>>>> +						 SPI_CS_CNT_MAX);
>>>>>>> +	if (rc < 0 || rc > ctlr->num_chipselect) {
>>>>>>>     		dev_err(&ctlr->dev, "%pOF has no valid 'reg' property
>>>>>> (%d)\n",
>>>>>>>     			nc, rc);
>>>>>>>     		return rc;
>>>>>>> +	} else if ((of_property_read_bool(nc, "parallel-memories"))
>> &&
>>>>>>> +		   (!(ctlr->flags & SPI_CONTROLLER_MULTI_CS))) {
>>>>>>> +		dev_err(&ctlr->dev, "SPI controller doesn't support
>>>>>> multi
>>>>>>> CS\n");
>>>>>>> +		return -EINVAL;
>>>>>>>     	}
>>>>>>> -	spi_set_chipselect(spi, 0, value);
>>>>>>> +	for (idx = 0; idx < rc; idx++)
>>>>>>> +		spi_set_chipselect(spi, idx, cs[idx]);
>>>>>>> +	/* By default set the spi->cs_index_mask as 1 */
>>>>>>> +	spi->cs_index_mask = 0x01;
>>>>>>>
>>>>>>>     	/* Device speed */
>>>>>>>     	if (!of_property_read_u32(nc, "spi-max-frequency", &value))
>> @@
>>>>>>> -3907,7 +3994,8 @@ static int __spi_validate(struct spi_device
>>>>>>> *spi, struct spi_message *message)
>>>>>>>     	 * cs_change is set for each transfer.
>>>>>>>     	 */
>>>>>>>     	if ((spi->mode & SPI_CS_WORD) && (!(ctlr->mode_bits &
>>>>>>> SPI_CS_WORD) ||
>>>>>>> -					  spi_get_csgpiod(spi, 0))) {
>>>>>>> +					  spi_get_csgpiod(spi, 0) ||
>>>>>>> +					  spi_get_csgpiod(spi, 1))) {
>>>>>>>     		size_t maxsize;
>>>>>>>     		int ret;
>>>>>>>
>>>>>>> diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
>>>>>>> index 873ced6ae4ca..6453b246e0af 100644
>>>>>>> --- a/include/linux/spi/spi.h
>>>>>>> +++ b/include/linux/spi/spi.h
>>>>>>> @@ -19,6 +19,11 @@
>>>>>>>     #include <linux/acpi.h>
>>>>>>>     #include <linux/u64_stats_sync.h>
>>>>>>>
>>>>>>> +/* Max no. of CS supported per spi device */ #define
>>>>>>> +SPI_CS_CNT_MAX
>>>>>>> +2
>>>>>>> +
>>>>>>> +/* chip select mask */
>>>>>>> +#define SPI_PARALLEL_CS_MASK	(BIT(0) | BIT(1))
>>>>>>>     struct dma_chan;
>>>>>>>     struct software_node;
>>>>>>>     struct ptp_system_timestamp;
>>>>>>> @@ -166,6 +171,7 @@ extern void
>>>>>>> spi_transfer_cs_change_delay_exec(struct spi_message *msg,
>>>>>>>      *	deasserted. If @cs_change_delay is used from
>> @spi_transfer,
>>>>>>> then the
>>>>>>>      *	two delays will be added up.
>>>>>>>      * @pcpu_statistics: statistics for the spi_device
>>>>>>> + * @cs_index_mask: Bit mask of the active chipselect(s) in the
>>>>>>> chipselect array
>>>>>>>      *
>>>>>>>      * A @spi_device is used to interchange data between an SPI slave
>>>>>>>      * (usually a discrete chip) and CPU memory.
>>>>>>> @@ -181,7 +187,7 @@ struct spi_device {
>>>>>>>     	struct spi_controller	*controller;
>>>>>>>     	struct spi_controller	*master;	/* Compatibility layer
>>>>>> */
>>>>>>>     	u32			max_speed_hz;
>>>>>>> -	u8			chip_select;
>>>>>>> +	u8			chip_select[SPI_CS_CNT_MAX];
>>>>>>>     	u8			bits_per_word;
>>>>>>>     	bool			rt;
>>>>>>>     #define SPI_NO_TX	BIT(31)		/* No transmit wire */
>>>>>>> @@ -202,7 +208,7 @@ struct spi_device {
>>>>>>>     	void			*controller_data;
>>>>>>>     	char			modalias[SPI_NAME_SIZE];
>>>>>>>     	const char		*driver_override;
>>>>>>> -	struct gpio_desc	*cs_gpiod;	/* Chip select gpio
>>>>>> desc
>>>>>>> */
>>>>>>> +	struct gpio_desc	*cs_gpiod[SPI_CS_CNT_MAX];	/*
>>>>>> Chip
>>>>>>> select gpio desc */
>>>>>>>     	struct spi_delay	word_delay; /* Inter-word delay */
>>>>>>>     	/* CS delays */
>>>>>>>     	struct spi_delay	cs_setup;
>>>>>>> @@ -212,6 +218,13 @@ struct spi_device {
>>>>>>>     	/* The statistics */
>>>>>>>     	struct spi_statistics __percpu	*pcpu_statistics;
>>>>>>>
>>>>>>> +	/* Bit mask of the chipselect(s) that the driver need to use
>>>>>> from
>>>>>>> +	 * the chipselect array.When the controller is capable to
>>>>>> handle
>>>>>>> +	 * multiple chip selects & memories are connected in parallel
>>>>>>> +	 * then more than one bit need to be set in cs_index_mask.
>>>>>>> +	 */
>>>>>>> +	u32			cs_index_mask : SPI_CS_CNT_MAX;
>>>>>>> +
>>>>>>>     	/*
>>>>>>>     	 * likely need more hooks for more protocol options affecting
>> how
>>>>>>>     	 * the controller talks to each chip, like:
>>>>>>> @@ -268,22 +281,22 @@ static inline void *spi_get_drvdata(const
>>>>>>> struct spi_device *spi)
>>>>>>>
>>>>>>>     static inline u8 spi_get_chipselect(const struct spi_device
>>>>>>> *spi,
>>>>>> u8 idx)
>>>>>>>     {
>>>>>>> -	return spi->chip_select;
>>>>>>> +	return spi->chip_select[idx];
>>>>>>>     }
>>>>>>>
>>>>>>>     static inline void spi_set_chipselect(struct spi_device *spi,
>>>>>>> u8
>>>>>> idx, u8
>>>>>>> chipselect)
>>>>>>>     {
>>>>>>> -	spi->chip_select = chipselect;
>>>>>>> +	spi->chip_select[idx] = chipselect;
>>>>>>>     }
>>>>>>>
>>>>>>>     static inline struct gpio_desc *spi_get_csgpiod(const struct
>>>>>> spi_device
>>>>>>> *spi, u8 idx)
>>>>>>>     {
>>>>>>> -	return spi->cs_gpiod;
>>>>>>> +	return spi->cs_gpiod[idx];
>>>>>>>     }
>>>>>>>
>>>>>>>     static inline void spi_set_csgpiod(struct spi_device *spi, u8
>>>>>>> idx,
>>>>>> struct
>>>>>>> gpio_desc *csgpiod)
>>>>>>>     {
>>>>>>> -	spi->cs_gpiod = csgpiod;
>>>>>>> +	spi->cs_gpiod[idx] = csgpiod;
>>>>>>>     }
>>>>>>>
>>>>>>>     /**
>>>>>>> @@ -388,6 +401,8 @@ extern struct spi_device
>>>>>>> *spi_new_ancillary_device(struct spi_device *spi, u8 ch
>>>>>>>      * @bus_lock_spinlock: spinlock for SPI bus locking
>>>>>>>      * @bus_lock_mutex: mutex for exclusion of multiple callers
>>>>>>>      * @bus_lock_flag: indicates that the SPI bus is locked for
>>>>>> exclusive use
>>>>>>> + * @multi_cs_cap: indicates that the SPI Controller can
>>>>>> assert/de-assert
>>>>>>> + *	more than one chip select at once.
>>>>>>>      * @setup: updates the device mode and clocking records used by a
>>>>>>>      *	device's SPI controller; protocol code may call this.  This
>>>>>>>      *	must fail if an unrecognized or unsupported mode is
>> requested.
>>>>>>> @@ -554,6 +569,11 @@ struct spi_controller {
>>>>>>>     #define SPI_CONTROLLER_MUST_TX		BIT(4)	/* Requires tx
>>>>>>> */
>>>>>>>
>>>>>>>     #define SPI_MASTER_GPIO_SS		BIT(5)	/* GPIO CS must
>>>>>> select
>>>>>>> slave */
>>>>>>> +	/*
>>>>>>> +	 * The spi-controller has multi chip select capability and can
>>>>>>> +	 * assert/de-assert more than one chip select at once.
>>>>>>> +	 */
>>>>>>> +#define SPI_CONTROLLER_MULTI_CS		BIT(6)
>>>>>>>
>>>>>>>     	/* Flag indicating if the allocation of this struct is devres-
>>>>>>> managed */
>>>>>>>     	bool			devm_allocated;
>>>>>>> --
>>>>>>> 2.17.1
[    0.000000] Linux version 6.3.0-rc3+ (sbinding@sbinding-cirrus-dsktp2) (gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #36 SMP PREEMPT_DYNAMIC Fri Apr 28 13:52:51 BST 2023
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-6.3.0-rc3+ root=UUID=2aec303b-7cd8-4d6f-8da6-b19769ec6332 ro quiet splash resume=UUID=2aec303b-7cd8-4d6f-8da6-b19769ec6332 resume_offset=17821696 vt.handoff=7
[    0.000000] KERNEL supported cpus:
[    0.000000]   Intel GenuineIntel
[    0.000000]   AMD AuthenticAMD
[    0.000000]   Hygon HygonGenuine
[    0.000000]   Centaur CentaurHauls
[    0.000000]   zhaoxin   Shanghai
[    0.000000] x86/split lock detection: #AC: crashing the kernel on kernel split_locks and warning on user-space split_locks
[    0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x200: 'Protection Keys User registers'
[    0.000000] x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
[    0.000000] x86/fpu: xstate_offset[9]:  832, xstate_sizes[9]:    8
[    0.000000] x86/fpu: Enabled xstate features 0x207, context size is 840 bytes, using 'compacted' format.
[    0.000000] signal: max sigframe size: 3632
[    0.000000] BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009efff] usable
[    0.000000] BIOS-e820: [mem 0x000000000009f000-0x00000000000fffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000003c0d2fff] usable
[    0.000000] BIOS-e820: [mem 0x000000003c0d3000-0x000000003f927fff] reserved
[    0.000000] BIOS-e820: [mem 0x000000003f928000-0x000000003fb27fff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x000000003fb28000-0x000000003fbfefff] ACPI data
[    0.000000] BIOS-e820: [mem 0x000000003fbff000-0x000000003fbfffff] usable
[    0.000000] BIOS-e820: [mem 0x000000003fc00000-0x0000000045ffffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000046e00000-0x0000000046ffffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000048000000-0x00000000507fffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000c0000000-0x00000000cfffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fed20000-0x00000000fed7ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000ff800000-0x00000000ffffffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000100000000-0x00000004af7fffff] usable
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] efi: EFI v2.7 by HP
[    0.000000] efi: ACPI=0x3fbfe000 ACPI 2.0=0x3fbfe014 TPMFinalLog=0x3faa5000 SMBIOS=0x3c89d000 ESRT=0x3c897218 MEMATTR=0x34c48018 MOKvar=0x34c4a000 RNG=0x3fb52018 TPMEventLog=0x34c18018
[    0.000000] random: crng init done
[    0.000000] efi: Remove mem431: MMIO range=[0xc0000000-0xcfffffff] (256MB) from e820 map
[    0.000000] e820: remove [mem 0xc0000000-0xcfffffff] reserved
[    0.000000] efi: Remove mem433: MMIO range=[0xff800000-0xffffffff] (8MB) from e820 map
[    0.000000] e820: remove [mem 0xff800000-0xffffffff] reserved
[    0.000000] SMBIOS 3.3 present.
[    0.000000] DMI: HP /896D, BIOS U70 Ver. 89.33.02 10/29/2021
[    0.000000] tsc: Detected 1200.000 MHz processor
[    0.000000] tsc: Detected 1190.400 MHz TSC
[    0.000004] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[    0.000006] e820: remove [mem 0x000a0000-0x000fffff] usable
[    0.000010] last_pfn = 0x4af800 max_arch_pfn = 0x400000000
[    0.000014] x86/PAT: Configuration [0-7]: WB  WC  UC- UC  WB  WP  UC- WT
[    0.000378] last_pfn = 0x3fc00 max_arch_pfn = 0x400000000
[    0.004000] esrt: Reserving ESRT space from 0x000000003c897218 to 0x000000003c8972c8.
[    0.004000] e820: update [mem 0x34c4a000-0x34c4afff] usable ==> reserved
[    0.004000] Using GB pages for direct mapping
[    0.004000] Secure boot disabled
[    0.004000] RAMDISK: [mem 0x29442000-0x2d2cffff]
[    0.004000] ACPI: Early table checksum verification disabled
[    0.004000] ACPI: RSDP 0x000000003FBFE014 000024 (v02 HPQOEM)
[    0.004000] ACPI: XSDT 0x000000003FB54228 00017C (v01 HPQOEM SLIC-BPC 00000000      01000013)
[    0.004000] ACPI: FACP 0x000000003FBFD000 000114 (v06 HPQOEM SLIC-BPC 00000000 HP   00000001)
[    0.004000] ACPI: Override [DSDT-896D    ], this is unsafe: tainting kernel
[    0.004000] Disabling lock debugging due to kernel taint
[    0.004000] ACPI: DSDT 0x000000003FB85000 Logical table override, new table: 0xFFFFFFFFBA82FF60
[    0.004000] ACPI: DSDT 0xFFFFFFFFBA82FF60 03D729 (v02 HPQOEM 896D     00000000 INTL 20190509)
[    0.004000] ACPI: FACS 0x000000003FA82000 000040
[    0.004000] ACPI: SSDT 0x000000003FBFC000 0002D7 (v01 HP     NVTEC    00000001 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FBFB000 00012A (v02 HP     ShmTable 00000001 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FBED000 00D7FB (v02 HPQOEM PLT_RTD3 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FBE7000 005CE0 (v02 CpuRef CpuSsdt  00003000 INTL 20200717)
[    0.004000] ACPI: RTMA 0x000000003FBE6000 00009E (v01 HP     _HBMART_ 00001000 HP   00000001)
[    0.004000] ACPI: SSDT 0x000000003FBE4000 0017B3 (v02 HP     UcsiAcpi 00000001 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FBE3000 0000FB (v02 HP     UcsiCntr 00000001 INTL 20200717)
[    0.004000] ACPI: OEML 0x000000003FBE2000 000028 (v03 HPQOEM ADL-P-M  00000002      01000013)
[    0.004000] ACPI: SSDT 0x000000003FBE0000 001D00 (v01 HP     LAPTOPPC 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FBDE000 0005FB (v02 HPQOEM Tpm2Tabl 00001000 INTL 20200717)
[    0.004000] ACPI: TPM2 0x000000003FBDD000 00004C (v04 HPQOEM ADL-P-M  00000002      01000013)
[    0.004000] ACPI: SSDT 0x000000003FBDA000 002A65 (v02 SaSsdt SaSsdt   00003000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FBD6000 003427 (v02 INTEL  IgfxSsdt 00003000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FBC8000 00D1AB (v02 INTEL  TcssSsdt 00001000 INTL 20200717)
[    0.004000] ACPI: WSMT 0x000000003FBC7000 000028 (v01 HPQOEM 896D     00000001 HP   00000001)
[    0.004000] ACPI: HPET 0x000000003FBC5000 000038 (v01 HPQOEM 896D     00000001 HP   00000001)
[    0.004000] ACPI: APIC 0x000000003FBC4000 0001DC (v05 HPQOEM 896D     00000001 HP   00000001)
[    0.004000] ACPI: MCFG 0x000000003FBC3000 00003C (v01 HPQOEM 896D     00000001 HP   00000001)
[    0.004000] ACPI: SSDT 0x000000003FB84000 00098A (v02 HPQOEM HP_XHC_P 00000000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB7B000 00700C (v02 DptfTb DptfTabl 00001000 INTL 20200717)
[    0.004000] ACPI: WSMT 0x000000003FB7A000 000028 (v01 HPQOEM          00000000      00000000)
[    0.004000] ACPI: NHLT 0x000000003FB78000 001B16 (v00 HPQOEM ADL-P-M  00000002      01000013)
[    0.004000] ACPI: DMAR 0x000000003FB77000 000088 (v02 INTEL  ADL      00000002 INTL 01000013)
[    0.004000] ACPI: SSDT 0x000000003FB6D000 009C2E (v02 HPQOEM MS-SSDT  00003000 INTL 20200717)
[    0.004000] ACPI: LPIT 0x000000003FBC6000 0000CC (v01 HPQOEM ADL-P-M  00000002      01000013)
[    0.004000] ACPI: SSDT 0x000000003FB69000 003AEA (v02 SocGpe SocGpe   00003000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB66000 002B2A (v02 SocCmn SocCmn   00003000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB64000 00134D (v01 HP     HPINWWAN 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB63000 00019F (v01 HP     HPNBCONV 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB62000 0005DA (v01 HP     INTTPL   00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB60000 001C69 (v02 Rtd3   AdlP_Rvp 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB5C000 0033CC (v01 HP     HPINNBWL 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB5B000 000032 (v01 HP     HPCONDEV 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB5A000 000116 (v01 HP     HPSANIMD 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB59000 000F18 (v02 HP     HPINTELG 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB58000 000069 (v01 HP     HPCAHWID 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB57000 00004B (v01 HP     CAPAHWID 00001000 INTL 20200717)
[    0.004000] ACPI: BGRT 0x000000003FB55000 000038 (v01 HPQOEM ADL-P-M  00000002      01000013)
[    0.004000] ACPI: ASF! 0x000000003FB83000 0000A0 (v32 HPQOEM  UYAMIHC 00000002      01000013)
[    0.004000] ACPI: PHAT 0x000000003FB56000 000506 (v00 HPQOEM SLIC-BPC 00000005 MSFT 0100000D)
[    0.004000] ACPI: SSDT 0x000000003FBDF000 0002F9 (v02 HP     PwrCtlEv 00000001 INTL 20200717)
[    0.004000] ACPI: FPDT 0x000000003FB53000 000044 (v01 HPQOEM ADL-P-M  00000002      01000013)
[    0.004000] ACPI: Reserving FACP table memory at [mem 0x3fbfd000-0x3fbfd113]
[    0.004000] ACPI: Reserving DSDT table memory at [mem 0xffffffffba82ff60-0xffffffffba86d688]
[    0.004000] ACPI: Reserving FACS table memory at [mem 0x3fa82000-0x3fa8203f]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbfc000-0x3fbfc2d6]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbfb000-0x3fbfb129]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbed000-0x3fbfa7fa]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbe7000-0x3fbeccdf]
[    0.004000] ACPI: Reserving RTMA table memory at [mem 0x3fbe6000-0x3fbe609d]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbe4000-0x3fbe57b2]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbe3000-0x3fbe30fa]
[    0.004000] ACPI: Reserving OEML table memory at [mem 0x3fbe2000-0x3fbe2027]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbe0000-0x3fbe1cff]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbde000-0x3fbde5fa]
[    0.004000] ACPI: Reserving TPM2 table memory at [mem 0x3fbdd000-0x3fbdd04b]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbda000-0x3fbdca64]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbd6000-0x3fbd9426]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbc8000-0x3fbd51aa]
[    0.004000] ACPI: Reserving WSMT table memory at [mem 0x3fbc7000-0x3fbc7027]
[    0.004000] ACPI: Reserving HPET table memory at [mem 0x3fbc5000-0x3fbc5037]
[    0.004000] ACPI: Reserving APIC table memory at [mem 0x3fbc4000-0x3fbc41db]
[    0.004000] ACPI: Reserving MCFG table memory at [mem 0x3fbc3000-0x3fbc303b]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb84000-0x3fb84989]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb7b000-0x3fb8200b]
[    0.004000] ACPI: Reserving WSMT table memory at [mem 0x3fb7a000-0x3fb7a027]
[    0.004000] ACPI: Reserving NHLT table memory at [mem 0x3fb78000-0x3fb79b15]
[    0.004000] ACPI: Reserving DMAR table memory at [mem 0x3fb77000-0x3fb77087]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb6d000-0x3fb76c2d]
[    0.004000] ACPI: Reserving LPIT table memory at [mem 0x3fbc6000-0x3fbc60cb]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb69000-0x3fb6cae9]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb66000-0x3fb68b29]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb64000-0x3fb6534c]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb63000-0x3fb6319e]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb62000-0x3fb625d9]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb60000-0x3fb61c68]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb5c000-0x3fb5f3cb]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb5b000-0x3fb5b031]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb5a000-0x3fb5a115]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb59000-0x3fb59f17]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb58000-0x3fb58068]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb57000-0x3fb5704a]
[    0.004000] ACPI: Reserving BGRT table memory at [mem 0x3fb55000-0x3fb55037]
[    0.004000] ACPI: Reserving ASF! table memory at [mem 0x3fb83000-0x3fb8309f]
[    0.004000] ACPI: Reserving PHAT table memory at [mem 0x3fb56000-0x3fb56505]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbdf000-0x3fbdf2f8]
[    0.004000] ACPI: Reserving FPDT table memory at [mem 0x3fb53000-0x3fb53043]
[    0.004000] No NUMA configuration found
[    0.004000] Faking a node at [mem 0x0000000000000000-0x00000004af7fffff]
[    0.004000] NODE_DATA(0) allocated [mem 0x4af7d5000-0x4af7fffff]
[    0.004000] Zone ranges:
[    0.004000]   DMA      [mem 0x0000000000001000-0x0000000000ffffff]
[    0.004000]   DMA32    [mem 0x0000000001000000-0x00000000ffffffff]
[    0.004000]   Normal   [mem 0x0000000100000000-0x00000004af7fffff]
[    0.004000]   Device   empty
[    0.004000] Movable zone start for each node
[    0.004000] Early memory node ranges
[    0.004000]   node   0: [mem 0x0000000000001000-0x000000000009efff]
[    0.004000]   node   0: [mem 0x0000000000100000-0x000000003c0d2fff]
[    0.004000]   node   0: [mem 0x000000003fbff000-0x000000003fbfffff]
[    0.004000]   node   0: [mem 0x0000000100000000-0x00000004af7fffff]
[    0.004000] Initmem setup node 0 [mem 0x0000000000001000-0x00000004af7fffff]
[    0.004000] On node 0, zone DMA: 1 pages in unavailable ranges
[    0.004000] On node 0, zone DMA: 97 pages in unavailable ranges
[    0.004000] On node 0, zone DMA32: 15148 pages in unavailable ranges
[    0.004000] On node 0, zone Normal: 1024 pages in unavailable ranges
[    0.004000] On node 0, zone Normal: 2048 pages in unavailable ranges
[    0.004000] Reserving Intel graphics memory at [mem 0x4c800000-0x507fffff]
[    0.004000] ACPI: PM-Timer IO Port: 0x1808
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x02] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x03] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x04] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x05] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x06] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x07] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x08] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x09] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x0a] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x0b] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x0c] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x0d] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x0e] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x0f] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x10] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x11] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x12] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x13] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x14] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x15] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x16] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x17] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1])
[    0.004000] IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-119
[    0.004000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.004000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.004000] ACPI: Using ACPI (MADT) for SMP configuration information
[    0.004000] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[    0.004000] e820: update [mem 0x3472b000-0x34773fff] usable ==> reserved
[    0.004000] TSC deadline timer available
[    0.004000] smpboot: Allowing 12 CPUs, 0 hotplug CPUs
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x00000000-0x00000fff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x0009f000-0x000fffff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x3472b000-0x34773fff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x34c4a000-0x34c4afff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x3c0d3000-0x3f927fff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x3f928000-0x3fb27fff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x3fb28000-0x3fbfefff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x3fc00000-0x45ffffff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x46000000-0x46dfffff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x46e00000-0x46ffffff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x47000000-0x47ffffff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x48000000-0x507fffff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x50800000-0xfed1ffff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0xfed20000-0xfed7ffff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0xfed80000-0xffffffff]
[    0.004000] [mem 0x50800000-0xfed1ffff] available for PCI devices
[    0.004000] Booting paravirtualized kernel on bare hardware
[    0.004000] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645519600211568 ns
[    0.004000] setup_percpu: NR_CPUS:8192 nr_cpumask_bits:12 nr_cpu_ids:12 nr_node_ids:1
[    0.004000] percpu: Embedded 62 pages/cpu s217088 r8192 d28672 u262144
[    0.004000] pcpu-alloc: s217088 r8192 d28672 u262144 alloc=1*2097152
[    0.004000] pcpu-alloc: [0] 00 01 02 03 04 05 06 07 [0] 08 09 10 11 -- -- -- --
[    0.004000] Fallback order for Node 0: 0
[    0.004000] Built 1 zonelists, mobility grouping on.  Total pages: 4046064
[    0.004000] Policy zone: Normal
[    0.004000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.3.0-rc3+ root=UUID=2aec303b-7cd8-4d6f-8da6-b19769ec6332 ro quiet splash resume=UUID=2aec303b-7cd8-4d6f-8da6-b19769ec6332 resume_offset=17821696 vt.handoff=7
[    0.004000] Unknown kernel command line parameters "splash BOOT_IMAGE=/boot/vmlinuz-6.3.0-rc3+", will be passed to user space.
[    0.004000] Dentry cache hash table entries: 2097152 (order: 12, 16777216 bytes, linear)
[    0.004000] Inode-cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    0.004000] mem auto-init: stack:off, heap alloc:on, heap free:off
[    0.004000] software IO TLB: area num 16.
[    0.004000] Memory: 15805664K/16441800K available (18432K kernel code, 3438K rwdata, 6824K rodata, 4408K init, 18612K bss, 635876K reserved, 0K cma-reserved)
[    0.004000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=12, Nodes=1
[    0.004000] ftrace: allocating 50146 entries in 196 pages
[    0.004000] ftrace: allocated 196 pages with 3 groups
[    0.004000] Dynamic Preempt: voluntary
[    0.004000] rcu: Preemptible hierarchical RCU implementation.
[    0.004000] rcu:     RCU restricting CPUs from NR_CPUS=8192 to nr_cpu_ids=12.
[    0.004000]  Trampoline variant of Tasks RCU enabled.
[    0.004000]  Rude variant of Tasks RCU enabled.
[    0.004000]  Tracing variant of Tasks RCU enabled.
[    0.004000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.004000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=12
[    0.004000] NR_IRQS: 524544, nr_irqs: 2152, preallocated irqs: 16
[    0.004000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.004000] Console: colour dummy device 80x25
[    0.004000] printk: console [tty0] enabled
[    0.004000] ACPI: Core revision 20221020
[    0.004000] ACPI Error: Table [DSDT] is not invalidated during early boot stage (20221020/tbxface-163)
[    0.004000] hpet: HPET dysfunctional in PC10. Force disabled.
[    0.004000] APIC: Switch to symmetric I/O mode setup
[    0.004000] DMAR: Host address width 39
[    0.004000] DMAR: DRHD base: 0x000000fed90000 flags: 0x0
[    0.004000] DMAR: dmar0: reg_base_addr fed90000 ver 4:0 cap 9c0000c406f0462 ecap 29a08f0505e
[    0.004000] DMAR: DRHD base: 0x000000fed91000 flags: 0x1
[    0.004000] DMAR: dmar1: reg_base_addr fed91000 ver 5:0 cap 8d2008c40660462 ecap f050da
[    0.004000] DMAR: RMRR base: 0x0000004c000000 end: 0x000000507fffff
[    0.004000] DMAR-IR: IOAPIC id 2 under DRHD base  0xfed91000 IOMMU 1
[    0.004000] DMAR-IR: HPET id 0 under DRHD base 0xfed91000
[    0.004000] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[    0.004000] DMAR-IR: Enabled IRQ remapping in x2apic mode
[    0.004000] x2apic enabled
[    0.004000] Switched APIC routing to cluster x2apic.
[    0.004000] clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x1128af0325d, max_idle_ns: 440795261011 ns
[    0.094398] Calibrating delay loop (skipped), value calculated using timer frequency.. 2380.80 BogoMIPS (lpj=4761600)
[    0.094401] pid_max: default: 32768 minimum: 301
[    0.098393] LSM: initializing lsm=lockdown,capability,yama,integrity,apparmor
[    0.098393] Yama: becoming mindful.
[    0.098393] AppArmor: AppArmor initialized
[    0.098393] Mount-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.098393] Mountpoint-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.098393] x86/tme: not enabled by BIOS
[    0.098393] CPU0: Thermal monitoring enabled (TM1)
[    0.098393] x86/cpu: User Mode Instruction Prevention (UMIP) activated
[    0.098393] process: using mwait in idle threads
[    0.098393] Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0
[    0.098393] Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0, 1GB 0
[    0.098393] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
[    0.098393] Spectre V2 : Mitigation: Enhanced / Automatic IBRS
[    0.098393] Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch
[    0.098393] Spectre V2 : Spectre v2 / PBRSB-eIBRS: Retire a single CALL on VMEXIT
[    0.098393] Spectre V2 : mitigation: Enabling conditional Indirect Branch Prediction Barrier
[    0.098393] Speculative Store Bypass: Mitigation: Speculative Store Bypass disabled via prctl
[    0.098393] Freeing SMP alternatives memory: 44K
[    0.098393] smpboot: CPU0: Genuine Intel(R) 0000 (family: 0x6, model: 0x9a, stepping: 0x1)
[    0.098393] cblist_init_generic: Setting adjustable number of callback queues.
[    0.098393] cblist_init_generic: Setting shift to 4 and lim to 1.
[    0.098393] cblist_init_generic: Setting shift to 4 and lim to 1.
[    0.098393] cblist_init_generic: Setting shift to 4 and lim to 1.
[    0.098393] Performance Events: XSAVE Architectural LBR, PEBS fmt4+-baseline,  AnyThread deprecated, Alderlake Hybrid events, 32-deep LBR, full-width counters, Intel PMU driver.
[    0.098393] core: cpu_core PMU driver:
[    0.098393] ... version:                5
[    0.098393] ... bit width:              48
[    0.098393] ... generic registers:      8
[    0.098393] ... value mask:             0000ffffffffffff
[    0.098393] ... max period:             00007fffffffffff
[    0.098393] ... fixed-purpose events:   4
[    0.098393] ... event mask:             0001000f000000ff
[    0.098393] Estimated ratio of average max frequency by base frequency (times 1024): 3413
[    0.098393] rcu: Hierarchical SRCU implementation.
[    0.098393] rcu:     Max phase no-delay instances is 1000.
[    0.098393] NMI watchdog: Enabled. Permanently consumes one hw-PMU counter.
[    0.098393] smp: Bringing up secondary CPUs ...
[    0.098393] x86: Booting SMP configuration:
[    0.098393] .... node  #0, CPUs:        #1  #2  #3  #4
[    0.094393] core: cpu_atom PMU driver: PEBS-via-PT
[    0.094393] ... version:                5
[    0.094393] ... bit width:              48
[    0.094393] ... generic registers:      6
[    0.094393] ... value mask:             0000ffffffffffff
[    0.094393] ... max period:             00007fffffffffff
[    0.094393] ... fixed-purpose events:   3
[    0.094393] ... event mask:             000000070000003f
[    0.103856]   #5  #6  #7  #8  #9 #10 #11
[    0.129260] smp: Brought up 1 node, 12 CPUs
[    0.129260] smpboot: Max logical packages: 1
[    0.129260] smpboot: Total of 12 processors activated (28569.60 BogoMIPS)
[    0.131485] devtmpfs: initialized
[    0.131485] x86/mm: Memory block size: 128MB
[    0.131485] ACPI: PM: Registering ACPI NVS region [mem 0x3f928000-0x3fb27fff] (2097152 bytes)
[    0.131485] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.131485] futex hash table entries: 4096 (order: 6, 262144 bytes, linear)
[    0.131485] pinctrl core: initialized pinctrl subsystem
[    0.131485] PM: RTC time: 13:11:46, date: 2023-04-28
[    0.131825] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.132014] DMA: preallocated 2048 KiB GFP_KERNEL pool for atomic allocations
[    0.134459] DMA: preallocated 2048 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.134593] DMA: preallocated 2048 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.134600] audit: initializing netlink subsys (disabled)
[    0.134604] audit: type=2000 audit(1682687506.040:1): state=initialized audit_enabled=0 res=1
[    0.134604] thermal_sys: Registered thermal governor 'fair_share'
[    0.134604] thermal_sys: Registered thermal governor 'bang_bang'
[    0.134604] thermal_sys: Registered thermal governor 'step_wise'
[    0.134604] thermal_sys: Registered thermal governor 'user_space'
[    0.134604] thermal_sys: Registered thermal governor 'power_allocator'
[    0.134604] EISA bus registered
[    0.134604] cpuidle: using governor ladder
[    0.134604] cpuidle: using governor menu
[    0.134604] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[    0.134604] PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem 0xc0000000-0xcfffffff] (base 0xc0000000)
[    0.134604] PCI: not using MMCONFIG
[    0.134604] PCI: Using configuration type 1 for base access
[    0.134686] ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
[    0.134701] kprobes: kprobe jump-optimization is enabled. All kprobes are optimized if possible.
[    0.140096] HugeTLB: registered 1.00 GiB page size, pre-allocated 0 pages
[    0.140101] HugeTLB: 16380 KiB vmemmap can be freed for a 1.00 GiB page
[    0.140103] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages
[    0.140103] HugeTLB: 28 KiB vmemmap can be freed for a 2.00 MiB page
[    0.140721] fbcon: Taking over console
[    0.140721] ACPI: Added _OSI(Module Device)
[    0.140721] ACPI: Added _OSI(Processor Device)
[    0.140721] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.140721] ACPI: Added _OSI(Processor Aggregator Device)
[    0.251490] ACPI BIOS Error (bug): Failure creating named object [\_GPE._L6F], AE_ALREADY_EXISTS (20221020/dswload2-326)
[    0.251505] ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20221020/psobject-220)
[    0.251508] ACPI: Skipping parse of AML opcode: Method (0x0014)
[    0.252163] ACPI BIOS Error (bug): Failure creating named object [\_SB.PC00.I2C1.TPL0._HID], AE_ALREADY_EXISTS (20221020/dswload2-326)
[    0.252166] ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20221020/psobject-220)
[    0.252168] ACPI: Skipping parse of AML opcode: Method (0x0014)
[    0.255095] ACPI: 28 ACPI AML tables successfully acquired and loaded
[    0.258060] ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored
[    0.273479] ACPI: Dynamic OEM Table Load:
[    0.273497] ACPI: SSDT 0xFFFFA0E841F49C00 0001AB (v02 PmRef  Cpu0Psd  00003000 INTL 20200717)
[    0.274504] ACPI: \_SB_.PR00: _OSC native thermal LVT Acked
[    0.276862] ACPI: USB4 _OSC: OS supports USB3+ DisplayPort+ PCIe+ XDomain+
[    0.276863] ACPI: USB4 _OSC: OS controls USB3+ DisplayPort+ PCIe+ XDomain+
[    0.277876] ACPI: Dynamic OEM Table Load:
[    0.277888] ACPI: SSDT 0xFFFFA0E840E6C000 000394 (v02 PmRef  Cpu0Cst  00003001 INTL 20200717)
[    0.279079] ACPI: Dynamic OEM Table Load:
[    0.279090] ACPI: SSDT 0xFFFFA0E840E6E800 000371 (v02 PmRef  Cpu0Ist  00003000 INTL 20200717)
[    0.280323] ACPI: Dynamic OEM Table Load:
[    0.280333] ACPI: SSDT 0xFFFFA0E841FB1800 0004D8 (v02 PmRef  Cpu0Hwp  00003000 INTL 20200717)
[    0.281758] ACPI: Dynamic OEM Table Load:
[    0.281773] ACPI: SSDT 0xFFFFA0E840E42000 001BAF (v02 PmRef  ApIst    00003000 INTL 20200717)
[    0.283601] ACPI: Dynamic OEM Table Load:
[    0.283613] ACPI: SSDT 0xFFFFA0E840E44000 001038 (v02 PmRef  ApHwp    00003000 INTL 20200717)
[    0.285214] ACPI: Dynamic OEM Table Load:
[    0.285225] ACPI: SSDT 0xFFFFA0E841FB8000 001349 (v02 PmRef  ApPsd    00003000 INTL 20200717)
[    0.286877] ACPI: Dynamic OEM Table Load:
[    0.286889] ACPI: SSDT 0xFFFFA0E841F8E000 000FBB (v02 PmRef  ApCst    00003000 INTL 20200717)
[    0.293260] ACPI: EC: EC started
[    0.293262] ACPI: EC: interrupt blocked
[    0.322247] ACPI: EC: EC_CMD/EC_SC=0x66, EC_DATA=0x62
[    0.322249] ACPI: \_SB_.PC00.LPCB.EC0_: Boot DSDT EC used to handle transactions
[    0.322250] ACPI: Interpreter enabled
[    0.322329] ACPI: PM: (supports S0 S3 S4 S5)
[    0.322330] ACPI: Using IOAPIC for interrupt routing
[    0.322393] PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem 0xc0000000-0xcfffffff] (base 0xc0000000)
[    0.323708] PCI: MMCONFIG at [mem 0xc0000000-0xcfffffff] reserved as ACPI motherboard resource
[    0.323724] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    0.323724] PCI: Using E820 reservations for host bridge windows
[    0.324506] ACPI: Enabled 7 GPEs in block 00 to 7F
[    0.325786] ACPI: \_SB_.PC00.PEG0.PXP_: New power resource
[    0.330601] ACPI: \_SB_.PC00.XHCI.RHUB.HS04.PRUB: New power resource
[    0.331168] ACPI: \_SB_.PC00.XHCI.RHUB.HS10.BTPR: New power resource
[    0.337825] ACPI: \_SB_.PC00.CNVW.WRST: New power resource
[    0.342978] ACPI: \_SB_.PC00.RP08.PXP_: New power resource
[    0.343590] ACPI: \_SB_.PC00.RP08.PXSX.MRST: New power resource
[    0.353713] ACPI: \_SB_.PC00.TBT0: New power resource
[    0.353785] ACPI: \_SB_.PC00.TBT1: New power resource
[    0.353850] ACPI: \_SB_.PC00.D3C_: New power resource
[    0.598041] ACPI: \PIN_: New power resource
[    0.598465] ACPI: PCI Root Bridge [PC00] (domain 0000 [bus 00-fe])
[    0.598473] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI HPX-Type3]
[    0.600424] acpi PNP0A08:00: _OSC: platform does not support [AER]
[    0.604204] acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug SHPCHotplug PME PCIeCapability LTR]
[    0.609467] PCI host bridge to bus 0000:00
[    0.609470] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7 window]
[    0.609472] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff window]
[    0.609473] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window]
[    0.609473] pci_bus 0000:00: root bus resource [mem 0x50800000-0xbfffffff window]
[    0.609474] pci_bus 0000:00: root bus resource [mem 0x4000000000-0x7fffffffff window]
[    0.609476] pci_bus 0000:00: root bus resource [bus 00-fe]
[    0.635046] pci 0000:00:00.0: [8086:4601] type 00 class 0x060000
[    0.635419] pci 0000:00:02.0: [8086:46a8] type 00 class 0x030000
[    0.635432] pci 0000:00:02.0: reg 0x10: [mem 0x603c000000-0x603cffffff 64bit]
[    0.635440] pci 0000:00:02.0: reg 0x18: [mem 0x4000000000-0x400fffffff 64bit pref]
[    0.635446] pci 0000:00:02.0: reg 0x20: [io  0x3000-0x303f]
[    0.635467] pci 0000:00:02.0: BAR 2: assigned to efifb
[    0.635468] pci 0000:00:02.0: DMAR: Skip IOMMU disabling for graphics
[    0.635472] pci 0000:00:02.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff]
[    0.635516] pci 0000:00:02.0: reg 0x344: [mem 0x00000000-0x00ffffff 64bit]
[    0.635517] pci 0000:00:02.0: VF(n) BAR0 space: [mem 0x00000000-0x06ffffff 64bit] (contains BAR0 for 7 VFs)
[    0.635524] pci 0000:00:02.0: reg 0x34c: [mem 0x00000000-0x1fffffff 64bit pref]
[    0.635525] pci 0000:00:02.0: VF(n) BAR2 space: [mem 0x00000000-0xdfffffff 64bit pref] (contains BAR2 for 7 VFs)
[    0.635673] pci 0000:00:04.0: [8086:461d] type 00 class 0x118000
[    0.635689] pci 0000:00:04.0: reg 0x10: [mem 0x603d180000-0x603d19ffff 64bit]
[    0.636030] pci 0000:00:06.0: [8086:464d] type 01 class 0x060400
[    0.636384] pci 0000:00:06.0: PME# supported from D0 D3hot D3cold
[    0.636478] pci 0000:00:06.0: PTM enabled (root), 4ns granularity
[    0.637061] pci 0000:00:06.2: [8086:463d] type 01 class 0x060400
[    0.637187] pci 0000:00:06.2: PME# supported from D0 D3hot D3cold
[    0.637236] pci 0000:00:06.2: PTM enabled (root), 4ns granularity
[    0.637809] pci 0000:00:07.0: [8086:466e] type 01 class 0x060400
[    0.637863] pci 0000:00:07.0: Overriding RP PIO Log Size to 4
[    0.637958] pci 0000:00:07.0: PME# supported from D0 D3hot D3cold
[    0.637995] pci 0000:00:07.0: PTM enabled (root), 4ns granularity
[    0.638851] pci 0000:00:07.2: [8086:462f] type 01 class 0x060400
[    0.638904] pci 0000:00:07.2: Overriding RP PIO Log Size to 4
[    0.638991] pci 0000:00:07.2: PME# supported from D0 D3hot D3cold
[    0.639027] pci 0000:00:07.2: PTM enabled (root), 4ns granularity
[    0.639906] pci 0000:00:08.0: [8086:464f] type 00 class 0x088000
[    0.639917] pci 0000:00:08.0: reg 0x10: [mem 0x603d1dc000-0x603d1dcfff 64bit]
[    0.640029] pci 0000:00:0a.0: [8086:467d] type 00 class 0x118000
[    0.640040] pci 0000:00:0a.0: reg 0x10: [mem 0x603d1c0000-0x603d1c7fff 64bit]
[    0.640068] pci 0000:00:0a.0: enabling Extended Tags
[    0.640189] pci 0000:00:0d.0: [8086:461e] type 00 class 0x0c0330
[    0.640200] pci 0000:00:0d.0: reg 0x10: [mem 0x603d1b0000-0x603d1bffff 64bit]
[    0.640250] pci 0000:00:0d.0: PME# supported from D3hot D3cold
[    0.640711] pci 0000:00:0d.2: [8086:463e] type 00 class 0x0c0340
[    0.640725] pci 0000:00:0d.2: reg 0x10: [mem 0x603d140000-0x603d17ffff 64bit]
[    0.640734] pci 0000:00:0d.2: reg 0x18: [mem 0x603d1db000-0x603d1dbfff 64bit]
[    0.640777] pci 0000:00:0d.2: supports D1 D2
[    0.640778] pci 0000:00:0d.2: PME# supported from D0 D1 D2 D3hot D3cold
[    0.640879] pci 0000:00:0d.3: [8086:466d] type 00 class 0x0c0340
[    0.640892] pci 0000:00:0d.3: reg 0x10: [mem 0x603d100000-0x603d13ffff 64bit]
[    0.640902] pci 0000:00:0d.3: reg 0x18: [mem 0x603d1da000-0x603d1dafff 64bit]
[    0.640945] pci 0000:00:0d.3: supports D1 D2
[    0.640945] pci 0000:00:0d.3: PME# supported from D0 D1 D2 D3hot D3cold
[    0.641201] pci 0000:00:14.0: [8086:51ed] type 00 class 0x0c0330
[    0.641223] pci 0000:00:14.0: reg 0x10: [mem 0x603d1a0000-0x603d1affff 64bit]
[    0.641317] pci 0000:00:14.0: PME# supported from D3hot D3cold
[    0.641805] pci 0000:00:14.2: [8086:51ef] type 00 class 0x050000
[    0.641830] pci 0000:00:14.2: reg 0x10: [mem 0x603d1d0000-0x603d1d3fff 64bit]
[    0.641846] pci 0000:00:14.2: reg 0x18: [mem 0x603d1d9000-0x603d1d9fff 64bit]
[    0.642074] pci 0000:00:14.3: [8086:51f0] type 00 class 0x028000
[    0.642096] pci 0000:00:14.3: reg 0x10: [mem 0x603d1cc000-0x603d1cffff 64bit]
[    0.642248] pci 0000:00:14.3: PME# supported from D0 D3hot D3cold
[    0.643058] pci 0000:00:15.0: [8086:51e8] type 00 class 0x0c8000
[    0.643790] pci 0000:00:15.0: reg 0x10: [mem 0x00000000-0x00000fff 64bit]
[    0.647058] pci 0000:00:16.0: [8086:51e0] type 00 class 0x078000
[    0.647085] pci 0000:00:16.0: reg 0x10: [mem 0x603d1d7000-0x603d1d7fff 64bit]
[    0.647198] pci 0000:00:16.0: PME# supported from D3hot
[    0.647735] pci 0000:00:16.3: [8086:51e3] type 00 class 0x070002
[    0.647756] pci 0000:00:16.3: reg 0x10: [io  0x3060-0x3067]
[    0.647766] pci 0000:00:16.3: reg 0x14: [mem 0x6c401000-0x6c401fff]
[    0.648069] pci 0000:00:1c.0: [8086:51bf] type 01 class 0x060400
[    0.648224] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
[    0.648279] pci 0000:00:1c.0: PTM enabled (root), 4ns granularity
[    0.649454] pci 0000:00:1e.0: [8086:51a8] type 00 class 0x078000
[    0.650186] pci 0000:00:1e.0: reg 0x10: [mem 0x00000000-0x00000fff 64bit]
[    0.653939] pci 0000:00:1e.2: [8086:51aa] type 00 class 0x0c8000
[    0.654637] pci 0000:00:1e.2: reg 0x10: [mem 0x00000000-0x00000fff 64bit]
[    0.657924] pci 0000:00:1f.0: [8086:5182] type 00 class 0x060100
[    0.658338] pci 0000:00:1f.3: [8086:51c8] type 00 class 0x040100
[    0.658404] pci 0000:00:1f.3: reg 0x10: [mem 0x603d1c8000-0x603d1cbfff 64bit]
[    0.658489] pci 0000:00:1f.3: reg 0x20: [mem 0x603d000000-0x603d0fffff 64bit]
[    0.658629] pci 0000:00:1f.3: PME# supported from D3hot D3cold
[    0.659227] pci 0000:00:1f.4: [8086:51a3] type 00 class 0x0c0500
[    0.659320] pci 0000:00:1f.4: reg 0x10: [mem 0x603d1d4000-0x603d1d40ff 64bit]
[    0.659415] pci 0000:00:1f.4: reg 0x20: [io  0xefa0-0xefbf]
[    0.659700] pci 0000:00:1f.5: [8086:51a4] type 00 class 0x0c8000
[    0.659723] pci 0000:00:1f.5: reg 0x10: [mem 0xfe010000-0xfe010fff]
[    0.659986] pci 0000:00:06.0: PCI bridge to [bus 01]
[    0.660784] pci 0000:02:00.0: [1e0f:0001] type 00 class 0x010802
[    0.660804] pci 0000:02:00.0: reg 0x10: [mem 0x6c300000-0x6c303fff 64bit]
[    0.660918] pci 0000:02:00.0: PME# supported from D0 D3hot
[    0.661073] pci 0000:00:06.2: PCI bridge to [bus 02]
[    0.661076] pci 0000:00:06.2:   bridge window [mem 0x6c300000-0x6c3fffff]
[    0.661115] pci 0000:00:07.0: PCI bridge to [bus 03-2c]
[    0.661119] pci 0000:00:07.0:   bridge window [mem 0x60000000-0x6c1fffff]
[    0.661123] pci 0000:00:07.0:   bridge window [mem 0x6000000000-0x601bffffff 64bit pref]
[    0.661158] pci 0000:00:07.2: PCI bridge to [bus 2d-56]
[    0.661162] pci 0000:00:07.2:   bridge window [mem 0x52000000-0x5e1fffff]
[    0.661166] pci 0000:00:07.2:   bridge window [mem 0x6020000000-0x603bffffff 64bit pref]
[    0.661402] pci 0000:57:00.0: [8086:7560] type 00 class 0x0d4000
[    0.661437] pci 0000:57:00.0: reg 0x10: [mem 0x6c200000-0x6c200fff 64bit]
[    0.661459] pci 0000:57:00.0: reg 0x18: [mem 0x6c201000-0x6c2010ff 64bit]
[    0.661619] pci 0000:57:00.0: PME# supported from D0 D3hot D3cold
[    0.661721] pci 0000:57:00.0: 2.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s PCIe x1 link at 0000:00:1c.0 (capable of 4.000 Gb/s with 5.0 GT/s PCIe x1 link)
[    0.662010] pci 0000:00:1c.0: PCI bridge to [bus 57]
[    0.662015] pci 0000:00:1c.0:   bridge window [mem 0x6c200000-0x6c2fffff]
[    0.687836] Low-power S0 idle used by default for system suspend
[    0.688325] ACPI: EC: interrupt unblocked
[    0.688326] ACPI: EC: event unblocked
[    0.688351] ACPI: EC: EC_CMD/EC_SC=0x66, EC_DATA=0x62
[    0.688352] ACPI: EC: GPE=0x6e
[    0.688353] ACPI: \_SB_.PC00.LPCB.EC0_: Boot DSDT EC initialization complete
[    0.688355] ACPI: \_SB_.PC00.LPCB.EC0_: EC: Used to handle transactions and events
[    0.688471] iommu: Default domain type: Translated
[    0.688471] iommu: DMA domain TLB invalidation policy: lazy mode
[    0.688471] SCSI subsystem initialized
[    0.688471] libata version 3.00 loaded.
[    0.688471] ACPI: bus type USB registered
[    0.688471] usbcore: registered new interface driver usbfs
[    0.688471] usbcore: registered new interface driver hub
[    0.688471] usbcore: registered new device driver usb
[    0.688471] pps_core: LinuxPPS API ver. 1 registered
[    0.688471] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.688471] PTP clock support registered
[    0.688471] EDAC MC: Ver: 3.0.0
[    0.690395] efivars: Registered efivars operations
[    0.694609] NetLabel: Initializing
[    0.694612] NetLabel:  domain hash size = 128
[    0.694612] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
[    0.694628] NetLabel:  unlabeled traffic allowed by default
[    0.694641] PCI: Using ACPI for IRQ routing
[    0.770283] PCI: pci_cache_line_size set to 64 bytes
[    0.770768] pci 0000:00:1f.5: can't claim BAR 0 [mem 0xfe010000-0xfe010fff]: no compatible bridge window
[    0.771109] e820: reserve RAM buffer [mem 0x0009f000-0x0009ffff]
[    0.771111] e820: reserve RAM buffer [mem 0x3472b000-0x37ffffff]
[    0.771112] e820: reserve RAM buffer [mem 0x34c4a000-0x37ffffff]
[    0.771112] e820: reserve RAM buffer [mem 0x3c0d3000-0x3fffffff]
[    0.771113] e820: reserve RAM buffer [mem 0x3fc00000-0x3fffffff]
[    0.771113] e820: reserve RAM buffer [mem 0x4af800000-0x4afffffff]
[    0.771142] pci 0000:00:02.0: vgaarb: setting as boot VGA device
[    0.771142] pci 0000:00:02.0: vgaarb: bridge control possible
[    0.771142] pci 0000:00:02.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
[    0.771142] vgaarb: loaded
[    0.771916] clocksource: Switched to clocksource tsc-early
[    0.779823] VFS: Disk quotas dquot_6.6.0
[    0.779838] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.779967] AppArmor: AppArmor Filesystem Enabled
[    0.779986] pnp: PnP ACPI init
[    0.780650] system 00:00: [io  0x0680-0x069f] has been reserved
[    0.780652] system 00:00: [io  0x164e-0x164f] has been reserved
[    0.780817] system 00:01: [io  0x1854-0x1857] has been reserved
[    0.780912] system 00:03: [io  0x0200-0x027f] has been reserved
[    0.780914] system 00:03: [mem 0xfedf0000-0xfedfffff] has been reserved
[    0.781402] pnp 00:04: disabling [mem 0xc0000000-0xcfffffff] because it overlaps 0000:00:02.0 BAR 9 [mem 0x00000000-0xdfffffff 64bit pref]
[    0.781425] system 00:04: [mem 0xfedc0000-0xfedc7fff] has been reserved
[    0.781426] system 00:04: [mem 0xfeda0000-0xfeda0fff] has been reserved
[    0.781427] system 00:04: [mem 0xfeda1000-0xfeda1fff] has been reserved
[    0.781429] system 00:04: [mem 0xfed20000-0xfed7ffff] could not be reserved
[    0.781430] system 00:04: [mem 0xfed90000-0xfed93fff] could not be reserved
[    0.781431] system 00:04: [mem 0xfed45000-0xfed8ffff] could not be reserved
[    0.781432] system 00:04: [mem 0xfee00000-0xfeefffff] has been reserved
[    0.782549] system 00:05: [io  0x2000-0x20fe] has been reserved
[    0.783634] pnp: PnP ACPI: found 7 devices
[    0.789371] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[    0.789423] NET: Registered PF_INET protocol family
[    0.789840] IP idents hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[    0.791775] tcp_listen_portaddr_hash hash table entries: 8192 (order: 5, 131072 bytes, linear)
[    0.791834] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.792043] TCP established hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.792533] TCP bind hash table entries: 65536 (order: 9, 2097152 bytes, linear)
[    0.792766] TCP: Hash tables configured (established 131072 bind 65536)
[    0.792955] MPTCP token hash table entries: 16384 (order: 6, 393216 bytes, linear)
[    0.793030] UDP hash table entries: 8192 (order: 6, 262144 bytes, linear)
[    0.793092] UDP-Lite hash table entries: 8192 (order: 6, 262144 bytes, linear)
[    0.793152] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.793167] NET: Registered PF_XDP protocol family
[    0.793175] pci_bus 0000:00: max bus depth: 1 pci_try_num: 2
[    0.793191] pci 0000:00:02.0: BAR 9: assigned [mem 0x4020000000-0x40ffffffff 64bit pref]
[    0.793197] pci 0000:00:02.0: BAR 7: assigned [mem 0x4010000000-0x4016ffffff 64bit]
[    0.793200] pci 0000:00:07.0: BAR 13: assigned [io  0x4000-0x4fff]
[    0.793202] pci 0000:00:07.2: BAR 13: assigned [io  0x5000-0x5fff]
[    0.793203] pci 0000:00:15.0: BAR 0: assigned [mem 0x4017000000-0x4017000fff 64bit]
[    0.793550] pci 0000:00:1e.0: BAR 0: assigned [mem 0x4017001000-0x4017001fff 64bit]
[    0.793892] pci 0000:00:1e.2: BAR 0: assigned [mem 0x4017002000-0x4017002fff 64bit]
[    0.794233] resource: avoiding allocation from e820 entry [mem 0x0009f000-0x000fffff]
[    0.794235] pci 0000:00:1f.5: BAR 0: assigned [mem 0x50800000-0x50800fff]
[    0.794266] pci 0000:00:06.0: PCI bridge to [bus 01]
[    0.794311] pci 0000:00:06.2: PCI bridge to [bus 02]
[    0.794314] pci 0000:00:06.2:   bridge window [mem 0x6c300000-0x6c3fffff]
[    0.794320] pci 0000:00:07.0: PCI bridge to [bus 03-2c]
[    0.794321] pci 0000:00:07.0:   bridge window [io  0x4000-0x4fff]
[    0.794325] pci 0000:00:07.0:   bridge window [mem 0x60000000-0x6c1fffff]
[    0.794327] pci 0000:00:07.0:   bridge window [mem 0x6000000000-0x601bffffff 64bit pref]
[    0.794332] pci 0000:00:07.2: PCI bridge to [bus 2d-56]
[    0.794333] pci 0000:00:07.2:   bridge window [io  0x5000-0x5fff]
[    0.794336] pci 0000:00:07.2:   bridge window [mem 0x52000000-0x5e1fffff]
[    0.794339] pci 0000:00:07.2:   bridge window [mem 0x6020000000-0x603bffffff 64bit pref]
[    0.794344] pci 0000:00:1c.0: PCI bridge to [bus 57]
[    0.794368] pci 0000:00:1c.0:   bridge window [mem 0x6c200000-0x6c2fffff]
[    0.794377] pci_bus 0000:00: resource 4 [io  0x0000-0x0cf7 window]
[    0.794378] pci_bus 0000:00: resource 5 [io  0x0d00-0xffff window]
[    0.794379] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff window]
[    0.794379] pci_bus 0000:00: resource 7 [mem 0x50800000-0xbfffffff window]
[    0.794380] pci_bus 0000:00: resource 8 [mem 0x4000000000-0x7fffffffff window]
[    0.794381] pci_bus 0000:02: resource 1 [mem 0x6c300000-0x6c3fffff]
[    0.794382] pci_bus 0000:03: resource 0 [io  0x4000-0x4fff]
[    0.794383] pci_bus 0000:03: resource 1 [mem 0x60000000-0x6c1fffff]
[    0.794384] pci_bus 0000:03: resource 2 [mem 0x6000000000-0x601bffffff 64bit pref]
[    0.794384] pci_bus 0000:2d: resource 0 [io  0x5000-0x5fff]
[    0.794385] pci_bus 0000:2d: resource 1 [mem 0x52000000-0x5e1fffff]
[    0.794386] pci_bus 0000:2d: resource 2 [mem 0x6020000000-0x603bffffff 64bit pref]
[    0.794387] pci_bus 0000:57: resource 1 [mem 0x6c200000-0x6c2fffff]
[    0.794583] pci 0000:00:0d.0: enabling device (0000 -> 0002)
[    0.794638] pci 0000:00:14.0: enabling device (0000 -> 0002)
[    0.795373] PCI: CLS 0 bytes, default 64
[    0.795385] DMAR: Intel-IOMMU force enabled due to platform opt in
[    0.795396] DMAR: No ATSR found
[    0.795396] DMAR: No SATC found
[    0.795397] DMAR: IOMMU feature fl1gp_support inconsistent
[    0.795399] DMAR: IOMMU feature pgsel_inv inconsistent
[    0.795400] DMAR: IOMMU feature nwfs inconsistent
[    0.795400] DMAR: IOMMU feature dit inconsistent
[    0.795401] DMAR: IOMMU feature sc_support inconsistent
[    0.795401] DMAR: IOMMU feature dev_iotlb_support inconsistent
[    0.795402] DMAR: dmar0: Using Queued invalidation
[    0.795406] DMAR: dmar1: Using Queued invalidation
[    0.795444] Trying to unpack rootfs image as initramfs...
[    0.795640] pci 0000:00:02.0: Adding to iommu group 0
[    0.795684] pci 0000:00:00.0: Adding to iommu group 1
[    0.795692] pci 0000:00:04.0: Adding to iommu group 2
[    0.795713] pci 0000:00:06.0: Adding to iommu group 3
[    0.795722] pci 0000:00:06.2: Adding to iommu group 4
[    0.795733] pci 0000:00:07.0: Adding to iommu group 5
[    0.795742] pci 0000:00:07.2: Adding to iommu group 6
[    0.795750] pci 0000:00:08.0: Adding to iommu group 7
[    0.795757] pci 0000:00:0a.0: Adding to iommu group 8
[    0.795775] pci 0000:00:0d.0: Adding to iommu group 9
[    0.795783] pci 0000:00:0d.2: Adding to iommu group 9
[    0.795791] pci 0000:00:0d.3: Adding to iommu group 9
[    0.795805] pci 0000:00:14.0: Adding to iommu group 10
[    0.795815] pci 0000:00:14.2: Adding to iommu group 10
[    0.795824] pci 0000:00:14.3: Adding to iommu group 11
[    0.795835] pci 0000:00:15.0: Adding to iommu group 12
[    0.795849] pci 0000:00:16.0: Adding to iommu group 13
[    0.795858] pci 0000:00:16.3: Adding to iommu group 13
[    0.795880] pci 0000:00:1c.0: Adding to iommu group 14
[    0.795895] pci 0000:00:1e.0: Adding to iommu group 15
[    0.795903] pci 0000:00:1e.2: Adding to iommu group 15
[    0.795923] pci 0000:00:1f.0: Adding to iommu group 16
[    0.795932] pci 0000:00:1f.3: Adding to iommu group 16
[    0.795941] pci 0000:00:1f.4: Adding to iommu group 16
[    0.795949] pci 0000:00:1f.5: Adding to iommu group 16
[    0.795959] pci 0000:02:00.0: Adding to iommu group 17
[    0.795983] pci 0000:57:00.0: Adding to iommu group 18
[    0.796147] DMAR: Intel(R) Virtualization Technology for Directed I/O
[    0.796148] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    0.796149] software IO TLB: mapped [mem 0x0000000025442000-0x0000000029442000] (64MB)
[    0.806603] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x1128af0325d, max_idle_ns: 440795261011 ns
[    0.806627] clocksource: Switched to clocksource tsc
[    0.806675] platform rtc_cmos: registered platform RTC device (no PNP device found)
[    0.807392] Initialise system trusted keyrings
[    0.807407] Key type blacklist registered
[    0.807484] workingset: timestamp_bits=36 max_order=22 bucket_order=0
[    0.807498] zbud: loaded
[    0.807713] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.807797] fuse: init (API version 7.38)
[    0.807983] integrity: Platform Keyring initialized
[    0.810814] Key type asymmetric registered
[    0.810817] Asymmetric key parser 'x509' registered
[    0.810851] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 243)
[    0.810946] io scheduler mq-deadline registered
[    0.811745] pcieport 0000:00:06.0: PME: Signaling with IRQ 122
[    0.812257] pcieport 0000:00:06.2: PME: Signaling with IRQ 123
[    0.812561] pcieport 0000:00:07.0: PME: Signaling with IRQ 124
[    0.812589] pcieport 0000:00:07.0: pciehp: Slot #3 AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug+ Surprise+ Interlock- NoCompl+ IbPresDis- LLActRep+
[    0.813067] pcieport 0000:00:07.2: PME: Signaling with IRQ 125
[    0.813097] pcieport 0000:00:07.2: pciehp: Slot #5 AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug+ Surprise+ Interlock- NoCompl+ IbPresDis- LLActRep+
[    0.813637] pcieport 0000:00:1c.0: PME: Signaling with IRQ 126
[    0.813816] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
[    0.814897] ACPI: AC: AC Adapter [AC] (on-line)
[    0.814965] input: Sleep Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input0
[    0.814986] ACPI: button: Sleep Button [SLPB]
[    0.815015] input: Lid Switch as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input1
[    0.815030] ACPI: button: Lid Switch [LID]
[    0.815056] input: Power Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input2
[    0.815071] ACPI: button: Power Button [PWRB]
[    0.815103] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input3
[    0.815144] ACPI: button: Power Button [PWRF]

[    0.819223]
               Initialized Local Variables for Method [GETP]:
[    0.819225]   Local0: 00000000a274324f <Obj>           Integer 0000000000000003

[    0.819233] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.819234]   Arg0:   00000000edc30dd3 <Obj>           Integer 0000000000000000
[    0.819238]   Arg1:   00000000a6419e1b <Obj>           Integer 0000000000000003

[    0.819243] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.819255] ACPI Error: Aborting method \_TZ.CPUZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)

[    0.819307]
               Initialized Local Variables for Method [GETP]:
[    0.819308]   Local0: 00000000f749d28b <Obj>           Integer 0000000000000002

[    0.819313] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.819314]   Arg0:   00000000edc30dd3 <Obj>           Integer 0000000000000000
[    0.819317]   Arg1:   000000006a0d68db <Obj>           Integer 0000000000000002

[    0.819321] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.819329] ACPI Error: Aborting method \_TZ.CHOT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.819335] ACPI Error: Aborting method \_TZ.CPUZ._HOT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)

[    0.821063]
               Initialized Local Variables for Method [SETM]:
[    0.821064]   Local5: 000000002b5d1c3b <Obj>           Integer 0000000000000000
[    0.821067]   Local7: 0000000083081c6a <Obj>           Integer 0000000000000001

[    0.821071] Initialized Arguments for Method [SETM]:  (3 arguments defined for method invocation)
[    0.821072]   Arg0:   00000000ebf7ccee <Obj>           Integer 0000000000000000
[    0.821075]   Arg1:   000000006a0d68db <Obj>           Integer 0000000000000001
[    0.821078]   Arg2:   00000000b89b0b84 <Obj>           Integer 0000000000000035

[    0.821082] ACPI Error: Aborting method \_TZ.SETM due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.821089] ACPI Error: Aborting method \_TZ.CPUZ._TMP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)

[    0.821124]
               Initialized Local Variables for Method [GETP]:
[    0.821125]   Local0: 0000000004b4aa82 <Obj>           Integer 0000000000000003

[    0.821129] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.821130]   Arg0:   0000000083081c6a <Obj>           Integer 0000000000000000
[    0.821133]   Arg1:   00000000ebf7ccee <Obj>           Integer 0000000000000003

[    0.821137] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.821144] ACPI Error: Aborting method \_TZ.CPUZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)

[    0.821188]
               Initialized Local Variables for Method [GETP]:
[    0.821189]   Local0: 00000000cb6c01d0 <Obj>           Integer 0000000000000002

[    0.821193] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.821194]   Arg0:   00000000ebf7ccee <Obj>           Integer 0000000000000000
[    0.821197]   Arg1:   0000000083081c6a <Obj>           Integer 0000000000000002

[    0.821201] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.821207] ACPI Error: Aborting method \_TZ.CHOT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.821214] ACPI Error: Aborting method \_TZ.CPUZ._HOT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.821222] ACPI: thermal: [Firmware Bug]: No valid trip found

[    0.821260]
               Initialized Local Variables for Method [GETP]:
[    0.821261]   Local0: 0000000083081c6a <Obj>           Integer 0000000000000003

[    0.821265] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.821265]   Arg0:   000000002b5d1c3b <Obj>           Integer 0000000000000001
[    0.821268]   Arg1:   000000006a0d68db <Obj>           Integer 0000000000000003

[    0.821272] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.821279] ACPI Error: Aborting method \_TZ.GFXZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)

[    0.821304]
               Initialized Local Variables for Method [GETP]:
[    0.821304]   Local0: 00000000ebf7ccee <Obj>           Integer 0000000000000001

[    0.821308] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.821309]   Arg0:   0000000083081c6a <Obj>           Integer 0000000000000001
[    0.821312]   Arg1:   000000002b5d1c3b <Obj>           Integer 0000000000000001

[    0.821316] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.821322] ACPI Error: Aborting method \_TZ.GFXZ._PSV due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)

[    0.822973]
               Initialized Local Variables for Method [SETM]:
[    0.822975]   Local5: 000000001f48dee8 <Obj>           Integer 0000000000000000
[    0.822982]   Local7: 0000000097cb4d40 <Obj>           Integer 0000000000000002

[    0.822986] Initialized Arguments for Method [SETM]:  (3 arguments defined for method invocation)
[    0.822987]   Arg0:   000000003a1c42b4 <Obj>           Integer 0000000000000001
[    0.822990]   Arg1:   00000000bbcccaa7 <Obj>           Integer 0000000000000002
[    0.822992]   Arg2:   00000000a088118c <Obj>           Integer 0000000000000019

[    0.822997] ACPI Error: Aborting method \_TZ.SETM due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.823009] ACPI Error: Aborting method \_TZ.GFXZ._TMP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)

[    0.823049]
               Initialized Local Variables for Method [GETP]:
[    0.823050]   Local0: 000000001f48dee8 <Obj>           Integer 0000000000000003

[    0.823054] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.823055]   Arg0:   000000003a1c42b4 <Obj>           Integer 0000000000000001
[    0.823058]   Arg1:   00000000bbcccaa7 <Obj>           Integer 0000000000000003

[    0.823061] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.823068] ACPI Error: Aborting method \_TZ.GFXZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)

[    0.823093]
               Initialized Local Variables for Method [GETP]:
[    0.823094]   Local0: 0000000056abb730 <Obj>           Integer 0000000000000001

[    0.823097] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.823098]   Arg0:   000000003a1c42b4 <Obj>           Integer 0000000000000001
[    0.823101]   Arg1:   00000000bbcccaa7 <Obj>           Integer 0000000000000001

[    0.823104] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.823111] ACPI Error: Aborting method \_TZ.GFXZ._PSV due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.823118] ACPI: thermal: [Firmware Bug]: No valid trip found

[    0.823171]
               Initialized Local Variables for Method [GETP]:
[    0.823172]   Local0: 0000000097cb4d40 <Obj>           Integer 0000000000000003

[    0.823175] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.823176]   Arg0:   0000000056abb730 <Obj>           Integer 0000000000000002
[    0.823179]   Arg1:   000000003a1c42b4 <Obj>           Integer 0000000000000003

[    0.823182] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.823188] ACPI Error: Aborting method \_TZ.EXTZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)

[    0.824988]
               Initialized Local Variables for Method [GETP]:
[    0.824989]   Local0: 0000000056abb730 <Obj>           Integer 0000000000000003

[    0.824999] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.825000]   Arg0:   000000007dd4086a <Obj>           Integer 0000000000000002
[    0.825003]   Arg1:   00000000e3cf0522 <Obj>           Integer 0000000000000003

[    0.825007] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.825019] ACPI Error: Aborting method \_TZ.EXTZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.825028] ACPI: thermal: [Firmware Bug]: No valid trip found

[    0.825079]
               Initialized Local Variables for Method [GETP]:
[    0.825080]   Local0: 000000003a1c42b4 <Obj>           Integer 0000000000000003

[    0.825084] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.825084]   Arg0:   0000000056abb730 <Obj>           Integer 0000000000000003
[    0.825087]   Arg1:   000000007dd4086a <Obj>           Integer 0000000000000003

[    0.825090] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.825096] ACPI Error: Aborting method \_TZ.LOCZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)

[    0.826718]
               Initialized Local Variables for Method [GETP]:
[    0.826719]   Local0: 000000007dd4086a <Obj>           Integer 0000000000000003

[    0.826726] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.826727]   Arg0:   0000000056abb730 <Obj>           Integer 0000000000000003
[    0.826730]   Arg1:   000000008b4c0003 <Obj>           Integer 0000000000000003

[    0.826734] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.826745] ACPI Error: Aborting method \_TZ.LOCZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.826754] ACPI: thermal: [Firmware Bug]: No valid trip found

[    0.826808]
               Initialized Local Variables for Method [GETP]:
[    0.826809]   Local0: 000000003a1c42b4 <Obj>           Integer 0000000000000003

[    0.826813] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.826814]   Arg0:   000000007dd4086a <Obj>           Integer 0000000000000004
[    0.826816]   Arg1:   0000000056abb730 <Obj>           Integer 0000000000000003

[    0.826819] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.826826] ACPI Error: Aborting method \_TZ.BATZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)

[    0.826849]
               Initialized Local Variables for Method [GETP]:
[    0.826849]   Local0: 000000008ff39dcf <Obj>           Integer 0000000000000001

[    0.826853] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.826853]   Arg0:   000000007dd4086a <Obj>           Integer 0000000000000004
[    0.826856]   Arg1:   0000000056abb730 <Obj>           Integer 0000000000000001

[    0.826859] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.826865] ACPI Error: Aborting method \_TZ.BATZ._PSV due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)

[    0.828654]
               Initialized Local Variables for Method [SETM]:
[    0.828656]   Local5: 000000003a1c42b4 <Obj>           Integer 0000000000000000
[    0.828662]   Local7: 00000000bcfbd287 <Obj>           Integer 0000000000000010

[    0.828666] Initialized Arguments for Method [SETM]:  (3 arguments defined for method invocation)
[    0.828667]   Arg0:   000000007dd4086a <Obj>           Integer 0000000000000004
[    0.828670]   Arg1:   0000000056abb730 <Obj>           Integer 0000000000000005
[    0.828672]   Arg2:   00000000eaa146c1 <Obj>           Integer 0000000000000017

[    0.828676] ACPI Error: Aborting method \_TZ.SETM due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.828689] ACPI Error: Aborting method \_TZ.BATZ._TMP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)

[    0.828726]
               Initialized Local Variables for Method [GETP]:
[    0.828727]   Local0: 000000003a1c42b4 <Obj>           Integer 0000000000000003

[    0.828730] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.828731]   Arg0:   000000007dd4086a <Obj>           Integer 0000000000000004
[    0.828733]   Arg1:   0000000056abb730 <Obj>           Integer 0000000000000003

[    0.828737] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.828743] ACPI Error: Aborting method \_TZ.BATZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)

[    0.828766]
               Initialized Local Variables for Method [GETP]:
[    0.828767]   Local0: 00000000aba2c902 <Obj>           Integer 0000000000000001

[    0.828770] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.828771]   Arg0:   000000007dd4086a <Obj>           Integer 0000000000000004
[    0.828773]   Arg1:   0000000056abb730 <Obj>           Integer 0000000000000001

[    0.828777] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.828783] ACPI Error: Aborting method \_TZ.BATZ._PSV due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.828789] ACPI: thermal: [Firmware Bug]: No valid trip found

[    0.828841]
               Initialized Local Variables for Method [GETP]:
[    0.828842]   Local0: 00000000bcfbd287 <Obj>           Integer 0000000000000003

[    0.828845] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.828846]   Arg0:   00000000aba2c902 <Obj>           Integer 0000000000000005
[    0.828848]   Arg1:   000000007dd4086a <Obj>           Integer 0000000000000003

[    0.828851] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.828857] ACPI Error: Aborting method \_TZ.CHGZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)

[    0.830959]
               Initialized Local Variables for Method [GETP]:
[    0.830961]   Local0: 000000007dd4086a <Obj>           Integer 0000000000000003

[    0.830968] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.830969]   Arg0:   00000000aba2c902 <Obj>           Integer 0000000000000005
[    0.830972]   Arg1:   00000000f4872a85 <Obj>           Integer 0000000000000003

[    0.830977] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.830990] ACPI Error: Aborting method \_TZ.CHGZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20221020/psparse-529)
[    0.831123] ACPI: thermal: [Firmware Bug]: No valid trip found
[    0.835244] thermal LNXTHERM:06: registered as thermal_zone0
[    0.835252] ACPI: thermal: Thermal Zone [PCHZ] (0 C)
[    0.835938] Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled
[    0.840315] serial 0000:00:16.3: enabling device (0000 -> 0003)
[    0.852935] ACPI: battery: Slot [BAT0] (battery present)
[    0.861883] 0000:00:16.3: ttyS4 at I/O 0x3060 (irq = 19, base_baud = 115200) is a 16550A
[    0.862428] hpet_acpi_add: no address or irqs in _CRS
[    0.862484] Linux agpgart interface v0.103
[    0.865170] tpm_tis IFX1520:00: 2.0 TPM (device-id 0x1D, rev-id 38)
[    0.867825] tpm tpm0: [Firmware Bug]: TPM interrupt not working, polling instead
[    0.934261] Freeing initrd memory: 64056K
[    1.024906] loop: module loaded
[    1.025062] tun: Universal TUN/TAP device driver, 1.6
[    1.025075] PPP generic driver version 2.4.2
[    1.025213] VFIO - User Level meta-driver version: 0.3
[    1.025275] i8042: PNP: PS/2 Controller [PNP0303:PS2K] at 0x60,0x64 irq 1
[    1.025276] i8042: PNP: PS/2 appears to have AUX port disabled, if this is incorrect please boot with i8042.nopnp
[    1.025881] serio: i8042 KBD port at 0x60,0x64 irq 1
[    1.025933] mousedev: PS/2 mouse device common for all mice
[    1.026021] rtc_cmos rtc_cmos: RTC can wake from S4
[    1.027812] rtc_cmos rtc_cmos: registered as rtc0
[    1.028186] rtc_cmos rtc_cmos: setting system clock to 2023-04-28T13:11:47 UTC (1682687507)
[    1.028208] rtc_cmos rtc_cmos: alarms up to one month, y3k, 114 bytes nvram
[    1.028214] i2c_dev: i2c /dev entries driver
[    1.028887] device-mapper: core: CONFIG_IMA_DISABLE_HTABLE is disabled. Duplicate IMA measurements will not be recorded in the IMA log.
[    1.028894] device-mapper: uevent: version 1.0.3
[    1.028913] device-mapper: ioctl: 4.47.0-ioctl (2022-07-28) initialised: dm-devel@redhat.com
[    1.028922] platform eisa.0: Probing EISA bus 0
[    1.028923] platform eisa.0: EISA: Cannot allocate resource for mainboard
[    1.028924] platform eisa.0: Cannot allocate resource for EISA slot 1
[    1.028924] platform eisa.0: Cannot allocate resource for EISA slot 2
[    1.028925] platform eisa.0: Cannot allocate resource for EISA slot 3
[    1.028925] platform eisa.0: Cannot allocate resource for EISA slot 4
[    1.028926] platform eisa.0: Cannot allocate resource for EISA slot 5
[    1.028926] platform eisa.0: Cannot allocate resource for EISA slot 6
[    1.028927] platform eisa.0: Cannot allocate resource for EISA slot 7
[    1.028927] platform eisa.0: Cannot allocate resource for EISA slot 8
[    1.028928] platform eisa.0: EISA: Detected 0 cards
[    1.028929] intel_pstate: Intel P-state driver initializing
[    1.031289] intel_pstate: HWP enabled
[    1.031707] ledtrig-cpu: registered to indicate activity on CPUs
[    1.031766] efifb: probing for efifb
[    1.031803] efifb: showing boot graphics
[    1.033689] efifb: framebuffer at 0x4000000000, using 9000k, total 9000k
[    1.033691] efifb: mode is 1920x1200x32, linelength=7680, pages=1
[    1.033692] efifb: scrolling: redraw
[    1.033692] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
[    1.033795] Console: switching to colour frame buffer device 240x75
[    1.037095] fb0: EFI VGA frame buffer device
[    1.037276] intel_pmc_core INT33A1:00:  initialized
[    1.037387] drop_monitor: Initializing network drop monitor service
[    1.037478] NET: Registered PF_INET6 protocol family
[    1.042586] Segment Routing with IPv6
[    1.042592] In-situ OAM (IOAM) with IPv6
[    1.042617] NET: Registered PF_PACKET protocol family
[    1.042667] Key type dns_resolver registered
[    1.044710] microcode: Microcode Update Driver: v2.2.
[    1.045157] resctrl: L2 allocation detected
[    1.045184] IPI shorthand broadcast: enabled
[    1.045971] sched_clock: Marking stable (954747164, 90393717)->(1076694222, -31553341)
[    1.046508] registered taskstats version 1
[    1.047118] Loading compiled-in X.509 certificates
[    1.047566] Loaded X.509 cert 'Build time autogenerated kernel key: efc831a9c65eff684b8c9039fb11dbd2ebac655e'
[    1.048264] zswap: loaded using pool lzo/zbud
[    1.049828] Key type .fscrypt registered
[    1.049830] Key type fscrypt-provisioning registered
[    1.050799] Key type trusted registered
[    1.052236] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input4
[    1.052988] Key type encrypted registered
[    1.052997] AppArmor: AppArmor sha1 policy hashing enabled
[    1.053710] integrity: Loading X.509 certificate: UEFI:db
[    1.053737] integrity: Loaded X.509 cert 'HP Inc.: HP UEFI Secure Boot DB 2017: d9c01b50cfcae89d3b05345c163aa76e5dd589e7'
[    1.053739] integrity: Loading X.509 certificate: UEFI:db
[    1.053754] integrity: Loaded X.509 cert 'Microsoft Windows Production PCA 2011: a92902398e16c49778cd90f99e4f9ae17c55af53'
[    1.053754] integrity: Loading X.509 certificate: UEFI:db
[    1.053768] integrity: Loaded X.509 cert 'Microsoft Corporation UEFI CA 2011: 13adbf4309bd82709c8cd54f316ed522988a1bd4'
[    1.054293] Loading compiled-in module X.509 certificates
[    1.054669] Loaded X.509 cert 'Build time autogenerated kernel key: efc831a9c65eff684b8c9039fb11dbd2ebac655e'
[    1.054678] ima: Allocated hash algorithm: sha1
[    1.088287] ima: No architecture policies found
[    1.088363] evm: Initialising EVM extended attributes:
[    1.088365] evm: security.selinux
[    1.088369] evm: security.SMACK64
[    1.088371] evm: security.SMACK64EXEC
[    1.088373] evm: security.SMACK64TRANSMUTE
[    1.088375] evm: security.SMACK64MMAP
[    1.088376] evm: security.apparmor
[    1.088378] evm: security.ima
[    1.088379] evm: security.capability
[    1.088381] evm: HMAC attrs: 0x1
[    1.089368] PM:   Magic number: 3:88:181
[    1.089531] acpi device:40: hash matches
[    1.090135] RAS: Correctable Errors collector initialized.
[    1.099302] Freeing unused decrypted memory: 2036K
[    1.100049] Freeing unused kernel image (initmem) memory: 4408K
[    1.106608] Write protecting the kernel read-only data: 26624k
[    1.107352] Freeing unused kernel image (rodata/data gap) memory: 1368K
[    1.112529] x86/mm: Checked W+X mappings: passed, no W+X pages found.
[    1.112534] Run /init as init process
[    1.112534]   with arguments:
[    1.112535]     /init
[    1.112536]     splash
[    1.112537]   with environment:
[    1.112538]     HOME=/
[    1.112538]     TERM=linux
[    1.112538]     BOOT_IMAGE=/boot/vmlinuz-6.3.0-rc3+
[    1.200969] wmi_bus wmi_bus-PNP0C14:02: WQZZ data block query control method not found
[    1.217306] xhci_hcd 0000:00:0d.0: xHCI Host Controller
[    1.217322] xhci_hcd 0000:00:0d.0: new USB bus registered, assigned bus number 1
[    1.217642] xhci_hcd 0000:00:14.0: xHCI Host Controller
[    1.217660] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 2
[    1.218414] xhci_hcd 0000:00:0d.0: hcc params 0x20007fc1 hci version 0x120 quirks 0x0000000200009810
[    1.218774] xhci_hcd 0000:00:0d.0: xHCI Host Controller
[    1.218781] xhci_hcd 0000:00:0d.0: new USB bus registered, assigned bus number 3
[    1.218785] xhci_hcd 0000:00:0d.0: Host supports USB 3.2 Enhanced SuperSpeed
[    1.218837] xhci_hcd 0000:00:14.0: hcc params 0x20007fc1 hci version 0x120 quirks 0x0000100200009810
[    1.218890] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.03
[    1.218896] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.218898] usb usb1: Product: xHCI Host Controller
[    1.218899] usb usb1: Manufacturer: Linux 6.3.0-rc3+ xhci-hcd
[    1.218901] usb usb1: SerialNumber: 0000:00:0d.0
[    1.219122] hub 1-0:1.0: USB hub found
[    1.219137] hub 1-0:1.0: 1 port detected
[    1.219756] xhci_hcd 0000:00:14.0: xHCI Host Controller
[    1.219815] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 4
[    1.219821] xhci_hcd 0000:00:14.0: Host supports USB 3.1 Enhanced SuperSpeed
[    1.219879] usb usb3: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.03
[    1.219886] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.219888] usb usb3: Product: xHCI Host Controller
[    1.219890] usb usb3: Manufacturer: Linux 6.3.0-rc3+ xhci-hcd
[    1.219892] usb usb3: SerialNumber: 0000:00:0d.0
[    1.233097] hub 3-0:1.0: USB hub found
[    1.233126] hub 3-0:1.0: 3 ports detected
[    1.244100] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.03
[    1.244110] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.244114] usb usb2: Product: xHCI Host Controller
[    1.244117] usb usb2: Manufacturer: Linux 6.3.0-rc3+ xhci-hcd
[    1.244120] usb usb2: SerialNumber: 0000:00:14.0
[    1.244515] hub 2-0:1.0: USB hub found
[    1.244570] hub 2-0:1.0: 12 ports detected
[    1.250467] usb usb4: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.03
[    1.250472] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.250474] usb usb4: Product: xHCI Host Controller
[    1.250475] usb usb4: Manufacturer: Linux 6.3.0-rc3+ xhci-hcd
[    1.250476] usb usb4: SerialNumber: 0000:00:14.0
[    1.250715] hub 4-0:1.0: USB hub found
[    1.250745] hub 4-0:1.0: 4 ports detected
[    1.252142] usb: port power management may be unreliable
[    1.254647] ACPI: bus type thunderbolt registered
[    1.257062] i801_smbus 0000:00:1f.4: enabling device (0000 -> 0003)
[    1.257952] i801_smbus 0000:00:1f.4: SPD Write Disable is set
[    1.258034] i801_smbus 0000:00:1f.4: SMBus using PCI interrupt
[    1.258506] nvme 0000:02:00.0: platform quirk: setting simple suspend
[    1.258704] nvme nvme0: pci function 0000:02:00.0
[    1.262249] i2c i2c-0: 4/4 memory slots populated (from DMI)
[    1.262254] i2c i2c-0: Memory type 0x22 not supported yet, not instantiating SPD
[    1.274174] nvme nvme0: allocated 61 MiB host memory buffer.
[    1.405746] thunderbolt 0000:00:0d.2: 0: DROM data CRC32 mismatch (expected: 0x6c170589, got: 0xe0469681), aborting
[    1.405766] thunderbolt 0-0: reading DROM failed: -5
[    1.428947] nvme nvme0: 12/0/0 default/read/poll queues
[    1.433453]  nvme0n1: p1 p2
[    1.446494] intel-lpss 0000:00:15.0: enabling device (0000 -> 0002)
[    1.446991] idma64 idma64.0: Found Intel integrated DMA 64-bit
[    1.466534] intel-lpss 0000:00:1e.0: enabling device (0000 -> 0002)
[    1.467229] idma64 idma64.1: Found Intel integrated DMA 64-bit
[    1.478662] intel-lpss 0000:00:1e.2: enabling device (0000 -> 0002)
[    1.479025] idma64 idma64.2: Found Intel integrated DMA 64-bit
[    1.506549] usb 2-1: new high-speed USB device number 2 using xhci_hcd
[    1.591456] thunderbolt 0000:00:0d.3: 0: DROM data CRC32 mismatch (expected: 0x6c170589, got: 0xe0469681), aborting
[    1.591465] thunderbolt 1-0: reading DROM failed: -5
[    1.660918] random: crng reseeded on system resumption
[    1.661289] PM: hibernation: Marking nosave pages: [mem 0x00000000-0x00000fff]
[    1.661294] PM: hibernation: Marking nosave pages: [mem 0x0009f000-0x000fffff]
[    1.661297] PM: hibernation: Marking nosave pages: [mem 0x3472b000-0x34773fff]
[    1.661299] PM: hibernation: Marking nosave pages: [mem 0x34c4a000-0x34c4afff]
[    1.661300] PM: hibernation: Marking nosave pages: [mem 0x3c0d3000-0x3fbfefff]
[    1.661500] PM: hibernation: Marking nosave pages: [mem 0x3fc00000-0xffffffff]
[    1.663098] PM: hibernation: Basic memory bitmaps created
[    1.663412] PM: hibernation: Basic memory bitmaps freed
[    1.688710] EXT4-fs (nvme0n1p2): mounted filesystem 2aec303b-7cd8-4d6f-8da6-b19769ec6332 with ordered data mode. Quota mode: none.
[    1.728614] usb 3-1: new SuperSpeed USB device number 2 using xhci_hcd
[    1.746702] usb 2-1: New USB device found, idVendor=30c9, idProduct=0040, bcdDevice= 0.02
[    1.746718] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    1.746723] usb 2-1: Product: HP 5MP Camera
[    1.746728] usb 2-1: Manufacturer: DLTDCX29IF4053
[    1.746731] usb 2-1: SerialNumber: 01.00.00
[    1.807483] usb 4-3: new SuperSpeed USB device number 2 using xhci_hcd
[    1.875351] usb 4-3: New USB device found, idVendor=0bda, idProduct=0315, bcdDevice= 2.17
[    1.875373] usb 4-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    1.875381] usb 4-3: Product: USB3.0 Card Reader
[    1.875387] usb 4-3: Manufacturer: Realtek
[    1.875392] usb 4-3: SerialNumber: 202006095347
[    1.916109] systemd[1]: Inserted module 'autofs4'
[    1.958546] usb 2-10: new full-speed USB device number 3 using xhci_hcd
[    2.013704] usb 3-1: New USB device found, idVendor=0b95, idProduct=1790, bcdDevice= 2.00
[    2.013709] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.013711] usb 3-1: Product: AX88179A
[    2.013713] usb 3-1: Manufacturer: ASIX
[    2.013714] usb 3-1: SerialNumber: 0077376A
[    2.063236] systemd[1]: systemd 245.4-4ubuntu3.20 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid)
[    2.063317] systemd[1]: Detected architecture x86-64.
[    2.114607] usb 2-10: New USB device found, idVendor=8087, idProduct=0033, bcdDevice= 0.00
[    2.114627] usb 2-10: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.124183] systemd[1]: Set hostname to <cirrus-laptop-hp1>.
[    2.153196] memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL, pid=1 'systemd'
[    2.369860] systemd[1]: Created slice system-modprobe.slice.
[    2.370061] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[    2.370187] systemd[1]: Created slice User and Session Slice.
[    2.370219] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    2.370338] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[    2.370363] systemd[1]: Reached target User and Group Name Lookups.
[    2.370370] systemd[1]: Reached target Remote File Systems.
[    2.370376] systemd[1]: Reached target Slices.
[    2.370507] systemd[1]: Listening on Syslog Socket.
[    2.370560] systemd[1]: Listening on fsck to fsckd communication Socket.
[    2.370593] systemd[1]: Listening on initctl Compatibility Named Pipe.
[    2.370693] systemd[1]: Listening on Journal Audit Socket.
[    2.370731] systemd[1]: Listening on Journal Socket (/dev/log).
[    2.370779] systemd[1]: Listening on Journal Socket.
[    2.370828] systemd[1]: Listening on udev Control Socket.
[    2.370856] systemd[1]: Listening on udev Kernel Socket.
[    2.391179] systemd[1]: Mounting Huge Pages File System...
[    2.394086] systemd[1]: Mounting POSIX Message Queue File System...
[    2.395953] systemd[1]: Mounting Kernel Debug File System...
[    2.397063] systemd[1]: Mounting Kernel Trace File System...
[    2.398239] systemd[1]: Starting Journal Service...
[    2.398740] systemd[1]: Starting Set the console keyboard layout...
[    2.399195] systemd[1]: Starting Create list of static device nodes for the current kernel...
[    2.399683] systemd[1]: Starting Load Kernel Module chromeos_pstore...
[    2.400191] systemd[1]: Starting Load Kernel Module drm...
[    2.400644] systemd[1]: Starting Load Kernel Module efi_pstore...
[    2.401179] systemd[1]: Starting Load Kernel Module pstore_blk...
[    2.401666] systemd[1]: Starting Load Kernel Module pstore_zone...
[    2.402170] systemd[1]: Starting Load Kernel Module ramoops...
[    2.403746] systemd[1]: Condition check resulted in Set Up Additional Binary Formats being skipped.
[    2.403847] systemd[1]: Condition check resulted in File System Check on Root Device being skipped.
[    2.408972] systemd[1]: Starting Load Kernel Modules...
[    2.409047] pstore: Using crash dump compression: deflate
[    2.414001] systemd[1]: Starting Remount Root and Kernel File Systems...
[    2.418954] systemd[1]: Starting udev Coldplug all Devices...
[    2.423398] systemd[1]: Starting Uncomplicated firewall...
[    2.431769] systemd[1]: Mounted Huge Pages File System.
[    2.432384] systemd[1]: Mounted POSIX Message Queue File System.
[    2.432956] systemd[1]: Mounted Kernel Debug File System.
[    2.433516] systemd[1]: Mounted Kernel Trace File System.
[    2.435772] systemd[1]: Finished Create list of static device nodes for the current kernel.
[    2.437155] systemd[1]: modprobe@pstore_blk.service: Succeeded.
[    2.438540] systemd[1]: Finished Load Kernel Module pstore_blk.
[    2.439887] systemd[1]: modprobe@pstore_zone.service: Succeeded.
[    2.441312] systemd[1]: Finished Load Kernel Module pstore_zone.
[    2.442470] systemd[1]: modprobe@ramoops.service: Succeeded.
[    2.443847] systemd[1]: Finished Load Kernel Module ramoops.
[    2.445722] systemd[1]: Finished Uncomplicated firewall.
[    2.475406] pstore: Registered efi_pstore as persistent store backend
[    2.479983] systemd[1]: modprobe@chromeos_pstore.service: Succeeded.
[    2.480934] systemd[1]: Finished Load Kernel Module chromeos_pstore.
[    2.481259] systemd[1]: modprobe@efi_pstore.service: Succeeded.
[    2.481841] systemd[1]: Finished Load Kernel Module efi_pstore.
[    2.485045] EXT4-fs (nvme0n1p2): re-mounted 2aec303b-7cd8-4d6f-8da6-b19769ec6332. Quota mode: none.
[    2.486634] systemd[1]: Finished Remount Root and Kernel File Systems.
[    2.487857] systemd[1]: Activating swap /swapfile...
[    2.488344] systemd[1]: Condition check resulted in Rebuild Hardware Database being skipped.
[    2.488446] systemd[1]: Condition check resulted in Platform Persistent Storage Archival being skipped.
[    2.489849] systemd[1]: Starting Load/Save Random Seed...
[    2.491368] systemd[1]: Starting Create System Users...
[    2.502045] Adding 16777212k swap on /swapfile.  Priority:-2 extents:180 across:339705856k SSFS
[    2.502157] systemd[1]: Activated swap /swapfile.
[    2.502250] systemd[1]: Reached target Swap.
[    2.505037] systemd[1]: Finished Load/Save Random Seed.
[    2.509331] ACPI: bus type drm_connector registered
[    2.510138] systemd[1]: modprobe@drm.service: Succeeded.
[    2.510580] systemd[1]: Finished Load Kernel Module drm.
[    2.511179] systemd[1]: Finished Create System Users.
[    2.511262] lp: driver loaded but no devices found
[    2.512303] systemd[1]: Starting Create Static Device Nodes in /dev...
[    2.515127] ppdev: user-space parallel port driver
[    2.519873] parport0: PC-style at 0x278 [PCSPP,EPP]
[    2.522186] systemd[1]: Finished Set the console keyboard layout.
[    2.526894] systemd[1]: Finished Create Static Device Nodes in /dev.
[    2.527042] systemd[1]: Reached target Local File Systems (Pre).
[    2.532495] systemd[1]: Mounting Mount unit for bare, revision 5...
[    2.533943] systemd[1]: Mounting Mount unit for core18, revision 2714...
[    2.535154] systemd[1]: Mounting Mount unit for core18, revision 2721...
[    2.535783] loop0: detected capacity change from 0 to 113888
[    2.536662] systemd[1]: Mounting Mount unit for core20, revision 1828...
[    2.537973] systemd[1]: Mounting Mount unit for core20, revision 1852...
[    2.539487] systemd[1]: Mounting Mount unit for gnome-3-34-1804, revision 90...
[    2.542318] systemd[1]: Mounting Mount unit for gnome-3-34-1804, revision 93...
[    2.543411] systemd[1]: Mounting Mount unit for gnome-3-38-2004, revision 137...
[    2.544360] systemd[1]: Mounting Mount unit for gnome-3-38-2004, revision 140...
[    2.548919] systemd[1]: Mounting Mount unit for gtk-common-themes, revision 1534...
[    2.550090] systemd[1]: Mounting Mount unit for gtk-common-themes, revision 1535...
[    2.551892] systemd[1]: Mounting Mount unit for snap-store, revision 599...
[    2.553209] systemd[1]: Mounting Mount unit for snap-store, revision 638...
[    2.554933] systemd[1]: Mounting Mount unit for snapd, revision 18596...
[    2.556601] systemd[1]: Mounting Mount unit for snapd, revision 18933...
[    2.557870] systemd[1]: Starting udev Kernel Device Manager...
[    2.558335] systemd[1]: Started Journal Service.
[    2.558854] loop1: detected capacity change from 0 to 113896
[    2.558979] loop2: detected capacity change from 0 to 129672
[    2.559071] loop3: detected capacity change from 0 to 716160
[    2.575168] systemd-journald[302]: Received client request to flush runtime journal.
[    2.590607] loop4: detected capacity change from 0 to 8
[    2.590662] loop5: detected capacity change from 0 to 166424
[    2.590723] loop6: detected capacity change from 0 to 187776
[    2.590862] loop7: detected capacity change from 0 to 94056
[    2.591404] loop8: detected capacity change from 0 to 109032
[    2.614759] lp0: using parport0 (polling).
[    2.630903] loop10: detected capacity change from 0 to 102072
[    2.631297] loop9: detected capacity change from 0 to 447264
[    2.638332] loop11: detected capacity change from 0 to 94064
[    2.652107] loop13: detected capacity change from 0 to 129608
[    2.661822] loop12: detected capacity change from 0 to 447264
[    2.672371] loop14: detected capacity change from 0 to 716168
[    2.776408] input: Intel HID events as /devices/platform/INTC1070:00/input/input5
[    2.778739] intel-hid INTC1070:00: platform supports 5 button array
[    2.779122] Consider using thermal netlink events interface
[    2.780846] input: Intel HID 5 button array as /devices/platform/INTC1070:00/input/input6
[    2.806643] __spi_add_device( ) [667] cs[0] = [0]
[    2.806684] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    2.806687] spi_set_cs( ) [996] cs_num == [64]
[    2.815349] __spi_add_device( ) [667] cs[0] = [1]
[    2.815358] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    2.815360] spi_set_cs( ) [996] cs_num == [64]
[    2.821163] Serial bus multi instantiate pseudo device driver CSC3551:00: Instantiated 2 SPI devices.
[    2.859196] resource: resource sanity check: requesting [mem 0x00000000fedc0000-0x00000000fedcffff], which spans more than pnp 00:04 [mem 0xfedc0000-0xfedc7fff]
[    2.859208] caller igen6_probe+0x178/0x8e0 [igen6_edac] mapping multiple BARs
[    2.866789] EDAC MC0: Giving out device to module igen6_edac controller Intel_client_SoC MC#0: DEV 0000:00:00.0 (INTERRUPT)
[    2.909158] EDAC MC1: Giving out device to module igen6_edac controller Intel_client_SoC MC#1: DEV 0000:00:00.0 (INTERRUPT)
[    2.909218] EDAC igen6 MC1: HANDLING IBECC MEMORY ERROR
[    2.909222] EDAC igen6 MC1: ADDR 0x7fffffffe0
[    2.909226] EDAC igen6 MC0: HANDLING IBECC MEMORY ERROR
[    2.909228] EDAC igen6 MC0: ADDR 0x7fffffffe0
[    2.909324] EDAC igen6: v2.5
[    2.939565] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    2.940053] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    2.945979] mc: Linux media interface: v0.10
[    2.964974] dw-apb-uart.1: ttyS5 at MMIO 0x4017001000 (irq = 16, base_baud = 6250000) is a 16550A
[    2.972709] mei_me 0000:00:16.0: enabling device (0000 -> 0002)
[    2.977600] Intel(R) Wireless WiFi driver for Linux
[    2.978170] iwlwifi 0000:00:14.3: enabling device (0000 -> 0002)
[    3.024564] iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-so-a0-gf-a0-74.ucode failed with error -2
[    3.040495] Bluetooth: Core ver 2.22
[    3.040536] NET: Registered PF_BLUETOOTH protocol family
[    3.040539] Bluetooth: HCI device and connection manager initialized
[    3.040546] Bluetooth: HCI socket layer initialized
[    3.040551] Bluetooth: L2CAP socket layer initialized
[    3.040557] Bluetooth: SCO socket layer initialized
[    3.049529] usb-storage 4-3:1.0: USB Mass Storage device detected
[    3.050868] iwlwifi 0000:00:14.3: api flags index 2 larger than supported by driver
[    3.050900] iwlwifi 0000:00:14.3: TLV_FW_FSEQ_VERSION: FSEQ Version: 0.0.2.36
[    3.051611] iwlwifi 0000:00:14.3: loaded firmware version 73.35c0a2c6.0 so-a0-gf-a0-73.ucode op_mode iwlmvm
[    3.058495] scsi host0: usb-storage 4-3:1.0
[    3.059924] proc_thermal_pci 0000:00:04.0: enabling device (0000 -> 0002)
[    3.063831] usbcore: registered new interface driver usb-storage
[    3.067714] intel_rapl_common: Found RAPL domain package
[    3.070575] usbcore: registered new interface driver cdc_ether
[    3.075475] usbcore: registered new interface driver uas
[    3.077893] videodev: Linux video capture interface: v2.00
[    3.094941] RAPL PMU: API unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
[    3.094952] RAPL PMU: hw unit of domain pp0-core 2^-14 Joules
[    3.094955] RAPL PMU: hw unit of domain package 2^-14 Joules
[    3.094957] RAPL PMU: hw unit of domain pp1-gpu 2^-14 Joules
[    3.094959] RAPL PMU: hw unit of domain psys 2^-14 Joules
[    3.110632] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.110641] spi_set_cs( ) [996] cs_num == [64]
[    3.110974] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.110978] spi_set_cs( ) [996] cs_num == [64]
[    3.111019] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.111021] spi_set_cs( ) [996] cs_num == [64]
[    3.111268] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.111275] spi_set_cs( ) [996] cs_num == [64]
[    3.111348] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.111351] spi_set_cs( ) [996] cs_num == [64]
[    3.111570] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.111572] spi_set_cs( ) [996] cs_num == [64]
[    3.111603] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.111604] spi_set_cs( ) [996] cs_num == [64]
[    3.111815] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.111817] spi_set_cs( ) [996] cs_num == [64]
[    3.111850] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.111852] spi_set_cs( ) [996] cs_num == [64]
[    3.111967] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.111969] spi_set_cs( ) [996] cs_num == [64]
[    3.111995] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.111996] spi_set_cs( ) [996] cs_num == [64]
[    3.112110] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.112111] spi_set_cs( ) [996] cs_num == [64]
[    3.112156] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.112163] spi_set_cs( ) [996] cs_num == [64]
[    3.112280] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.112282] spi_set_cs( ) [996] cs_num == [64]
[    3.112306] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.112308] spi_set_cs( ) [996] cs_num == [64]
[    3.112405] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.112406] spi_set_cs( ) [996] cs_num == [64]
[    3.112430] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.112431] spi_set_cs( ) [996] cs_num == [64]
[    3.112531] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.112532] spi_set_cs( ) [996] cs_num == [64]
[    3.112555] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.112556] spi_set_cs( ) [996] cs_num == [64]
[    3.112640] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.112642] spi_set_cs( ) [996] cs_num == [64]
[    3.112665] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.112666] spi_set_cs( ) [996] cs_num == [64]
[    3.112750] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.112751] spi_set_cs( ) [996] cs_num == [64]
[    3.112774] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.112776] spi_set_cs( ) [996] cs_num == [64]
[    3.112873] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.112875] spi_set_cs( ) [996] cs_num == [64]
[    3.112898] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.112899] spi_set_cs( ) [996] cs_num == [64]
[    3.113000] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.113001] spi_set_cs( ) [996] cs_num == [64]
[    3.113025] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.113026] spi_set_cs( ) [996] cs_num == [64]
[    3.113124] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.113125] spi_set_cs( ) [996] cs_num == [64]
[    3.113148] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.113150] spi_set_cs( ) [996] cs_num == [64]
[    3.113233] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.113234] spi_set_cs( ) [996] cs_num == [64]
[    3.113257] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.113259] spi_set_cs( ) [996] cs_num == [64]
[    3.113378] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.113379] spi_set_cs( ) [996] cs_num == [64]
[    3.113457] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.113463] spi_set_cs( ) [996] cs_num == [64]
[    3.113600] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.113603] spi_set_cs( ) [996] cs_num == [64]
[    3.113642] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.113644] spi_set_cs( ) [996] cs_num == [64]
[    3.114872] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.114877] spi_set_cs( ) [996] cs_num == [64]
[    3.114921] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.114923] spi_set_cs( ) [996] cs_num == [64]
[    3.115407] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.115411] spi_set_cs( ) [996] cs_num == [64]
[    3.115444] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.115445] spi_set_cs( ) [996] cs_num == [64]
[    3.115666] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.115669] spi_set_cs( ) [996] cs_num == [64]
[    3.115727] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.115730] spi_set_cs( ) [996] cs_num == [64]
[    3.115850] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.115852] spi_set_cs( ) [996] cs_num == [64]
[    3.115880] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.115882] spi_set_cs( ) [996] cs_num == [64]
[    3.115999] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.116002] spi_set_cs( ) [996] cs_num == [64]
[    3.116058] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.116060] spi_set_cs( ) [996] cs_num == [64]
[    3.116297] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.116299] spi_set_cs( ) [996] cs_num == [64]
[    3.116330] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.116332] spi_set_cs( ) [996] cs_num == [64]
[    3.116541] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.116543] spi_set_cs( ) [996] cs_num == [64]
[    3.116572] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.116573] spi_set_cs( ) [996] cs_num == [64]
[    3.116699] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.116704] spi_set_cs( ) [996] cs_num == [64]
[    3.116743] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.116745] spi_set_cs( ) [996] cs_num == [64]
[    3.116974] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.116976] spi_set_cs( ) [996] cs_num == [64]
[    3.117007] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.117008] spi_set_cs( ) [996] cs_num == [64]
[    3.117220] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.117222] spi_set_cs( ) [996] cs_num == [64]
[    3.117251] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.117253] spi_set_cs( ) [996] cs_num == [64]
[    3.117497] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.117499] spi_set_cs( ) [996] cs_num == [64]
[    3.117530] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.117531] spi_set_cs( ) [996] cs_num == [64]
[    3.117746] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.117748] spi_set_cs( ) [996] cs_num == [64]
[    3.117776] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.117778] spi_set_cs( ) [996] cs_num == [64]
[    3.117946] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.117949] spi_set_cs( ) [996] cs_num == [64]
[    3.117978] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.117980] spi_set_cs( ) [996] cs_num == [64]
[    3.118200] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.118207] spi_set_cs( ) [996] cs_num == [64]
[    3.118255] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.118257] spi_set_cs( ) [996] cs_num == [64]
[    3.118409] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.118412] spi_set_cs( ) [996] cs_num == [64]
[    3.118443] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.118445] spi_set_cs( ) [996] cs_num == [64]
[    3.118564] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.118566] spi_set_cs( ) [996] cs_num == [64]
[    3.118603] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.118605] spi_set_cs( ) [996] cs_num == [64]
[    3.118846] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.118851] spi_set_cs( ) [996] cs_num == [64]
[    3.118890] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.118892] spi_set_cs( ) [996] cs_num == [64]
[    3.119104] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.119106] spi_set_cs( ) [996] cs_num == [64]
[    3.119136] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.119138] spi_set_cs( ) [996] cs_num == [64]
[    3.119350] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.119352] spi_set_cs( ) [996] cs_num == [64]
[    3.119387] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.119389] spi_set_cs( ) [996] cs_num == [64]
[    3.119534] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.119537] spi_set_cs( ) [996] cs_num == [64]
[    3.119569] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.119570] spi_set_cs( ) [996] cs_num == [64]
[    3.119827] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.119831] spi_set_cs( ) [996] cs_num == [64]
[    3.119866] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.119868] spi_set_cs( ) [996] cs_num == [64]
[    3.119988] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.119993] spi_set_cs( ) [996] cs_num == [64]
[    3.120061] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.120066] spi_set_cs( ) [996] cs_num == [64]
[    3.120184] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.120187] spi_set_cs( ) [996] cs_num == [64]
[    3.120224] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.120225] spi_set_cs( ) [996] cs_num == [64]
[    3.120341] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.120343] spi_set_cs( ) [996] cs_num == [64]
[    3.120370] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.120372] spi_set_cs( ) [996] cs_num == [64]
[    3.120487] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.120488] spi_set_cs( ) [996] cs_num == [64]
[    3.120515] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.120516] spi_set_cs( ) [996] cs_num == [64]
[    3.122420] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.122426] spi_set_cs( ) [996] cs_num == [64]
[    3.122474] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.122477] spi_set_cs( ) [996] cs_num == [64]
[    3.123777] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.123782] spi_set_cs( ) [996] cs_num == [64]
[    3.123820] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.123822] spi_set_cs( ) [996] cs_num == [64]
[    3.125120] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.125126] spi_set_cs( ) [996] cs_num == [64]
[    3.125163] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.125164] spi_set_cs( ) [996] cs_num == [64]
[    3.125289] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.125293] spi_set_cs( ) [996] cs_num == [64]
[    3.125353] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.125357] spi_set_cs( ) [996] cs_num == [64]
[    3.125478] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.125482] spi_set_cs( ) [996] cs_num == [64]
[    3.125521] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.125523] spi_set_cs( ) [996] cs_num == [64]
[    3.125845] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.125849] spi_set_cs( ) [996] cs_num == [64]
[    3.125886] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.125888] spi_set_cs( ) [996] cs_num == [64]
[    3.126007] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.126009] spi_set_cs( ) [996] cs_num == [64]
[    3.126037] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.126039] spi_set_cs( ) [996] cs_num == [64]
[    3.126158] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.126160] spi_set_cs( ) [996] cs_num == [64]
[    3.126188] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.126190] spi_set_cs( ) [996] cs_num == [64]
[    3.126228] usbcore: registered new interface driver btusb
[    3.126389] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.126391] spi_set_cs( ) [996] cs_num == [64]
[    3.126500] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.126503] spi_set_cs( ) [996] cs_num == [64]
[    3.128968] Bluetooth: hci0: Device revision is 0
[    3.128975] Bluetooth: hci0: Secure boot is enabled
[    3.128977] Bluetooth: hci0: OTP lock is enabled
[    3.128978] Bluetooth: hci0: API lock is enabled
[    3.128980] Bluetooth: hci0: Debug lock is disabled
[    3.128981] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[    3.128984] Bluetooth: hci0: Bootloader timestamp 2019.40 buildtype 1 build 38
[    3.130247] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.130255] spi_set_cs( ) [996] cs_num == [64]
[    3.130326] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.130328] spi_set_cs( ) [996] cs_num == [64]
[    3.130524] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.130527] spi_set_cs( ) [996] cs_num == [64]
[    3.130563] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.130565] spi_set_cs( ) [996] cs_num == [64]
[    3.130683] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.130685] spi_set_cs( ) [996] cs_num == [64]
[    3.130712] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.130714] spi_set_cs( ) [996] cs_num == [64]
[    3.130831] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.130833] spi_set_cs( ) [996] cs_num == [64]
[    3.130863] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.130865] spi_set_cs( ) [996] cs_num == [64]
[    3.131090] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.131095] spi_set_cs( ) [996] cs_num == [64]
[    3.131133] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.131136] spi_set_cs( ) [996] cs_num == [64]
[    3.133354] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.133360] spi_set_cs( ) [996] cs_num == [64]
[    3.133405] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.133407] spi_set_cs( ) [996] cs_num == [64]
[    3.133619] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.133621] spi_set_cs( ) [996] cs_num == [64]
[    3.133652] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.133653] spi_set_cs( ) [996] cs_num == [64]
[    3.133784] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.133790] spi_set_cs( ) [996] cs_num == [64]
[    3.133831] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.133833] spi_set_cs( ) [996] cs_num == [64]
[    3.138406] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.138411] spi_set_cs( ) [996] cs_num == [64]
[    3.138451] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.138452] spi_set_cs( ) [996] cs_num == [64]
[    3.138690] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.138695] spi_set_cs( ) [996] cs_num == [64]
[    3.138735] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.138737] spi_set_cs( ) [996] cs_num == [64]
[    3.138873] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.138875] spi_set_cs( ) [996] cs_num == [64]
[    3.138902] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.138903] spi_set_cs( ) [996] cs_num == [64]
[    3.139023] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.139024] spi_set_cs( ) [996] cs_num == [64]
[    3.139050] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.139051] spi_set_cs( ) [996] cs_num == [64]
[    3.139172] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.139173] spi_set_cs( ) [996] cs_num == [64]
[    3.139199] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.139200] spi_set_cs( ) [996] cs_num == [64]
[    3.139320] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.139322] spi_set_cs( ) [996] cs_num == [64]
[    3.139350] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.139351] spi_set_cs( ) [996] cs_num == [64]
[    3.139566] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.139569] spi_set_cs( ) [996] cs_num == [64]
[    3.139596] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.139597] spi_set_cs( ) [996] cs_num == [64]
[    3.139717] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.139718] spi_set_cs( ) [996] cs_num == [64]
[    3.139744] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.139745] spi_set_cs( ) [996] cs_num == [64]
[    3.139864] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.139865] spi_set_cs( ) [996] cs_num == [64]
[    3.139891] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.139892] spi_set_cs( ) [996] cs_num == [64]
[    3.140011] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.140013] spi_set_cs( ) [996] cs_num == [64]
[    3.140039] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.140041] spi_set_cs( ) [996] cs_num == [64]
[    3.140237] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.140239] spi_set_cs( ) [996] cs_num == [64]
[    3.140265] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.140267] spi_set_cs( ) [996] cs_num == [64]
[    3.140439] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.140444] spi_set_cs( ) [996] cs_num == [64]
[    3.140482] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.140484] spi_set_cs( ) [996] cs_num == [64]
[    3.140602] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.140604] spi_set_cs( ) [996] cs_num == [64]
[    3.140631] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.140632] spi_set_cs( ) [996] cs_num == [64]
[    3.142243] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.142249] spi_set_cs( ) [996] cs_num == [64]
[    3.142378] Bluetooth: hci0: Found device firmware: intel/ibt-0040-0041.sfi
[    3.142454] Bluetooth: hci0: Boot Address: 0x100800
[    3.142458] Bluetooth: hci0: Firmware Version: 118-22.22
[    3.143544] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.143550] spi_set_cs( ) [996] cs_num == [64]
[    3.143735] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.143738] spi_set_cs( ) [996] cs_num == [64]
[    3.143783] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.143787] spi_set_cs( ) [996] cs_num == [64]
[    3.146162] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.146172] spi_set_cs( ) [996] cs_num == [64]
[    3.146228] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.146232] spi_set_cs( ) [996] cs_num == [64]
[    3.146379] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.146384] spi_set_cs( ) [996] cs_num == [64]
[    3.146459] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.146464] spi_set_cs( ) [996] cs_num == [64]
[    3.146621] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.146626] spi_set_cs( ) [996] cs_num == [64]
[    3.146648] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.146652] spi_set_cs( ) [996] cs_num == [64]
[    3.146791] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.146797] spi_set_cs( ) [996] cs_num == [64]
[    3.146838] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.146840] spi_set_cs( ) [996] cs_num == [64]
[    3.147021] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.147024] spi_set_cs( ) [996] cs_num == [64]
[    3.147063] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.147066] spi_set_cs( ) [996] cs_num == [64]
[    3.147455] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.147458] spi_set_cs( ) [996] cs_num == [64]
[    3.147562] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.147566] spi_set_cs( ) [996] cs_num == [64]
[    3.147737] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.147740] spi_set_cs( ) [996] cs_num == [64]
[    3.147815] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.147819] spi_set_cs( ) [996] cs_num == [64]
[    3.148143] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.148152] spi_set_cs( ) [996] cs_num == [64]
[    3.148202] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.148206] spi_set_cs( ) [996] cs_num == [64]
[    3.148379] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.148386] spi_set_cs( ) [996] cs_num == [64]
[    3.148423] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.148425] spi_set_cs( ) [996] cs_num == [64]
[    3.150547] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.150552] spi_set_cs( ) [996] cs_num == [64]
[    3.150587] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.150589] spi_set_cs( ) [996] cs_num == [64]
[    3.151169] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.151176] spi_set_cs( ) [996] cs_num == [64]
[    3.151224] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.151227] spi_set_cs( ) [996] cs_num == [64]
[    3.151562] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.151566] spi_set_cs( ) [996] cs_num == [64]
[    3.151604] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.151607] spi_set_cs( ) [996] cs_num == [64]
[    3.151988] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.151996] spi_set_cs( ) [996] cs_num == [64]
[    3.152046] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.152050] spi_set_cs( ) [996] cs_num == [64]
[    3.152218] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.152223] spi_set_cs( ) [996] cs_num == [64]
[    3.152274] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.152277] spi_set_cs( ) [996] cs_num == [64]
[    3.152469] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.152471] spi_set_cs( ) [996] cs_num == [64]
[    3.152512] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.152515] spi_set_cs( ) [996] cs_num == [64]
[    3.152653] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.152655] spi_set_cs( ) [996] cs_num == [64]
[    3.152685] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.152687] spi_set_cs( ) [996] cs_num == [64]
[    3.152852] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.152856] spi_set_cs( ) [996] cs_num == [64]
[    3.152899] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.152900] spi_set_cs( ) [996] cs_num == [64]
[    3.153168] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.153176] spi_set_cs( ) [996] cs_num == [64]
[    3.153237] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.153239] spi_set_cs( ) [996] cs_num == [64]
[    3.153371] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.153374] spi_set_cs( ) [996] cs_num == [64]
[    3.153413] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.153416] spi_set_cs( ) [996] cs_num == [64]
[    3.153603] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.153611] spi_set_cs( ) [996] cs_num == [64]
[    3.153647] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.153651] spi_set_cs( ) [996] cs_num == [64]
[    3.153930] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.153933] spi_set_cs( ) [996] cs_num == [64]
[    3.153971] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.153973] spi_set_cs( ) [996] cs_num == [64]
[    3.154096] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.154101] spi_set_cs( ) [996] cs_num == [64]
[    3.154134] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.154136] spi_set_cs( ) [996] cs_num == [64]
[    3.154313] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.154322] spi_set_cs( ) [996] cs_num == [64]
[    3.154429] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.154433] spi_set_cs( ) [996] cs_num == [64]
[    3.154581] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.154586] spi_set_cs( ) [996] cs_num == [64]
[    3.154634] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.154638] spi_set_cs( ) [996] cs_num == [64]
[    3.154964] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.154969] spi_set_cs( ) [996] cs_num == [64]
[    3.155016] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.155018] spi_set_cs( ) [996] cs_num == [64]
[    3.155175] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.155179] spi_set_cs( ) [996] cs_num == [64]
[    3.155246] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.155250] spi_set_cs( ) [996] cs_num == [64]
[    3.155442] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.155448] spi_set_cs( ) [996] cs_num == [64]
[    3.155470] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.155472] spi_set_cs( ) [996] cs_num == [64]
[    3.156109] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.156114] spi_set_cs( ) [996] cs_num == [64]
[    3.156153] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.156157] spi_set_cs( ) [996] cs_num == [64]
[    3.156583] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.156588] spi_set_cs( ) [996] cs_num == [64]
[    3.156632] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.156636] spi_set_cs( ) [996] cs_num == [64]
[    3.156768] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.156771] spi_set_cs( ) [996] cs_num == [64]
[    3.156808] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.156811] spi_set_cs( ) [996] cs_num == [64]
[    3.156929] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.156933] spi_set_cs( ) [996] cs_num == [64]
[    3.156958] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.156960] spi_set_cs( ) [996] cs_num == [64]
[    3.157122] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.157126] spi_set_cs( ) [996] cs_num == [64]
[    3.157164] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.157167] spi_set_cs( ) [996] cs_num == [64]
[    3.157434] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.157439] spi_set_cs( ) [996] cs_num == [64]
[    3.157478] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.157482] spi_set_cs( ) [996] cs_num == [64]
[    3.157715] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.157720] spi_set_cs( ) [996] cs_num == [64]
[    3.157770] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.157772] spi_set_cs( ) [996] cs_num == [64]
[    3.157977] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.157985] spi_set_cs( ) [996] cs_num == [64]
[    3.158026] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.158029] spi_set_cs( ) [996] cs_num == [64]
[    3.158460] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.158464] spi_set_cs( ) [996] cs_num == [64]
[    3.158503] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.158505] spi_set_cs( ) [996] cs_num == [64]
[    3.158555] cryptd: max_cpu_qlen set to 1000
[    3.158870] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.158874] spi_set_cs( ) [996] cs_num == [64]
[    3.158906] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.158908] spi_set_cs( ) [996] cs_num == [64]
[    3.159037] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.159044] spi_set_cs( ) [996] cs_num == [64]
[    3.159083] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.159085] spi_set_cs( ) [996] cs_num == [64]
[    3.159295] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.159297] spi_set_cs( ) [996] cs_num == [64]
[    3.159330] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.159331] spi_set_cs( ) [996] cs_num == [64]
[    3.159523] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.159525] spi_set_cs( ) [996] cs_num == [64]
[    3.159557] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.159559] spi_set_cs( ) [996] cs_num == [64]
[    3.159742] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.159744] spi_set_cs( ) [996] cs_num == [64]
[    3.159775] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.159777] spi_set_cs( ) [996] cs_num == [64]
[    3.159984] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.159986] spi_set_cs( ) [996] cs_num == [64]
[    3.160017] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.160018] spi_set_cs( ) [996] cs_num == [64]
[    3.160123] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.160125] spi_set_cs( ) [996] cs_num == [64]
[    3.160153] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.160155] spi_set_cs( ) [996] cs_num == [64]
[    3.160327] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.160331] spi_set_cs( ) [996] cs_num == [64]
[    3.160362] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.160363] spi_set_cs( ) [996] cs_num == [64]
[    3.160805] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.160811] spi_set_cs( ) [996] cs_num == [64]
[    3.160851] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.160854] spi_set_cs( ) [996] cs_num == [64]
[    3.160975] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.160982] spi_set_cs( ) [996] cs_num == [64]
[    3.161127] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.161131] spi_set_cs( ) [996] cs_num == [64]
[    3.162050] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.162056] spi_set_cs( ) [996] cs_num == [64]
[    3.162085] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.162086] spi_set_cs( ) [996] cs_num == [64]
[    3.162205] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.162207] spi_set_cs( ) [996] cs_num == [64]
[    3.162235] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.162236] spi_set_cs( ) [996] cs_num == [64]
[    3.163188] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.163193] spi_set_cs( ) [996] cs_num == [64]
[    3.163228] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.163230] spi_set_cs( ) [996] cs_num == [64]
[    3.163368] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.163373] spi_set_cs( ) [996] cs_num == [64]
[    3.163414] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.163416] spi_set_cs( ) [996] cs_num == [64]
[    3.163537] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.163543] spi_set_cs( ) [996] cs_num == [64]
[    3.163577] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.163579] spi_set_cs( ) [996] cs_num == [64]
[    3.163697] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.163699] spi_set_cs( ) [996] cs_num == [64]
[    3.163727] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.163728] spi_set_cs( ) [996] cs_num == [64]
[    3.163843] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.163845] spi_set_cs( ) [996] cs_num == [64]
[    3.163874] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.163876] spi_set_cs( ) [996] cs_num == [64]
[    3.164506] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.164512] spi_set_cs( ) [996] cs_num == [64]
[    3.164550] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.164552] spi_set_cs( ) [996] cs_num == [64]
[    3.168949] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.168958] spi_set_cs( ) [996] cs_num == [64]
[    3.168998] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.169000] spi_set_cs( ) [996] cs_num == [64]
[    3.169148] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.169150] spi_set_cs( ) [996] cs_num == [64]
[    3.169174] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.169177] spi_set_cs( ) [996] cs_num == [64]
[    3.172825] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.172834] spi_set_cs( ) [996] cs_num == [64]
[    3.177175] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.177184] spi_set_cs( ) [996] cs_num == [64]
[    3.177363] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.177366] spi_set_cs( ) [996] cs_num == [64]
[    3.177396] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.177398] spi_set_cs( ) [996] cs_num == [64]
[    3.177525] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.177533] spi_set_cs( ) [996] cs_num == [64]
[    3.177575] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.177578] spi_set_cs( ) [996] cs_num == [64]
[    3.177686] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.177689] spi_set_cs( ) [996] cs_num == [64]
[    3.178751] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.178756] spi_set_cs( ) [996] cs_num == [64]
[    3.178907] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.178909] spi_set_cs( ) [996] cs_num == [64]
[    3.179443] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.179450] spi_set_cs( ) [996] cs_num == [64]
[    3.179582] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.179590] spi_set_cs( ) [996] cs_num == [64]
[    3.179942] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.179946] spi_set_cs( ) [996] cs_num == [64]
[    3.180067] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.180069] spi_set_cs( ) [996] cs_num == [64]
[    3.180600] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.180604] spi_set_cs( ) [996] cs_num == [64]
[    3.180730] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.180736] spi_set_cs( ) [996] cs_num == [64]
[    3.181519] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.181524] spi_set_cs( ) [996] cs_num == [64]
[    3.181667] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.181670] spi_set_cs( ) [996] cs_num == [64]
[    3.188133] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.188145] spi_set_cs( ) [996] cs_num == [64]
[    3.189334] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.189344] spi_set_cs( ) [996] cs_num == [64]
[    3.189441] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.189445] spi_set_cs( ) [996] cs_num == [64]
[    3.189595] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.189605] spi_set_cs( ) [996] cs_num == [64]
[    3.189647] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.0: Cirrus Logic CS35L41 (35a40), Revision: B2
[    3.213397] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.1: Reset line busy, assuming shared reset
[    3.215536] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.215542] spi_set_cs( ) [996] cs_num == [64]
[    3.215772] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.215775] spi_set_cs( ) [996] cs_num == [64]
[    3.215811] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.215812] spi_set_cs( ) [996] cs_num == [64]
[    3.216027] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.216029] spi_set_cs( ) [996] cs_num == [64]
[    3.216057] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.1: OTP Boot status 80000000 error: 0
[    3.216068] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.216069] spi_set_cs( ) [996] cs_num == [64]
[    3.216185] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.216187] spi_set_cs( ) [996] cs_num == [64]
[    3.216214] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.216215] spi_set_cs( ) [996] cs_num == [64]
[    3.216328] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.216329] spi_set_cs( ) [996] cs_num == [64]
[    3.216353] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.216354] spi_set_cs( ) [996] cs_num == [64]
[    3.216470] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.216471] spi_set_cs( ) [996] cs_num == [64]
[    3.216499] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.216500] spi_set_cs( ) [996] cs_num == [64]
[    3.216616] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.216617] spi_set_cs( ) [996] cs_num == [64]
[    3.226445] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.226455] spi_set_cs( ) [996] cs_num == [64]
[    3.226611] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.226621] spi_set_cs( ) [996] cs_num == [64]
[    3.226738] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.226743] spi_set_cs( ) [996] cs_num == [64]
[    3.226883] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.226887] spi_set_cs( ) [996] cs_num == [64]
[    3.226926] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.226928] spi_set_cs( ) [996] cs_num == [64]
[    3.227063] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.227071] spi_set_cs( ) [996] cs_num == [64]
[    3.227101] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.227103] spi_set_cs( ) [996] cs_num == [64]
[    3.227269] AVX2 version of gcm_enc/dec engaged.
[    3.227281] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.227284] spi_set_cs( ) [996] cs_num == [64]
[    3.227369] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.227370] spi_set_cs( ) [996] cs_num == [64]
[    3.227439] AES CTR mode by8 optimization enabled
[    3.227564] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    3.227566] spi_set_cs( ) [996] cs_num == [64]
[    3.227580] cs35l41-hda: probe of spi0-CSC3551:00-cs35l41-hda.1 failed with error -5
[    3.230509] iwlwifi 0000:00:14.3: Detected Intel(R) Wi-Fi 6E AX211 160MHz, REV=0x370
[    3.231071] usb 2-1: Found UVC 1.50 device HP 5MP Camera (30c9:0040)
[    3.241789] snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    3.243320] snd_hda_intel 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[    3.256887] cdc_ncm 3-1:2.0: MAC-Address: f8:e4:3b:77:37:6a
[    3.256897] cdc_ncm 3-1:2.0: setting rx_max = 16384
[    3.268431] cdc_ncm 3-1:2.0: setting tx_max = 16384
[    3.270257] thermal thermal_zone6: failed to read out thermal zone (-61)
[    3.333927] usb 2-1: Found UVC 1.50 device HP 5MP Camera (30c9:0040)
[    3.354453] usbcore: registered new interface driver uvcvideo
[    3.429920] iwlwifi 0000:00:14.3: WFPM_UMAC_PD_NOTIFICATION: 0x1f
[    3.429981] iwlwifi 0000:00:14.3: WFPM_LMAC2_PD_NOTIFICATION: 0x1f
[    3.429991] iwlwifi 0000:00:14.3: WFPM_AUTH_KEY_0: 0x80
[    3.430001] iwlwifi 0000:00:14.3: CNVI_SCU_SEQ_DATA_DW9: 0x0
[    3.431009] iwlwifi 0000:00:14.3: loaded PNVM version 881c99e1
[    3.442526] iwlwifi 0000:00:14.3: Detected RF GF, rfid=0x2010d000
[    3.511475] iwlwifi 0000:00:14.3: base HW address: ac:82:47:d7:75:5d
[    3.526741] cdc_ncm 3-1:2.0 eth0: register 'cdc_ncm' at usb-0000:00:0d.0-1, CDC NCM (NO ZLP), f8:e4:3b:77:37:6a
[    3.531963] iwlwifi 0000:00:14.3 wlp0s20f3: renamed from wlan0
[    3.540603] usbcore: registered new interface driver cdc_ncm
[    3.574970] intel_rapl_msr: PL4 support detected.
[    3.577882] usbcore: registered new interface driver cdc_wdm
[    3.579026] intel_rapl_common: Found RAPL domain package
[    3.579035] intel_rapl_common: Found RAPL domain core
[    3.579038] intel_rapl_common: Found RAPL domain uncore
[    3.579044] intel_rapl_common: Found RAPL domain psys
[    3.630357] i915 0000:00:02.0: [drm] VT-d active for gfx access
[    3.632288] Console: switching to colour dummy device 80x25
[    3.632525] i915 0000:00:02.0: vgaarb: deactivate vga console
[    3.632815] i915 0000:00:02.0: [drm] Using Transparent Hugepages
[    3.633712] i915 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem
[    3.636763] mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_component_ops [i915])
[    3.638268] i915 0000:00:02.0: Direct firmware load for i915/adlp_dmc.bin failed with error -2
[    3.642032] i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/adlp_dmc_ver2_16.bin (v2.16)
[    3.643186] usbcore: registered new interface driver cdc_mbim
[    3.652348] i915 0000:00:02.0: [drm] GuC firmware i915/adlp_guc_70.bin (70.5) is recommended, but only i915/adlp_guc_70.1.1.bin (70.1) was found
[    3.652353] i915 0000:00:02.0: [drm] Consider updating your linux-firmware pkg or downloading from https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/i915
[    3.659411] i915 0000:00:02.0: [drm] HuC firmware i915/tgl_huc.bin (0.0) is recommended, but only i915/tgl_huc_7.9.3.bin (7.9) was found
[    3.659414] i915 0000:00:02.0: [drm] Consider updating your linux-firmware pkg or downloading from https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/i915
[    3.663509] i915 0000:00:02.0: [drm] GT0: GuC firmware i915/adlp_guc_70.1.1.bin version 70.1.1
[    3.663518] i915 0000:00:02.0: [drm] GT0: HuC firmware i915/tgl_huc_7.9.3.bin version 7.9.3
[    3.674431] cdc_ncm 3-1:2.0 enxf8e43b77376a: renamed from eth0
[    3.686378] i915 0000:00:02.0: [drm] HuC authenticated
[    3.686726] i915 0000:00:02.0: [drm] GT0: GuC submission enabled
[    3.686730] i915 0000:00:02.0: [drm] GT0: GuC SLPC enabled
[    3.687165] i915 0000:00:02.0: [drm] GuC RC: enabled
[    3.736833] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    3.736966] sof-audio-pci-intel-tgl 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[    3.736993] sof-audio-pci-intel-tgl 0000:00:1f.3: enabling device (0000 -> 0002)
[    3.737306] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[    4.098496] scsi 0:0:0:0: Direct-Access     Generic- SD/MMC/MS/MSPRO  1.00 PQ: 0 ANSI: 6
[    4.098661] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    4.104918] audit: type=1400 audit(1682687510.571:2): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe" pid=553 comm="apparmor_parser"
[    4.104928] audit: type=1400 audit(1682687510.571:3): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe//kmod" pid=553 comm="apparmor_parser"
[    4.105079] audit: type=1400 audit(1682687510.571:4): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libreoffice-xpdfimport" pid=550 comm="apparmor_parser"
[    4.105152] audit: type=1400 audit(1682687510.571:5): apparmor="STATUS" operation="profile_load" profile="unconfined" name="ippusbxd" pid=559 comm="apparmor_parser"
[    4.105279] audit: type=1400 audit(1682687510.571:6): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libreoffice-senddoc" pid=554 comm="apparmor_parser"
[    4.105377] audit: type=1400 audit(1682687510.571:7): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libreoffice-oopslash" pid=552 comm="apparmor_parser"
[    4.105932] audit: type=1400 audit(1682687510.571:8): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/bin/man" pid=555 comm="apparmor_parser"
[    4.105939] audit: type=1400 audit(1682687510.571:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="man_filter" pid=555 comm="apparmor_parser"
[    4.105943] audit: type=1400 audit(1682687510.571:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="man_groff" pid=555 comm="apparmor_parser"
[    4.732949] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    4.732954] Bluetooth: BNEP filters: protocol multicast
[    4.732959] Bluetooth: BNEP socket layer initialized
[    4.738735] Bluetooth: hci0: Waiting for firmware download to complete
[    4.739055] Bluetooth: hci0: Firmware loaded in 1559248 usecs
[    4.739150] Bluetooth: hci0: Waiting for device to boot
[    4.757059] Bluetooth: hci0: Device booted in 17536 usecs
[    4.757067] Bluetooth: hci0: Malformed MSFT vendor event: 0x02
[    4.770752] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-0040-0041.ddc
[    4.773091] Bluetooth: hci0: Applying Intel DDC parameters completed
[    4.777768] Bluetooth: hci0: PPAG-BT Domain disabled
[    4.780067] Bluetooth: hci0: Firmware timestamp 2022.22 buildtype 1 build 44918
[    4.807673] [drm] Initialized i915 1.6.0 20201103 for 0000:00:02.0 on minor 0
[    4.810188] ACPI: video: Video Device [GFX0] (multi-head: yes  rom: no  post: no)
[    4.810987] input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input7
[    4.811304] sof-audio-pci-intel-tgl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    4.816665] fbcon: i915drmfb (fb0) is primary device
[    4.821162] Console: switching to colour frame buffer device 240x75
[    4.840642] i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device
[    4.879410] sd 0:0:0:0: [sda] 61063168 512-byte logical blocks: (31.3 GB/29.1 GiB)
[    4.879828] sd 0:0:0:0: [sda] Write Protect is off
[    4.879832] sd 0:0:0:0: [sda] Mode Sense: 2f 00 00 00
[    4.880119] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[    4.883108] sd 0:0:0:0: [sda] Attached SCSI disk
[    4.889960] Bluetooth: MGMT ver 1.22
[    4.894699] sof-audio-pci-intel-tgl 0000:00:1f.3: use msi interrupt mode
[    4.900473] NET: Registered PF_ALG protocol family
[    4.973168] sof-audio-pci-intel-tgl 0000:00:1f.3: hda codecs found, mask 5
[    4.973177] sof-audio-pci-intel-tgl 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[    4.973183] sof-audio-pci-intel-tgl 0000:00:1f.3: DMICs detected in NHLT tables: 2
[    5.004422] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 1:8:0-f9f4a
[    5.004430] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:18:1 Kernel ABI 3:23:0
[    5.004439] sof-audio-pci-intel-tgl 0000:00:1f.3: unknown sof_ext_man header type 3 size 0x30
[    5.109975] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 1:8:0-f9f4a
[    5.109986] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:18:1 Kernel ABI 3:23:0
[    5.132881] iwlwifi 0000:00:14.3: WFPM_UMAC_PD_NOTIFICATION: 0x1f
[    5.132933] iwlwifi 0000:00:14.3: WFPM_LMAC2_PD_NOTIFICATION: 0x1f
[    5.132943] iwlwifi 0000:00:14.3: WFPM_AUTH_KEY_0: 0x80
[    5.132993] iwlwifi 0000:00:14.3: CNVI_SCU_SEQ_DATA_DW9: 0x0
[    5.134470] sof-audio-pci-intel-tgl 0000:00:1f.3: Topology: ABI 3:18:1 Kernel ABI 3:23:0
[    5.134888] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Parent card not yet available, widget card binding deferred
[    5.199811] snd_hda_codec_realtek ehdaudio0D0: autoconfig for ALC245: line_outs=1 (0x17/0x0/0x0/0x0/0x0) type:speaker
[    5.199823] snd_hda_codec_realtek ehdaudio0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    5.199827] snd_hda_codec_realtek ehdaudio0D0:    hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[    5.199831] snd_hda_codec_realtek ehdaudio0D0:    mono: mono_out=0x0
[    5.199833] snd_hda_codec_realtek ehdaudio0D0:    inputs:
[    5.199835] snd_hda_codec_realtek ehdaudio0D0:      Mic=0x19
[    5.254779] snd_hda_codec_realtek ehdaudio0D0: ASoC: sink widget AIF1TX overwritten
[    5.254804] snd_hda_codec_realtek ehdaudio0D0: ASoC: source widget AIF1RX overwritten
[    5.255028] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi3 overwritten
[    5.255035] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi2 overwritten
[    5.255038] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi1 overwritten
[    5.255042] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Codec Output Pin1 overwritten
[    5.255045] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Codec Input Pin1 overwritten
[    5.255050] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Analog Codec Playback overwritten
[    5.255054] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Digital Codec Playback overwritten
[    5.255059] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Alt Analog Codec Playback overwritten
[    5.255064] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Analog Codec Capture overwritten
[    5.255069] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Digital Codec Capture overwritten
[    5.255073] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Alt Analog Codec Capture overwritten
[    5.255083] skl_hda_dsp_generic skl_hda_dsp_generic: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 3
[    5.280471] input: sof-hda-dsp Mic as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input8
[    5.280545] input: sof-hda-dsp Headphone as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input9
[    5.280598] input: sof-hda-dsp HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input10
[    5.280638] input: sof-hda-dsp HDMI/DP,pcm=4 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input11
[    5.280726] input: sof-hda-dsp HDMI/DP,pcm=5 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input12
[    5.895943] Bluetooth: RFCOMM TTY layer initialized
[    5.895953] Bluetooth: RFCOMM socket layer initialized
[    5.895961] Bluetooth: RFCOMM ver 1.11
[    6.051348] loop15: detected capacity change from 0 to 8
[    6.052164] IPv6: ADDRCONF(NETDEV_CHANGE): enxf8e43b77376a: link becomes ready
[    6.922698] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.922704] spi_set_cs( ) [996] cs_num == [64]
[    6.923011] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.923014] spi_set_cs( ) [996] cs_num == [64]
[    6.923034] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.923035] spi_set_cs( ) [996] cs_num == [64]
[    6.923243] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.923246] spi_set_cs( ) [996] cs_num == [64]
[    6.923264] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.923265] spi_set_cs( ) [996] cs_num == [64]
[    6.923467] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.923470] spi_set_cs( ) [996] cs_num == [64]
[    6.923491] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.923491] spi_set_cs( ) [996] cs_num == [64]
[    6.923681] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.923684] spi_set_cs( ) [996] cs_num == [64]
[    6.934603] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.934617] spi_set_cs( ) [996] cs_num == [64]
[    6.934887] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.934899] spi_set_cs( ) [996] cs_num == [64]
[    6.934943] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.934945] spi_set_cs( ) [996] cs_num == [64]
[    6.935210] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.935222] spi_set_cs( ) [996] cs_num == [64]
[    6.935260] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.935263] spi_set_cs( ) [996] cs_num == [64]
[    6.935510] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.935522] spi_set_cs( ) [996] cs_num == [64]
[    6.935560] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.935563] spi_set_cs( ) [996] cs_num == [64]
[    6.935802] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.935815] spi_set_cs( ) [996] cs_num == [64]
[    6.935853] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.935856] spi_set_cs( ) [996] cs_num == [64]
[    6.940878] spi_set_cs( ) [995] spi->cs_index_mask == [0]
[    6.940887] spi_set_cs( ) [996] cs_num == [64]
[    9.496086] rfkill: input handler disabled
[    9.684991] kauditd_printk_skb: 28 callbacks suppressed
[    9.684995] audit: type=1400 audit(1682687516.151:39): apparmor="DENIED" operation="capable" class="cap" profile="/snap/snapd/18933/usr/lib/snapd/snap-confine" pid=1564 comm="snap-confine" capability=4  capname="fsetid"
[   11.911328] audit: type=1326 audit(1682687518.379:40): auid=1000 uid=1000 gid=1000 ses=2 subj=snap.snap-store.snap-store pid=1564 comm="snap-store" exe="/snap/snap-store/638/usr/bin/snap-store" sig=0 arch=c000003e syscall=314 compat=0 ip=0x7f04fb64073d code=0x50000
[   16.078771] audit: type=1400 audit(1682687522.547:41): apparmor="DENIED" operation="open" class="file" profile="snap.snap-store.snap-store" name="/etc/PackageKit/Vendor.conf" pid=1564 comm="snap-store" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[   16.333813] audit: type=1400 audit(1682687522.799:42): apparmor="DENIED" operation="open" class="file" profile="snap.snap-store.snap-store" name="/etc/appstream.conf" pid=1564 comm="snap-store" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 04d7322170c4a..69580f134b440 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -662,8 +662,12 @@ static int __spi_add_device(struct spi_device *spi)
        }

        if (ctlr->cs_gpiods) {
-               for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
-                       spi_set_csgpiod(spi, idx, ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]);
+               for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
+                       if (!(idx != 0 && !spi_get_chipselect(spi, idx))) {
+                               printk("%s( ) [%d] cs[%d] = [%d]\n", __func__, __LINE__, idx, spi_get_chipselect(spi, idx));
+                               spi_set_csgpiod(spi, idx, ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]);
+                       }
+               }
        }

        /*
@@ -988,6 +992,9 @@ static void spi_set_cs(struct spi_device *spi, bool enable, bool force)
        u32 cs_num = __ffs(spi->cs_index_mask);
        int idx;

+       printk("%s( ) [%d] spi->cs_index_mask == [%d]\n", __func__, __LINE__, spi->cs_index_mask);
+       printk("%s( ) [%d] cs_num == [%d]\n", __func__, __LINE__, cs_num);
+
        /*
         * In parallel mode all the chip selects are asserted/de-asserted
         * at once
[    0.000000] Linux version 6.3.0+ (sbinding@sbinding-cirrus-dsktp2) (gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #35 SMP PREEMPT_DYNAMIC Fri Apr 28 11:33:52 BST 2023
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-6.3.0+ root=UUID=2aec303b-7cd8-4d6f-8da6-b19769ec6332 ro quiet splash resume=UUID=2aec303b-7cd8-4d6f-8da6-b19769ec6332 resume_offset=17821696 vt.handoff=7
[    0.000000] KERNEL supported cpus:
[    0.000000]   Intel GenuineIntel
[    0.000000]   AMD AuthenticAMD
[    0.000000]   Hygon HygonGenuine
[    0.000000]   Centaur CentaurHauls
[    0.000000]   zhaoxin   Shanghai
[    0.000000] x86/split lock detection: #AC: crashing the kernel on kernel split_locks and warning on user-space split_locks
[    0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[    0.000000] x86/fpu: Supporting XSAVE feature 0x200: 'Protection Keys User registers'
[    0.000000] x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
[    0.000000] x86/fpu: xstate_offset[9]:  832, xstate_sizes[9]:    8
[    0.000000] x86/fpu: Enabled xstate features 0x207, context size is 840 bytes, using 'compacted' format.
[    0.000000] signal: max sigframe size: 3632
[    0.000000] BIOS-provided physical RAM map:
[    0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009efff] usable
[    0.000000] BIOS-e820: [mem 0x000000000009f000-0x00000000000fffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000003c0d2fff] usable
[    0.000000] BIOS-e820: [mem 0x000000003c0d3000-0x000000003f927fff] reserved
[    0.000000] BIOS-e820: [mem 0x000000003f928000-0x000000003fb27fff] ACPI NVS
[    0.000000] BIOS-e820: [mem 0x000000003fb28000-0x000000003fbfefff] ACPI data
[    0.000000] BIOS-e820: [mem 0x000000003fbff000-0x000000003fbfffff] usable
[    0.000000] BIOS-e820: [mem 0x000000003fc00000-0x0000000045ffffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000046e00000-0x0000000046ffffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000048000000-0x00000000507fffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000c0000000-0x00000000cfffffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000fed20000-0x00000000fed7ffff] reserved
[    0.000000] BIOS-e820: [mem 0x00000000ff800000-0x00000000ffffffff] reserved
[    0.000000] BIOS-e820: [mem 0x0000000100000000-0x00000004af7fffff] usable
[    0.000000] NX (Execute Disable) protection: active
[    0.000000] efi: EFI v2.7 by HP
[    0.000000] efi: ACPI=0x3fbfe000 ACPI 2.0=0x3fbfe014 TPMFinalLog=0x3faa5000 SMBIOS=0x3c89d000 ESRT=0x3c897218 MEMATTR=0x34c47018 MOKvar=0x34c49000 RNG=0x3fb52018 TPMEventLog=0x34c18018
[    0.000000] random: crng init done
[    0.000000] efi: Remove mem431: MMIO range=[0xc0000000-0xcfffffff] (256MB) from e820 map
[    0.000000] e820: remove [mem 0xc0000000-0xcfffffff] reserved
[    0.000000] efi: Remove mem433: MMIO range=[0xff800000-0xffffffff] (8MB) from e820 map
[    0.000000] e820: remove [mem 0xff800000-0xffffffff] reserved
[    0.000000] SMBIOS 3.3 present.
[    0.000000] DMI: HP /896D, BIOS U70 Ver. 89.33.02 10/29/2021
[    0.000000] tsc: Detected 1200.000 MHz processor
[    0.000000] tsc: Detected 1190.400 MHz TSC
[    0.000004] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved
[    0.000006] e820: remove [mem 0x000a0000-0x000fffff] usable
[    0.000010] last_pfn = 0x4af800 max_arch_pfn = 0x400000000
[    0.000014] x86/PAT: Configuration [0-7]: WB  WC  UC- UC  WB  WP  UC- WT
[    0.000373] last_pfn = 0x3fc00 max_arch_pfn = 0x400000000
[    0.004000] esrt: Reserving ESRT space from 0x000000003c897218 to 0x000000003c8972c8.
[    0.004000] e820: update [mem 0x34c49000-0x34c49fff] usable ==> reserved
[    0.004000] Using GB pages for direct mapping
[    0.004000] Secure boot disabled
[    0.004000] RAMDISK: [mem 0x29425000-0x2d2cdfff]
[    0.004000] ACPI: Early table checksum verification disabled
[    0.004000] ACPI: RSDP 0x000000003FBFE014 000024 (v02 HPQOEM)
[    0.004000] ACPI: XSDT 0x000000003FB54228 00017C (v01 HPQOEM SLIC-BPC 00000000      01000013)
[    0.004000] ACPI: FACP 0x000000003FBFD000 000114 (v06 HPQOEM SLIC-BPC 00000000 HP   00000001)
[    0.004000] ACPI: Override [DSDT-896D    ], this is unsafe: tainting kernel
[    0.004000] Disabling lock debugging due to kernel taint
[    0.004000] ACPI: DSDT 0x000000003FB85000 Logical table override, new table: 0xFFFFFFFFB68308E0
[    0.004000] ACPI: DSDT 0xFFFFFFFFB68308E0 03D729 (v02 HPQOEM 896D     00000000 INTL 20190509)
[    0.004000] ACPI: FACS 0x000000003FA82000 000040
[    0.004000] ACPI: SSDT 0x000000003FBFC000 0002D7 (v01 HP     NVTEC    00000001 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FBFB000 00012A (v02 HP     ShmTable 00000001 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FBED000 00D7FB (v02 HPQOEM PLT_RTD3 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FBE7000 005CE0 (v02 CpuRef CpuSsdt  00003000 INTL 20200717)
[    0.004000] ACPI: RTMA 0x000000003FBE6000 00009E (v01 HP     _HBMART_ 00001000 HP   00000001)
[    0.004000] ACPI: SSDT 0x000000003FBE4000 0017B3 (v02 HP     UcsiAcpi 00000001 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FBE3000 0000FB (v02 HP     UcsiCntr 00000001 INTL 20200717)
[    0.004000] ACPI: OEML 0x000000003FBE2000 000028 (v03 HPQOEM ADL-P-M  00000002      01000013)
[    0.004000] ACPI: SSDT 0x000000003FBE0000 001D00 (v01 HP     LAPTOPPC 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FBDE000 0005FB (v02 HPQOEM Tpm2Tabl 00001000 INTL 20200717)
[    0.004000] ACPI: TPM2 0x000000003FBDD000 00004C (v04 HPQOEM ADL-P-M  00000002      01000013)
[    0.004000] ACPI: SSDT 0x000000003FBDA000 002A65 (v02 SaSsdt SaSsdt   00003000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FBD6000 003427 (v02 INTEL  IgfxSsdt 00003000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FBC8000 00D1AB (v02 INTEL  TcssSsdt 00001000 INTL 20200717)
[    0.004000] ACPI: WSMT 0x000000003FBC7000 000028 (v01 HPQOEM 896D     00000001 HP   00000001)
[    0.004000] ACPI: HPET 0x000000003FBC5000 000038 (v01 HPQOEM 896D     00000001 HP   00000001)
[    0.004000] ACPI: APIC 0x000000003FBC4000 0001DC (v05 HPQOEM 896D     00000001 HP   00000001)
[    0.004000] ACPI: MCFG 0x000000003FBC3000 00003C (v01 HPQOEM 896D     00000001 HP   00000001)
[    0.004000] ACPI: SSDT 0x000000003FB84000 00098A (v02 HPQOEM HP_XHC_P 00000000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB7B000 00700C (v02 DptfTb DptfTabl 00001000 INTL 20200717)
[    0.004000] ACPI: WSMT 0x000000003FB7A000 000028 (v01 HPQOEM          00000000      00000000)
[    0.004000] ACPI: NHLT 0x000000003FB78000 001B16 (v00 HPQOEM ADL-P-M  00000002      01000013)
[    0.004000] ACPI: DMAR 0x000000003FB77000 000088 (v02 INTEL  ADL      00000002 INTL 01000013)
[    0.004000] ACPI: SSDT 0x000000003FB6D000 009C2E (v02 HPQOEM MS-SSDT  00003000 INTL 20200717)
[    0.004000] ACPI: LPIT 0x000000003FBC6000 0000CC (v01 HPQOEM ADL-P-M  00000002      01000013)
[    0.004000] ACPI: SSDT 0x000000003FB69000 003AEA (v02 SocGpe SocGpe   00003000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB66000 002B2A (v02 SocCmn SocCmn   00003000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB64000 00134D (v01 HP     HPINWWAN 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB63000 00019F (v01 HP     HPNBCONV 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB62000 0005DA (v01 HP     INTTPL   00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB60000 001C69 (v02 Rtd3   AdlP_Rvp 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB5C000 0033CC (v01 HP     HPINNBWL 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB5B000 000032 (v01 HP     HPCONDEV 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB5A000 000116 (v01 HP     HPSANIMD 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB59000 000F18 (v02 HP     HPINTELG 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB58000 000069 (v01 HP     HPCAHWID 00001000 INTL 20200717)
[    0.004000] ACPI: SSDT 0x000000003FB57000 00004B (v01 HP     CAPAHWID 00001000 INTL 20200717)
[    0.004000] ACPI: BGRT 0x000000003FB55000 000038 (v01 HPQOEM ADL-P-M  00000002      01000013)
[    0.004000] ACPI: ASF! 0x000000003FB83000 0000A0 (v32 HPQOEM  UYAMIHC 00000002      01000013)
[    0.004000] ACPI: PHAT 0x000000003FB56000 000506 (v00 HPQOEM SLIC-BPC 00000005 MSFT 0100000D)
[    0.004000] ACPI: SSDT 0x000000003FBDF000 0002F9 (v02 HP     PwrCtlEv 00000001 INTL 20200717)
[    0.004000] ACPI: FPDT 0x000000003FB53000 000044 (v01 HPQOEM ADL-P-M  00000002      01000013)
[    0.004000] ACPI: Reserving FACP table memory at [mem 0x3fbfd000-0x3fbfd113]
[    0.004000] ACPI: Reserving DSDT table memory at [mem 0xffffffffb68308e0-0xffffffffb686e008]
[    0.004000] ACPI: Reserving FACS table memory at [mem 0x3fa82000-0x3fa8203f]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbfc000-0x3fbfc2d6]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbfb000-0x3fbfb129]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbed000-0x3fbfa7fa]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbe7000-0x3fbeccdf]
[    0.004000] ACPI: Reserving RTMA table memory at [mem 0x3fbe6000-0x3fbe609d]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbe4000-0x3fbe57b2]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbe3000-0x3fbe30fa]
[    0.004000] ACPI: Reserving OEML table memory at [mem 0x3fbe2000-0x3fbe2027]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbe0000-0x3fbe1cff]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbde000-0x3fbde5fa]
[    0.004000] ACPI: Reserving TPM2 table memory at [mem 0x3fbdd000-0x3fbdd04b]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbda000-0x3fbdca64]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbd6000-0x3fbd9426]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbc8000-0x3fbd51aa]
[    0.004000] ACPI: Reserving WSMT table memory at [mem 0x3fbc7000-0x3fbc7027]
[    0.004000] ACPI: Reserving HPET table memory at [mem 0x3fbc5000-0x3fbc5037]
[    0.004000] ACPI: Reserving APIC table memory at [mem 0x3fbc4000-0x3fbc41db]
[    0.004000] ACPI: Reserving MCFG table memory at [mem 0x3fbc3000-0x3fbc303b]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb84000-0x3fb84989]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb7b000-0x3fb8200b]
[    0.004000] ACPI: Reserving WSMT table memory at [mem 0x3fb7a000-0x3fb7a027]
[    0.004000] ACPI: Reserving NHLT table memory at [mem 0x3fb78000-0x3fb79b15]
[    0.004000] ACPI: Reserving DMAR table memory at [mem 0x3fb77000-0x3fb77087]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb6d000-0x3fb76c2d]
[    0.004000] ACPI: Reserving LPIT table memory at [mem 0x3fbc6000-0x3fbc60cb]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb69000-0x3fb6cae9]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb66000-0x3fb68b29]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb64000-0x3fb6534c]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb63000-0x3fb6319e]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb62000-0x3fb625d9]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb60000-0x3fb61c68]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb5c000-0x3fb5f3cb]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb5b000-0x3fb5b031]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb5a000-0x3fb5a115]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb59000-0x3fb59f17]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb58000-0x3fb58068]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fb57000-0x3fb5704a]
[    0.004000] ACPI: Reserving BGRT table memory at [mem 0x3fb55000-0x3fb55037]
[    0.004000] ACPI: Reserving ASF! table memory at [mem 0x3fb83000-0x3fb8309f]
[    0.004000] ACPI: Reserving PHAT table memory at [mem 0x3fb56000-0x3fb56505]
[    0.004000] ACPI: Reserving SSDT table memory at [mem 0x3fbdf000-0x3fbdf2f8]
[    0.004000] ACPI: Reserving FPDT table memory at [mem 0x3fb53000-0x3fb53043]
[    0.004000] No NUMA configuration found
[    0.004000] Faking a node at [mem 0x0000000000000000-0x00000004af7fffff]
[    0.004000] NODE_DATA(0) allocated [mem 0x4af7d5000-0x4af7fffff]
[    0.004000] Zone ranges:
[    0.004000]   DMA      [mem 0x0000000000001000-0x0000000000ffffff]
[    0.004000]   DMA32    [mem 0x0000000001000000-0x00000000ffffffff]
[    0.004000]   Normal   [mem 0x0000000100000000-0x00000004af7fffff]
[    0.004000]   Device   empty
[    0.004000] Movable zone start for each node
[    0.004000] Early memory node ranges
[    0.004000]   node   0: [mem 0x0000000000001000-0x000000000009efff]
[    0.004000]   node   0: [mem 0x0000000000100000-0x000000003c0d2fff]
[    0.004000]   node   0: [mem 0x000000003fbff000-0x000000003fbfffff]
[    0.004000]   node   0: [mem 0x0000000100000000-0x00000004af7fffff]
[    0.004000] Initmem setup node 0 [mem 0x0000000000001000-0x00000004af7fffff]
[    0.004000] On node 0, zone DMA: 1 pages in unavailable ranges
[    0.004000] On node 0, zone DMA: 97 pages in unavailable ranges
[    0.004000] On node 0, zone DMA32: 15148 pages in unavailable ranges
[    0.004000] On node 0, zone Normal: 1024 pages in unavailable ranges
[    0.004000] On node 0, zone Normal: 2048 pages in unavailable ranges
[    0.004000] Reserving Intel graphics memory at [mem 0x4c800000-0x507fffff]
[    0.004000] ACPI: PM-Timer IO Port: 0x1808
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x02] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x03] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x04] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x05] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x06] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x07] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x08] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x09] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x0a] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x0b] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x0c] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x0d] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x0e] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x0f] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x10] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x11] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x12] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x13] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x14] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x15] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x16] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x17] high edge lint[0x1])
[    0.004000] ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1])
[    0.004000] IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-119
[    0.004000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
[    0.004000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
[    0.004000] ACPI: Using ACPI (MADT) for SMP configuration information
[    0.004000] ACPI: HPET id: 0x8086a201 base: 0xfed00000
[    0.004000] e820: update [mem 0x3472c000-0x34774fff] usable ==> reserved
[    0.004000] TSC deadline timer available
[    0.004000] smpboot: Allowing 12 CPUs, 0 hotplug CPUs
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x00000000-0x00000fff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x0009f000-0x000fffff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x3472c000-0x34774fff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x34c49000-0x34c49fff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x3c0d3000-0x3f927fff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x3f928000-0x3fb27fff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x3fb28000-0x3fbfefff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x3fc00000-0x45ffffff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x46000000-0x46dfffff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x46e00000-0x46ffffff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x47000000-0x47ffffff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x48000000-0x507fffff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0x50800000-0xfed1ffff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0xfed20000-0xfed7ffff]
[    0.004000] PM: hibernation: Registered nosave memory: [mem 0xfed80000-0xffffffff]
[    0.004000] [mem 0x50800000-0xfed1ffff] available for PCI devices
[    0.004000] Booting paravirtualized kernel on bare hardware
[    0.004000] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645519600211568 ns
[    0.004000] setup_percpu: NR_CPUS:8192 nr_cpumask_bits:12 nr_cpu_ids:12 nr_node_ids:1
[    0.004000] percpu: Embedded 62 pages/cpu s217088 r8192 d28672 u262144
[    0.004000] pcpu-alloc: s217088 r8192 d28672 u262144 alloc=1*2097152
[    0.004000] pcpu-alloc: [0] 00 01 02 03 04 05 06 07 [0] 08 09 10 11 -- -- -- --
[    0.004000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.3.0+ root=UUID=2aec303b-7cd8-4d6f-8da6-b19769ec6332 ro quiet splash resume=UUID=2aec303b-7cd8-4d6f-8da6-b19769ec6332 resume_offset=17821696 vt.handoff=7
[    0.004000] Unknown kernel command line parameters "splash BOOT_IMAGE=/boot/vmlinuz-6.3.0+", will be passed to user space.
[    0.004000] Dentry cache hash table entries: 2097152 (order: 12, 16777216 bytes, linear)
[    0.004000] Inode-cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    0.004000] Fallback order for Node 0: 0
[    0.004000] Built 1 zonelists, mobility grouping on.  Total pages: 4046064
[    0.004000] Policy zone: Normal
[    0.004000] mem auto-init: stack:off, heap alloc:on, heap free:off
[    0.004000] software IO TLB: area num 16.
[    0.004000] Memory: 15805400K/16441800K available (18432K kernel code, 3445K rwdata, 6856K rodata, 4424K init, 18588K bss, 636140K reserved, 0K cma-reserved)
[    0.004000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=12, Nodes=1
[    0.004000] ftrace: allocating 50397 entries in 197 pages
[    0.004000] ftrace: allocated 197 pages with 4 groups
[    0.004000] Dynamic Preempt: voluntary
[    0.004000] rcu: Preemptible hierarchical RCU implementation.
[    0.004000] rcu:     RCU restricting CPUs from NR_CPUS=8192 to nr_cpu_ids=12.
[    0.004000]  Trampoline variant of Tasks RCU enabled.
[    0.004000]  Rude variant of Tasks RCU enabled.
[    0.004000]  Tracing variant of Tasks RCU enabled.
[    0.004000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.004000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=12
[    0.004000] NR_IRQS: 524544, nr_irqs: 2152, preallocated irqs: 16
[    0.004000] rcu: srcu_init: Setting srcu_struct sizes based on contention.
[    0.004000] Console: colour dummy device 80x25
[    0.004000] printk: console [tty0] enabled
[    0.004000] ACPI: Core revision 20230331
[    0.004000] ACPI Error: Table [DSDT] is not invalidated during early boot stage (20230331/tbxface-163)
[    0.004000] hpet: HPET dysfunctional in PC10. Force disabled.
[    0.004000] APIC: Switch to symmetric I/O mode setup
[    0.004000] DMAR: Host address width 39
[    0.004000] DMAR: DRHD base: 0x000000fed90000 flags: 0x0
[    0.004000] DMAR: dmar0: reg_base_addr fed90000 ver 4:0 cap 9c0000c406f0462 ecap 29a08f0505e
[    0.004000] DMAR: DRHD base: 0x000000fed91000 flags: 0x1
[    0.004000] DMAR: dmar1: reg_base_addr fed91000 ver 5:0 cap 8d2008c40660462 ecap f050da
[    0.004000] DMAR: RMRR base: 0x0000004c000000 end: 0x000000507fffff
[    0.004000] DMAR-IR: IOAPIC id 2 under DRHD base  0xfed91000 IOMMU 1
[    0.004000] DMAR-IR: HPET id 0 under DRHD base 0xfed91000
[    0.004000] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[    0.004000] DMAR-IR: Enabled IRQ remapping in x2apic mode
[    0.004000] x2apic enabled
[    0.004000] Switched APIC routing to cluster x2apic.
[    0.004000] clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x1128af0325d, max_idle_ns: 440795261011 ns
[    0.094427] Calibrating delay loop (skipped), value calculated using timer frequency.. 2380.80 BogoMIPS (lpj=4761600)
[    0.094429] pid_max: default: 32768 minimum: 301
[    0.098422] LSM: initializing lsm=lockdown,capability,yama,apparmor,integrity
[    0.098422] Yama: becoming mindful.
[    0.098422] AppArmor: AppArmor initialized
[    0.098422] Mount-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.098422] Mountpoint-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.098422] x86/tme: not enabled by BIOS
[    0.098422] CPU0: Thermal monitoring enabled (TM1)
[    0.098422] x86/cpu: User Mode Instruction Prevention (UMIP) activated
[    0.098422] process: using mwait in idle threads
[    0.098422] Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0
[    0.098422] Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0, 1GB 0
[    0.098422] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
[    0.098422] Spectre V2 : Mitigation: Enhanced / Automatic IBRS
[    0.098422] Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch
[    0.098422] Spectre V2 : Spectre v2 / PBRSB-eIBRS: Retire a single CALL on VMEXIT
[    0.098422] Spectre V2 : mitigation: Enabling conditional Indirect Branch Prediction Barrier
[    0.098422] Speculative Store Bypass: Mitigation: Speculative Store Bypass disabled via prctl
[    0.098422] Freeing SMP alternatives memory: 44K
[    0.098422] smpboot: CPU0: Genuine Intel(R) 0000 (family: 0x6, model: 0x9a, stepping: 0x1)
[    0.098422] cblist_init_generic: Setting adjustable number of callback queues.
[    0.098422] cblist_init_generic: Setting shift to 4 and lim to 1.
[    0.098422] cblist_init_generic: Setting shift to 4 and lim to 1.
[    0.098422] cblist_init_generic: Setting shift to 4 and lim to 1.
[    0.098422] Performance Events: XSAVE Architectural LBR, PEBS fmt4+-baseline,  AnyThread deprecated, Alderlake Hybrid events, 32-deep LBR, full-width counters, Intel PMU driver.
[    0.098422] core: cpu_core PMU driver:
[    0.098422] ... version:                5
[    0.098422] ... bit width:              48
[    0.098422] ... generic registers:      8
[    0.098422] ... value mask:             0000ffffffffffff
[    0.098422] ... max period:             00007fffffffffff
[    0.098422] ... fixed-purpose events:   4
[    0.098422] ... event mask:             0001000f000000ff
[    0.098422] Estimated ratio of average max frequency by base frequency (times 1024): 3413
[    0.098422] rcu: Hierarchical SRCU implementation.
[    0.098422] rcu:     Max phase no-delay instances is 1000.
[    0.098422] NMI watchdog: Enabled. Permanently consumes one hw-PMU counter.
[    0.098422] smp: Bringing up secondary CPUs ...
[    0.098422] x86: Booting SMP configuration:
[    0.098422] .... node  #0, CPUs:        #1  #2  #3  #4
[    0.094422] core: cpu_atom PMU driver: PEBS-via-PT
[    0.094422] ... version:                5
[    0.094422] ... bit width:              48
[    0.094422] ... generic registers:      6
[    0.094422] ... value mask:             0000ffffffffffff
[    0.094422] ... max period:             00007fffffffffff
[    0.094422] ... fixed-purpose events:   3
[    0.094422] ... event mask:             000000070000003f
[    0.104193]   #5  #6  #7  #8  #9 #10 #11
[    0.130701] smp: Brought up 1 node, 12 CPUs
[    0.130701] smpboot: Max logical packages: 1
[    0.130701] smpboot: Total of 12 processors activated (28569.60 BogoMIPS)
[    0.135240] devtmpfs: initialized
[    0.135240] x86/mm: Memory block size: 128MB
[    0.135339] ACPI: PM: Registering ACPI NVS region [mem 0x3f928000-0x3fb27fff] (2097152 bytes)
[    0.135339] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.135339] futex hash table entries: 4096 (order: 6, 262144 bytes, linear)
[    0.135339] pinctrl core: initialized pinctrl subsystem
[    0.135339] PM: RTC time: 12:13:45, date: 2023-04-28
[    0.135873] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.136064] DMA: preallocated 2048 KiB GFP_KERNEL pool for atomic allocations
[    0.136327] DMA: preallocated 2048 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.138695] DMA: preallocated 2048 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.138711] audit: initializing netlink subsys (disabled)
[    0.138730] audit: type=2000 audit(1682684025.044:1): state=initialized audit_enabled=0 res=1
[    0.138730] thermal_sys: Registered thermal governor 'fair_share'
[    0.138730] thermal_sys: Registered thermal governor 'bang_bang'
[    0.138730] thermal_sys: Registered thermal governor 'step_wise'
[    0.138730] thermal_sys: Registered thermal governor 'user_space'
[    0.138730] thermal_sys: Registered thermal governor 'power_allocator'
[    0.138730] EISA bus registered
[    0.138730] cpuidle: using governor ladder
[    0.138730] cpuidle: using governor menu
[    0.138730] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[    0.138730] PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem 0xc0000000-0xcfffffff] (base 0xc0000000)
[    0.138730] PCI: not using MMCONFIG
[    0.138730] PCI: Using configuration type 1 for base access
[    0.138731] ENERGY_PERF_BIAS: Set to 'normal', was 'performance'
[    0.138744] kprobes: kprobe jump-optimization is enabled. All kprobes are optimized if possible.
[    0.138744] HugeTLB: registered 1.00 GiB page size, pre-allocated 0 pages
[    0.138744] HugeTLB: 16380 KiB vmemmap can be freed for a 1.00 GiB page
[    0.138744] HugeTLB: registered 2.00 MiB page size, pre-allocated 0 pages
[    0.138744] HugeTLB: 28 KiB vmemmap can be freed for a 2.00 MiB page
[    0.142515] fbcon: Taking over console
[    0.142554] ACPI: Added _OSI(Module Device)
[    0.142555] ACPI: Added _OSI(Processor Device)
[    0.142556] ACPI: Added _OSI(3.0 _SCP Extensions)
[    0.142557] ACPI: Added _OSI(Processor Aggregator Device)
[    0.254126] ACPI BIOS Error (bug): Failure creating named object [\_GPE._L6F], AE_ALREADY_EXISTS (20230331/dswload2-326)
[    0.254137] ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20230331/psobject-220)
[    0.254141] ACPI: Skipping parse of AML opcode: Method (0x0014)
[    0.255003] ACPI BIOS Error (bug): Failure creating named object [\_SB.PC00.I2C1.TPL0._HID], AE_ALREADY_EXISTS (20230331/dswload2-326)
[    0.255009] ACPI Error: AE_ALREADY_EXISTS, During name lookup/catalog (20230331/psobject-220)
[    0.255012] ACPI: Skipping parse of AML opcode: Method (0x0014)
[    0.258710] ACPI: 28 ACPI AML tables successfully acquired and loaded
[    0.262559] ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored
[    0.279620] ACPI: Dynamic OEM Table Load:
[    0.279637] ACPI: SSDT 0xFFFF8B1F81FE8C00 0001AB (v02 PmRef  Cpu0Psd  00003000 INTL 20200717)
[    0.280977] ACPI: \_SB_.PR00: _OSC native thermal LVT Acked
[    0.283383] ACPI: USB4 _OSC: OS supports USB3+ DisplayPort+ PCIe+ XDomain+
[    0.283384] ACPI: USB4 _OSC: OS controls USB3+ DisplayPort+ PCIe+ XDomain+
[    0.284555] ACPI: Dynamic OEM Table Load:
[    0.284565] ACPI: SSDT 0xFFFF8B1F814F1000 000394 (v02 PmRef  Cpu0Cst  00003001 INTL 20200717)
[    0.286064] ACPI: Dynamic OEM Table Load:
[    0.286073] ACPI: SSDT 0xFFFF8B1F814F7400 000371 (v02 PmRef  Cpu0Ist  00003000 INTL 20200717)
[    0.287627] ACPI: Dynamic OEM Table Load:
[    0.287635] ACPI: SSDT 0xFFFF8B1F82028800 0004D8 (v02 PmRef  Cpu0Hwp  00003000 INTL 20200717)
[    0.289471] ACPI: Dynamic OEM Table Load:
[    0.289483] ACPI: SSDT 0xFFFF8B1F814EC000 001BAF (v02 PmRef  ApIst    00003000 INTL 20200717)
[    0.291726] ACPI: Dynamic OEM Table Load:
[    0.291736] ACPI: SSDT 0xFFFF8B1F814EA000 001038 (v02 PmRef  ApHwp    00003000 INTL 20200717)
[    0.293721] ACPI: Dynamic OEM Table Load:
[    0.293730] ACPI: SSDT 0xFFFF8B1F82032000 001349 (v02 PmRef  ApPsd    00003000 INTL 20200717)
[    0.295792] ACPI: Dynamic OEM Table Load:
[    0.295801] ACPI: SSDT 0xFFFF8B1F814FB000 000FBB (v02 PmRef  ApCst    00003000 INTL 20200717)
[    0.303003] ACPI: EC: EC started
[    0.303004] ACPI: EC: interrupt blocked
[    0.332806] ACPI: EC: EC_CMD/EC_SC=0x66, EC_DATA=0x62
[    0.332808] ACPI: \_SB_.PC00.LPCB.EC0_: Boot DSDT EC used to handle transactions
[    0.332810] ACPI: Interpreter enabled
[    0.332881] ACPI: PM: (supports S0 S3 S4 S5)
[    0.332882] ACPI: Using IOAPIC for interrupt routing
[    0.332945] PCI: MMCONFIG for domain 0000 [bus 00-ff] at [mem 0xc0000000-0xcfffffff] (base 0xc0000000)
[    0.334546] PCI: MMCONFIG at [mem 0xc0000000-0xcfffffff] reserved as ACPI motherboard resource
[    0.334563] PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
[    0.334564] PCI: Using E820 reservations for host bridge windows
[    0.335552] ACPI: Enabled 7 GPEs in block 00 to 7F
[    0.337050] ACPI: \_SB_.PC00.PEG0.PXP_: New power resource
[    0.342204] ACPI: \_SB_.PC00.XHCI.RHUB.HS04.PRUB: New power resource
[    0.342975] ACPI: \_SB_.PC00.XHCI.RHUB.HS10.BTPR: New power resource
[    0.351743] ACPI: \_SB_.PC00.CNVW.WRST: New power resource
[    0.357354] ACPI: \_SB_.PC00.RP08.PXP_: New power resource
[    0.358152] ACPI: \_SB_.PC00.RP08.PXSX.MRST: New power resource
[    0.369683] ACPI: \_SB_.PC00.TBT0: New power resource
[    0.369766] ACPI: \_SB_.PC00.TBT1: New power resource
[    0.369841] ACPI: \_SB_.PC00.D3C_: New power resource
[    0.615657] ACPI: \PIN_: New power resource
[    0.616191] ACPI: PCI Root Bridge [PC00] (domain 0000 [bus 00-fe])
[    0.616201] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI HPX-Type3]
[    0.618236] acpi PNP0A08:00: _OSC: platform does not support [AER]
[    0.622082] acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug SHPCHotplug PME PCIeCapability LTR]
[    0.628036] PCI host bridge to bus 0000:00
[    0.628038] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7 window]
[    0.628041] pci_bus 0000:00: root bus resource [io  0x0d00-0xffff window]
[    0.628042] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff window]
[    0.628044] pci_bus 0000:00: root bus resource [mem 0x50800000-0xbfffffff window]
[    0.628045] pci_bus 0000:00: root bus resource [mem 0x4000000000-0x7fffffffff window]
[    0.628047] pci_bus 0000:00: root bus resource [bus 00-fe]
[    0.651109] pci 0000:00:00.0: [8086:4601] type 00 class 0x060000
[    0.651503] pci 0000:00:02.0: [8086:46a8] type 00 class 0x030000
[    0.651516] pci 0000:00:02.0: reg 0x10: [mem 0x603c000000-0x603cffffff 64bit]
[    0.651525] pci 0000:00:02.0: reg 0x18: [mem 0x4000000000-0x400fffffff 64bit pref]
[    0.651531] pci 0000:00:02.0: reg 0x20: [io  0x3000-0x303f]
[    0.651554] pci 0000:00:02.0: BAR 2: assigned to efifb
[    0.651556] pci 0000:00:02.0: DMAR: Skip IOMMU disabling for graphics
[    0.651560] pci 0000:00:02.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff]
[    0.651605] pci 0000:00:02.0: reg 0x344: [mem 0x00000000-0x00ffffff 64bit]
[    0.651607] pci 0000:00:02.0: VF(n) BAR0 space: [mem 0x00000000-0x06ffffff 64bit] (contains BAR0 for 7 VFs)
[    0.651615] pci 0000:00:02.0: reg 0x34c: [mem 0x00000000-0x1fffffff 64bit pref]
[    0.651616] pci 0000:00:02.0: VF(n) BAR2 space: [mem 0x00000000-0xdfffffff 64bit pref] (contains BAR2 for 7 VFs)
[    0.651802] pci 0000:00:04.0: [8086:461d] type 00 class 0x118000
[    0.651819] pci 0000:00:04.0: reg 0x10: [mem 0x603d180000-0x603d19ffff 64bit]
[    0.652214] pci 0000:00:06.0: [8086:464d] type 01 class 0x060400
[    0.652576] pci 0000:00:06.0: PME# supported from D0 D3hot D3cold
[    0.652674] pci 0000:00:06.0: PTM enabled (root), 4ns granularity
[    0.653348] pci 0000:00:06.2: [8086:463d] type 01 class 0x060400
[    0.653438] pci 0000:00:06.2: PME# supported from D0 D3hot D3cold
[    0.653477] pci 0000:00:06.2: PTM enabled (root), 4ns granularity
[    0.654166] pci 0000:00:07.0: [8086:466e] type 01 class 0x060400
[    0.654224] pci 0000:00:07.0: Overriding RP PIO Log Size to 4
[    0.654318] pci 0000:00:07.0: PME# supported from D0 D3hot D3cold
[    0.654357] pci 0000:00:07.0: PTM enabled (root), 4ns granularity
[    0.655317] pci 0000:00:07.2: [8086:462f] type 01 class 0x060400
[    0.655374] pci 0000:00:07.2: Overriding RP PIO Log Size to 4
[    0.655467] pci 0000:00:07.2: PME# supported from D0 D3hot D3cold
[    0.655506] pci 0000:00:07.2: PTM enabled (root), 4ns granularity
[    0.656504] pci 0000:00:08.0: [8086:464f] type 00 class 0x088000
[    0.656516] pci 0000:00:08.0: reg 0x10: [mem 0x603d1dc000-0x603d1dcfff 64bit]
[    0.656645] pci 0000:00:0a.0: [8086:467d] type 00 class 0x118000
[    0.656657] pci 0000:00:0a.0: reg 0x10: [mem 0x603d1c0000-0x603d1c7fff 64bit]
[    0.656686] pci 0000:00:0a.0: enabling Extended Tags
[    0.656818] pci 0000:00:0d.0: [8086:461e] type 00 class 0x0c0330
[    0.656831] pci 0000:00:0d.0: reg 0x10: [mem 0x603d1b0000-0x603d1bffff 64bit]
[    0.656882] pci 0000:00:0d.0: PME# supported from D3hot D3cold
[    0.657388] pci 0000:00:0d.2: [8086:463e] type 00 class 0x0c0340
[    0.657398] pci 0000:00:0d.2: reg 0x10: [mem 0x603d140000-0x603d17ffff 64bit]
[    0.657405] pci 0000:00:0d.2: reg 0x18: [mem 0x603d1db000-0x603d1dbfff 64bit]
[    0.657436] pci 0000:00:0d.2: supports D1 D2
[    0.657437] pci 0000:00:0d.2: PME# supported from D0 D1 D2 D3hot D3cold
[    0.657565] pci 0000:00:0d.3: [8086:466d] type 00 class 0x0c0340
[    0.657581] pci 0000:00:0d.3: reg 0x10: [mem 0x603d100000-0x603d13ffff 64bit]
[    0.657591] pci 0000:00:0d.3: reg 0x18: [mem 0x603d1da000-0x603d1dafff 64bit]
[    0.657637] pci 0000:00:0d.3: supports D1 D2
[    0.657638] pci 0000:00:0d.3: PME# supported from D0 D1 D2 D3hot D3cold
[    0.657930] pci 0000:00:14.0: [8086:51ed] type 00 class 0x0c0330
[    0.657956] pci 0000:00:14.0: reg 0x10: [mem 0x603d1a0000-0x603d1affff 64bit]
[    0.658064] pci 0000:00:14.0: PME# supported from D3hot D3cold
[    0.658634] pci 0000:00:14.2: [8086:51ef] type 00 class 0x050000
[    0.658662] pci 0000:00:14.2: reg 0x10: [mem 0x603d1d0000-0x603d1d3fff 64bit]
[    0.658680] pci 0000:00:14.2: reg 0x18: [mem 0x603d1d9000-0x603d1d9fff 64bit]
[    0.658932] pci 0000:00:14.3: [8086:51f0] type 00 class 0x028000
[    0.658999] pci 0000:00:14.3: reg 0x10: [mem 0x603d1cc000-0x603d1cffff 64bit]
[    0.659208] pci 0000:00:14.3: PME# supported from D0 D3hot D3cold
[    0.660053] pci 0000:00:15.0: [8086:51e8] type 00 class 0x0c8000
[    0.660785] pci 0000:00:15.0: reg 0x10: [mem 0x00000000-0x00000fff 64bit]
[    0.664110] pci 0000:00:16.0: [8086:51e0] type 00 class 0x078000
[    0.664140] pci 0000:00:16.0: reg 0x10: [mem 0x603d1d7000-0x603d1d7fff 64bit]
[    0.664252] pci 0000:00:16.0: PME# supported from D3hot
[    0.664847] pci 0000:00:16.3: [8086:51e3] type 00 class 0x070002
[    0.664871] pci 0000:00:16.3: reg 0x10: [io  0x3060-0x3067]
[    0.664883] pci 0000:00:16.3: reg 0x14: [mem 0x6c401000-0x6c401fff]
[    0.665205] pci 0000:00:1c.0: [8086:51bf] type 01 class 0x060400
[    0.665350] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold
[    0.665391] pci 0000:00:1c.0: PTM enabled (root), 4ns granularity
[    0.666631] pci 0000:00:1e.0: [8086:51a8] type 00 class 0x078000
[    0.667363] pci 0000:00:1e.0: reg 0x10: [mem 0x00000000-0x00000fff 64bit]
[    0.671185] pci 0000:00:1e.2: [8086:51aa] type 00 class 0x0c8000
[    0.671917] pci 0000:00:1e.2: reg 0x10: [mem 0x00000000-0x00000fff 64bit]
[    0.675219] pci 0000:00:1f.0: [8086:5182] type 00 class 0x060100
[    0.675698] pci 0000:00:1f.3: [8086:51c8] type 00 class 0x040100
[    0.675774] pci 0000:00:1f.3: reg 0x10: [mem 0x603d1c8000-0x603d1cbfff 64bit]
[    0.675862] pci 0000:00:1f.3: reg 0x20: [mem 0x603d000000-0x603d0fffff 64bit]
[    0.676017] pci 0000:00:1f.3: PME# supported from D3hot D3cold
[    0.676688] pci 0000:00:1f.4: [8086:51a3] type 00 class 0x0c0500
[    0.676785] pci 0000:00:1f.4: reg 0x10: [mem 0x603d1d4000-0x603d1d40ff 64bit]
[    0.676881] pci 0000:00:1f.4: reg 0x20: [io  0xefa0-0xefbf]
[    0.677289] pci 0000:00:1f.5: [8086:51a4] type 00 class 0x0c8000
[    0.677311] pci 0000:00:1f.5: reg 0x10: [mem 0xfe010000-0xfe010fff]
[    0.677598] pci 0000:00:06.0: PCI bridge to [bus 01]
[    0.678412] pci 0000:02:00.0: [1e0f:0001] type 00 class 0x010802
[    0.678433] pci 0000:02:00.0: reg 0x10: [mem 0x6c300000-0x6c303fff 64bit]
[    0.678550] pci 0000:02:00.0: PME# supported from D0 D3hot
[    0.678725] pci 0000:00:06.2: PCI bridge to [bus 02]
[    0.678729] pci 0000:00:06.2:   bridge window [mem 0x6c300000-0x6c3fffff]
[    0.678772] pci 0000:00:07.0: PCI bridge to [bus 03-2c]
[    0.678777] pci 0000:00:07.0:   bridge window [mem 0x60000000-0x6c1fffff]
[    0.678781] pci 0000:00:07.0:   bridge window [mem 0x6000000000-0x601bffffff 64bit pref]
[    0.678823] pci 0000:00:07.2: PCI bridge to [bus 2d-56]
[    0.678827] pci 0000:00:07.2:   bridge window [mem 0x52000000-0x5e1fffff]
[    0.678832] pci 0000:00:07.2:   bridge window [mem 0x6020000000-0x603bffffff 64bit pref]
[    0.679071] pci 0000:57:00.0: [8086:7560] type 00 class 0x0d4000
[    0.679107] pci 0000:57:00.0: reg 0x10: [mem 0x6c200000-0x6c200fff 64bit]
[    0.679129] pci 0000:57:00.0: reg 0x18: [mem 0x6c201000-0x6c2010ff 64bit]
[    0.679292] pci 0000:57:00.0: PME# supported from D0 D3hot D3cold
[    0.679397] pci 0000:57:00.0: 2.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s PCIe x1 link at 0000:00:1c.0 (capable of 4.000 Gb/s with 5.0 GT/s PCIe x1 link)
[    0.679847] pci 0000:00:1c.0: PCI bridge to [bus 57]
[    0.679853] pci 0000:00:1c.0:   bridge window [mem 0x6c200000-0x6c2fffff]
[    0.712563] Low-power S0 idle used by default for system suspend
[    0.713128] ACPI: EC: interrupt unblocked
[    0.713131] ACPI: EC: event unblocked
[    0.713174] ACPI: EC: EC_CMD/EC_SC=0x66, EC_DATA=0x62
[    0.713175] ACPI: EC: GPE=0x6e
[    0.713177] ACPI: \_SB_.PC00.LPCB.EC0_: Boot DSDT EC initialization complete
[    0.713180] ACPI: \_SB_.PC00.LPCB.EC0_: EC: Used to handle transactions and events
[    0.713259] iommu: Default domain type: Translated
[    0.713259] iommu: DMA domain TLB invalidation policy: lazy mode
[    0.713259] SCSI subsystem initialized
[    0.713259] libata version 3.00 loaded.
[    0.713259] ACPI: bus type USB registered
[    0.713259] usbcore: registered new interface driver usbfs
[    0.713259] usbcore: registered new interface driver hub
[    0.713259] usbcore: registered new device driver usb
[    0.713259] pps_core: LinuxPPS API ver. 1 registered
[    0.713259] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.713259] PTP clock support registered
[    0.714439] EDAC MC: Ver: 3.0.0
[    0.715055] efivars: Registered efivars operations
[    0.718858] NetLabel: Initializing
[    0.718861] NetLabel:  domain hash size = 128
[    0.718863] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
[    0.718899] NetLabel:  unlabeled traffic allowed by default
[    0.718925] PCI: Using ACPI for IRQ routing
[    0.794735] PCI: pci_cache_line_size set to 64 bytes
[    0.795834] pci 0000:00:1f.5: can't claim BAR 0 [mem 0xfe010000-0xfe010fff]: no compatible bridge window
[    0.796179] e820: reserve RAM buffer [mem 0x0009f000-0x0009ffff]
[    0.796181] e820: reserve RAM buffer [mem 0x3472c000-0x37ffffff]
[    0.796182] e820: reserve RAM buffer [mem 0x34c49000-0x37ffffff]
[    0.796183] e820: reserve RAM buffer [mem 0x3c0d3000-0x3fffffff]
[    0.796184] e820: reserve RAM buffer [mem 0x3fc00000-0x3fffffff]
[    0.796184] e820: reserve RAM buffer [mem 0x4af800000-0x4afffffff]
[    0.796216] pci 0000:00:02.0: vgaarb: setting as boot VGA device
[    0.796216] pci 0000:00:02.0: vgaarb: bridge control possible
[    0.796216] pci 0000:00:02.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
[    0.796216] vgaarb: loaded
[    0.796325] clocksource: Switched to clocksource tsc-early
[    0.796469] VFS: Disk quotas dquot_6.6.0
[    0.796479] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    0.796479] AppArmor: AppArmor Filesystem Enabled
[    0.796479] pnp: PnP ACPI init
[    0.796479] system 00:00: [io  0x0680-0x069f] has been reserved
[    0.796479] system 00:00: [io  0x164e-0x164f] has been reserved
[    0.796479] system 00:01: [io  0x1854-0x1857] has been reserved
[    0.796479] system 00:03: [io  0x0200-0x027f] has been reserved
[    0.796479] system 00:03: [mem 0xfedf0000-0xfedfffff] has been reserved
[    0.796479] pnp 00:04: disabling [mem 0xc0000000-0xcfffffff] because it overlaps 0000:00:02.0 BAR 9 [mem 0x00000000-0xdfffffff 64bit pref]
[    0.796479] system 00:04: [mem 0xfedc0000-0xfedc7fff] has been reserved
[    0.796479] system 00:04: [mem 0xfeda0000-0xfeda0fff] has been reserved
[    0.796479] system 00:04: [mem 0xfeda1000-0xfeda1fff] has been reserved
[    0.796479] system 00:04: [mem 0xfed20000-0xfed7ffff] could not be reserved
[    0.796479] system 00:04: [mem 0xfed90000-0xfed93fff] could not be reserved
[    0.796479] system 00:04: [mem 0xfed45000-0xfed8ffff] could not be reserved
[    0.796479] system 00:04: [mem 0xfee00000-0xfeefffff] has been reserved
[    0.797247] system 00:05: [io  0x2000-0x20fe] has been reserved
[    0.798338] pnp: PnP ACPI: found 7 devices
[    0.804562] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[    0.804640] NET: Registered PF_INET protocol family
[    0.805106] IP idents hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[    0.808145] tcp_listen_portaddr_hash hash table entries: 8192 (order: 5, 131072 bytes, linear)
[    0.808210] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.808441] TCP established hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.808965] TCP bind hash table entries: 65536 (order: 9, 2097152 bytes, linear)
[    0.809173] TCP: Hash tables configured (established 131072 bind 65536)
[    0.809400] MPTCP token hash table entries: 16384 (order: 6, 393216 bytes, linear)
[    0.809489] UDP hash table entries: 8192 (order: 6, 262144 bytes, linear)
[    0.809561] UDP-Lite hash table entries: 8192 (order: 6, 262144 bytes, linear)
[    0.809634] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.809643] NET: Registered PF_XDP protocol family
[    0.809657] pci_bus 0000:00: max bus depth: 1 pci_try_num: 2
[    0.809682] pci 0000:00:02.0: BAR 9: assigned [mem 0x4020000000-0x40ffffffff 64bit pref]
[    0.809690] pci 0000:00:02.0: BAR 7: assigned [mem 0x4010000000-0x4016ffffff 64bit]
[    0.809694] pci 0000:00:07.0: BAR 13: assigned [io  0x4000-0x4fff]
[    0.809696] pci 0000:00:07.2: BAR 13: assigned [io  0x5000-0x5fff]
[    0.809698] pci 0000:00:15.0: BAR 0: assigned [mem 0x4017000000-0x4017000fff 64bit]
[    0.810046] pci 0000:00:1e.0: BAR 0: assigned [mem 0x4017001000-0x4017001fff 64bit]
[    0.810387] pci 0000:00:1e.2: BAR 0: assigned [mem 0x4017002000-0x4017002fff 64bit]
[    0.810751] resource: avoiding allocation from e820 entry [mem 0x0009f000-0x000fffff]
[    0.810754] pci 0000:00:1f.5: BAR 0: assigned [mem 0x50800000-0x50800fff]
[    0.810784] pci 0000:00:06.0: PCI bridge to [bus 01]
[    0.810830] pci 0000:00:06.2: PCI bridge to [bus 02]
[    0.810833] pci 0000:00:06.2:   bridge window [mem 0x6c300000-0x6c3fffff]
[    0.810839] pci 0000:00:07.0: PCI bridge to [bus 03-2c]
[    0.810841] pci 0000:00:07.0:   bridge window [io  0x4000-0x4fff]
[    0.810845] pci 0000:00:07.0:   bridge window [mem 0x60000000-0x6c1fffff]
[    0.810848] pci 0000:00:07.0:   bridge window [mem 0x6000000000-0x601bffffff 64bit pref]
[    0.810853] pci 0000:00:07.2: PCI bridge to [bus 2d-56]
[    0.810854] pci 0000:00:07.2:   bridge window [io  0x5000-0x5fff]
[    0.810858] pci 0000:00:07.2:   bridge window [mem 0x52000000-0x5e1fffff]
[    0.810861] pci 0000:00:07.2:   bridge window [mem 0x6020000000-0x603bffffff 64bit pref]
[    0.810867] pci 0000:00:1c.0: PCI bridge to [bus 57]
[    0.810891] pci 0000:00:1c.0:   bridge window [mem 0x6c200000-0x6c2fffff]
[    0.810901] pci_bus 0000:00: resource 4 [io  0x0000-0x0cf7 window]
[    0.810903] pci_bus 0000:00: resource 5 [io  0x0d00-0xffff window]
[    0.810904] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff window]
[    0.810905] pci_bus 0000:00: resource 7 [mem 0x50800000-0xbfffffff window]
[    0.810906] pci_bus 0000:00: resource 8 [mem 0x4000000000-0x7fffffffff window]
[    0.810908] pci_bus 0000:02: resource 1 [mem 0x6c300000-0x6c3fffff]
[    0.810909] pci_bus 0000:03: resource 0 [io  0x4000-0x4fff]
[    0.810910] pci_bus 0000:03: resource 1 [mem 0x60000000-0x6c1fffff]
[    0.810911] pci_bus 0000:03: resource 2 [mem 0x6000000000-0x601bffffff 64bit pref]
[    0.810912] pci_bus 0000:2d: resource 0 [io  0x5000-0x5fff]
[    0.810913] pci_bus 0000:2d: resource 1 [mem 0x52000000-0x5e1fffff]
[    0.810914] pci_bus 0000:2d: resource 2 [mem 0x6020000000-0x603bffffff 64bit pref]
[    0.810916] pci_bus 0000:57: resource 1 [mem 0x6c200000-0x6c2fffff]
[    0.811130] pci 0000:00:0d.0: enabling device (0000 -> 0002)
[    0.811201] pci 0000:00:14.0: enabling device (0000 -> 0002)
[    0.811989] PCI: CLS 0 bytes, default 64
[    0.812004] DMAR: Intel-IOMMU force enabled due to platform opt in
[    0.812017] DMAR: No ATSR found
[    0.812018] DMAR: No SATC found
[    0.812020] DMAR: IOMMU feature fl1gp_support inconsistent
[    0.812021] DMAR: IOMMU feature pgsel_inv inconsistent
[    0.812022] DMAR: IOMMU feature nwfs inconsistent
[    0.812023] DMAR: IOMMU feature dit inconsistent
[    0.812024] DMAR: IOMMU feature sc_support inconsistent
[    0.812024] DMAR: IOMMU feature dev_iotlb_support inconsistent
[    0.812026] DMAR: dmar0: Using Queued invalidation
[    0.812032] DMAR: dmar1: Using Queued invalidation
[    0.812098] Trying to unpack rootfs image as initramfs...
[    0.812298] pci 0000:00:02.0: Adding to iommu group 0
[    0.812349] pci 0000:00:00.0: Adding to iommu group 1
[    0.812359] pci 0000:00:04.0: Adding to iommu group 2
[    0.812387] pci 0000:00:06.0: Adding to iommu group 3
[    0.812399] pci 0000:00:06.2: Adding to iommu group 4
[    0.812410] pci 0000:00:07.0: Adding to iommu group 5
[    0.812421] pci 0000:00:07.2: Adding to iommu group 6
[    0.812432] pci 0000:00:08.0: Adding to iommu group 7
[    0.812441] pci 0000:00:0a.0: Adding to iommu group 8
[    0.812461] pci 0000:00:0d.0: Adding to iommu group 9
[    0.812471] pci 0000:00:0d.2: Adding to iommu group 9
[    0.812481] pci 0000:00:0d.3: Adding to iommu group 9
[    0.812499] pci 0000:00:14.0: Adding to iommu group 10
[    0.812509] pci 0000:00:14.2: Adding to iommu group 10
[    0.812519] pci 0000:00:14.3: Adding to iommu group 11
[    0.812532] pci 0000:00:15.0: Adding to iommu group 12
[    0.812547] pci 0000:00:16.0: Adding to iommu group 13
[    0.812559] pci 0000:00:16.3: Adding to iommu group 13
[    0.812586] pci 0000:00:1c.0: Adding to iommu group 14
[    0.812601] pci 0000:00:1e.0: Adding to iommu group 15
[    0.812612] pci 0000:00:1e.2: Adding to iommu group 15
[    0.812635] pci 0000:00:1f.0: Adding to iommu group 16
[    0.812648] pci 0000:00:1f.3: Adding to iommu group 16
[    0.812659] pci 0000:00:1f.4: Adding to iommu group 16
[    0.812669] pci 0000:00:1f.5: Adding to iommu group 16
[    0.812680] pci 0000:02:00.0: Adding to iommu group 17
[    0.812706] pci 0000:57:00.0: Adding to iommu group 18
[    0.812879] DMAR: Intel(R) Virtualization Technology for Directed I/O
[    0.812880] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    0.812881] software IO TLB: mapped [mem 0x0000000025425000-0x0000000029425000] (64MB)
[    0.813264] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x1128af0325d, max_idle_ns: 440795261011 ns
[    0.813284] clocksource: Switched to clocksource tsc
[    0.813311] platform rtc_cmos: registered platform RTC device (no PNP device found)
[    0.813926] Initialise system trusted keyrings
[    0.813941] Key type blacklist registered
[    0.814035] workingset: timestamp_bits=36 max_order=22 bucket_order=0
[    0.814052] zbud: loaded
[    0.814271] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.814396] fuse: init (API version 7.38)
[    0.814579] integrity: Platform Keyring initialized
[    0.816997] Key type asymmetric registered
[    0.816998] Asymmetric key parser 'x509' registered
[    0.817019] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 243)
[    0.817122] io scheduler mq-deadline registered
[    0.820838] pcieport 0000:00:06.0: PME: Signaling with IRQ 122
[    0.821288] pcieport 0000:00:06.2: PME: Signaling with IRQ 123
[    0.821552] pcieport 0000:00:07.0: PME: Signaling with IRQ 124
[    0.821578] pcieport 0000:00:07.0: pciehp: Slot #3 AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug+ Surprise+ Interlock- NoCompl+ IbPresDis- LLActRep+
[    0.821998] pcieport 0000:00:07.2: PME: Signaling with IRQ 125
[    0.822019] pcieport 0000:00:07.2: pciehp: Slot #5 AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug+ Surprise+ Interlock- NoCompl+ IbPresDis- LLActRep+
[    0.822617] pcieport 0000:00:1c.0: PME: Signaling with IRQ 126
[    0.822792] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
[    0.823812] ACPI: AC: AC Adapter [AC] (on-line)
[    0.823874] input: Sleep Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input0
[    0.823894] ACPI: button: Sleep Button [SLPB]
[    0.823923] input: Lid Switch as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input1
[    0.823939] ACPI: button: Lid Switch [LID]
[    0.823965] input: Power Button as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input2
[    0.823981] ACPI: button: Power Button [PWRB]
[    0.824013] input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input3
[    0.824054] ACPI: button: Power Button [PWRF]

[    0.828496]
               Initialized Local Variables for Method [GETP]:
[    0.828498]   Local0: 0000000084821b95 <Obj>           Integer 0000000000000003

[    0.828507] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.828508]   Arg0:   000000001a62ef34 <Obj>           Integer 0000000000000000
[    0.828513]   Arg1:   00000000a0480f2d <Obj>           Integer 0000000000000003

[    0.828519] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.828539] ACPI Error: Aborting method \_TZ.CPUZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)

[    0.828598]
               Initialized Local Variables for Method [GETP]:
[    0.828600]   Local0: 00000000563addef <Obj>           Integer 0000000000000002

[    0.828605] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.828606]   Arg0:   0000000008fc944a <Obj>           Integer 0000000000000000
[    0.828610]   Arg1:   000000005e25a2f2 <Obj>           Integer 0000000000000002

[    0.828615] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.828624] ACPI Error: Aborting method \_TZ.CHOT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.828632] ACPI Error: Aborting method \_TZ.CPUZ._HOT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)

[    0.830155]
               Initialized Local Variables for Method [SETM]:
[    0.830157]   Local5: 000000005d9477ac <Obj>           Integer 0000000000000000
[    0.830164]   Local7: 00000000846084b4 <Obj>           Integer 0000000000000001

[    0.830169] Initialized Arguments for Method [SETM]:  (3 arguments defined for method invocation)
[    0.830170]   Arg0:   000000005e25a2f2 <Obj>           Integer 0000000000000000
[    0.830174]   Arg1:   000000008ad9a3a3 <Obj>           Integer 0000000000000001
[    0.830177]   Arg2:   00000000e350d060 <Obj>           Integer 0000000000000035

[    0.830183] ACPI Error: Aborting method \_TZ.SETM due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.830196] ACPI Error: Aborting method \_TZ.CPUZ._TMP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)

[    0.830244]
               Initialized Local Variables for Method [GETP]:
[    0.830245]   Local0: 000000008e4bbfbb <Obj>           Integer 0000000000000003

[    0.830250] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.830251]   Arg0:   000000005d9477ac <Obj>           Integer 0000000000000000
[    0.830254]   Arg1:   00000000846084b4 <Obj>           Integer 0000000000000003

[    0.830259] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.830268] ACPI Error: Aborting method \_TZ.CPUZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)

[    0.830320]
               Initialized Local Variables for Method [GETP]:
[    0.830321]   Local0: 000000005d9477ac <Obj>           Integer 0000000000000002

[    0.830325] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.830326]   Arg0:   000000001a62ef34 <Obj>           Integer 0000000000000000
[    0.830329]   Arg1:   000000005e25a2f2 <Obj>           Integer 0000000000000002

[    0.830333] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.830340] ACPI Error: Aborting method \_TZ.CHOT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.830347] ACPI Error: Aborting method \_TZ.CPUZ._HOT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.830356] ACPI: thermal: [Firmware Bug]: No valid trip found

[    0.830410]
               Initialized Local Variables for Method [GETP]:
[    0.830411]   Local0: 000000008ad9a3a3 <Obj>           Integer 0000000000000003

[    0.830415] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.830416]   Arg0:   0000000077cedccd <Obj>           Integer 0000000000000001
[    0.830419]   Arg1:   000000005d9477ac <Obj>           Integer 0000000000000003

[    0.830438] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.830446] ACPI Error: Aborting method \_TZ.GFXZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)

[    0.830474]
               Initialized Local Variables for Method [GETP]:
[    0.830475]   Local0: 000000008ad9a3a3 <Obj>           Integer 0000000000000001

[    0.830479] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.830480]   Arg0:   0000000077cedccd <Obj>           Integer 0000000000000001
[    0.830483]   Arg1:   000000005d9477ac <Obj>           Integer 0000000000000001

[    0.830487] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.830494] ACPI Error: Aborting method \_TZ.GFXZ._PSV due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)

[    0.831987]
               Initialized Local Variables for Method [SETM]:
[    0.831988]   Local5: 000000002d8f0baf <Obj>           Integer 0000000000000000
[    0.831994]   Local7: 000000000fcff59f <Obj>           Integer 0000000000000002

[    0.831998] Initialized Arguments for Method [SETM]:  (3 arguments defined for method invocation)
[    0.831999]   Arg0:   00000000d4c7b319 <Obj>           Integer 0000000000000001
[    0.832003]   Arg1:   00000000efa1fc8c <Obj>           Integer 0000000000000002
[    0.832005]   Arg2:   00000000c97928e0 <Obj>           Integer 0000000000000019

[    0.832010] ACPI Error: Aborting method \_TZ.SETM due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.832024] ACPI Error: Aborting method \_TZ.GFXZ._TMP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)

[    0.832067]
               Initialized Local Variables for Method [GETP]:
[    0.832068]   Local0: 00000000a2df3858 <Obj>           Integer 0000000000000003

[    0.832072] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.832072]   Arg0:   000000000fcff59f <Obj>           Integer 0000000000000001
[    0.832075]   Arg1:   00000000d4c7b319 <Obj>           Integer 0000000000000003

[    0.832078] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.832085] ACPI Error: Aborting method \_TZ.GFXZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)

[    0.832109]
               Initialized Local Variables for Method [GETP]:
[    0.832110]   Local0: 000000008e483dd8 <Obj>           Integer 0000000000000001

[    0.832113] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.832114]   Arg0:   000000000fcff59f <Obj>           Integer 0000000000000001
[    0.832116]   Arg1:   00000000d4c7b319 <Obj>           Integer 0000000000000001

[    0.832120] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.832126] ACPI Error: Aborting method \_TZ.GFXZ._PSV due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.832133] ACPI: thermal: [Firmware Bug]: No valid trip found

[    0.832179]
               Initialized Local Variables for Method [GETP]:
[    0.832180]   Local0: 000000002d8f0baf <Obj>           Integer 0000000000000003

[    0.832183] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.832184]   Arg0:   000000008e483dd8 <Obj>           Integer 0000000000000002
[    0.832186]   Arg1:   000000000fcff59f <Obj>           Integer 0000000000000003

[    0.832189] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.832196] ACPI Error: Aborting method \_TZ.EXTZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)

[    0.833641]
               Initialized Local Variables for Method [GETP]:
[    0.833642]   Local0: 000000008e483dd8 <Obj>           Integer 0000000000000003

[    0.833649] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.833649]   Arg0:   000000006dc35a0d <Obj>           Integer 0000000000000002
[    0.833652]   Arg1:   00000000b973eda0 <Obj>           Integer 0000000000000003

[    0.833656] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.833666] ACPI Error: Aborting method \_TZ.EXTZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.833675] ACPI: thermal: [Firmware Bug]: No valid trip found

[    0.833719]
               Initialized Local Variables for Method [GETP]:
[    0.833720]   Local0: 000000000fcff59f <Obj>           Integer 0000000000000003

[    0.833723] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.833724]   Arg0:   000000008e483dd8 <Obj>           Integer 0000000000000003
[    0.833726]   Arg1:   000000006dc35a0d <Obj>           Integer 0000000000000003

[    0.833729] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.833735] ACPI Error: Aborting method \_TZ.LOCZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)

[    0.835172]
               Initialized Local Variables for Method [GETP]:
[    0.835173]   Local0: 000000006dc35a0d <Obj>           Integer 0000000000000003

[    0.835179] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.835180]   Arg0:   000000008e483dd8 <Obj>           Integer 0000000000000003
[    0.835183]   Arg1:   00000000a1f95d60 <Obj>           Integer 0000000000000003

[    0.835187] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.835198] ACPI Error: Aborting method \_TZ.LOCZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.835207] ACPI: thermal: [Firmware Bug]: No valid trip found

[    0.835251]
               Initialized Local Variables for Method [GETP]:
[    0.835251]   Local0: 000000000fcff59f <Obj>           Integer 0000000000000003

[    0.835255] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.835255]   Arg0:   000000006dc35a0d <Obj>           Integer 0000000000000004
[    0.835258]   Arg1:   000000008e483dd8 <Obj>           Integer 0000000000000003

[    0.835261] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.835267] ACPI Error: Aborting method \_TZ.BATZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)

[    0.835288]
               Initialized Local Variables for Method [GETP]:
[    0.835288]   Local0: 00000000f3cc0fdd <Obj>           Integer 0000000000000001

[    0.835291] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.835292]   Arg0:   000000006dc35a0d <Obj>           Integer 0000000000000004
[    0.835294]   Arg1:   000000008e483dd8 <Obj>           Integer 0000000000000001

[    0.835298] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.835303] ACPI Error: Aborting method \_TZ.BATZ._PSV due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)

[    0.836747]
               Initialized Local Variables for Method [SETM]:
[    0.836749]   Local5: 000000000fcff59f <Obj>           Integer 0000000000000000
[    0.836754]   Local7: 00000000b289c990 <Obj>           Integer 0000000000000010

[    0.836758] Initialized Arguments for Method [SETM]:  (3 arguments defined for method invocation)
[    0.836759]   Arg0:   000000006dc35a0d <Obj>           Integer 0000000000000004
[    0.836761]   Arg1:   000000008e483dd8 <Obj>           Integer 0000000000000005
[    0.836764]   Arg2:   000000000cb0ff9f <Obj>           Integer 0000000000000017

[    0.836768] ACPI Error: Aborting method \_TZ.SETM due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.836779] ACPI Error: Aborting method \_TZ.BATZ._TMP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)

[    0.836815]
               Initialized Local Variables for Method [GETP]:
[    0.836815]   Local0: 000000000fcff59f <Obj>           Integer 0000000000000003

[    0.836819] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.836819]   Arg0:   000000006dc35a0d <Obj>           Integer 0000000000000004
[    0.836822]   Arg1:   000000008e483dd8 <Obj>           Integer 0000000000000003

[    0.836825] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.836831] ACPI Error: Aborting method \_TZ.BATZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)

[    0.836852]
               Initialized Local Variables for Method [GETP]:
[    0.836853]   Local0: 00000000c91293db <Obj>           Integer 0000000000000001

[    0.836856] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.836857]   Arg0:   000000006dc35a0d <Obj>           Integer 0000000000000004
[    0.836859]   Arg1:   000000008e483dd8 <Obj>           Integer 0000000000000001

[    0.836862] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.836867] ACPI Error: Aborting method \_TZ.BATZ._PSV due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.836874] ACPI: thermal: [Firmware Bug]: No valid trip found

[    0.836917]
               Initialized Local Variables for Method [GETP]:
[    0.836918]   Local0: 00000000b289c990 <Obj>           Integer 0000000000000003

[    0.836921] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.836922]   Arg0:   00000000c91293db <Obj>           Integer 0000000000000005
[    0.836924]   Arg1:   000000006dc35a0d <Obj>           Integer 0000000000000003

[    0.836927] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.836933] ACPI Error: Aborting method \_TZ.CHGZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)

[    0.838399]
               Initialized Local Variables for Method [GETP]:
[    0.838401]   Local0: 000000006dc35a0d <Obj>           Integer 0000000000000003

[    0.838407] Initialized Arguments for Method [GETP]:  (2 arguments defined for method invocation)
[    0.838408]   Arg0:   00000000c91293db <Obj>           Integer 0000000000000005
[    0.838410]   Arg1:   0000000052824e34 <Obj>           Integer 0000000000000003

[    0.838414] ACPI Error: Aborting method \_TZ.GETP due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.838435] ACPI Error: Aborting method \_TZ.CHGZ._CRT due to previous error (AE_AML_UNINITIALIZED_ELEMENT) (20230331/psparse-529)
[    0.838444] ACPI: thermal: [Firmware Bug]: No valid trip found
[    0.842755] thermal LNXTHERM:06: registered as thermal_zone0
[    0.842762] ACPI: thermal: Thermal Zone [PCHZ] (0 C)
[    0.843444] Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled
[    0.845034] serial 0000:00:16.3: enabling device (0000 -> 0003)
[    0.861294] ACPI: battery: Slot [BAT0] (battery present)
[    0.866373] 0000:00:16.3: ttyS4 at I/O 0x3060 (irq = 19, base_baud = 115200) is a 16550A
[    0.867085] hpet_acpi_add: no address or irqs in _CRS
[    0.867152] Linux agpgart interface v0.103
[    0.869336] tpm_tis IFX1520:00: 2.0 TPM (device-id 0x1D, rev-id 38)
[    0.963975] Freeing initrd memory: 64164K
[    1.025036] loop: module loaded
[    1.025298] tun: Universal TUN/TAP device driver, 1.6
[    1.025373] PPP generic driver version 2.4.2
[    1.025769] VFIO - User Level meta-driver version: 0.3
[    1.025865] i8042: PNP: PS/2 Controller [PNP0303:PS2K] at 0x60,0x64 irq 1
[    1.025868] i8042: PNP: PS/2 appears to have AUX port disabled, if this is incorrect please boot with i8042.nopnp
[    1.026619] serio: i8042 KBD port at 0x60,0x64 irq 1
[    1.026818] mousedev: PS/2 mouse device common for all mice
[    1.027190] rtc_cmos rtc_cmos: RTC can wake from S4
[    1.029045] rtc_cmos rtc_cmos: registered as rtc0
[    1.029426] rtc_cmos rtc_cmos: setting system clock to 2023-04-28T12:13:46 UTC (1682684026)
[    1.029468] rtc_cmos rtc_cmos: alarms up to one month, y3k, 114 bytes nvram
[    1.029477] i2c_dev: i2c /dev entries driver
[    1.030074] device-mapper: core: CONFIG_IMA_DISABLE_HTABLE is disabled. Duplicate IMA measurements will not be recorded in the IMA log.
[    1.030082] device-mapper: uevent: version 1.0.3
[    1.030158] device-mapper: ioctl: 4.48.0-ioctl (2023-03-01) initialised: dm-devel@redhat.com
[    1.030172] platform eisa.0: Probing EISA bus 0
[    1.030174] platform eisa.0: EISA: Cannot allocate resource for mainboard
[    1.030175] platform eisa.0: Cannot allocate resource for EISA slot 1
[    1.030176] platform eisa.0: Cannot allocate resource for EISA slot 2
[    1.030177] platform eisa.0: Cannot allocate resource for EISA slot 3
[    1.030178] platform eisa.0: Cannot allocate resource for EISA slot 4
[    1.030178] platform eisa.0: Cannot allocate resource for EISA slot 5
[    1.030179] platform eisa.0: Cannot allocate resource for EISA slot 6
[    1.030180] platform eisa.0: Cannot allocate resource for EISA slot 7
[    1.030181] platform eisa.0: Cannot allocate resource for EISA slot 8
[    1.030181] platform eisa.0: EISA: Detected 0 cards
[    1.030184] intel_pstate: Intel P-state driver initializing
[    1.032218] intel_pstate: HWP enabled
[    1.032833] ledtrig-cpu: registered to indicate activity on CPUs
[    1.032900] efifb: probing for efifb
[    1.032927] efifb: showing boot graphics
[    1.034869] efifb: framebuffer at 0x4000000000, using 9000k, total 9000k
[    1.034880] efifb: mode is 1920x1200x32, linelength=7680, pages=1
[    1.034885] efifb: scrolling: redraw
[    1.034887] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
[    1.035194] Console: switching to colour frame buffer device 240x75
[    1.038889] fb0: EFI VGA frame buffer device
[    1.039325] intel_pmc_core INT33A1:00:  initialized
[    1.039643] drop_monitor: Initializing network drop monitor service
[    1.039796] NET: Registered PF_INET6 protocol family
[    1.046016] Segment Routing with IPv6
[    1.046023] In-situ OAM (IOAM) with IPv6
[    1.046045] NET: Registered PF_PACKET protocol family
[    1.046110] Key type dns_resolver registered
[    1.047770] microcode: Microcode Update Driver: v2.2.
[    1.048177] resctrl: L2 allocation detected
[    1.048181] IPI shorthand broadcast: enabled
[    1.048994] sched_clock: Marking stable (957746928, 90422880)->(1079743707, -31573899)
[    1.049295] registered taskstats version 1
[    1.049629] Loading compiled-in X.509 certificates
[    1.050077] Loaded X.509 cert 'Build time autogenerated kernel key: efc831a9c65eff684b8c9039fb11dbd2ebac655e'
[    1.051464] Key type .fscrypt registered
[    1.051465] Key type fscrypt-provisioning registered
[    1.052518] Key type trusted registered
[    1.052644] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input4
[    1.054856] Key type encrypted registered
[    1.054864] AppArmor: AppArmor sha1 policy hashing enabled
[    1.055630] integrity: Loading X.509 certificate: UEFI:db
[    1.055648] integrity: Loaded X.509 cert 'HP Inc.: HP UEFI Secure Boot DB 2017: d9c01b50cfcae89d3b05345c163aa76e5dd589e7'
[    1.055648] integrity: Loading X.509 certificate: UEFI:db
[    1.055659] integrity: Loaded X.509 cert 'Microsoft Windows Production PCA 2011: a92902398e16c49778cd90f99e4f9ae17c55af53'
[    1.055659] integrity: Loading X.509 certificate: UEFI:db
[    1.055671] integrity: Loaded X.509 cert 'Microsoft Corporation UEFI CA 2011: 13adbf4309bd82709c8cd54f316ed522988a1bd4'
[    1.056226] Loading compiled-in module X.509 certificates
[    1.056548] Loaded X.509 cert 'Build time autogenerated kernel key: efc831a9c65eff684b8c9039fb11dbd2ebac655e'
[    1.056549] ima: Allocated hash algorithm: sha1
[    1.074145] ima: No architecture policies found
[    1.074160] evm: Initialising EVM extended attributes:
[    1.074161] evm: security.selinux
[    1.074161] evm: security.SMACK64
[    1.074162] evm: security.SMACK64EXEC
[    1.074163] evm: security.SMACK64TRANSMUTE
[    1.074164] evm: security.SMACK64MMAP
[    1.074164] evm: security.apparmor
[    1.074164] evm: security.ima
[    1.074165] evm: security.capability
[    1.074165] evm: HMAC attrs: 0x1
[    1.074569] PM:   Magic number: 3:532:229
[    1.074621] acpi device:76: hash matches
[    1.074953] acpi-cpufreq: probe of acpi-cpufreq failed with error -17
[    1.074998] RAS: Correctable Errors collector initialized.
[    1.078813] Freeing unused decrypted memory: 2036K
[    1.079802] Freeing unused kernel image (initmem) memory: 4424K
[    1.106710] Write protecting the kernel read-only data: 26624k
[    1.108346] Freeing unused kernel image (rodata/data gap) memory: 1336K
[    1.117226] x86/mm: Checked W+X mappings: passed, no W+X pages found.
[    1.117239] Run /init as init process
[    1.117241]   with arguments:
[    1.117243]     /init
[    1.117243]     splash
[    1.117244]   with environment:
[    1.117244]     HOME=/
[    1.117245]     TERM=linux
[    1.117245]     BOOT_IMAGE=/boot/vmlinuz-6.3.0+
[    1.188668] wmi_bus wmi_bus-PNP0C14:02: WQZZ data block query control method not found
[    1.215950] xhci_hcd 0000:00:0d.0: xHCI Host Controller
[    1.216325] xhci_hcd 0000:00:0d.0: new USB bus registered, assigned bus number 1
[    1.217422] xhci_hcd 0000:00:0d.0: hcc params 0x20007fc1 hci version 0x120 quirks 0x0000000200009810
[    1.226046] xhci_hcd 0000:00:0d.0: xHCI Host Controller
[    1.226059] xhci_hcd 0000:00:0d.0: new USB bus registered, assigned bus number 2
[    1.226067] xhci_hcd 0000:00:0d.0: Host supports USB 3.2 Enhanced SuperSpeed
[    1.226141] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.03
[    1.226147] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.226150] usb usb1: Product: xHCI Host Controller
[    1.226153] usb usb1: Manufacturer: Linux 6.3.0+ xhci-hcd
[    1.226155] usb usb1: SerialNumber: 0000:00:0d.0
[    1.227331] ACPI: bus type thunderbolt registered
[    1.229031] i801_smbus 0000:00:1f.4: enabling device (0000 -> 0003)
[    1.229455] i801_smbus 0000:00:1f.4: SPD Write Disable is set
[    1.229540] i801_smbus 0000:00:1f.4: SMBus using PCI interrupt
[    1.239613] i2c i2c-0: 4/4 memory slots populated (from DMI)
[    1.239619] i2c i2c-0: Memory type 0x22 not supported yet, not instantiating SPD
[    1.239687] hub 1-0:1.0: USB hub found
[    1.239711] hub 1-0:1.0: 1 port detected
[    1.244258] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.03
[    1.244267] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.244270] usb usb2: Product: xHCI Host Controller
[    1.244273] usb usb2: Manufacturer: Linux 6.3.0+ xhci-hcd
[    1.244275] usb usb2: SerialNumber: 0000:00:0d.0
[    1.244693] hub 2-0:1.0: USB hub found
[    1.244714] hub 2-0:1.0: 3 ports detected
[    1.248457] xhci_hcd 0000:00:14.0: xHCI Host Controller
[    1.248475] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 3
[    1.249692] xhci_hcd 0000:00:14.0: hcc params 0x20007fc1 hci version 0x120 quirks 0x0000100200009810
[    1.250282] xhci_hcd 0000:00:14.0: xHCI Host Controller
[    1.250289] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 4
[    1.250295] xhci_hcd 0000:00:14.0: Host supports USB 3.1 Enhanced SuperSpeed
[    1.250377] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.03
[    1.250383] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.250386] usb usb3: Product: xHCI Host Controller
[    1.250388] usb usb3: Manufacturer: Linux 6.3.0+ xhci-hcd
[    1.250390] usb usb3: SerialNumber: 0000:00:14.0
[    1.250660] hub 3-0:1.0: USB hub found
[    1.250705] hub 3-0:1.0: 12 ports detected
[    1.254498] usb usb4: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.03
[    1.254501] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.254503] usb usb4: Product: xHCI Host Controller
[    1.254504] usb usb4: Manufacturer: Linux 6.3.0+ xhci-hcd
[    1.254504] usb usb4: SerialNumber: 0000:00:14.0
[    1.254657] hub 4-0:1.0: USB hub found
[    1.254683] hub 4-0:1.0: 4 ports detected
[    1.255321] usb: port power management may be unreliable
[    1.296395] nvme 0000:02:00.0: platform quirk: setting simple suspend
[    1.296550] nvme nvme0: pci function 0000:02:00.0
[    1.306631] intel-lpss 0000:00:15.0: enabling device (0000 -> 0002)
[    1.307737] idma64 idma64.0: Found Intel integrated DMA 64-bit
[    1.312351] nvme nvme0: allocated 61 MiB host memory buffer.
[    1.326628] intel-lpss 0000:00:1e.0: enabling device (0000 -> 0002)
[    1.328043] idma64 idma64.1: Found Intel integrated DMA 64-bit
[    1.338727] intel-lpss 0000:00:1e.2: enabling device (0000 -> 0002)
[    1.341404] idma64 idma64.2: Found Intel integrated DMA 64-bit
[    1.382787] thunderbolt 0000:00:0d.2: 0: DROM data CRC32 mismatch (expected: 0x6c170589, got: 0xe0469681), aborting
[    1.382796] thunderbolt 0000:00:0d.2: 0: parsing DROM failed
[    1.382798] thunderbolt 0-0: reading DROM failed: -22
[    1.468417] nvme nvme0: 12/0/0 default/read/poll queues
[    1.476959]  nvme0n1: p1 p2
[    1.514478] usb 3-1: new high-speed USB device number 2 using xhci_hcd
[    1.552318] thunderbolt 0000:00:0d.3: 0: DROM data CRC32 mismatch (expected: 0x6c170589, got: 0xe0469681), aborting
[    1.552323] thunderbolt 0000:00:0d.3: 0: parsing DROM failed
[    1.552324] thunderbolt 1-0: reading DROM failed: -22
[    1.618363] random: crng reseeded on system resumption
[    1.618760] PM: hibernation: Marking nosave pages: [mem 0x00000000-0x00000fff]
[    1.618764] PM: hibernation: Marking nosave pages: [mem 0x0009f000-0x000fffff]
[    1.618768] PM: hibernation: Marking nosave pages: [mem 0x3472c000-0x34774fff]
[    1.618770] PM: hibernation: Marking nosave pages: [mem 0x34c49000-0x34c49fff]
[    1.618771] PM: hibernation: Marking nosave pages: [mem 0x3c0d3000-0x3fbfefff]
[    1.618974] PM: hibernation: Marking nosave pages: [mem 0x3fc00000-0xffffffff]
[    1.620626] PM: hibernation: Basic memory bitmaps created
[    1.620920] PM: hibernation: Basic memory bitmaps freed
[    1.644399] EXT4-fs (nvme0n1p2): mounted filesystem 2aec303b-7cd8-4d6f-8da6-b19769ec6332 with ordered data mode. Quota mode: none.
[    1.727716] usb 2-1: new SuperSpeed USB device number 2 using xhci_hcd
[    1.750769] usb 3-1: New USB device found, idVendor=30c9, idProduct=0040, bcdDevice= 0.02
[    1.750788] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    1.750795] usb 3-1: Product: HP 5MP Camera
[    1.750799] usb 3-1: Manufacturer: DLTDCX29IF4053
[    1.750804] usb 3-1: SerialNumber: 01.00.00
[    1.807347] usb 4-3: new SuperSpeed USB device number 2 using xhci_hcd
[    1.875878] usb 4-3: New USB device found, idVendor=0bda, idProduct=0315, bcdDevice= 2.17
[    1.875882] usb 4-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    1.875884] usb 4-3: Product: USB3.0 Card Reader
[    1.875886] usb 4-3: Manufacturer: Realtek
[    1.875887] usb 4-3: SerialNumber: 202006095347
[    1.880898] systemd[1]: Inserted module 'autofs4'
[    1.958617] usb 3-10: new full-speed USB device number 3 using xhci_hcd
[    2.015789] usb 2-1: New USB device found, idVendor=0b95, idProduct=1790, bcdDevice= 2.00
[    2.015794] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.015796] usb 2-1: Product: AX88179A
[    2.015798] usb 2-1: Manufacturer: ASIX
[    2.015799] usb 2-1: SerialNumber: 0077376A
[    2.026691] systemd[1]: systemd 245.4-4ubuntu3.20 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid)
[    2.026776] systemd[1]: Detected architecture x86-64.
[    2.088775] systemd[1]: Set hostname to <cirrus-laptop-hp1>.
[    2.110245] usb 3-10: New USB device found, idVendor=8087, idProduct=0033, bcdDevice= 0.00
[    2.110267] usb 3-10: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.120939] memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL, pid=1 'systemd'
[    2.326744] systemd[1]: Created slice system-modprobe.slice.
[    2.326876] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[    2.327037] systemd[1]: Created slice User and Session Slice.
[    2.327083] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    2.327242] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[    2.327275] systemd[1]: Reached target User and Group Name Lookups.
[    2.327286] systemd[1]: Reached target Remote File Systems.
[    2.327291] systemd[1]: Reached target Slices.
[    2.327388] systemd[1]: Listening on Syslog Socket.
[    2.327427] systemd[1]: Listening on fsck to fsckd communication Socket.
[    2.327450] systemd[1]: Listening on initctl Compatibility Named Pipe.
[    2.327538] systemd[1]: Listening on Journal Audit Socket.
[    2.327568] systemd[1]: Listening on Journal Socket (/dev/log).
[    2.327611] systemd[1]: Listening on Journal Socket.
[    2.327651] systemd[1]: Listening on udev Control Socket.
[    2.327675] systemd[1]: Listening on udev Kernel Socket.
[    2.351216] systemd[1]: Mounting Huge Pages File System...
[    2.353951] systemd[1]: Mounting POSIX Message Queue File System...
[    2.355604] systemd[1]: Mounting Kernel Debug File System...
[    2.356744] systemd[1]: Mounting Kernel Trace File System...
[    2.358242] systemd[1]: Starting Journal Service...
[    2.359363] systemd[1]: Starting Set the console keyboard layout...
[    2.360425] systemd[1]: Starting Create list of static device nodes for the current kernel...
[    2.361123] systemd[1]: Starting Load Kernel Module chromeos_pstore...
[    2.361725] systemd[1]: Starting Load Kernel Module drm...
[    2.362200] systemd[1]: Starting Load Kernel Module efi_pstore...
[    2.362804] systemd[1]: Starting Load Kernel Module pstore_blk...
[    2.363363] systemd[1]: Starting Load Kernel Module pstore_zone...
[    2.364242] systemd[1]: Starting Load Kernel Module ramoops...
[    2.367212] systemd[1]: Condition check resulted in Set Up Additional Binary Formats being skipped.
[    2.367280] systemd[1]: Condition check resulted in File System Check on Root Device being skipped.
[    2.370107] systemd[1]: Starting Load Kernel Modules...
[    2.370106] pstore: Using crash dump compression: deflate
[    2.375253] systemd[1]: Starting Remount Root and Kernel File Systems...
[    2.379304] systemd[1]: Starting udev Coldplug all Devices...
[    2.383764] systemd[1]: Starting Uncomplicated firewall...
[    2.390010] systemd[1]: Mounted Huge Pages File System.
[    2.390547] systemd[1]: Mounted POSIX Message Queue File System.
[    2.391046] systemd[1]: Mounted Kernel Debug File System.
[    2.391329] systemd[1]: Mounted Kernel Trace File System.
[    2.393363] systemd[1]: Finished Create list of static device nodes for the current kernel.
[    2.394710] systemd[1]: modprobe@pstore_blk.service: Succeeded.
[    2.396094] systemd[1]: Finished Load Kernel Module pstore_blk.
[    2.396882] systemd[1]: modprobe@pstore_zone.service: Succeeded.
[    2.398125] systemd[1]: Finished Load Kernel Module pstore_zone.
[    2.399002] systemd[1]: modprobe@ramoops.service: Succeeded.
[    2.400100] systemd[1]: Finished Load Kernel Module ramoops.
[    2.401969] systemd[1]: Finished Uncomplicated firewall.
[    2.435429] pstore: Registered efi_pstore as persistent store backend
[    2.437031] systemd[1]: modprobe@chromeos_pstore.service: Succeeded.
[    2.438542] systemd[1]: Finished Load Kernel Module chromeos_pstore.
[    2.439670] systemd[1]: modprobe@efi_pstore.service: Succeeded.
[    2.440063] systemd[1]: Finished Load Kernel Module efi_pstore.
[    2.443098] EXT4-fs (nvme0n1p2): re-mounted 2aec303b-7cd8-4d6f-8da6-b19769ec6332. Quota mode: none.
[    2.445901] systemd[1]: Finished Remount Root and Kernel File Systems.
[    2.448398] systemd[1]: Activating swap /swapfile...
[    2.449213] systemd[1]: Condition check resulted in Rebuild Hardware Database being skipped.
[    2.449306] systemd[1]: Condition check resulted in Platform Persistent Storage Archival being skipped.
[    2.450662] systemd[1]: Starting Load/Save Random Seed...
[    2.452136] systemd[1]: Starting Create System Users...
[    2.463392] Adding 16777212k swap on /swapfile.  Priority:-2 extents:180 across:339705856k SSFS
[    2.463546] systemd[1]: Activated swap /swapfile.
[    2.463636] systemd[1]: Reached target Swap.
[    2.466675] systemd[1]: Finished Load/Save Random Seed.
[    2.470563] systemd[1]: Finished Create System Users.
[    2.472238] systemd[1]: Starting Create Static Device Nodes in /dev...
[    2.478298] ACPI: bus type drm_connector registered
[    2.480122] systemd[1]: modprobe@drm.service: Succeeded.
[    2.480695] systemd[1]: Finished Load Kernel Module drm.
[    2.482740] lp: driver loaded but no devices found
[    2.483071] systemd[1]: Finished Set the console keyboard layout.
[    2.487006] ppdev: user-space parallel port driver
[    2.487388] systemd[1]: Finished Create Static Device Nodes in /dev.
[    2.487495] systemd[1]: Reached target Local File Systems (Pre).
[    2.489757] parport0: PC-style at 0x278 [PCSPP,EPP]
[    2.495008] systemd[1]: Mounting Mount unit for bare, revision 5...
[    2.496811] systemd[1]: Mounting Mount unit for core18, revision 2714...
[    2.498248] systemd[1]: Mounting Mount unit for core18, revision 2721...
[    2.499124] loop0: detected capacity change from 0 to 8
[    2.500126] systemd[1]: Mounting Mount unit for core20, revision 1828...
[    2.501631] systemd[1]: Mounting Mount unit for core20, revision 1852...
[    2.503507] systemd[1]: Mounting Mount unit for gnome-3-34-1804, revision 90...
[    2.506677] systemd[1]: Mounting Mount unit for gnome-3-34-1804, revision 93...
[    2.508334] systemd[1]: Mounting Mount unit for gnome-3-38-2004, revision 137...
[    2.509896] systemd[1]: Mounting Mount unit for gnome-3-38-2004, revision 140...
[    2.514365] systemd[1]: Mounting Mount unit for gtk-common-themes, revision 1534...
[    2.516631] systemd[1]: Mounting Mount unit for gtk-common-themes, revision 1535...
[    2.519324] systemd[1]: Mounting Mount unit for snap-store, revision 599...
[    2.521688] systemd[1]: Mounting Mount unit for snap-store, revision 638...
[    2.523176] systemd[1]: Mounting Mount unit for snapd, revision 18596...
[    2.524469] systemd[1]: Mounting Mount unit for snapd, revision 18933...
[    2.525680] systemd[1]: Starting udev Kernel Device Manager...
[    2.526231] systemd[1]: Started Journal Service.
[    2.530464] loop1: detected capacity change from 0 to 113888
[    2.530613] loop2: detected capacity change from 0 to 94064
[    2.540184] systemd-journald[298]: Received client request to flush runtime journal.
[    2.558824] loop3: detected capacity change from 0 to 102072
[    2.558870] loop4: detected capacity change from 0 to 94056
[    2.558908] loop5: detected capacity change from 0 to 109032
[    2.558944] loop6: detected capacity change from 0 to 716168
[    2.578704] loop7: detected capacity change from 0 to 187776
[    2.579052] loop8: detected capacity change from 0 to 447264
[    2.583126] loop10: detected capacity change from 0 to 716160
[    2.583127] loop9: detected capacity change from 0 to 447264
[    2.583231] loop12: detected capacity change from 0 to 129608
[    2.583233] loop11: detected capacity change from 0 to 129672
[    2.583252] loop13: detected capacity change from 0 to 166424
[    2.598871] lp0: using parport0 (polling).
[    2.704361] loop14: detected capacity change from 0 to 113896
[    2.754989] Consider using thermal netlink events interface
[    2.756517] input: Intel HID events as /devices/platform/INTC1070:00/input/input5
[    2.760346] intel-hid INTC1070:00: platform supports 5 button array
[    2.765457] input: Intel HID 5 button array as /devices/platform/INTC1070:00/input/input6
[    2.805436] Serial bus multi instantiate pseudo device driver CSC3551:00: Instantiated 2 SPI devices.
[    2.886808] resource: resource sanity check: requesting [mem 0x00000000fedc0000-0x00000000fedcffff], which spans more than pnp 00:04 [mem 0xfedc0000-0xfedc7fff]
[    2.886827] caller igen6_probe+0x178/0x8e0 [igen6_edac] mapping multiple BARs
[    2.888880] EDAC MC0: Giving out device to module igen6_edac controller Intel_client_SoC MC#0: DEV 0000:00:00.0 (INTERRUPT)
[    2.888996] EDAC MC1: Giving out device to module igen6_edac controller Intel_client_SoC MC#1: DEV 0000:00:00.0 (INTERRUPT)
[    2.889033] EDAC igen6 MC1: HANDLING IBECC MEMORY ERROR
[    2.889036] EDAC igen6 MC1: ADDR 0x7fffffffe0
[    2.889041] EDAC igen6 MC0: HANDLING IBECC MEMORY ERROR
[    2.889043] EDAC igen6 MC0: ADDR 0x7fffffffe0
[    2.889131] EDAC igen6: v2.5
[    2.927784] dw-apb-uart.1: ttyS5 at MMIO 0x4017001000 (irq = 16, base_baud = 6250000) is a 16550A
[    2.928529] mei_me 0000:00:16.0: enabling device (0000 -> 0002)
[    2.931722] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    2.932363] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    3.014650] Bluetooth: Core ver 2.22
[    3.014863] NET: Registered PF_BLUETOOTH protocol family
[    3.014866] Bluetooth: HCI device and connection manager initialized
[    3.014871] Bluetooth: HCI socket layer initialized
[    3.014873] Bluetooth: L2CAP socket layer initialized
[    3.014878] Bluetooth: SCO socket layer initialized
[    3.027815] mc: Linux media interface: v0.10
[    3.027999] Intel(R) Wireless WiFi driver for Linux
[    3.028250] iwlwifi 0000:00:14.3: enabling device (0000 -> 0002)
[    3.031951] usb-storage 4-3:1.0: USB Mass Storage device detected
[    3.034307] scsi host0: usb-storage 4-3:1.0
[    3.040559] proc_thermal_pci 0000:00:04.0: enabling device (0000 -> 0002)
[    3.041776] usbcore: registered new interface driver cdc_ether
[    3.049687] usbcore: registered new interface driver usb-storage
[    3.053173] intel_rapl_common: Found RAPL domain package
[    3.053898] videodev: Linux video capture interface: v2.00
[    3.053993] usbcore: registered new interface driver uas
[    3.054686] iwlwifi 0000:00:14.3: Detected crf-id 0x400410, cnv-id 0x80400 wfpm id 0x80000020
[    3.054745] iwlwifi 0000:00:14.3: PCI dev 51f0/0094, rev=0x370, rfid=0x2010d000
[    3.055952] iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-so-a0-gf-a0-78.ucode failed with error -2
[    3.056220] iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-so-a0-gf-a0-77.ucode failed with error -2
[    3.056254] iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-so-a0-gf-a0-76.ucode failed with error -2
[    3.056277] iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-so-a0-gf-a0-75.ucode failed with error -2
[    3.056303] iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-so-a0-gf-a0-74.ucode failed with error -2
[    3.059399] RAPL PMU: API unit is 2^-32 Joules, 4 fixed counters, 655360 ms ovfl timer
[    3.059408] RAPL PMU: hw unit of domain pp0-core 2^-14 Joules
[    3.059411] RAPL PMU: hw unit of domain package 2^-14 Joules
[    3.059414] RAPL PMU: hw unit of domain pp1-gpu 2^-14 Joules
[    3.059415] RAPL PMU: hw unit of domain psys 2^-14 Joules
[    3.062682] usbcore: registered new interface driver btusb
[    3.065152] Bluetooth: hci0: Device revision is 0
[    3.065160] Bluetooth: hci0: Secure boot is enabled
[    3.065162] Bluetooth: hci0: OTP lock is enabled
[    3.065164] Bluetooth: hci0: API lock is enabled
[    3.065166] Bluetooth: hci0: Debug lock is disabled
[    3.065167] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[    3.065171] Bluetooth: hci0: Bootloader timestamp 2019.40 buildtype 1 build 38
[    3.087470] cryptd: max_cpu_qlen set to 1000
[    3.096703] Bluetooth: hci0: Found device firmware: intel/ibt-0040-0041.sfi
[    3.096738] Bluetooth: hci0: Boot Address: 0x100800
[    3.096740] Bluetooth: hci0: Firmware Version: 118-22.22
[    3.100644] iwlwifi 0000:00:14.3: api flags index 2 larger than supported by driver
[    3.100681] iwlwifi 0000:00:14.3: TLV_FW_FSEQ_VERSION: FSEQ Version: 0.0.2.36
[    3.101462] iwlwifi 0000:00:14.3: loaded firmware version 73.35c0a2c6.0 so-a0-gf-a0-73.ucode op_mode iwlmvm
[    3.111298] AVX2 version of gcm_enc/dec engaged.
[    3.111445] AES CTR mode by8 optimization enabled
[    3.121076] usb 3-1: Found UVC 1.50 device HP 5MP Camera (30c9:0040)
[    3.131060] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.0: Cirrus Logic CS35L41 (35a40), Revision: B2
[    3.133980] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.1: Reset line busy, assuming shared reset
[    3.205122] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.1: Cirrus Logic CS35L41 (35a40), Revision: B2
[    3.214495] intel_rapl_msr: PL4 support detected.
[    3.214985] intel_rapl_common: Found RAPL domain package
[    3.214994] intel_rapl_common: Found RAPL domain core
[    3.214997] intel_rapl_common: Found RAPL domain uncore
[    3.215002] intel_rapl_common: Found RAPL domain psys
[    3.217654] usb 3-1: Found UVC 1.50 device HP 5MP Camera (30c9:0040)
[    3.225228] cdc_ncm 2-1:2.0: MAC-Address: f8:e4:3b:77:37:6a
[    3.225240] cdc_ncm 2-1:2.0: setting rx_max = 16384
[    3.247858] usbcore: registered new interface driver uvcvideo
[    3.252271] cdc_ncm 2-1:2.0: setting tx_max = 16384
[    3.293506] iwlwifi 0000:00:14.3: Detected Intel(R) Wi-Fi 6E AX211 160MHz, REV=0x370
[    3.326225] cdc_ncm 2-1:2.0 eth0: register 'cdc_ncm' at usb-0000:00:0d.0-1, CDC NCM (NO ZLP), f8:e4:3b:77:37:6a
[    3.326567] thermal thermal_zone6: failed to read out thermal zone (-61)
[    3.340518] usbcore: registered new interface driver cdc_ncm
[    3.487143] iwlwifi 0000:00:14.3: WFPM_UMAC_PD_NOTIFICATION: 0x1f
[    3.487198] iwlwifi 0000:00:14.3: WFPM_LMAC2_PD_NOTIFICATION: 0x1f
[    3.487207] iwlwifi 0000:00:14.3: WFPM_AUTH_KEY_0: 0x80
[    3.487217] iwlwifi 0000:00:14.3: CNVI_SCU_SEQ_DATA_DW9: 0x0
[    3.488325] iwlwifi 0000:00:14.3: loaded PNVM version 881c99e1
[    3.500073] iwlwifi 0000:00:14.3: Detected RF GF, rfid=0x2010d000
[    3.570016] iwlwifi 0000:00:14.3: base HW address: ac:82:47:d7:75:5d
[    3.588208] usbcore: registered new interface driver cdc_wdm
[    3.590329] i915 0000:00:02.0: [drm] VT-d active for gfx access
[    3.590638] Console: switching to colour dummy device 80x25
[    3.590778] i915 0000:00:02.0: vgaarb: deactivate vga console
[    3.590955] i915 0000:00:02.0: [drm] Using Transparent Hugepages
[    3.591643] i915 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem
[    3.597888] i915 0000:00:02.0: Direct firmware load for i915/adlp_dmc.bin failed with error -2
[    3.600261] usbcore: registered new interface driver cdc_mbim
[    3.602444] i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/adlp_dmc_ver2_16.bin (v2.16)
[    3.603086] iwlwifi 0000:00:14.3 wlp0s20f3: renamed from wlan0
[    3.606623] mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_ops [i915])
[    3.610852] snd_hda_intel 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    3.611059] snd_hda_intel 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[    3.623336] i915 0000:00:02.0: [drm] GT0: GuC firmware i915/adlp_guc_70.bin (70.5) is recommended, but only i915/adlp_guc_70.1.1.bin (70.1) was found
[    3.623349] i915 0000:00:02.0: [drm] GT0: Consider updating your linux-firmware pkg or downloading from https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/i915
[    3.631635] i915 0000:00:02.0: [drm] GT0: HuC firmware i915/tgl_huc.bin (0.0) is recommended, but only i915/tgl_huc_7.9.3.bin (7.9) was found
[    3.631645] i915 0000:00:02.0: [drm] GT0: Consider updating your linux-firmware pkg or downloading from https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/i915
[    3.636290] i915 0000:00:02.0: [drm] GT0: GuC firmware i915/adlp_guc_70.1.1.bin version 70.1.1
[    3.636297] i915 0000:00:02.0: [drm] GT0: HuC firmware i915/tgl_huc_7.9.3.bin version 7.9.3
[    3.639147] cdc_ncm 2-1:2.0 enxf8e43b77376a: renamed from eth0
[    3.654081] i915 0000:00:02.0: [drm] GT0: HuC: authenticated!
[    3.654562] i915 0000:00:02.0: [drm] GT0: GUC: submission enabled
[    3.654565] i915 0000:00:02.0: [drm] GT0: GUC: SLPC enabled
[    3.655003] i915 0000:00:02.0: [drm] GT0: GUC: RC enabled
[    3.721731] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if info 0x040100
[    3.721869] sof-audio-pci-intel-tgl 0000:00:1f.3: Digital mics found on Skylake+ platform, using SOF driver
[    3.721887] sof-audio-pci-intel-tgl 0000:00:1f.3: enabling device (0000 -> 0002)
[    3.722156] sof-audio-pci-intel-tgl 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040100
[    4.066216] scsi 0:0:0:0: Direct-Access     Generic- SD/MMC/MS/MSPRO  1.00 PQ: 0 ANSI: 6
[    4.066422] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    4.091368] audit: type=1400 audit(1682684029.559:2): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libreoffice-senddoc" pid=566 comm="apparmor_parser"
[    4.091402] audit: type=1400 audit(1682684029.559:3): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe" pid=565 comm="apparmor_parser"
[    4.091405] audit: type=1400 audit(1682684029.559:4): apparmor="STATUS" operation="profile_load" profile="unconfined" name="nvidia_modprobe//kmod" pid=565 comm="apparmor_parser"
[    4.091429] audit: type=1400 audit(1682684029.559:5): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libreoffice-xpdfimport" pid=562 comm="apparmor_parser"
[    4.091461] audit: type=1400 audit(1682684029.559:6): apparmor="STATUS" operation="profile_load" profile="unconfined" name="ippusbxd" pid=571 comm="apparmor_parser"
[    4.091605] audit: type=1400 audit(1682684029.559:7): apparmor="STATUS" operation="profile_load" profile="unconfined" name="libreoffice-oopslash" pid=564 comm="apparmor_parser"
[    4.091848] audit: type=1400 audit(1682684029.559:8): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/bin/man" pid=567 comm="apparmor_parser"
[    4.091851] audit: type=1400 audit(1682684029.559:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="man_filter" pid=567 comm="apparmor_parser"
[    4.091853] audit: type=1400 audit(1682684029.559:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="man_groff" pid=567 comm="apparmor_parser"
[    4.708430] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    4.708434] Bluetooth: BNEP filters: protocol multicast
[    4.708437] Bluetooth: BNEP socket layer initialized
[    4.782765] Bluetooth: hci0: Waiting for firmware download to complete
[    4.783097] Bluetooth: hci0: Firmware loaded in 1646860 usecs
[    4.783178] Bluetooth: hci0: Waiting for device to boot
[    4.801155] Bluetooth: hci0: Device booted in 17610 usecs
[    4.801177] Bluetooth: hci0: Malformed MSFT vendor event: 0x02
[    4.807850] Bluetooth: hci0: Found Intel DDC parameters: intel/ibt-0040-0041.ddc
[    4.811134] Bluetooth: hci0: Applying Intel DDC parameters completed
[    4.811313] [drm] Initialized i915 1.6.0 20201103 for 0000:00:02.0 on minor 0
[    4.813302] ACPI: video: Video Device [GFX0] (multi-head: yes  rom: no  post: no)
[    4.813841] input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input7
[    4.813967] sof-audio-pci-intel-tgl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    4.814118] Bluetooth: hci0: Firmware timestamp 2022.22 buildtype 1 build 44918
[    4.816179] fbcon: i915drmfb (fb0) is primary device
[    4.825657] Console: switching to colour frame buffer device 240x75
[    4.846443] i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device
[    4.846629] sd 0:0:0:0: [sda] 61063168 512-byte logical blocks: (31.3 GB/29.1 GiB)
[    4.847050] sd 0:0:0:0: [sda] Write Protect is off
[    4.847054] sd 0:0:0:0: [sda] Mode Sense: 2f 00 00 00
[    4.847338] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[    4.850185] sd 0:0:0:0: [sda] Attached SCSI disk
[    4.883247] Bluetooth: MGMT ver 1.22
[    4.887288] sof-audio-pci-intel-tgl 0000:00:1f.3: use msi interrupt mode
[    4.896916] NET: Registered PF_ALG protocol family
[    4.965919] sof-audio-pci-intel-tgl 0000:00:1f.3: hda codecs found, mask 5
[    4.965932] sof-audio-pci-intel-tgl 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[    4.965942] sof-audio-pci-intel-tgl 0000:00:1f.3: DMICs detected in NHLT tables: 2
[    5.006178] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 1:8:0-f9f4a
[    5.006192] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:18:1 Kernel ABI 3:23:0
[    5.006211] sof-audio-pci-intel-tgl 0000:00:1f.3: unknown sof_ext_man header type 3 size 0x30
[    5.116835] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware info: version 1:8:0-f9f4a
[    5.116846] sof-audio-pci-intel-tgl 0000:00:1f.3: Firmware: ABI 3:18:1 Kernel ABI 3:23:0
[    5.133106] iwlwifi 0000:00:14.3: WFPM_UMAC_PD_NOTIFICATION: 0x1f
[    5.133158] iwlwifi 0000:00:14.3: WFPM_LMAC2_PD_NOTIFICATION: 0x1f
[    5.133167] iwlwifi 0000:00:14.3: WFPM_AUTH_KEY_0: 0x80
[    5.133177] iwlwifi 0000:00:14.3: CNVI_SCU_SEQ_DATA_DW9: 0x0
[    5.134711] sof-audio-pci-intel-tgl 0000:00:1f.3: Topology: ABI 3:18:1 Kernel ABI 3:23:0
[    5.135318] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: Parent card not yet available, widget card binding deferred
[    5.213647] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.0: DSP1: Firmware version: 3
[    5.213656] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.0: DSP1: cirrus/cs35l41-dsp1-spk-prot-103c8973.wmfw: Fri 27 Aug 2021 14:58:19 W. Europe Daylight Time
[    5.221645] iwlwifi 0000:00:14.3: Registered PHC clock: iwlwifi-PTP, with index: 0
[    5.287800] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.0: DSP1: Firmware: 400a4 vendor: 0x2 v0.43.1, 2 algorithms
[    5.288501] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.0: DSP1: 0: ID cd v29.63.1 XM@94 YM@e
[    5.288509] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.0: DSP1: 1: ID f20b v0.1.0 XM@176 YM@0
[    5.288514] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.0: DSP1: spk-prot: E:\Amp Tuning\HP\860\0527 LS R754 UPDATE THERMAL\103C8973_220527.bin
[    5.311552] snd_hda_codec_realtek ehdaudio0D0: bound spi0-CSC3551:00-cs35l41-hda.0 (ops cs35l41_hda_comp_ops [snd_hda_scodec_cs35l41])
[    5.312034] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.1: DSP1: Firmware version: 3
[    5.312039] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.1: DSP1: cirrus/cs35l41-dsp1-spk-prot-103c8973.wmfw: Fri 27 Aug 2021 14:58:19 W. Europe Daylight Time
[    5.374781] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.1: DSP1: Firmware: 400a4 vendor: 0x2 v0.43.1, 2 algorithms
[    5.375509] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.1: DSP1: 0: ID cd v29.63.1 XM@94 YM@e
[    5.375519] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.1: DSP1: 1: ID f20b v0.1.0 XM@176 YM@0
[    5.375524] cs35l41-hda spi0-CSC3551:00-cs35l41-hda.1: DSP1: spk-prot: E:\Amp Tuning\HP\860\0527 LS R754 UPDATE THERMAL\103C8973_220527.bin
[    5.402679] snd_hda_codec_realtek ehdaudio0D0: bound spi0-CSC3551:00-cs35l41-hda.1 (ops cs35l41_hda_comp_ops [snd_hda_scodec_cs35l41])
[    5.403247] snd_hda_codec_realtek ehdaudio0D0: autoconfig for ALC245: line_outs=1 (0x17/0x0/0x0/0x0/0x0) type:speaker
[    5.403253] snd_hda_codec_realtek ehdaudio0D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    5.403255] snd_hda_codec_realtek ehdaudio0D0:    hp_outs=1 (0x21/0x0/0x0/0x0/0x0)
[    5.403257] snd_hda_codec_realtek ehdaudio0D0:    mono: mono_out=0x0
[    5.403258] snd_hda_codec_realtek ehdaudio0D0:    inputs:
[    5.403260] snd_hda_codec_realtek ehdaudio0D0:      Mic=0x19
[    5.461829] snd_hda_codec_realtek ehdaudio0D0: ASoC: sink widget AIF1TX overwritten
[    5.461839] snd_hda_codec_realtek ehdaudio0D0: ASoC: source widget AIF1RX overwritten
[    5.462002] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi3 overwritten
[    5.462008] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi2 overwritten
[    5.462013] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget hifi1 overwritten
[    5.462018] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Codec Output Pin1 overwritten
[    5.462021] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Codec Input Pin1 overwritten
[    5.462027] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Analog Codec Playback overwritten
[    5.462032] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Digital Codec Playback overwritten
[    5.462037] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sink widget Alt Analog Codec Playback overwritten
[    5.462044] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Analog Codec Capture overwritten
[    5.462049] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Digital Codec Capture overwritten
[    5.462054] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: source widget Alt Analog Codec Capture overwritten
[    5.462065] skl_hda_dsp_generic skl_hda_dsp_generic: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 3
[    5.498173] input: sof-hda-dsp Mic as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input8
[    5.498297] input: sof-hda-dsp Headphone as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input9
[    5.498396] input: sof-hda-dsp HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input10
[    5.498558] input: sof-hda-dsp HDMI/DP,pcm=4 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input11
[    5.498667] input: sof-hda-dsp HDMI/DP,pcm=5 as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input12
[    5.923031] IPv6: ADDRCONF(NETDEV_CHANGE): enxf8e43b77376a: link becomes ready
[    5.955085] Bluetooth: RFCOMM TTY layer initialized
[    5.955096] Bluetooth: RFCOMM socket layer initialized
[    5.955102] Bluetooth: RFCOMM ver 1.11
[    6.063935] loop15: detected capacity change from 0 to 8
[    9.487745] rfkill: input handler disabled
[    9.673554] kauditd_printk_skb: 28 callbacks suppressed
[    9.673560] audit: type=1400 audit(1682684035.139:39): apparmor="DENIED" operation="capable" class="cap" profile="/snap/snapd/18933/usr/lib/snapd/snap-confine" pid=1563 comm="snap-confine" capability=4  capname="fsetid"
[   11.919458] audit: type=1326 audit(1682684037.387:40): auid=1000 uid=1000 gid=1000 ses=2 subj=snap.snap-store.snap-store pid=1563 comm="snap-store" exe="/snap/snap-store/638/usr/bin/snap-store" sig=0 arch=c000003e syscall=314 compat=0 ip=0x7f6f3c3eb73d code=0x50000
[   13.994449] audit: type=1400 audit(1682684039.459:41): apparmor="DENIED" operation="open" class="file" profile="snap.snap-store.snap-store" name="/var/lib/snapd/hostfs/usr/share/gdm/greeter/applications/gnome-initial-setup.desktop" pid=1563 comm="snap-store" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[   14.012522] audit: type=1400 audit(1682684039.479:42): apparmor="DENIED" operation="open" class="file" profile="snap.snap-store.snap-store" name="/var/lib/snapd/hostfs/usr/share/gdm/greeter/applications/gnome-initial-setup.desktop" pid=1563 comm="snap-store" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[   14.193251] audit: type=1326 audit(1682684039.659:43): auid=1000 uid=1000 gid=1000 ses=2 subj=snap.snap-store.snap-store pid=1563 comm="snap-store" exe="/snap/snap-store/638/usr/bin/snap-store" sig=0 arch=c000003e syscall=93 compat=0 ip=0x7f6f3c3e239b code=0x50000
[   14.513722] audit: type=1400 audit(1682684039.979:44): apparmor="DENIED" operation="open" class="file" profile="snap.snap-store.snap-store" name="/etc/PackageKit/Vendor.conf" pid=1563 comm="snap-store" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[   14.795762] audit: type=1400 audit(1682684040.263:45): apparmor="DENIED" operation="open" class="file" profile="snap.snap-store.snap-store" name="/etc/appstream.conf" pid=1563 comm="snap-store" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[   23.410307] audit: type=1400 audit(1682684048.875:46): apparmor="DENIED" operation="open" class="file" profile="snap.snap-store.snap-store" name="/var/lib/snapd/hostfs/usr/share/gdm/greeter/applications/gnome-initial-setup.desktop" pid=1563 comm="pool-org.gnome." requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[   23.429565] audit: type=1400 audit(1682684048.895:47): apparmor="DENIED" operation="open" class="file" profile="snap.snap-store.snap-store" name="/var/lib/snapd/hostfs/usr/share/gdm/greeter/applications/gnome-initial-setup.desktop" pid=1563 comm="pool-org.gnome." requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[   23.607930] audit: type=1326 audit(1682684049.075:48): auid=1000 uid=1000 gid=1000 ses=2 subj=snap.snap-store.snap-store pid=1563 comm="pool-org.gnome." exe="/snap/snap-store/638/usr/bin/snap-store" sig=0 arch=c000003e syscall=93 compat=0 ip=0x7f6f3c3e239b code=0x50000
Mahapatra, Amit Kumar May 2, 2023, 11:40 a.m. UTC | #8
Hello Stefan,

> -----Original Message-----
> From: Stefan Binding <sbinding@opensource.cirrus.com>
> Sent: Friday, April 28, 2023 7:38 PM
> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
> vigneshr@ti.com
> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
> claudiu.beznea@microchip.com; Simek, Michal <michal.simek@amd.com>;
> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
> Subject: Re: [PATCH V7 1/7] spi: Add stacked and parallel memories support
> in SPI core
> 
> Hi,
> 
> On 27/04/2023 18:09, Mahapatra, Amit Kumar wrote:
> > Hello Stefan,
> >
> >> -----Original Message-----
> >> From: Stefan Binding <sbinding@opensource.cirrus.com>
> >> Sent: Tuesday, April 25, 2023 5:50 PM
> >> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
> >> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
> >> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
> >> vigneshr@ti.com
> >> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org; linux-
> >> kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
> >> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
> >> claudiu.beznea@microchip.com; Simek, Michal
> <michal.simek@amd.com>;
> >> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
> >> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
> >> Subject: Re: [PATCH V7 1/7] spi: Add stacked and parallel memories
> >> support in SPI core
> >>
> >> Hi,
> >>
> >> On 20/04/2023 10:04, Mahapatra, Amit Kumar wrote:
> >>> Hello Stefan,
> >>>
> >>>> -----Original Message-----
> >>>> From: Stefan Binding <sbinding@opensource.cirrus.com>
> >>>> Sent: Wednesday, April 12, 2023 8:33 PM
> >>>> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
> >>>> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
> >>>> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
> >>>> vigneshr@ti.com
> >>>> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org;
> >>>> linux- kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
> >>>> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
> >>>> claudiu.beznea@microchip.com; Simek, Michal
> >> <michal.simek@amd.com>;
> >>>> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
> >>>> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
> >>>> Subject: Re: [PATCH V7 1/7] spi: Add stacked and parallel memories
> >>>> support in SPI core
> >>>>
> >>>> Hi,
> >>>>
> >>>> On 11/04/2023 10:07, Mahapatra, Amit Kumar wrote:
> >>>>> Hello Stefan,
> >>>>>
> >>>>>> -----Original Message-----
> >>>>>> From: Stefan Binding <sbinding@opensource.cirrus.com>
> >>>>>> Sent: Thursday, April 6, 2023 7:14 PM
> >>>>>> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
> >>>>>> broonie@kernel.org; tudor.ambarus@linaro.org;
> >>>>>> pratyush@kernel.org; michael@walle.cc;
> miquel.raynal@bootlin.com;
> >>>>>> richard@nod.at; vigneshr@ti.com
> >>>>>> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org;
> >>>>>> linux- kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
> >>>>>> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
> >>>>>> claudiu.beznea@microchip.com; Simek, Michal
> >>>> <michal.simek@amd.com>;
> >>>>>> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
> >>>>>> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
> >>>>>> Subject: RE: [PATCH V7 1/7] spi: Add stacked and parallel
> >>>>>> memories support in SPI core
> >>>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>>> -----Original Message-----
> >>>>>>> From: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
> >>>>>>> Sent: Thursday, April 6, 2023 7:54 AM
> >>>>>>> To: broonie@kernel.org; tudor.ambarus@linaro.org;
> >>>>>>> pratyush@kernel.org; michael@walle.cc;
> >>>>>>> miquel.raynal@bootlin.com; richard@nod.at; vigneshr@ti.com
> >>>>>>> Cc: git@amd.com; sbinding@opensource.cirrus.com; linux-
> >>>>>>> spi@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> >>>>>>> mtd@lists.infradead.org; nicolas.ferre@microchip.com;
> >>>>>>> alexandre.belloni@bootlin.com; claudiu.beznea@microchip.com;
> >>>>>>> michal.simek@amd.com; linux-arm-kernel@lists.infradead.org;
> >>>>>>> amitrkcian2002@gmail.com; Amit Kumar Mahapatra <amit.kumar-
> >>>>>>> mahapatra@amd.com>
> >>>>>>> Subject: [PATCH V7 1/7] spi: Add stacked and parallel memories
> >>>>>> support
> >>>>>>> in SPI core
> >>>>>>>
> >>>>>>> For supporting multiple CS the SPI device need to be aware of
> >>>>>>> all
> >>>>>> the CS
> >>>>>>> values. So, the "chip_select" member in the spi_device structure
> >>>>>>> is
> >>>>>> now
> >>>>>>> an
> >>>>>>> array that holds all the CS values.
> >>>>>>>
> >>>>>>> spi_device structure now has a "cs_index_mask" member. This acts
> >>>>>>> as
> >>>>>> an
> >>>>>>> index to the chip_select array. If nth bit of spi->cs_index_mask
> >>>>>>> is
> >>>>>> set
> >>>>>>> then the driver would assert spi->chip_select[n].
> >>>>>>>
> >>>>>>> In parallel mode all the chip selects are asserted/de-asserted
> >>>>>>> simultaneously and each byte of data is stored in both devices,
> >>>>>>> the
> >>>>>> even
> >>>>>>> bits in one, the odd bits in the other. The split is
> >>>>>>> automatically
> >>>>>> handled
> >>>>>>> by the GQSPI controller. The GQSPI controller supports a maximum
> >>>>>>> of two flashes connected in parallel mode. A
> >>>>>>> SPI_CONTROLLER_MULTI_CS flag bit is added in the spi
> >>>>>>> controntroller flags, through
> >>>>>>> ctlr->flags the spi
> >>>>>> core
> >>>>>>> will make sure that the controller is capable of handling
> >>>>>>> multiple
> >>>>>> chip
> >>>>>>> selects at once.
> >>>>>>>
> >>>>>>> For supporting multiple CS via GPIO the cs_gpiod member of the
> >>>>>>> spi_device structure is now an array that holds the gpio
> >>>>>>> descriptor for each chipselect.
> >>>>>>>
> >>>>>>> Multi CS support using GPIO is not tested due to unavailability
> >>>>>>> of necessary hardware setup.
> >>>>>>>
> >>>>>>> Multi CS configuration with one native CS and one GPIO CS is not
> >>>>>>> supported as this configuration could not be tested due to
> >>>>>>> unavailability of necessary hardware setup.
> >>>>>> I've tested this chain on a released laptop (HP EliteBook 840 G9)
> >>>>>> which uses SPI to interface to 2 amps, one amp uses a native CS
> >>>>>> and the other uses a GPIO CS, and I noticed that when using this
> >>>>>> chain, the second amp no longer works.
> >>>>> Thank you for testing this patch series on GPIO CS setup. As I
> >>>>> don't have a GPIO CS setup, is it possible for you debug the
> >>>>> failure and share more details/logs where the problem is?
> >>>>>
> >>>>> Regards,
> >>>>> Amit
> >>>> We are willing and able to debug this failure and share the failure logs.
> >>>> The first issue that I see is a kernel crash when trying to set the GPIO CS:
> >>>>
> >>>> [    2.951658] general protection fault, probably for non-canonical
> >>>> address
> >>>> 0xdead000000000122: 0000 [#1] PREEMPT SMP NOPTI [    2.951771]
> CPU:
> >> 9
> >>>> PID: 379 Comm: systemd-udevd Tainted: G A           6.3.0-rc3+ #30
> >>>> [ 2.951826] Hardware name: HP /896D, BIOS U70 Ver. 89.33.02
> >>>> 10/29/2021 [    2.951882] RIP:
> >>>> 0010:gpiod_set_value_cansleep+0x21/0xa0
> >>>> [    2.951941] Code: 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 48
> >>>> 85 ff
> >>>> 74 3e 55 48 89 e5 41 55 41 89 f5 41 54 49 89 fc 48 81 ff 00 f0 ff
> >>>> ff
> >>>> 77 2c <48> 8b 3f 48 85 ff 74 53 48 83 bf 68 03 00 00 00 74 34 44 89
> >>>> ee 4c [    2.952043]
> >>>> RSP: 0018:ffffc008c0deb928 EFLAGS: 00010287 [    2.952080] RAX:
> >>>> 0000000000000001 RBX: ffffa0a489534c00 RCX:
> >>>> 0000000000000000
> >>>> [    2.952124] RDX: dead000000000122 RSI: 0000000000000001 RDI:
> >>>> dead000000000122
> >>>> [    2.952167] RBP: ffffc008c0deb938 R08: 0000000000000000 R09:
> >>>> ffffc008c0deb868
> >>>> [    2.952211] R10: ffffffffffffffff R11: 00000000000000b0 R12:
> >>>> dead000000000122
> >>>> [    2.952256] R13: 0000000000000001 R14: 0000000000000000 R15:
> >>>> 0000000000000000
> >>>> [    2.952299] FS:  00007f7fa5b5b880(0000)
> >>>> GS:ffffa0a81f840000(0000)
> >>>> knlGS:0000000000000000
> >>>> [    2.952369] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [
> >>>> 2.952407] CR2: 000055d648427100 CR3: 000000010e960003 CR4:
> >>>> 0000000000770ee0
> >>>> [    2.952451] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> >>>> 0000000000000000
> >>>> [    2.952492] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
> >>>> 0000000000000400
> >>>> [    2.952533] PKRU: 55555554
> >>>> [    2.952561] Call Trace:
> >>>> [    2.952579]  <TASK>
> >>>> [    2.952598]  spi_set_cs+0x257/0x4a0 [    2.952630]
> >>>> spi_setup+0x1a2/0x500 [    2.952667]  __spi_add_device+0x88/0x160 [
> >>>> 2.952710]  spi_add_device+0x60/0x90 [    2.952738]
> >>>> smi_spi_probe+0x178/0x370 [serial_multi_instantiate] [    2.952792]
> >>>> smi_probe+0xcf/0x110 [serial_multi_instantiate] [    2.952854]
> >>>> platform_probe+0x42/0xb0 [    2.952885]  really_probe+0x1b2/0x420 [
> >>>> 2.952914]  __driver_probe_device+0x7e/0x180 [    2.952947]
> >>>> driver_probe_device+0x23/0xa0 [    2.952993]
> >>>> __driver_attach+0xe4/0x1e0 [    2.953021]  ?
> >>>> __pfx___driver_attach+0x10/0x10
> >>>> [    2.953061]  bus_for_each_dev+0x7a/0xd0 [    2.953088]
> >>>> driver_attach+0x1e/0x30 [    2.953123]  bus_add_driver+0x11c/0x220
> >>>> [ 2.953150]  driver_register+0x64/0x130 [    2.953174]  ?
> >>>> __pfx_init_module+0x10/0x10 [serial_multi_instantiate] [
> >>>> 2.953221]
> >>>> __platform_driver_register+0x1e/0x30
> >>>> [    2.953251]  smi_driver_init+0x1c/0xff0
> >>>> [serial_multi_instantiate] [    2.953310]  do_one_initcall+0x46/0x220
> [    2.953339]  ?
> >>>> kmalloc_trace+0x2a/0xa0 [    2.953375]  do_init_module+0x52/0x220 [
> >>>> 2.953411]  load_module+0x223c/0x2460 [    2.953450]
> >>>> __do_sys_finit_module+0xc8/0x140 [    2.953479]  ?
> >>>> __do_sys_finit_module+0xc8/0x140
> >>>> [    2.953510]  __x64_sys_finit_module+0x18/0x20 [    2.953538]
> >>>> do_syscall_64+0x38/0x90 [    2.953574]
> >>>> entry_SYSCALL_64_after_hwframe+0x72/0xdc
> >>>> [    2.953606] RIP: 0033:0x7f7fa5d7476d [    2.953639] Code: 00 c3
> >>>> 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa
> >>>> 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24
> >>>> 08 0f
> >>>> 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f3 36 0d 00 f7 d8 64 89 01
> >>>> 48 [    2.953739] RSP: 002b:00007fff1f8dd3b8 EFLAGS: 00000246
> >> ORIG_RAX:
> >>>> 0000000000000139
> >>>> [    2.956833] RAX: ffffffffffffffda RBX: 000055d648654ab0 RCX:
> >>>> 00007f7fa5d7476d
> >>>> [    2.959202] RDX: 0000000000000000 RSI: 00007f7fa5c54ded RDI:
> >>>> 0000000000000006
> >>>> [    2.961542] RBP: 0000000000020000 R08: 0000000000000000 R09:
> >>>> 0000000000000000
> >>>> [    2.964312] R10: 0000000000000006 R11: 0000000000000246 R12:
> >>>> 00007f7fa5c54ded
> >>>> [    2.966694] R13: 0000000000000000 R14: 000055d6483f41a0 R15:
> >>>> 000055d648654ab0
> >>>> [    2.967668] resource: resource sanity check: requesting [mem
> >>>> 0x00000000fedc0000-0x00000000fedcffff], which spans more than pnp
> >>>> 00:04 [mem 0xfedc0000-0xfedc7fff] [    2.968998]  </TASK> [
> >>>> 2.971615] caller
> >>>> igen6_probe+0x178/0x8e0 [igen6_edac] mapping multiple BARs [
> >>>> 2.975014] Modules linked in: igen6_edac(+) fjes(-)
> >>>> serial_multi_instantiate(+) int3403_thermal sch_fq_codel
> >>>> int340x_thermal_zone int3400_thermal intel_hid acpi_thermal_rel
> >>>> acpi_tad sparse_keymap acpi_pad mac_hid msr parport_pc ppdev lp
> >>>> parport drm ramoops reed_solomon efi_pstore ip_tables x_tables
> >>>> autofs4 spi_pxa2xx_platform dw_dmac dw_dmac_core nvme
> >> intel_lpss_pci
> >>>> intel_lpss crc32_pclmul thunderbolt i2c_i801 xhci_pci idma64
> >>>> nvme_core i2c_smbus virt_dma xhci_pci_renesas video wmi
> >>>> pinctrl_tigerlake [    2.987901] ---[ end trace 0000000000000000
> >>>> ]---
> >> [    3.157030] RIP:
> >>>> 0010:gpiod_set_value_cansleep+0x21/0xa0
> >>>> [    3.159077] Code: 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 48
> >>>> 85 ff
> >>>> 74 3e 55 48 89 e5 41 55 41 89 f5 41 54 49 89 fc 48 81 ff 00 f0 ff
> >>>> ff
> >>>> 77 2c <48> 8b 3f 48 85 ff 74 53 48 83 bf 68 03 00 00 00 74 34 44 89
> >>>> ee 4c [    3.161461]
> >>>> RSP: 0018:ffffc008c0deb928 EFLAGS: 00010287 [    3.164005] RAX:
> >>>> 0000000000000001 RBX: ffffa0a489534c00 RCX:
> >>>> 0000000000000000
> >>>> [    3.166354] RDX: dead000000000122 RSI: 0000000000000001 RDI:
> >>>> dead000000000122
> >>>> [    3.168499] RBP: ffffc008c0deb938 R08: 0000000000000000 R09:
> >>>> ffffc008c0deb868
> >>>> [    3.170609] R10: ffffffffffffffff R11: 00000000000000b0 R12:
> >>>> dead000000000122
> >>>> [    3.172893] R13: 0000000000000001 R14: 0000000000000000 R15:
> >>>> 0000000000000000
> >>>> [    3.175335] FS:  00007f7fa5b5b880(0000)
> >>>> GS:ffffa0a81f840000(0000)
> >>>> knlGS:0000000000000000
> >>>> [    3.180434] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [
> >>>> 3.183356] CR2: 000055d648427100 CR3: 000000010e960003 CR4:
> >>>> 0000000000770ee0
> >>>> [    3.185107] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> >>>> 0000000000000000
> >>>> [    3.186840] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
> >>>> 0000000000000400
> >>>> [    3.188647] PKRU: 55555554
> >>> Thank you for sharing the logs.
> >>> As per our analysis the spi->cs_gpiod[0] is getting messed up while
> >>> setting it in __spi_add_device( ).
> >>> Is it possible for you to do the following changes on top of this
> >>> patch series & re-run your test.
> >>>
> >>> After applying this patch series, in drivers/spi/spi.c file replace
> >>> the following code snippet in __spi_add_device( ) function defination.
> >>>
> >>> if (ctlr->cs_gpiods) {
> >>>           for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
> >>>                   spi_set_csgpiod(spi, idx,
> >>> ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]); }
> >>>
> >>> with the below code snippet
> >>>
> >>> if (ctlr->cs_gpiods) {
> >>>           for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> >>>                   if (!(idx != 0 && !spi_get_chipselect(spi, idx)))
> >>>                           spi_set_csgpiod(spi, idx, ctlr-
> >>> cs_gpiods[spi_get_chipselect(spi, idx)]);
> >>>           }
> >>> }
> >>>
> >>> then re-run your test.
> >>>
> >>> Regards,
> >>> Amit
> >> I'm still seeing a crash on probe:
> >>
> >> [    3.265683] BUG: unable to handle page fault for address:
> >> 00000000fffedfdd
> >> [    3.265744] #PF: supervisor read access in kernel mode [    3.265781] #PF:
> >> error_code(0x0000) - not-present page [    3.265817] PGD 0 P4D 0 [
> >> 3.265840] Oops: 0000 [#1] PREEMPT SMP NOPTI [    3.265865] CPU: 4 PID:
> >> 385 Comm: systemd-udevd Tainted: G A           6.3.0-rc3+ #32 [
> >> 3.265910] Hardware name: HP /896D, BIOS U70 Ver. 89.33.02 10/29/2021
> >> [    3.265956]
> >> RIP: 0010:gpiod_set_raw_value_commit+0x3d/0xf0
> >> [    3.266007] Code: 48 89 e5 41 55 44 0f b6 ee 41 54 53 48 8b 17 48
> >> 2b
> >> 82 70 03 00 00 4c 8b a2 68 03 00 00 48 c1 f8 03 48 0f af c1 66 90 48
> >> 89
> >> c6 <49> 8b 44 24 60 44 89 ea 4c 89 e7 ff d0 0f 1f 00 5b 41 5c 41 5d
> >> 5d [    3.266092] RSP: 0018:ffffaad780f6f620 EFLAGS: 00010a03 [
> >> 3.266121]
> >> RAX: 333330b6bdbad102 RBX: ffff9c8d4a5f6800 RCX:
> >> cccccccccccccccd
> >> [    3.266156] RDX: ffff9c8d4a5f6d40 RSI: 333330b6bdbad102 RDI:
> >> ffff9c8d4a5f6d40
> >> [    3.266192] RBP: ffffaad780f6f638 R08: 00000001018c3789 R09:
> >> 0000000000000000
> >> [    3.266228] R10: ffff9c8c4009ee40 R11: 0000000000000000 R12:
> >> 00000000fffedf7d
> >> [    3.266264] R13: 0000000000000000 R14: 0000000000000001 R15:
> >> 0000000000000001
> >> [    3.266299] FS:  00007f98d04de880(0000) GS:ffff9c90df700000(0000)
> >> knlGS:0000000000000000
> >> [    3.266358] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [
> >> 3.266388] CR2: 00000000fffedfdd CR3: 000000010b680003 CR4:
> >> 0000000000770ee0
> >> [    3.266422] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> >> 0000000000000000
> >> [    3.266457] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
> >> 0000000000000400
> >> [    3.266490] PKRU: 55555554
> >> [    3.266513] Call Trace:
> >> [    3.266530]  <TASK>
> >> [    3.266546]  gpiod_set_value_nocheck+0x5b/0x70 [    3.266583]
> >> gpiod_set_value_cansleep+0x3e/0xa0
> >> [    3.266609]  spi_set_cs+0x257/0x4a0 [    3.266634]
> >> spi_transfer_one_message+0x49/0x740
> >> [    3.266672]  __spi_pump_transfer_message+0x29b/0x620
> >> [    3.266712]  __spi_sync+0x26f/0x3b0 [    3.266735]
> >> spi_write_then_read+0x157/0x210 [    3.266771]  ?
> >> psi_group_change+0x175/0x3b0
> [    3.266802]  regmap_spi_read+0xe/0x20
> >> [    3.266826]  _regmap_raw_read+0xe1/0x210 [    3.266861]
> >> _regmap_bus_read+0x3a/0x70 [    3.266887]  _regmap_read+0x66/0x140
> [
> >> 3.266918]  regmap_read+0x3f/0x70 [    3.266957]
> >> cs35l41_hda_probe+0x553/0xc10 [snd_hda_scodec_cs35l41]
> [    3.267027]
> >> cs35l41_hda_spi_probe+0x62/0x80 [snd_hda_scodec_cs35l41_spi] [
> >> 3.267096]  spi_probe+0x55/0x90 [    3.267145]
> >> really_probe+0x1b2/0x420 [    3.267184]
> >> __driver_probe_device+0x7e/0x180 [    3.267227]
> >> driver_probe_device+0x23/0xa0 [    3.267287]
> >> __driver_attach+0xe4/0x1e0 [    3.267326]  ?
> >> __pfx___driver_attach+0x10/0x10
> >> [    3.267381]  bus_for_each_dev+0x7a/0xd0 [    3.267406]
> >> driver_attach+0x1e/0x30 [    3.267437]  bus_add_driver+0x11c/0x220 [
> >> 3.267461]  driver_register+0x64/0x130 [    3.267483]  ?
> >> __pfx_init_module+0x10/0x10 [snd_hda_scodec_cs35l41_spi] [
> >> 3.267525]  __spi_register_driver+0xa1/0xd0 [    3.270712]  ?
> >> __pfx_init_module+0x10/0x10 [snd_hda_scodec_cs35l41_spi] [
> >> 3.273446]  cs35l41_spi_driver_init+0x1c/0xff0
> >> [snd_hda_scodec_cs35l41_spi]
> >> [    3.275119]  do_one_initcall+0x46/0x220 [    3.276828]  ?
> >> kmalloc_trace+0x2a/0xa0 [    3.279290]  do_init_module+0x52/0x220 [
> >> 3.283593]  load_module+0x223c/0x2460 [    3.283602]
> >> __do_sys_finit_module+0xc8/0x140 [    3.287883]  ?
> >> __do_sys_finit_module+0xc8/0x140
> >> [    3.287907]  __x64_sys_finit_module+0x18/0x20 [    3.293156]
> >> do_syscall_64+0x38/0x90 [    3.298937]
> >> entry_SYSCALL_64_after_hwframe+0x72/0xdc
> >> [    3.298945] RIP: 0033:0x7f98d06f776d [    3.319574] Code: 00 c3 66
> >> 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa
> >> 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08
> >> 0f
> >> 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f3 36 0d 00 f7 d8 64 89 01
> >> 48 [    3.319579] RSP: 002b:00007ffd988f7a08 EFLAGS: 00000246
> ORIG_RAX:
> >> 0000000000000139
> >> [    3.319585] RAX: ffffffffffffffda RBX: 000055af06a7d030 RCX:
> >> 00007f98d06f776d
> >> [    3.319589] RDX: 0000000000000000 RSI: 00007f98d05d7ded RDI:
> >> 0000000000000013
> >> [    3.329520] RBP: 0000000000020000 R08: 0000000000000000 R09:
> >> 0000000000000000
> >> [    3.329523] R10: 0000000000000013 R11: 0000000000000246 R12:
> >> 00007f98d05d7ded
> >> [    3.329525] R13: 0000000000000000 R14: 000055af06cdd040 R15:
> >> 000055af06a7d030
> >> [    3.329531]  </TASK>
> >> [    3.329533] Modules linked in: snd_hda_intel(+) ttm
> >> snd_intel_dspcfg btusb rapl snd_seq_midi snd_intel_sdw_acpi libarc4
> >> intel_cstate binfmt_misc
> >> uvcvideo(+) snd_seq_midi_event btrtl
> >> snd_hda_scodec_cs35l41_spi(+) snd_hda_codec drm_display_helper
> >> cdc_ncm(+) videobuf2_vmalloc snd_rawmidi btbcm uvc cdc_ether cec
> >> btintel videobuf2_memops snd_hda_scodec_cs35l41_i2c snd_hda_core
> >> videobuf2_v4l2 uas usbnet rc_core snd_hwdep btmtk
> >> snd_hda_scodec_cs35l41 input_leds mii wmi_bmof videodev snd_seq
> >> processor_thermal_device_pci bluetooth iwlwifi drm_kms_helper
> snd_pcm
> >> snd_hda_cs_dsp_ctls processor_thermal_device mei_me
> videobuf2_common
> >> snd_seq_device i2c_algo_bit cs_dsp processor_thermal_rfim
> >> ecdh_generic usb_storage serio_raw mc syscopyarea ecc
> >> processor_thermal_mbox ucsi_acpi snd_soc_cs35l41_lib 8250_dw mei
> >> snd_timer cfg80211 sysfillrect typec_ucsi processor_thermal_rapl
> >> igen6_edac sysimgblt intel_rapl_common typec snd soundcore
> >> int3403_thermal int340x_thermal_zone serial_multi_instantiate
> >> int3400_thermal intel_hid acpi_thermal_rel [    3.338475]
> >> sparse_keymap acpi_tad acpi_pad mac_hid sch_fq_codel msr parport_pc
> >> ppdev lp parport drm ramoops reed_solomon efi_pstore ip_tables
> >> x_tables autofs4 spi_pxa2xx_platform dw_dmac dw_dmac_core
> >> intel_lpss_pci nvme intel_lpss i2c_i801 idma64 crc32_pclmul
> >> thunderbolt i2c_smbus nvme_core xhci_pci virt_dma xhci_pci_renesas
> >> video wmi pinctrl_tigerlake [    3.338514]
> >> CR2: 00000000fffedfdd [    3.338517] ---[ end trace 0000000000000000
> >> ]--- [    3.504965] RIP: 0010:gpiod_set_raw_value_commit+0x3d/0xf0
> >> [    3.504973] Code: 48 89 e5 41 55 44 0f b6 ee 41 54 53 48 8b 17 48
> >> 2b
> >> 82 70 03 00 00 4c 8b a2 68 03 00 00 48 c1 f8 03 48 0f af c1 66 90 48
> >> 89
> >> c6 <49> 8b 44 24 60 44 89 ea 4c 89 e7 ff d0 0f 1f 00 5b 41 5c 41 5d
> >> 5d [    3.504975] RSP: 0018:ffffaad780f6f620 EFLAGS: 00010a03 [
> >> 3.504978]
> >> RAX: 333330b6bdbad102 RBX: ffff9c8d4a5f6800 RCX:
> >> cccccccccccccccd
> >> [    3.504979] RDX: ffff9c8d4a5f6d40 RSI: 333330b6bdbad102 RDI:
> >> ffff9c8d4a5f6d40
> >> [    3.504980] RBP: ffffaad780f6f638 R08: 00000001018c3789 R09:
> >> 0000000000000000
> >> [    3.504982] R10: ffff9c8c4009ee40 R11: 0000000000000000 R12:
> >> 00000000fffedf7d
> >> [    3.504983] R13: 0000000000000000 R14: 0000000000000001 R15:
> >> 0000000000000001
> >> [    3.504984] FS:  00007f98d04de880(0000) GS:ffff9c90df700000(0000)
> >> knlGS:0000000000000000
> >> [    3.504986] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [
> >> 3.504988] CR2: 00000000fffedfdd CR3: 000000010b680003 CR4:
> >> 0000000000770ee0
> >> [    3.504989] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> >> 0000000000000000
> >> [    3.504990] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
> >> 0000000000000400
> >> [    3.504992] PKRU: 55555554
> >>
> >> Thanks,
> >> Stefan
> > Thanks for the logs.
> >
> > Could you please confirm that your test case was passing with
> >
> https://github.com/torvalds/linux/commit/303feb3cc06ac0665d0ee9c14149
> 4
> > 1200e60e8a3 patch but it is failing with the current patch series ?
> 
> I retested with the latest master kernel
> https://github.com/torvalds/linux/commit/33afd4b76393627477e878b3b195
> d606e585d816
> and I could see it worked fine. I attached a dmesg log of this.
> 
> That particular commit id you posted does not work, due to a different issue
> which was fixed in a later commit.

Thank you for the confirmation.
> 
> >
> > Regarding the failure
> > The logs suggest that we are trying to access an invalid pointer while
> > calling the gpiod_set_value_cansleep( ) API.
> > This could be possible if the cs_num is corrupted and we are trying to
> > access an invalid spi->cs_gpiod[ ].
> > To confirm the same could you please do the following changes in the
> > code and re-test.
> >
> > After applying this patch series, in drivers/spi/spi.c file replace
> > the following code snippet in __spi_add_device( ) function definition.
> > if (ctlr->cs_gpiods) {
> >          for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
> >                  spi_set_csgpiod(spi, idx,
> > ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]); }
> >
> > with the below code snippet
> >
> > if (ctlr->cs_gpiods) {
> >          for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> >                  if (!(idx != 0 && !spi_get_chipselect(spi, idx))) {
> > 		printk("%s( ) [%d] cs[%d] = [%d]\n", __func__, __LINE__, idx,
> spi_get_chipselect(spi, idx));
> > 		spi_set_csgpiod(spi, idx, ctlr-
> >cs_gpiods[spi_get_chipselect(spi, idx)]);
> > 	}
> >          }
> > }
> >
> > And at the start of  spi_set_cs( ) function in drivers/spi/spi.c file
> > add the following print statements.
> >
> > printk("%s( ) [%d] spi->cs_index_mask == [%d]\n", __func__, __LINE__,
> > spi->cs_index_mask); printk("%s( ) [%d] cs_num == [%d]\n", __func__,
> > __LINE__, cs_num);
> 
> I've attached dmesg log of this. It no longer crashes when using the prints (I
> am unsure why), but it still does not work.
> For sanity, I retested these changes with the print lines commented out, and
> the crash returned.

Thanks a lot for the dmesg log.
Here the __ffs() is creating the issue. __ffs() behavior is undefined if 
no set bits exist in spi->cs_index_mask , as a result random value
(i.e, 64) is assigned to cs_num.
I think this could be fixed by replacing __ffs() with ffs() calls. 
To confirm the same could you please apply the attached patch on top of 
this patch series and re-test. If it works fine, then for sanity kindly 
rerun by removing the printk lines.

Thanks,
Amit 

> 
> >
> > Thanks,
> > Amit
> >>>> Thanks,
> >>>>
> >>>> Stefan
> >>>>
> >>>>>> Thanks,
> >>>>>> Stefan Binding
> >>>>>>
> >>>>>>> Signed-off-by: Amit Kumar Mahapatra <amit.kumar-
> >>>>>> mahapatra@amd.com>
> >>>>>>> ---
> >>>>>>>     drivers/spi/spi.c       | 226
> >>>>>> ++++++++++++++++++++++++++++------------
> >>>>>>>     include/linux/spi/spi.h |  32 ++++--
> >>>>>>>     2 files changed, 183 insertions(+), 75 deletions(-)
> >>>>>>>
> >>>>>>> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index
> >>>>>>> 9036d7a50674..04d7322170c4 100644
> >>>>>>> --- a/drivers/spi/spi.c
> >>>>>>> +++ b/drivers/spi/spi.c
> >>>>>>> @@ -612,10 +612,24 @@ static int spi_dev_check(struct device
> *dev,
> >>>>>>> void *data)  {
> >>>>>>>     	struct spi_device *spi = to_spi_device(dev);
> >>>>>>>     	struct spi_device *new_spi = data;
> >>>>>>> +	int idx, nw_idx;
> >>>>>>>
> >>>>>>> -	if (spi->controller == new_spi->controller &&
> >>>>>>> -	    spi_get_chipselect(spi, 0) == spi_get_chipselect(new_spi,
> >>>>>> 0))
> >>>>>>> -		return -EBUSY;
> >>>>>>> +	if (spi->controller == new_spi->controller) {
> >>>>>>> +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> >>>>>>> +			for (nw_idx = 0; nw_idx < SPI_CS_CNT_MAX;
> >>>>>>> nw_idx++) {
> >>>>>>> +				if ((idx != 0 &&
> >>>>>> !spi_get_chipselect(spi,
> >>>>>>> idx)) ||
> >>>>>>> +				    (nw_idx != 0 &&
> >>>>>>> !spi_get_chipselect(spi, nw_idx))) {
> >>>>>>> +					continue;
> >>>>>>> +				} else if (spi_get_chipselect(spi,
> >>>>>> idx) ==
> >>>>>>> +				    spi_get_chipselect(new_spi,
> >>>>>> nw_idx))
> >>>>>>> {
> >>>>>>> +					dev_err(dev,
> >>>>>>> +						"chipselect %d
> >> already
> >>>>>>> in use\n",
> >>>>>>> +
> >>>>>>> 	spi_get_chipselect(new_spi, nw_idx));
> >>>>>>> +					return -EBUSY;
> >>>>>>> +				}
> >>>>>>> +			}
> >>>>>>> +		}
> >>>>>>> +	}
> >>>>>>>     	return 0;
> >>>>>>>     }
> >>>>>>>
> >>>>>>> @@ -629,7 +643,7 @@ static int __spi_add_device(struct spi_device
> >>>>>>> *spi)
> >>>>>>>     {
> >>>>>>>     	struct spi_controller *ctlr = spi->controller;
> >>>>>>>     	struct device *dev = ctlr->dev.parent;
> >>>>>>> -	int status;
> >>>>>>> +	int status, idx;
> >>>>>>>
> >>>>>>>     	/*
> >>>>>>>     	 * We need to make sure there's no other device with this
> >> @@
> >>>>>>> -638,8
> >>>>>>> +652,6 @@ static int __spi_add_device(struct spi_device
> >>>>>>> *spi)
> >>>>>>>     	 */
> >>>>>>>     	status = bus_for_each_dev(&spi_bus_type, NULL, spi,
> >>>>>> spi_dev_check);
> >>>>>>>     	if (status) {
> >>>>>>> -		dev_err(dev, "chipselect %d already in use\n",
> >>>>>>> -				spi_get_chipselect(spi, 0));
> >>>>>>>     		return status;
> >>>>>>>     	}
> >>>>>>>
> >>>>>>> @@ -649,8 +661,10 @@ static int __spi_add_device(struct
> spi_device
> >>>>>>> *spi)
> >>>>>>>     		return -ENODEV;
> >>>>>>>     	}
> >>>>>>>
> >>>>>>> -	if (ctlr->cs_gpiods)
> >>>>>>> -		spi_set_csgpiod(spi, 0, ctlr-
> >>>>>>>> cs_gpiods[spi_get_chipselect(spi, 0)]);
> >>>>>>> +	if (ctlr->cs_gpiods) {
> >>>>>>> +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
> >>>>>>> +			spi_set_csgpiod(spi, idx, ctlr-
> >>>>>>>> cs_gpiods[spi_get_chipselect(spi, idx)]);
> >>>>>>> +	}
> >>>>>>>
> >>>>>>>     	/*
> >>>>>>>     	 * Drivers may modify this initial i/o setup, but will @@
> >>>>>>> -690,13
> >>>>>>> +704,15 @@ int spi_add_device(struct spi_device *spi)  {
> >>>>>>>     	struct spi_controller *ctlr = spi->controller;
> >>>>>>>     	struct device *dev = ctlr->dev.parent;
> >>>>>>> -	int status;
> >>>>>>> +	int status, idx;
> >>>>>>>
> >>>>>>> -	/* Chipselects are numbered 0..max; validate. */
> >>>>>>> -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
> >>>>>>> -		dev_err(dev, "cs%d >= max %d\n",
> >>>>>>> spi_get_chipselect(spi, 0),
> >>>>>>> -			ctlr->num_chipselect);
> >>>>>>> -		return -EINVAL;
> >>>>>>> +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> >>>>>>> +		/* Chipselects are numbered 0..max; validate. */
> >>>>>>> +		if (spi_get_chipselect(spi, idx) >=
> >>>>>> ctlr->num_chipselect) {
> >>>>>>> +			dev_err(dev, "cs%d >= max %d\n",
> >>>>>>> spi_get_chipselect(spi, idx),
> >>>>>>> +				ctlr->num_chipselect);
> >>>>>>> +			return -EINVAL;
> >>>>>>> +		}
> >>>>>>>     	}
> >>>>>>>
> >>>>>>>     	/* Set the bus ID string */
> >>>>>>> @@ -713,12 +729,15 @@ static int spi_add_device_locked(struct
> >>>>>>> spi_device *spi)  {
> >>>>>>>     	struct spi_controller *ctlr = spi->controller;
> >>>>>>>     	struct device *dev = ctlr->dev.parent;
> >>>>>>> +	int idx;
> >>>>>>>
> >>>>>>> -	/* Chipselects are numbered 0..max; validate. */
> >>>>>>> -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
> >>>>>>> -		dev_err(dev, "cs%d >= max %d\n",
> >>>>>>> spi_get_chipselect(spi, 0),
> >>>>>>> -			ctlr->num_chipselect);
> >>>>>>> -		return -EINVAL;
> >>>>>>> +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
> >>>>>>> +		/* Chipselects are numbered 0..max; validate. */
> >>>>>>> +		if (spi_get_chipselect(spi, idx) >=
> >>>>>> ctlr->num_chipselect) {
> >>>>>>> +			dev_err(dev, "cs%d >= max %d\n",
> >>>>>>> spi_get_chipselect(spi, idx),
> >>>>>>> +				ctlr->num_chipselect);
> >>>>>>> +			return -EINVAL;
> >>>>>>> +		}
> >>>>>>>     	}
> >>>>>>>
> >>>>>>>     	/* Set the bus ID string */
> >>>>>>> @@ -966,58 +985,118 @@ static void spi_res_release(struct
> >>>>>>> spi_controller *ctlr, struct spi_message *mes  static void
> >>>>>>> spi_set_cs(struct spi_device *spi, bool enable, bool
> >>>>>> force)
> >>>>>>>     {
> >>>>>>>     	bool activate = enable;
> >>>>>>> +	u32 cs_num = __ffs(spi->cs_index_mask);
> >>>>>>> +	int idx;
> >>>>>>>
> >>>>>>>     	/*
> >>>>>>> -	 * Avoid calling into the driver (or doing delays) if the chip
> >>>>>> select
> >>>>>>> -	 * isn't actually changing from the last time this was called.
> >>>>>>> +	 * In parallel mode all the chip selects are
> >>>>>> asserted/de-asserted
> >>>>>>> +	 * at once
> >>>>>>>     	 */
> >>>>>>> -	if (!force && ((enable && spi->controller->last_cs ==
> >>>>>>> spi_get_chipselect(spi, 0)) ||
> >>>>>>> -		       (!enable && spi->controller->last_cs !=
> >>>>>>> spi_get_chipselect(spi, 0))) &&
> >>>>>>> -	    (spi->controller->last_cs_mode_high == (spi->mode &
> >>>>>>> SPI_CS_HIGH)))
> >>>>>>> -		return;
> >>>>>>> -
> >>>>>>> -	trace_spi_set_cs(spi, activate);
> >>>>>>> -
> >>>>>>> -	spi->controller->last_cs = enable ? spi_get_chipselect(spi, 0)
> >>>>>> : -1;
> >>>>>>> -	spi->controller->last_cs_mode_high = spi->mode &
> >>>>>>> SPI_CS_HIGH;
> >>>>>>> -
> >>>>>>> -	if ((spi_get_csgpiod(spi, 0) ||
> >>>>>> !spi->controller->set_cs_timing)
> >>>>>>> && !activate)
> >>>>>>> -		spi_delay_exec(&spi->cs_hold, NULL);
> >>>>>>> -
> >>>>>>> -	if (spi->mode & SPI_CS_HIGH)
> >>>>>>> -		enable = !enable;
> >>>>>>> +	if ((spi->cs_index_mask & SPI_PARALLEL_CS_MASK) ==
> >>>>>>> SPI_PARALLEL_CS_MASK) {
> >>>>>>> +		spi->controller->last_cs_mode_high = spi->mode &
> >>>>>>> SPI_CS_HIGH;
> >>>>>>> +
> >>>>>>> +		if ((spi_get_csgpiod(spi, 0) || !spi->controller-
> >>>>>>>> set_cs_timing) && !activate)
> >>>>>>> +			spi_delay_exec(&spi->cs_hold, NULL);
> >>>>>>> +
> >>>>>>> +		if (spi->mode & SPI_CS_HIGH)
> >>>>>>> +			enable = !enable;
> >>>>>>> +
> >>>>>>> +		if (spi_get_csgpiod(spi, 0) && spi_get_csgpiod(spi,
> >>>>>> 1)) {
> >>>>>>> +			if (!(spi->mode & SPI_NO_CS)) {
> >>>>>>> +				/*
> >>>>>>> +				 * Historically ACPI has no means of
> >>>>>> the
> >>>>>>> GPIO polarity and
> >>>>>>> +				 * thus the SPISerialBus() resource
> >>>>>>> defines it on the per-chip
> >>>>>>> +				 * basis. In order to avoid a chain of
> >>>>>>> negations, the GPIO
> >>>>>>> +				 * polarity is considered being Active
> >>>>>>> High. Even for the cases
> >>>>>>> +				 * when _DSD() is involved (in the
> >>>>>>> updated versions of ACPI)
> >>>>>>> +				 * the GPIO CS polarity must be
> >>>>>> defined
> >>>>>>> Active High to avoid
> >>>>>>> +				 * ambiguity. That's why we use
> >>>>>> enable,
> >>>>>>> that takes SPI_CS_HIGH
> >>>>>>> +				 * into account.
> >>>>>>> +				 */
> >>>>>>> +				if (has_acpi_companion(&spi->dev)) {
> >>>>>>> +					for (idx = 0; idx <
> >>>>>>> SPI_CS_CNT_MAX; idx++)
> >>>>>>> +
> >>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
> >>>>>>> +
> >>>>>>> !enable);
> >>>>>>> +				} else {
> >>>>>>> +					for (idx = 0; idx <
> >>>>>>> SPI_CS_CNT_MAX; idx++)
> >>>>>>> +						/* Polarity handled by
> >>>>>>> GPIO library */
> >>>>>>> +
> >>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
> >>>>>>> +
> >>>>>>> activate);
> >>>>>>> +				}
> >>>>>>> +			}
> >>>>>>> +			/* Some SPI masters need both GPIO CS &
> >>>>>>> slave_select */
> >>>>>>> +			if ((spi->controller->flags &
> >>>>>>> SPI_MASTER_GPIO_SS) &&
> >>>>>>> +			    spi->controller->set_cs)
> >>>>>>> +				spi->controller->set_cs(spi, !enable);
> >>>>>>> +		} else if (spi->controller->set_cs) {
> >>>>>>> +			spi->controller->set_cs(spi, !enable);
> >>>>>>> +		}
> >>>>>>>
> >>>>>>> -	if (spi_get_csgpiod(spi, 0)) {
> >>>>>>> -		if (!(spi->mode & SPI_NO_CS)) {
> >>>>>>> -			/*
> >>>>>>> -			 * Historically ACPI has no means of the GPIO
> >>>>>>> polarity and
> >>>>>>> -			 * thus the SPISerialBus() resource defines it
> >>>>>> on
> >>>>>>> the per-chip
> >>>>>>> -			 * basis. In order to avoid a chain of
> >>>>>> negations,
> >>>>>>> the GPIO
> >>>>>>> -			 * polarity is considered being Active High.
> >>>>>> Even
> >>>>>>> for the cases
> >>>>>>> -			 * when _DSD() is involved (in the updated
> >>>>>>> versions of ACPI)
> >>>>>>> -			 * the GPIO CS polarity must be defined
> Active
> >>>>>>> High to avoid
> >>>>>>> -			 * ambiguity. That's why we use enable, that
> >>>>>>> takes SPI_CS_HIGH
> >>>>>>> -			 * into account.
> >>>>>>> -			 */
> >>>>>>> -			if (has_acpi_companion(&spi->dev))
> >>>>>>> -
> >>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), !enable);
> >>>>>>> +		if (spi_get_csgpiod(spi, 0) || spi_get_csgpiod(spi, 1)
> >>>>>> ||
> >>>>>>> +		    !spi->controller->set_cs_timing) {
> >>>>>>> +			if (activate)
> >>>>>>> +				spi_delay_exec(&spi->cs_setup,
> >> NULL);
> >>>>>>>     			else
> >>>>>>> -				/* Polarity handled by GPIO library */
> >>>>>>> -
> >>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), activate);
> >>>>>>> +				spi_delay_exec(&spi->cs_inactive,
> >>>>>>> NULL);
> >>>>>>>     		}
> >>>>>>> -		/* Some SPI masters need both GPIO CS &
> slave_select
> >>>>>>> */
> >>>>>>> -		if ((spi->controller->flags & SPI_MASTER_GPIO_SS)
> &&
> >>>>>>> -		    spi->controller->set_cs)
> >>>>>>> +	} else {
> >>>>>>> +		/*
> >>>>>>> +		 * Avoid calling into the driver (or doing delays) if
> >>>>>> the
> >>>>>>> chip select
> >>>>>>> +		 * isn't actually changing from the last time this was
> >>>>>>> called.
> >>>>>>> +		 */
> >>>>>>> +		if (!force && ((enable && spi->controller->last_cs ==
> >>>>>>> +				spi_get_chipselect(spi, cs_num)) ||
> >>>>>>> +				(!enable && spi->controller->last_cs
> >>>>>> !=
> >>>>>>> +				 spi_get_chipselect(spi, cs_num))) &&
> >>>>>>> +		    (spi->controller->last_cs_mode_high ==
> >>>>>>> +		     (spi->mode & SPI_CS_HIGH)))
> >>>>>>> +			return;
> >>>>>>> +
> >>>>>>> +		trace_spi_set_cs(spi, activate);
> >>>>>>> +
> >>>>>>> +		spi->controller->last_cs = enable ?
> >>>>>>> spi_get_chipselect(spi, cs_num) : -1;
> >>>>>>> +		spi->controller->last_cs_mode_high = spi->mode &
> >>>>>>> SPI_CS_HIGH;
> >>>>>>> +
> >>>>>>> +		if ((spi_get_csgpiod(spi, cs_num) || !spi->controller-
> >>>>>>>> set_cs_timing) && !activate)
> >>>>>>> +			spi_delay_exec(&spi->cs_hold, NULL);
> >>>>>>> +
> >>>>>>> +		if (spi->mode & SPI_CS_HIGH)
> >>>>>>> +			enable = !enable;
> >>>>>>> +
> >>>>>>> +		if (spi_get_csgpiod(spi, cs_num)) {
> >>>>>>> +			if (!(spi->mode & SPI_NO_CS)) {
> >>>>>>> +				/*
> >>>>>>> +				 * Historically ACPI has no means of
> >>>>>> the
> >>>>>>> GPIO polarity and
> >>>>>>> +				 * thus the SPISerialBus() resource
> >>>>>>> defines it on the per-chip
> >>>>>>> +				 * basis. In order to avoid a chain of
> >>>>>>> negations, the GPIO
> >>>>>>> +				 * polarity is considered being Active
> >>>>>>> High. Even for the cases
> >>>>>>> +				 * when _DSD() is involved (in the
> >>>>>>> updated versions of ACPI)
> >>>>>>> +				 * the GPIO CS polarity must be
> >>>>>> defined
> >>>>>>> Active High to avoid
> >>>>>>> +				 * ambiguity. That's why we use
> >>>>>> enable,
> >>>>>>> that takes SPI_CS_HIGH
> >>>>>>> +				 * into account.
> >>>>>>> +				 */
> >>>>>>> +				if (has_acpi_companion(&spi->dev))
> >>>>>>> +
> >>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
> >>>>>>> +
> >>>>>>> !enable);
> >>>>>>> +				else
> >>>>>>> +					/* Polarity handled by GPIO
> >>>>>>> library */
> >>>>>>> +
> >>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
> >>>>>>> +
> >>>>>>> activate);
> >>>>>>> +			}
> >>>>>>> +			/* Some SPI masters need both GPIO CS &
> >>>>>>> slave_select */
> >>>>>>> +			if ((spi->controller->flags &
> >>>>>>> SPI_MASTER_GPIO_SS) &&
> >>>>>>> +			    spi->controller->set_cs)
> >>>>>>> +				spi->controller->set_cs(spi, !enable);
> >>>>>>> +		} else if (spi->controller->set_cs) {
> >>>>>>>     			spi->controller->set_cs(spi, !enable);
> >>>>>>> -	} else if (spi->controller->set_cs) {
> >>>>>>> -		spi->controller->set_cs(spi, !enable);
> >>>>>>> -	}
> >>>>>>> +		}
> >>>>>>>
> >>>>>>> -	if (spi_get_csgpiod(spi, 0) ||
> >>>>>> !spi->controller->set_cs_timing) {
> >>>>>>> -		if (activate)
> >>>>>>> -			spi_delay_exec(&spi->cs_setup, NULL);
> >>>>>>> -		else
> >>>>>>> -			spi_delay_exec(&spi->cs_inactive, NULL);
> >>>>>>> +		if (spi_get_csgpiod(spi, cs_num) || !spi->controller-
> >>>>>>>> set_cs_timing) {
> >>>>>>> +			if (activate)
> >>>>>>> +				spi_delay_exec(&spi->cs_setup,
> >> NULL);
> >>>>>>> +			else
> >>>>>>> +				spi_delay_exec(&spi->cs_inactive,
> >>>>>>> NULL);
> >>>>>>> +		}
> >>>>>>>     	}
> >>>>>>>     }
> >>>>>>>
> >>>>>>> @@ -2246,8 +2325,8 @@ static void
> of_spi_parse_dt_cs_delay(struct
> >>>>>>> device_node *nc,  static int of_spi_parse_dt(struct spi_controller
> >>>>>>> *ctlr, struct
> >>>>>> spi_device
> >>>>>>> *spi,
> >>>>>>>     			   struct device_node *nc)
> >>>>>>>     {
> >>>>>>> -	u32 value;
> >>>>>>> -	int rc;
> >>>>>>> +	u32 value, cs[SPI_CS_CNT_MAX] = {0};
> >>>>>>> +	int rc, idx;
> >>>>>>>
> >>>>>>>     	/* Mode (clock phase/polarity/etc.) */
> >>>>>>>     	if (of_property_read_bool(nc, "spi-cpha")) @@ -2320,13
> >>>>>>> +2399,21
> >>>>>> @@
> >>>>>>> static int of_spi_parse_dt(struct spi_controller *ctlr, struct
> >>>>>>> spi_device *spi,
> >>>>>>>     	}
> >>>>>>>
> >>>>>>>     	/* Device address */
> >>>>>>> -	rc = of_property_read_u32(nc, "reg", &value);
> >>>>>>> -	if (rc) {
> >>>>>>> +	rc = of_property_read_variable_u32_array(nc, "reg", &cs[0],
> >> 1,
> >>>>>>> +						 SPI_CS_CNT_MAX);
> >>>>>>> +	if (rc < 0 || rc > ctlr->num_chipselect) {
> >>>>>>>     		dev_err(&ctlr->dev, "%pOF has no valid 'reg' property
> >>>>>> (%d)\n",
> >>>>>>>     			nc, rc);
> >>>>>>>     		return rc;
> >>>>>>> +	} else if ((of_property_read_bool(nc, "parallel-memories"))
> >> &&
> >>>>>>> +		   (!(ctlr->flags & SPI_CONTROLLER_MULTI_CS))) {
> >>>>>>> +		dev_err(&ctlr->dev, "SPI controller doesn't support
> >>>>>> multi
> >>>>>>> CS\n");
> >>>>>>> +		return -EINVAL;
> >>>>>>>     	}
> >>>>>>> -	spi_set_chipselect(spi, 0, value);
> >>>>>>> +	for (idx = 0; idx < rc; idx++)
> >>>>>>> +		spi_set_chipselect(spi, idx, cs[idx]);
> >>>>>>> +	/* By default set the spi->cs_index_mask as 1 */
> >>>>>>> +	spi->cs_index_mask = 0x01;
> >>>>>>>
> >>>>>>>     	/* Device speed */
> >>>>>>>     	if (!of_property_read_u32(nc, "spi-max-frequency", &value))
> >> @@
> >>>>>>> -3907,7 +3994,8 @@ static int __spi_validate(struct spi_device
> >>>>>>> *spi, struct spi_message *message)
> >>>>>>>     	 * cs_change is set for each transfer.
> >>>>>>>     	 */
> >>>>>>>     	if ((spi->mode & SPI_CS_WORD) && (!(ctlr->mode_bits &
> >>>>>>> SPI_CS_WORD) ||
> >>>>>>> -					  spi_get_csgpiod(spi, 0))) {
> >>>>>>> +					  spi_get_csgpiod(spi, 0) ||
> >>>>>>> +					  spi_get_csgpiod(spi, 1))) {
> >>>>>>>     		size_t maxsize;
> >>>>>>>     		int ret;
> >>>>>>>
> >>>>>>> diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
> >>>>>>> index 873ced6ae4ca..6453b246e0af 100644
> >>>>>>> --- a/include/linux/spi/spi.h
> >>>>>>> +++ b/include/linux/spi/spi.h
> >>>>>>> @@ -19,6 +19,11 @@
> >>>>>>>     #include <linux/acpi.h>
> >>>>>>>     #include <linux/u64_stats_sync.h>
> >>>>>>>
> >>>>>>> +/* Max no. of CS supported per spi device */ #define
> >>>>>>> +SPI_CS_CNT_MAX
> >>>>>>> +2
> >>>>>>> +
> >>>>>>> +/* chip select mask */
> >>>>>>> +#define SPI_PARALLEL_CS_MASK	(BIT(0) | BIT(1))
> >>>>>>>     struct dma_chan;
> >>>>>>>     struct software_node;
> >>>>>>>     struct ptp_system_timestamp;
> >>>>>>> @@ -166,6 +171,7 @@ extern void
> >>>>>>> spi_transfer_cs_change_delay_exec(struct spi_message *msg,
> >>>>>>>      *	deasserted. If @cs_change_delay is used from
> >> @spi_transfer,
> >>>>>>> then the
> >>>>>>>      *	two delays will be added up.
> >>>>>>>      * @pcpu_statistics: statistics for the spi_device
> >>>>>>> + * @cs_index_mask: Bit mask of the active chipselect(s) in the
> >>>>>>> chipselect array
> >>>>>>>      *
> >>>>>>>      * A @spi_device is used to interchange data between an SPI slave
> >>>>>>>      * (usually a discrete chip) and CPU memory.
> >>>>>>> @@ -181,7 +187,7 @@ struct spi_device {
> >>>>>>>     	struct spi_controller	*controller;
> >>>>>>>     	struct spi_controller	*master;	/* Compatibility layer
> >>>>>> */
> >>>>>>>     	u32			max_speed_hz;
> >>>>>>> -	u8			chip_select;
> >>>>>>> +	u8			chip_select[SPI_CS_CNT_MAX];
> >>>>>>>     	u8			bits_per_word;
> >>>>>>>     	bool			rt;
> >>>>>>>     #define SPI_NO_TX	BIT(31)		/* No transmit wire */
> >>>>>>> @@ -202,7 +208,7 @@ struct spi_device {
> >>>>>>>     	void			*controller_data;
> >>>>>>>     	char			modalias[SPI_NAME_SIZE];
> >>>>>>>     	const char		*driver_override;
> >>>>>>> -	struct gpio_desc	*cs_gpiod;	/* Chip select gpio
> >>>>>> desc
> >>>>>>> */
> >>>>>>> +	struct gpio_desc	*cs_gpiod[SPI_CS_CNT_MAX];	/*
> >>>>>> Chip
> >>>>>>> select gpio desc */
> >>>>>>>     	struct spi_delay	word_delay; /* Inter-word delay */
> >>>>>>>     	/* CS delays */
> >>>>>>>     	struct spi_delay	cs_setup;
> >>>>>>> @@ -212,6 +218,13 @@ struct spi_device {
> >>>>>>>     	/* The statistics */
> >>>>>>>     	struct spi_statistics __percpu	*pcpu_statistics;
> >>>>>>>
> >>>>>>> +	/* Bit mask of the chipselect(s) that the driver need to use
> >>>>>> from
> >>>>>>> +	 * the chipselect array.When the controller is capable to
> >>>>>> handle
> >>>>>>> +	 * multiple chip selects & memories are connected in parallel
> >>>>>>> +	 * then more than one bit need to be set in cs_index_mask.
> >>>>>>> +	 */
> >>>>>>> +	u32			cs_index_mask : SPI_CS_CNT_MAX;
> >>>>>>> +
> >>>>>>>     	/*
> >>>>>>>     	 * likely need more hooks for more protocol options affecting
> >> how
> >>>>>>>     	 * the controller talks to each chip, like:
> >>>>>>> @@ -268,22 +281,22 @@ static inline void *spi_get_drvdata(const
> >>>>>>> struct spi_device *spi)
> >>>>>>>
> >>>>>>>     static inline u8 spi_get_chipselect(const struct spi_device
> >>>>>>> *spi,
> >>>>>> u8 idx)
> >>>>>>>     {
> >>>>>>> -	return spi->chip_select;
> >>>>>>> +	return spi->chip_select[idx];
> >>>>>>>     }
> >>>>>>>
> >>>>>>>     static inline void spi_set_chipselect(struct spi_device *spi,
> >>>>>>> u8
> >>>>>> idx, u8
> >>>>>>> chipselect)
> >>>>>>>     {
> >>>>>>> -	spi->chip_select = chipselect;
> >>>>>>> +	spi->chip_select[idx] = chipselect;
> >>>>>>>     }
> >>>>>>>
> >>>>>>>     static inline struct gpio_desc *spi_get_csgpiod(const struct
> >>>>>> spi_device
> >>>>>>> *spi, u8 idx)
> >>>>>>>     {
> >>>>>>> -	return spi->cs_gpiod;
> >>>>>>> +	return spi->cs_gpiod[idx];
> >>>>>>>     }
> >>>>>>>
> >>>>>>>     static inline void spi_set_csgpiod(struct spi_device *spi, u8
> >>>>>>> idx,
> >>>>>> struct
> >>>>>>> gpio_desc *csgpiod)
> >>>>>>>     {
> >>>>>>> -	spi->cs_gpiod = csgpiod;
> >>>>>>> +	spi->cs_gpiod[idx] = csgpiod;
> >>>>>>>     }
> >>>>>>>
> >>>>>>>     /**
> >>>>>>> @@ -388,6 +401,8 @@ extern struct spi_device
> >>>>>>> *spi_new_ancillary_device(struct spi_device *spi, u8 ch
> >>>>>>>      * @bus_lock_spinlock: spinlock for SPI bus locking
> >>>>>>>      * @bus_lock_mutex: mutex for exclusion of multiple callers
> >>>>>>>      * @bus_lock_flag: indicates that the SPI bus is locked for
> >>>>>> exclusive use
> >>>>>>> + * @multi_cs_cap: indicates that the SPI Controller can
> >>>>>> assert/de-assert
> >>>>>>> + *	more than one chip select at once.
> >>>>>>>      * @setup: updates the device mode and clocking records used by
> a
> >>>>>>>      *	device's SPI controller; protocol code may call this.  This
> >>>>>>>      *	must fail if an unrecognized or unsupported mode is
> >> requested.
> >>>>>>> @@ -554,6 +569,11 @@ struct spi_controller {
> >>>>>>>     #define SPI_CONTROLLER_MUST_TX		BIT(4)	/*
> Requires tx
> >>>>>>> */
> >>>>>>>
> >>>>>>>     #define SPI_MASTER_GPIO_SS		BIT(5)	/* GPIO CS
> must
> >>>>>> select
> >>>>>>> slave */
> >>>>>>> +	/*
> >>>>>>> +	 * The spi-controller has multi chip select capability and can
> >>>>>>> +	 * assert/de-assert more than one chip select at once.
> >>>>>>> +	 */
> >>>>>>> +#define SPI_CONTROLLER_MULTI_CS		BIT(6)
> >>>>>>>
> >>>>>>>     	/* Flag indicating if the allocation of this struct is devres-
> >>>>>>> managed */
> >>>>>>>     	bool			devm_allocated;
> >>>>>>> --
> >>>>>>> 2.17.1
Stefan Binding May 9, 2023, 4:17 p.m. UTC | #9
Hi,

On 02/05/2023 12:40, Mahapatra, Amit Kumar wrote:
> Hello Stefan,
>
>> -----Original Message-----
>> From: Stefan Binding <sbinding@opensource.cirrus.com>
>> Sent: Friday, April 28, 2023 7:38 PM
>> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
>> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
>> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
>> vigneshr@ti.com
>> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org; linux-
>> kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
>> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
>> claudiu.beznea@microchip.com; Simek, Michal <michal.simek@amd.com>;
>> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
>> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
>> Subject: Re: [PATCH V7 1/7] spi: Add stacked and parallel memories support
>> in SPI core
>>
>> Hi,
>>
>> On 27/04/2023 18:09, Mahapatra, Amit Kumar wrote:
>>> Hello Stefan,
>>>
>>>> -----Original Message-----
>>>> From: Stefan Binding <sbinding@opensource.cirrus.com>
>>>> Sent: Tuesday, April 25, 2023 5:50 PM
>>>> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
>>>> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
>>>> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
>>>> vigneshr@ti.com
>>>> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org; linux-
>>>> kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
>>>> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
>>>> claudiu.beznea@microchip.com; Simek, Michal
>> <michal.simek@amd.com>;
>>>> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
>>>> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
>>>> Subject: Re: [PATCH V7 1/7] spi: Add stacked and parallel memories
>>>> support in SPI core
>>>>
>>>> Hi,
>>>>
>>>> On 20/04/2023 10:04, Mahapatra, Amit Kumar wrote:
>>>>> Hello Stefan,
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Stefan Binding <sbinding@opensource.cirrus.com>
>>>>>> Sent: Wednesday, April 12, 2023 8:33 PM
>>>>>> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
>>>>>> broonie@kernel.org; tudor.ambarus@linaro.org; pratyush@kernel.org;
>>>>>> michael@walle.cc; miquel.raynal@bootlin.com; richard@nod.at;
>>>>>> vigneshr@ti.com
>>>>>> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org;
>>>>>> linux- kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
>>>>>> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
>>>>>> claudiu.beznea@microchip.com; Simek, Michal
>>>> <michal.simek@amd.com>;
>>>>>> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
>>>>>> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
>>>>>> Subject: Re: [PATCH V7 1/7] spi: Add stacked and parallel memories
>>>>>> support in SPI core
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> On 11/04/2023 10:07, Mahapatra, Amit Kumar wrote:
>>>>>>> Hello Stefan,
>>>>>>>
>>>>>>>> -----Original Message-----
>>>>>>>> From: Stefan Binding <sbinding@opensource.cirrus.com>
>>>>>>>> Sent: Thursday, April 6, 2023 7:14 PM
>>>>>>>> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>;
>>>>>>>> broonie@kernel.org; tudor.ambarus@linaro.org;
>>>>>>>> pratyush@kernel.org; michael@walle.cc;
>> miquel.raynal@bootlin.com;
>>>>>>>> richard@nod.at; vigneshr@ti.com
>>>>>>>> Cc: git (AMD-Xilinx) <git@amd.com>; linux-spi@vger.kernel.org;
>>>>>>>> linux- kernel@vger.kernel.org; linux-mtd@lists.infradead.org;
>>>>>>>> nicolas.ferre@microchip.com; alexandre.belloni@bootlin.com;
>>>>>>>> claudiu.beznea@microchip.com; Simek, Michal
>>>>>> <michal.simek@amd.com>;
>>>>>>>> linux-arm-kernel@lists.infradead.org; amitrkcian2002@gmail.com;
>>>>>>>> patches@opensource.cirrus.com; vitalyr@opensource.cirrus.com
>>>>>>>> Subject: RE: [PATCH V7 1/7] spi: Add stacked and parallel
>>>>>>>> memories support in SPI core
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>>> -----Original Message-----
>>>>>>>>> From: Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>
>>>>>>>>> Sent: Thursday, April 6, 2023 7:54 AM
>>>>>>>>> To: broonie@kernel.org; tudor.ambarus@linaro.org;
>>>>>>>>> pratyush@kernel.org; michael@walle.cc;
>>>>>>>>> miquel.raynal@bootlin.com; richard@nod.at; vigneshr@ti.com
>>>>>>>>> Cc: git@amd.com; sbinding@opensource.cirrus.com; linux-
>>>>>>>>> spi@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
>>>>>>>>> mtd@lists.infradead.org; nicolas.ferre@microchip.com;
>>>>>>>>> alexandre.belloni@bootlin.com; claudiu.beznea@microchip.com;
>>>>>>>>> michal.simek@amd.com; linux-arm-kernel@lists.infradead.org;
>>>>>>>>> amitrkcian2002@gmail.com; Amit Kumar Mahapatra <amit.kumar-
>>>>>>>>> mahapatra@amd.com>
>>>>>>>>> Subject: [PATCH V7 1/7] spi: Add stacked and parallel memories
>>>>>>>> support
>>>>>>>>> in SPI core
>>>>>>>>>
>>>>>>>>> For supporting multiple CS the SPI device need to be aware of
>>>>>>>>> all
>>>>>>>> the CS
>>>>>>>>> values. So, the "chip_select" member in the spi_device structure
>>>>>>>>> is
>>>>>>>> now
>>>>>>>>> an
>>>>>>>>> array that holds all the CS values.
>>>>>>>>>
>>>>>>>>> spi_device structure now has a "cs_index_mask" member. This acts
>>>>>>>>> as
>>>>>>>> an
>>>>>>>>> index to the chip_select array. If nth bit of spi->cs_index_mask
>>>>>>>>> is
>>>>>>>> set
>>>>>>>>> then the driver would assert spi->chip_select[n].
>>>>>>>>>
>>>>>>>>> In parallel mode all the chip selects are asserted/de-asserted
>>>>>>>>> simultaneously and each byte of data is stored in both devices,
>>>>>>>>> the
>>>>>>>> even
>>>>>>>>> bits in one, the odd bits in the other. The split is
>>>>>>>>> automatically
>>>>>>>> handled
>>>>>>>>> by the GQSPI controller. The GQSPI controller supports a maximum
>>>>>>>>> of two flashes connected in parallel mode. A
>>>>>>>>> SPI_CONTROLLER_MULTI_CS flag bit is added in the spi
>>>>>>>>> controntroller flags, through
>>>>>>>>> ctlr->flags the spi
>>>>>>>> core
>>>>>>>>> will make sure that the controller is capable of handling
>>>>>>>>> multiple
>>>>>>>> chip
>>>>>>>>> selects at once.
>>>>>>>>>
>>>>>>>>> For supporting multiple CS via GPIO the cs_gpiod member of the
>>>>>>>>> spi_device structure is now an array that holds the gpio
>>>>>>>>> descriptor for each chipselect.
>>>>>>>>>
>>>>>>>>> Multi CS support using GPIO is not tested due to unavailability
>>>>>>>>> of necessary hardware setup.
>>>>>>>>>
>>>>>>>>> Multi CS configuration with one native CS and one GPIO CS is not
>>>>>>>>> supported as this configuration could not be tested due to
>>>>>>>>> unavailability of necessary hardware setup.
>>>>>>>> I've tested this chain on a released laptop (HP EliteBook 840 G9)
>>>>>>>> which uses SPI to interface to 2 amps, one amp uses a native CS
>>>>>>>> and the other uses a GPIO CS, and I noticed that when using this
>>>>>>>> chain, the second amp no longer works.
>>>>>>> Thank you for testing this patch series on GPIO CS setup. As I
>>>>>>> don't have a GPIO CS setup, is it possible for you debug the
>>>>>>> failure and share more details/logs where the problem is?
>>>>>>>
>>>>>>> Regards,
>>>>>>> Amit
>>>>>> We are willing and able to debug this failure and share the failure logs.
>>>>>> The first issue that I see is a kernel crash when trying to set the GPIO CS:
>>>>>>
>>>>>> [    2.951658] general protection fault, probably for non-canonical
>>>>>> address
>>>>>> 0xdead000000000122: 0000 [#1] PREEMPT SMP NOPTI [    2.951771]
>> CPU:
>>>> 9
>>>>>> PID: 379 Comm: systemd-udevd Tainted: G A           6.3.0-rc3+ #30
>>>>>> [ 2.951826] Hardware name: HP /896D, BIOS U70 Ver. 89.33.02
>>>>>> 10/29/2021 [    2.951882] RIP:
>>>>>> 0010:gpiod_set_value_cansleep+0x21/0xa0
>>>>>> [    2.951941] Code: 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 48
>>>>>> 85 ff
>>>>>> 74 3e 55 48 89 e5 41 55 41 89 f5 41 54 49 89 fc 48 81 ff 00 f0 ff
>>>>>> ff
>>>>>> 77 2c <48> 8b 3f 48 85 ff 74 53 48 83 bf 68 03 00 00 00 74 34 44 89
>>>>>> ee 4c [    2.952043]
>>>>>> RSP: 0018:ffffc008c0deb928 EFLAGS: 00010287 [    2.952080] RAX:
>>>>>> 0000000000000001 RBX: ffffa0a489534c00 RCX:
>>>>>> 0000000000000000
>>>>>> [    2.952124] RDX: dead000000000122 RSI: 0000000000000001 RDI:
>>>>>> dead000000000122
>>>>>> [    2.952167] RBP: ffffc008c0deb938 R08: 0000000000000000 R09:
>>>>>> ffffc008c0deb868
>>>>>> [    2.952211] R10: ffffffffffffffff R11: 00000000000000b0 R12:
>>>>>> dead000000000122
>>>>>> [    2.952256] R13: 0000000000000001 R14: 0000000000000000 R15:
>>>>>> 0000000000000000
>>>>>> [    2.952299] FS:  00007f7fa5b5b880(0000)
>>>>>> GS:ffffa0a81f840000(0000)
>>>>>> knlGS:0000000000000000
>>>>>> [    2.952369] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [
>>>>>> 2.952407] CR2: 000055d648427100 CR3: 000000010e960003 CR4:
>>>>>> 0000000000770ee0
>>>>>> [    2.952451] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
>>>>>> 0000000000000000
>>>>>> [    2.952492] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
>>>>>> 0000000000000400
>>>>>> [    2.952533] PKRU: 55555554
>>>>>> [    2.952561] Call Trace:
>>>>>> [    2.952579]  <TASK>
>>>>>> [    2.952598]  spi_set_cs+0x257/0x4a0 [    2.952630]
>>>>>> spi_setup+0x1a2/0x500 [    2.952667]  __spi_add_device+0x88/0x160 [
>>>>>> 2.952710]  spi_add_device+0x60/0x90 [    2.952738]
>>>>>> smi_spi_probe+0x178/0x370 [serial_multi_instantiate] [    2.952792]
>>>>>> smi_probe+0xcf/0x110 [serial_multi_instantiate] [    2.952854]
>>>>>> platform_probe+0x42/0xb0 [    2.952885]  really_probe+0x1b2/0x420 [
>>>>>> 2.952914]  __driver_probe_device+0x7e/0x180 [    2.952947]
>>>>>> driver_probe_device+0x23/0xa0 [    2.952993]
>>>>>> __driver_attach+0xe4/0x1e0 [    2.953021]  ?
>>>>>> __pfx___driver_attach+0x10/0x10
>>>>>> [    2.953061]  bus_for_each_dev+0x7a/0xd0 [    2.953088]
>>>>>> driver_attach+0x1e/0x30 [    2.953123]  bus_add_driver+0x11c/0x220
>>>>>> [ 2.953150]  driver_register+0x64/0x130 [    2.953174]  ?
>>>>>> __pfx_init_module+0x10/0x10 [serial_multi_instantiate] [
>>>>>> 2.953221]
>>>>>> __platform_driver_register+0x1e/0x30
>>>>>> [    2.953251]  smi_driver_init+0x1c/0xff0
>>>>>> [serial_multi_instantiate] [    2.953310]  do_one_initcall+0x46/0x220
>> [    2.953339]  ?
>>>>>> kmalloc_trace+0x2a/0xa0 [    2.953375]  do_init_module+0x52/0x220 [
>>>>>> 2.953411]  load_module+0x223c/0x2460 [    2.953450]
>>>>>> __do_sys_finit_module+0xc8/0x140 [    2.953479]  ?
>>>>>> __do_sys_finit_module+0xc8/0x140
>>>>>> [    2.953510]  __x64_sys_finit_module+0x18/0x20 [    2.953538]
>>>>>> do_syscall_64+0x38/0x90 [    2.953574]
>>>>>> entry_SYSCALL_64_after_hwframe+0x72/0xdc
>>>>>> [    2.953606] RIP: 0033:0x7f7fa5d7476d [    2.953639] Code: 00 c3
>>>>>> 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa
>>>>>> 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24
>>>>>> 08 0f
>>>>>> 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f3 36 0d 00 f7 d8 64 89 01
>>>>>> 48 [    2.953739] RSP: 002b:00007fff1f8dd3b8 EFLAGS: 00000246
>>>> ORIG_RAX:
>>>>>> 0000000000000139
>>>>>> [    2.956833] RAX: ffffffffffffffda RBX: 000055d648654ab0 RCX:
>>>>>> 00007f7fa5d7476d
>>>>>> [    2.959202] RDX: 0000000000000000 RSI: 00007f7fa5c54ded RDI:
>>>>>> 0000000000000006
>>>>>> [    2.961542] RBP: 0000000000020000 R08: 0000000000000000 R09:
>>>>>> 0000000000000000
>>>>>> [    2.964312] R10: 0000000000000006 R11: 0000000000000246 R12:
>>>>>> 00007f7fa5c54ded
>>>>>> [    2.966694] R13: 0000000000000000 R14: 000055d6483f41a0 R15:
>>>>>> 000055d648654ab0
>>>>>> [    2.967668] resource: resource sanity check: requesting [mem
>>>>>> 0x00000000fedc0000-0x00000000fedcffff], which spans more than pnp
>>>>>> 00:04 [mem 0xfedc0000-0xfedc7fff] [    2.968998]  </TASK> [
>>>>>> 2.971615] caller
>>>>>> igen6_probe+0x178/0x8e0 [igen6_edac] mapping multiple BARs [
>>>>>> 2.975014] Modules linked in: igen6_edac(+) fjes(-)
>>>>>> serial_multi_instantiate(+) int3403_thermal sch_fq_codel
>>>>>> int340x_thermal_zone int3400_thermal intel_hid acpi_thermal_rel
>>>>>> acpi_tad sparse_keymap acpi_pad mac_hid msr parport_pc ppdev lp
>>>>>> parport drm ramoops reed_solomon efi_pstore ip_tables x_tables
>>>>>> autofs4 spi_pxa2xx_platform dw_dmac dw_dmac_core nvme
>>>> intel_lpss_pci
>>>>>> intel_lpss crc32_pclmul thunderbolt i2c_i801 xhci_pci idma64
>>>>>> nvme_core i2c_smbus virt_dma xhci_pci_renesas video wmi
>>>>>> pinctrl_tigerlake [    2.987901] ---[ end trace 0000000000000000
>>>>>> ]---
>>>> [    3.157030] RIP:
>>>>>> 0010:gpiod_set_value_cansleep+0x21/0xa0
>>>>>> [    3.159077] Code: 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 48
>>>>>> 85 ff
>>>>>> 74 3e 55 48 89 e5 41 55 41 89 f5 41 54 49 89 fc 48 81 ff 00 f0 ff
>>>>>> ff
>>>>>> 77 2c <48> 8b 3f 48 85 ff 74 53 48 83 bf 68 03 00 00 00 74 34 44 89
>>>>>> ee 4c [    3.161461]
>>>>>> RSP: 0018:ffffc008c0deb928 EFLAGS: 00010287 [    3.164005] RAX:
>>>>>> 0000000000000001 RBX: ffffa0a489534c00 RCX:
>>>>>> 0000000000000000
>>>>>> [    3.166354] RDX: dead000000000122 RSI: 0000000000000001 RDI:
>>>>>> dead000000000122
>>>>>> [    3.168499] RBP: ffffc008c0deb938 R08: 0000000000000000 R09:
>>>>>> ffffc008c0deb868
>>>>>> [    3.170609] R10: ffffffffffffffff R11: 00000000000000b0 R12:
>>>>>> dead000000000122
>>>>>> [    3.172893] R13: 0000000000000001 R14: 0000000000000000 R15:
>>>>>> 0000000000000000
>>>>>> [    3.175335] FS:  00007f7fa5b5b880(0000)
>>>>>> GS:ffffa0a81f840000(0000)
>>>>>> knlGS:0000000000000000
>>>>>> [    3.180434] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [
>>>>>> 3.183356] CR2: 000055d648427100 CR3: 000000010e960003 CR4:
>>>>>> 0000000000770ee0
>>>>>> [    3.185107] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
>>>>>> 0000000000000000
>>>>>> [    3.186840] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
>>>>>> 0000000000000400
>>>>>> [    3.188647] PKRU: 55555554
>>>>> Thank you for sharing the logs.
>>>>> As per our analysis the spi->cs_gpiod[0] is getting messed up while
>>>>> setting it in __spi_add_device( ).
>>>>> Is it possible for you to do the following changes on top of this
>>>>> patch series & re-run your test.
>>>>>
>>>>> After applying this patch series, in drivers/spi/spi.c file replace
>>>>> the following code snippet in __spi_add_device( ) function defination.
>>>>>
>>>>> if (ctlr->cs_gpiods) {
>>>>>            for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
>>>>>                    spi_set_csgpiod(spi, idx,
>>>>> ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]); }
>>>>>
>>>>> with the below code snippet
>>>>>
>>>>> if (ctlr->cs_gpiods) {
>>>>>            for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>>>>>                    if (!(idx != 0 && !spi_get_chipselect(spi, idx)))
>>>>>                            spi_set_csgpiod(spi, idx, ctlr-
>>>>> cs_gpiods[spi_get_chipselect(spi, idx)]);
>>>>>            }
>>>>> }
>>>>>
>>>>> then re-run your test.
>>>>>
>>>>> Regards,
>>>>> Amit
>>>> I'm still seeing a crash on probe:
>>>>
>>>> [    3.265683] BUG: unable to handle page fault for address:
>>>> 00000000fffedfdd
>>>> [    3.265744] #PF: supervisor read access in kernel mode [    3.265781] #PF:
>>>> error_code(0x0000) - not-present page [    3.265817] PGD 0 P4D 0 [
>>>> 3.265840] Oops: 0000 [#1] PREEMPT SMP NOPTI [    3.265865] CPU: 4 PID:
>>>> 385 Comm: systemd-udevd Tainted: G A           6.3.0-rc3+ #32 [
>>>> 3.265910] Hardware name: HP /896D, BIOS U70 Ver. 89.33.02 10/29/2021
>>>> [    3.265956]
>>>> RIP: 0010:gpiod_set_raw_value_commit+0x3d/0xf0
>>>> [    3.266007] Code: 48 89 e5 41 55 44 0f b6 ee 41 54 53 48 8b 17 48
>>>> 2b
>>>> 82 70 03 00 00 4c 8b a2 68 03 00 00 48 c1 f8 03 48 0f af c1 66 90 48
>>>> 89
>>>> c6 <49> 8b 44 24 60 44 89 ea 4c 89 e7 ff d0 0f 1f 00 5b 41 5c 41 5d
>>>> 5d [    3.266092] RSP: 0018:ffffaad780f6f620 EFLAGS: 00010a03 [
>>>> 3.266121]
>>>> RAX: 333330b6bdbad102 RBX: ffff9c8d4a5f6800 RCX:
>>>> cccccccccccccccd
>>>> [    3.266156] RDX: ffff9c8d4a5f6d40 RSI: 333330b6bdbad102 RDI:
>>>> ffff9c8d4a5f6d40
>>>> [    3.266192] RBP: ffffaad780f6f638 R08: 00000001018c3789 R09:
>>>> 0000000000000000
>>>> [    3.266228] R10: ffff9c8c4009ee40 R11: 0000000000000000 R12:
>>>> 00000000fffedf7d
>>>> [    3.266264] R13: 0000000000000000 R14: 0000000000000001 R15:
>>>> 0000000000000001
>>>> [    3.266299] FS:  00007f98d04de880(0000) GS:ffff9c90df700000(0000)
>>>> knlGS:0000000000000000
>>>> [    3.266358] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [
>>>> 3.266388] CR2: 00000000fffedfdd CR3: 000000010b680003 CR4:
>>>> 0000000000770ee0
>>>> [    3.266422] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
>>>> 0000000000000000
>>>> [    3.266457] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
>>>> 0000000000000400
>>>> [    3.266490] PKRU: 55555554
>>>> [    3.266513] Call Trace:
>>>> [    3.266530]  <TASK>
>>>> [    3.266546]  gpiod_set_value_nocheck+0x5b/0x70 [    3.266583]
>>>> gpiod_set_value_cansleep+0x3e/0xa0
>>>> [    3.266609]  spi_set_cs+0x257/0x4a0 [    3.266634]
>>>> spi_transfer_one_message+0x49/0x740
>>>> [    3.266672]  __spi_pump_transfer_message+0x29b/0x620
>>>> [    3.266712]  __spi_sync+0x26f/0x3b0 [    3.266735]
>>>> spi_write_then_read+0x157/0x210 [    3.266771]  ?
>>>> psi_group_change+0x175/0x3b0
>> [    3.266802]  regmap_spi_read+0xe/0x20
>>>> [    3.266826]  _regmap_raw_read+0xe1/0x210 [    3.266861]
>>>> _regmap_bus_read+0x3a/0x70 [    3.266887]  _regmap_read+0x66/0x140
>> [
>>>> 3.266918]  regmap_read+0x3f/0x70 [    3.266957]
>>>> cs35l41_hda_probe+0x553/0xc10 [snd_hda_scodec_cs35l41]
>> [    3.267027]
>>>> cs35l41_hda_spi_probe+0x62/0x80 [snd_hda_scodec_cs35l41_spi] [
>>>> 3.267096]  spi_probe+0x55/0x90 [    3.267145]
>>>> really_probe+0x1b2/0x420 [    3.267184]
>>>> __driver_probe_device+0x7e/0x180 [    3.267227]
>>>> driver_probe_device+0x23/0xa0 [    3.267287]
>>>> __driver_attach+0xe4/0x1e0 [    3.267326]  ?
>>>> __pfx___driver_attach+0x10/0x10
>>>> [    3.267381]  bus_for_each_dev+0x7a/0xd0 [    3.267406]
>>>> driver_attach+0x1e/0x30 [    3.267437]  bus_add_driver+0x11c/0x220 [
>>>> 3.267461]  driver_register+0x64/0x130 [    3.267483]  ?
>>>> __pfx_init_module+0x10/0x10 [snd_hda_scodec_cs35l41_spi] [
>>>> 3.267525]  __spi_register_driver+0xa1/0xd0 [    3.270712]  ?
>>>> __pfx_init_module+0x10/0x10 [snd_hda_scodec_cs35l41_spi] [
>>>> 3.273446]  cs35l41_spi_driver_init+0x1c/0xff0
>>>> [snd_hda_scodec_cs35l41_spi]
>>>> [    3.275119]  do_one_initcall+0x46/0x220 [    3.276828]  ?
>>>> kmalloc_trace+0x2a/0xa0 [    3.279290]  do_init_module+0x52/0x220 [
>>>> 3.283593]  load_module+0x223c/0x2460 [    3.283602]
>>>> __do_sys_finit_module+0xc8/0x140 [    3.287883]  ?
>>>> __do_sys_finit_module+0xc8/0x140
>>>> [    3.287907]  __x64_sys_finit_module+0x18/0x20 [    3.293156]
>>>> do_syscall_64+0x38/0x90 [    3.298937]
>>>> entry_SYSCALL_64_after_hwframe+0x72/0xdc
>>>> [    3.298945] RIP: 0033:0x7f98d06f776d [    3.319574] Code: 00 c3 66
>>>> 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa
>>>> 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08
>>>> 0f
>>>> 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d f3 36 0d 00 f7 d8 64 89 01
>>>> 48 [    3.319579] RSP: 002b:00007ffd988f7a08 EFLAGS: 00000246
>> ORIG_RAX:
>>>> 0000000000000139
>>>> [    3.319585] RAX: ffffffffffffffda RBX: 000055af06a7d030 RCX:
>>>> 00007f98d06f776d
>>>> [    3.319589] RDX: 0000000000000000 RSI: 00007f98d05d7ded RDI:
>>>> 0000000000000013
>>>> [    3.329520] RBP: 0000000000020000 R08: 0000000000000000 R09:
>>>> 0000000000000000
>>>> [    3.329523] R10: 0000000000000013 R11: 0000000000000246 R12:
>>>> 00007f98d05d7ded
>>>> [    3.329525] R13: 0000000000000000 R14: 000055af06cdd040 R15:
>>>> 000055af06a7d030
>>>> [    3.329531]  </TASK>
>>>> [    3.329533] Modules linked in: snd_hda_intel(+) ttm
>>>> snd_intel_dspcfg btusb rapl snd_seq_midi snd_intel_sdw_acpi libarc4
>>>> intel_cstate binfmt_misc
>>>> uvcvideo(+) snd_seq_midi_event btrtl
>>>> snd_hda_scodec_cs35l41_spi(+) snd_hda_codec drm_display_helper
>>>> cdc_ncm(+) videobuf2_vmalloc snd_rawmidi btbcm uvc cdc_ether cec
>>>> btintel videobuf2_memops snd_hda_scodec_cs35l41_i2c snd_hda_core
>>>> videobuf2_v4l2 uas usbnet rc_core snd_hwdep btmtk
>>>> snd_hda_scodec_cs35l41 input_leds mii wmi_bmof videodev snd_seq
>>>> processor_thermal_device_pci bluetooth iwlwifi drm_kms_helper
>> snd_pcm
>>>> snd_hda_cs_dsp_ctls processor_thermal_device mei_me
>> videobuf2_common
>>>> snd_seq_device i2c_algo_bit cs_dsp processor_thermal_rfim
>>>> ecdh_generic usb_storage serio_raw mc syscopyarea ecc
>>>> processor_thermal_mbox ucsi_acpi snd_soc_cs35l41_lib 8250_dw mei
>>>> snd_timer cfg80211 sysfillrect typec_ucsi processor_thermal_rapl
>>>> igen6_edac sysimgblt intel_rapl_common typec snd soundcore
>>>> int3403_thermal int340x_thermal_zone serial_multi_instantiate
>>>> int3400_thermal intel_hid acpi_thermal_rel [    3.338475]
>>>> sparse_keymap acpi_tad acpi_pad mac_hid sch_fq_codel msr parport_pc
>>>> ppdev lp parport drm ramoops reed_solomon efi_pstore ip_tables
>>>> x_tables autofs4 spi_pxa2xx_platform dw_dmac dw_dmac_core
>>>> intel_lpss_pci nvme intel_lpss i2c_i801 idma64 crc32_pclmul
>>>> thunderbolt i2c_smbus nvme_core xhci_pci virt_dma xhci_pci_renesas
>>>> video wmi pinctrl_tigerlake [    3.338514]
>>>> CR2: 00000000fffedfdd [    3.338517] ---[ end trace 0000000000000000
>>>> ]--- [    3.504965] RIP: 0010:gpiod_set_raw_value_commit+0x3d/0xf0
>>>> [    3.504973] Code: 48 89 e5 41 55 44 0f b6 ee 41 54 53 48 8b 17 48
>>>> 2b
>>>> 82 70 03 00 00 4c 8b a2 68 03 00 00 48 c1 f8 03 48 0f af c1 66 90 48
>>>> 89
>>>> c6 <49> 8b 44 24 60 44 89 ea 4c 89 e7 ff d0 0f 1f 00 5b 41 5c 41 5d
>>>> 5d [    3.504975] RSP: 0018:ffffaad780f6f620 EFLAGS: 00010a03 [
>>>> 3.504978]
>>>> RAX: 333330b6bdbad102 RBX: ffff9c8d4a5f6800 RCX:
>>>> cccccccccccccccd
>>>> [    3.504979] RDX: ffff9c8d4a5f6d40 RSI: 333330b6bdbad102 RDI:
>>>> ffff9c8d4a5f6d40
>>>> [    3.504980] RBP: ffffaad780f6f638 R08: 00000001018c3789 R09:
>>>> 0000000000000000
>>>> [    3.504982] R10: ffff9c8c4009ee40 R11: 0000000000000000 R12:
>>>> 00000000fffedf7d
>>>> [    3.504983] R13: 0000000000000000 R14: 0000000000000001 R15:
>>>> 0000000000000001
>>>> [    3.504984] FS:  00007f98d04de880(0000) GS:ffff9c90df700000(0000)
>>>> knlGS:0000000000000000
>>>> [    3.504986] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [
>>>> 3.504988] CR2: 00000000fffedfdd CR3: 000000010b680003 CR4:
>>>> 0000000000770ee0
>>>> [    3.504989] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
>>>> 0000000000000000
>>>> [    3.504990] DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7:
>>>> 0000000000000400
>>>> [    3.504992] PKRU: 55555554
>>>>
>>>> Thanks,
>>>> Stefan
>>> Thanks for the logs.
>>>
>>> Could you please confirm that your test case was passing with
>>>
>> https://github.com/torvalds/linux/commit/303feb3cc06ac0665d0ee9c14149
>> 4
>>> 1200e60e8a3 patch but it is failing with the current patch series ?
>> I retested with the latest master kernel
>> https://github.com/torvalds/linux/commit/33afd4b76393627477e878b3b195
>> d606e585d816
>> and I could see it worked fine. I attached a dmesg log of this.
>>
>> That particular commit id you posted does not work, due to a different issue
>> which was fixed in a later commit.
> Thank you for the confirmation.
>>> Regarding the failure
>>> The logs suggest that we are trying to access an invalid pointer while
>>> calling the gpiod_set_value_cansleep( ) API.
>>> This could be possible if the cs_num is corrupted and we are trying to
>>> access an invalid spi->cs_gpiod[ ].
>>> To confirm the same could you please do the following changes in the
>>> code and re-test.
>>>
>>> After applying this patch series, in drivers/spi/spi.c file replace
>>> the following code snippet in __spi_add_device( ) function definition.
>>> if (ctlr->cs_gpiods) {
>>>           for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
>>>                   spi_set_csgpiod(spi, idx,
>>> ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]); }
>>>
>>> with the below code snippet
>>>
>>> if (ctlr->cs_gpiods) {
>>>           for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>>>                   if (!(idx != 0 && !spi_get_chipselect(spi, idx))) {
>>> 		printk("%s( ) [%d] cs[%d] = [%d]\n", __func__, __LINE__, idx,
>> spi_get_chipselect(spi, idx));
>>> 		spi_set_csgpiod(spi, idx, ctlr-
>>> cs_gpiods[spi_get_chipselect(spi, idx)]);
>>> 	}
>>>           }
>>> }
>>>
>>> And at the start of  spi_set_cs( ) function in drivers/spi/spi.c file
>>> add the following print statements.
>>>
>>> printk("%s( ) [%d] spi->cs_index_mask == [%d]\n", __func__, __LINE__,
>>> spi->cs_index_mask); printk("%s( ) [%d] cs_num == [%d]\n", __func__,
>>> __LINE__, cs_num);
>> I've attached dmesg log of this. It no longer crashes when using the prints (I
>> am unsure why), but it still does not work.
>> For sanity, I retested these changes with the print lines commented out, and
>> the crash returned.
> Thanks a lot for the dmesg log.
> Here the __ffs() is creating the issue. __ffs() behavior is undefined if
> no set bits exist in spi->cs_index_mask , as a result random value
> (i.e, 64) is assigned to cs_num.
> I think this could be fixed by replacing __ffs() with ffs() calls.
> To confirm the same could you please apply the attached patch on top of
> this patch series and re-test. If it works fine, then for sanity kindly
> rerun by removing the printk lines.

I tested the patch (with and without the prints) on a number of systems 
we have
which use multiple SPI Chip Select GPIOs, and it looks like with this 
patch, they
are all working now.

Thanks,

Stefan

>
> Thanks,
> Amit
>
>>> Thanks,
>>> Amit
>>>>>> Thanks,
>>>>>>
>>>>>> Stefan
>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Stefan Binding
>>>>>>>>
>>>>>>>>> Signed-off-by: Amit Kumar Mahapatra <amit.kumar-
>>>>>>>> mahapatra@amd.com>
>>>>>>>>> ---
>>>>>>>>>      drivers/spi/spi.c       | 226
>>>>>>>> ++++++++++++++++++++++++++++------------
>>>>>>>>>      include/linux/spi/spi.h |  32 ++++--
>>>>>>>>>      2 files changed, 183 insertions(+), 75 deletions(-)
>>>>>>>>>
>>>>>>>>> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index
>>>>>>>>> 9036d7a50674..04d7322170c4 100644
>>>>>>>>> --- a/drivers/spi/spi.c
>>>>>>>>> +++ b/drivers/spi/spi.c
>>>>>>>>> @@ -612,10 +612,24 @@ static int spi_dev_check(struct device
>> *dev,
>>>>>>>>> void *data)  {
>>>>>>>>>      	struct spi_device *spi = to_spi_device(dev);
>>>>>>>>>      	struct spi_device *new_spi = data;
>>>>>>>>> +	int idx, nw_idx;
>>>>>>>>>
>>>>>>>>> -	if (spi->controller == new_spi->controller &&
>>>>>>>>> -	    spi_get_chipselect(spi, 0) == spi_get_chipselect(new_spi,
>>>>>>>> 0))
>>>>>>>>> -		return -EBUSY;
>>>>>>>>> +	if (spi->controller == new_spi->controller) {
>>>>>>>>> +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>>>>>>>>> +			for (nw_idx = 0; nw_idx < SPI_CS_CNT_MAX;
>>>>>>>>> nw_idx++) {
>>>>>>>>> +				if ((idx != 0 &&
>>>>>>>> !spi_get_chipselect(spi,
>>>>>>>>> idx)) ||
>>>>>>>>> +				    (nw_idx != 0 &&
>>>>>>>>> !spi_get_chipselect(spi, nw_idx))) {
>>>>>>>>> +					continue;
>>>>>>>>> +				} else if (spi_get_chipselect(spi,
>>>>>>>> idx) ==
>>>>>>>>> +				    spi_get_chipselect(new_spi,
>>>>>>>> nw_idx))
>>>>>>>>> {
>>>>>>>>> +					dev_err(dev,
>>>>>>>>> +						"chipselect %d
>>>> already
>>>>>>>>> in use\n",
>>>>>>>>> +
>>>>>>>>> 	spi_get_chipselect(new_spi, nw_idx));
>>>>>>>>> +					return -EBUSY;
>>>>>>>>> +				}
>>>>>>>>> +			}
>>>>>>>>> +		}
>>>>>>>>> +	}
>>>>>>>>>      	return 0;
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>> @@ -629,7 +643,7 @@ static int __spi_add_device(struct spi_device
>>>>>>>>> *spi)
>>>>>>>>>      {
>>>>>>>>>      	struct spi_controller *ctlr = spi->controller;
>>>>>>>>>      	struct device *dev = ctlr->dev.parent;
>>>>>>>>> -	int status;
>>>>>>>>> +	int status, idx;
>>>>>>>>>
>>>>>>>>>      	/*
>>>>>>>>>      	 * We need to make sure there's no other device with this
>>>> @@
>>>>>>>>> -638,8
>>>>>>>>> +652,6 @@ static int __spi_add_device(struct spi_device
>>>>>>>>> *spi)
>>>>>>>>>      	 */
>>>>>>>>>      	status = bus_for_each_dev(&spi_bus_type, NULL, spi,
>>>>>>>> spi_dev_check);
>>>>>>>>>      	if (status) {
>>>>>>>>> -		dev_err(dev, "chipselect %d already in use\n",
>>>>>>>>> -				spi_get_chipselect(spi, 0));
>>>>>>>>>      		return status;
>>>>>>>>>      	}
>>>>>>>>>
>>>>>>>>> @@ -649,8 +661,10 @@ static int __spi_add_device(struct
>> spi_device
>>>>>>>>> *spi)
>>>>>>>>>      		return -ENODEV;
>>>>>>>>>      	}
>>>>>>>>>
>>>>>>>>> -	if (ctlr->cs_gpiods)
>>>>>>>>> -		spi_set_csgpiod(spi, 0, ctlr-
>>>>>>>>>> cs_gpiods[spi_get_chipselect(spi, 0)]);
>>>>>>>>> +	if (ctlr->cs_gpiods) {
>>>>>>>>> +		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
>>>>>>>>> +			spi_set_csgpiod(spi, idx, ctlr-
>>>>>>>>>> cs_gpiods[spi_get_chipselect(spi, idx)]);
>>>>>>>>> +	}
>>>>>>>>>
>>>>>>>>>      	/*
>>>>>>>>>      	 * Drivers may modify this initial i/o setup, but will @@
>>>>>>>>> -690,13
>>>>>>>>> +704,15 @@ int spi_add_device(struct spi_device *spi)  {
>>>>>>>>>      	struct spi_controller *ctlr = spi->controller;
>>>>>>>>>      	struct device *dev = ctlr->dev.parent;
>>>>>>>>> -	int status;
>>>>>>>>> +	int status, idx;
>>>>>>>>>
>>>>>>>>> -	/* Chipselects are numbered 0..max; validate. */
>>>>>>>>> -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
>>>>>>>>> -		dev_err(dev, "cs%d >= max %d\n",
>>>>>>>>> spi_get_chipselect(spi, 0),
>>>>>>>>> -			ctlr->num_chipselect);
>>>>>>>>> -		return -EINVAL;
>>>>>>>>> +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>>>>>>>>> +		/* Chipselects are numbered 0..max; validate. */
>>>>>>>>> +		if (spi_get_chipselect(spi, idx) >=
>>>>>>>> ctlr->num_chipselect) {
>>>>>>>>> +			dev_err(dev, "cs%d >= max %d\n",
>>>>>>>>> spi_get_chipselect(spi, idx),
>>>>>>>>> +				ctlr->num_chipselect);
>>>>>>>>> +			return -EINVAL;
>>>>>>>>> +		}
>>>>>>>>>      	}
>>>>>>>>>
>>>>>>>>>      	/* Set the bus ID string */
>>>>>>>>> @@ -713,12 +729,15 @@ static int spi_add_device_locked(struct
>>>>>>>>> spi_device *spi)  {
>>>>>>>>>      	struct spi_controller *ctlr = spi->controller;
>>>>>>>>>      	struct device *dev = ctlr->dev.parent;
>>>>>>>>> +	int idx;
>>>>>>>>>
>>>>>>>>> -	/* Chipselects are numbered 0..max; validate. */
>>>>>>>>> -	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
>>>>>>>>> -		dev_err(dev, "cs%d >= max %d\n",
>>>>>>>>> spi_get_chipselect(spi, 0),
>>>>>>>>> -			ctlr->num_chipselect);
>>>>>>>>> -		return -EINVAL;
>>>>>>>>> +	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
>>>>>>>>> +		/* Chipselects are numbered 0..max; validate. */
>>>>>>>>> +		if (spi_get_chipselect(spi, idx) >=
>>>>>>>> ctlr->num_chipselect) {
>>>>>>>>> +			dev_err(dev, "cs%d >= max %d\n",
>>>>>>>>> spi_get_chipselect(spi, idx),
>>>>>>>>> +				ctlr->num_chipselect);
>>>>>>>>> +			return -EINVAL;
>>>>>>>>> +		}
>>>>>>>>>      	}
>>>>>>>>>
>>>>>>>>>      	/* Set the bus ID string */
>>>>>>>>> @@ -966,58 +985,118 @@ static void spi_res_release(struct
>>>>>>>>> spi_controller *ctlr, struct spi_message *mes  static void
>>>>>>>>> spi_set_cs(struct spi_device *spi, bool enable, bool
>>>>>>>> force)
>>>>>>>>>      {
>>>>>>>>>      	bool activate = enable;
>>>>>>>>> +	u32 cs_num = __ffs(spi->cs_index_mask);
>>>>>>>>> +	int idx;
>>>>>>>>>
>>>>>>>>>      	/*
>>>>>>>>> -	 * Avoid calling into the driver (or doing delays) if the chip
>>>>>>>> select
>>>>>>>>> -	 * isn't actually changing from the last time this was called.
>>>>>>>>> +	 * In parallel mode all the chip selects are
>>>>>>>> asserted/de-asserted
>>>>>>>>> +	 * at once
>>>>>>>>>      	 */
>>>>>>>>> -	if (!force && ((enable && spi->controller->last_cs ==
>>>>>>>>> spi_get_chipselect(spi, 0)) ||
>>>>>>>>> -		       (!enable && spi->controller->last_cs !=
>>>>>>>>> spi_get_chipselect(spi, 0))) &&
>>>>>>>>> -	    (spi->controller->last_cs_mode_high == (spi->mode &
>>>>>>>>> SPI_CS_HIGH)))
>>>>>>>>> -		return;
>>>>>>>>> -
>>>>>>>>> -	trace_spi_set_cs(spi, activate);
>>>>>>>>> -
>>>>>>>>> -	spi->controller->last_cs = enable ? spi_get_chipselect(spi, 0)
>>>>>>>> : -1;
>>>>>>>>> -	spi->controller->last_cs_mode_high = spi->mode &
>>>>>>>>> SPI_CS_HIGH;
>>>>>>>>> -
>>>>>>>>> -	if ((spi_get_csgpiod(spi, 0) ||
>>>>>>>> !spi->controller->set_cs_timing)
>>>>>>>>> && !activate)
>>>>>>>>> -		spi_delay_exec(&spi->cs_hold, NULL);
>>>>>>>>> -
>>>>>>>>> -	if (spi->mode & SPI_CS_HIGH)
>>>>>>>>> -		enable = !enable;
>>>>>>>>> +	if ((spi->cs_index_mask & SPI_PARALLEL_CS_MASK) ==
>>>>>>>>> SPI_PARALLEL_CS_MASK) {
>>>>>>>>> +		spi->controller->last_cs_mode_high = spi->mode &
>>>>>>>>> SPI_CS_HIGH;
>>>>>>>>> +
>>>>>>>>> +		if ((spi_get_csgpiod(spi, 0) || !spi->controller-
>>>>>>>>>> set_cs_timing) && !activate)
>>>>>>>>> +			spi_delay_exec(&spi->cs_hold, NULL);
>>>>>>>>> +
>>>>>>>>> +		if (spi->mode & SPI_CS_HIGH)
>>>>>>>>> +			enable = !enable;
>>>>>>>>> +
>>>>>>>>> +		if (spi_get_csgpiod(spi, 0) && spi_get_csgpiod(spi,
>>>>>>>> 1)) {
>>>>>>>>> +			if (!(spi->mode & SPI_NO_CS)) {
>>>>>>>>> +				/*
>>>>>>>>> +				 * Historically ACPI has no means of
>>>>>>>> the
>>>>>>>>> GPIO polarity and
>>>>>>>>> +				 * thus the SPISerialBus() resource
>>>>>>>>> defines it on the per-chip
>>>>>>>>> +				 * basis. In order to avoid a chain of
>>>>>>>>> negations, the GPIO
>>>>>>>>> +				 * polarity is considered being Active
>>>>>>>>> High. Even for the cases
>>>>>>>>> +				 * when _DSD() is involved (in the
>>>>>>>>> updated versions of ACPI)
>>>>>>>>> +				 * the GPIO CS polarity must be
>>>>>>>> defined
>>>>>>>>> Active High to avoid
>>>>>>>>> +				 * ambiguity. That's why we use
>>>>>>>> enable,
>>>>>>>>> that takes SPI_CS_HIGH
>>>>>>>>> +				 * into account.
>>>>>>>>> +				 */
>>>>>>>>> +				if (has_acpi_companion(&spi->dev)) {
>>>>>>>>> +					for (idx = 0; idx <
>>>>>>>>> SPI_CS_CNT_MAX; idx++)
>>>>>>>>> +
>>>>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
>>>>>>>>> +
>>>>>>>>> !enable);
>>>>>>>>> +				} else {
>>>>>>>>> +					for (idx = 0; idx <
>>>>>>>>> SPI_CS_CNT_MAX; idx++)
>>>>>>>>> +						/* Polarity handled by
>>>>>>>>> GPIO library */
>>>>>>>>> +
>>>>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
>>>>>>>>> +
>>>>>>>>> activate);
>>>>>>>>> +				}
>>>>>>>>> +			}
>>>>>>>>> +			/* Some SPI masters need both GPIO CS &
>>>>>>>>> slave_select */
>>>>>>>>> +			if ((spi->controller->flags &
>>>>>>>>> SPI_MASTER_GPIO_SS) &&
>>>>>>>>> +			    spi->controller->set_cs)
>>>>>>>>> +				spi->controller->set_cs(spi, !enable);
>>>>>>>>> +		} else if (spi->controller->set_cs) {
>>>>>>>>> +			spi->controller->set_cs(spi, !enable);
>>>>>>>>> +		}
>>>>>>>>>
>>>>>>>>> -	if (spi_get_csgpiod(spi, 0)) {
>>>>>>>>> -		if (!(spi->mode & SPI_NO_CS)) {
>>>>>>>>> -			/*
>>>>>>>>> -			 * Historically ACPI has no means of the GPIO
>>>>>>>>> polarity and
>>>>>>>>> -			 * thus the SPISerialBus() resource defines it
>>>>>>>> on
>>>>>>>>> the per-chip
>>>>>>>>> -			 * basis. In order to avoid a chain of
>>>>>>>> negations,
>>>>>>>>> the GPIO
>>>>>>>>> -			 * polarity is considered being Active High.
>>>>>>>> Even
>>>>>>>>> for the cases
>>>>>>>>> -			 * when _DSD() is involved (in the updated
>>>>>>>>> versions of ACPI)
>>>>>>>>> -			 * the GPIO CS polarity must be defined
>> Active
>>>>>>>>> High to avoid
>>>>>>>>> -			 * ambiguity. That's why we use enable, that
>>>>>>>>> takes SPI_CS_HIGH
>>>>>>>>> -			 * into account.
>>>>>>>>> -			 */
>>>>>>>>> -			if (has_acpi_companion(&spi->dev))
>>>>>>>>> -
>>>>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), !enable);
>>>>>>>>> +		if (spi_get_csgpiod(spi, 0) || spi_get_csgpiod(spi, 1)
>>>>>>>> ||
>>>>>>>>> +		    !spi->controller->set_cs_timing) {
>>>>>>>>> +			if (activate)
>>>>>>>>> +				spi_delay_exec(&spi->cs_setup,
>>>> NULL);
>>>>>>>>>      			else
>>>>>>>>> -				/* Polarity handled by GPIO library */
>>>>>>>>> -
>>>>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), activate);
>>>>>>>>> +				spi_delay_exec(&spi->cs_inactive,
>>>>>>>>> NULL);
>>>>>>>>>      		}
>>>>>>>>> -		/* Some SPI masters need both GPIO CS &
>> slave_select
>>>>>>>>> */
>>>>>>>>> -		if ((spi->controller->flags & SPI_MASTER_GPIO_SS)
>> &&
>>>>>>>>> -		    spi->controller->set_cs)
>>>>>>>>> +	} else {
>>>>>>>>> +		/*
>>>>>>>>> +		 * Avoid calling into the driver (or doing delays) if
>>>>>>>> the
>>>>>>>>> chip select
>>>>>>>>> +		 * isn't actually changing from the last time this was
>>>>>>>>> called.
>>>>>>>>> +		 */
>>>>>>>>> +		if (!force && ((enable && spi->controller->last_cs ==
>>>>>>>>> +				spi_get_chipselect(spi, cs_num)) ||
>>>>>>>>> +				(!enable && spi->controller->last_cs
>>>>>>>> !=
>>>>>>>>> +				 spi_get_chipselect(spi, cs_num))) &&
>>>>>>>>> +		    (spi->controller->last_cs_mode_high ==
>>>>>>>>> +		     (spi->mode & SPI_CS_HIGH)))
>>>>>>>>> +			return;
>>>>>>>>> +
>>>>>>>>> +		trace_spi_set_cs(spi, activate);
>>>>>>>>> +
>>>>>>>>> +		spi->controller->last_cs = enable ?
>>>>>>>>> spi_get_chipselect(spi, cs_num) : -1;
>>>>>>>>> +		spi->controller->last_cs_mode_high = spi->mode &
>>>>>>>>> SPI_CS_HIGH;
>>>>>>>>> +
>>>>>>>>> +		if ((spi_get_csgpiod(spi, cs_num) || !spi->controller-
>>>>>>>>>> set_cs_timing) && !activate)
>>>>>>>>> +			spi_delay_exec(&spi->cs_hold, NULL);
>>>>>>>>> +
>>>>>>>>> +		if (spi->mode & SPI_CS_HIGH)
>>>>>>>>> +			enable = !enable;
>>>>>>>>> +
>>>>>>>>> +		if (spi_get_csgpiod(spi, cs_num)) {
>>>>>>>>> +			if (!(spi->mode & SPI_NO_CS)) {
>>>>>>>>> +				/*
>>>>>>>>> +				 * Historically ACPI has no means of
>>>>>>>> the
>>>>>>>>> GPIO polarity and
>>>>>>>>> +				 * thus the SPISerialBus() resource
>>>>>>>>> defines it on the per-chip
>>>>>>>>> +				 * basis. In order to avoid a chain of
>>>>>>>>> negations, the GPIO
>>>>>>>>> +				 * polarity is considered being Active
>>>>>>>>> High. Even for the cases
>>>>>>>>> +				 * when _DSD() is involved (in the
>>>>>>>>> updated versions of ACPI)
>>>>>>>>> +				 * the GPIO CS polarity must be
>>>>>>>> defined
>>>>>>>>> Active High to avoid
>>>>>>>>> +				 * ambiguity. That's why we use
>>>>>>>> enable,
>>>>>>>>> that takes SPI_CS_HIGH
>>>>>>>>> +				 * into account.
>>>>>>>>> +				 */
>>>>>>>>> +				if (has_acpi_companion(&spi->dev))
>>>>>>>>> +
>>>>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
>>>>>>>>> +
>>>>>>>>> !enable);
>>>>>>>>> +				else
>>>>>>>>> +					/* Polarity handled by GPIO
>>>>>>>>> library */
>>>>>>>>> +
>>>>>>>>> 	gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
>>>>>>>>> +
>>>>>>>>> activate);
>>>>>>>>> +			}
>>>>>>>>> +			/* Some SPI masters need both GPIO CS &
>>>>>>>>> slave_select */
>>>>>>>>> +			if ((spi->controller->flags &
>>>>>>>>> SPI_MASTER_GPIO_SS) &&
>>>>>>>>> +			    spi->controller->set_cs)
>>>>>>>>> +				spi->controller->set_cs(spi, !enable);
>>>>>>>>> +		} else if (spi->controller->set_cs) {
>>>>>>>>>      			spi->controller->set_cs(spi, !enable);
>>>>>>>>> -	} else if (spi->controller->set_cs) {
>>>>>>>>> -		spi->controller->set_cs(spi, !enable);
>>>>>>>>> -	}
>>>>>>>>> +		}
>>>>>>>>>
>>>>>>>>> -	if (spi_get_csgpiod(spi, 0) ||
>>>>>>>> !spi->controller->set_cs_timing) {
>>>>>>>>> -		if (activate)
>>>>>>>>> -			spi_delay_exec(&spi->cs_setup, NULL);
>>>>>>>>> -		else
>>>>>>>>> -			spi_delay_exec(&spi->cs_inactive, NULL);
>>>>>>>>> +		if (spi_get_csgpiod(spi, cs_num) || !spi->controller-
>>>>>>>>>> set_cs_timing) {
>>>>>>>>> +			if (activate)
>>>>>>>>> +				spi_delay_exec(&spi->cs_setup,
>>>> NULL);
>>>>>>>>> +			else
>>>>>>>>> +				spi_delay_exec(&spi->cs_inactive,
>>>>>>>>> NULL);
>>>>>>>>> +		}
>>>>>>>>>      	}
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>> @@ -2246,8 +2325,8 @@ static void
>> of_spi_parse_dt_cs_delay(struct
>>>>>>>>> device_node *nc,  static int of_spi_parse_dt(struct spi_controller
>>>>>>>>> *ctlr, struct
>>>>>>>> spi_device
>>>>>>>>> *spi,
>>>>>>>>>      			   struct device_node *nc)
>>>>>>>>>      {
>>>>>>>>> -	u32 value;
>>>>>>>>> -	int rc;
>>>>>>>>> +	u32 value, cs[SPI_CS_CNT_MAX] = {0};
>>>>>>>>> +	int rc, idx;
>>>>>>>>>
>>>>>>>>>      	/* Mode (clock phase/polarity/etc.) */
>>>>>>>>>      	if (of_property_read_bool(nc, "spi-cpha")) @@ -2320,13
>>>>>>>>> +2399,21
>>>>>>>> @@
>>>>>>>>> static int of_spi_parse_dt(struct spi_controller *ctlr, struct
>>>>>>>>> spi_device *spi,
>>>>>>>>>      	}
>>>>>>>>>
>>>>>>>>>      	/* Device address */
>>>>>>>>> -	rc = of_property_read_u32(nc, "reg", &value);
>>>>>>>>> -	if (rc) {
>>>>>>>>> +	rc = of_property_read_variable_u32_array(nc, "reg", &cs[0],
>>>> 1,
>>>>>>>>> +						 SPI_CS_CNT_MAX);
>>>>>>>>> +	if (rc < 0 || rc > ctlr->num_chipselect) {
>>>>>>>>>      		dev_err(&ctlr->dev, "%pOF has no valid 'reg' property
>>>>>>>> (%d)\n",
>>>>>>>>>      			nc, rc);
>>>>>>>>>      		return rc;
>>>>>>>>> +	} else if ((of_property_read_bool(nc, "parallel-memories"))
>>>> &&
>>>>>>>>> +		   (!(ctlr->flags & SPI_CONTROLLER_MULTI_CS))) {
>>>>>>>>> +		dev_err(&ctlr->dev, "SPI controller doesn't support
>>>>>>>> multi
>>>>>>>>> CS\n");
>>>>>>>>> +		return -EINVAL;
>>>>>>>>>      	}
>>>>>>>>> -	spi_set_chipselect(spi, 0, value);
>>>>>>>>> +	for (idx = 0; idx < rc; idx++)
>>>>>>>>> +		spi_set_chipselect(spi, idx, cs[idx]);
>>>>>>>>> +	/* By default set the spi->cs_index_mask as 1 */
>>>>>>>>> +	spi->cs_index_mask = 0x01;
>>>>>>>>>
>>>>>>>>>      	/* Device speed */
>>>>>>>>>      	if (!of_property_read_u32(nc, "spi-max-frequency", &value))
>>>> @@
>>>>>>>>> -3907,7 +3994,8 @@ static int __spi_validate(struct spi_device
>>>>>>>>> *spi, struct spi_message *message)
>>>>>>>>>      	 * cs_change is set for each transfer.
>>>>>>>>>      	 */
>>>>>>>>>      	if ((spi->mode & SPI_CS_WORD) && (!(ctlr->mode_bits &
>>>>>>>>> SPI_CS_WORD) ||
>>>>>>>>> -					  spi_get_csgpiod(spi, 0))) {
>>>>>>>>> +					  spi_get_csgpiod(spi, 0) ||
>>>>>>>>> +					  spi_get_csgpiod(spi, 1))) {
>>>>>>>>>      		size_t maxsize;
>>>>>>>>>      		int ret;
>>>>>>>>>
>>>>>>>>> diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
>>>>>>>>> index 873ced6ae4ca..6453b246e0af 100644
>>>>>>>>> --- a/include/linux/spi/spi.h
>>>>>>>>> +++ b/include/linux/spi/spi.h
>>>>>>>>> @@ -19,6 +19,11 @@
>>>>>>>>>      #include <linux/acpi.h>
>>>>>>>>>      #include <linux/u64_stats_sync.h>
>>>>>>>>>
>>>>>>>>> +/* Max no. of CS supported per spi device */ #define
>>>>>>>>> +SPI_CS_CNT_MAX
>>>>>>>>> +2
>>>>>>>>> +
>>>>>>>>> +/* chip select mask */
>>>>>>>>> +#define SPI_PARALLEL_CS_MASK	(BIT(0) | BIT(1))
>>>>>>>>>      struct dma_chan;
>>>>>>>>>      struct software_node;
>>>>>>>>>      struct ptp_system_timestamp;
>>>>>>>>> @@ -166,6 +171,7 @@ extern void
>>>>>>>>> spi_transfer_cs_change_delay_exec(struct spi_message *msg,
>>>>>>>>>       *	deasserted. If @cs_change_delay is used from
>>>> @spi_transfer,
>>>>>>>>> then the
>>>>>>>>>       *	two delays will be added up.
>>>>>>>>>       * @pcpu_statistics: statistics for the spi_device
>>>>>>>>> + * @cs_index_mask: Bit mask of the active chipselect(s) in the
>>>>>>>>> chipselect array
>>>>>>>>>       *
>>>>>>>>>       * A @spi_device is used to interchange data between an SPI slave
>>>>>>>>>       * (usually a discrete chip) and CPU memory.
>>>>>>>>> @@ -181,7 +187,7 @@ struct spi_device {
>>>>>>>>>      	struct spi_controller	*controller;
>>>>>>>>>      	struct spi_controller	*master;	/* Compatibility layer
>>>>>>>> */
>>>>>>>>>      	u32			max_speed_hz;
>>>>>>>>> -	u8			chip_select;
>>>>>>>>> +	u8			chip_select[SPI_CS_CNT_MAX];
>>>>>>>>>      	u8			bits_per_word;
>>>>>>>>>      	bool			rt;
>>>>>>>>>      #define SPI_NO_TX	BIT(31)		/* No transmit wire */
>>>>>>>>> @@ -202,7 +208,7 @@ struct spi_device {
>>>>>>>>>      	void			*controller_data;
>>>>>>>>>      	char			modalias[SPI_NAME_SIZE];
>>>>>>>>>      	const char		*driver_override;
>>>>>>>>> -	struct gpio_desc	*cs_gpiod;	/* Chip select gpio
>>>>>>>> desc
>>>>>>>>> */
>>>>>>>>> +	struct gpio_desc	*cs_gpiod[SPI_CS_CNT_MAX];	/*
>>>>>>>> Chip
>>>>>>>>> select gpio desc */
>>>>>>>>>      	struct spi_delay	word_delay; /* Inter-word delay */
>>>>>>>>>      	/* CS delays */
>>>>>>>>>      	struct spi_delay	cs_setup;
>>>>>>>>> @@ -212,6 +218,13 @@ struct spi_device {
>>>>>>>>>      	/* The statistics */
>>>>>>>>>      	struct spi_statistics __percpu	*pcpu_statistics;
>>>>>>>>>
>>>>>>>>> +	/* Bit mask of the chipselect(s) that the driver need to use
>>>>>>>> from
>>>>>>>>> +	 * the chipselect array.When the controller is capable to
>>>>>>>> handle
>>>>>>>>> +	 * multiple chip selects & memories are connected in parallel
>>>>>>>>> +	 * then more than one bit need to be set in cs_index_mask.
>>>>>>>>> +	 */
>>>>>>>>> +	u32			cs_index_mask : SPI_CS_CNT_MAX;
>>>>>>>>> +
>>>>>>>>>      	/*
>>>>>>>>>      	 * likely need more hooks for more protocol options affecting
>>>> how
>>>>>>>>>      	 * the controller talks to each chip, like:
>>>>>>>>> @@ -268,22 +281,22 @@ static inline void *spi_get_drvdata(const
>>>>>>>>> struct spi_device *spi)
>>>>>>>>>
>>>>>>>>>      static inline u8 spi_get_chipselect(const struct spi_device
>>>>>>>>> *spi,
>>>>>>>> u8 idx)
>>>>>>>>>      {
>>>>>>>>> -	return spi->chip_select;
>>>>>>>>> +	return spi->chip_select[idx];
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>>      static inline void spi_set_chipselect(struct spi_device *spi,
>>>>>>>>> u8
>>>>>>>> idx, u8
>>>>>>>>> chipselect)
>>>>>>>>>      {
>>>>>>>>> -	spi->chip_select = chipselect;
>>>>>>>>> +	spi->chip_select[idx] = chipselect;
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>>      static inline struct gpio_desc *spi_get_csgpiod(const struct
>>>>>>>> spi_device
>>>>>>>>> *spi, u8 idx)
>>>>>>>>>      {
>>>>>>>>> -	return spi->cs_gpiod;
>>>>>>>>> +	return spi->cs_gpiod[idx];
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>>      static inline void spi_set_csgpiod(struct spi_device *spi, u8
>>>>>>>>> idx,
>>>>>>>> struct
>>>>>>>>> gpio_desc *csgpiod)
>>>>>>>>>      {
>>>>>>>>> -	spi->cs_gpiod = csgpiod;
>>>>>>>>> +	spi->cs_gpiod[idx] = csgpiod;
>>>>>>>>>      }
>>>>>>>>>
>>>>>>>>>      /**
>>>>>>>>> @@ -388,6 +401,8 @@ extern struct spi_device
>>>>>>>>> *spi_new_ancillary_device(struct spi_device *spi, u8 ch
>>>>>>>>>       * @bus_lock_spinlock: spinlock for SPI bus locking
>>>>>>>>>       * @bus_lock_mutex: mutex for exclusion of multiple callers
>>>>>>>>>       * @bus_lock_flag: indicates that the SPI bus is locked for
>>>>>>>> exclusive use
>>>>>>>>> + * @multi_cs_cap: indicates that the SPI Controller can
>>>>>>>> assert/de-assert
>>>>>>>>> + *	more than one chip select at once.
>>>>>>>>>       * @setup: updates the device mode and clocking records used by
>> a
>>>>>>>>>       *	device's SPI controller; protocol code may call this.  This
>>>>>>>>>       *	must fail if an unrecognized or unsupported mode is
>>>> requested.
>>>>>>>>> @@ -554,6 +569,11 @@ struct spi_controller {
>>>>>>>>>      #define SPI_CONTROLLER_MUST_TX		BIT(4)	/*
>> Requires tx
>>>>>>>>> */
>>>>>>>>>
>>>>>>>>>      #define SPI_MASTER_GPIO_SS		BIT(5)	/* GPIO CS
>> must
>>>>>>>> select
>>>>>>>>> slave */
>>>>>>>>> +	/*
>>>>>>>>> +	 * The spi-controller has multi chip select capability and can
>>>>>>>>> +	 * assert/de-assert more than one chip select at once.
>>>>>>>>> +	 */
>>>>>>>>> +#define SPI_CONTROLLER_MULTI_CS		BIT(6)
>>>>>>>>>
>>>>>>>>>      	/* Flag indicating if the allocation of this struct is devres-
>>>>>>>>> managed */
>>>>>>>>>      	bool			devm_allocated;
>>>>>>>>> --
>>>>>>>>> 2.17.1
diff mbox series

Patch

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 9036d7a50674..04d7322170c4 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -612,10 +612,24 @@  static int spi_dev_check(struct device *dev, void *data)
 {
 	struct spi_device *spi = to_spi_device(dev);
 	struct spi_device *new_spi = data;
+	int idx, nw_idx;
 
-	if (spi->controller == new_spi->controller &&
-	    spi_get_chipselect(spi, 0) == spi_get_chipselect(new_spi, 0))
-		return -EBUSY;
+	if (spi->controller == new_spi->controller) {
+		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
+			for (nw_idx = 0; nw_idx < SPI_CS_CNT_MAX; nw_idx++) {
+				if ((idx != 0 && !spi_get_chipselect(spi, idx)) ||
+				    (nw_idx != 0 && !spi_get_chipselect(spi, nw_idx))) {
+					continue;
+				} else if (spi_get_chipselect(spi, idx) ==
+				    spi_get_chipselect(new_spi, nw_idx)) {
+					dev_err(dev,
+						"chipselect %d already in use\n",
+						spi_get_chipselect(new_spi, nw_idx));
+					return -EBUSY;
+				}
+			}
+		}
+	}
 	return 0;
 }
 
@@ -629,7 +643,7 @@  static int __spi_add_device(struct spi_device *spi)
 {
 	struct spi_controller *ctlr = spi->controller;
 	struct device *dev = ctlr->dev.parent;
-	int status;
+	int status, idx;
 
 	/*
 	 * We need to make sure there's no other device with this
@@ -638,8 +652,6 @@  static int __spi_add_device(struct spi_device *spi)
 	 */
 	status = bus_for_each_dev(&spi_bus_type, NULL, spi, spi_dev_check);
 	if (status) {
-		dev_err(dev, "chipselect %d already in use\n",
-				spi_get_chipselect(spi, 0));
 		return status;
 	}
 
@@ -649,8 +661,10 @@  static int __spi_add_device(struct spi_device *spi)
 		return -ENODEV;
 	}
 
-	if (ctlr->cs_gpiods)
-		spi_set_csgpiod(spi, 0, ctlr->cs_gpiods[spi_get_chipselect(spi, 0)]);
+	if (ctlr->cs_gpiods) {
+		for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
+			spi_set_csgpiod(spi, idx, ctlr->cs_gpiods[spi_get_chipselect(spi, idx)]);
+	}
 
 	/*
 	 * Drivers may modify this initial i/o setup, but will
@@ -690,13 +704,15 @@  int spi_add_device(struct spi_device *spi)
 {
 	struct spi_controller *ctlr = spi->controller;
 	struct device *dev = ctlr->dev.parent;
-	int status;
+	int status, idx;
 
-	/* Chipselects are numbered 0..max; validate. */
-	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
-		dev_err(dev, "cs%d >= max %d\n", spi_get_chipselect(spi, 0),
-			ctlr->num_chipselect);
-		return -EINVAL;
+	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
+		/* Chipselects are numbered 0..max; validate. */
+		if (spi_get_chipselect(spi, idx) >= ctlr->num_chipselect) {
+			dev_err(dev, "cs%d >= max %d\n", spi_get_chipselect(spi, idx),
+				ctlr->num_chipselect);
+			return -EINVAL;
+		}
 	}
 
 	/* Set the bus ID string */
@@ -713,12 +729,15 @@  static int spi_add_device_locked(struct spi_device *spi)
 {
 	struct spi_controller *ctlr = spi->controller;
 	struct device *dev = ctlr->dev.parent;
+	int idx;
 
-	/* Chipselects are numbered 0..max; validate. */
-	if (spi_get_chipselect(spi, 0) >= ctlr->num_chipselect) {
-		dev_err(dev, "cs%d >= max %d\n", spi_get_chipselect(spi, 0),
-			ctlr->num_chipselect);
-		return -EINVAL;
+	for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
+		/* Chipselects are numbered 0..max; validate. */
+		if (spi_get_chipselect(spi, idx) >= ctlr->num_chipselect) {
+			dev_err(dev, "cs%d >= max %d\n", spi_get_chipselect(spi, idx),
+				ctlr->num_chipselect);
+			return -EINVAL;
+		}
 	}
 
 	/* Set the bus ID string */
@@ -966,58 +985,118 @@  static void spi_res_release(struct spi_controller *ctlr, struct spi_message *mes
 static void spi_set_cs(struct spi_device *spi, bool enable, bool force)
 {
 	bool activate = enable;
+	u32 cs_num = __ffs(spi->cs_index_mask);
+	int idx;
 
 	/*
-	 * Avoid calling into the driver (or doing delays) if the chip select
-	 * isn't actually changing from the last time this was called.
+	 * In parallel mode all the chip selects are asserted/de-asserted
+	 * at once
 	 */
-	if (!force && ((enable && spi->controller->last_cs == spi_get_chipselect(spi, 0)) ||
-		       (!enable && spi->controller->last_cs != spi_get_chipselect(spi, 0))) &&
-	    (spi->controller->last_cs_mode_high == (spi->mode & SPI_CS_HIGH)))
-		return;
-
-	trace_spi_set_cs(spi, activate);
-
-	spi->controller->last_cs = enable ? spi_get_chipselect(spi, 0) : -1;
-	spi->controller->last_cs_mode_high = spi->mode & SPI_CS_HIGH;
-
-	if ((spi_get_csgpiod(spi, 0) || !spi->controller->set_cs_timing) && !activate)
-		spi_delay_exec(&spi->cs_hold, NULL);
-
-	if (spi->mode & SPI_CS_HIGH)
-		enable = !enable;
+	if ((spi->cs_index_mask & SPI_PARALLEL_CS_MASK) == SPI_PARALLEL_CS_MASK) {
+		spi->controller->last_cs_mode_high = spi->mode & SPI_CS_HIGH;
+
+		if ((spi_get_csgpiod(spi, 0) || !spi->controller->set_cs_timing) && !activate)
+			spi_delay_exec(&spi->cs_hold, NULL);
+
+		if (spi->mode & SPI_CS_HIGH)
+			enable = !enable;
+
+		if (spi_get_csgpiod(spi, 0) && spi_get_csgpiod(spi, 1)) {
+			if (!(spi->mode & SPI_NO_CS)) {
+				/*
+				 * Historically ACPI has no means of the GPIO polarity and
+				 * thus the SPISerialBus() resource defines it on the per-chip
+				 * basis. In order to avoid a chain of negations, the GPIO
+				 * polarity is considered being Active High. Even for the cases
+				 * when _DSD() is involved (in the updated versions of ACPI)
+				 * the GPIO CS polarity must be defined Active High to avoid
+				 * ambiguity. That's why we use enable, that takes SPI_CS_HIGH
+				 * into account.
+				 */
+				if (has_acpi_companion(&spi->dev)) {
+					for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
+						gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
+									 !enable);
+				} else {
+					for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)
+						/* Polarity handled by GPIO library */
+						gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
+									 activate);
+				}
+			}
+			/* Some SPI masters need both GPIO CS & slave_select */
+			if ((spi->controller->flags & SPI_MASTER_GPIO_SS) &&
+			    spi->controller->set_cs)
+				spi->controller->set_cs(spi, !enable);
+		} else if (spi->controller->set_cs) {
+			spi->controller->set_cs(spi, !enable);
+		}
 
-	if (spi_get_csgpiod(spi, 0)) {
-		if (!(spi->mode & SPI_NO_CS)) {
-			/*
-			 * Historically ACPI has no means of the GPIO polarity and
-			 * thus the SPISerialBus() resource defines it on the per-chip
-			 * basis. In order to avoid a chain of negations, the GPIO
-			 * polarity is considered being Active High. Even for the cases
-			 * when _DSD() is involved (in the updated versions of ACPI)
-			 * the GPIO CS polarity must be defined Active High to avoid
-			 * ambiguity. That's why we use enable, that takes SPI_CS_HIGH
-			 * into account.
-			 */
-			if (has_acpi_companion(&spi->dev))
-				gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), !enable);
+		if (spi_get_csgpiod(spi, 0) || spi_get_csgpiod(spi, 1) ||
+		    !spi->controller->set_cs_timing) {
+			if (activate)
+				spi_delay_exec(&spi->cs_setup, NULL);
 			else
-				/* Polarity handled by GPIO library */
-				gpiod_set_value_cansleep(spi_get_csgpiod(spi, 0), activate);
+				spi_delay_exec(&spi->cs_inactive, NULL);
 		}
-		/* Some SPI masters need both GPIO CS & slave_select */
-		if ((spi->controller->flags & SPI_MASTER_GPIO_SS) &&
-		    spi->controller->set_cs)
+	} else {
+		/*
+		 * Avoid calling into the driver (or doing delays) if the chip select
+		 * isn't actually changing from the last time this was called.
+		 */
+		if (!force && ((enable && spi->controller->last_cs ==
+				spi_get_chipselect(spi, cs_num)) ||
+				(!enable && spi->controller->last_cs !=
+				 spi_get_chipselect(spi, cs_num))) &&
+		    (spi->controller->last_cs_mode_high ==
+		     (spi->mode & SPI_CS_HIGH)))
+			return;
+
+		trace_spi_set_cs(spi, activate);
+
+		spi->controller->last_cs = enable ? spi_get_chipselect(spi, cs_num) : -1;
+		spi->controller->last_cs_mode_high = spi->mode & SPI_CS_HIGH;
+
+		if ((spi_get_csgpiod(spi, cs_num) || !spi->controller->set_cs_timing) && !activate)
+			spi_delay_exec(&spi->cs_hold, NULL);
+
+		if (spi->mode & SPI_CS_HIGH)
+			enable = !enable;
+
+		if (spi_get_csgpiod(spi, cs_num)) {
+			if (!(spi->mode & SPI_NO_CS)) {
+				/*
+				 * Historically ACPI has no means of the GPIO polarity and
+				 * thus the SPISerialBus() resource defines it on the per-chip
+				 * basis. In order to avoid a chain of negations, the GPIO
+				 * polarity is considered being Active High. Even for the cases
+				 * when _DSD() is involved (in the updated versions of ACPI)
+				 * the GPIO CS polarity must be defined Active High to avoid
+				 * ambiguity. That's why we use enable, that takes SPI_CS_HIGH
+				 * into account.
+				 */
+				if (has_acpi_companion(&spi->dev))
+					gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
+								 !enable);
+				else
+					/* Polarity handled by GPIO library */
+					gpiod_set_value_cansleep(spi_get_csgpiod(spi, cs_num),
+								 activate);
+			}
+			/* Some SPI masters need both GPIO CS & slave_select */
+			if ((spi->controller->flags & SPI_MASTER_GPIO_SS) &&
+			    spi->controller->set_cs)
+				spi->controller->set_cs(spi, !enable);
+		} else if (spi->controller->set_cs) {
 			spi->controller->set_cs(spi, !enable);
-	} else if (spi->controller->set_cs) {
-		spi->controller->set_cs(spi, !enable);
-	}
+		}
 
-	if (spi_get_csgpiod(spi, 0) || !spi->controller->set_cs_timing) {
-		if (activate)
-			spi_delay_exec(&spi->cs_setup, NULL);
-		else
-			spi_delay_exec(&spi->cs_inactive, NULL);
+		if (spi_get_csgpiod(spi, cs_num) || !spi->controller->set_cs_timing) {
+			if (activate)
+				spi_delay_exec(&spi->cs_setup, NULL);
+			else
+				spi_delay_exec(&spi->cs_inactive, NULL);
+		}
 	}
 }
 
@@ -2246,8 +2325,8 @@  static void of_spi_parse_dt_cs_delay(struct device_node *nc,
 static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi,
 			   struct device_node *nc)
 {
-	u32 value;
-	int rc;
+	u32 value, cs[SPI_CS_CNT_MAX] = {0};
+	int rc, idx;
 
 	/* Mode (clock phase/polarity/etc.) */
 	if (of_property_read_bool(nc, "spi-cpha"))
@@ -2320,13 +2399,21 @@  static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi,
 	}
 
 	/* Device address */
-	rc = of_property_read_u32(nc, "reg", &value);
-	if (rc) {
+	rc = of_property_read_variable_u32_array(nc, "reg", &cs[0], 1,
+						 SPI_CS_CNT_MAX);
+	if (rc < 0 || rc > ctlr->num_chipselect) {
 		dev_err(&ctlr->dev, "%pOF has no valid 'reg' property (%d)\n",
 			nc, rc);
 		return rc;
+	} else if ((of_property_read_bool(nc, "parallel-memories")) &&
+		   (!(ctlr->flags & SPI_CONTROLLER_MULTI_CS))) {
+		dev_err(&ctlr->dev, "SPI controller doesn't support multi CS\n");
+		return -EINVAL;
 	}
-	spi_set_chipselect(spi, 0, value);
+	for (idx = 0; idx < rc; idx++)
+		spi_set_chipselect(spi, idx, cs[idx]);
+	/* By default set the spi->cs_index_mask as 1 */
+	spi->cs_index_mask = 0x01;
 
 	/* Device speed */
 	if (!of_property_read_u32(nc, "spi-max-frequency", &value))
@@ -3907,7 +3994,8 @@  static int __spi_validate(struct spi_device *spi, struct spi_message *message)
 	 * cs_change is set for each transfer.
 	 */
 	if ((spi->mode & SPI_CS_WORD) && (!(ctlr->mode_bits & SPI_CS_WORD) ||
-					  spi_get_csgpiod(spi, 0))) {
+					  spi_get_csgpiod(spi, 0) ||
+					  spi_get_csgpiod(spi, 1))) {
 		size_t maxsize;
 		int ret;
 
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 873ced6ae4ca..6453b246e0af 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -19,6 +19,11 @@ 
 #include <linux/acpi.h>
 #include <linux/u64_stats_sync.h>
 
+/* Max no. of CS supported per spi device */
+#define SPI_CS_CNT_MAX 2
+
+/* chip select mask */
+#define SPI_PARALLEL_CS_MASK	(BIT(0) | BIT(1))
 struct dma_chan;
 struct software_node;
 struct ptp_system_timestamp;
@@ -166,6 +171,7 @@  extern void spi_transfer_cs_change_delay_exec(struct spi_message *msg,
  *	deasserted. If @cs_change_delay is used from @spi_transfer, then the
  *	two delays will be added up.
  * @pcpu_statistics: statistics for the spi_device
+ * @cs_index_mask: Bit mask of the active chipselect(s) in the chipselect array
  *
  * A @spi_device is used to interchange data between an SPI slave
  * (usually a discrete chip) and CPU memory.
@@ -181,7 +187,7 @@  struct spi_device {
 	struct spi_controller	*controller;
 	struct spi_controller	*master;	/* Compatibility layer */
 	u32			max_speed_hz;
-	u8			chip_select;
+	u8			chip_select[SPI_CS_CNT_MAX];
 	u8			bits_per_word;
 	bool			rt;
 #define SPI_NO_TX	BIT(31)		/* No transmit wire */
@@ -202,7 +208,7 @@  struct spi_device {
 	void			*controller_data;
 	char			modalias[SPI_NAME_SIZE];
 	const char		*driver_override;
-	struct gpio_desc	*cs_gpiod;	/* Chip select gpio desc */
+	struct gpio_desc	*cs_gpiod[SPI_CS_CNT_MAX];	/* Chip select gpio desc */
 	struct spi_delay	word_delay; /* Inter-word delay */
 	/* CS delays */
 	struct spi_delay	cs_setup;
@@ -212,6 +218,13 @@  struct spi_device {
 	/* The statistics */
 	struct spi_statistics __percpu	*pcpu_statistics;
 
+	/* Bit mask of the chipselect(s) that the driver need to use from
+	 * the chipselect array.When the controller is capable to handle
+	 * multiple chip selects & memories are connected in parallel
+	 * then more than one bit need to be set in cs_index_mask.
+	 */
+	u32			cs_index_mask : SPI_CS_CNT_MAX;
+
 	/*
 	 * likely need more hooks for more protocol options affecting how
 	 * the controller talks to each chip, like:
@@ -268,22 +281,22 @@  static inline void *spi_get_drvdata(const struct spi_device *spi)
 
 static inline u8 spi_get_chipselect(const struct spi_device *spi, u8 idx)
 {
-	return spi->chip_select;
+	return spi->chip_select[idx];
 }
 
 static inline void spi_set_chipselect(struct spi_device *spi, u8 idx, u8 chipselect)
 {
-	spi->chip_select = chipselect;
+	spi->chip_select[idx] = chipselect;
 }
 
 static inline struct gpio_desc *spi_get_csgpiod(const struct spi_device *spi, u8 idx)
 {
-	return spi->cs_gpiod;
+	return spi->cs_gpiod[idx];
 }
 
 static inline void spi_set_csgpiod(struct spi_device *spi, u8 idx, struct gpio_desc *csgpiod)
 {
-	spi->cs_gpiod = csgpiod;
+	spi->cs_gpiod[idx] = csgpiod;
 }
 
 /**
@@ -388,6 +401,8 @@  extern struct spi_device *spi_new_ancillary_device(struct spi_device *spi, u8 ch
  * @bus_lock_spinlock: spinlock for SPI bus locking
  * @bus_lock_mutex: mutex for exclusion of multiple callers
  * @bus_lock_flag: indicates that the SPI bus is locked for exclusive use
+ * @multi_cs_cap: indicates that the SPI Controller can assert/de-assert
+ *	more than one chip select at once.
  * @setup: updates the device mode and clocking records used by a
  *	device's SPI controller; protocol code may call this.  This
  *	must fail if an unrecognized or unsupported mode is requested.
@@ -554,6 +569,11 @@  struct spi_controller {
 #define SPI_CONTROLLER_MUST_TX		BIT(4)	/* Requires tx */
 
 #define SPI_MASTER_GPIO_SS		BIT(5)	/* GPIO CS must select slave */
+	/*
+	 * The spi-controller has multi chip select capability and can
+	 * assert/de-assert more than one chip select at once.
+	 */
+#define SPI_CONTROLLER_MULTI_CS		BIT(6)
 
 	/* Flag indicating if the allocation of this struct is devres-managed */
 	bool			devm_allocated;