linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Akihiko Odaki <akihiko.odaki@gmail.com>
To: "Limonciello, Mario" <mario.limonciello@amd.com>
Cc: Basavaraj Natikar <basavaraj.natikar@amd.com>,
	Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] HID: amd_sfh: Ignore uninitialized device
Date: Wed, 29 Jun 2022 00:11:46 +0900	[thread overview]
Message-ID: <8c95e3d7-cff6-c56e-e197-fdd0911d81aa@gmail.com> (raw)
In-Reply-To: <b17f4e85-8a35-65ab-34de-0978bdc4cfea@amd.com>

On 2022/06/28 23:42, Limonciello, Mario wrote:
> On 6/26/2022 03:13, Akihiko Odaki wrote:
>> Lenovo ThinkPad C13 Yoga has AMD Sensor Fusion Hub, but it is not used
>> because Chrome OS EC Sensor Hub is used instead. The system therefore
>> never loads the firmware for MP2 and MP2 does not work. It results in
>> AMD_P2C_MSG3 register to have -1 as its value.
>>
>> Without this change, the driver interprets the value as it supports all
>> sensor types and exposes them, which confuses a userspace program,
>> iio-sensor-proxy, and makes it to use the non-functioning sensors
>> instead of functioning sensors exposed via Chrome OS EC Sensor Hub.
>>
>> Check the version bits included in AMD_P2C_MSG3 register and ignore the
>> device if all of the bits are set.
>>
> 
> Have you already confirmed this failure happens in 5.19-rc1 or later as 
> well?  I would think that b5d7f43e97dabfa04a4be5ff027ce7da119332be 
> should have fixed it.

Yes. I confirmed it with 78ca55889a549a9a194c6ec666836329b774ab6d.

b5d7f43e97dabfa04a4be5ff027ce7da119332be deals with the case where it 
advertises v2 but it doesn't in my case.

Regards,
Akihiko Odaki

> 
>> Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
>> ---
>>   drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c 
>> b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
>> index dadc491bbf6b..4137e5da77ad 100644
>> --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
>> +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
>> @@ -271,6 +271,8 @@ static void mp2_select_ops(struct amd_mp2_dev 
>> *privdata)
>>       case V2_STATUS:
>>           privdata->mp2_ops = &amd_sfh_ops_v2;
>>           break;
>> +    case 15:
>> +        break;
>>       default:
>>           privdata->mp2_ops = &amd_sfh_ops;
>>           break;
>> @@ -317,6 +319,8 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, 
>> const struct pci_device_id *i
>>           return -ENOMEM;
>>       mp2_select_ops(privdata);
>> +    if (!privdata->mp2_ops)
>> +        return -ENODEV;
>>       rc = amd_sfh_irq_init(privdata);
>>       if (rc) {
> 


  reply	other threads:[~2022-06-28 15:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-26  8:13 [PATCH] HID: amd_sfh: Ignore uninitialized device Akihiko Odaki
2022-06-28 14:42 ` Limonciello, Mario
2022-06-28 15:11   ` Akihiko Odaki [this message]
2022-06-28 15:14     ` Limonciello, Mario
2022-06-28 15:21       ` Akihiko Odaki
2022-07-07 18:19         ` Limonciello, Mario

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=8c95e3d7-cff6-c56e-e197-fdd0911d81aa@gmail.com \
    --to=akihiko.odaki@gmail.com \
    --cc=basavaraj.natikar@amd.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).