linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marius Hoch <mail@mariushoch.de>
To: Jean Delvare <jdelvare@suse.de>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] i2c: i801: Force no IRQ for Dell Latitude E7450
Date: Sun, 18 Jun 2023 15:08:03 +0200	[thread overview]
Message-ID: <2648642f-3078-aebf-7920-7eceed044dc8@mariushoch.de> (raw)
In-Reply-To: <20230604163855.5b7ea1e0@endymion.delvare>

Hi Jean,

On 04/06/2023 16:38, Jean Delvare wrote:
> On Sun, 14 May 2023 12:36:33 +0200, Marius Hoch wrote:
>> The Dell Latitude E7450 uses IRQ 18 for the accelerometer,
>> but also claims that the SMBus uses IRQ 18. This will
>> result in:
>>
>> i801_smbus 0000:00:1f.3: PCI INT C: failed to register GSI
>> i801_smbus 0000:00:1f.3: Failed to enable SMBus PCI device (-16)
>> i801_smbus: probe of 0000:00:1f.3 failed with error -16
>>
>> Force the SMBus IRQ to IRQ_NOTCONNECTED in this case, so that
>> we fall back to polling, which also seems to be what the (very
>> dated) Windows 7 drivers on the Dell Latitude E7450 do.
>>
>> This was tested on Dell Latitude E7450.
>>
>> Signed-off-by: Marius Hoch <mail@mariushoch.de>
>> ---
>>   drivers/i2c/busses/i2c-i801.c | 20 ++++++++++++++++++++
>>   1 file changed, 20 insertions(+)
>>
>> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
>> index ac5326747c51..5fd2ac585160 100644
>> --- a/drivers/i2c/busses/i2c-i801.c
>> +++ b/drivers/i2c/busses/i2c-i801.c
>> @@ -1624,6 +1624,20 @@ static void i801_setup_hstcfg(struct i801_priv *priv)
>>   	pci_write_config_byte(priv->pci_dev, SMBHSTCFG, hstcfg);
>>   }
>>   
>> +/**
> As reported by the kernel test robot, please don't start a comment with
> /** unless it's a kernel-doc-style comment.
>
>> + * These DELL devices claim an IRQ for the SMBus (usually 18), but we can't use
>> + * it, as its actually for the I2C accelerometer.
>> + */
>> +static const struct dmi_system_id dmi_force_no_irq[] = {
>> +	{
>> +		.matches = {
>> +			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
>> +			DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E7450"),
>> +		},
>> +	},
>> +	{} /* Terminating entry */
>> +};
>> +
>>   static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
>>   {
>>   	int err, i;
>> @@ -1657,6 +1671,12 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
>>   	if (!(priv->features & FEATURE_BLOCK_BUFFER))
>>   		priv->features &= ~FEATURE_BLOCK_PROC;
>>   
>> +	if (dmi_check_system(dmi_force_no_irq)) {
> If the problem is caused by dev->irq being 255, and now that we know
> that this value is special on x86, wouldn't it make more sense to
> restrict this quirk to CONFIG_X86 and simply check for dev->irq ==
> 0xff? This would save us the extra effort of maintaining a list of
> machines which need the quirk.
>
>> +		/* Force no IRQ for these devices, otherwise pcim_enable_device will fail */
>> +		dev->irq = IRQ_NOTCONNECTED;
>> +		dev->irq_managed = 1;
> This field is undocumented so I have no idea what it does. Is it not
> sufficient to set irq to IRQ_NOTCONNECTED?
If irq_managed is not set our irq value will be entirely ignored it 
seems (thus leading to the same code path/ failure initially outlined).
>
>> +	}
>> +
>>   	err = pcim_enable_device(dev);
>>   	if (err) {
>>   		dev_err(&dev->dev, "Failed to enable SMBus PCI device (%d)\n",
>


  reply	other threads:[~2023-06-18 13:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-14 10:36 [PATCH 0/2] i2c: i801: Force no IRQ for Dell Latitude E7450 Marius Hoch
2023-05-14 10:36 ` [PATCH 1/2] " Marius Hoch
2023-05-14 12:06   ` kernel test robot
2023-05-14 12:06   ` kernel test robot
2023-06-04 14:38   ` Jean Delvare
2023-06-18 13:08     ` Marius Hoch [this message]
2023-05-14 10:36 ` [PATCH 2/2] i2c: i801: Force no IRQ for further Dell Latitudes Marius Hoch
2023-05-23 18:03 ` [PATCH 0/2] i2c: i801: Force no IRQ for Dell Latitude E7450 Jean Delvare
2023-06-03  9:24   ` Marius Hoch
2023-06-04 14:01     ` Jean Delvare
2023-06-04 14:31       ` Jean Delvare
2023-06-04 20:41       ` Rudolf Marek
2023-06-18 12:52         ` Marius Hoch
2023-06-18 13:42       ` Marius Hoch
2023-06-19 15:19         ` Jean Delvare
2023-07-19 19:27         ` Pali Rohár
2023-10-29 17:17 ` Wolfram Sang

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=2648642f-3078-aebf-7920-7eceed044dc8@mariushoch.de \
    --to=mail@mariushoch.de \
    --cc=jdelvare@suse.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).