Re: [PATCH v3] usb: gadget: configfs: Fix KASAN use-after-free

2017-02-09 Thread Macpaul Lin
in "Android Linux" or "Chromium OS". I'm not sure about the difference between Chromium OS and Linux PC. According to CVE report, it looks like the change is from Chromium OS? Dose Nvidia has a pure Linux software team can verify your patch on your platform? I think if you can prove the result is okay on Linux PC or on Chromium OS will help. -- Best regards, Macpaul Lin

[PATCH v3] usb: mtu3: fix panic in mtu3_gadget_stop()

2020-08-27 Thread Macpaul Lin
mit+0xcc/0x108 [] drm_mode_atomic_ioctl+0x1c20/0x2580 [] drm_ioctl_kernel+0x118/0x1b0 [] drm_ioctl+0x5c0/0x920 [] do_vfs_ioctl+0x188/0x1820 [] SyS_ioctl+0x8c/0xa0 Signed-off-by: Macpaul Lin Cc: sta...@vger.kernel.org --- Changes for v3: - Call synchronize_irq() in mtu3_gadget_stop() inst

[PATCH v4] usb: mtu3: fix panic in mtu3_gadget_stop()

2020-08-27 Thread Macpaul Lin
mit+0xcc/0x108 [] drm_mode_atomic_ioctl+0x1c20/0x2580 [] drm_ioctl_kernel+0x118/0x1b0 [] drm_ioctl+0x5c0/0x920 [] do_vfs_ioctl+0x188/0x1820 [] SyS_ioctl+0x8c/0xa0 Fixes: df2069acb005 ("usb: Add MediaTek USB3 DRD driver") Signed-off-by: Macpaul Lin Cc: sta...@vger.kernel.org --- Changes fo

[PATCH RESEND v2] usb: gadget: configfs: Fix use-after-free issue with udc_name

2020-12-29 Thread Macpaul Lin
f+0xe4/0x12c gadget_dev_desc_UDC_show+0x54/0x64 configfs_read_file+0x210/0x3a0 __vfs_read+0xf0/0x49c vfs_read+0x130/0x2b4 SyS_read+0x114/0x208 el0_svc_naked+0x34/0x38 Add mutex_lock to protect this kind of scenario. Signed-off-by: Eddie Hung Signed-off-by: Macpaul Lin Reviewed-by: Peter C

Re: [PATCH v3] ALSA: usb-audio: disable 96khz support for HUAWEI USB-C HEADSET

2020-11-17 Thread Macpaul Lin
On Tue, 2020-11-10 at 17:04 +0800, Macpaul Lin wrote: > The HUAWEI USB-C headset (VID:0x12d1, PID:0x3a07) reported it supports > 96khz. However there will be some random issue under 96khz. > Not sure if there is any alternate setting could be applied. > Hence 48khz is suggested t

[PATCH] ALSA: usb-audio: disable 96khz support for HUAWEI USB-C HEADSET

2020-11-10 Thread Macpaul Lin
The HUAWEI USB-C headset (VID:0x12d1, PID:0x3a07) reported it supports 96khz. However there will be some random issue under 96khz. Not sure if there is any alternate setting could be applied. Hence 48khz is suggested to be applied at this moment. Signed-off-by: Macpaul Lin Signed-off-by: Eddie

Re: [PATCH] ALSA: usb-audio: disable 96khz support for HUAWEI USB-C HEADSET

2020-11-10 Thread Macpaul Lin
On Tue, 2020-11-10 at 09:12 +0100, Takashi Iwai wrote: > On Tue, 10 Nov 2020 09:04:03 +0100, > Macpaul Lin wrote: > > > > The HUAWEI USB-C headset (VID:0x12d1, PID:0x3a07) reported it supports > > 96khz. However there will be some random issue under 96khz. > > Not

[PATCH v2] ALSA: usb-audio: disable 96khz support for HUAWEI USB-C HEADSET

2020-11-10 Thread Macpaul Lin
The HUAWEI USB-C headset (VID:0x12d1, PID:0x3a07) reported it supports 96khz. However there will be some random issue under 96khz. Not sure if there is any alternate setting could be applied. Hence 48khz is suggested to be applied at this moment. Signed-off-by: Macpaul Lin Signed-off-by: Eddie

Re: [PATCH v2] ALSA: usb-audio: disable 96khz support for HUAWEI USB-C HEADSET

2020-11-10 Thread Macpaul Lin
On Tue, 2020-11-10 at 09:50 +0100, Greg KH wrote: > On Tue, Nov 10, 2020 at 04:42:54PM +0800, Macpaul Lin wrote: > > The HUAWEI USB-C headset (VID:0x12d1, PID:0x3a07) reported it supports > > 96khz. However there will be some random issue under 96khz. > > Not sure if there is

[PATCH v3] ALSA: usb-audio: disable 96khz support for HUAWEI USB-C HEADSET

2020-11-10 Thread Macpaul Lin
The HUAWEI USB-C headset (VID:0x12d1, PID:0x3a07) reported it supports 96khz. However there will be some random issue under 96khz. Not sure if there is any alternate setting could be applied. Hence 48khz is suggested to be applied at this moment. Signed-off-by: Macpaul Lin Signed-off-by: Eddie

[RESEND PATCH v4] usb: mtu3: fix panic in mtu3_gadget_stop()

2020-11-05 Thread Macpaul Lin
mit+0xcc/0x108 [] drm_mode_atomic_ioctl+0x1c20/0x2580 [] drm_ioctl_kernel+0x118/0x1b0 [] drm_ioctl+0x5c0/0x920 [] do_vfs_ioctl+0x188/0x1820 [] SyS_ioctl+0x8c/0xa0 Fixes: df2069acb005 ("usb: Add MediaTek USB3 DRD driver") Signed-off-by: Macpaul Lin Acked-by: Chunfeng Yun Cc: sta...@vg

Re: [PATCH 1/2] dt-bindings: usb: mediatek,mtk-xhci: add keep-clock-on

2020-11-06 Thread Macpaul Lin
On Wed, 2020-11-04 at 16:39 -0600, Rob Herring wrote: > On Mon, Nov 02, 2020 at 03:18:48PM +0800, Macpaul Lin wrote: > > Option "mediatek,keep-clock-on" means to keep clock on during system > > suspend and resume. Some platform will flush register settings if clock h

[PATCH v2 1/2] dt-bindings: usb: mediatek,mtk-xhci: add str-clock-on

2020-11-06 Thread Macpaul Lin
Option "mediatek,str-clock-on" means to keep clock on during system suspend and resume. Some platform will flush register settings if clock has been disabled when system is suspended. Set this option to avoid clock off. Change-Id: Id841f58e9d7fb3656511072b3eb14d0d355e2dd5 Signed-off-b

[PATCH v2 2/2] usb: host: XHCI: xhci-mtk.c: support mediatek,str-clock-on

2020-11-06 Thread Macpaul Lin
Some platform dose not support turn off clock when system suspending. We add an option "mediatek,str-clock-on" for distinquish these platforms. When "mediatek,str-clock-on" has been set, xhci-mtk driver will skip turning clock on and off during system suspend and resume. Si

Re: [PATCH v2 1/2] dt-bindings: usb: mediatek,mtk-xhci: add str-clock-on

2020-11-06 Thread Macpaul Lin
On Fri, 2020-11-06 at 17:46 +0800, Macpaul Lin wrote: > Option "mediatek,str-clock-on" means to keep clock on during system > suspend and resume. Some platform will flush register settings if clock has > been disabled when system is suspended. Set this option to avoid clock

[PATCH v3 1/2] dt-bindings: usb: mediatek,mtk-xhci: add str-clock-on

2020-11-06 Thread Macpaul Lin
host controller") Signed-off-by: Macpaul Lin Cc: sta...@vger.kernel.org --- Changes for v3: - Remove unnecessary Change-Id in commit message. - Add "Fixes" tag as a bug fix on phone system. Changes for v2: - Rename "mediatek,keep-clock-on" to "mediatek,str-clock-on&

[PATCH v3 2/2] usb: host: XHCI: xhci-mtk.c: support mediatek,str-clock-on

2020-11-06 Thread Macpaul Lin
Fixes: 0cbd4b34cda9 ("xhci: mediatek: support MTK xHCI host controller") Signed-off-by: Macpaul Lin Cc: sta...@vger.kernel.org --- Changes for v3: - Add "Fixes" tag as a bug fix on phone system. Changes for v2: - Replace "mediatek,keep-clock-on" to "mediatek,str

[PATCH v2] usb: gadget: configfs: Fix use-after-free issue with udc_name

2020-10-28 Thread Macpaul Lin
f+0xe4/0x12c gadget_dev_desc_UDC_show+0x54/0x64 configfs_read_file+0x210/0x3a0 __vfs_read+0xf0/0x49c vfs_read+0x130/0x2b4 SyS_read+0x114/0x208 el0_svc_naked+0x34/0x38 Add mutex_lock to protect this kind of scenario. Signed-off-by: Eddie Hung Signed-off-by: Macpaul Lin Reviewed-by: Peter C

Re: [PATCH v2] usb: gadget: configfs: Fix use-after-free issue with udc_name

2020-10-28 Thread Macpaul Lin
On Thu, 2020-10-29 at 01:55 +0800, Macpaul Lin wrote: > From: Eddie Hung > > There is a use-after-free issue, if access udc_name > in function gadget_dev_desc_UDC_store after another context > free udc_name in function unregister_gadget. > > Context 1: > g

[RESEND PATCH v2] usb: gadget: configfs: Fix use-after-free issue with udc_name

2020-10-31 Thread Macpaul Lin
f+0xe4/0x12c gadget_dev_desc_UDC_show+0x54/0x64 configfs_read_file+0x210/0x3a0 __vfs_read+0xf0/0x49c vfs_read+0x130/0x2b4 SyS_read+0x114/0x208 el0_svc_naked+0x34/0x38 Add mutex_lock to protect this kind of scenario. Signed-off-by: Eddie Hung Signed-off-by: Macpaul Lin Reviewed-by: Peter C

[PATCH 1/2] dt-bindings: usb: mediatek,mtk-xhci: add keep-clock-on

2020-11-01 Thread Macpaul Lin
Option "mediatek,keep-clock-on" means to keep clock on during system suspend and resume. Some platform will flush register settings if clock has been disabled when system is suspended. Set this option to avoid clock off. Signed-off-by: Macpaul Lin --- .../devicetree/bindings/usb/me

[PATCH 2/2] usb: host: XHCI: xhci-mtk.c: support mediatek,keep-clock-on

2020-11-01 Thread Macpaul Lin
Some platform dose not support turn off clock when system suspending. We add an option "mediatek,keep-clock-on" for distinquish these platforms. When "mediatek,keep-clock-on" has been set, xhci-mtk driver will skip turning clock on and off during system suspend and resume. Si

[PATCH] sound: usb: pcm: fix incorrect power state when playing sound after PM_AUTO suspend

2020-06-02 Thread Macpaul Lin
. Hence we suggest to change power state to SNDRV_CTL_POWER_D0 when card has been resumed successfully. Signed-off-by: Macpaul Lin --- sound/usb/pcm.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index a4e4064..d667ecb 100644 --- a/sound/usb

Re: [PATCH] sound: usb: pcm: fix incorrect power state when playing sound after PM_AUTO suspend

2020-06-02 Thread Macpaul Lin
On Tue, 2020-06-02 at 19:53 +0800, Macpaul Lin wrote: > This patch fix incorrect power state changed by usb_audio_suspend() > when CONFIG_PM is enabled. > > After receiving suspend PM message with auto flag, usb_audio_suspend() > change card's power state to SNDRV_CTL_POWER_D

[PATCH] usb: host: xhci-mtk: avoid runtime suspend when removing hcd

2020-05-28 Thread Macpaul Lin
When runtime suspend was enabled, runtime suspend might happened when xhci is removing hcd. This might cause kernel panic when hcd has been freed but runtime pm suspend related handle need to reference it. Change-Id: I70a5dc8006207caeecbac6955ce8e5345dcc70e6 Signed-off-by: Macpaul Lin

[PATCH v2] usb: host: xhci-mtk: avoid runtime suspend when removing hcd

2020-05-28 Thread Macpaul Lin
When runtime suspend was enabled, runtime suspend might happened when xhci is removing hcd. This might cause kernel panic when hcd has been freed but runtime pm suspend related handle need to reference it. Signed-off-by: Macpaul Lin --- drivers/usb/host/xhci-mtk.c |5 +++-- 1 file changed

Re: linux-next: build failure after merge of the sound-current tree

2020-06-04 Thread Macpaul Lin
bundled interfaces") > > I have reverted that commit for today. > Sorry I've tested its function by "patch back" to older kernel version 4.14. After checking the latest patch again, there is indeed a typo here. Thanks Macpaul Lin

[PATCH v6 0/8] Add basic SoC support for mt6765

2019-07-12 Thread Macpaul Lin
This patch adds basic SoC support for Mediatek's new 8-core SoC, MT6765, which is mainly for smartphone application. Changes in V6: 1. Adapt V5's patchset to latest kernel tree. Origin V5 patchset. https://lore.kernel.org/patchwork/cover/963612/ 2. Due to clk's common code has been submit

[PATCH v6 1/8] dt-bindings: clock: mediatek: document clk bindings for Mediatek MT6765 SoC

2019-07-12 Thread Macpaul Lin
From: Mars Cheng This patch adds the binding documentation for apmixedsys, audsys, camsys, imgsys, infracfg, mipi0a, topckgen, vcodecsys Signed-off-by: Mars Cheng Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin --- .../arm/mediatek/mediatek,apmixedsys.txt | 1 + .../bindings/arm

[PATCH v6 3/8] dt-bindings: mediatek: add MT6765 power dt-bindings

2019-07-12 Thread Macpaul Lin
From: Mars Cheng This adds power dt-bindings for MT6765 Signed-off-by: Mars Cheng Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin Reviewed-by: Rob Herring --- .../devicetree/bindings/soc/mediatek/scpsys.txt| 6 ++ include/dt-bindings/power/mt6765-power.h | 14

[PATCH v6 2/8] dt-bindings: mediatek: Add smi dts binding for Mediatek MT6765 SoC

2019-07-12 Thread Macpaul Lin
From: Mars Cheng This patch adds MT6765 smi binding document Signed-off-by: Mars Cheng Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin Acked-by: Rob Herring --- .../bindings/memory-controllers/mediatek,smi-common.txt | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v6 5/8] clk: mediatek: Add MT6765 clock support

2019-07-12 Thread Macpaul Lin
From: Owen Chen Add MT6765 clock support, include topckgen, apmixedsys, infracfg, mcucfg and subsystem clocks. Signed-off-by: Owen Chen Signed-off-by: Mars Cheng Signed-off-by: Macpaul Lin --- drivers/clk/mediatek/Kconfig | 86 ++ drivers/clk/mediatek/Makefile| 7

[PATCH v6 4/8] clk: mediatek: add mt6765 clock IDs

2019-07-12 Thread Macpaul Lin
From: Mars Cheng Add MT6765 clock dt-bindings, include topckgen, apmixedsys, infracfg, mcucfg and subsystem clocks. Signed-off-by: Mars Cheng Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin --- include/dt-bindings/clock/mt6765-clk.h | 313 + 1 file changed, 313

[PATCH v6 6/8] soc: mediatek: add MT6765 scpsys and subdomain support

2019-07-12 Thread Macpaul Lin
From: Mars Cheng This adds scpsys support for MT6765 Add subdomain support for MT6765: isp, mm, connsys, mfg, and cam. Signed-off-by: Mars Cheng Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin --- drivers/soc/mediatek/mtk-scpsys.c | 130 ++ 1 file changed

[PATCH v6 7/8] arm64: dts: mediatek: add mt6765 support

2019-07-12 Thread Macpaul Lin
From: Mars Cheng Add basic chip support for Mediatek 6765, include uart node with correct uart clocks, pwrap device Add clock controller nodes, include topckgen, infracfg, apmixedsys and subsystem. Signed-off-by: Mars Cheng Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin Acked-by: Marc

[PATCH v6 8/8] arm64: defconfig: add CONFIG_COMMON_CLK_MT6765_XXX clocks

2019-07-12 Thread Macpaul Lin
From: Owen Chen Enable MT6765 clock configs, include topckgen, apmixedsys, infracfg, and subsystem clocks. Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin --- arch/arm64/configs/defconfig | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64

[PATCH] usb: mtu3: fix panic in mtu3_gadget_disconnect()

2020-07-31 Thread Macpaul Lin
898 [] drm_atomic_commit+0xcc/0x108 [] drm_mode_atomic_ioctl+0x1c20/0x2580 [] drm_ioctl_kernel+0x118/0x1b0 [] drm_ioctl+0x5c0/0x920 [] do_vfs_ioctl+0x188/0x1820 [] SyS_ioctl+0x8c/0xa0 Signed-off-by: Macpaul Lin Cc: sta...@vger.kernel.org --- drivers/usb/mtu3/mtu3_gadget.c | 7 ++- 1 file changed

[PATCH v2] usb: mtu3: fix panic in mtu3_gadget_disconnect()

2020-07-31 Thread Macpaul Lin
mit+0xcc/0x108 [] drm_mode_atomic_ioctl+0x1c20/0x2580 [] drm_ioctl_kernel+0x118/0x1b0 [] drm_ioctl+0x5c0/0x920 [] do_vfs_ioctl+0x188/0x1820 [] SyS_ioctl+0x8c/0xa0 Signed-off-by: Macpaul Lin Cc: sta...@vger.kernel.org --- Changes for v2: - Check mtu_gadget_driver out of spin_lock might still not w

[PATCH] usb: gadget: configfs: Fix use-after-free issue with udc_name

2020-07-16 Thread Macpaul Lin
f+0xe4/0x12c gadget_dev_desc_UDC_show+0x54/0x64 configfs_read_file+0x210/0x3a0 __vfs_read+0xf0/0x49c vfs_read+0x130/0x2b4 SyS_read+0x114/0x208 el0_svc_naked+0x34/0x38 Add mutex_lock to protect this kind of scenario. Signed-off-by: Eddie Hung Signed-off-by: Macpaul Lin Cc: sta...@vger.kernel.org --- drivers/usb/gadge

[PATCH v2] usb: gadget: configfs: Fix use-after-free issue with udc_name

2020-07-17 Thread Macpaul Lin
f+0xe4/0x12c gadget_dev_desc_UDC_show+0x54/0x64 configfs_read_file+0x210/0x3a0 __vfs_read+0xf0/0x49c vfs_read+0x130/0x2b4 SyS_read+0x114/0x208 el0_svc_naked+0x34/0x38 Add mutex_lock to protect this kind of scenario. Signed-off-by: Eddie Hung Signed-off-by: Macpaul Lin Reviewed-by: Peter C

Re: [PATCH v2] usb: gadget: configfs: Fix use-after-free issue with udc_name

2020-07-17 Thread Macpaul Lin
On Sat, 2020-07-18 at 10:45 +0800, Macpaul Lin wrote: > From: Eddie Hung > Well, it's strange, I simply replaced the uploader's name to my colleague, git send-email pop up this line automatically. Shouldn't I do that kind of change. It did not happened before. Do I need to change i

Re: [PATCH v2] usb: gadget: configfs: Fix use-after-free issue with udc_name

2020-07-21 Thread Macpaul Lin
On Tue, 2020-07-21 at 13:33 +0200, Greg Kroah-Hartman wrote: > On Sat, Jul 18, 2020 at 10:58:53AM +0800, Macpaul Lin wrote: > > On Sat, 2020-07-18 at 10:45 +0800, Macpaul Lin wrote: > > > From: Eddie Hung > > > > > > > Well, it's strange, I si

[PATCH] mtu3: fix setup packet response for HNP and SRP request

2019-06-12 Thread Macpaul Lin
1. Add OTG_HNP_REQD and OTG_SRP_REQD definitions in ch9.h. 2. When OTG_HNP_REQD and OTG_SRP_REQD has been received, usb hardware must not enter TEST mode but need to response setup packet. 3. Add otg_srp_reqd and otg_hnp_reqd in struct ssusb_mtk for futher implementation. Signed-off-by: Macpaul

[PATCH] usb: musb: mediatek: add reset FADDR to zero in reset interrupt handle

2020-05-13 Thread Macpaul Lin
When receiving reset interrupt, FADDR need to be reset to zero in periphearl mode. Otherwise ep0 cannot do enumeration when re-pluging USB cable. Signed-off-by: Macpaul Lin --- drivers/usb/musb/mediatek.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/musb/mediatek.c b

[PATCH] usb: gadget: u_serial: fix coverity warning: negative index at array

2020-05-14 Thread Macpaul Lin
This issue has been reported by coverity scanner. Replace "int portnum" by "unsigned int", this void negative index at array. Signed-off-by: Stan Lu Signed-off-by: Macpaul Lin --- drivers/usb/gadget/function/u_serial.c |4 ++-- 1 file changed, 2 insertions(+), 2 dele

[PATCH] usb/gadget/function: introduce Built-in CDROM support

2020-06-09 Thread Macpaul Lin
-off-by: Macpaul Lin --- drivers/usb/gadget/Kconfig | 16 +++ drivers/usb/gadget/function/f_mass_storage.c | 49 +++- drivers/usb/gadget/function/f_mass_storage.h | 5 +- drivers/usb/gadget/function/storage_common.c | 23 + 4 files changed, 90

[PATCH v2] usb/gadget/function: introduce Built-in CDROM support

2020-06-10 Thread Macpaul Lin
-off-by: Macpaul Lin --- Changes for v2: - Thanks for Peter's review. - Fix typo in commit message. - use variable common->bicr instead of IS_ENABLED(). - Fix #ifdef CONFIG_USB_CONFIGFS_BICR. drivers/usb/gadget/Kconfig | 16 +++ drivers/usb/gadget/funct

[PATCH v3] usb: replace hardcode maximum usb string length by definition

2020-06-18 Thread Macpaul Lin
Replace hardcode maximum usb string length (126 bytes) by definition "MAX_USB_STRING_LEN". Signed-off-by: Macpaul Lin Acked-by: Alan Stern --- Changes for v2: - Add definition "MAX_USB_STRING_LEN" in ch9.h instead of in usb.h. Thanks for Alan's suggestion. Change

Re: [PATCH] clk: mediatek: Remove ifr{0,1}_cfg_regs structures

2020-06-18 Thread Macpaul Lin
On Tue, 2020-06-09 at 14:18 -0700, Stephen Boyd wrote: > These aren't used and the macros that reference them aren't used either. > Remove the dead code to avoid compile warnings. > > Cc: Owen Chen > Cc: Mars Cheng > Cc: Macpaul Lin > Fixes: 1aca9939bf72 ("clk:

Re: [PATCH v8 0/4] Add basic SoC support for mt6765

2020-06-18 Thread Macpaul Lin
On Fri, 2020-02-21 at 18:12 +0800, Macpaul Lin wrote: > This patch adds basic SoC support for Mediatek's new 8-core SoC, > MT6765, which is mainly for smartphone application. > > Changes in V8: > 1. Origin V7 patchset: >https://patchwork.kernel.org/cover/11370105/ &g

Re: [PATCH v2] usb: gadget: configfs: Fix KASAN use-after-free

2020-06-10 Thread Macpaul Lin
t; > - if (!str) > > - return -ENOMEM; > > + if (copy) { > > + str = copy; > > + } else { > > + str = kmalloc(MAX_USB_STRING_WITH_NULL_LEN, GFP_KERNEL); > > + if (!str) > > + return -ENOMEM; > > + } > > + strcpy(str, s); > > if (str[ret - 1] == '\n') > > str[ret - 1] = '\0'; > > - kfree(copy); > > *s_copy = str; > > return 0; > > } > > -- > > 2.7.4 > > > > -Kees Thank you very much. Macpaul Lin

Re: [PATCH v2] usb/gadget/function: introduce Built-in CDROM support

2020-06-11 Thread Macpaul Lin
On Wed, 2020-06-10 at 10:31 -0400, Alan Stern wrote: > On Wed, Jun 10, 2020 at 02:15:18PM +0800, Macpaul Lin wrote: > > Introduce Built-In CDROM (BICR) support. > > This feature depends on USB_CONFIGFS_MASS_STORAGE option. > > > > 1. Some settings and new function is

[PATCH] usb: replace hardcoded maximum usb string length by definition

2020-06-11 Thread Macpaul Lin
Replace hardcoded maximum usb string length (126 bytes) by definition "MAX_USB_STRING_LEN". Signed-off-by: Macpaul Lin --- drivers/usb/gadget/composite.c |4 ++-- drivers/usb/gadget/configfs.c |3 ++- drivers/usb/gadget/usbstring.c |5 +++-- include/linux/usb.h

Re: [PATCH] sound: usb: pcm: fix incorrect power state when playing sound after PM_AUTO suspend

2020-06-02 Thread Macpaul Lin
On Tue, 2020-06-02 at 14:46 +0200, Takashi Iwai wrote: > On Tue, 02 Jun 2020 13:53:41 +0200, > Macpaul Lin wrote: > > > > This patch fix incorrect power state changed by usb_audio_suspend() > > when CONFIG_PM is enabled. > > > > After receivi

Re: [PATCH] sound: usb: pcm: fix incorrect power state when playing sound after PM_AUTO suspend

2020-06-03 Thread Macpaul Lin
gt;num_suspended_intf--; > > err_out: > atomic_dec(>active); /* allow autopm after this point */ > diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h > index 1c892c7f14d7..e0ebfb25fbd5 100644 > --- a/sound/usb/usbaudio.h > +++ b/sound/usb/usbaudio.h > @@ -26,7 +26,7 @@ struct snd_usb_audio { > struct usb_interface *pm_intf; > u32 usb_id; > struct mutex mutex; > - unsigned int autosuspended:1; > + unsigned int system_suspend; > atomic_t active; > atomic_t shutdown; > atomic_t usage_count; > > ___ Thank you very much! Best regards, Macpaul Lin

Re: [PATCH] usb: host: xhci-mtk: avoid runtime suspend when removing hcd

2020-06-03 Thread Macpaul Lin
On Wed, 2020-06-03 at 14:47 +0300, Mathias Nyman wrote: > On 29.5.2020 7.29, Macpaul Lin wrote: > > When runtime suspend was enabled, runtime suspend might happened > > when xhci is removing hcd. This might cause kernel panic when hcd > > has been freed but runtime pm suspen

[PATCH v3] usb: host: xhci-mtk: avoid runtime suspend when removing hcd

2020-06-03 Thread Macpaul Lin
When runtime suspend was enabled, runtime suspend might happened when xhci is removing hcd. This might cause kernel panic when hcd has been freed but runtime pm suspend related handle need to reference it. Signed-off-by: Macpaul Lin Reviewed-by: Chunfeng Yun --- Changes for v3: - Replace

Re: [PATCH] sound: usb: pcm: fix incorrect power state when playing sound after PM_AUTO suspend

2020-06-03 Thread Macpaul Lin
On Wed, 2020-06-03 at 14:47 +0200, Takashi Iwai wrote: > On Wed, 03 Jun 2020 14:39:24 +0200, > Macpaul Lin wrote: > > > > On Wed, 2020-06-03 at 10:45 +0200, Takashi Iwai wrote: > > > On Wed, 03 Jun 2020 08:54:51 +0200, > > > Takashi Iwai wrote: > > >

[PATCH v4] usb: host: xhci-mtk: avoid runtime suspend when removing hcd

2020-06-03 Thread Macpaul Lin
When runtime suspend was enabled, runtime suspend might happen when xhci is removing hcd. This might cause kernel panic when hcd has been freed but runtime pm suspend related handle need to reference it. Signed-off-by: Macpaul Lin Reviewed-by: Chunfeng Yun Cc: sta...@vger.kernel.org --- Changes

[PATCH 1/2] usb: gadget: introduce flag for large request

2020-06-16 Thread Macpaul Lin
transmission. Hence upper layer software can reduce some effort for queueing many requests back and forth for larger data. Here we introduce "can_exceed_maxp" flag in gadget when these kinds of hardware is ready to support these operations. Signed-off-by: Macpaul Lin --- drivers/usb/mtu3/

[PATCH 2/2] usb: gadget: u_serial: improve performance for large data

2020-06-16 Thread Macpaul Lin
If the hardware (like DMA engine) could support large usb request exceeds maximum packet size, use larger buffer when performing Rx/Tx could reduce request numbers and improve performance. Signed-off-by: Macpaul Lin --- drivers/usb/gadget/function/u_serial.c |9 +++-- 1 file changed, 7

Re: [PATCH 1/2] usb: gadget: introduce flag for large request

2020-06-16 Thread Macpaul Lin
Alan Stern 於 2020年6月16日 週二 下午10:05寫道: > > On Tue, Jun 16, 2020 at 08:34:43PM +0800, Macpaul Lin wrote: > > Some USB hardware like DMA engine can help to process (split) the data > > of each URB request into small packets. For example, the max packet size > > of

[PATCH v2] usb: gadget: u_serial: improve performance for large data

2020-06-16 Thread Macpaul Lin
for performance improving. Signed-off-by: Macpaul Lin --- drivers/usb/gadget/function/u_serial.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index 3cfc6e2..d7912a9 100644 --- a/drivers/usb

Re: [PATCH v2] usb: gadget: u_serial: improve performance for large data

2020-06-16 Thread Macpaul Lin
On Wed, 2020-06-17 at 07:14 +0200, Greg Kroah-Hartman wrote: > On Wed, Jun 17, 2020 at 10:46:47AM +0800, Macpaul Lin wrote: > > Nowadays some embedded systems use VCOM to transfer large log and data. > > Take LTE MODEM as an example, during the long debugging stage, large > &

[PATCH v3] usb: gadget: u_serial: improve performance for large data

2020-06-16 Thread Macpaul Lin
for performance improving. Signed-off-by: Macpaul Lin --- Changes for v2: - Drop previous patch for adding flag which indicates hardware capability in gadget.h and in DMA engine according to Alan's suggestion. Thanks. - Replace requested buffer size "REQ_BUF_SIZE" instead of checkin

[PATCH] sound: usb: quirks: add quirk for Samsung USBC Headset (AKG)

2020-06-23 Thread Macpaul Lin
We've found Samsung USBC Headset (AKG) (VID: 0x04e8, PID: 0xa051) need a tiny delay after each class compliant request. Otherwise the device might not be able to be recognized each times. Signed-off-by: Chihhao Chen Signed-off-by: Macpaul Lin Cc: sta...@vger.kernel.org --- sound/usb/quirks.c

[PATCH v2] usb: replace hardcode maximum usb string length by definition

2020-06-15 Thread Macpaul Lin
Replace hardcode maximum usb string length (126 bytes) by definition "MAX_USB_STRING_LEN". Signed-off-by: Macpaul Lin --- Changes for v2: - Add definition "MAX_USB_STRING_LEN" in ch9.h instead of in usb.h. Thanks for Alan's suggestion. drivers/usb/gadget/composite.c

[PATCH] usb: gadget: u_serial.h: increase MAX_U_SERIAL_PORTS to 8

2020-06-15 Thread Macpaul Lin
Mediatek's LTE modem needs up to 8 ports to connect to PC for logging and debugging under some scenarios. Hence we suggest to increase the definition of MAX_U_SERIAL_PORTS to 8 for some complex embedded systems. Signed-off-by: Macpaul Lin --- drivers/usb/gadget/function/u_serial.h |2 +- 1

Re: [PATCH v3] usb: gadget: configfs: Fix KASAN use-after-free

2017-02-09 Thread Macpaul Lin
S". I'm not sure about the difference between Chromium OS and Linux PC. According to CVE report, it looks like the change is from Chromium OS? Dose Nvidia has a pure Linux software team can verify your patch on your platform? I think if you can prove the result is okay on Linux PC or on Chromium OS will help. -- Best regards, Macpaul Lin

Re: [PATCH v2] usb: gadget: configfs: Fix use-after-free issue with udc_name

2020-10-20 Thread Macpaul Lin
On Sat, 2020-07-18 at 10:45 +0800, Macpaul Lin wrote: > From: Eddie Hung > There is a use-after-free issue, if access udc_name > in function gadget_dev_desc_UDC_store after another context > free udc_name in function unregister_gadget. > > Context 1: > gadg

[PATCH v9 1/4] dt-bindings: mediatek: Add smi dts binding for Mediatek MT6765 SoC

2021-03-09 Thread Macpaul Lin
From: Mars Cheng This patch adds MT6765 smi binding document Signed-off-by: Mars Cheng Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin Acked-by: Rob Herring --- .../bindings/memory-controllers/mediatek,smi-common.yaml | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v9 2/4] soc: mediatek: add MT6765 scpsys and subdomain support

2021-03-09 Thread Macpaul Lin
From: Mars Cheng This adds scpsys support for MT6765 Add subdomain support for MT6765: isp, mm, connsys, mfg, and cam. Signed-off-by: Mars Cheng Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin --- drivers/soc/mediatek/mtk-scpsys.c | 91 +++ 1 file changed, 91

[PATCH v9 0/4] Add basic SoC support for mt6765

2021-03-09 Thread Macpaul Lin
This patch adds basic SoC support for Mediatek's new 8-core SoC, MT6765, which is mainly for smartphone application. Changes in V9: 1. Origin V8 patchset: https://patchwork.kernel.org/cover/11396015/ [v9,1/4] dt-bindings: mediatek: Add smi dts binding for Mediatek MT6765 SoC

[PATCH v9 4/4] arm64: defconfig: add CONFIG_COMMON_CLK_MT6765_XXX clocks

2021-03-09 Thread Macpaul Lin
From: Owen Chen Enable MT6765 clock configs, include topckgen, apmixedsys, infracfg, and subsystem clocks. Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin --- arch/arm64/configs/defconfig | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64

[PATCH v9 3/4] arm64: dts: mediatek: add mt6765 support

2021-03-09 Thread Macpaul Lin
From: Mars Cheng Add basic chip support for Mediatek 6765, include uart node with correct uart clocks, pwrap device Add clock controller nodes, include topckgen, infracfg, apmixedsys and subsystem. Signed-off-by: Mars Cheng Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin Acked-by: Marc

Re: [PATCH v4] usb: gadget: configfs: Fix KASAN use-after-free

2021-03-10 Thread Macpaul Lin
On Thu, 2021-03-11 at 14:42 +0800, Macpaul Lin wrote: > From: Jim Lin > > When gadget is disconnected, running sequence is like this. > . composite_disconnect > . Call trace: > usb_string_copy+0xd0/0x128 > gadget_config_name_configuration_store+0x4 > gadget_config_n

[PATCH v4] usb: gadget: configfs: Fix KASAN use-after-free

2021-03-10 Thread Macpaul Lin
er-free" error occurs. Signed-off-by: Jim Lin Signed-off-by: Macpaul Lin Cc: sta...@vger.kernel.org --- Changes in v2: Changes in v3: - Change commit description Changes in v4: - Fix build error and adapt patch to kernel-5.12-rc1. Replace definition "MAX_USB_STRING_WITH_NULL_LEN&q

[PATCH v10 4/4] arm64: defconfig: add CONFIG_COMMON_CLK_MT6765_XXX clocks

2021-03-09 Thread Macpaul Lin
From: Owen Chen Enable MT6765 clock configs, include topckgen, apmixedsys, infracfg, and subsystem clocks. Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin --- arch/arm64/configs/defconfig | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64

[PATCH v10 3/4] arm64: dts: mediatek: add mt6765 support

2021-03-09 Thread Macpaul Lin
From: Mars Cheng Add basic chip support for Mediatek 6765, include uart node with correct uart clocks, pwrap device Add clock controller nodes, include topckgen, infracfg, apmixedsys and subsystem. Signed-off-by: Mars Cheng Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin Acked-by: Marc

[PATCH v10 1/4] dt-bindings: mediatek: Add smi dts binding for Mediatek MT6765 SoC

2021-03-09 Thread Macpaul Lin
From: Mars Cheng This patch adds MT6765 smi binding document Signed-off-by: Mars Cheng Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin Acked-by: Rob Herring --- .../bindings/memory-controllers/mediatek,smi-common.yaml | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v10 0/4] Add basic SoC support for mt6765

2021-03-09 Thread Macpaul Lin
This patch adds basic SoC support for Mediatek's new 8-core SoC, MT6765, which is mainly for smartphone application. Changes in V10: [v10,1/4] dt-bindings: mediatek: Add smi dts binding for Mediatek MT6765 SoC - No Change. [v10,2/4] soc: mediatek: add MT6765 scpsys and

[PATCH v10 2/4] soc: mediatek: add MT6765 scpsys and subdomain support

2021-03-09 Thread Macpaul Lin
From: Mars Cheng This adds scpsys support for MT6765 Add subdomain support for MT6765: isp, mm, connsys, mfg, and cam. Signed-off-by: Mars Cheng Signed-off-by: Owen Chen Signed-off-by: Macpaul Lin --- drivers/soc/mediatek/mtk-scpsys.c | 91 +++ 1 file changed, 91

Re: [PATCH v8 3/4] arm64: dts: mediatek: add mt6765 support

2021-03-09 Thread Macpaul Lin
On Wed, 2021-03-10 at 00:08 +0800, Chun-Kuang Hu wrote: > Hi, Macpaul: > > Macpaul Lin 於 2020年2月21日 週五 下午6:22寫道: > > > > From: Mars Cheng > > > > Add basic chip support for Mediatek 6765, include > > uart node with correct uart clocks, pwrap device >