Skip to contentSkip to conversation

fpga: altera-cvp: output expected CvP VSE_PCIE_EXT_CAP_ID in error case

PATCH In review Anatolij Gustschin 2 participants 3 messages Nov 6, 2018 – Nov 16, 2018 FPGA manager framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fpga: altera-cvp: output expected CvP VSE_PCIE_EXT_CAP_ID in error case

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.

---
 drivers/fpga/altera-cvp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/fpga/altera-cvp.c +4 -1
index 381d0c42450f..08c0080092da 100644
@@ -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;
 	}
 
Signature · 1 line
2.17.1
#1 lore raw

On Tue, Nov 6, 2018 at 3:58 PM Anatolij Gustschin <[email protected]> wrote:

Hi Anatolij,

Quoted 15 lines

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.

---
 drivers/fpga/altera-cvp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/fpga/altera-cvp.c +0 -0
index 381d0c42450f..08c0080092da 100644

drivers/fpga/altera-cvp.c static int altera_cvp_probe(struct pci_dev *pdev, · line 419

Quoted 8 lines
drivers/fpga/altera-cvp.c +4 -1
@@ -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

Quoted 6 lines
drivers/fpga/altera-cvp.c +0 -1
                return -ENODEV;
        }
 
--

2.17.1

#2 lore raw

Hi Alan,

Quoted 23 lines · On Thu, 15 Nov 2018 16:28:10 -0600 Alan Tull [email protected] wrote:

On Tue, Nov 6, 2018 at 3:58 PM Anatolij Gustschin <[email protected]> wrote:

Hi Anatolij,

Quoted 19 lines

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.

---
 drivers/fpga/altera-cvp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/fpga/altera-cvp.c +0 -1
index 381d0c42450f..08c0080092da 100644
@@ -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);
Quoted 8 lines

drivers/fpga/altera-cvp.c static int altera_cvp_probe(struct pci_dev *pdev, · line 419

Quoted 4 lines
drivers/fpga/altera-cvp.c +4 -0
+               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