netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] qlcnic: Bug fixes
@ 2014-04-23 13:59 Shahed Shaikh
  2014-04-23 13:59 ` [PATCH net 1/2] qlcnic: Reset firmware API lock at driver load time Shahed Shaikh
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Shahed Shaikh @ 2014-04-23 13:59 UTC (permalink / raw)
  To: davem; +Cc: netdev, Dept-HSGLinuxNICDev, Shahed Shaikh

From: Shahed Shaikh <shahed.shaikh@qlogic.com>

Hi David,

This patch series contains following fixes -

* Fix memory leak caused because of issuing mailbox
  command which can not wait for its completion.
* Reset firmware API lock which might be in inconsistent state.

Please apply this series to net.

Thanks,
Shahed

Rajesh Borundia (1):
  qlcnic: Fix memory leak.

Sony Chacko (1):
  qlcnic: Reset firmware API lock at driver load time

 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c   |    9 +++++++++
 .../ethernet/qlogic/qlcnic/qlcnic_sriov_common.c   |    9 ++++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)

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

* [PATCH net 1/2] qlcnic: Reset firmware API lock at driver load time
  2014-04-23 13:59 [PATCH net 0/2] qlcnic: Bug fixes Shahed Shaikh
@ 2014-04-23 13:59 ` Shahed Shaikh
  2014-04-23 13:59 ` [PATCH net 2/2] qlcnic: Fix memory leak Shahed Shaikh
  2014-04-24 17:31 ` [PATCH net 0/2] qlcnic: Bug fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Shahed Shaikh @ 2014-04-23 13:59 UTC (permalink / raw)
  To: davem; +Cc: netdev, Dept-HSGLinuxNICDev, Sony Chacko

From: Sony Chacko <sony.chacko@qlogic.com>

Some firmware versions fails to reset the lock during
initialization. Force reset firmware API lock during driver
probe to ensure lock availability.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
---
 drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index dbf7539..0bc9148 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -2374,6 +2374,14 @@ void qlcnic_set_drv_version(struct qlcnic_adapter *adapter)
 		qlcnic_fw_cmd_set_drv_version(adapter, fw_cmd);
 }
 
+/* Reset firmware API lock */
+static void qlcnic_reset_api_lock(struct qlcnic_adapter *adapter)
+{
+	qlcnic_api_lock(adapter);
+	qlcnic_api_unlock(adapter);
+}
+
+
 static int
 qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
@@ -2476,6 +2484,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (qlcnic_82xx_check(adapter)) {
 		qlcnic_check_vf(adapter, ent);
 		adapter->portnum = adapter->ahw->pci_func;
+		qlcnic_reset_api_lock(adapter);
 		err = qlcnic_start_firmware(adapter);
 		if (err) {
 			dev_err(&pdev->dev, "Loading fw failed.Please Reboot\n"
-- 
1.5.6

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

* [PATCH net 2/2] qlcnic: Fix memory leak.
  2014-04-23 13:59 [PATCH net 0/2] qlcnic: Bug fixes Shahed Shaikh
  2014-04-23 13:59 ` [PATCH net 1/2] qlcnic: Reset firmware API lock at driver load time Shahed Shaikh
@ 2014-04-23 13:59 ` Shahed Shaikh
  2014-04-24 17:31 ` [PATCH net 0/2] qlcnic: Bug fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Shahed Shaikh @ 2014-04-23 13:59 UTC (permalink / raw)
  To: davem; +Cc: netdev, Dept-HSGLinuxNICDev, Rajesh Borundia

From: Rajesh Borundia <rajesh.borundia@qlogic.com>

o In case QLC_83XX_MBX_CMD_NO_WAIT command type the calling
  function does not free the memory as it does not wait for
  response. So free it when get a response from adapter after
  sending the command.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
---
 .../ethernet/qlogic/qlcnic/qlcnic_sriov_common.c   |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
index 0638c18..6afe9c1 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c
@@ -1370,7 +1370,7 @@ static int qlcnic_sriov_issue_cmd(struct qlcnic_adapter *adapter,
 
 	rsp = qlcnic_sriov_alloc_bc_trans(&trans);
 	if (rsp)
-		return rsp;
+		goto free_cmd;
 
 	rsp = qlcnic_sriov_prepare_bc_hdr(trans, cmd, seq, QLC_BC_COMMAND);
 	if (rsp)
@@ -1425,6 +1425,13 @@ err_out:
 
 cleanup_transaction:
 	qlcnic_sriov_cleanup_transaction(trans);
+
+free_cmd:
+	if (cmd->type == QLC_83XX_MBX_CMD_NO_WAIT) {
+		qlcnic_free_mbx_args(cmd);
+		kfree(cmd);
+	}
+
 	return rsp;
 }
 
-- 
1.5.6

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

* Re: [PATCH net 0/2] qlcnic: Bug fixes
  2014-04-23 13:59 [PATCH net 0/2] qlcnic: Bug fixes Shahed Shaikh
  2014-04-23 13:59 ` [PATCH net 1/2] qlcnic: Reset firmware API lock at driver load time Shahed Shaikh
  2014-04-23 13:59 ` [PATCH net 2/2] qlcnic: Fix memory leak Shahed Shaikh
@ 2014-04-24 17:31 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2014-04-24 17:31 UTC (permalink / raw)
  To: shahed.shaikh; +Cc: netdev, Dept-HSGLinuxNICDev

From: Shahed Shaikh <shahed.shaikh@qlogic.com>
Date: Wed, 23 Apr 2014 09:59:54 -0400

> This patch series contains following fixes -
> 
> * Fix memory leak caused because of issuing mailbox
>   command which can not wait for its completion.
> * Reset firmware API lock which might be in inconsistent state.
> 
> Please apply this series to net.

Series applied, thanks.

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

end of thread, other threads:[~2014-04-24 17:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-23 13:59 [PATCH net 0/2] qlcnic: Bug fixes Shahed Shaikh
2014-04-23 13:59 ` [PATCH net 1/2] qlcnic: Reset firmware API lock at driver load time Shahed Shaikh
2014-04-23 13:59 ` [PATCH net 2/2] qlcnic: Fix memory leak Shahed Shaikh
2014-04-24 17:31 ` [PATCH net 0/2] qlcnic: Bug fixes David Miller

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).