[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <410670D7E743164D87FA6160E7907A56013135A5A0@am04wembxa.internal.synopsys.com>
Date: Tue, 29 May 2018 14:45:10 +0000
From: Minas Harutyunyan <Minas.Harutyunyan@...opsys.com>
To: William Wu <william.wu@...k-chips.com>,
"Minas.Harutyunyan@...opsys.com" <Minas.Harutyunyan@...opsys.com>,
"felipe.balbi@...ux.intel.com" <felipe.balbi@...ux.intel.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
CC: "sergei.shtylyov@...entembedded.com"
<sergei.shtylyov@...entembedded.com>,
"heiko@...ech.de" <heiko@...ech.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-rockchip@...ts.infradead.org"
<linux-rockchip@...ts.infradead.org>,
"frank.wang@...k-chips.com" <frank.wang@...k-chips.com>,
"huangtao@...k-chips.com" <huangtao@...k-chips.com>,
"dianders@...gle.com" <dianders@...gle.com>,
"daniel.meng@...k-chips.com" <daniel.meng@...k-chips.com>,
"John.Youn@...opsys.com" <John.Youn@...opsys.com>,
"fml@...k-chips.com" <fml@...k-chips.com>
Subject: Re: [PATCH] usb: dwc2: fix the incorrect bitmaps for the ports of
multi_tt hub
Acked-by Minas Harutyunyan hminas@...opsys.com>
On 5/21/2018 2:13 PM, William Wu wrote:
> The dwc2_get_ls_map() use ttport to reference into the
> bitmap if we're on a multi_tt hub. But the bitmaps index
> from 0 to (hub->maxchild - 1), while the ttport index from
> 1 to hub->maxchild. This will cause invalid memory access
> when the number of ttport is hub->maxchild.
>
> Without this patch, I can easily meet a Kernel panic issue
> if connect a low-speed USB mouse with the max port of FE2.1
> multi-tt hub (1a40:0201) on rk3288 platform.
>
> Signed-off-by: William Wu <william.wu@...k-chips.com>
> ---
> drivers/usb/dwc2/hcd_queue.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c
> index d7c3d6c..9c55d1a 100644
> --- a/drivers/usb/dwc2/hcd_queue.c
> +++ b/drivers/usb/dwc2/hcd_queue.c
> @@ -383,7 +383,7 @@ static unsigned long *dwc2_get_ls_map(struct dwc2_hsotg *hsotg,
> /* Get the map and adjust if this is a multi_tt hub */
> map = qh->dwc_tt->periodic_bitmaps;
> if (qh->dwc_tt->usb_tt->multi)
> - map += DWC2_ELEMENTS_PER_LS_BITMAP * qh->ttport;
> + map += DWC2_ELEMENTS_PER_LS_BITMAP * (qh->ttport - 1);
>
> return map;
> }
>
Powered by blists - more mailing lists