Re: [PATCH RESEND] rtsx_usb_ms: Use msleep_interruptible() in polling loop

2015-10-07 Thread Roger Tseng
leep(1000); > + if (msleep_interruptible(1000)) > + flush_signals(current); > } > > complete(>detect_ms_exit); -- Best regards, Roger Tseng

Re: [PATCH RESEND] rtsx_usb_ms: Use msleep_interruptible() in polling loop

2015-10-07 Thread Roger Tseng
msleep(1000); > + if (msleep_interruptible(1000)) > + flush_signals(current); > } > > complete(>detect_ms_exit); -- Best regards, Roger Tseng

[PATCH] mfd: rtsx_usb: prevent DMA from stack

2015-03-05 Thread Roger Tseng
[] usb_control_msg+0xdc/0x130 [] rtsx_usb_ep0_read_register+0x59/0x70 [rtsx_usb] [] ? rtsx_usb_get_rsp+0x41/0x50 [rtsx_usb] [] rtsx_usb_ms_handle_req+0x7ce/0x9c5 [rtsx_usb_ms] Reported-by: Josh Boyer Signed-off-by: Roger Tseng --- drivers/mfd/rtsx_usb.c | 30 -- 1 file changed

[PATCH] mfd: rtsx_usb: prevent DMA from stack

2015-03-05 Thread Roger Tseng
] rtsx_usb_ep0_read_register+0x59/0x70 [rtsx_usb] [a00310c1] ? rtsx_usb_get_rsp+0x41/0x50 [rtsx_usb] [a071da4e] rtsx_usb_ms_handle_req+0x7ce/0x9c5 [rtsx_usb_ms] Reported-by: Josh Boyer jwbo...@fedoraproject.org Signed-off-by: Roger Tseng rogera...@realtek.com --- drivers/mfd/rtsx_usb.c | 30

Re: DMA-API backtrace from rtsx_usb_ms driver

2015-02-25 Thread Roger Tseng
da/0x470 > [] worker_thread+0x53/0x470 > [] ? process_one_work+0x860/0x860 > [] kthread+0x104/0x120 > [] ? local_clock+0x25/0x30 > [] ? kthread_create_on_node+0x250/0x250 > [] ret_from_fork+0x7c/0xb0 > [] ? kthread_create_on_node+0x250/0x250 > > josh > > --Please consider the environment before printing this e-mail. -- Best regards, Roger Tseng

Re: DMA-API backtrace from rtsx_usb_ms driver

2015-02-25 Thread Roger Tseng
] ret_from_fork+0x7c/0xb0 [810d30b0] ? kthread_create_on_node+0x250/0x250 josh --Please consider the environment before printing this e-mail. -- Best regards, Roger Tseng

[OVERWRITE] mfd: rtsx_usb: Defer autosuspend while card exists

2015-01-21 Thread Roger Tseng
in suspend method and defer the autosuspend if the slot is loaded. The default 2 second autosuspend delay of USB subsystem should let the next polling detects the card. Signed-off-by: Roger Tseng --- drivers/mfd/rtsx_usb.c | 18 ++ 1 file changed, 18 insertions(+) diff --git

[OVERWRITE] mfd: rtsx_usb: Defer autosuspend while card exists

2015-01-21 Thread Roger Tseng
in suspend method and defer the autosuspend if the slot is loaded. The default 2 second autosuspend delay of USB subsystem should let the next polling detects the card. Signed-off-by: Roger Tseng rogera...@realtek.com --- drivers/mfd/rtsx_usb.c | 18 ++ 1 file changed, 18 insertions

Re: [PATCH 1/2] mfd: rtsx_usb: Fix runtime PM deadlock

2015-01-20 Thread Roger Tseng
On Tue, 2015-01-20 at 16:07 +, Lee Jones wrote: > On Tue, 20 Jan 2015, Roger Tseng wrote: > > > On Mon, 2015-01-19 at 09:45 +, Lee Jones wrote: > > > On Thu, 15 Jan 2015, Roger Tseng wrote: > > > > > > > sd_set_power_mode() in derive

Re: [PATCH 1/2] mfd: rtsx_usb: Fix runtime PM deadlock

2015-01-20 Thread Roger Tseng
On Mon, 2015-01-19 at 09:45 +, Lee Jones wrote: > On Thu, 15 Jan 2015, Roger Tseng wrote: > > > sd_set_power_mode() in derived module drivers/mmc/host/rtsx_usb_sdmmc.c > > acquires dev_mutex and then calls pm_runtime_get_sync() to make sure the > > device is awake wh

Re: [PATCH 1/2] mfd: rtsx_usb: Fix runtime PM deadlock

2015-01-20 Thread Roger Tseng
On Mon, 2015-01-19 at 09:45 +, Lee Jones wrote: On Thu, 15 Jan 2015, Roger Tseng wrote: sd_set_power_mode() in derived module drivers/mmc/host/rtsx_usb_sdmmc.c acquires dev_mutex and then calls pm_runtime_get_sync() to make sure the device is awake while initializing a newly inserted

Re: [PATCH 1/2] mfd: rtsx_usb: Fix runtime PM deadlock

2015-01-20 Thread Roger Tseng
On Tue, 2015-01-20 at 16:07 +, Lee Jones wrote: On Tue, 20 Jan 2015, Roger Tseng wrote: On Mon, 2015-01-19 at 09:45 +, Lee Jones wrote: On Thu, 15 Jan 2015, Roger Tseng wrote: sd_set_power_mode() in derived module drivers/mmc/host/rtsx_usb_sdmmc.c acquires dev_mutex

[PATCH 2/2] mfd: rtsx_usb: Defer autosuspend while card exists

2015-01-14 Thread Roger Tseng
in suspend method and defer the autosuspend if the slot is loaded. The default 2 second autosuspend delay of USB subsystem should let the next polling detects the card. Signed-off-by: Roger Tseng --- drivers/mfd/rtsx_usb.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers

[PATCH 0/2] Fix PM deadlock and card detection problem

2015-01-14 Thread Roger Tseng
The patchset fixes a deadlock situation of runtime PM methods and minimize card detection "deadtime" during runtime suspending. Roger Tseng (2): mfd: rtsx_usb: Fix runtime PM deadlock mfd: rtsx_usb: Defer autosuspend while card exists drivers/mfd/rtsx_usb.c | 21 +-

[PATCH 1/2] mfd: rtsx_usb: Fix runtime PM deadlock

2015-01-14 Thread Roger Tseng
. Cc: # v3.16+ Fixes: 730876be2566 ("mfd: Add realtek USB card reader driver") Signed-off-by: Roger Tseng --- drivers/mfd/rtsx_usb.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/mfd/rtsx_usb.c b/drivers/mfd/rtsx_usb.c index dbdd0faeb6ce..076694126e5d 100644 --- a/d

[PATCH 2/2] mfd: rtsx_usb: Defer autosuspend while card exists

2015-01-14 Thread Roger Tseng
in suspend method and defer the autosuspend if the slot is loaded. The default 2 second autosuspend delay of USB subsystem should let the next polling detects the card. Signed-off-by: Roger Tseng rogera...@realtek.com --- drivers/mfd/rtsx_usb.c | 14 ++ 1 file changed, 14 insertions

[PATCH 0/2] Fix PM deadlock and card detection problem

2015-01-14 Thread Roger Tseng
The patchset fixes a deadlock situation of runtime PM methods and minimize card detection deadtime during runtime suspending. Roger Tseng (2): mfd: rtsx_usb: Fix runtime PM deadlock mfd: rtsx_usb: Defer autosuspend while card exists drivers/mfd/rtsx_usb.c | 21 + 1 file

[PATCH 1/2] mfd: rtsx_usb: Fix runtime PM deadlock

2015-01-14 Thread Roger Tseng
. Cc: sta...@vger.kernel.org # v3.16+ Fixes: 730876be2566 (mfd: Add realtek USB card reader driver) Signed-off-by: Roger Tseng rogera...@realtek.com --- drivers/mfd/rtsx_usb.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/mfd/rtsx_usb.c b/drivers/mfd/rtsx_usb.c index

[PATCH 1/2] mmc: core: Add new power_mode MMC_POWER_UNDEFINED

2014-09-24 Thread Roger Tseng
her prevents state messed up in cards that was already initialized(eg. by BIOS of UEFI driver). Signed-off-by: Roger Tseng --- drivers/mmc/core/core.c |1 + include/linux/mmc/host.h |1 + 2 files changed, 2 insertions(+) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c in

[PATCH 0/2] mmc: Add power_mode MMC_POWER_UNDEFINED

2014-09-24 Thread Roger Tseng
Invent MMC_POWER_UNDEFINED to describe the initial host power_mode which might be either off or turned on by an early driver such as BIOS or UEFI driver. This lets the later mmc_power_off() do actual power-off things and power_mode will be in a known state eventually. Roger Tseng (2): mmc: core

[PATCH 2/2] mmc: rtsx_pci: Set power related cap2 macros

2014-09-24 Thread Roger Tseng
Set MMC_CAP2_NO_PRESCAN_POWERUP and MMC_CAP2_FULL_PWR_CYCLE for rtsx_pci_sdmmc and rtsx_usb_sdmmc to reflect properties of Realtek card reader hosts. Signed-off-by: Roger Tseng --- drivers/mmc/host/rtsx_pci_sdmmc.c |1 + drivers/mmc/host/rtsx_usb_sdmmc.c |1 + 2 files changed, 2

[PATCH 2/2] mmc: rtsx_pci: Set power related cap2 macros

2014-09-24 Thread Roger Tseng
Set MMC_CAP2_NO_PRESCAN_POWERUP and MMC_CAP2_FULL_PWR_CYCLE for rtsx_pci_sdmmc and rtsx_usb_sdmmc to reflect properties of Realtek card reader hosts. Signed-off-by: Roger Tseng rogera...@realtek.com --- drivers/mmc/host/rtsx_pci_sdmmc.c |1 + drivers/mmc/host/rtsx_usb_sdmmc.c |1 + 2

[PATCH 0/2] mmc: Add power_mode MMC_POWER_UNDEFINED

2014-09-24 Thread Roger Tseng
Invent MMC_POWER_UNDEFINED to describe the initial host power_mode which might be either off or turned on by an early driver such as BIOS or UEFI driver. This lets the later mmc_power_off() do actual power-off things and power_mode will be in a known state eventually. Roger Tseng (2): mmc: core

[PATCH 1/2] mmc: core: Add new power_mode MMC_POWER_UNDEFINED

2014-09-24 Thread Roger Tseng
prevents state messed up in cards that was already initialized(eg. by BIOS of UEFI driver). Signed-off-by: Roger Tseng rogera...@realtek.com --- drivers/mmc/core/core.c |1 + include/linux/mmc/host.h |1 + 2 files changed, 2 insertions(+) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core

Re: [PATCH] mmc: rtsx: add card power off during probe

2014-09-22 Thread Roger Tseng
wer_off() in mmc_start_host() is more than NOP now and triggers real power-off and re-init in sdhci. Will this be OK? > So, let's try your proposal, thus don't check MMC_CAP2_FULL_PWR_CYCLE. > > Can you repost new version of your patches and please split them up on > core and host separately. > > Kind regards > Uffe > > --Please consider the environment before printing this e-mail. -- Best regards, Roger Tseng

Re: [PATCH] mmc: rtsx: add card power off during probe

2014-09-22 Thread Roger Tseng
before printing this e-mail. -- Best regards, Roger Tseng

Re: [PATCH] mmc: rtsx: add card power off during probe

2014-09-18 Thread Roger Tseng
On Wed, 2014-09-17 at 21:29 +0200, Ulf Hansson wrote: > On 17 September 2014 11:11, micky wrote: > > On 09/17/2014 02:01 AM, Ulf Hansson wrote: > >> > >> On 12 September 2014 03:39, wrote: > >>> > >>> From: Roger Tseng > >>&g

Re: [PATCH] mmc: rtsx: add card power off during probe

2014-09-18 Thread Roger Tseng
On Wed, 2014-09-17 at 21:29 +0200, Ulf Hansson wrote: On 17 September 2014 11:11, micky micky_ch...@realsil.com.cn wrote: On 09/17/2014 02:01 AM, Ulf Hansson wrote: On 12 September 2014 03:39, micky_ch...@realsil.com.cn wrote: From: Roger Tseng rogera...@realtek.com Some platform

Re: [PATCH] mmc: rtsx: fix incorrect last byte in R2 response

2014-08-14 Thread Roger Tseng
On Wed, 2014-08-13 at 17:09 +0200, Ulf Hansson wrote: > On 11 August 2014 10:32, wrote: > > From: Roger Tseng > > > > Current code erroneously fill the last byte of R2 response with an undefined > > value. In addition, it is impossible to obtain the real values since

Re: [PATCH] mmc: rtsx: fix incorrect last byte in R2 response

2014-08-14 Thread Roger Tseng
On Wed, 2014-08-13 at 17:09 +0200, Ulf Hansson wrote: On 11 August 2014 10:32, rogera...@realtek.com wrote: From: Roger Tseng rogera...@realtek.com Current code erroneously fill the last byte of R2 response with an undefined value. In addition, it is impossible to obtain the real values

RE: [PATCH 1/3] mfd: Add realtek USB card reader driver

2014-01-07 Thread Roger Tseng
Hi Dan, >> +int rtsx_usb_ep0_write_register(struct rtsx_ucr *ucr, u16 addr, >> + u8 mask, u8 data) >> +{ >> + u16 value = 0, index = 0; >> + >> + value |= (u16)(3 & 0x03) << 14; >> + value |= (u16)(addr & 0x3FFF); > >Don't do pointless things: > >value |= 0x03 <<

RE: [PATCH 1/3] mfd: Add realtek USB card reader driver

2014-01-07 Thread Roger Tseng
Hi Dan, +int rtsx_usb_ep0_write_register(struct rtsx_ucr *ucr, u16 addr, + u8 mask, u8 data) +{ + u16 value = 0, index = 0; + + value |= (u16)(3 0x03) 14; + value |= (u16)(addr 0x3FFF); Don't do pointless things: value |= 0x03 14; value |= addr

RE: [PATCH] mfd:rtsx: Support RTL8411B

2013-04-19 Thread Roger Tseng
>On Fri, Apr 19, 2013 at 09:52:42PM +0800, rogera...@realtek.com wrote: >> From: Roger Tseng >> >> Adding support of model RTL8411B. Since the model is similar to RTL8411, >> differences are implemented in rtl8411.c. >> > >What tree is this against

RE: [PATCH] mfd:rtsx: Support RTL8411B

2013-04-19 Thread Roger Tseng
On Fri, Apr 19, 2013 at 09:52:42PM +0800, rogera...@realtek.com wrote: From: Roger Tseng rogera...@realtek.com Adding support of model RTL8411B. Since the model is similar to RTL8411, differences are implemented in rtl8411.c. What tree is this against? regards, dan carpenter It should

Re: [PATCH 1/3] MMC: rtsx: remove driving adjustment

2013-02-04 Thread Roger Tseng
v3.9. Hi Chris, Would you please apply patch 1/3 for kernel v3.9. Thanks. Best regards, Roger Tseng On 02/04/2013 04:47 PM, Dan Carpenter wrote: On Mon, Feb 04, 2013 at 03:45:57PM +0800, Roger Tseng wrote: Several new models of readers use different way to select driving capability(a necessary

Re: [PATCH 1/3] MMC: rtsx: remove driving adjustment

2013-02-04 Thread Roger Tseng
v3.9. Hi Chris, Would you please apply patch 1/3 for kernel v3.9. Thanks. Best regards, Roger Tseng On 02/04/2013 04:47 PM, Dan Carpenter wrote: On Mon, Feb 04, 2013 at 03:45:57PM +0800, Roger Tseng wrote: Several new models of readers use different way to select driving capability(a necessary

[PATCH 3/3] mfd: rtsx: support RTS5227

2013-02-03 Thread Roger Tseng
Support new model RTS5227. Signed-off-by: Roger Tseng Reviewed-by: Wei WANG --- drivers/mfd/Makefile | 2 +- drivers/mfd/rts5227.c| 234 +++ drivers/mfd/rtsx_pcr.c | 5 + drivers/mfd/rtsx_pcr.h | 1 + include/linux/mfd

[PATCH 2/3] mfd: rtsx: implement driving adjustment to device-dependent callbacks

2013-02-03 Thread Roger Tseng
Implement different ways of selecting driving capability(a necessary adjustment along with voltage change). It was origionally in device-independent mmc/host/rtsx_pci_sdmmc.c. Moving it here to support devices which may have a different way of adjustment. Signed-off-by: Roger Tseng Reviewed

[PATCH 0/3] rtsx: patchset for supporting new model RTS5227

2013-02-03 Thread Roger Tseng
The patchset makes necessary changes in mfd and mmc tree for supporting RTS5227 card reader. Roger Tseng (3): MMC: rtsx: remove driving adjustment mfd: rtsx: implement driving adjustment to device-dependent callbacks mfd: rtsx: support RTS5227 drivers/mfd/Makefile | 2

[PATCH 1/3] MMC: rtsx: remove driving adjustment

2013-02-03 Thread Roger Tseng
-by: Roger Tseng Reviewed-by: Wei WANG --- drivers/mmc/host/rtsx_pci_sdmmc.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c index f74b5ad..f93f100 100644 --- a/drivers/mmc/host/rtsx_pci_sdmmc.c +++ b/drivers/mmc/host

[PATCH 1/3] MMC: rtsx: remove driving adjustment

2013-02-03 Thread Roger Tseng
-by: Roger Tseng rogera...@realtek.com Reviewed-by: Wei WANG wei_w...@realsil.com.cn --- drivers/mmc/host/rtsx_pci_sdmmc.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c index f74b5ad..f93f100 100644 --- a/drivers/mmc

[PATCH 0/3] rtsx: patchset for supporting new model RTS5227

2013-02-03 Thread Roger Tseng
The patchset makes necessary changes in mfd and mmc tree for supporting RTS5227 card reader. Roger Tseng (3): MMC: rtsx: remove driving adjustment mfd: rtsx: implement driving adjustment to device-dependent callbacks mfd: rtsx: support RTS5227 drivers/mfd/Makefile | 2

[PATCH 2/3] mfd: rtsx: implement driving adjustment to device-dependent callbacks

2013-02-03 Thread Roger Tseng
Implement different ways of selecting driving capability(a necessary adjustment along with voltage change). It was origionally in device-independent mmc/host/rtsx_pci_sdmmc.c. Moving it here to support devices which may have a different way of adjustment. Signed-off-by: Roger Tseng rogera

[PATCH 3/3] mfd: rtsx: support RTS5227

2013-02-03 Thread Roger Tseng
Support new model RTS5227. Signed-off-by: Roger Tseng rogera...@realtek.com Reviewed-by: Wei WANG wei_w...@realsil.com.cn --- drivers/mfd/Makefile | 2 +- drivers/mfd/rts5227.c| 234 +++ drivers/mfd/rtsx_pcr.c | 5 + drivers/mfd