From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Klara Modin <klarasmodin@gmail.com>, gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, stern@rowland.harvard.edu
Subject: Re: [PATCH v2] usb: usb-acpi: Set port connect type of not connectable ports correctly
Date: Fri, 8 Mar 2024 11:37:18 +0200 [thread overview]
Message-ID: <7095a67d-b82d-6411-a9b9-ece40d572ad1@linux.intel.com> (raw)
In-Reply-To: <78fb735f-3279-40a3-8d12-201a62b13942@gmail.com>
On 7.3.2024 19.28, Klara Modin wrote:
> On 2024-03-07 17:04, Klara Modin wrote:
>> Hi,
>>
>> On 2024-02-23 15:03, Mathias Nyman wrote:
>>> Ports with _UPC (USB Port Capability) ACPI objects stating they are
>>> "not connectable" are not wired to any connector or internal device.
>>> They only exist inside the host controller.
>>>
>>> These ports may not have an ACPI _PLD (Physical Location of Device)
>>> object.
>>>
>>> Rework the code so that _UPC is read even if _PLD does not exist, and
>>> make sure the port->connect_type is set to "USB_PORT_NOT_USED" instead
>>> of "USB_PORT_CONNECT_TYPE_UNKNOWN".
>>>
>>> No bugs or known issues are reported due to possibly not parsing _UPC,
>>> and thus leaving the port connect type as "unknown" instead of
>>> "not used". Nice to have this fixed but no need to add it to stable
>>> kernels, or urgency to get it upstream.
>>
>> With this patch (f3ac348e6e04501479fecf55250b25ff2092540b in next-20240307), my machine fails to boot. I was able to get some kernel console output from the pstore when compiling USB support as a module instead of built in. Reverting it on top of next-20240307 resolves the issue for me.
>
> Correction, it does boot when building USB support as a module. Got more logs from the unhealthy system and lspci. lsusb shows a single USB 2.0 root hub and nothing else. Calling it with `-v` hangs and produces nothing useful, the same happens with lshw.
>
>>
>> Please tell me if there's anything else you need.
Thanks for reporting this.
Looks like *pld might never get set in some error cases, and we end up
freeing some random pointer.
i.e if status = acpi_get_physical_device_location(handle, &pld) fails
Could you try if this helps:
diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c
index f250dfc3b14d..7f8a912d4fe2 100644
--- a/drivers/usb/core/usb-acpi.c
+++ b/drivers/usb/core/usb-acpi.c
@@ -154,7 +154,7 @@ usb_acpi_get_connect_type(struct usb_port *port_dev, acpi_handle *handle)
enum usb_port_connect_type connect_type = USB_PORT_CONNECT_TYPE_UNKNOWN;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *upc = NULL;
- struct acpi_pld_info *pld;
+ struct acpi_pld_info *pld = NULL;
acpi_status status;
/*
Thanks
Mathias
next prev parent reply other threads:[~2024-03-08 9:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-23 14:03 [PATCH v2] usb: usb-acpi: Set port connect type of not connectable ports correctly Mathias Nyman
2024-03-07 16:04 ` Klara Modin
2024-03-07 17:28 ` Klara Modin
2024-03-08 9:37 ` Mathias Nyman [this message]
2024-03-08 10:19 ` Klara Modin
2024-03-08 11:29 ` Mathias Nyman
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=7095a67d-b82d-6411-a9b9-ece40d572ad1@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=klarasmodin@gmail.com \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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