2020-09-11 19:47:29

by David E. Box

[permalink] [raw]
Subject: [PATCH 1/3] mfd: intel_pmt: Add OOBMSM device ID

Add Out of Band Management Services Module device ID to Intel PMT driver.

Signed-off-by: Alexander Duyck <[email protected]>
Signed-off-by: David E. Box <[email protected]>
---
drivers/mfd/intel_pmt.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/mfd/intel_pmt.c b/drivers/mfd/intel_pmt.c
index 0e572b105101..8f9970ab3026 100644
--- a/drivers/mfd/intel_pmt.c
+++ b/drivers/mfd/intel_pmt.c
@@ -55,6 +55,8 @@ struct pmt_platform_info {
unsigned long quirks;
};

+static const struct pmt_platform_info pmt_info;
+
static const struct pmt_platform_info tgl_info = {
.quirks = PMT_QUIRK_NO_WATCHER | PMT_QUIRK_NO_CRASHLOG |
PMT_QUIRK_TABLE_SHIFT,
@@ -200,8 +202,10 @@ static void pmt_pci_remove(struct pci_dev *pdev)
pm_runtime_get_sync(&pdev->dev);
}

+#define PCI_DEVICE_ID_INTEL_PMT_OOBMSM 0x09a7
#define PCI_DEVICE_ID_INTEL_PMT_TGL 0x9a0d
static const struct pci_device_id pmt_pci_ids[] = {
+ { PCI_DEVICE_DATA(INTEL, PMT_OOBMSM, &pmt_info) },
{ PCI_DEVICE_DATA(INTEL, PMT_TGL, &tgl_info) },
{ }
};
--
2.20.1


2020-09-14 13:08:49

by Hans de Goede

[permalink] [raw]
Subject: Re: [PATCH 1/3] mfd: intel_pmt: Add OOBMSM device ID

Hi,

On 9/11/20 9:45 PM, David E. Box wrote:
> Add Out of Band Management Services Module device ID to Intel PMT driver.
>
> Signed-off-by: Alexander Duyck <[email protected]>
> Signed-off-by: David E. Box <[email protected]>

Looks good to me:

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

Lee, I expect you will pick this-one up (and the next also) ?

Regards,

Hans

> ---
> drivers/mfd/intel_pmt.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/mfd/intel_pmt.c b/drivers/mfd/intel_pmt.c
> index 0e572b105101..8f9970ab3026 100644
> --- a/drivers/mfd/intel_pmt.c
> +++ b/drivers/mfd/intel_pmt.c
> @@ -55,6 +55,8 @@ struct pmt_platform_info {
> unsigned long quirks;
> };
>
> +static const struct pmt_platform_info pmt_info;
> +
> static const struct pmt_platform_info tgl_info = {
> .quirks = PMT_QUIRK_NO_WATCHER | PMT_QUIRK_NO_CRASHLOG |
> PMT_QUIRK_TABLE_SHIFT,
> @@ -200,8 +202,10 @@ static void pmt_pci_remove(struct pci_dev *pdev)
> pm_runtime_get_sync(&pdev->dev);
> }
>
> +#define PCI_DEVICE_ID_INTEL_PMT_OOBMSM 0x09a7
> #define PCI_DEVICE_ID_INTEL_PMT_TGL 0x9a0d
> static const struct pci_device_id pmt_pci_ids[] = {
> + { PCI_DEVICE_DATA(INTEL, PMT_OOBMSM, &pmt_info) },
> { PCI_DEVICE_DATA(INTEL, PMT_TGL, &tgl_info) },
> { }
> };
>

2020-09-29 09:52:41

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 1/3] mfd: intel_pmt: Add OOBMSM device ID

On Fri, 11 Sep 2020, David E. Box wrote:

> Add Out of Band Management Services Module device ID to Intel PMT driver.
>
> Signed-off-by: Alexander Duyck <[email protected]>
> Signed-off-by: David E. Box <[email protected]>
> ---
> drivers/mfd/intel_pmt.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/mfd/intel_pmt.c b/drivers/mfd/intel_pmt.c
> index 0e572b105101..8f9970ab3026 100644
> --- a/drivers/mfd/intel_pmt.c
> +++ b/drivers/mfd/intel_pmt.c
> @@ -55,6 +55,8 @@ struct pmt_platform_info {
> unsigned long quirks;
> };
>
> +static const struct pmt_platform_info pmt_info;
> +
> static const struct pmt_platform_info tgl_info = {
> .quirks = PMT_QUIRK_NO_WATCHER | PMT_QUIRK_NO_CRASHLOG |
> PMT_QUIRK_TABLE_SHIFT,
> @@ -200,8 +202,10 @@ static void pmt_pci_remove(struct pci_dev *pdev)
> pm_runtime_get_sync(&pdev->dev);
> }
>
> +#define PCI_DEVICE_ID_INTEL_PMT_OOBMSM 0x09a7
> #define PCI_DEVICE_ID_INTEL_PMT_TGL 0x9a0d
> static const struct pci_device_id pmt_pci_ids[] = {
> + { PCI_DEVICE_DATA(INTEL, PMT_OOBMSM, &pmt_info) },

Why are you supplying an empty struct?

> { PCI_DEVICE_DATA(INTEL, PMT_TGL, &tgl_info) },
> { }
> };

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

2020-09-29 18:21:18

by David E. Box

[permalink] [raw]
Subject: Re: [PATCH 1/3] mfd: intel_pmt: Add OOBMSM device ID

On Tue, 2020-09-29 at 10:51 +0100, Lee Jones wrote:
> On Fri, 11 Sep 2020, David E. Box wrote:
>
> > Add Out of Band Management Services Module device ID to Intel PMT
> > driver.
> >
> > Signed-off-by: Alexander Duyck <[email protected]>
> > Signed-off-by: David E. Box <[email protected]>
> > ---
> > drivers/mfd/intel_pmt.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/mfd/intel_pmt.c b/drivers/mfd/intel_pmt.c
> > index 0e572b105101..8f9970ab3026 100644
> > --- a/drivers/mfd/intel_pmt.c
> > +++ b/drivers/mfd/intel_pmt.c
> > @@ -55,6 +55,8 @@ struct pmt_platform_info {
> > unsigned long quirks;
> > };
> >
> > +static const struct pmt_platform_info pmt_info;
> > +
> > static const struct pmt_platform_info tgl_info = {
> > .quirks = PMT_QUIRK_NO_WATCHER | PMT_QUIRK_NO_CRASHLOG |
> > PMT_QUIRK_TABLE_SHIFT,
> > @@ -200,8 +202,10 @@ static void pmt_pci_remove(struct pci_dev
> > *pdev)
> > pm_runtime_get_sync(&pdev->dev);
> > }
> >
> > +#define PCI_DEVICE_ID_INTEL_PMT_OOBMSM 0x09a7
> > #define PCI_DEVICE_ID_INTEL_PMT_TGL 0x9a0d
> > static const struct pci_device_id pmt_pci_ids[] = {
> > + { PCI_DEVICE_DATA(INTEL, PMT_OOBMSM, &pmt_info) },
>
> Why are you supplying an empty struct?

Because the OOBMSM device doesn't need code provided driver data, but
info is dereferenced in several areas. We also use kmemdup to copy
driver_data under the assumption that it was provided. We could allow
for NULL if driver_data is referenced directly.

David


2020-09-30 07:16:23

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 1/3] mfd: intel_pmt: Add OOBMSM device ID

On Tue, 29 Sep 2020, David E. Box wrote:

> On Tue, 2020-09-29 at 10:51 +0100, Lee Jones wrote:
> > On Fri, 11 Sep 2020, David E. Box wrote:
> >
> > > Add Out of Band Management Services Module device ID to Intel PMT
> > > driver.
> > >
> > > Signed-off-by: Alexander Duyck <[email protected]>
> > > Signed-off-by: David E. Box <[email protected]>
> > > ---
> > > drivers/mfd/intel_pmt.c | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > diff --git a/drivers/mfd/intel_pmt.c b/drivers/mfd/intel_pmt.c
> > > index 0e572b105101..8f9970ab3026 100644
> > > --- a/drivers/mfd/intel_pmt.c
> > > +++ b/drivers/mfd/intel_pmt.c
> > > @@ -55,6 +55,8 @@ struct pmt_platform_info {
> > > unsigned long quirks;
> > > };
> > >
> > > +static const struct pmt_platform_info pmt_info;
> > > +
> > > static const struct pmt_platform_info tgl_info = {
> > > .quirks = PMT_QUIRK_NO_WATCHER | PMT_QUIRK_NO_CRASHLOG |
> > > PMT_QUIRK_TABLE_SHIFT,
> > > @@ -200,8 +202,10 @@ static void pmt_pci_remove(struct pci_dev
> > > *pdev)
> > > pm_runtime_get_sync(&pdev->dev);
> > > }
> > >
> > > +#define PCI_DEVICE_ID_INTEL_PMT_OOBMSM 0x09a7
> > > #define PCI_DEVICE_ID_INTEL_PMT_TGL 0x9a0d
> > > static const struct pci_device_id pmt_pci_ids[] = {
> > > + { PCI_DEVICE_DATA(INTEL, PMT_OOBMSM, &pmt_info) },
> >
> > Why are you supplying an empty struct?
>
> Because the OOBMSM device doesn't need code provided driver data, but
> info is dereferenced in several areas. We also use kmemdup to copy
> driver_data under the assumption that it was provided. We could allow
> for NULL if driver_data is referenced directly.

Just check for NULL. No need to create and send bogus data.

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

2020-09-30 16:51:42

by David E. Box

[permalink] [raw]
Subject: Re: [PATCH 1/3] mfd: intel_pmt: Add OOBMSM device ID

On Wed, 2020-09-30 at 08:12 +0100, Lee Jones wrote:
> On Tue, 29 Sep 2020, David E. Box wrote:
>
> > On Tue, 2020-09-29 at 10:51 +0100, Lee Jones wrote:
> > > On Fri, 11 Sep 2020, David E. Box wrote:
> > >
> > > > Add Out of Band Management Services Module device ID to Intel
> > > > PMT
> > > > driver.
> > > >
> > > > Signed-off-by: Alexander Duyck <
> > > > [email protected]>
> > > > Signed-off-by: David E. Box <[email protected]>
> > > > ---
> > > > drivers/mfd/intel_pmt.c | 4 ++++
> > > > 1 file changed, 4 insertions(+)
> > > >
> > > > diff --git a/drivers/mfd/intel_pmt.c b/drivers/mfd/intel_pmt.c
> > > > index 0e572b105101..8f9970ab3026 100644
> > > > --- a/drivers/mfd/intel_pmt.c
> > > > +++ b/drivers/mfd/intel_pmt.c
> > > > @@ -55,6 +55,8 @@ struct pmt_platform_info {
> > > > unsigned long quirks;
> > > > };
> > > >
> > > > +static const struct pmt_platform_info pmt_info;
> > > > +
> > > > static const struct pmt_platform_info tgl_info = {
> > > > .quirks = PMT_QUIRK_NO_WATCHER | PMT_QUIRK_NO_CRASHLOG
> > > > |
> > > > PMT_QUIRK_TABLE_SHIFT,
> > > > @@ -200,8 +202,10 @@ static void pmt_pci_remove(struct pci_dev
> > > > *pdev)
> > > > pm_runtime_get_sync(&pdev->dev);
> > > > }
> > > >
> > > > +#define PCI_DEVICE_ID_INTEL_PMT_OOBMSM 0x09a7
> > > > #define PCI_DEVICE_ID_INTEL_PMT_TGL 0x9a0d
> > > > static const struct pci_device_id pmt_pci_ids[] = {
> > > > + { PCI_DEVICE_DATA(INTEL, PMT_OOBMSM, &pmt_info) },
> > >
> > > Why are you supplying an empty struct?
> >
> > Because the OOBMSM device doesn't need code provided driver data,
> > but
> > info is dereferenced in several areas. We also use kmemdup to copy
> > driver_data under the assumption that it was provided. We could
> > allow
> > for NULL if driver_data is referenced directly.
>
> Just check for NULL. No need to create and send bogus data.

Sure. If you haven't already, please note that this patch was pulled
into the V6 series in the link below. You accepted V5 but Hans
suggested some late changes after reviewing the new crashlog driver in
this patchset. So rather than have separate patchsets with a
dependency, we bundled them all into the original. We'll make these
changes in V7 now.

https://lore.kernel.org/patchwork/patch/1313166/

David

2020-10-01 07:59:07

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 1/3] mfd: intel_pmt: Add OOBMSM device ID

On Wed, 30 Sep 2020, David E. Box wrote:

> On Wed, 2020-09-30 at 08:12 +0100, Lee Jones wrote:
> > On Tue, 29 Sep 2020, David E. Box wrote:
> >
> > > On Tue, 2020-09-29 at 10:51 +0100, Lee Jones wrote:
> > > > On Fri, 11 Sep 2020, David E. Box wrote:
> > > >
> > > > > Add Out of Band Management Services Module device ID to Intel
> > > > > PMT
> > > > > driver.
> > > > >
> > > > > Signed-off-by: Alexander Duyck <
> > > > > [email protected]>
> > > > > Signed-off-by: David E. Box <[email protected]>
> > > > > ---
> > > > > drivers/mfd/intel_pmt.c | 4 ++++
> > > > > 1 file changed, 4 insertions(+)
> > > > >
> > > > > diff --git a/drivers/mfd/intel_pmt.c b/drivers/mfd/intel_pmt.c
> > > > > index 0e572b105101..8f9970ab3026 100644
> > > > > --- a/drivers/mfd/intel_pmt.c
> > > > > +++ b/drivers/mfd/intel_pmt.c
> > > > > @@ -55,6 +55,8 @@ struct pmt_platform_info {
> > > > > unsigned long quirks;
> > > > > };
> > > > >
> > > > > +static const struct pmt_platform_info pmt_info;
> > > > > +
> > > > > static const struct pmt_platform_info tgl_info = {
> > > > > .quirks = PMT_QUIRK_NO_WATCHER | PMT_QUIRK_NO_CRASHLOG
> > > > > |
> > > > > PMT_QUIRK_TABLE_SHIFT,
> > > > > @@ -200,8 +202,10 @@ static void pmt_pci_remove(struct pci_dev
> > > > > *pdev)
> > > > > pm_runtime_get_sync(&pdev->dev);
> > > > > }
> > > > >
> > > > > +#define PCI_DEVICE_ID_INTEL_PMT_OOBMSM 0x09a7
> > > > > #define PCI_DEVICE_ID_INTEL_PMT_TGL 0x9a0d
> > > > > static const struct pci_device_id pmt_pci_ids[] = {
> > > > > + { PCI_DEVICE_DATA(INTEL, PMT_OOBMSM, &pmt_info) },
> > > >
> > > > Why are you supplying an empty struct?
> > >
> > > Because the OOBMSM device doesn't need code provided driver data,
> > > but
> > > info is dereferenced in several areas. We also use kmemdup to copy
> > > driver_data under the assumption that it was provided. We could
> > > allow
> > > for NULL if driver_data is referenced directly.
> >
> > Just check for NULL. No need to create and send bogus data.
>
> Sure. If you haven't already, please note that this patch was pulled
> into the V6 series in the link below. You accepted V5 but Hans
> suggested some late changes after reviewing the new crashlog driver in
> this patchset. So rather than have separate patchsets with a
> dependency, we bundled them all into the original. We'll make these
> changes in V7 now.
>
> https://lore.kernel.org/patchwork/patch/1313166/

Sounds reasonable.

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