Skip to contentSkip to conversation

scsi: csiostor: fail probe if fw does not support FCoE

PATCH Applied Varun Prakash 2 participants 2 messages Jul 31, 2017 – Aug 8, 2017 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: csiostor: fail probe if fw does not support FCoE

Fail probe if FCoE capability is not enabled in the firmware.

---
 drivers/scsi/csiostor/csio_hw.c   |  4 +++-
 drivers/scsi/csiostor/csio_init.c | 12 ++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)
drivers/scsi/csiostor/csio_hw.c +3 -1
index 2029ad2..5be0086 100644
@@ -3845,8 +3845,10 @@ csio_hw_start(struct csio_hw *hw)
 
 	if (csio_is_hw_ready(hw))
 		return 0;
-	else
+	else if (csio_match_state(hw, csio_hws_uninit))
 		return -EINVAL;
+	else
+		return -ENODEV;
 }
 
 int
drivers/scsi/csiostor/csio_init.c +8 -4
index ea0c310..dcd0741 100644
@@ -969,10 +969,14 @@ static int csio_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	pci_set_drvdata(pdev, hw);
 
-	if (csio_hw_start(hw) != 0) {
-		dev_err(&pdev->dev,
-			"Failed to start FW, continuing in debug mode.\n");
-		return 0;
+	rv = csio_hw_start(hw);
+	if (rv) {
+		if (rv == -EINVAL) {
+			dev_err(&pdev->dev,
+				"Failed to start FW, continuing in debug mode.\n");
+			return 0;
+		}
+		goto err_lnode_exit;
 	}
 
 	sprintf(hw->fwrev_str, "%u.%u.%u.%u\n",
Signature · 1 line
2.0.2
#1 lore raw

Varun,

Quoted 1 line

Fail probe if FCoE capability is not enabled in the firmware.

Applied to 4.13/scsi-fixes. Thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering