All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal: int340x: Use IMOK independently
@ 2021-07-16 16:39 Sumeet Pawnikar
  2021-07-19 17:16 ` srinivas pandruvada
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sumeet Pawnikar @ 2021-07-16 16:39 UTC (permalink / raw)
  To: rui.zhang, srinivas.pandruvada, daniel.lezcano, linux-pm, linux-kernel
  Cc: sumeet.r.pawnikar

Some chrome platform requires IMOK method in coreboot. But these platforms
don't use GDDV data vault in coreboot. As per current code flow, to enable
and use IMOK only, we need to have GDDV support as well in coreboot. This
patch removes the dependency for IMOK from GDDV to enable and use IMOK
independently.

Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
---
 .../intel/int340x_thermal/int3400_thermal.c        | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
index 823354a1a91a..19926beeb3b7 100644
--- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
@@ -108,9 +108,12 @@ static struct attribute *imok_attr[] = {
 	NULL
 };
 
+static const struct attribute_group imok_attribute_group = {
+	.attrs = imok_attr,
+};
+
 static const struct attribute_group data_attribute_group = {
 	.bin_attrs = data_attributes,
-	.attrs = imok_attr,
 };
 
 static ssize_t available_uuids_show(struct device *dev,
@@ -522,6 +525,12 @@ static int int3400_thermal_probe(struct platform_device *pdev)
 	if (result)
 		goto free_rel_misc;
 
+	if (acpi_has_method(priv->adev->handle, "IMOK")) {
+		result = sysfs_create_group(&pdev->dev.kobj, &imok_attribute_group);
+		if (result)
+			goto free_imok;
+	}
+
 	if (priv->data_vault) {
 		result = sysfs_create_group(&pdev->dev.kobj,
 					    &data_attribute_group);
@@ -545,6 +554,8 @@ static int int3400_thermal_probe(struct platform_device *pdev)
 	}
 free_uuid:
 	sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group);
+free_imok:
+	sysfs_remove_group(&pdev->dev.kobj, &imok_attribute_group);
 free_rel_misc:
 	if (!priv->rel_misc_dev_res)
 		acpi_thermal_rel_misc_device_remove(priv->adev->handle);
@@ -573,6 +584,7 @@ static int int3400_thermal_remove(struct platform_device *pdev)
 	if (priv->data_vault)
 		sysfs_remove_group(&pdev->dev.kobj, &data_attribute_group);
 	sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group);
+	sysfs_remove_group(&pdev->dev.kobj, &imok_attribute_group);
 	thermal_zone_device_unregister(priv->thermal);
 	kfree(priv->data_vault);
 	kfree(priv->trts);
-- 
2.17.1


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

* Re: [PATCH] thermal: int340x: Use IMOK independently
  2021-07-16 16:39 [PATCH] thermal: int340x: Use IMOK independently Sumeet Pawnikar
@ 2021-07-19 17:16 ` srinivas pandruvada
  2021-07-27  2:32 ` Zhang, Rui
  2021-09-09 14:38 ` [thermal: thermal/next] thermal/drivers/int340x: " thermal-bot for Sumeet Pawnikar
  2 siblings, 0 replies; 4+ messages in thread
From: srinivas pandruvada @ 2021-07-19 17:16 UTC (permalink / raw)
  To: Sumeet Pawnikar, rui.zhang, daniel.lezcano, linux-pm, linux-kernel

On Fri, 2021-07-16 at 22:09 +0530, Sumeet Pawnikar wrote:
> Some chrome platform requires IMOK method in coreboot. But these
> platforms
> don't use GDDV data vault in coreboot. As per current code flow, to
> enable
> and use IMOK only, we need to have GDDV support as well in coreboot.
> This
> patch removes the dependency for IMOK from GDDV to enable and use IMOK
> independently.
> 
> Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> ---
>  .../intel/int340x_thermal/int3400_thermal.c        | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> index 823354a1a91a..19926beeb3b7 100644
> --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> @@ -108,9 +108,12 @@ static struct attribute *imok_attr[] = {
>         NULL
>  };
>  
> +static const struct attribute_group imok_attribute_group = {
> +       .attrs = imok_attr,
> +};
> +
>  static const struct attribute_group data_attribute_group = {
>         .bin_attrs = data_attributes,
> -       .attrs = imok_attr,
>  };
>  
>  static ssize_t available_uuids_show(struct device *dev,
> @@ -522,6 +525,12 @@ static int int3400_thermal_probe(struct
> platform_device *pdev)
>         if (result)
>                 goto free_rel_misc;
>  
> +       if (acpi_has_method(priv->adev->handle, "IMOK")) {
> +               result = sysfs_create_group(&pdev->dev.kobj,
> &imok_attribute_group);
> +               if (result)
> +                       goto free_imok;
> +       }
> +
>         if (priv->data_vault) {
>                 result = sysfs_create_group(&pdev->dev.kobj,
>                                             &data_attribute_group);
> @@ -545,6 +554,8 @@ static int int3400_thermal_probe(struct
> platform_device *pdev)
>         }
>  free_uuid:
>         sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group);
> +free_imok:
> +       sysfs_remove_group(&pdev->dev.kobj, &imok_attribute_group);
>  free_rel_misc:
>         if (!priv->rel_misc_dev_res)
>                 acpi_thermal_rel_misc_device_remove(priv->adev-
> >handle);
> @@ -573,6 +584,7 @@ static int int3400_thermal_remove(struct
> platform_device *pdev)
>         if (priv->data_vault)
>                 sysfs_remove_group(&pdev->dev.kobj,
> &data_attribute_group);
>         sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group);
> +       sysfs_remove_group(&pdev->dev.kobj, &imok_attribute_group);
>         thermal_zone_device_unregister(priv->thermal);
>         kfree(priv->data_vault);
>         kfree(priv->trts);



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

* RE: [PATCH] thermal: int340x: Use IMOK independently
  2021-07-16 16:39 [PATCH] thermal: int340x: Use IMOK independently Sumeet Pawnikar
  2021-07-19 17:16 ` srinivas pandruvada
@ 2021-07-27  2:32 ` Zhang, Rui
  2021-09-09 14:38 ` [thermal: thermal/next] thermal/drivers/int340x: " thermal-bot for Sumeet Pawnikar
  2 siblings, 0 replies; 4+ messages in thread
From: Zhang, Rui @ 2021-07-27  2:32 UTC (permalink / raw)
  To: Pawnikar, Sumeet R, srinivas.pandruvada, daniel.lezcano,
	linux-pm, linux-kernel



> -----Original Message-----
> From: Pawnikar, Sumeet R <sumeet.r.pawnikar@intel.com>
> Sent: Saturday, July 17, 2021 12:40 AM
> To: Zhang, Rui <rui.zhang@intel.com>; srinivas.pandruvada@linux.intel.com;
> daniel.lezcano@linaro.org; linux-pm@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Cc: Pawnikar, Sumeet R <sumeet.r.pawnikar@intel.com>
> Subject: [PATCH] thermal: int340x: Use IMOK independently
> Importance: High
> 
> Some chrome platform requires IMOK method in coreboot. But these
> platforms don't use GDDV data vault in coreboot. As per current code flow,
> to enable and use IMOK only, we need to have GDDV support as well in
> coreboot. This patch removes the dependency for IMOK from GDDV to
> enable and use IMOK independently.
> 
> Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>

Acked-by: Zhang Rui <rui.zhang@intel.com>

Thanks,
Rui

> ---
>  .../intel/int340x_thermal/int3400_thermal.c        | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> index 823354a1a91a..19926beeb3b7 100644
> --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> @@ -108,9 +108,12 @@ static struct attribute *imok_attr[] = {
>  	NULL
>  };
> 
> +static const struct attribute_group imok_attribute_group = {
> +	.attrs = imok_attr,
> +};
> +
>  static const struct attribute_group data_attribute_group = {
>  	.bin_attrs = data_attributes,
> -	.attrs = imok_attr,
>  };
> 
>  static ssize_t available_uuids_show(struct device *dev, @@ -522,6 +525,12
> @@ static int int3400_thermal_probe(struct platform_device *pdev)
>  	if (result)
>  		goto free_rel_misc;
> 
> +	if (acpi_has_method(priv->adev->handle, "IMOK")) {
> +		result = sysfs_create_group(&pdev->dev.kobj,
> &imok_attribute_group);
> +		if (result)
> +			goto free_imok;
> +	}
> +
>  	if (priv->data_vault) {
>  		result = sysfs_create_group(&pdev->dev.kobj,
>  					    &data_attribute_group);
> @@ -545,6 +554,8 @@ static int int3400_thermal_probe(struct
> platform_device *pdev)
>  	}
>  free_uuid:
>  	sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group);
> +free_imok:
> +	sysfs_remove_group(&pdev->dev.kobj, &imok_attribute_group);
>  free_rel_misc:
>  	if (!priv->rel_misc_dev_res)
>  		acpi_thermal_rel_misc_device_remove(priv->adev->handle);
> @@ -573,6 +584,7 @@ static int int3400_thermal_remove(struct
> platform_device *pdev)
>  	if (priv->data_vault)
>  		sysfs_remove_group(&pdev->dev.kobj,
> &data_attribute_group);
>  	sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group);
> +	sysfs_remove_group(&pdev->dev.kobj, &imok_attribute_group);
>  	thermal_zone_device_unregister(priv->thermal);
>  	kfree(priv->data_vault);
>  	kfree(priv->trts);
> --
> 2.17.1


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

* [thermal: thermal/next] thermal/drivers/int340x: Use IMOK independently
  2021-07-16 16:39 [PATCH] thermal: int340x: Use IMOK independently Sumeet Pawnikar
  2021-07-19 17:16 ` srinivas pandruvada
  2021-07-27  2:32 ` Zhang, Rui
@ 2021-09-09 14:38 ` thermal-bot for Sumeet Pawnikar
  2 siblings, 0 replies; 4+ messages in thread
From: thermal-bot for Sumeet Pawnikar @ 2021-09-09 14:38 UTC (permalink / raw)
  To: linux-pm
  Cc: Sumeet Pawnikar, Srinivas Pandruvada, Zhang Rui, Daniel Lezcano, amitk

The following commit has been merged into the thermal/next branch of thermal:

Commit-ID:     f1b07a14694be02b2b87e2fe6def6cff2f4bd452
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//f1b07a14694be02b2b87e2fe6def6cff2f4bd452
Author:        Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
AuthorDate:    Fri, 16 Jul 2021 22:09:46 +05:30
Committer:     Daniel Lezcano <daniel.lezcano@linaro.org>
CommitterDate: Sat, 14 Aug 2021 15:39:13 +02:00

thermal/drivers/int340x: Use IMOK independently

Some chrome platform requires IMOK method in coreboot. But these platforms
don't use GDDV data vault in coreboot. As per current code flow, to enable
and use IMOK only, we need to have GDDV support as well in coreboot. This
patch removes the dependency for IMOK from GDDV to enable and use IMOK
independently.

Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210716163946.3142-1-sumeet.r.pawnikar@intel.com
---
 drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 14 +++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
index 823354a..19926be 100644
--- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
@@ -108,9 +108,12 @@ static struct attribute *imok_attr[] = {
 	NULL
 };
 
+static const struct attribute_group imok_attribute_group = {
+	.attrs = imok_attr,
+};
+
 static const struct attribute_group data_attribute_group = {
 	.bin_attrs = data_attributes,
-	.attrs = imok_attr,
 };
 
 static ssize_t available_uuids_show(struct device *dev,
@@ -522,6 +525,12 @@ static int int3400_thermal_probe(struct platform_device *pdev)
 	if (result)
 		goto free_rel_misc;
 
+	if (acpi_has_method(priv->adev->handle, "IMOK")) {
+		result = sysfs_create_group(&pdev->dev.kobj, &imok_attribute_group);
+		if (result)
+			goto free_imok;
+	}
+
 	if (priv->data_vault) {
 		result = sysfs_create_group(&pdev->dev.kobj,
 					    &data_attribute_group);
@@ -545,6 +554,8 @@ free_sysfs:
 	}
 free_uuid:
 	sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group);
+free_imok:
+	sysfs_remove_group(&pdev->dev.kobj, &imok_attribute_group);
 free_rel_misc:
 	if (!priv->rel_misc_dev_res)
 		acpi_thermal_rel_misc_device_remove(priv->adev->handle);
@@ -573,6 +584,7 @@ static int int3400_thermal_remove(struct platform_device *pdev)
 	if (priv->data_vault)
 		sysfs_remove_group(&pdev->dev.kobj, &data_attribute_group);
 	sysfs_remove_group(&pdev->dev.kobj, &uuid_attribute_group);
+	sysfs_remove_group(&pdev->dev.kobj, &imok_attribute_group);
 	thermal_zone_device_unregister(priv->thermal);
 	kfree(priv->data_vault);
 	kfree(priv->trts);

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

end of thread, other threads:[~2021-09-09 14:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-16 16:39 [PATCH] thermal: int340x: Use IMOK independently Sumeet Pawnikar
2021-07-19 17:16 ` srinivas pandruvada
2021-07-27  2:32 ` Zhang, Rui
2021-09-09 14:38 ` [thermal: thermal/next] thermal/drivers/int340x: " thermal-bot for Sumeet Pawnikar

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.