All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] netxen: fix build with without CONFIG_PM
@ 2009-06-23  6:26 Dhananjay Phadke
  2009-06-23  6:26 ` [PATCH 2/2] netxen: fix firmware init handshake Dhananjay Phadke
  2009-06-23 11:21 ` [PATCH 1/2] netxen: fix build with without CONFIG_PM David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Dhananjay Phadke @ 2009-06-23  6:26 UTC (permalink / raw)
  To: davem; +Cc: netdev

wrap pci suspend() and resume() with CONFIG_PM check.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
---
 drivers/net/netxen/netxen_nic_main.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 71daa3d..43ac333 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -1178,6 +1178,7 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev)
 	free_netdev(netdev);
 }
 
+#ifdef CONFIG_PM
 static int
 netxen_nic_suspend(struct pci_dev *pdev, pm_message_t state)
 {
@@ -1242,6 +1243,7 @@ netxen_nic_resume(struct pci_dev *pdev)
 
 	return 0;
 }
+#endif
 
 static int netxen_nic_open(struct net_device *netdev)
 {
@@ -1771,8 +1773,10 @@ static struct pci_driver netxen_driver = {
 	.id_table = netxen_pci_tbl,
 	.probe = netxen_nic_probe,
 	.remove = __devexit_p(netxen_nic_remove),
+#ifdef CONFIG_PM
 	.suspend = netxen_nic_suspend,
 	.resume = netxen_nic_resume
+#endif
 };
 
 /* Driver Registration on NetXen card    */
-- 
1.6.0.2


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

* [PATCH 2/2] netxen: fix firmware init handshake
  2009-06-23  6:26 [PATCH 1/2] netxen: fix build with without CONFIG_PM Dhananjay Phadke
@ 2009-06-23  6:26 ` Dhananjay Phadke
  2009-06-23 11:21   ` David Miller
  2009-06-23 11:21 ` [PATCH 1/2] netxen: fix build with without CONFIG_PM David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Dhananjay Phadke @ 2009-06-23  6:26 UTC (permalink / raw)
  To: davem; +Cc: netdev

Make sure all functions run firmware init handshake.

If PCI function 0 fails to initialize firmware, mark the
state failed so that other functions on the same board
bail out quickly instead of waiting 30s for firmware
handshake.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
---
 drivers/net/netxen/netxen_nic_init.c |   37 ++++++++++++++++++---------------
 drivers/net/netxen/netxen_nic_main.c |    3 +-
 2 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index bdb143d..055bb61 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -944,28 +944,31 @@ int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val)
 	u32 val = 0;
 	int retries = 60;
 
-	if (!pegtune_val) {
-		do {
-			val = NXRD32(adapter, CRB_CMDPEG_STATE);
+	if (pegtune_val)
+		return 0;
 
-			if (val == PHAN_INITIALIZE_COMPLETE ||
-				val == PHAN_INITIALIZE_ACK)
-				return 0;
+	do {
+		val = NXRD32(adapter, CRB_CMDPEG_STATE);
 
-			msleep(500);
+		switch (val) {
+		case PHAN_INITIALIZE_COMPLETE:
+		case PHAN_INITIALIZE_ACK:
+			return 0;
+		case PHAN_INITIALIZE_FAILED:
+			goto out_err;
+		default:
+			break;
+		}
 
-		} while (--retries);
+		msleep(500);
 
-		if (!retries) {
-			pegtune_val = NXRD32(adapter,
-					NETXEN_ROMUSB_GLB_PEGTUNE_DONE);
-			printk(KERN_WARNING "netxen_phantom_init: init failed, "
-					"pegtune_val=%x\n", pegtune_val);
-			return -1;
-		}
-	}
+	} while (--retries);
 
-	return 0;
+	NXWR32(adapter, CRB_CMDPEG_STATE, PHAN_INITIALIZE_FAILED);
+
+out_err:
+	dev_warn(&adapter->pdev->dev, "firmware init failed\n");
+	return -EIO;
 }
 
 static int
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 43ac333..2919a2d 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -705,7 +705,7 @@ netxen_start_firmware(struct netxen_adapter *adapter, int request_fw)
 		first_driver = (adapter->ahw.pci_func == 0);
 
 	if (!first_driver)
-		return 0;
+		goto wait_init;
 
 	first_boot = NXRD32(adapter, NETXEN_CAM_RAM(0x1fc));
 
@@ -752,6 +752,7 @@ netxen_start_firmware(struct netxen_adapter *adapter, int request_fw)
 		| (_NETXEN_NIC_LINUX_SUBVERSION);
 	NXWR32(adapter, CRB_DRIVER_VERSION, val);
 
+wait_init:
 	/* Handshake with the card before we register the devices. */
 	err = netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE);
 	if (err) {
-- 
1.6.0.2


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

* Re: [PATCH 1/2] netxen: fix build with without CONFIG_PM
  2009-06-23  6:26 [PATCH 1/2] netxen: fix build with without CONFIG_PM Dhananjay Phadke
  2009-06-23  6:26 ` [PATCH 2/2] netxen: fix firmware init handshake Dhananjay Phadke
@ 2009-06-23 11:21 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2009-06-23 11:21 UTC (permalink / raw)
  To: dhananjay; +Cc: netdev

From: Dhananjay Phadke <dhananjay@netxen.com>
Date: Mon, 22 Jun 2009 23:26:20 -0700

> wrap pci suspend() and resume() with CONFIG_PM check.
> 
> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>

Applied.

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

* Re: [PATCH 2/2] netxen: fix firmware init handshake
  2009-06-23  6:26 ` [PATCH 2/2] netxen: fix firmware init handshake Dhananjay Phadke
@ 2009-06-23 11:21   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2009-06-23 11:21 UTC (permalink / raw)
  To: dhananjay; +Cc: netdev

From: Dhananjay Phadke <dhananjay@netxen.com>
Date: Mon, 22 Jun 2009 23:26:21 -0700

> Make sure all functions run firmware init handshake.
> 
> If PCI function 0 fails to initialize firmware, mark the
> state failed so that other functions on the same board
> bail out quickly instead of waiting 30s for firmware
> handshake.
> 
> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>

Applied.

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

end of thread, other threads:[~2009-06-23 11:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-23  6:26 [PATCH 1/2] netxen: fix build with without CONFIG_PM Dhananjay Phadke
2009-06-23  6:26 ` [PATCH 2/2] netxen: fix firmware init handshake Dhananjay Phadke
2009-06-23 11:21   ` David Miller
2009-06-23 11:21 ` [PATCH 1/2] netxen: fix build with without CONFIG_PM David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.