[V2,1/2] MFD: intel_pmt: Fix nuisance messages and handling of disabled capabilities
diff mbox series

Message ID 20210224201005.1034005-1-david.e.box@linux.intel.com
State New, archived
Headers show
Series
  • [V2,1/2] MFD: intel_pmt: Fix nuisance messages and handling of disabled capabilities
Related show

Commit Message

David E. Box Feb. 24, 2021, 8:10 p.m. UTC
Some products will be available that have PMT capabilities that are not
supported. Remove the warnings in this instance to avoid nuisance messages
and confusion.

Also return an error code for capabilities that are disabled by quirk to
prevent them from keeping the driver loaded if only disabled capabilities
are found.

Fixes: 4f8217d5b0ca ("mfd: Intel Platform Monitoring Technology support")
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
For merge in platform-drivers-x86

Based on 5.11-rc1 review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Changes from V1:

	- None. Patch 2 added.

 drivers/mfd/intel_pmt.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)


base-commit: a7d53dbbc70a81d5781da7fc905b656f41ad2381

Comments

Hans de Goede Feb. 24, 2021, 8:22 p.m. UTC | #1
Hi,

On 2/24/21 9:10 PM, David E. Box wrote:
> Some products will be available that have PMT capabilities that are not
> supported. Remove the warnings in this instance to avoid nuisance messages
> and confusion.
> 
> Also return an error code for capabilities that are disabled by quirk to
> prevent them from keeping the driver loaded if only disabled capabilities
> are found.
> 
> Fixes: 4f8217d5b0ca ("mfd: Intel Platform Monitoring Technology support")
> Signed-off-by: David E. Box <david.e.box@linux.intel.com>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> ---
> For merge in platform-drivers-x86
> 
> Based on 5.11-rc1 review-hans branch:
> https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Which, assuming you did a git remote update recently is AKA platform-drivers-x86-v5.12-1 .

> Changes from V1:
> 
> 	- None. Patch 2 added.

The series looks good to me, so for the series:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Lee, since both patches touch mfd files (and patch 2 also touches files under drivers/platform/x86)
I think it would be best if you just merge the entire series.

As always I would appreciate a pull-req from you to also pull the changes
into my tree, in case further drivers/platform/x86/intel_pmt* changes
show up during this cycle.

Regards,

Hans






> 
>  drivers/mfd/intel_pmt.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/mfd/intel_pmt.c b/drivers/mfd/intel_pmt.c
> index 744b230cdcca..65da2b17a204 100644
> --- a/drivers/mfd/intel_pmt.c
> +++ b/drivers/mfd/intel_pmt.c
> @@ -79,19 +79,18 @@ static int pmt_add_dev(struct pci_dev *pdev, struct intel_dvsec_header *header,
>  	case DVSEC_INTEL_ID_WATCHER:
>  		if (quirks & PMT_QUIRK_NO_WATCHER) {
>  			dev_info(dev, "Watcher not supported\n");
> -			return 0;
> +			return -EINVAL;
>  		}
>  		name = "pmt_watcher";
>  		break;
>  	case DVSEC_INTEL_ID_CRASHLOG:
>  		if (quirks & PMT_QUIRK_NO_CRASHLOG) {
>  			dev_info(dev, "Crashlog not supported\n");
> -			return 0;
> +			return -EINVAL;
>  		}
>  		name = "pmt_crashlog";
>  		break;
>  	default:
> -		dev_err(dev, "Unrecognized PMT capability: %d\n", id);
>  		return -EINVAL;
>  	}
>  
> @@ -174,12 +173,8 @@ static int pmt_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  		header.offset = INTEL_DVSEC_TABLE_OFFSET(table);
>  
>  		ret = pmt_add_dev(pdev, &header, quirks);
> -		if (ret) {
> -			dev_warn(&pdev->dev,
> -				 "Failed to add device for DVSEC id %d\n",
> -				 header.id);
> +		if (ret)
>  			continue;
> -		}
>  
>  		found_devices = true;
>  	} while (true);
> 
> base-commit: a7d53dbbc70a81d5781da7fc905b656f41ad2381
>
David E. Box Feb. 24, 2021, 11:01 p.m. UTC | #2
On Wed, 2021-02-24 at 21:22 +0100, Hans de Goede wrote:
> Hi,
> 
> On 2/24/21 9:10 PM, David E. Box wrote:
> > Some products will be available that have PMT capabilities that are
> > not
> > supported. Remove the warnings in this instance to avoid nuisance
> > messages
> > and confusion.
> > 
> > Also return an error code for capabilities that are disabled by
> > quirk to
> > prevent them from keeping the driver loaded if only disabled
> > capabilities
> > are found.
> > 
> > Fixes: 4f8217d5b0ca ("mfd: Intel Platform Monitoring Technology
> > support")
> > Signed-off-by: David E. Box <david.e.box@linux.intel.com>
> > Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> > ---
> > For merge in platform-drivers-x86
> > 
> > Based on 5.11-rc1 review-hans branch:
> > https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
> 
> Which, assuming you did a git remote update recently is AKA platform-
> drivers-x86-v5.12-1 .

That it is.

> 
> > Changes from V1:
> > 
> >         - None. Patch 2 added.
> 
> The series looks good to me, so for the series:
> 
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> 
> Lee, since both patches touch mfd files (and patch 2 also touches
> files under drivers/platform/x86)
> I think it would be best if you just merge the entire series.

Ack

David

> 
> As always I would appreciate a pull-req from you to also pull the
> changes
> into my tree, in case further drivers/platform/x86/intel_pmt* changes
> show up during this cycle.
> 
> Regards,
> 
> Hans
> 
> 
> 
> 
> 
> 
> > 
> >  drivers/mfd/intel_pmt.c | 11 +++--------
> >  1 file changed, 3 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/mfd/intel_pmt.c b/drivers/mfd/intel_pmt.c
> > index 744b230cdcca..65da2b17a204 100644
> > --- a/drivers/mfd/intel_pmt.c
> > +++ b/drivers/mfd/intel_pmt.c
> > @@ -79,19 +79,18 @@ static int pmt_add_dev(struct pci_dev *pdev,
> > struct intel_dvsec_header *header,
> >         case DVSEC_INTEL_ID_WATCHER:
> >                 if (quirks & PMT_QUIRK_NO_WATCHER) {
> >                         dev_info(dev, "Watcher not supported\n");
> > -                       return 0;
> > +                       return -EINVAL;
> >                 }
> >                 name = "pmt_watcher";
> >                 break;
> >         case DVSEC_INTEL_ID_CRASHLOG:
> >                 if (quirks & PMT_QUIRK_NO_CRASHLOG) {
> >                         dev_info(dev, "Crashlog not supported\n");
> > -                       return 0;
> > +                       return -EINVAL;
> >                 }
> >                 name = "pmt_crashlog";
> >                 break;
> >         default:
> > -               dev_err(dev, "Unrecognized PMT capability: %d\n",
> > id);
> >                 return -EINVAL;
> >         }
> >  
> > @@ -174,12 +173,8 @@ static int pmt_pci_probe(struct pci_dev *pdev,
> > const struct pci_device_id *id)
> >                 header.offset = INTEL_DVSEC_TABLE_OFFSET(table);
> >  
> >                 ret = pmt_add_dev(pdev, &header, quirks);
> > -               if (ret) {
> > -                       dev_warn(&pdev->dev,
> > -                                "Failed to add device for DVSEC id
> > %d\n",
> > -                                header.id);
> > +               if (ret)
> >                         continue;
> > -               }
> >  
> >                 found_devices = true;
> >         } while (true);
> > 
> > base-commit: a7d53dbbc70a81d5781da7fc905b656f41ad2381
> > 
>

Patch
diff mbox series

diff --git a/drivers/mfd/intel_pmt.c b/drivers/mfd/intel_pmt.c
index 744b230cdcca..65da2b17a204 100644
--- a/drivers/mfd/intel_pmt.c
+++ b/drivers/mfd/intel_pmt.c
@@ -79,19 +79,18 @@  static int pmt_add_dev(struct pci_dev *pdev, struct intel_dvsec_header *header,
 	case DVSEC_INTEL_ID_WATCHER:
 		if (quirks & PMT_QUIRK_NO_WATCHER) {
 			dev_info(dev, "Watcher not supported\n");
-			return 0;
+			return -EINVAL;
 		}
 		name = "pmt_watcher";
 		break;
 	case DVSEC_INTEL_ID_CRASHLOG:
 		if (quirks & PMT_QUIRK_NO_CRASHLOG) {
 			dev_info(dev, "Crashlog not supported\n");
-			return 0;
+			return -EINVAL;
 		}
 		name = "pmt_crashlog";
 		break;
 	default:
-		dev_err(dev, "Unrecognized PMT capability: %d\n", id);
 		return -EINVAL;
 	}
 
@@ -174,12 +173,8 @@  static int pmt_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		header.offset = INTEL_DVSEC_TABLE_OFFSET(table);
 
 		ret = pmt_add_dev(pdev, &header, quirks);
-		if (ret) {
-			dev_warn(&pdev->dev,
-				 "Failed to add device for DVSEC id %d\n",
-				 header.id);
+		if (ret)
 			continue;
-		}
 
 		found_devices = true;
 	} while (true);