linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fpga: altera-cvp: output expected CvP VSE_PCIE_EXT_CAP_ID in error case
@ 2018-11-06 21:58 Anatolij Gustschin
  2018-11-15 22:28 ` Alan Tull
  0 siblings, 1 reply; 3+ messages in thread
From: Anatolij Gustschin @ 2018-11-06 21:58 UTC (permalink / raw)
  To: linux-fpga; +Cc: atull, mdf

Output VSE_PCIE_EXT_CAP_ID register address and expected register
value in error message to give more info when analyzing issues
with loaded periphery image.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 drivers/fpga/altera-cvp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/fpga/altera-cvp.c b/drivers/fpga/altera-cvp.c
index 381d0c42450f..08c0080092da 100644
--- a/drivers/fpga/altera-cvp.c
+++ b/drivers/fpga/altera-cvp.c
@@ -413,7 +413,10 @@ static int altera_cvp_probe(struct pci_dev *pdev,
 	 */
 	pci_read_config_word(pdev, VSE_PCIE_EXT_CAP_ID, &val);
 	if (val != VSE_PCIE_EXT_CAP_ID_VAL) {
-		dev_err(&pdev->dev, "Wrong EXT_CAP_ID value 0x%x\n", val);
+		dev_err(&pdev->dev,
+			"Wrong VSE_PCIE_EXT_CAP_ID value 0x%04x at 0x%x, "
+			"expected: 0x%04x\n",
+			val, VSE_PCIE_EXT_CAP_ID, VSE_PCIE_EXT_CAP_ID_VAL);
 		return -ENODEV;
 	}
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] fpga: altera-cvp: output expected CvP VSE_PCIE_EXT_CAP_ID in error case
  2018-11-06 21:58 [PATCH] fpga: altera-cvp: output expected CvP VSE_PCIE_EXT_CAP_ID in error case Anatolij Gustschin
@ 2018-11-15 22:28 ` Alan Tull
  2018-11-16  0:08   ` Anatolij Gustschin
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Tull @ 2018-11-15 22:28 UTC (permalink / raw)
  To: Anatolij Gustschin; +Cc: linux-fpga, Moritz Fischer

On Tue, Nov 6, 2018 at 3:58 PM Anatolij Gustschin <agust@denx.de> wrote:

Hi Anatolij,

>
> Output VSE_PCIE_EXT_CAP_ID register address and expected register
> value in error message to give more info when analyzing issues
> with loaded periphery image.
>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> ---
>  drivers/fpga/altera-cvp.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/fpga/altera-cvp.c b/drivers/fpga/altera-cvp.c
> index 381d0c42450f..08c0080092da 100644
> --- a/drivers/fpga/altera-cvp.c
> +++ b/drivers/fpga/altera-cvp.c
> @@ -413,7 +413,10 @@ static int altera_cvp_probe(struct pci_dev *pdev,
>          */
>         pci_read_config_word(pdev, VSE_PCIE_EXT_CAP_ID, &val);
>         if (val != VSE_PCIE_EXT_CAP_ID_VAL) {
> -               dev_err(&pdev->dev, "Wrong EXT_CAP_ID value 0x%x\n", val);
> +               dev_err(&pdev->dev,
> +                       "Wrong VSE_PCIE_EXT_CAP_ID value 0x%04x at 0x%x, "
> +                       "expected: 0x%04x\n",
> +                       val, VSE_PCIE_EXT_CAP_ID, VSE_PCIE_EXT_CAP_ID_VAL);

This patch adds error print info which is printing out constants.
Wouldn't the user just be able to look at the source and know what was
expected?  I may be missing something here.

Alan

>                 return -ENODEV;
>         }
>
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fpga: altera-cvp: output expected CvP VSE_PCIE_EXT_CAP_ID in error case
  2018-11-15 22:28 ` Alan Tull
@ 2018-11-16  0:08   ` Anatolij Gustschin
  0 siblings, 0 replies; 3+ messages in thread
From: Anatolij Gustschin @ 2018-11-16  0:08 UTC (permalink / raw)
  To: Alan Tull; +Cc: linux-fpga, Moritz Fischer

Hi Alan,

On Thu, 15 Nov 2018 16:28:10 -0600
Alan Tull atull@kernel.org wrote:

>On Tue, Nov 6, 2018 at 3:58 PM Anatolij Gustschin <agust@denx.de> wrote:
>
>Hi Anatolij,
>
>>
>> Output VSE_PCIE_EXT_CAP_ID register address and expected register
>> value in error message to give more info when analyzing issues
>> with loaded periphery image.
>>
>> Signed-off-by: Anatolij Gustschin <agust@denx.de>
>> ---
>>  drivers/fpga/altera-cvp.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/fpga/altera-cvp.c b/drivers/fpga/altera-cvp.c
>> index 381d0c42450f..08c0080092da 100644
>> --- a/drivers/fpga/altera-cvp.c
>> +++ b/drivers/fpga/altera-cvp.c
>> @@ -413,7 +413,10 @@ static int altera_cvp_probe(struct pci_dev *pdev,
>>          */
>>         pci_read_config_word(pdev, VSE_PCIE_EXT_CAP_ID, &val);
>>         if (val != VSE_PCIE_EXT_CAP_ID_VAL) {
>> -               dev_err(&pdev->dev, "Wrong EXT_CAP_ID value 0x%x\n", val);
>> +               dev_err(&pdev->dev,
>> +                       "Wrong VSE_PCIE_EXT_CAP_ID value 0x%04x at 0x%x, "
>> +                       "expected: 0x%04x\n",
>> +                       val, VSE_PCIE_EXT_CAP_ID, VSE_PCIE_EXT_CAP_ID_VAL);  
>
>This patch adds error print info which is printing out constants.
>Wouldn't the user just be able to look at the source and know what was
>expected?  I may be missing something here.

People dealing with different FPGAs asked me to add this, they didn't
want to lookup it in the code.

Thanks,
Anatolij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-16 10:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-06 21:58 [PATCH] fpga: altera-cvp: output expected CvP VSE_PCIE_EXT_CAP_ID in error case Anatolij Gustschin
2018-11-15 22:28 ` Alan Tull
2018-11-16  0:08   ` Anatolij Gustschin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).