2021-01-28 17:41:42

by David E. Box

[permalink] [raw]
Subject: [PATCH] MFD: intel_pmt: Fix nuisance messages and handling of disabled capabilities

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


2021-02-02 22:24:42

by Hans de Goede

[permalink] [raw]
Subject: Re: [PATCH] MFD: intel_pmt: Fix nuisance messages and handling of disabled capabilities

Hi,

On 1/28/21 6:28 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 <[email protected]>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <[email protected]>

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

2021-02-24 20:18:18

by David E. Box

[permalink] [raw]
Subject: [PATCH V2 1/2] MFD: intel_pmt: Fix nuisance messages and handling of disabled capabilities

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 <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
---
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(-)

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

2021-02-25 03:25:28

by Hans de Goede

[permalink] [raw]
Subject: Re: [PATCH V2 1/2] MFD: intel_pmt: Fix nuisance messages and handling of disabled capabilities

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 <[email protected]>
> Reviewed-by: Hans de Goede <[email protected]>
> ---
> 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 <[email protected]>

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
>

2021-02-25 04:17:05

by David E. Box

[permalink] [raw]
Subject: Re: [PATCH V2 1/2] MFD: intel_pmt: Fix nuisance messages and handling of disabled capabilities

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 <[email protected]>
> > Reviewed-by: Hans de Goede <[email protected]>
> > ---
> > 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 <[email protected]>
>
> 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
> >
>


2021-03-09 18:16:20

by Lee Jones

[permalink] [raw]
Subject: [GIT PULL] Immutable branch between MFD and Platform/X86 due for the v5.13 merge window

Enjoy!

The following changes since commit fe07bfda2fb9cdef8a4d4008a409bb02f35f1bd8:

Linux 5.12-rc1 (2021-02-28 16:05:19 -0800)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-platform-x86-v5.13

for you to fetch changes up to ccafe3126ad3f48ea1cd9ae460c69d1ba879fb65:

mfd: intel_pmt: Add support for DG1 (2021-03-09 17:05:25 +0000)

----------------------------------------------------------------
Immutable branch between MFD and Platform/X86 due for the v5.13 merge window

----------------------------------------------------------------
David E. Box (2):
mfd: intel_pmt: Fix nuisance messages and handling of disabled capabilities
mfd: intel_pmt: Add support for DG1

drivers/mfd/intel_pmt.c | 112 +++++++++++++++++++----------
drivers/platform/x86/intel_pmt_class.c | 46 ++++++++++++
drivers/platform/x86/intel_pmt_class.h | 1 +
drivers/platform/x86/intel_pmt_telemetry.c | 20 ------
4 files changed, 122 insertions(+), 57 deletions(-)

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2021-03-09 19:03:31

by Hans de Goede

[permalink] [raw]
Subject: Re: [GIT PULL] Immutable branch between MFD and Platform/X86 due for the v5.13 merge window

Hi Lee,

On 3/9/21 7:12 PM, Lee Jones wrote:
> Enjoy!
>
> The following changes since commit fe07bfda2fb9cdef8a4d4008a409bb02f35f1bd8:
>
> Linux 5.12-rc1 (2021-02-28 16:05:19 -0800)

I thought we were supposed to avoid using 5.12-rc1 as a base to avoid people
hitting the swapfile related disk-corruption when bisecting?

See: https://lwn.net/Articles/848431/

So it might be better to redo this branch with 5.12-rc2 as a base ?

Regards,

Hans


>
> are available in the Git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-platform-x86-v5.13
>
> for you to fetch changes up to ccafe3126ad3f48ea1cd9ae460c69d1ba879fb65:
>
> mfd: intel_pmt: Add support for DG1 (2021-03-09 17:05:25 +0000)
>
> ----------------------------------------------------------------
> Immutable branch between MFD and Platform/X86 due for the v5.13 merge window
>
> ----------------------------------------------------------------
> David E. Box (2):
> mfd: intel_pmt: Fix nuisance messages and handling of disabled capabilities
> mfd: intel_pmt: Add support for DG1
>
> drivers/mfd/intel_pmt.c | 112 +++++++++++++++++++----------
> drivers/platform/x86/intel_pmt_class.c | 46 ++++++++++++
> drivers/platform/x86/intel_pmt_class.h | 1 +
> drivers/platform/x86/intel_pmt_telemetry.c | 20 ------
> 4 files changed, 122 insertions(+), 57 deletions(-)
>

2021-03-09 19:20:46

by Lee Jones

[permalink] [raw]
Subject: Re: [GIT PULL] Immutable branch between MFD and Platform/X86 due for the v5.13 merge window

On Tue, 09 Mar 2021, Hans de Goede wrote:

> Hi Lee,
>
> On 3/9/21 7:12 PM, Lee Jones wrote:
> > Enjoy!
> >
> > The following changes since commit fe07bfda2fb9cdef8a4d4008a409bb02f35f1bd8:
> >
> > Linux 5.12-rc1 (2021-02-28 16:05:19 -0800)
>
> I thought we were supposed to avoid using 5.12-rc1 as a base to avoid people
> hitting the swapfile related disk-corruption when bisecting?
>
> See: https://lwn.net/Articles/848431/

Interesting. First I'd heard of it.

> So it might be better to redo this branch with 5.12-rc2 as a base ?

I already have 3 immutable branches based on -rc1.

Will need to look further into this to see what I can do.

Please bear with me.

> > are available in the Git repository at:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-platform-x86-v5.13
> >
> > for you to fetch changes up to ccafe3126ad3f48ea1cd9ae460c69d1ba879fb65:
> >
> > mfd: intel_pmt: Add support for DG1 (2021-03-09 17:05:25 +0000)
> >
> > ----------------------------------------------------------------
> > Immutable branch between MFD and Platform/X86 due for the v5.13 merge window
> >
> > ----------------------------------------------------------------
> > David E. Box (2):
> > mfd: intel_pmt: Fix nuisance messages and handling of disabled capabilities
> > mfd: intel_pmt: Add support for DG1
> >
> > drivers/mfd/intel_pmt.c | 112 +++++++++++++++++++----------
> > drivers/platform/x86/intel_pmt_class.c | 46 ++++++++++++
> > drivers/platform/x86/intel_pmt_class.h | 1 +
> > drivers/platform/x86/intel_pmt_telemetry.c | 20 ------
> > 4 files changed, 122 insertions(+), 57 deletions(-)
> >
>

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2021-03-09 20:09:29

by Lee Jones

[permalink] [raw]
Subject: Re: [GIT PULL] Immutable branch between MFD and Platform/X86 due for the v5.13 merge window

On Tue, 09 Mar 2021, Lee Jones wrote:

> On Tue, 09 Mar 2021, Hans de Goede wrote:
>
> > Hi Lee,
> >
> > On 3/9/21 7:12 PM, Lee Jones wrote:
> > > Enjoy!
> > >
> > > The following changes since commit fe07bfda2fb9cdef8a4d4008a409bb02f35f1bd8:
> > >
> > > Linux 5.12-rc1 (2021-02-28 16:05:19 -0800)
> >
> > I thought we were supposed to avoid using 5.12-rc1 as a base to avoid people
> > hitting the swapfile related disk-corruption when bisecting?
> >
> > See: https://lwn.net/Articles/848431/
>
> Interesting. First I'd heard of it.
>
> > So it might be better to redo this branch with 5.12-rc2 as a base ?
>
> I already have 3 immutable branches based on -rc1.
>
> Will need to look further into this to see what I can do.
>
> Please bear with me.

Okay, discard this one. I'll do another first thing.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2021-03-10 10:58:58

by Lee Jones

[permalink] [raw]
Subject: [GIT PULL v2] Immutable branch between MFD and Platform/X86 due for the v5.13 merge window

Rebased onto -rc2

The following changes since commit a38fd8748464831584a19438cbb3082b5a2dab15:

Linux 5.12-rc2 (2021-03-05 17:33:41 -0800)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-platform-x86-v5.13

for you to fetch changes up to aa47ad3f853ae72c32b7e46dfc8bc2c8dc2dbad7:

mfd: intel_pmt: Add support for DG1 (2021-03-10 10:48:48 +0000)

----------------------------------------------------------------
Immutable branch between MFD and Platform/x86 due for the v5.13 merge window

----------------------------------------------------------------
David E. Box (2):
mfd: intel_pmt: Fix nuisance messages and handling of disabled capabilities
mfd: intel_pmt: Add support for DG1

drivers/mfd/intel_pmt.c | 112 +++++++++++++++++++----------
drivers/platform/x86/intel_pmt_class.c | 46 ++++++++++++
drivers/platform/x86/intel_pmt_class.h | 1 +
drivers/platform/x86/intel_pmt_telemetry.c | 20 ------
4 files changed, 122 insertions(+), 57 deletions(-)

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2021-03-18 11:03:59

by Hans de Goede

[permalink] [raw]
Subject: Re: [GIT PULL v2] Immutable branch between MFD and Platform/X86 due for the v5.13 merge window

Hi,

On 3/10/21 11:57 AM, Lee Jones wrote:
> Rebased onto -rc2
>
> The following changes since commit a38fd8748464831584a19438cbb3082b5a2dab15:
>
> Linux 5.12-rc2 (2021-03-05 17:33:41 -0800)
>
> are available in the Git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-platform-x86-v5.13
>
> for you to fetch changes up to aa47ad3f853ae72c32b7e46dfc8bc2c8dc2dbad7:
>
> mfd: intel_pmt: Add support for DG1 (2021-03-10 10:48:48 +0000)
>
> ----------------------------------------------------------------
> Immutable branch between MFD and Platform/x86 due for the v5.13 merge window

Thank you, I've merged this into my review-hans branch now, so this will
soon be in pdx86/for-next.

Regards,

Hans