* [PATCH NEXT 1/3] qlcnic: fix LED test when interface is down.
2010-12-17 8:58 [PATCH NEXT 0/3]qlcnic: bug fixes Amit Kumar Salecha
@ 2010-12-17 8:59 ` Amit Kumar Salecha
2010-12-17 8:59 ` [PATCH NEXT 2/3] qlcnic: fix ocm window register offset calculation Amit Kumar Salecha
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Amit Kumar Salecha @ 2010-12-17 8:59 UTC (permalink / raw)
To: davem; +Cc: netdev, ameen.rahman, anirban.chakraborty, Sucheta Chakraborty
From: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
When interface is down, create temporary context to config LED.
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
drivers/net/qlcnic/qlcnic.h | 1 +
drivers/net/qlcnic/qlcnic_ethtool.c | 27 ++++++++++++++++++++++-----
2 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index f267da4..4028d0c 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -925,6 +925,7 @@ struct qlcnic_ipaddr {
#define QLCNIC_INTERRUPT_TEST 1
#define QLCNIC_LOOPBACK_TEST 2
+#define QLCNIC_LED_TEST 3
#define QLCNIC_FILTER_AGE 80
#define QLCNIC_READD_AGE 20
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index 0eaf31b..1e7af70 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -834,16 +834,27 @@ static int qlcnic_set_tso(struct net_device *dev, u32 data)
static int qlcnic_blink_led(struct net_device *dev, u32 val)
{
struct qlcnic_adapter *adapter = netdev_priv(dev);
+ int max_sds_rings = adapter->max_sds_rings;
+ int dev_down = 0;
int ret;
- if (!test_bit(__QLCNIC_DEV_UP, &adapter->state))
- return -EIO;
+ if (!test_bit(__QLCNIC_DEV_UP, &adapter->state)) {
+ dev_down = 1;
+ if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state))
+ return -EIO;
+
+ ret = qlcnic_diag_alloc_res(dev, QLCNIC_LED_TEST);
+ if (ret) {
+ clear_bit(__QLCNIC_RESETTING, &adapter->state);
+ return ret;
+ }
+ }
ret = adapter->nic_ops->config_led(adapter, 1, 0xf);
if (ret) {
dev_err(&adapter->pdev->dev,
"Failed to set LED blink state.\n");
- return ret;
+ goto done;
}
msleep_interruptible(val * 1000);
@@ -852,10 +863,16 @@ static int qlcnic_blink_led(struct net_device *dev, u32 val)
if (ret) {
dev_err(&adapter->pdev->dev,
"Failed to reset LED blink state.\n");
- return ret;
+ goto done;
}
- return 0;
+done:
+ if (dev_down) {
+ qlcnic_diag_free_res(dev, max_sds_rings);
+ clear_bit(__QLCNIC_RESETTING, &adapter->state);
+ }
+ return ret;
+
}
static void
--
1.7.3.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH NEXT 2/3] qlcnic: fix ocm window register offset calculation
2010-12-17 8:58 [PATCH NEXT 0/3]qlcnic: bug fixes Amit Kumar Salecha
2010-12-17 8:59 ` [PATCH NEXT 1/3] qlcnic: fix LED test when interface is down Amit Kumar Salecha
@ 2010-12-17 8:59 ` Amit Kumar Salecha
2010-12-17 8:59 ` [PATCH NEXT 3/3] qlcnic: reset pci function unconditionally during probe Amit Kumar Salecha
2010-12-17 19:39 ` [PATCH NEXT 0/3]qlcnic: bug fixes David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Amit Kumar Salecha @ 2010-12-17 8:59 UTC (permalink / raw)
To: davem; +Cc: netdev, ameen.rahman, anirban.chakraborty, Rajesh Borundia
From: Rajesh Borundia <rajesh.borundia@qlogic.com>
OCM window register offset was calculated incorrectly for
pci function greater than zero.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
drivers/net/qlcnic/qlcnic_hdr.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/qlcnic/qlcnic_hdr.h b/drivers/net/qlcnic/qlcnic_hdr.h
index 19328e0..726ef55 100644
--- a/drivers/net/qlcnic/qlcnic_hdr.h
+++ b/drivers/net/qlcnic/qlcnic_hdr.h
@@ -621,7 +621,7 @@ enum {
#define PCIX_INT_MASK (0x10104)
#define PCIX_OCM_WINDOW (0x10800)
-#define PCIX_OCM_WINDOW_REG(func) (PCIX_OCM_WINDOW + 0x20 * (func))
+#define PCIX_OCM_WINDOW_REG(func) (PCIX_OCM_WINDOW + 0x4 * (func))
#define PCIX_TARGET_STATUS (0x10118)
#define PCIX_TARGET_STATUS_F1 (0x10160)
--
1.7.3.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH NEXT 3/3] qlcnic: reset pci function unconditionally during probe
2010-12-17 8:58 [PATCH NEXT 0/3]qlcnic: bug fixes Amit Kumar Salecha
2010-12-17 8:59 ` [PATCH NEXT 1/3] qlcnic: fix LED test when interface is down Amit Kumar Salecha
2010-12-17 8:59 ` [PATCH NEXT 2/3] qlcnic: fix ocm window register offset calculation Amit Kumar Salecha
@ 2010-12-17 8:59 ` Amit Kumar Salecha
2010-12-17 19:39 ` [PATCH NEXT 0/3]qlcnic: bug fixes David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Amit Kumar Salecha @ 2010-12-17 8:59 UTC (permalink / raw)
To: davem; +Cc: netdev, ameen.rahman, anirban.chakraborty, Rajesh Borundia
From: Rajesh Borundia <rajesh.borundia@qlogic.com>
Some boot code drivers dont have cleanup routine, so pci function
remains in unknown state prior to driver load. So during driver load
issue FLR unconditionally.
Update driver version to 5.0.14.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
drivers/net/qlcnic/qlcnic.h | 4 ++--
drivers/net/qlcnic/qlcnic_main.c | 5 +----
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index 4028d0c..9c2a02d 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -34,8 +34,8 @@
#define _QLCNIC_LINUX_MAJOR 5
#define _QLCNIC_LINUX_MINOR 0
-#define _QLCNIC_LINUX_SUBVERSION 13
-#define QLCNIC_LINUX_VERSIONID "5.0.13"
+#define _QLCNIC_LINUX_SUBVERSION 14
+#define QLCNIC_LINUX_VERSIONID "5.0.14"
#define QLCNIC_DRV_IDC_VER 0x01
#define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\
(_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 788850e..11e3a46 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -1468,7 +1468,6 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
uint8_t revision_id;
uint8_t pci_using_dac;
char brd_name[QLCNIC_MAX_BOARD_NAME_LEN];
- u32 val;
err = pci_enable_device(pdev);
if (err)
@@ -1530,9 +1529,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err)
goto err_out_iounmap;
- val = QLCRD32(adapter, QLCNIC_CRB_DRV_ACTIVE);
- if (QLC_DEV_CHECK_ACTIVE(val, adapter->portnum))
- adapter->flags |= QLCNIC_NEED_FLR;
+ adapter->flags |= QLCNIC_NEED_FLR;
err = adapter->nic_ops->start_firmware(adapter);
if (err) {
--
1.7.3.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH NEXT 0/3]qlcnic: bug fixes
2010-12-17 8:58 [PATCH NEXT 0/3]qlcnic: bug fixes Amit Kumar Salecha
` (2 preceding siblings ...)
2010-12-17 8:59 ` [PATCH NEXT 3/3] qlcnic: reset pci function unconditionally during probe Amit Kumar Salecha
@ 2010-12-17 19:39 ` David Miller
3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2010-12-17 19:39 UTC (permalink / raw)
To: amit.salecha; +Cc: netdev, ameen.rahman, anirban.chakraborty
From: Amit Kumar Salecha <amit.salecha@qlogic.com>
Date: Fri, 17 Dec 2010 00:58:59 -0800
> Series of 3 bug fixes, apply them in net-next branch.
All applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread