diff options
author | Alex Dubov <oakad@yahoo.com> | 2008-03-10 14:43:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-10 21:01:18 -0400 |
commit | 593672582e71a688cf8c3fc1c59ec7c44d3799e5 (patch) | |
tree | 7ce71db28639146c9302bb2b03880638661f417d /drivers/memstick | |
parent | 251cc9b9df065cb2c170ea45f566c0d9456186c2 (diff) |
memstick: try harder to recover from unsuccessful interface mode switch
Signed-off-by: Alex Dubov <oakad@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/memstick')
-rw-r--r-- | drivers/memstick/core/mspro_block.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c index 62b913ba9b97..1d637e4561d3 100644 --- a/drivers/memstick/core/mspro_block.c +++ b/drivers/memstick/core/mspro_block.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/idr.h> | 16 | #include <linux/idr.h> |
17 | #include <linux/hdreg.h> | 17 | #include <linux/hdreg.h> |
18 | #include <linux/kthread.h> | 18 | #include <linux/kthread.h> |
19 | #include <linux/delay.h> | ||
19 | #include <linux/memstick.h> | 20 | #include <linux/memstick.h> |
20 | 21 | ||
21 | #define DRIVER_NAME "mspro_block" | 22 | #define DRIVER_NAME "mspro_block" |
@@ -820,7 +821,7 @@ static int mspro_block_switch_to_parallel(struct memstick_dev *card) | |||
820 | struct memstick_host *host = card->host; | 821 | struct memstick_host *host = card->host; |
821 | struct mspro_block_data *msb = memstick_get_drvdata(card); | 822 | struct mspro_block_data *msb = memstick_get_drvdata(card); |
822 | struct mspro_param_register param = { | 823 | struct mspro_param_register param = { |
823 | .system = 0, | 824 | .system = MEMSTICK_SYS_PAR4, |
824 | .data_count = 0, | 825 | .data_count = 0, |
825 | .data_address = 0, | 826 | .data_address = 0, |
826 | .tpc_param = 0 | 827 | .tpc_param = 0 |
@@ -845,8 +846,24 @@ static int mspro_block_switch_to_parallel(struct memstick_dev *card) | |||
845 | wait_for_completion(&card->mrq_complete); | 846 | wait_for_completion(&card->mrq_complete); |
846 | 847 | ||
847 | if (card->current_mrq.error) { | 848 | if (card->current_mrq.error) { |
848 | msb->system = 0x80; | 849 | msb->system = MEMSTICK_SYS_SERIAL; |
850 | host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_OFF); | ||
851 | msleep(1000); | ||
852 | host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_ON); | ||
849 | host->set_param(host, MEMSTICK_INTERFACE, MEMSTICK_SERIAL); | 853 | host->set_param(host, MEMSTICK_INTERFACE, MEMSTICK_SERIAL); |
854 | |||
855 | if (memstick_set_rw_addr(card)) | ||
856 | return card->current_mrq.error; | ||
857 | |||
858 | param.system = msb->system; | ||
859 | |||
860 | card->next_request = h_mspro_block_req_init; | ||
861 | msb->mrq_handler = h_mspro_block_default; | ||
862 | memstick_init_req(&card->current_mrq, MS_TPC_WRITE_REG, ¶m, | ||
863 | sizeof(param)); | ||
864 | memstick_new_req(host); | ||
865 | wait_for_completion(&card->mrq_complete); | ||
866 | |||
850 | return -EFAULT; | 867 | return -EFAULT; |
851 | } | 868 | } |
852 | 869 | ||