Linux USB
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Tejas Narendra Joglekar <Tejas.Joglekar@synopsys.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH 2/3] usb: dwc3: Move sysdev selection and clamp out of dwc3_get_properties()
Date: Wed, 25 Nov 2026 09:52:10 -0500	[thread overview]
Message-ID: <awb2Ghsu_QaVboaG@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <6f0f6d1316450597da0515dc31954339ebe59482.1795559405.git.Thinh.Nguyen@synopsys.com>

On Tue, Nov 24, 2026 at 10:59:25PM +0000, Thinh Nguyen wrote:
> Select the sysdev and clamp num_hc_interrupters after all properties
> are read, so they can follow values overridden by glue drivers in a
> following change. Move the clamp to dwc3_check_params().
>
> No functional change.
>
> Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> ---
>  drivers/usb/dwc3/core.c | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 372737f4750b..3b2b5fcc627a 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -1761,12 +1761,6 @@ static void dwc3_get_properties(struct dwc3 *dwc)
>
>  	dwc->sysdev_is_parent = device_property_read_bool(dev,
>  				"linux,sysdev_is_parent");
> -	if (dwc->sysdev_is_parent)
> -		dwc->sysdev = dwc->dev->parent;
> -	else
> -		dwc->sysdev = dwc->dev;
> -
> -	dwc->sys_wakeup = device_may_wakeup(dwc->sysdev);
>
>  	dwc->has_lpm_erratum = device_property_read_bool(dev,
>  				"snps,has-lpm-erratum");
> @@ -1802,9 +1796,6 @@ static void dwc3_get_properties(struct dwc3 *dwc)
>  				&tx_max_burst_prd);
>  	device_property_read_u16(dev, "num-hc-interrupters",
>  				 &num_hc_interrupters);
> -	/* DWC3 core allowed to have a max of 8 interrupters */
> -	if (num_hc_interrupters > 8)
> -		num_hc_interrupters = 8;
>
>  	dwc->do_fifo_resize = device_property_read_bool(dev,
>  							"tx-fifo-resize");
> @@ -2001,6 +1992,10 @@ static void dwc3_check_params(struct dwc3 *dwc)
>  			break;
>  		}
>  	}
> +
> +	/* DWC3 core allowed to have a max of 8 interrupters */
> +	if (dwc->num_hc_interrupters > 8)
> +		dwc->num_hc_interrupters = 8;
>  }
>
>  static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc)
> @@ -2315,9 +2310,15 @@ int dwc3_core_probe(const struct dwc3_probe_data *data)
>  	dwc->regs_size	= resource_size(&dwc_res);
>
>  	dwc3_get_properties(dwc);
> -

Nit: avoid this unrelated change.

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  	dwc3_get_software_properties(dwc, &data->properties);
>
> +	if (dwc->sysdev_is_parent)
> +		dwc->sysdev = dwc->dev->parent;
> +	else
> +		dwc->sysdev = dwc->dev;
> +
> +	dwc->sys_wakeup = device_may_wakeup(dwc->sysdev);
> +
>  	spin_lock_init(&dwc->lock);
>
>  	dwc3_get_usb_power_supply(dwc);
> --
> 2.53.0

  reply	other threads:[~2026-11-25 14:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 22:59 [PATCH 0/3] usb: dwc3: Let glue drivers override all dwc3 properties Thinh Nguyen
2026-11-24 22:59 ` [PATCH 1/3] usb: dwc3: Group glue-overridable properties in struct dwc3 Thinh Nguyen
2026-11-25  3:28   ` Xu Yang
2026-11-25 14:47   ` Frank Li
2026-11-24 22:59 ` [PATCH 2/3] usb: dwc3: Move sysdev selection and clamp out of dwc3_get_properties() Thinh Nguyen
2026-11-25 14:52   ` Frank Li [this message]
2026-11-24 22:59 ` [PATCH 3/3] usb: dwc3: Allow glue drivers to override all dwc3_properties Thinh Nguyen
2026-11-25  3:30   ` Xu Yang
2026-11-25 14:54   ` Frank Li
2026-11-25 15:47   ` Sven Peter
2026-11-25 19:11   ` Krishna Kurapati
2026-11-26 12:49   ` André Draszik
2026-11-24 23:04 ` [PATCH 0/3] usb: dwc3: Let glue drivers override all dwc3 properties sashiko-bot
2026-12-03 21:12 ` Greg Kroah-Hartman

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=awb2Ghsu_QaVboaG@lizhi-Precision-Tower-5810 \
    --to=frank.li@oss.nxp.com \
    --cc=Tejas.Joglekar@synopsys.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox