All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] liquidio: deprecate 1-bit flag indicating watchdog kernel thread is running
@ 2017-10-26  1:04 Felix Manlunas
  2017-10-27 13:13 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Manlunas @ 2017-10-26  1:04 UTC (permalink / raw)
  To: davem; +Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla

Deprecate the 1-bit flag (bit 2 in the SLI_SCRATCH_1 Octeon register) that
indicates that the liquidio watchdog kernel thread is running for this NIC.
Reason is:  it is incompatible with the firmware's use for SLI_SCRATCH_1.

In lieu of checking that now-deprecated flag, check the value of
oct_dev->adapter_refcount to determine whether or not to create the
watchdog kernel thread.

Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
---
 drivers/net/ethernet/cavium/liquidio/lio_main.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
index 963803b..d1a755b 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
@@ -1076,19 +1076,13 @@ liquidio_probe(struct pci_dev *pdev,
 	}
 
 	if (OCTEON_CN23XX_PF(oct_dev)) {
-		u64 scratch1;
 		u8 bus, device, function;
 
-		scratch1 = octeon_read_csr64(oct_dev, CN23XX_SLI_SCRATCH1);
-		if (!(scratch1 & 4ULL)) {
-			/* Bit 2 of SLI_SCRATCH_1 is a flag that indicates that
-			 * the lio watchdog kernel thread is running for this
-			 * NIC.  Each NIC gets one watchdog kernel thread.
+		if (atomic_read(oct_dev->adapter_refcount) == 1) {
+			/* Each NIC gets one watchdog kernel thread.  The first
+			 * PF (of each NIC) that gets pci_driver->probe()'d
+			 * creates that thread.
 			 */
-			scratch1 |= 4ULL;
-			octeon_write_csr64(oct_dev, CN23XX_SLI_SCRATCH1,
-					   scratch1);
-
 			bus = pdev->bus->number;
 			device = PCI_SLOT(pdev->devfn);
 			function = PCI_FUNC(pdev->devfn);

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

* Re: [PATCH net-next] liquidio: deprecate 1-bit flag indicating watchdog kernel thread is running
  2017-10-26  1:04 [PATCH net-next] liquidio: deprecate 1-bit flag indicating watchdog kernel thread is running Felix Manlunas
@ 2017-10-27 13:13 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-10-27 13:13 UTC (permalink / raw)
  To: felix.manlunas; +Cc: netdev, raghu.vatsavayi, derek.chickles, satananda.burla

From: Felix Manlunas <felix.manlunas@cavium.com>
Date: Wed, 25 Oct 2017 18:04:56 -0700

> Deprecate the 1-bit flag (bit 2 in the SLI_SCRATCH_1 Octeon register) that
> indicates that the liquidio watchdog kernel thread is running for this NIC.
> Reason is:  it is incompatible with the firmware's use for SLI_SCRATCH_1.
> 
> In lieu of checking that now-deprecated flag, check the value of
> oct_dev->adapter_refcount to determine whether or not to create the
> watchdog kernel thread.
> 
> Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
> Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>

Applied.

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

end of thread, other threads:[~2017-10-27 13:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-26  1:04 [PATCH net-next] liquidio: deprecate 1-bit flag indicating watchdog kernel thread is running Felix Manlunas
2017-10-27 13:13 ` 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.