* [PATCH 1/2] platform/x86: intel_pmt_class: Initial resource to 0
@ 2021-03-17 2:44 David E. Box
2021-03-17 2:44 ` [PATCH 2/2] platform_x86: intel_pmt_crashlog: Fix incorrect macros David E. Box
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: David E. Box @ 2021-03-17 2:44 UTC (permalink / raw)
To: hdegoede, mgross
Cc: David E. Box, lee.jones, platform-driver-x86, linux-kernel
Initialize the struct resource in intel_pmt_dev_register to zero to avoid a
fault should the char *name field be non-zero.
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
---
Base commit is v5.12-rc3.
drivers/platform/x86/intel_pmt_class.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/intel_pmt_class.c b/drivers/platform/x86/intel_pmt_class.c
index c8939fba4509..ee2b3bbeb83d 100644
--- a/drivers/platform/x86/intel_pmt_class.c
+++ b/drivers/platform/x86/intel_pmt_class.c
@@ -173,7 +173,7 @@ static int intel_pmt_dev_register(struct intel_pmt_entry *entry,
struct intel_pmt_namespace *ns,
struct device *parent)
{
- struct resource res;
+ struct resource res = {0};
struct device *dev;
int ret;
base-commit: 1e28eed17697bcf343c6743f0028cc3b5dd88bf0
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] platform_x86: intel_pmt_crashlog: Fix incorrect macros
2021-03-17 2:44 [PATCH 1/2] platform/x86: intel_pmt_class: Initial resource to 0 David E. Box
@ 2021-03-17 2:44 ` David E. Box
2021-03-23 17:29 ` [PATCH 1/2] platform/x86: intel_pmt_class: Initial resource to 0 David E. Box
2021-03-23 20:10 ` Hans de Goede
2 siblings, 0 replies; 5+ messages in thread
From: David E. Box @ 2021-03-17 2:44 UTC (permalink / raw)
To: hdegoede, mgross
Cc: David E. Box, lee.jones, platform-driver-x86, linux-kernel
Fixes off-by-one bugs in the macro assignments for the crashlog control
bits. Was initially tested on emulation but bug revealed after testing on
silicon.
Fixes: 5ef9998c96b0 ("platform/x86: Intel PMT Crashlog capability driver")
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
---
drivers/platform/x86/intel_pmt_crashlog.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/platform/x86/intel_pmt_crashlog.c b/drivers/platform/x86/intel_pmt_crashlog.c
index 97dd749c8290..92d315a16cfd 100644
--- a/drivers/platform/x86/intel_pmt_crashlog.c
+++ b/drivers/platform/x86/intel_pmt_crashlog.c
@@ -23,18 +23,17 @@
#define CRASH_TYPE_OOBMSM 1
/* Control Flags */
-#define CRASHLOG_FLAG_DISABLE BIT(27)
+#define CRASHLOG_FLAG_DISABLE BIT(28)
/*
- * Bits 28 and 29 control the state of bit 31.
+ * Bits 29 and 30 control the state of bit 31.
*
- * Bit 28 will clear bit 31, if set, allowing a new crashlog to be captured.
- * Bit 29 will immediately trigger a crashlog to be generated, setting bit 31.
- * Bit 30 is read-only and reserved as 0.
+ * Bit 29 will clear bit 31, if set, allowing a new crashlog to be captured.
+ * Bit 30 will immediately trigger a crashlog to be generated, setting bit 31.
* Bit 31 is the read-only status with a 1 indicating log is complete.
*/
-#define CRASHLOG_FLAG_TRIGGER_CLEAR BIT(28)
-#define CRASHLOG_FLAG_TRIGGER_EXECUTE BIT(29)
+#define CRASHLOG_FLAG_TRIGGER_CLEAR BIT(29)
+#define CRASHLOG_FLAG_TRIGGER_EXECUTE BIT(30)
#define CRASHLOG_FLAG_TRIGGER_COMPLETE BIT(31)
#define CRASHLOG_FLAG_TRIGGER_MASK GENMASK(31, 28)
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] platform/x86: intel_pmt_class: Initial resource to 0
2021-03-17 2:44 [PATCH 1/2] platform/x86: intel_pmt_class: Initial resource to 0 David E. Box
2021-03-17 2:44 ` [PATCH 2/2] platform_x86: intel_pmt_crashlog: Fix incorrect macros David E. Box
@ 2021-03-23 17:29 ` David E. Box
2021-03-23 20:15 ` Hans de Goede
2021-03-23 20:10 ` Hans de Goede
2 siblings, 1 reply; 5+ messages in thread
From: David E. Box @ 2021-03-23 17:29 UTC (permalink / raw)
To: hdegoede, mgross; +Cc: lee.jones, platform-driver-x86, linux-kernel
On Tue, 2021-03-16 at 19:44 -0700, David E. Box wrote:
> Initialize the struct resource in intel_pmt_dev_register to zero to
> avoid a
> fault should the char *name field be non-zero.
Hi Hans. Can these 2 patches be pulled as fixes for 5.12? Thanks.
David
>
> Signed-off-by: David E. Box <david.e.box@linux.intel.com>
> ---
>
> Base commit is v5.12-rc3.
>
> drivers/platform/x86/intel_pmt_class.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/intel_pmt_class.c
> b/drivers/platform/x86/intel_pmt_class.c
> index c8939fba4509..ee2b3bbeb83d 100644
> --- a/drivers/platform/x86/intel_pmt_class.c
> +++ b/drivers/platform/x86/intel_pmt_class.c
> @@ -173,7 +173,7 @@ static int intel_pmt_dev_register(struct
> intel_pmt_entry *entry,
> struct intel_pmt_namespace *ns,
> struct device *parent)
> {
> - struct resource res;
> + struct resource res = {0};
> struct device *dev;
> int ret;
>
>
> base-commit: 1e28eed17697bcf343c6743f0028cc3b5dd88bf0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] platform/x86: intel_pmt_class: Initial resource to 0
2021-03-17 2:44 [PATCH 1/2] platform/x86: intel_pmt_class: Initial resource to 0 David E. Box
2021-03-17 2:44 ` [PATCH 2/2] platform_x86: intel_pmt_crashlog: Fix incorrect macros David E. Box
2021-03-23 17:29 ` [PATCH 1/2] platform/x86: intel_pmt_class: Initial resource to 0 David E. Box
@ 2021-03-23 20:10 ` Hans de Goede
2 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2021-03-23 20:10 UTC (permalink / raw)
To: David E. Box, mgross; +Cc: lee.jones, platform-driver-x86, linux-kernel
Hi,
On 3/17/21 3:44 AM, David E. Box wrote:
> Initialize the struct resource in intel_pmt_dev_register to zero to avoid a
> fault should the char *name field be non-zero.
>
> Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Thank you for your patch-series, I've applied the series to my
review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.
Regards,
Hans
> ---
>
> Base commit is v5.12-rc3.
>
> drivers/platform/x86/intel_pmt_class.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/intel_pmt_class.c b/drivers/platform/x86/intel_pmt_class.c
> index c8939fba4509..ee2b3bbeb83d 100644
> --- a/drivers/platform/x86/intel_pmt_class.c
> +++ b/drivers/platform/x86/intel_pmt_class.c
> @@ -173,7 +173,7 @@ static int intel_pmt_dev_register(struct intel_pmt_entry *entry,
> struct intel_pmt_namespace *ns,
> struct device *parent)
> {
> - struct resource res;
> + struct resource res = {0};
> struct device *dev;
> int ret;
>
>
> base-commit: 1e28eed17697bcf343c6743f0028cc3b5dd88bf0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] platform/x86: intel_pmt_class: Initial resource to 0
2021-03-23 17:29 ` [PATCH 1/2] platform/x86: intel_pmt_class: Initial resource to 0 David E. Box
@ 2021-03-23 20:15 ` Hans de Goede
0 siblings, 0 replies; 5+ messages in thread
From: Hans de Goede @ 2021-03-23 20:15 UTC (permalink / raw)
To: david.e.box, mgross; +Cc: lee.jones, platform-driver-x86, linux-kernel
Hi,
On 3/23/21 6:29 PM, David E. Box wrote:
> On Tue, 2021-03-16 at 19:44 -0700, David E. Box wrote:
>> Initialize the struct resource in intel_pmt_dev_register to zero to
>> avoid a
>> fault should the char *name field be non-zero.
>
> Hi Hans. Can these 2 patches be pulled as fixes for 5.12? Thanks.
I've merged this into my review-hans branch now.
I'll also them to my fixes branch and add them to my next
pull-req to Linus for 5.12.
Regards,
Hans
> David
>
>>
>> Signed-off-by: David E. Box <david.e.box@linux.intel.com>
>> ---
>>
>> Base commit is v5.12-rc3.
>>
>> drivers/platform/x86/intel_pmt_class.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/platform/x86/intel_pmt_class.c
>> b/drivers/platform/x86/intel_pmt_class.c
>> index c8939fba4509..ee2b3bbeb83d 100644
>> --- a/drivers/platform/x86/intel_pmt_class.c
>> +++ b/drivers/platform/x86/intel_pmt_class.c
>> @@ -173,7 +173,7 @@ static int intel_pmt_dev_register(struct
>> intel_pmt_entry *entry,
>> struct intel_pmt_namespace *ns,
>> struct device *parent)
>> {
>> - struct resource res;
>> + struct resource res = {0};
>> struct device *dev;
>> int ret;
>>
>>
>> base-commit: 1e28eed17697bcf343c6743f0028cc3b5dd88bf0
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-03-23 20:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-17 2:44 [PATCH 1/2] platform/x86: intel_pmt_class: Initial resource to 0 David E. Box
2021-03-17 2:44 ` [PATCH 2/2] platform_x86: intel_pmt_crashlog: Fix incorrect macros David E. Box
2021-03-23 17:29 ` [PATCH 1/2] platform/x86: intel_pmt_class: Initial resource to 0 David E. Box
2021-03-23 20:15 ` Hans de Goede
2021-03-23 20:10 ` Hans de Goede
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.