Hi,

John Youn <[email protected]> writes:
> Implement interrupt moderation which allows the interrupt rate to be
> throttled. To enable this feature the dwc->imod_interval must be set to
> 1 or greater. This value specifies the minimum inter-interrupt interval,
> in 250 ns increments. A value of 0 disables interrupt moderation.
>
> This applies for DWC_usb3 version 3.00a and higher and for DWC_usb31
> version 1.20a and higher.
>
> Signed-off-by: John Youn <[email protected]>
> ---
>  drivers/usb/dwc3/core.c   | 16 ++++++++++++++++
>  drivers/usb/dwc3/core.h   | 15 +++++++++++++++
>  drivers/usb/dwc3/gadget.c | 16 ++++++++++++++++
>  3 files changed, 47 insertions(+)
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index f0bb6df..dbd6408 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -1021,12 +1021,28 @@ static void dwc3_get_properties(struct dwc3 *dwc)
>       dwc->hird_threshold = hird_threshold
>               | (dwc->is_utmi_l1_suspend << 4);
>  
> +     dwc->imod_interval = 0;
> +}
> +
> +/* check whether the core supports IMOD */
> +bool dwc3_has_imod(struct dwc3 *dwc)
> +{
> +     return ((dwc3_is_usb3(dwc) &&
> +              dwc->revision >= DWC3_REVISION_300A) ||
> +             (dwc3_is_usb31(dwc) &&
> +              dwc->revision >= DWC3_USB31_REVISION_120A));
>  }

looks like this could be a static inline in core.h

>  static void dwc3_check_params(struct dwc3 *dwc)
>  {
>       struct device *dev = dwc->dev;
>  
> +     /* Check for proper value of imod_interval */
> +     if (dwc->imod_interval && !dwc3_has_imod(dwc)) {
> +             dev_warn(dwc->dev, "Interrupt moderation not supported\n");

looks like dev_info() is enough here. Perhaps, even, dev_dbg().

-- 
balbi

Attachment: signature.asc
Description: PGP signature

Reply via email to