Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH 1/42] drivers/net/wan: Adjust confusing if indentation
From: David Miller @ 2010-08-17  8:49 UTC (permalink / raw)
  To: julia; +Cc: khc, netdev, linux-kernel, kernel-janitors
In-Reply-To: <Pine.LNX.4.64.1008052216400.31692@ask.diku.dk>


Applied.

^ permalink raw reply

* Re: [PATCH 7/42] net/atm: Adjust confusing if indentation
From: David Miller @ 2010-08-17  8:49 UTC (permalink / raw)
  To: julia; +Cc: linux-kernel, netdev, kernel-janitors
In-Reply-To: <Pine.LNX.4.64.1008052218400.31692@ask.diku.dk>


Applied.

^ permalink raw reply

* Re: [PATCH 41/42] net/decnet: Adjust confusing if indentation
From: David Miller @ 2010-08-17  8:49 UTC (permalink / raw)
  To: julia; +Cc: linux-decnet-user, linux-kernel, netdev, kernel-janitors
In-Reply-To: <Pine.LNX.4.64.1008052229200.31692@ask.diku.dk>


Applied.

^ permalink raw reply

* Re: [PATCH 18/42] drivers/net: Adjust confusing if indentation
From: David Miller @ 2010-08-17  8:49 UTC (permalink / raw)
  To: julia; +Cc: netdev, linux-kernel, kernel-janitors
In-Reply-To: <Pine.LNX.4.64.1008052222000.31692@ask.diku.dk>


Applied.

^ permalink raw reply

* Re: [PATCH 31/42] drivers/net: Adjust confusing if indentation
From: David Miller @ 2010-08-17  8:49 UTC (permalink / raw)
  To: julia-dAYI7NvHqcQ
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <Pine.LNX.4.64.1008052226050.31692-QfmoRoYWmW9knbxzx/v8hQ@public.gmane.org>


Applied.

^ permalink raw reply

* Re: [PATCH 32/42] drivers/net/bnx2x: Adjust confusing if indentation
From: David Miller @ 2010-08-17  8:49 UTC (permalink / raw)
  To: julia; +Cc: eilong, netdev, linux-kernel, kernel-janitors
In-Reply-To: <Pine.LNX.4.64.1008052226210.31692@ask.diku.dk>


Applied.

^ permalink raw reply

* Re: [PATCH 37/42] drivers/net/hamradio: Adjust confusing if indentation
From: David Miller @ 2010-08-17  8:49 UTC (permalink / raw)
  To: julia
  Cc: jreuter, klaus.kudielka, linux-hams, netdev, linux-kernel,
	kernel-janitors
In-Reply-To: <Pine.LNX.4.64.1008052227520.31692@ask.diku.dk>


Applied.

^ permalink raw reply

* Re: [PATCH 28/42] drivers/atm: Adjust confusing if indentation
From: David Miller @ 2010-08-17  8:49 UTC (permalink / raw)
  To: julia; +Cc: chas, linux-atm-general, netdev, linux-kernel, kernel-janitors
In-Reply-To: <Pine.LNX.4.64.1008052225070.31692@ask.diku.dk>


Applied.

^ permalink raw reply

* Re: [PATCH 38/42] drivers/net: Adjust confusing if indentation
From: David Miller @ 2010-08-17  8:49 UTC (permalink / raw)
  To: julia; +Cc: florian, netdev, linux-kernel, kernel-janitors
In-Reply-To: <Pine.LNX.4.64.1008052228120.31692@ask.diku.dk>


Applied.

^ permalink raw reply

* Re: [PATCH 40/42] drivers/isdn: Adjust confusing if indentation
From: David Miller @ 2010-08-17  8:49 UTC (permalink / raw)
  To: julia; +Cc: isdn, netdev, linux-kernel, kernel-janitors
In-Reply-To: <Pine.LNX.4.64.1008052228590.31692@ask.diku.dk>


Applied.

^ permalink raw reply

* Re: [PATCH v5 1/2] core: Factor out flow calculation from get_rps_cpu
From: David Miller @ 2010-08-17  8:50 UTC (permalink / raw)
  To: krkumar2; +Cc: arnd, mst, netdev, xiaosuo, bhutchings, therbert
In-Reply-To: <20100804161552.3814.56839.sendpatchset@krkumar2.in.ibm.com>

From: Krishna Kumar <krkumar2@in.ibm.com>
Date: Wed, 04 Aug 2010 21:45:52 +0530

> Factor out flow calculation code from get_rps_cpu, since other
> functions can use the same code.

Applied.

^ permalink raw reply

* Re: [PATCH v5 2/2] macvtap: Implement multiqueue for macvtap driver
From: David Miller @ 2010-08-17  8:50 UTC (permalink / raw)
  To: krkumar2; +Cc: arnd, mst, netdev, xiaosuo, bhutchings, therbert
In-Reply-To: <20100804161559.3814.52060.sendpatchset@krkumar2.in.ibm.com>

From: Krishna Kumar <krkumar2@in.ibm.com>
Date: Wed, 04 Aug 2010 21:45:59 +0530

> Implement multiqueue facility for macvtap driver. The idea is that
> a macvtap device can be opened multiple times and the fd's can be
> used to register eg, as backend for vhost.

Applied.

^ permalink raw reply

* Re: [PATCH] ethtool: Provide a default implementation of ethtool_ops::get_drvinfo
From: David Miller @ 2010-08-17  8:50 UTC (permalink / raw)
  To: bhutchings; +Cc: rusty, netdev, mst, izumi.taku
In-Reply-To: <1281036008.2095.6.camel@achroite.uk.solarflarecom.com>

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Thu, 05 Aug 2010 20:20:08 +0100

> The driver name and bus address for a net_device can normally be found
> through the driver model now.  Instead of requiring drivers to provide
> this information redundantly through the ethtool_ops::get_drvinfo
> operation, use the driver model to do so if the driver does not define
> the operation.  Since ETHTOOL_GDRVINFO no longer requires the driver
> to implement any operations, do not require net_device::ethtool_ops to
> be set either.
> 
> Remove implementations of get_drvinfo and ethtool_ops that provide
> only this information.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>

Applied.

^ permalink raw reply

* Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.
From: Richard Cochran @ 2010-08-17  8:53 UTC (permalink / raw)
  To: john stultz
  Cc: Rodolfo Giometti, netdev-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Krzysztof Halasa
In-Reply-To: <AANLkTik_2MKMhOuDGOmu8Kzyq-ipLe+Bxrb3FaD+Tv4U-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Mon, Aug 16, 2010 at 12:24:48PM -0700, john stultz wrote:
> 3) I'm not sure I see the benefit of being able to have multiple
> frequency corrected time domains.  In other words, what benefit would
> you get from adjusting a PTP clock's frequency instead of just
> adjusting the system's time freq? Having the PTP time as a reference
> to correct the system time seems reasonable, but I'm not sure I see
> why userland would want to adjust the PTP clock's freq.

For PTP enabled hardware, the timestamp on the network packet comes
from from the PTP clock, not from the system time.

Of course, you can always just leave the PTP clock alone, figure the
needed correction, and apply it whenever needed. But this has some
disadvantages. First of all, the (one and only) open source PTPd does
not do it that way. Also, only one program (the PTPd or equivalent)
will know the correct time. Other programs will not be able to ask the
operating system for time services. Instead, they would need to use
IPC to the PTPd.

The PTP protocol (and some PTP hardware) offers a "one step" method,
where the timestamps are inserted by the hardware on the fly. Here you
really do need the PTP clock to be correctly adjusted.

All of the PTP hardware that I am familiar with provides a clock
adjustment method, so it simpler and cleaner just to use this facility
to tune the PTP clock.

Richard

^ permalink raw reply

* Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.
From: Arnd Bergmann @ 2010-08-17  9:25 UTC (permalink / raw)
  To: Richard Cochran
  Cc: linuxppc-dev, Rodolfo Giometti, netdev, devicetree-discuss,
	linux-kernel, linux-arm-kernel, Krzysztof Halasa
In-Reply-To: <20100817083216.GA3330@riccoc20.at.omicron.at>

On Tuesday 17 August 2010, Richard Cochran wrote:
> > Why did you not want to add syscalls? Adding ioctls instead of syscalls
> > does not make the interface better, just less visible.
> 
> I bet that, had I posted patch set with new syscalls, someone would
> have said, "You are adding new syscalls. Can't you just use a char
> device instead!"

Very possible, but after considering both options, I think we would
still end up with the same conclusion.
 
> If you add syscalls and introduce CLOCK_PTP, then you add it to
> everyone's kernel, even those people who never heard of PTP. A char
> device has the advantage that can it be simply ignored.

It's a matter of perspective whether you consider this an advantage
or disadvantage. I would expect that since you are trying to get support
for PTP into the kernel, you'd be happy for people to know about it and
use your code ;-).

> Also, a syscall has got to have the right form from the very beginning.
> If the next generation of PTP hardware looks very different, then it is not
> that much of a crime to change an ioctl interface, provided it has
> versioning.

No, that's just a myth. The rules for ABI stability are pretty much the
same. We try hard to avoid ever changing an existing ABI, for both
syscalls and ioctl. In either case, if you get it wrong, you have to support
the old interface and create a new syscall or ioctl command.
As mentioned, versioning does not solve this, it just adds another
indirection (which we try to avoid).

One difference is that more people take a look at your code when you suggest
a new syscall, so the chances of getting it right in the first upstream
version are higher.
Another difference is that we generally use ioctl for devices that can
be enumerated, while syscalls are for system services that are not tied to
a specific device. This argument works both ways for PTP IMHO: On the one
hand you want to have a reliable clock that you can use without knowing
where it comes from, on the other you might have multiple PTP sources that
you need to differentiate.

	Arnd

^ permalink raw reply

* Re: [PATCH net-next] bnx2x: Load firmware in open() instead of probe()
From: David Miller @ 2010-08-17  9:34 UTC (permalink / raw)
  To: dmitry; +Cc: netdev, eilong
In-Reply-To: <1280908180.4712.3.camel@lb-tlvb-dmitry>

From: "Dmitry Kravkov" <dmitry@broadcom.com>
Date: Wed, 4 Aug 2010 10:49:40 +0300

> Loading firmware when actually bringing eth device up.
> This also will allow driver to be insmoded when filesystem with
> firmware files is not available yet.
> 
> Suggested by Stephen Hemminger <shemminger@vyatta.com>
> 
> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied.

^ permalink raw reply

* Re: [PATCH] pcnet_cs: Use proper netdev_*-printouts
From: David Miller @ 2010-08-17  9:34 UTC (permalink / raw)
  To: w.sang; +Cc: netdev, linux-pcmcia, linux, joe
In-Reply-To: <1281270725-25282-1-git-send-email-w.sang@pengutronix.de>

From: Wolfram Sang <w.sang@pengutronix.de>
Date: Sun,  8 Aug 2010 14:32:05 +0200

> To prevent broken messages like:
> 
> [  204.024291] eth%d: pcnet_reset_8390() did not complete.
> 
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>

Applied.

^ permalink raw reply

* Re: [PATCH] pcnet_cs: Use pr_fmt and pr_<level>
From: David Miller @ 2010-08-17  9:34 UTC (permalink / raw)
  To: joe; +Cc: w.sang, netdev, linux-pcmcia, linux
In-Reply-To: <1281279036.28761.29.camel@Joe-Laptop.home>

From: Joe Perches <joe@perches.com>
Date: Sun, 08 Aug 2010 07:50:36 -0700

> It looks as if the printks in get_ax88190 are
> incorrect and were duplicated and superceded by a
> test in pcnet_config, so I removed them.
> 
> Changed the level of the ax88190 test to KERN_NOTICE
> to match the other message styles in pcnet_config.
> 
> Compiled but untested.
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Applied.

^ permalink raw reply

* Re: [PATCH] r6040: fix all checkpatch errors and warnings
From: David Miller @ 2010-08-17  9:34 UTC (permalink / raw)
  To: florian; +Cc: netdev
In-Reply-To: <201008082208.46396.florian@openwrt.org>

From: Florian Fainelli <florian@openwrt.org>
Date: Sun, 8 Aug 2010 22:08:44 +0200

> This patch fixes a couple of errors and warnings spotted by checkpatch.pl:
> - some lines were over 80 columns
> - there were some whitespaces left
> 
> The call to printk is now replaced by a call to pr_info and the log-level
> included in the driver version is now removed, so there are no longer false
> positives on this warning.
> 
> Signed-off-by: Florian Fainelli <florian@openwrt.org>

Applied.

^ permalink raw reply

* Re: [PATCH] cpmac: fix all checkpatch errors and warnings
From: David Miller @ 2010-08-17  9:35 UTC (permalink / raw)
  To: florian; +Cc: netdev
In-Reply-To: <201008082209.40403.florian@openwrt.org>

From: Florian Fainelli <florian@openwrt.org>
Date: Sun, 8 Aug 2010 22:09:39 +0200

> This patches fixes a couple of checkpatch warnings and errors:
> - lines over 80 columns
> - printk() instead of pr_cont()
> - assignments in tests (if ((foo == bar())))
> 
> Signed-off-by: Florian Fainelli <florian@openwrt.org>

Applied.

^ permalink raw reply

* Re: [PATCH] am79c961a: Use net_device_stats from struct net_device
From: David Miller @ 2010-08-17  9:35 UTC (permalink / raw)
  To: tklauser; +Cc: netdev, linux, segooon
In-Reply-To: <1281366274-28796-1-git-send-email-tklauser@distanz.ch>

From: Tobias Klauser <tklauser@distanz.ch>
Date: Mon,  9 Aug 2010 17:04:34 +0200

> struct net_device has its own struct net_device_stats member, so we can
> use this one instead of a private copy in the dev_priv struct.
> 
> Cc: Kulikov Vasiliy <segooon@gmail.com>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

Applied.

^ permalink raw reply

* Re: [net-next-2.6 PATCH 0/7] enic: updates to version 1.4.1.2
From: David Miller @ 2010-08-17  9:35 UTC (permalink / raw)
  To: roprabhu; +Cc: netdev
In-Reply-To: <20100811045436.3877.51650.stgit@savbu-pc100.cisco.com>

From: Roopa Prabhu <roprabhu@cisco.com>
Date: Tue, 10 Aug 2010 21:54:50 -0700

> This patch series implements the following enic driver updates:
> 
> 01/7 - Add set mac address
> 02/7 - Add support for firmware management device
> 03/7 - Add new firmware devcmds
> 04/7 - Use offsetof macro in vic tlv length calculation
> 05/7 - Clean up: remove enic_dev_stats_clear
> 06/7 - Check if rq/wq buf not NULL before freeing them
> 07/7 - Mark intr_timer in vnic_enet_config as deprecated
> 
> 
> Signed-off-by: Scott Feldman <scofeldm@cisco.com>
> Signed-off-by: Roopa Prabhu<roprabhu@cisco.com>
> Signed-off-by: Vasanthy Kolluri<vkolluri@cisco.com>

All applied, thank you.

^ permalink raw reply

* Re: [PATCHv2 NEXT 0/7]qlcnic: enhancement and fixes
From: David Miller @ 2010-08-17  9:43 UTC (permalink / raw)
  To: amit.salecha; +Cc: netdev, ameen.rahman
In-Reply-To: <1281682646-15990-1-git-send-email-amit.salecha@qlogic.com>

From: Amit Kumar Salecha <amit.salecha@qlogic.com>
Date: Thu, 12 Aug 2010 23:57:19 -0700

> Hi
>    Sending v2 series of 7 patches. In previous set of patches author
>    email id was incorrect and a minor fix in lro/rxcsum patch.
>    Please ignore v1 patches.

Please respin this against net-next-2.6 and resubmit, as-is it doesn't
apply cleanly.

Also, patch #5 is not correct.  Use "netdev_info()" if you want the
netdev stuff printed properly in the link status message.  You're
undoing all of the work made such that all printk's in your driver are
consistent, by using the pr_fmt based interfaces (pr_*(), dev_*(),
netdev_*()).

^ permalink raw reply

* [PATCHv3 NEXT 1/7] qlcnic: fix aer for virtual func
From: Amit Kumar Salecha @ 2010-08-17 10:34 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman
In-Reply-To: <1282041265-32591-1-git-send-email-amit.salecha@qlogic.com>

Virtual function are not privilge to initialize firmware.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
 drivers/net/qlcnic/qlcnic_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index bf6d87a..4ecbf41 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -2733,7 +2733,7 @@ static int qlcnic_attach_func(struct pci_dev *pdev)
 	if (qlcnic_api_lock(adapter))
 		return -EINVAL;
 
-	if (first_func) {
+	if (adapter->op_mode != QLCNIC_NON_PRIV_FUNC && first_func) {
 		adapter->need_fw_reset = 1;
 		set_bit(__QLCNIC_START_FW, &adapter->state);
 		QLCWR32(adapter, QLCNIC_CRB_DEV_STATE, QLCNIC_DEV_INITIALIZING);
-- 
1.6.0.2


^ permalink raw reply related

* [PATCHv3 NEXT 2/7] qlcnic: device state management fixes for virtual func
From: Amit Kumar Salecha @ 2010-08-17 10:34 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman
In-Reply-To: <1282041265-32591-1-git-send-email-amit.salecha@qlogic.com>

o NPAR state should be set to operationl by Mangement function only.
o NPAR state should be set to non operational before device reset.
o VF function should wait for NPAR state to be operational.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
 drivers/net/qlcnic/qlcnic_hdr.h  |    5 +-
 drivers/net/qlcnic/qlcnic_main.c |   80 +++++++++++++++++++++++---------------
 2 files changed, 51 insertions(+), 34 deletions(-)

diff --git a/drivers/net/qlcnic/qlcnic_hdr.h b/drivers/net/qlcnic/qlcnic_hdr.h
index 15fc320..bd346d9 100644
--- a/drivers/net/qlcnic/qlcnic_hdr.h
+++ b/drivers/net/qlcnic/qlcnic_hdr.h
@@ -718,8 +718,9 @@ enum {
 #define QLCNIC_DEV_FAILED		0x6
 #define QLCNIC_DEV_QUISCENT		0x7
 
-#define QLCNIC_DEV_NPAR_NOT_RDY	0
-#define QLCNIC_DEV_NPAR_RDY		1
+#define QLCNIC_DEV_NPAR_NON_OPER	0 /* NON Operational */
+#define QLCNIC_DEV_NPAR_OPER		1 /* NPAR Operational */
+#define QLCNIC_DEV_NPAR_OPER_TIMEO	30 /* Operational time out */
 
 #define QLC_DEV_CHECK_ACTIVE(VAL, FN)		((VAL) &= (1 << (FN * 4)))
 #define QLC_DEV_SET_REF_CNT(VAL, FN)		((VAL) |= (1 << (FN * 4)))
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 4ecbf41..70c4b6b 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -2398,7 +2398,7 @@ qlcnic_fwinit_work(struct work_struct *work)
 {
 	struct qlcnic_adapter *adapter = container_of(work,
 			struct qlcnic_adapter, fw_work.work);
-	u32 dev_state = 0xf, npar_state;
+	u32 dev_state = 0xf;
 
 	if (qlcnic_api_lock(adapter))
 		goto err_ret;
@@ -2412,16 +2412,8 @@ qlcnic_fwinit_work(struct work_struct *work)
 	}
 
 	if (adapter->op_mode == QLCNIC_NON_PRIV_FUNC) {
-		npar_state = QLCRD32(adapter, QLCNIC_CRB_DEV_NPAR_STATE);
-		if (npar_state == QLCNIC_DEV_NPAR_RDY) {
-			qlcnic_api_unlock(adapter);
-			goto wait_npar;
-		} else {
-			qlcnic_schedule_work(adapter, qlcnic_fwinit_work,
-				FW_POLL_DELAY);
-			qlcnic_api_unlock(adapter);
-			return;
-		}
+		qlcnic_api_unlock(adapter);
+		goto wait_npar;
 	}
 
 	if (adapter->fw_wait_cnt++ > adapter->reset_ack_timeo) {
@@ -2470,20 +2462,17 @@ wait_npar:
 	QLCDB(adapter, HW, "Func waiting: Device state=%u\n", dev_state);
 
 	switch (dev_state) {
-	case QLCNIC_DEV_QUISCENT:
-	case QLCNIC_DEV_NEED_QUISCENT:
-	case QLCNIC_DEV_NEED_RESET:
-		qlcnic_schedule_work(adapter,
-			qlcnic_fwinit_work, FW_POLL_DELAY);
-		return;
-	case QLCNIC_DEV_FAILED:
-		break;
-
-	default:
+	case QLCNIC_DEV_READY:
 		if (!adapter->nic_ops->start_firmware(adapter)) {
 			qlcnic_schedule_work(adapter, qlcnic_attach_work, 0);
 			return;
 		}
+	case QLCNIC_DEV_FAILED:
+		break;
+	default:
+		qlcnic_schedule_work(adapter,
+			qlcnic_fwinit_work, FW_POLL_DELAY);
+		return;
 	}
 
 err_ret:
@@ -2530,6 +2519,22 @@ err_ret:
 
 }
 
+/*Transit NPAR state to NON Operational */
+static void
+qlcnic_set_npar_non_operational(struct qlcnic_adapter *adapter)
+{
+	u32 state;
+
+	state = QLCRD32(adapter, QLCNIC_CRB_DEV_NPAR_STATE);
+	if (state == QLCNIC_DEV_NPAR_NON_OPER)
+		return;
+
+	if (qlcnic_api_lock(adapter))
+		return;
+	QLCWR32(adapter, QLCNIC_CRB_DEV_NPAR_STATE, QLCNIC_DEV_NPAR_NON_OPER);
+	qlcnic_api_unlock(adapter);
+}
+
 /*Transit to RESET state from READY state only */
 static void
 qlcnic_dev_request_reset(struct qlcnic_adapter *adapter)
@@ -2548,6 +2553,7 @@ qlcnic_dev_request_reset(struct qlcnic_adapter *adapter)
 		qlcnic_idc_debug_info(adapter, 0);
 	}
 
+	QLCWR32(adapter, QLCNIC_CRB_DEV_NPAR_STATE, QLCNIC_DEV_NPAR_NON_OPER);
 	qlcnic_api_unlock(adapter);
 }
 
@@ -2555,21 +2561,14 @@ qlcnic_dev_request_reset(struct qlcnic_adapter *adapter)
 static void
 qlcnic_dev_set_npar_ready(struct qlcnic_adapter *adapter)
 {
-	u32 state;
-
 	if (!(adapter->flags & QLCNIC_ESWITCH_ENABLED) ||
-		adapter->op_mode == QLCNIC_NON_PRIV_FUNC)
+	    adapter->op_mode != QLCNIC_MGMT_FUNC)
 		return;
 	if (qlcnic_api_lock(adapter))
 		return;
 
-	state = QLCRD32(adapter, QLCNIC_CRB_DEV_NPAR_STATE);
-
-	if (state != QLCNIC_DEV_NPAR_RDY) {
-		QLCWR32(adapter, QLCNIC_CRB_DEV_NPAR_STATE,
-			QLCNIC_DEV_NPAR_RDY);
-		QLCDB(adapter, DRV, "NPAR READY state set\n");
-	}
+	QLCWR32(adapter, QLCNIC_CRB_DEV_NPAR_STATE, QLCNIC_DEV_NPAR_OPER);
+	QLCDB(adapter, DRV, "NPAR operational state set\n");
 
 	qlcnic_api_unlock(adapter);
 }
@@ -2631,8 +2630,11 @@ qlcnic_check_health(struct qlcnic_adapter *adapter)
 		qlcnic_dev_request_reset(adapter);
 
 	state = QLCRD32(adapter, QLCNIC_CRB_DEV_STATE);
-	if (state == QLCNIC_DEV_NEED_RESET || state == QLCNIC_DEV_NEED_QUISCENT)
+	if (state == QLCNIC_DEV_NEED_RESET ||
+	    state == QLCNIC_DEV_NEED_QUISCENT) {
+		qlcnic_set_npar_non_operational(adapter);
 		adapter->need_fw_reset = 1;
+	}
 
 	heartbit = QLCRD32(adapter, QLCNIC_PEG_ALIVE_COUNTER);
 	if (heartbit != adapter->heartbit) {
@@ -2822,11 +2824,25 @@ static int
 qlcnicvf_start_firmware(struct qlcnic_adapter *adapter)
 {
 	int err;
+	u8 npar_opt_timeo = QLCNIC_DEV_NPAR_OPER_TIMEO;
+	u32 npar_state;
 
 	err = qlcnic_can_start_firmware(adapter);
 	if (err)
 		return err;
 
+	npar_state = QLCRD32(adapter, QLCNIC_CRB_DEV_NPAR_STATE);
+	while (npar_state != QLCNIC_DEV_NPAR_OPER && --npar_opt_timeo) {
+		msleep(1000);
+		npar_state = QLCRD32(adapter, QLCNIC_CRB_DEV_NPAR_STATE);
+	}
+
+	if (!npar_opt_timeo) {
+		dev_err(&adapter->pdev->dev,
+			"Waiting for NPAR state to opertional timeout\n");
+		return -EIO;
+	}
+
 	qlcnic_check_options(adapter);
 
 	adapter->need_fw_reset = 0;
-- 
1.6.0.2


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox