On 1 June 2016 at 15:10, Michal Kadlic <michal.kadlic@xxxxxxxxx> wrote: > Hello, > > newbie here, please bear with me... > > It seems that CMD6/SD_SWITCH request locks up the mmc-moxart controller. It > does not respond to any command after CMD6. > The fix suggested by Mr. Jonas Jensen <jonas.jensen@xxxxxxxxx> is to ignore > the SD_SWITCH request in moxart_request() > My question is - looking at mmc_read_switch() in drivers/mmc/core/sd.c - > would be -EINVAL a proper response in this case? No, this seems like a bad solution to the problem. If the SD_SWITCH command isn't working, then it's better to find out *why* instead of only disable it. That's because it would mean to also disable all higher speed modes for the cards. BTW, under what circumstances does the lock up happens? In all cases when trying to detect an inserted card? Kind regards Uffe > > This diff is against kernel 4.6. > > Best regards, > Michal Kadlic > --- > > diff -purN a/drivers/mmc/host/moxart-mmc.c b/drivers/mmc/host/moxart-mmc.c > --- a/drivers/mmc/host/moxart-mmc.c 2016-06-01 14:23:01.000000000 +0200 > +++ b/drivers/mmc/host/moxart-mmc.c 2016-06-01 14:37:08.856296102 +0200 > @@ -411,6 +411,14 @@ static void moxart_request(struct mmc_ho > mrq->cmd->error = -ETIMEDOUT; > goto request_done; > } > + > + if (mrq->cmd->opcode == SD_SWITCH) { > + > + /* CMD6 (at least in mode 0) locks up the controller > + * so we have to ignore this request */ > + mrq->cmd->error = -EINVAL; > + goto request_done; > + } > > moxart_prepare_data(host); > moxart_send_command(host, host->mrq->cmd) > -- > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html