All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Atharva Tiwari <atharvatiwarilinuxdev@gmail.com>
Cc: "open list:USB SUBSYSTEM" <linux-usb@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] usb: acpi: Get correct location data for Apple macs
Date: Mon, 23 Nov 2026 07:45:19 +0100	[thread overview]
Message-ID: <2026112344-jaybird-glancing-b56a@gregkh> (raw)
In-Reply-To: <20261123062519.11531-1-atharvatiwarilinuxdev@gmail.com>

On Mon, Nov 23, 2026 at 01:25:17AM -0500, Atharva Tiwari wrote:
> In All macs, the _PLD values in ACPI is just garbage values
> and provide no real data, and that may cause errors like:
> 
> usb: port power management may be unreliable
> 
> On Internal controllers, with multiple USB2.0 and USB3.0.
> 
> To fix this we use Apple's own location methods called SSP
> for USB2.0, and they use _ADR for USB3.0.
> 
> With this patch we get proper location and peering:
> 
> [    0.280281] usb usb2-port2: peered to usb1-port10
> [    0.280298] usb usb2-port3: peered to usb1-port3
> [    0.280311] usb usb2-port4: peered to usb1-port14
> [    0.280325] usb usb2-port5: peered to usb1-port8
> [    0.280354] usb usb2-port9: peered to usb1-port9
> 
> NOTE: All USB controller has bad _PLD values but SSP is only available
>       on internal USB controller, and even only new intel macs has SSP
>       method, so we check for SSP and XHC1 before using apple's methods.
> 
> Signed-off-by: Atharva Tiwari <atharvatiwarilinuxdev@gmail.com>
> ---
> Changes in v2:
> - Nulled location provided by _PLD in apple_get_location
> - Fixed typos.
> 
> Link to v1:
> https://lore.kernel.org/all/20261123053911.9856-1-atharvatiwarilinuxdev@gmail.com/

Please slow down, there is no rush.  One patch per 24 hours max.

> 
>  drivers/usb/core/usb-acpi.c | 74 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 74 insertions(+)
> 
> diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c
> index 489dbdc96..403c2ff44 100644
> --- a/drivers/usb/core/usb-acpi.c
> +++ b/drivers/usb/core/usb-acpi.c
> @@ -12,6 +12,7 @@
>  #include <linux/acpi.h>
>  #include <linux/pci.h>
>  #include <linux/usb/hcd.h>
> +#include <linux/platform_data/x86/apple.h>
>  
>  #include "hub.h"
>  
> @@ -199,6 +200,69 @@ static int usb_acpi_add_usb4_devlink(struct usb_device *udev)
>   */
>  #define USB_ACPI_LOCATION_VALID (1 << 31)
>  
> +/*
> + * Set at registration time on x86 Apple Macs whose internal XHC1 controller
> + * has ports exposing an SSP object. Apple reports the port location through
> + * SSP (USB 2.0) and _ADR (USB 3.x) instead of _PLD.
> + */
> +static bool is_apple_location;

Again, why is this needed and not just calculated at the one place you
actually use it?

thanks,

greg k-h

  parent reply	other threads:[~2026-11-23  6:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  6:25 [PATCH v2] usb: acpi: Get correct location data for Apple macs Atharva Tiwari
2026-11-23  6:33 ` sashiko-bot
2026-11-23  6:45 ` Greg Kroah-Hartman [this message]
2026-11-23  7:01   ` Atharva Tiwari
2026-11-30  9:50 ` Atharva Tiwari
2026-11-30 11:56   ` Greg KH

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=2026112344-jaybird-glancing-b56a@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=atharvatiwarilinuxdev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 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.