* [PATCH v2 1/2] memstick: ms_block: keep the power off during a full msb_reset()
2026-12-03 16:42 [PATCH v2 0/2] memstick: fixes for mspro_block and ms_block Ho Jie Feng
@ 2026-12-03 16:42 ` Ho Jie Feng
2026-12-03 16:42 ` [PATCH v2 2/2] memstick: ms_block: add the missing newline to the parallel switch error Ho Jie Feng
1 sibling, 0 replies; 3+ messages in thread
From: Ho Jie Feng @ 2026-12-03 16:42 UTC (permalink / raw)
To: Ulf Hansson
Cc: Maxim Levitsky, Alex Dubov, linux-mmc, linux-kernel, Ho Jie Feng,
stable, Thomas Fourier, Maoyi Xie, Guangshuo Li, Hemanth Selam,
Andrew Morton
Keep the power off for long enough so that the card properly
power cycles.
mspro_block already waits 10 ms when it power cycles the card to fall
back to serial mode. Move that delay to a define in memstick.h and use
it in both drivers.
Fixes: 0ab30494bc4f ("memstick: add support for legacy memorysticks")
Cc: stable@vger.kernel.org
Signed-off-by: Ho Jie Feng <hjf3108@gmail.com>
---
drivers/memstick/core/ms_block.c | 3 +++
drivers/memstick/core/mspro_block.c | 2 +-
include/linux/memstick.h | 2 ++
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c
index 151dffb636c1e..d3cae3a40dca2 100644
--- a/drivers/memstick/core/ms_block.c
+++ b/drivers/memstick/core/ms_block.c
@@ -740,6 +740,9 @@ static int msb_reset(struct msb_data *msb, bool full)
msb_invalidate_reg_window(msb);
+ /* Allow enough time for the card to fully power off */
+ msleep(MEMSTICK_POWER_OFF_DELAY_MS);
+
error = host->set_param(host,
MEMSTICK_POWER, MEMSTICK_POWER_ON);
if (error)
diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c
index 215f4c3759c41..7da1ca4c2268f 100644
--- a/drivers/memstick/core/mspro_block.c
+++ b/drivers/memstick/core/mspro_block.c
@@ -867,7 +867,7 @@ static int mspro_block_switch_interface(struct memstick_dev *card)
dev_name(&card->dev));
msb->system = MEMSTICK_SYS_SERIAL;
host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_OFF);
- msleep(10);
+ msleep(MEMSTICK_POWER_OFF_DELAY_MS);
host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_ON);
host->set_param(host, MEMSTICK_INTERFACE, MEMSTICK_SERIAL);
diff --git a/include/linux/memstick.h b/include/linux/memstick.h
index 107bdcbedf794..cec27e2372758 100644
--- a/include/linux/memstick.h
+++ b/include/linux/memstick.h
@@ -202,6 +202,8 @@ enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE };
#define MEMSTICK_POWER_OFF 0
#define MEMSTICK_POWER_ON 1
+#define MEMSTICK_POWER_OFF_DELAY_MS 10
+
#define MEMSTICK_SERIAL 0
#define MEMSTICK_PAR4 1
#define MEMSTICK_PAR8 2
--
2.56.1
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH v2 2/2] memstick: ms_block: add the missing newline to the parallel switch error
2026-12-03 16:42 [PATCH v2 0/2] memstick: fixes for mspro_block and ms_block Ho Jie Feng
2026-12-03 16:42 ` [PATCH v2 1/2] memstick: ms_block: keep the power off during a full msb_reset() Ho Jie Feng
@ 2026-12-03 16:42 ` Ho Jie Feng
1 sibling, 0 replies; 3+ messages in thread
From: Ho Jie Feng @ 2026-12-03 16:42 UTC (permalink / raw)
To: Ulf Hansson
Cc: Maxim Levitsky, Alex Dubov, linux-mmc, linux-kernel, Ho Jie Feng,
stable, Hemanth Selam, Thomas Fourier, Guangshuo Li,
Andrew Morton
Allow printk to finalize the record immediately instead of waiting
for the next message with a newline.
Fixes: 0ab30494bc4f ("memstick: add support for legacy memorysticks")
Cc: stable@vger.kernel.org
Signed-off-by: Ho Jie Feng <hjf3108@gmail.com>
---
drivers/memstick/core/ms_block.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c
index d3cae3a40dca2..1ef0811de0d9d 100644
--- a/drivers/memstick/core/ms_block.c
+++ b/drivers/memstick/core/ms_block.c
@@ -778,7 +778,7 @@ static int msb_switch_to_parallel(struct msb_data *msb)
error = msb_run_state_machine(msb, h_msb_parallel_switch);
if (error) {
- pr_err("Switch to parallel failed");
+ pr_err("Switch to parallel failed\n");
msb->regs.param.system &= ~MEMSTICK_SYS_PAM;
msb_reset(msb, true);
return -EFAULT;
--
2.56.1
^ permalink raw reply [flat|nested] 3+ messages in thread