Linux-Watchdog Archive on lore.kernel.org
 help / Atom feed
* [PATCH v2 0/3] watchdog/hpwdt: Do not claim on unsupported hardware
@ 2018-12-06  0:42 Jerry Hoemann
  2018-12-06  0:42 ` [PATCH v2 1/3] watchdog/hpwdt: Exclude via blacklist Jerry Hoemann
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jerry Hoemann @ 2018-12-06  0:42 UTC (permalink / raw)
  To: linux; +Cc: wim, linux-watchdog, linux-kernel, Jerry Hoemann

hpwdt driver isn't supported on all iLO hardware.


Changes in version 2:
1) Instead of having explicit if statement to check device IDs,
   provide a pci_device_id table of devices to blacklist.
2) Convert the current instance where SSID 0x1979 was being skipped.
3) Add new patch to add SSID 0x0289 to the blacklist table.
4) Print via dev_dbg instead of dev_info.


Jerry Hoemann (3):
  watchdog/hpwdt: Exclude via blacklist
  watchdog/hpwdt: Do not claim unsupported hardware
  watchdog/hpwdt: Update driver version.

 drivers/watchdog/hpwdt.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

-- 
1.8.3.1

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

* [PATCH v2 1/3] watchdog/hpwdt: Exclude via blacklist
  2018-12-06  0:42 [PATCH v2 0/3] watchdog/hpwdt: Do not claim on unsupported hardware Jerry Hoemann
@ 2018-12-06  0:42 ` Jerry Hoemann
  2018-12-06 17:57   ` Guenter Roeck
  2018-12-06  0:42 ` [PATCH v2 2/3] watchdog/hpwdt: Do not claim unsupported hardware Jerry Hoemann
  2018-12-06  0:42 ` [PATCH v2 3/3] watchdog/hpwdt: Update driver version Jerry Hoemann
  2 siblings, 1 reply; 7+ messages in thread
From: Jerry Hoemann @ 2018-12-06  0:42 UTC (permalink / raw)
  To: linux; +Cc: wim, linux-watchdog, linux-kernel, Jerry Hoemann

Instead of having explicit if statments excluding devices,
use a pci_device_id table of devices to blacklist.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
---
 drivers/watchdog/hpwdt.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 9356230..eecd014 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -50,6 +50,10 @@
 };
 MODULE_DEVICE_TABLE(pci, hpwdt_devices);
 
+static const struct pci_device_id hpwdt_blacklist[] = {
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_HP, 0x3306, PCI_VENDOR_ID_HP, 0x1979) }, /* auxilary iLO */
+	{0},			/* terminate list */
+};
 
 /*
  *	Watchdog operations
@@ -274,12 +278,10 @@ static int hpwdt_init_one(struct pci_dev *dev,
 		return -ENODEV;
 	}
 
-	/*
-	 * Ignore all auxilary iLO devices with the following PCI ID
-	 */
-	if (dev->subsystem_vendor == PCI_VENDOR_ID_HP &&
-	    dev->subsystem_device == 0x1979)
+	if (pci_match_id(hpwdt_blacklist, dev)) {
+		dev_dbg(&dev->dev, "Not supported on this device\n");
 		return -ENODEV;
+	}
 
 	if (pci_enable_device(dev)) {
 		dev_warn(&dev->dev,
-- 
1.8.3.1

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

* [PATCH v2 2/3] watchdog/hpwdt: Do not claim unsupported hardware
  2018-12-06  0:42 [PATCH v2 0/3] watchdog/hpwdt: Do not claim on unsupported hardware Jerry Hoemann
  2018-12-06  0:42 ` [PATCH v2 1/3] watchdog/hpwdt: Exclude via blacklist Jerry Hoemann
@ 2018-12-06  0:42 ` Jerry Hoemann
  2018-12-06 17:57   ` Guenter Roeck
  2018-12-06  0:42 ` [PATCH v2 3/3] watchdog/hpwdt: Update driver version Jerry Hoemann
  2 siblings, 1 reply; 7+ messages in thread
From: Jerry Hoemann @ 2018-12-06  0:42 UTC (permalink / raw)
  To: linux; +Cc: wim, linux-watchdog, linux-kernel, Jerry Hoemann

Do not claim when SSID 0x0289 as the watchdog features
are not enabled/validated by the firmware.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
---
 drivers/watchdog/hpwdt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index eecd014..c8e8055 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -52,6 +52,7 @@
 
 static const struct pci_device_id hpwdt_blacklist[] = {
 	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_HP, 0x3306, PCI_VENDOR_ID_HP, 0x1979) }, /* auxilary iLO */
+	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_HP, 0x3306, PCI_VENDOR_ID_HP_3PAR, 0x0289) },  /* CL */
 	{0},			/* terminate list */
 };
 
-- 
1.8.3.1

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

* [PATCH v2 3/3] watchdog/hpwdt: Update driver version.
  2018-12-06  0:42 [PATCH v2 0/3] watchdog/hpwdt: Do not claim on unsupported hardware Jerry Hoemann
  2018-12-06  0:42 ` [PATCH v2 1/3] watchdog/hpwdt: Exclude via blacklist Jerry Hoemann
  2018-12-06  0:42 ` [PATCH v2 2/3] watchdog/hpwdt: Do not claim unsupported hardware Jerry Hoemann
@ 2018-12-06  0:42 ` Jerry Hoemann
  2018-12-06 17:57   ` Guenter Roeck
  2 siblings, 1 reply; 7+ messages in thread
From: Jerry Hoemann @ 2018-12-06  0:42 UTC (permalink / raw)
  To: linux; +Cc: wim, linux-watchdog, linux-kernel, Jerry Hoemann

Bump version number to reflect recent minor changes.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
---
 drivers/watchdog/hpwdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index c8e8055..ef30c7e 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -26,7 +26,7 @@
 #include <linux/watchdog.h>
 #include <asm/nmi.h>
 
-#define HPWDT_VERSION			"2.0.1"
+#define HPWDT_VERSION			"2.0.2"
 #define SECS_TO_TICKS(secs)		((secs) * 1000 / 128)
 #define TICKS_TO_SECS(ticks)		((ticks) * 128 / 1000)
 #define HPWDT_MAX_TIMER			TICKS_TO_SECS(65535)
-- 
1.8.3.1

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

* Re: [PATCH v2 1/3] watchdog/hpwdt: Exclude via blacklist
  2018-12-06  0:42 ` [PATCH v2 1/3] watchdog/hpwdt: Exclude via blacklist Jerry Hoemann
@ 2018-12-06 17:57   ` Guenter Roeck
  0 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2018-12-06 17:57 UTC (permalink / raw)
  To: Jerry Hoemann; +Cc: wim, linux-watchdog, linux-kernel

On Wed, Dec 05, 2018 at 05:42:21PM -0700, Jerry Hoemann wrote:
> Instead of having explicit if statments excluding devices,
> use a pci_device_id table of devices to blacklist.
> 
> Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/hpwdt.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
> index 9356230..eecd014 100644
> --- a/drivers/watchdog/hpwdt.c
> +++ b/drivers/watchdog/hpwdt.c
> @@ -50,6 +50,10 @@
>  };
>  MODULE_DEVICE_TABLE(pci, hpwdt_devices);
>  
> +static const struct pci_device_id hpwdt_blacklist[] = {
> +	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_HP, 0x3306, PCI_VENDOR_ID_HP, 0x1979) }, /* auxilary iLO */
> +	{0},			/* terminate list */
> +};
>  
>  /*
>   *	Watchdog operations
> @@ -274,12 +278,10 @@ static int hpwdt_init_one(struct pci_dev *dev,
>  		return -ENODEV;
>  	}
>  
> -	/*
> -	 * Ignore all auxilary iLO devices with the following PCI ID
> -	 */
> -	if (dev->subsystem_vendor == PCI_VENDOR_ID_HP &&
> -	    dev->subsystem_device == 0x1979)
> +	if (pci_match_id(hpwdt_blacklist, dev)) {
> +		dev_dbg(&dev->dev, "Not supported on this device\n");
>  		return -ENODEV;
> +	}
>  
>  	if (pci_enable_device(dev)) {
>  		dev_warn(&dev->dev,
> -- 
> 1.8.3.1
> 

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

* Re: [PATCH v2 2/3] watchdog/hpwdt: Do not claim unsupported hardware
  2018-12-06  0:42 ` [PATCH v2 2/3] watchdog/hpwdt: Do not claim unsupported hardware Jerry Hoemann
@ 2018-12-06 17:57   ` Guenter Roeck
  0 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2018-12-06 17:57 UTC (permalink / raw)
  To: Jerry Hoemann; +Cc: wim, linux-watchdog, linux-kernel

On Wed, Dec 05, 2018 at 05:42:22PM -0700, Jerry Hoemann wrote:
> Do not claim when SSID 0x0289 as the watchdog features
> are not enabled/validated by the firmware.
> 
> Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/hpwdt.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
> index eecd014..c8e8055 100644
> --- a/drivers/watchdog/hpwdt.c
> +++ b/drivers/watchdog/hpwdt.c
> @@ -52,6 +52,7 @@
>  
>  static const struct pci_device_id hpwdt_blacklist[] = {
>  	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_HP, 0x3306, PCI_VENDOR_ID_HP, 0x1979) }, /* auxilary iLO */
> +	{ PCI_DEVICE_SUB(PCI_VENDOR_ID_HP, 0x3306, PCI_VENDOR_ID_HP_3PAR, 0x0289) },  /* CL */
>  	{0},			/* terminate list */
>  };
>  
> -- 
> 1.8.3.1
> 

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

* Re: [PATCH v2 3/3] watchdog/hpwdt: Update driver version.
  2018-12-06  0:42 ` [PATCH v2 3/3] watchdog/hpwdt: Update driver version Jerry Hoemann
@ 2018-12-06 17:57   ` Guenter Roeck
  0 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2018-12-06 17:57 UTC (permalink / raw)
  To: Jerry Hoemann; +Cc: wim, linux-watchdog, linux-kernel

On Wed, Dec 05, 2018 at 05:42:23PM -0700, Jerry Hoemann wrote:
> Bump version number to reflect recent minor changes.
> 
> Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/hpwdt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
> index c8e8055..ef30c7e 100644
> --- a/drivers/watchdog/hpwdt.c
> +++ b/drivers/watchdog/hpwdt.c
> @@ -26,7 +26,7 @@
>  #include <linux/watchdog.h>
>  #include <asm/nmi.h>
>  
> -#define HPWDT_VERSION			"2.0.1"
> +#define HPWDT_VERSION			"2.0.2"
>  #define SECS_TO_TICKS(secs)		((secs) * 1000 / 128)
>  #define TICKS_TO_SECS(ticks)		((ticks) * 128 / 1000)
>  #define HPWDT_MAX_TIMER			TICKS_TO_SECS(65535)
> -- 
> 1.8.3.1
> 

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

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-06  0:42 [PATCH v2 0/3] watchdog/hpwdt: Do not claim on unsupported hardware Jerry Hoemann
2018-12-06  0:42 ` [PATCH v2 1/3] watchdog/hpwdt: Exclude via blacklist Jerry Hoemann
2018-12-06 17:57   ` Guenter Roeck
2018-12-06  0:42 ` [PATCH v2 2/3] watchdog/hpwdt: Do not claim unsupported hardware Jerry Hoemann
2018-12-06 17:57   ` Guenter Roeck
2018-12-06  0:42 ` [PATCH v2 3/3] watchdog/hpwdt: Update driver version Jerry Hoemann
2018-12-06 17:57   ` Guenter Roeck

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org linux-watchdog@archiver.kernel.org
	public-inbox-index linux-watchdog


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/ public-inbox