Re: Boot failure with 5.4-rc5, bisected to 0f0581b24bd0 ("spi: fsl: Convert to use CS GPIO descriptors")

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Christophe,

sorry for forgetting about this :(

On Fri, Nov 8, 2019 at 2:34 PM Christophe Leroy <christophe.leroy@xxxxxx> wrote:

> With the two above changes, I get:
> [    3.143014] fsl_spi ff000a80.spi: bail out with error code -22
> [    3.148879] ------------[ cut here ]------------
> [    3.153261] remove_proc_entry: removing non-empty directory 'irq/43',
> leaking at least 'fsl_spi'
> [    3.162473] WARNING: CPU: 0 PID: 1 at fs/proc/generic.c:684
> remove_proc_entry+0x1a0/0x1c8

So that is another bug again. (Tearing down IRQs is erroneous
in some way.)

The problem is the first -22 (-EINVAL)

Which comes from of_fsl_spi_probe() IIUC.

Can you try the following? I'm sorry if gmail mangles the
patches, I put a copy here:
https://dflund.se/~triad/fsldebug.diff

diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index 114801a32371..3f68bea1c3c0 100644
--- a/drivers/spi/spi-fsl-spi.c
+++ b/drivers/spi/spi-fsl-spi.c
@@ -617,12 +617,15 @@ static struct spi_master * fsl_spi_probe(struct
device *dev,
  mpc8xxx_spi->type = fsl_spi_get_type(dev);

  ret = fsl_spi_cpm_init(mpc8xxx_spi);
- if (ret)
+ if (ret) {
+ dev_err(dev, "fsl_spi_cpm_init() failed\n");
  goto err_cpm_init;
+ }

  mpc8xxx_spi->reg_base = devm_ioremap_resource(dev, mem);
  if (IS_ERR(mpc8xxx_spi->reg_base)) {
  ret = PTR_ERR(mpc8xxx_spi->reg_base);
+ dev_err(dev, "erroneous ->reg_base\n");
  goto err_probe;
  }

@@ -645,8 +648,10 @@ static struct spi_master * fsl_spi_probe(struct
device *dev,
  ret = devm_request_irq(dev, mpc8xxx_spi->irq, fsl_spi_irq,
         0, "fsl_spi", mpc8xxx_spi);

- if (ret != 0)
+ if (ret != 0) {
+ dev_err(dev, "devm_request_irq() failed\n");
  goto err_probe;
+ }

  reg_base = mpc8xxx_spi->reg_base;

@@ -668,8 +673,10 @@ static struct spi_master * fsl_spi_probe(struct
device *dev,
  mpc8xxx_spi_write_reg(&reg_base->mode, regval);

  ret = devm_spi_register_master(dev, master);
- if (ret < 0)
+ if (ret < 0) {
+ dev_err(dev, "devm_spi_register_master() failed\n");
  goto err_probe;
+ }

  dev_info(dev, "at 0x%p (irq = %d), %s mode\n", reg_base,
  mpc8xxx_spi->irq, mpc8xxx_spi_strmode(mpc8xxx_spi->flags));
@@ -681,6 +688,7 @@ static struct spi_master * fsl_spi_probe(struct device *dev,
 err_cpm_init:
  spi_master_put(master);
 err:
+ dev_err(dev, "exiting fsl_spi_probe() with error\n");
  return ERR_PTR(ret);
 }

@@ -738,12 +746,14 @@ static int of_fsl_spi_probe(struct platform_device *ofdev)
  irq = irq_of_parse_and_map(np, 0);
  if (!irq) {
  ret = -EINVAL;
+ dev_err(dev, "irq_of_parse_and_map() failed\n");
  goto err;
  }

  master = fsl_spi_probe(dev, &mem, irq);
  if (IS_ERR(master)) {
  ret = PTR_ERR(master);
+ dev_err(dev, "fsl_spi_probe() failed\n");
  goto err;
  }

Let's drill in and see where this error come from.

Yours,
Linus Walleij



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux