The patch titled memstick: try harder to recover from unsuccessful interface mode switch has been added to the -mm tree. Its filename is memstick-try-harder-to-recover-from-unsuccessful-interface-mode-switch.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: memstick: try harder to recover from unsuccessful interface mode switch From: Alex Dubov <oakad@xxxxxxxxx> Signed-off-by: Alex Dubov <oakad@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/memstick/core/mspro_block.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff -puN drivers/memstick/core/mspro_block.c~memstick-try-harder-to-recover-from-unsuccessful-interface-mode-switch drivers/memstick/core/mspro_block.c --- a/drivers/memstick/core/mspro_block.c~memstick-try-harder-to-recover-from-unsuccessful-interface-mode-switch +++ a/drivers/memstick/core/mspro_block.c @@ -16,6 +16,7 @@ #include <linux/idr.h> #include <linux/hdreg.h> #include <linux/kthread.h> +#include <linux/delay.h> #include <linux/memstick.h> #define DRIVER_NAME "mspro_block" @@ -820,7 +821,7 @@ static int mspro_block_switch_to_paralle struct memstick_host *host = card->host; struct mspro_block_data *msb = memstick_get_drvdata(card); struct mspro_param_register param = { - .system = 0, + .system = MEMSTICK_SYS_PAR4, .data_count = 0, .data_address = 0, .tpc_param = 0 @@ -845,8 +846,24 @@ static int mspro_block_switch_to_paralle wait_for_completion(&card->mrq_complete); if (card->current_mrq.error) { - msb->system = 0x80; + msb->system = MEMSTICK_SYS_SERIAL; + host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_OFF); + msleep(1000); + host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_ON); host->set_param(host, MEMSTICK_INTERFACE, MEMSTICK_SERIAL); + + if (memstick_set_rw_addr(card)) + return card->current_mrq.error; + + param.system = msb->system; + + card->next_request = h_mspro_block_req_init; + msb->mrq_handler = h_mspro_block_default; + memstick_init_req(&card->current_mrq, MS_TPC_WRITE_REG, ¶m, + sizeof(param)); + memstick_new_req(host); + wait_for_completion(&card->mrq_complete); + return -EFAULT; } _ Patches currently in -mm which might be from oakad@xxxxxxxxx are memstick-introduce-correct-definitions-in-the-header.patch memstick-add-memstick_suspend-resume_host-methods.patch memstick-make-sure-number-of-command-retries-is-exactly-as-specified.patch memstick-drop-driver_version-numbers-as-meaningless.patch tifm-fix-the-memorystick-host-fifo-handling-code.patch tifm-fix-memorystick-host-initialization-code.patch tifm-clear-interrupt-mask-bits-before-setting-them-on-adapter-init.patch memstick-add-support-for-decoding-specfile-media-attributes.patch memstick-fix-parsing-of-assembly_date-attribute-field.patch memstick-try-harder-to-recover-from-unsuccessful-interface-mode-switch.patch memstick-add-support-for-jmicron-jmb38x-memorystick-host-controller.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html