From: "Pandruvada, Srinivas" <srinivas.pandruvada@intel.com>
To: "matthewgarrett@google.com" <matthewgarrett@google.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "Zhang, Rui" <rui.zhang@intel.com>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"Aram, Nisha" <nisha.aram@intel.com>,
"mjg59@google.com" <mjg59@google.com>
Subject: Re: [PATCH V2 3/3] thermal/int340x_thermal: Don't require IDSP to exist
Date: Mon, 18 May 2020 23:18:42 +0000 [thread overview]
Message-ID: <78cacff7bd332f472cd8ac2d3c658512f81a5cbe.camel@intel.com> (raw)
In-Reply-To: <20200414020953.255364-3-matthewgarrett@google.com>
On Mon, 2020-04-13 at 19:09 -0700, Matthew Garrett wrote:
> From: Matthew Garrett <mjg59@google.com>
>
> The IDSP method doesn't appear to exist on the most recent Intel
> platforms:
> instead, the IDSP data is included in the GDDV blob. Since we
> probably don't
> want to decompress and parse that in-kernel, just allow any UUID to
> be
> written if IDSP is missing.
>
> Signed-off-by: Matthew Garrett <mjg59@google.com>
Tested-by: Pandruvada, Srinivas <srinivas.pandruvada@linux.intel.com>
> ---
> .../intel/int340x_thermal/int3400_thermal.c | 30 ++++++++++++++---
> --
> 1 file changed, 22 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> index 3919098a73b47..19936709c2ad0 100644
> --- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> +++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> @@ -96,6 +96,9 @@ static ssize_t available_uuids_show(struct device
> *dev,
> int i;
> int length = 0;
>
> + if (!priv->uuid_bitmap)
> + return sprintf(buf, "UNKNOWN\n");
> +
> for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; i++) {
> if (priv->uuid_bitmap & (1 << i))
> if (PAGE_SIZE - length > 0)
> @@ -113,11 +116,11 @@ static ssize_t current_uuid_show(struct device
> *dev,
> {
> struct int3400_thermal_priv *priv = dev_get_drvdata(dev);
>
> - if (priv->uuid_bitmap & (1 << priv->current_uuid_index))
> - return sprintf(buf, "%s\n",
> - int3400_thermal_uuids[priv-
> >current_uuid_index]);
> - else
> + if (priv->current_uuid_index == -1)
> return sprintf(buf, "INVALID\n");
> +
> + return sprintf(buf, "%s\n",
> + int3400_thermal_uuids[priv-
> >current_uuid_index]);
> }
>
> static ssize_t current_uuid_store(struct device *dev,
> @@ -128,9 +131,16 @@ static ssize_t current_uuid_store(struct device
> *dev,
> int i;
>
> for (i = 0; i < INT3400_THERMAL_MAXIMUM_UUID; ++i) {
> - if ((priv->uuid_bitmap & (1 << i)) &&
> - !(strncmp(buf, int3400_thermal_uuids[i],
> - sizeof(int3400_thermal_uuids[i]) - 1))) {
> + if (!strncmp(buf, int3400_thermal_uuids[i],
> + sizeof(int3400_thermal_uuids[i]) - 1)) {
> + /*
> + * If we have a list of supported UUIDs, make
> sure
> + * this one is supported.
> + */
> + if (priv->uuid_bitmap &&
> + !(priv->uuid_bitmap & (1 << i)))
> + return -EINVAL;
> +
> priv->current_uuid_index = i;
> return count;
> }
> @@ -462,9 +472,13 @@ static int int3400_thermal_probe(struct
> platform_device *pdev)
> priv->adev = adev;
>
> result = int3400_thermal_get_uuids(priv);
> - if (result)
> +
> + /* Missing IDSP isn't fatal */
> + if (result && result != -ENODEV)
> goto free_priv;
>
> + priv->current_uuid_index = -1;
> +
> result = acpi_parse_art(priv->adev->handle, &priv->art_count,
> &priv->arts, true);
> if (result)
next prev parent reply other threads:[~2020-05-18 23:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-14 2:09 [PATCH V2 1/3] thermal/int340x_thermal: Export GDDV Matthew Garrett
2020-04-14 2:09 ` [PATCH V2 2/3] thermal/int340x_thermal: Export OEM vendor variables Matthew Garrett
2020-05-18 23:18 ` Pandruvada, Srinivas
2020-04-14 2:09 ` [PATCH V2 3/3] thermal/int340x_thermal: Don't require IDSP to exist Matthew Garrett
2020-05-18 23:18 ` Pandruvada, Srinivas [this message]
2020-04-14 3:33 ` [PATCH V2 1/3] thermal/int340x_thermal: Export GDDV Pandruvada, Srinivas
2020-04-14 3:53 ` Matthew Garrett
2020-04-14 3:58 ` Pandruvada, Srinivas
2020-05-18 23:18 ` Pandruvada, Srinivas
2020-05-29 6:00 ` Pandruvada, Srinivas
2020-05-29 6:02 ` Zhang Rui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=78cacff7bd332f472cd8ac2d3c658512f81a5cbe.camel@intel.com \
--to=srinivas.pandruvada@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=matthewgarrett@google.com \
--cc=mjg59@google.com \
--cc=nisha.aram@intel.com \
--cc=rui.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®