提交 a40c4f80 编写于 作者: G Geert Uytterhoeven 提交者: Zheng Zengkai

usb: gadget: Mark USB_FSL_QE broken on 64-bit

stable inclusion
from stable-5.10.79
commit 27409143122f9c68f74da42ce987cc6badb40784
bugzilla: 185793 https://gitee.com/openeuler/kernel/issues/I4K65C

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=27409143122f9c68f74da42ce987cc6badb40784

--------------------------------

commit a0548b26 upstream.

On 64-bit:

    drivers/usb/gadget/udc/fsl_qe_udc.c: In function ‘qe_ep0_rx’:
    drivers/usb/gadget/udc/fsl_qe_udc.c:842:13: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      842 |     vaddr = (u32)phys_to_virt(in_be32(&bd->buf));
	  |             ^
    In file included from drivers/usb/gadget/udc/fsl_qe_udc.c:41:
    drivers/usb/gadget/udc/fsl_qe_udc.c:843:28: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
      843 |     frame_set_data(pframe, (u8 *)vaddr);
	  |                            ^

The driver assumes physical and virtual addresses are 32-bit, hence it
cannot work on 64-bit platforms.
Acked-by: NLi Yang <leoyang.li@nxp.com>
Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/20211027080849.3276289-1-geert@linux-m68k.org
Cc: stable <stable@vger.kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NBin Li <huawei.libin@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 ca668928
...@@ -330,6 +330,7 @@ config USB_AMD5536UDC ...@@ -330,6 +330,7 @@ config USB_AMD5536UDC
config USB_FSL_QE config USB_FSL_QE
tristate "Freescale QE/CPM USB Device Controller" tristate "Freescale QE/CPM USB Device Controller"
depends on FSL_SOC && (QUICC_ENGINE || CPM) depends on FSL_SOC && (QUICC_ENGINE || CPM)
depends on !64BIT || BROKEN
help help
Some of Freescale PowerPC processors have a Full Speed Some of Freescale PowerPC processors have a Full Speed
QE/CPM2 USB controller, which support device mode with 4 QE/CPM2 USB controller, which support device mode with 4
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册