From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Badhri Jagan Sridharan <badhri@google.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"felipe.balbi@linux.intel.com" <felipe.balbi@linux.intel.com>,
"robh@kernel.org" <robh@kernel.org>,
"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
John Youn <John.Youn@synopsys.com>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"jameswei@google.com" <jameswei@google.com>,
"stable@kernel.org" <stable@kernel.org>
Subject: Re: [PATCH v1 2/2] usb: dwc3: core: Obtain imod_interval from device tree
Date: Tue, 4 Feb 2025 00:46:44 +0000 [thread overview]
Message-ID: <20250204004638.cacmapvsp5vlewir@synopsys.com> (raw)
In-Reply-To: <20250202035100.31235-2-badhri@google.com>
On Sun, Feb 02, 2025, Badhri Jagan Sridharan wrote:
> Although commit cf40b86b6ef6 ("usb: dwc3: Implement interrupt
> moderation") adds support for interrupt moderation in device
> mode, it does not add an option to enable interrupt moderation
> unless the version of the controller is 3.00a where the
> interrupt moderation is automatically enabled. This patch
> reads the interrupt moderation interval counter value from
> device tree so that the interrupt moderation can be enabled
> through the device tree.
>
> The explicit initialization to 0 can be avoided as the dwc3
> struct is kzalloc'ed.
>
> Cc: stable@kernel.org
> Fixes: cf40b86b6ef6 ("usb: dwc3: Implement interrupt moderation")
> Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
> ---
> drivers/usb/dwc3/core.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index dfa1b5fe48dc..be0d302bbab7 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -1818,6 +1818,9 @@ static void dwc3_get_properties(struct dwc3 *dwc)
> dwc->dis_split_quirk = device_property_read_bool(dev,
> "snps,dis-split-quirk");
>
> + device_property_read_u16(dev, "snps,device-mode-intrpt-mod-interval",
> + &dwc->imod_interval);
> +
This value will get overwritten in dwc3_check_params() for DWC_usb3
v3.00a.
> dwc->lpm_nyet_threshold = lpm_nyet_threshold;
> dwc->tx_de_emphasis = tx_de_emphasis;
>
> @@ -1835,8 +1838,6 @@ static void dwc3_get_properties(struct dwc3 *dwc)
> dwc->tx_thr_num_pkt_prd = tx_thr_num_pkt_prd;
> dwc->tx_max_burst_prd = tx_max_burst_prd;
>
> - dwc->imod_interval = 0;
> -
> dwc->tx_fifo_resize_max_num = tx_fifo_resize_max_num;
> }
>
> --
> 2.48.1.362.g079036d154-goog
>
Do you need a property to adjust the IMOD interval? If not, just enable
it for all capable devices (dwc3_has_imod) with IMODI of 1 for now. It
should be good to have it enabled for all capable devices by default.
BR,
Thinh
next prev parent reply other threads:[~2025-02-04 0:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-02 3:50 [PATCH v1 1/2] dt-bindings: usb: snps,dwc3: Add property for imod Badhri Jagan Sridharan
2025-02-02 3:51 ` [PATCH v1 2/2] usb: dwc3: core: Obtain imod_interval from device tree Badhri Jagan Sridharan
2025-02-04 0:46 ` Thinh Nguyen [this message]
2025-02-05 8:39 ` Badhri Jagan Sridharan
2025-02-02 14:11 ` [PATCH v1 1/2] dt-bindings: usb: snps,dwc3: Add property for imod Krzysztof Kozlowski
2025-02-02 19:57 ` Krzysztof Kozlowski
2025-02-05 9:07 ` Badhri Jagan Sridharan
2025-02-05 13:50 ` Krzysztof Kozlowski
2025-02-05 18:19 ` Badhri Jagan Sridharan
2025-02-05 19:35 ` Krzysztof Kozlowski
2025-02-07 5:15 ` Badhri Jagan Sridharan
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=20250204004638.cacmapvsp5vlewir@synopsys.com \
--to=thinh.nguyen@synopsys.com \
--cc=John.Youn@synopsys.com \
--cc=badhri@google.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=felipe.balbi@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jameswei@google.com \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=robh@kernel.org \
--cc=stable@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