All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <florian.fainelli@broadcom.com>
To: Sam Edwards <cfsworks@gmail.com>,
	Justin Chen <justin.chen@broadcom.com>,
	Al Cooper <alcooperx@gmail.com>
Cc: Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	Vinod Koul <vkoul@kernel.org>,
	Kishon Vijay Abraham I <kishon@kernel.org>,
	linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org
Subject: Re: [PATCH] phy: usb: fix Broadcom driver table indexing error
Date: Thu, 3 Oct 2024 15:47:47 -0700	[thread overview]
Message-ID: <697604f4-ea38-4cfd-a4a8-3a346d4735db@broadcom.com> (raw)
In-Reply-To: <20241003211720.1339468-1-CFSworks@gmail.com>

On 10/3/24 14:17, Sam Edwards wrote:
> The Broadcom USB PHY driver contains a lookup table
> (`reg_bits_map_tables`) to resolve register bitmaps unique to certain
> versions of the USB PHY as found in various Broadcom chip families.
> Historically, this table was just kept carefully in sync with the
> "selector" enum every time the latter changed to ensure consistency.
> However, a recent commit (see 'fixes' tag) introduced two new
> enumerators but did not adjust the array for BCM4908, thus breaking the
> xHCI controller (and boot process) on this platform and revealing the
> fragility of this approach.
> 
> Since these arrays are a little sparse (many elements are zero) and the
> position of the array elements is significant only insofar as they agree
> with the enumerators, designated initializers are a better fit than
> positional initializers here. Convert this table accordingly, fixing the
> boot-time crash on BCM4908 in the process.
> 
> Fixes: 4536fe9640b6 ("phy: usb: suppress OC condition for 7439b2")
> Signed-off-by: Sam Edwards <CFSworks@gmail.com>

Thanks a bunch for the fix, good catch! Sorry to ask you this, but since 
this is intended to be backported to stable trees at some point, would 
you mind breaking this up in two commits:

- one which is easy to review and audit and which adjusts the BCM4908 entry
- another one which converts to using designated index constants?

Thanks!
-- 
Florian

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

WARNING: multiple messages have this Message-ID (diff)
From: Florian Fainelli <florian.fainelli@broadcom.com>
To: Sam Edwards <cfsworks@gmail.com>,
	Justin Chen <justin.chen@broadcom.com>,
	Al Cooper <alcooperx@gmail.com>
Cc: Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	Vinod Koul <vkoul@kernel.org>,
	Kishon Vijay Abraham I <kishon@kernel.org>,
	linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org
Subject: Re: [PATCH] phy: usb: fix Broadcom driver table indexing error
Date: Thu, 3 Oct 2024 15:47:47 -0700	[thread overview]
Message-ID: <697604f4-ea38-4cfd-a4a8-3a346d4735db@broadcom.com> (raw)
In-Reply-To: <20241003211720.1339468-1-CFSworks@gmail.com>

On 10/3/24 14:17, Sam Edwards wrote:
> The Broadcom USB PHY driver contains a lookup table
> (`reg_bits_map_tables`) to resolve register bitmaps unique to certain
> versions of the USB PHY as found in various Broadcom chip families.
> Historically, this table was just kept carefully in sync with the
> "selector" enum every time the latter changed to ensure consistency.
> However, a recent commit (see 'fixes' tag) introduced two new
> enumerators but did not adjust the array for BCM4908, thus breaking the
> xHCI controller (and boot process) on this platform and revealing the
> fragility of this approach.
> 
> Since these arrays are a little sparse (many elements are zero) and the
> position of the array elements is significant only insofar as they agree
> with the enumerators, designated initializers are a better fit than
> positional initializers here. Convert this table accordingly, fixing the
> boot-time crash on BCM4908 in the process.
> 
> Fixes: 4536fe9640b6 ("phy: usb: suppress OC condition for 7439b2")
> Signed-off-by: Sam Edwards <CFSworks@gmail.com>

Thanks a bunch for the fix, good catch! Sorry to ask you this, but since 
this is intended to be backported to stable trees at some point, would 
you mind breaking this up in two commits:

- one which is easy to review and audit and which adjusts the BCM4908 entry
- another one which converts to using designated index constants?

Thanks!
-- 
Florian

  reply	other threads:[~2024-10-03 22:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-03 21:17 [PATCH] phy: usb: fix Broadcom driver table indexing error Sam Edwards
2024-10-03 21:17 ` Sam Edwards
2024-10-03 22:47 ` Florian Fainelli [this message]
2024-10-03 22:47   ` Florian Fainelli
2024-10-04  2:19   ` Sam Edwards
2024-10-04  2:19     ` Sam Edwards

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=697604f4-ea38-4cfd-a4a8-3a346d4735db@broadcom.com \
    --to=florian.fainelli@broadcom.com \
    --cc=alcooperx@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=cfsworks@gmail.com \
    --cc=justin.chen@broadcom.com \
    --cc=kishon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=vkoul@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.