aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/emulex
diff options
context:
space:
mode:
authorKalesh AP <kalesh.purayil@emulex.com>2014-09-02 00:26:51 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-02 15:46:00 -0400
commitbb864e07b2ea9c3cb0206973baa79dc5f27d2ee8 (patch)
tree967e1eecf0c0d9dafe8ffebd654d1485a5b8b03c /drivers/net/ethernet/emulex
parentd3de154071c14549c4b99d06a063bf3761e482c3 (diff)
be2net: fix log messages in lancer FW download path
Log messages in the Lancer FW download path have issues such as: - a single message spanning multiple lines - the success message is logged even in failure cases - status codes are already logged in the FW cmd routines This patch fixes these issues. Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex')
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 6c2eb6978601..235892970084 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -4076,6 +4076,7 @@ static int lancer_fw_download(struct be_adapter *adapter,
4076{ 4076{
4077#define LANCER_FW_DOWNLOAD_CHUNK (32 * 1024) 4077#define LANCER_FW_DOWNLOAD_CHUNK (32 * 1024)
4078#define LANCER_FW_DOWNLOAD_LOCATION "/prg" 4078#define LANCER_FW_DOWNLOAD_LOCATION "/prg"
4079 struct device *dev = &adapter->pdev->dev;
4079 struct be_dma_mem flash_cmd; 4080 struct be_dma_mem flash_cmd;
4080 const u8 *data_ptr = NULL; 4081 const u8 *data_ptr = NULL;
4081 u8 *dest_image_ptr = NULL; 4082 u8 *dest_image_ptr = NULL;
@@ -4088,16 +4089,14 @@ static int lancer_fw_download(struct be_adapter *adapter,
4088 u8 change_status; 4089 u8 change_status;
4089 4090
4090 if (!IS_ALIGNED(fw->size, sizeof(u32))) { 4091 if (!IS_ALIGNED(fw->size, sizeof(u32))) {
4091 dev_err(&adapter->pdev->dev, 4092 dev_err(dev, "FW image size should be multiple of 4\n");
4092 "FW Image not properly aligned. "
4093 "Length must be 4 byte aligned.\n");
4094 status = -EINVAL; 4093 status = -EINVAL;
4095 goto lancer_fw_exit; 4094 goto lancer_fw_exit;
4096 } 4095 }
4097 4096
4098 flash_cmd.size = sizeof(struct lancer_cmd_req_write_object) 4097 flash_cmd.size = sizeof(struct lancer_cmd_req_write_object)
4099 + LANCER_FW_DOWNLOAD_CHUNK; 4098 + LANCER_FW_DOWNLOAD_CHUNK;
4100 flash_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, flash_cmd.size, 4099 flash_cmd.va = dma_alloc_coherent(dev, flash_cmd.size,
4101 &flash_cmd.dma, GFP_KERNEL); 4100 &flash_cmd.dma, GFP_KERNEL);
4102 if (!flash_cmd.va) { 4101 if (!flash_cmd.va) {
4103 status = -ENOMEM; 4102 status = -ENOMEM;
@@ -4137,33 +4136,26 @@ static int lancer_fw_download(struct be_adapter *adapter,
4137 &add_status); 4136 &add_status);
4138 } 4137 }
4139 4138
4140 dma_free_coherent(&adapter->pdev->dev, flash_cmd.size, flash_cmd.va, 4139 dma_free_coherent(dev, flash_cmd.size, flash_cmd.va, flash_cmd.dma);
4141 flash_cmd.dma);
4142 if (status) { 4140 if (status) {
4143 dev_err(&adapter->pdev->dev, 4141 dev_err(dev, "Firmware load error\n");
4144 "Firmware load error. "
4145 "Status code: 0x%x Additional Status: 0x%x\n",
4146 status, add_status);
4147 goto lancer_fw_exit; 4142 goto lancer_fw_exit;
4148 } 4143 }
4149 4144
4145 dev_info(dev, "Firmware flashed successfully\n");
4146
4150 if (change_status == LANCER_FW_RESET_NEEDED) { 4147 if (change_status == LANCER_FW_RESET_NEEDED) {
4151 dev_info(&adapter->pdev->dev, 4148 dev_info(dev, "Resetting adapter to activate new FW\n");
4152 "Resetting adapter to activate new FW\n");
4153 status = lancer_physdev_ctrl(adapter, 4149 status = lancer_physdev_ctrl(adapter,
4154 PHYSDEV_CONTROL_FW_RESET_MASK); 4150 PHYSDEV_CONTROL_FW_RESET_MASK);
4155 if (status) { 4151 if (status) {
4156 dev_err(&adapter->pdev->dev, 4152 dev_err(dev, "Adapter busy, could not reset FW\n");
4157 "Adapter busy for FW reset.\n" 4153 dev_err(dev, "Reboot server to activate new FW\n");
4158 "New FW will not be active.\n");
4159 goto lancer_fw_exit; 4154 goto lancer_fw_exit;
4160 } 4155 }
4161 } else if (change_status != LANCER_NO_RESET_NEEDED) { 4156 } else if (change_status != LANCER_NO_RESET_NEEDED) {
4162 dev_err(&adapter->pdev->dev, 4157 dev_info(dev, "Reboot server to activate new FW\n");
4163 "System reboot required for new FW to be active\n");
4164 } 4158 }
4165
4166 dev_info(&adapter->pdev->dev, "Firmware flashed successfully\n");
4167lancer_fw_exit: 4159lancer_fw_exit:
4168 return status; 4160 return status;
4169} 4161}