Linux-Watchdog Archive on lore.kernel.org
 help / Atom feed
* [PATCH 1/1] watchdog/hpwdt: Do not claim unsupported hardware
@ 2018-12-05  2:22 Jerry Hoemann
  2018-12-05  2:47 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Jerry Hoemann @ 2018-12-05  2:22 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 | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 9356230..b99ef0a4 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -281,6 +281,17 @@ static int hpwdt_init_one(struct pci_dev *dev,
 	    dev->subsystem_device == 0x1979)
 		return -ENODEV;
 
+	/*
+	 * Ignore unsupported hardware
+	 */
+	if (dev->vendor == PCI_VENDOR_ID_HP &&
+	    dev->device == 0x3306 &&
+	    dev->subsystem_vendor == PCI_VENDOR_ID_HP_3PAR &&
+	    dev->subsystem_device == 0x0289) {
+		dev_info(&dev->dev, "Not supported on this platform\n");
+		return -ENODEV;
+	}
+
 	if (pci_enable_device(dev)) {
 		dev_warn(&dev->dev,
 			"Not possible to enable PCI Device: 0x%x:0x%x.\n",
-- 
1.8.3.1

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

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

On 12/4/18 6:22 PM, 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>
> ---
>   drivers/watchdog/hpwdt.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
> index 9356230..b99ef0a4 100644
> --- a/drivers/watchdog/hpwdt.c
> +++ b/drivers/watchdog/hpwdt.c
> @@ -281,6 +281,17 @@ static int hpwdt_init_one(struct pci_dev *dev,
>   	    dev->subsystem_device == 0x1979)
>   		return -ENODEV;
>   
> +	/*
> +	 * Ignore unsupported hardware
> +	 */
> +	if (dev->vendor == PCI_VENDOR_ID_HP &&
> +	    dev->device == 0x3306 &&
> +	    dev->subsystem_vendor == PCI_VENDOR_ID_HP_3PAR &&
> +	    dev->subsystem_device == 0x0289) {
> +		dev_info(&dev->dev, "Not supported on this platform\n");
> +		return -ENODEV;
> +	}
> +

Please use a pci_device_id table with PCI_DEVICE_SUB() to create
a blacklist, and pci_match_id() to match against it.

Thanks,
Guenter

>   	if (pci_enable_device(dev)) {
>   		dev_warn(&dev->dev,
>   			"Not possible to enable PCI Device: 0x%x:0x%x.\n",
> 

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05  2:22 [PATCH 1/1] watchdog/hpwdt: Do not claim unsupported hardware Jerry Hoemann
2018-12-05  2:47 ` 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