2018-12-06 00:44:48

by Jerry Hoemann

[permalink] [raw]
Subject: [PATCH v2 0/3] watchdog/hpwdt: Do not claim on unsupported hardware

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



2018-12-06 00:43:46

by Jerry Hoemann

[permalink] [raw]
Subject: [PATCH v2 1/3] watchdog/hpwdt: Exclude via blacklist

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

Signed-off-by: Jerry Hoemann <[email protected]>
---
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


2018-12-06 00:44:17

by Jerry Hoemann

[permalink] [raw]
Subject: [PATCH v2 3/3] watchdog/hpwdt: Update driver version.

Bump version number to reflect recent minor changes.

Signed-off-by: Jerry Hoemann <[email protected]>
---
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


2018-12-06 00:45:04

by Jerry Hoemann

[permalink] [raw]
Subject: [PATCH v2 2/3] watchdog/hpwdt: Do not claim unsupported hardware

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

Signed-off-by: Jerry Hoemann <[email protected]>
---
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


2018-12-06 17:58:29

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] watchdog/hpwdt: Exclude via blacklist

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 <[email protected]>

Reviewed-by: Guenter Roeck <[email protected]>

> ---
> 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
>

2018-12-06 17:58:53

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] watchdog/hpwdt: Do not claim unsupported hardware

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 <[email protected]>

Reviewed-by: Guenter Roeck <[email protected]>

> ---
> 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
>

2018-12-06 18:00:33

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] watchdog/hpwdt: Update driver version.

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 <[email protected]>

Reviewed-by: Guenter Roeck <[email protected]>

> ---
> 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
>