cxgb4: Inform caller if driver didn't upgrade firmware

If a card had already been initialized, on reloading cxgb4 driver firmware
required an upgrade but the upgrade did not happen. In that case a mailbox
timeout would occur during T4 configuration file stuff. The fix is to let the
caller know the firmware was not upgraded so a reset would be issued before
starting the T4 config stuff.

Signed-off-by: Jay Hernandez <jay@chelsio.com>
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Vipul Pandya 2012-09-26 02:39:41 +00:00 committed by David S. Miller
parent 13ee15d396
commit 1648a22b16

View file

@ -933,7 +933,13 @@ static int upgrade_fw(struct adapter *adap)
if (!ret) if (!ret)
dev_info(dev, "firmware upgraded to version %pI4 from " dev_info(dev, "firmware upgraded to version %pI4 from "
FW_FNAME "\n", &hdr->fw_ver); FW_FNAME "\n", &hdr->fw_ver);
} else {
/*
* Tell our caller that we didn't upgrade the firmware.
*/
ret = -EINVAL;
} }
out: release_firmware(fw); out: release_firmware(fw);
return ret; return ret;
} }