All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: "Shah, Nehal-bakulchandra" <nehal-bakulchandra.shah@amd.com>,
	Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Sandeep Singh <sandeep.singh@amd.com>
Cc: Richard Neumann <mail@richard-neumann.de>,
	linux-input@vger.kernel.org, "Shyam-sundar.S-k\""@amd.com
Subject: Re: [PATCH 3/3] AMD_SFH: Add DMI quirk table for BIOS-es which don't set the activestatus bits
Date: Mon, 22 Feb 2021 12:53:28 +0100	[thread overview]
Message-ID: <3a2857a3-f8cb-bc0f-fe41-3bc101b817d7@redhat.com> (raw)
In-Reply-To: <eac9fd4c-f3ea-1127-a59d-aaa01ca8e0bc@amd.com>

Hi,

On 2/15/21 9:24 AM, Shah, Nehal-bakulchandra wrote:
> Hi Hans,
> On 1/28/2021 5:42 PM, Hans de Goede wrote:
>> Some BIOS-es do not initialize the activestatus bits of the AMD_P2C_MSG3
>> register. This cause the AMD_SFH driver to not register any sensors even
>> though the laptops in question do have sensors.
>>
>> Add a DMI quirk-table for specifying sensor-mask overrides based on
>> DMI match, to make the sensors work OOTB on these laptop models.
>>
>> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=199715
>> BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1651886
>> Fixes: 4f567b9f8141 ("SFH: PCIe driver to add support of AMD sensor fusion hub")
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>>  drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 24 ++++++++++++++++++++++++
>>  1 file changed, 24 insertions(+)
>>
>> diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
>> index ab0a9443e252..ddecc84fd6f0 100644
>> --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
>> +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
>> @@ -10,6 +10,7 @@
>>  #include <linux/bitops.h>
>>  #include <linux/delay.h>
>>  #include <linux/dma-mapping.h>
>> +#include <linux/dmi.h>
>>  #include <linux/interrupt.h>
>>  #include <linux/io-64-nonatomic-lo-hi.h>
>>  #include <linux/module.h>
>> @@ -77,11 +78,34 @@ void amd_stop_all_sensors(struct amd_mp2_dev *privdata)
>>  	writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0);
>>  }
>>  
>> +static const struct dmi_system_id dmi_sensor_mask_overrides[] = {
>> +	{
>> +		.matches = {
>> +			DMI_MATCH(DMI_PRODUCT_NAME, "HP ENVY x360 Convertible 13-ag0xxx"),
>> +		},
>> +		.driver_data = (void *)(ACEL_EN | MAGNO_EN),
>> +	},
>> +	{
>> +		.matches = {
>> +			DMI_MATCH(DMI_PRODUCT_NAME, "HP ENVY x360 Convertible 15-cp0xxx"),
>> +		},
>> +		.driver_data = (void *)(ACEL_EN | MAGNO_EN),
>> +	},
>> +	{ }
>> +};
>> +
>>  int amd_mp2_get_sensor_num(struct amd_mp2_dev *privdata, u8 *sensor_id)
>>  {
>>  	int activestatus, num_of_sensors = 0;
>> +	const struct dmi_system_id *dmi_id;
>>  	u32 activecontrolstatus;
>>  
>> +	if (sensor_mask_override == -1) {
>> +		dmi_id = dmi_first_match(dmi_sensor_mask_overrides);
>> +		if (dmi_id)
>> +			sensor_mask_override = (long)dmi_id->driver_data;
>> +	}
>> +
>>  	if (sensor_mask_override >= 0) {
>>  		activestatus = sensor_mask_override;
>>  	} else {
> Can you please confirm that HP Envy x360  is whether ryzen 4000 (Renior based) series or ryzen 3000 (Raven based) series? As of now current upstream code does not have support for Ryzen 4000 series
> for which work is in progress. However, for Ryzen 3000 based series this patch looks fine and thanks for the contribution.

Both models added to the dmi_sensor_mask_overrides table here use Raven-Ridge SoCs,
they ship with the following CPU options:

Ryzen 3 2300U
Ryzen 5 2500U
Ryzen 7 2700U

So I think we should be good to go wrt merging this set.

Since this set is basically a bugfix set it would be nice if we can get
this merged into one of the 5.12-rc#s.

Regards,

Hans


  parent reply	other threads:[~2021-02-22 11:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28 12:12 [PATCH 0/3] AMD_SFH: Allow overriding sensor-mask by module-param or DMI-quirk Hans de Goede
2021-01-28 12:12 ` [PATCH 1/3] AMD_SFH: Removed unused activecontrolstatus member from the amd_mp2_dev struct Hans de Goede
2021-01-28 12:12 ` [PATCH 2/3] AMD_SFH: Add sensor_mask module parameter Hans de Goede
2021-01-28 12:12 ` [PATCH 3/3] AMD_SFH: Add DMI quirk table for BIOS-es which don't set the activestatus bits Hans de Goede
2021-02-15  8:24   ` Shah, Nehal-bakulchandra
2021-02-15  9:02     ` Richard Neumann
2021-02-22 11:53     ` Hans de Goede [this message]
     [not found]       ` <09f1754a-9299-7b83-5e3f-001c2d6ca6f1@amd.com>
2021-02-24 19:30         ` Hans de Goede
2021-01-28 13:24 ` [PATCH 0/3] AMD_SFH: Allow overriding sensor-mask by module-param or DMI-quirk Richard Neumann
2021-03-08 15:33 ` Jiri Kosina

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=3a2857a3-f8cb-bc0f-fe41-3bc101b817d7@redhat.com \
    --to=hdegoede@redhat.com \
    --cc="Shyam-sundar.S-k\""@amd.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=mail@richard-neumann.de \
    --cc=nehal-bakulchandra.shah@amd.com \
    --cc=sandeep.singh@amd.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 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.