From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gregory CLEMENT Date: Thu, 05 Nov 2015 20:56:19 +0100 Subject: [U-Boot] [PATCH] mmc: atmel: Properly fix clock configuration In-Reply-To: <201511051738.45738.marex@denx.de> (Marek Vasut's message of "Thu, 5 Nov 2015 17:38:45 +0100") References: <1446735196-23171-1-git-send-email-gregory.clement@free-electrons.com> <1446735196-23171-2-git-send-email-gregory.clement@free-electrons.com> <201511051738.45738.marex@denx.de> Message-ID: <87wptw8bks.fsf@free-electrons.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Marek, On jeu., nov. 05 2015, Marek Vasut wrote: > On Thursday, November 05, 2015 at 03:53:16 PM, Gregory CLEMENT wrote: >> Timing issue occurs on eMMC not only when modifying the frequency but >> also for all the switch command(CMD6). According to the MMC spec waiting >> 8 clocks after a switch command would be the thing to do. >> >> This patch allows fixing CPU hang observed when trying to changing the >> bus width on a eMMC on SAMA5D4. >> >> Signed-off-by: Gregory CLEMENT > > On DENX MA5D4EVK: > > Tested-by: Marek Vasut Thanks for having tested it so quick! > > [...] > >> @@ -284,8 +286,10 @@ mci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, >> struct mmc_data *data) { >> u32 cnt = word_count * 4; >> printf("Read Data:\n"); >> + /* >> print_buffer(0, data->dest + cnt * block_count, >> 1, cnt, 0); >> + */ > > This bit shouldn't be in the patch I guess ;-) You're right! > >> } >> #endif >> #ifdef DEBUG >> @@ -323,6 +327,12 @@ mci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, >> struct mmc_data *data) } >> } >> >> + /* After the switch command, wait for 8 clocks before the next >> + * command >> + */ > > The comment style should match the kernel one -- multilines go like this: > /* > * foo > * bar > */ Sure, I will send a v2 with tour comment taken into account anw with your tested-by. Thanks, Gregory > >> + if (cmd->cmdidx == MMC_CMD_SWITCH) >> + udelay(8*1000000/ priv->curr_clk); /* 8 clk in us*/ >> + >> return 0; >> } > > Best regards, > Marek Vasut -- Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com