[RFC PATCH v12 3/5] mwifiex: Disable wakeup irq handling for pcie

2017-12-25 Thread Jeffy Chen
We are going to handle the wakeup irq in the pci core. Signed-off-by: Jeffy Chen --- Changes in v13: None Changes in v12: None Changes in v11: None Changes in v10: None Changes in v9: None Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v3: None

[RFC PATCH v12 0/5] PCI: rockchip: Move PCIe WAKE# handling into pci core

2017-12-25 Thread Jeffy Chen
d some comments. Changes in v5: Move to pci.txt Rebase. Use "wakeup" instead of "wake" Changes in v3: Fix error handling. Changes in v2: Use dev_pm_set_dedicated_wake_irq. Jeffy Chen (5): dt-bindings: PCI: Add definition of PCIe WAKE# irq and PCI irq of/irq: Adjust of_pci_

[RFC PATCH v12 3/5] mwifiex: Disable wakeup irq handling for pcie

2017-12-25 Thread Jeffy Chen
We are going to handle the wakeup irq in the pci core. Signed-off-by: Jeffy Chen --- Changes in v12: None Changes in v11: None Changes in v10: None Changes in v9: None Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v3: None Changes in v2: None

[RFC PATCH v12 0/5] PCI: rockchip: Move PCIe WAKE# handling into pci core

2017-12-25 Thread Jeffy Chen
up" instead of "wake" Changes in v3: Fix error handling. Changes in v2: Use dev_pm_set_dedicated_wake_irq. Jeffy Chen (5): dt-bindings: PCI: Add definition of PCIe WAKE# irq and PCI irq of/irq: Adjust of_pci_irq parsing for multiple interrupts mwifiex: Disable wakeup ir

[RFC PATCH v11 3/5] mwifiex: Disable wakeup irq handling for pcie

2017-12-25 Thread Jeffy Chen
We are going to handle the wakeup irq in the pci core. Signed-off-by: Jeffy Chen --- Changes in v11: None Changes in v10: None Changes in v9: None Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v3: None Changes in v2: None drivers/net/wireless

[RFC PATCH v11 0/5] PCI: rockchip: Move PCIe WAKE# handling into pci core

2017-12-25 Thread Jeffy Chen
error handling. Changes in v2: Use dev_pm_set_dedicated_wake_irq. Jeffy Chen (5): dt-bindings: PCI: Add definition of PCIe WAKE# irq and PCI irq of/irq: Adjust of_pci_irq parsing for multiple interrupts mwifiex: Disable wakeup irq handling for pcie PCI / PM: Add support for the PCIe WAKE# signal for OF arm64:

Re: [RFC PATCH v10 0/7] PCI: rockchip: Move PCIe WAKE# handling into pci core

2017-10-29 Thread jeffy
Hi Rafael, thanks for your reply. On 10/28/2017 05:07 PM, Rafael J. Wysocki wrote: Overall, I don't quite like the direction this is going into, but I need to have a deeper look. Which may take some time, so please bear with me. ok, i'll wait for your comments, thanks :) Thanks, Rafael

[RFC PATCH v10 3/7] mwifiex: Disable wakeup irq handling for pcie

2017-10-27 Thread Jeffy Chen
We are going to handle the wakeup irq in the pci core. Signed-off-by: Jeffy Chen --- Changes in v10: None Changes in v9: None Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v3: None Changes in v2: None drivers/net/wireless/marvell/mwifiex/main.c | 4

[RFC PATCH v10 0/7] PCI: rockchip: Move PCIe WAKE# handling into pci core

2017-10-27 Thread Jeffy Chen
eup" instead of "wake" Rebase. Changes in v3: Fix error handling. Changes in v2: Use dev_pm_set_dedicated_wake_irq. Jeffy Chen (7): dt-bindings: PCI: Add definition of PCIe WAKE# irq and PCI irq of/irq: Adjust of_pci_irq parsing for multiple interrupts mwifiex: Disable wakeup

[RFC PATCH v9 3/7] mwifiex: Disable wakeup irq handling for pcie

2017-10-27 Thread Jeffy Chen
We are going to handle the wakeup irq in the pci core. Signed-off-by: Jeffy Chen --- Changes in v9: None Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v3: None Changes in v2: None drivers/net/wireless/marvell/mwifiex/main.c | 4 1 file changed

[RFC PATCH v9 0/7] PCI: rockchip: Move PCIe WAKE# handling into pci core

2017-10-27 Thread Jeffy Chen
g into pci core. Changes in v6: Fix device_init_wake error handling, and add some comments. Changes in v5: Move to pci.txt Use "wakeup" instead of "wake" Rebase. Changes in v3: Fix error handling. Changes in v2: Use dev_pm_set_dedicated_wake_irq. Jeffy Chen (7): dt-binding

[RFC PATCH v8 0/7] PCI: rockchip: Move PCIe WAKE# handling into pci core

2017-10-26 Thread Jeffy Chen
dev_pm_set_dedicated_wake_irq. Jeffy Chen (7): dt-bindings: PCI: Add definition of PCIe WAKE# irq and PCI irq mwifiex: Disable wakeup irq handling for pcie arm64: dts: rockchip: Handle PCIe WAKE# signal in pcie driver for Gru of/irq: Adjust of pci irq parsing for multiple interrupts P

[RFC PATCH v8 2/7] mwifiex: Disable wakeup irq handling for pcie

2017-10-26 Thread Jeffy Chen
We are going to handle the wakeup irq in the pci core. Signed-off-by: Jeffy Chen --- Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v3: None Changes in v2: None drivers/net/wireless/marvell/mwifiex/main.c | 4 1 file changed, 4 insertions

Re: [PATCH] mwifiex: uninit wakeup info when failed to add card

2017-07-06 Thread jeffy
Hi brian, On 07/06/2017 02:08 AM, Brian Norris wrote: On Mon, Jul 03, 2017 at 03:54:30PM +0800, Jeffy Chen wrote: We inited wakeup info at the beginning of mwifiex_add_card, so we need to uninit it in the error handling. It's much the same as what we did in: 36908c4 mwifiex: uninit w

[PATCH v2] mwifiex: uninit wakeup info in the error handling

2017-07-06 Thread Jeffy Chen
We inited wakeup info at the beginning of mwifiex_add_card, so we need to uninit it in the error handling. It's much the same as what we did in: 36908c4 mwifiex: uninit wakeup info when removing device Signed-off-by: Jeffy Chen --- Changes in v2: Uninit wakeup when _mwifiex_fw_dpc faile

[PATCH] mwifiex: uninit wakeup info when failed to add card

2017-07-03 Thread Jeffy Chen
We inited wakeup info at the beginning of mwifiex_add_card, so we need to uninit it in the error handling. It's much the same as what we did in: 36908c4 mwifiex: uninit wakeup info when removing device Signed-off-by: Jeffy Chen --- drivers/net/wireless/marvell/mwifiex/main.c | 2 ++ 1

Re: Bluetooth: might sleep error in hidp_session_thread

2017-06-27 Thread jeffy
_session_thread Tested-by: Rohit Vaswani -Rohit -Original Message----- From: jeffy [mailto:jeffy.c...@rock-chips.com] Sent: Friday, June 23, 2017 05:39 To: Rohit Vaswani; linux-blueto...@vger.kernel.org Cc: Brian Norris; Douglas Anderson; Johan Hedberg; Peter Hurley; Johan Hedberg; netdev@

[RESEND PATCH v4 2/3] Bluetooth: cmtp: fix possible might sleep error in cmtp_session

2017-06-27 Thread Jeffy Chen
(); } __set_current_state(TASK_RUNNING); Which fixed at: dfb2fae Bluetooth: Fix nested sleeps So let's fix it at the same way, also follow the suggestion of: https://lwn.net/Articles/628628/ Signed-off-by: Jeffy Chen Reviewed-by: Brian Norris Reviewed-by: AL Yu-Che

[RESEND PATCH v4 3/3] Bluetooth: hidp: fix possible might sleep error in hidp_session_thread

2017-06-27 Thread Jeffy Chen
(); } __set_current_state(TASK_RUNNING); Which fixed at: dfb2fae Bluetooth: Fix nested sleeps So let's fix it at the same way, also follow the suggestion of: https://lwn.net/Articles/628628/ Signed-off-by: Jeffy Chen Tested-by: AL Yu-Chen Cho Tested-by: Rohit Va

[RESEND PATCH v4 1/3] Bluetooth: bnep: fix possible might sleep error in bnep_session

2017-06-27 Thread Jeffy Chen
(); } __set_current_state(TASK_RUNNING); Which fixed at: dfb2fae Bluetooth: Fix nested sleeps So let's fix it at the same way, also follow the suggestion of: https://lwn.net/Articles/628628/ Signed-off-by: Jeffy Chen Reviewed-by: Brian Norris Reviewed-by: AL Yu-Che

Re: Bluetooth: might sleep error in hidp_session_thread

2017-06-23 Thread jeffy
Hi Rohit, Thanx for your reply, and sorry to the delay, somehow your mail was marked as spam by the mail server :( On 06/13/2017 02:31 AM, Rohit Vaswani wrote: Hi Jeffy, I was looking into the patch from Jeffy Chen from February 14 2017 : [v4,3/3] Bluetooth: hidp: fix possible might

Re: [Patch net] ipv6: only call ip6_route_dev_notify() once for NETDEV_UNREGISTER

2017-06-20 Thread jeffy
Hi Cong Wang, oh, oops, i did misread. also, Tested-by: Jeffy Chen On 06/21/2017 11:01 AM, jeffy wrote: Hi Cong Wang, i don't know much about net core, maybe i'm misreading the code...but On 06/21/2017 02:42 AM, Cong Wang wrote: In commit 242d3a49a2a1 (&quo

Re: [Patch net] ipv6: only call ip6_route_dev_notify() once for NETDEV_UNREGISTER

2017-06-20 Thread jeffy
d, unfortunately, as reported by jeffy, netdev_wait_allrefs() could rebroadcast NETDEV_UNREGISTER event until all refs are gone. We have to add an additional check to avoid this corner case. For netdev_wait_allrefs() dev->reg_state is NETREG_UNREGISTERED, for dev_change_net_namespace(), dev->reg_

Re: [net,v2] ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf

2017-06-19 Thread jeffy
Hi Cong Wang, On 06/20/2017 12:54 PM, Cong Wang wrote: Hello, On Mon, Jun 19, 2017 at 8:15 PM, jeffy wrote: but actually they are not guaranteed to be paired: the netdev_run_todo(see the first dump stack above) would call netdev_wait_allrefs to rebroadcast unregister notification multiple

Re: [net,v2] ipv6: reorder ip6_route_dev_notifier after ipv6_dev_notf

2017-06-19 Thread jeffy
Hi guys, i hit some warnings when testing this patch on my local 4.4 kernel(arm64 chromebook) with KASAN & SLUB_DEBUG: [9.919374] BUG: KASAN: use-after-free in ip6_route_dev_notify+0x194/0x2bc at addr ffc0c9d4e480 [9.928469] Read of size 4 by task kworker/u12:3/124 [9.933463]

Re: [PATCH 3/3] mwifiex: wake system up when receives a wake irq

2017-02-24 Thread jeffy
Hi Kalle, On 02/24/2017 07:01 PM, Kalle Valo wrote: Jeffy Chen writes: Currrently we are disabling this wake irq after receiving it. If this happens before we finish suspend and the pm event check is disabled, the system will continue suspending, and this irq would not work again. We may

[PATCH 3/3] mwifiex: wake system up when receives a wake irq

2017-02-23 Thread Jeffy Chen
Currrently we are disabling this wake irq after receiving it. If this happens before we finish suspend and the pm event check is disabled, the system will continue suspending, and this irq would not work again. We may need to abort system suspend to avoid that. Signed-off-by: Jeffy Chen

Re: [PATCH v3 3/3] Bluetooth: hidp: fix possible might sleep error in hidp_session_thread

2017-02-13 Thread jeffy
Hi Dmitry, On 02/14/2017 05:27 AM, Dmitry Torokhov wrote: Hi Jeffy, On Sun, Feb 12, 2017 at 8:12 PM, Jeffy Chen wrote: It looks like hidp_session_thread has same pattern as the issue reported in old rfcomm: while (1) { set_current_state(TASK_INTERRUPTIBLE

[PATCH v4 3/3] Bluetooth: hidp: fix possible might sleep error in hidp_session_thread

2017-02-13 Thread Jeffy Chen
(); } __set_current_state(TASK_RUNNING); Which fixed at: dfb2fae Bluetooth: Fix nested sleeps So let's fix it at the same way, also follow the suggestion of: https://lwn.net/Articles/628628/ Signed-off-by: Jeffy Chen 1/ Fix could not wake up by wake attempts on original

[PATCH v4 2/3] Bluetooth: cmtp: fix possible might sleep error in cmtp_session

2017-02-13 Thread Jeffy Chen
(); } __set_current_state(TASK_RUNNING); Which fixed at: dfb2fae Bluetooth: Fix nested sleeps So let's fix it at the same way, also follow the suggestion of: https://lwn.net/Articles/628628/ Signed-off-by: Jeffy Chen Reviewed-by: Brian Norris Remove unnecessary memory ba

[PATCH v4 1/3] Bluetooth: bnep: fix possible might sleep error in bnep_session

2017-02-13 Thread Jeffy Chen
(); } __set_current_state(TASK_RUNNING); Which fixed at: dfb2fae Bluetooth: Fix nested sleeps So let's fix it at the same way, also follow the suggestion of: https://lwn.net/Articles/628628/ Signed-off-by: Jeffy Chen Reviewed-by: Brian Norris --- Changes in v3: Add br

Re: [PATCH 3/3] Bluetooth: hidp: fix possible might sleep error in hidp_session_thread

2017-02-12 Thread jeffy
Hi brian, On 02/11/2017 09:26 AM, Brian Norris wrote: Hi Jeffy, I'm really not an expert on bluetooth or HIDP, but I can't bring myself to say that this is correct. I still think you have a problem. On Tue, Jan 24, 2017 at 12:07:51PM +0800, Jeffy Chen wrote: It looks like hidp_sess

Re: [PATCH 2/3] Bluetooth: cmtp: fix possible might sleep error in cmtp_session

2017-02-12 Thread jeffy
Hi brian, On 02/11/2017 09:43 AM, Brian Norris wrote: Hi, On Tue, Jan 24, 2017 at 12:07:50PM +0800, Jeffy Chen wrote: It looks like cmtp_session has same pattern as the issue reported in old rfcomm: while (1) { set_current_state(TASK_INTERRUPTIBLE); if

Re: [PATCH 1/3] Bluetooth: bnep: fix possible might sleep error in bnep_session

2017-02-12 Thread jeffy
Hi brian, On 02/11/2017 09:40 AM, Brian Norris wrote: Hi, On Tue, Jan 24, 2017 at 12:07:49PM +0800, Jeffy Chen wrote: It looks like bnep_session has same pattern as the issue reported in old rfcomm: while (1) { set_current_state(TASK_INTERRUPTIBLE); if

[PATCH v3 3/3] Bluetooth: hidp: fix possible might sleep error in hidp_session_thread

2017-02-12 Thread Jeffy Chen
(); } __set_current_state(TASK_RUNNING); Which fixed at: dfb2fae Bluetooth: Fix nested sleeps So let's fix it at the same way, also follow the suggestion of: https://lwn.net/Articles/628628/ Signed-off-by: Jeffy Chen 1/ Fix could not wake up by wake attempts on original

[PATCH v3 1/3] Bluetooth: bnep: fix possible might sleep error in bnep_session

2017-02-12 Thread Jeffy Chen
(); } __set_current_state(TASK_RUNNING); Which fixed at: dfb2fae Bluetooth: Fix nested sleeps So let's fix it at the same way, also follow the suggestion of: https://lwn.net/Articles/628628/ Signed-off-by: Jeffy Chen Reviewed-by: Brian Norris --- Changes in v3: Add br

[PATCH v3 2/3] Bluetooth: cmtp: fix possible might sleep error in cmtp_session

2017-02-12 Thread Jeffy Chen
(); } __set_current_state(TASK_RUNNING); Which fixed at: dfb2fae Bluetooth: Fix nested sleeps So let's fix it at the same way, also follow the suggestion of: https://lwn.net/Articles/628628/ Signed-off-by: Jeffy Chen Reviewed-by: Brian Norris Remove unnecessary memory ba

[PATCH v2 3/3] Bluetooth: hidp: fix possible might sleep error in hidp_session_thread

2017-02-12 Thread Jeffy Chen
(); } __set_current_state(TASK_RUNNING); Which fixed at: dfb2fae Bluetooth: Fix nested sleeps So let's fix it at the same way, also follow the suggestion of: https://lwn.net/Articles/628628/ Signed-off-by: Jeffy Chen 1/ Fix could not wake up by wake attempts on original

[PATCH v2 1/3] Bluetooth: bnep: fix possible might sleep error in bnep_session

2017-02-12 Thread Jeffy Chen
(); } __set_current_state(TASK_RUNNING); Which fixed at: dfb2fae Bluetooth: Fix nested sleeps So let's fix it at the same way, also follow the suggestion of: https://lwn.net/Articles/628628/ Signed-off-by: Jeffy Chen --- Changes in v2: Remove unnecessary memory barrier b

[PATCH v2 2/3] Bluetooth: cmtp: fix possible might sleep error in cmtp_session

2017-02-12 Thread Jeffy Chen
(); } __set_current_state(TASK_RUNNING); Which fixed at: dfb2fae Bluetooth: Fix nested sleeps So let's fix it at the same way, also follow the suggestion of: https://lwn.net/Articles/628628/ Signed-off-by: Jeffy Chen Remove unnecessary memory barrier before wake_up_* func

Re: [PATCH] Bluetooth: hidp: might sleep error in hidp_session_thread

2017-01-23 Thread jeffy
Hi brian, On 01/24/2017 10:31 AM, Brian Norris wrote: Hi Jeffy, On Fri, Jan 20, 2017 at 09:52:08PM +0800, Jeffy Chen wrote: [ 39.044329] do not call blocking ops when !TASK_RUNNING; state=1 set at [] hidp_session_thread+0x110/0x568 [hidp] ... [ 40.159664] Call trace: [ 40.162122

[PATCH 2/3] Bluetooth: cmtp: fix possible might sleep error in cmtp_session

2017-01-23 Thread Jeffy Chen
(); } __set_current_state(TASK_RUNNING); Which fixed at: dfb2fae Bluetooth: Fix nested sleeps So let's fix it at the same way, also follow the suggestion of: https://lwn.net/Articles/628628/ Signed-off-by: Jeffy Chen --- net/bluetooth/cmtp/core.c | 21 ++-

[PATCH 3/3] Bluetooth: hidp: fix possible might sleep error in hidp_session_thread

2017-01-23 Thread Jeffy Chen
(); } __set_current_state(TASK_RUNNING); Which fixed at: dfb2fae Bluetooth: Fix nested sleeps So let's fix it at the same way, also follow the suggestion of: https://lwn.net/Articles/628628/ Signed-off-by: Jeffy Chen --- net/bluetooth/hidp/core.c

[PATCH 1/3] Bluetooth: bnep: fix possible might sleep error in bnep_session

2017-01-23 Thread Jeffy Chen
(); } __set_current_state(TASK_RUNNING); Which fixed at: dfb2fae Bluetooth: Fix nested sleeps So let's fix it at the same way, also follow the suggestion of: https://lwn.net/Articles/628628/ Signed-off-by: Jeffy Chen --- net/bluetooth/bnep/core.c | 15 +-- 1

[PATCH] Bluetooth: hidp: might sleep error in hidp_session_thread

2017-01-20 Thread Jeffy Chen
-off-by: Jeffy Chen --- net/bluetooth/hidp/core.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c index 0bec458..bfd3fb8 100644 --- a/net/bluetooth/hidp/core.c +++ b/net/bluetooth/hidp/core.c @@ -1180,7