lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250204004638.cacmapvsp5vlewir@synopsys.com>
Date: Tue, 4 Feb 2025 00:46:44 +0000
From: Thinh Nguyen <Thinh.Nguyen@...opsys.com>
To: Badhri Jagan Sridharan <badhri@...gle.com>
CC: Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "felipe.balbi@...ux.intel.com" <felipe.balbi@...ux.intel.com>,
        "robh@...nel.org" <robh@...nel.org>,
        "krzk+dt@...nel.org" <krzk+dt@...nel.org>,
        "conor+dt@...nel.org" <conor+dt@...nel.org>,
        John Youn <John.Youn@...opsys.com>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "jameswei@...gle.com" <jameswei@...gle.com>,
        "stable@...nel.org" <stable@...nel.org>
Subject: Re: [PATCH v1 2/2] usb: dwc3: core: Obtain imod_interval from device
 tree

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@...nel.org
> Fixes: cf40b86b6ef6 ("usb: dwc3: Implement interrupt moderation")
> Signed-off-by: Badhri Jagan Sridharan <badhri@...gle.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ