All of lore.kernel.org
 help / color / mirror / Atom feed
From: Moritz Fischer <mdf@kernel.org>
To: Luca Ceresoli <luca@lucaceresoli.net>
Cc: linux-fpga@vger.kernel.org, Moritz Fischer <mdf@kernel.org>,
	Tom Rix <trix@redhat.com>, Michal Simek <michal.simek@xilinx.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Anatolij Gustschin <agust@denx.de>
Subject: Re: [PATCH v4 5/5] fpga manager: xilinx-spi: provide better diagnostics on programming failure
Date: Sun, 30 Aug 2020 17:09:57 -0700	[thread overview]
Message-ID: <20200831000957.GE7421@epycbox.lan> (raw)
In-Reply-To: <20200830163850.8380-5-luca@lucaceresoli.net>

On Sun, Aug 30, 2020 at 06:38:50PM +0200, Luca Ceresoli wrote:
> When the DONE pin does not go high after programming to confirm programming
> success, the INIT_B pin provides some info on the reason. Use it if
> available to provide a more explanatory error message.
> 
> Reviewed-by: Tom Rix <trix@redhat.com>
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> 
> ---
> 
> Changes in v4:
>  - add Reviewed-by Tom Rix
> 
> Changes in v3: none.
> 
> Changes in v2:
>  - also check for gpiod_get_value() errors (Tom Rix)
> ---
>  drivers/fpga/xilinx-spi.c | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/fpga/xilinx-spi.c b/drivers/fpga/xilinx-spi.c
> index 52aab5a1f0ba..824abbbd631e 100644
> --- a/drivers/fpga/xilinx-spi.c
> +++ b/drivers/fpga/xilinx-spi.c
> @@ -195,7 +195,21 @@ static int xilinx_spi_write_complete(struct fpga_manager *mgr,
>  			return 0;
>  	}
>  
> -	dev_err(&mgr->dev, "Timeout after config data transfer\n");
> +	if (conf->init_b) {
> +		ret = gpiod_get_value(conf->init_b);
> +
> +		if (ret < 0) {
> +			dev_err(&mgr->dev, "Error reading INIT_B (%d)\n", ret);
> +			return ret;
> +		}
> +
> +		dev_err(&mgr->dev,
> +			ret ? "CRC error or invalid device\n"
> +			: "Missing sync word or incomplete bitstream\n");
> +	} else {
> +		dev_err(&mgr->dev, "Timeout after config data transfer\n");
> +	}
> +
>  	return -ETIMEDOUT;
>  }
>  
> -- 
> 2.28.0
> 
Applied to for-next,

Thanks

WARNING: multiple messages have this Message-ID (diff)
From: Moritz Fischer <mdf@kernel.org>
To: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Tom Rix <trix@redhat.com>,
	linux-fpga@vger.kernel.org,
	Michal Simek <michal.simek@xilinx.com>,
	linux-kernel@vger.kernel.org, Moritz Fischer <mdf@kernel.org>,
	Anatolij Gustschin <agust@denx.de>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4 5/5] fpga manager: xilinx-spi: provide better diagnostics on programming failure
Date: Sun, 30 Aug 2020 17:09:57 -0700	[thread overview]
Message-ID: <20200831000957.GE7421@epycbox.lan> (raw)
In-Reply-To: <20200830163850.8380-5-luca@lucaceresoli.net>

On Sun, Aug 30, 2020 at 06:38:50PM +0200, Luca Ceresoli wrote:
> When the DONE pin does not go high after programming to confirm programming
> success, the INIT_B pin provides some info on the reason. Use it if
> available to provide a more explanatory error message.
> 
> Reviewed-by: Tom Rix <trix@redhat.com>
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
> 
> ---
> 
> Changes in v4:
>  - add Reviewed-by Tom Rix
> 
> Changes in v3: none.
> 
> Changes in v2:
>  - also check for gpiod_get_value() errors (Tom Rix)
> ---
>  drivers/fpga/xilinx-spi.c | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/fpga/xilinx-spi.c b/drivers/fpga/xilinx-spi.c
> index 52aab5a1f0ba..824abbbd631e 100644
> --- a/drivers/fpga/xilinx-spi.c
> +++ b/drivers/fpga/xilinx-spi.c
> @@ -195,7 +195,21 @@ static int xilinx_spi_write_complete(struct fpga_manager *mgr,
>  			return 0;
>  	}
>  
> -	dev_err(&mgr->dev, "Timeout after config data transfer\n");
> +	if (conf->init_b) {
> +		ret = gpiod_get_value(conf->init_b);
> +
> +		if (ret < 0) {
> +			dev_err(&mgr->dev, "Error reading INIT_B (%d)\n", ret);
> +			return ret;
> +		}
> +
> +		dev_err(&mgr->dev,
> +			ret ? "CRC error or invalid device\n"
> +			: "Missing sync word or incomplete bitstream\n");
> +	} else {
> +		dev_err(&mgr->dev, "Timeout after config data transfer\n");
> +	}
> +
>  	return -ETIMEDOUT;
>  }
>  
> -- 
> 2.28.0
> 
Applied to for-next,

Thanks

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-08-31  0:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-30 16:38 [PATCH v4 1/5] fpga manager: xilinx-spi: remove stray comment Luca Ceresoli
2020-08-30 16:38 ` Luca Ceresoli
2020-08-30 16:38 ` [PATCH v4 2/5] fpga manager: xilinx-spi: remove final dot from dev_err() strings Luca Ceresoli
2020-08-30 16:38   ` Luca Ceresoli
2020-08-31  0:05   ` Moritz Fischer
2020-08-31  0:05     ` Moritz Fischer
2020-08-30 16:38 ` [PATCH v4 3/5] fpga manager: xilinx-spi: fix write_complete timeout handling Luca Ceresoli
2020-08-30 16:38   ` Luca Ceresoli
2020-08-31  0:07   ` Moritz Fischer
2020-08-31  0:07     ` Moritz Fischer
2020-08-30 16:38 ` [PATCH v4 4/5] fpga manager: xilinx-spi: add error checking after gpiod_get_value() Luca Ceresoli
2020-08-30 16:38   ` Luca Ceresoli
2020-08-31  0:09   ` Moritz Fischer
2020-08-31  0:09     ` Moritz Fischer
2020-08-30 16:38 ` [PATCH v4 5/5] fpga manager: xilinx-spi: provide better diagnostics on programming failure Luca Ceresoli
2020-08-30 16:38   ` Luca Ceresoli
2020-08-31  0:09   ` Moritz Fischer [this message]
2020-08-31  0:09     ` Moritz Fischer
2020-08-31  0:05 ` [PATCH v4 1/5] fpga manager: xilinx-spi: remove stray comment Moritz Fischer
2020-08-31  0:05   ` Moritz Fischer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200831000957.GE7421@epycbox.lan \
    --to=mdf@kernel.org \
    --cc=agust@denx.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca@lucaceresoli.net \
    --cc=michal.simek@xilinx.com \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.