From: "Michał Kopeć" <michal@nozomi.space>
To: linux-usb@vger.kernel.org
Subject: Issue with TPS6598x driver on ThinkPad T14 Gen1
Date: Thu, 07 Dec 2023 21:38:37 +0100 [thread overview]
Message-ID: <DCDB5S.JWZAY91S31EN1@nozomi.space> (raw)
Greetings,
I've been looking into fixing this error in dmesg relating to the
tps6598x driver on my Lenovo ThinkPad T14 Gen1 AMD:
[ 12.808694] Serial bus multi instantiate pseudo device driver
INT3515:00: error -ENXIO: IRQ index 1 not found
[ 12.808706] Serial bus multi instantiate pseudo device driver
INT3515:00: error -ENXIO: Error requesting irq at index 1
Here's what the device resources look like in the ACPI tables:
Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings
{
Name (SBFX, ResourceTemplate ()
{
I2cSerialBusV2 (0x0023, ControllerInitiated, 0x00061A80,
AddressingMode7Bit, "\\_SB.I2CA",
0x00, ResourceConsumer, , Exclusive,
)
I2cSerialBusV2 (0x0027, ControllerInitiated, 0x00061A80,
AddressingMode7Bit, "\\_SB.I2CA",
0x00, ResourceConsumer, , Exclusive,
)
GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullUp, 0x0000,
"\\_SB.GPIO", 0x00, ResourceConsumer, ,
)
{ // Pin list
0x0045
}
})
Return (SBFX) /* \_SB_.I2CA.UCMX._CRS.SBFX */
}
I believe the problem is that the serial-multi-instantiate driver is
assuming there are separate irqs defined for each of the i2c device
instances:
static const struct smi_node int3515_data = {
.instances = {
{ "tps6598x", IRQ_RESOURCE_APIC, 0 },
{ "tps6598x", IRQ_RESOURCE_APIC, 1 },
{ "tps6598x", IRQ_RESOURCE_APIC, 2 },
{ "tps6598x", IRQ_RESOURCE_APIC, 3 },
{}
},
.bus_type = SMI_I2C,
};
However as far as I know the tps6598x family of PD controllers expose
multiple i2c slaves (per USB-C port) with one shared irq. I modified
the smi driver as follows:
static const struct smi_node int3515_data = {
.instances = {
{ "tps6598x", IRQ_RESOURCE_AUTO, 0 },
{ "tps6598x", IRQ_RESOURCE_AUTO, 0 },
{ "tps6598x", IRQ_RESOURCE_AUTO, 0 },
{ "tps6598x", IRQ_RESOURCE_AUTO, 0 },
{}
},
.bus_type = SMI_I2C,
};
which resulted in a successful probe of the driver and creation of
port{0,1} entries in /sys/class/typec:
[ 49.742618] Serial bus multi instantiate pseudo device driver
INT3515:00: Using gpio irq
[ 49.747584] Serial bus multi instantiate pseudo device driver
INT3515:00: Using gpio irq
[ 49.752350] Serial bus multi instantiate pseudo device driver
INT3515:00: Instantiated 2 I2C devices.
So I guess my question for y'all is this: would this be an acceptable
change to make in the driver? If so, I'd be happy to push out the
patch. Or is it a case of the ACPI tables being bugged and I need to
pester Lenovo to fix them? Or, do we need to add logic to the driver to
handle both cases?
It would be nice if the authors of the driver could chime in.
Kind regards / Pozdrawiam,
Michał Kopeć
reply other threads:[~2023-12-07 20:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=DCDB5S.JWZAY91S31EN1@nozomi.space \
--to=michal@nozomi.space \
--cc=linux-usb@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