Hi, I am facing latency issue due to below implementation. The function 'mmc_rescan' is getting called at regular intervals which is calling 'of_find_comaptible_node which is adding to the latency. Trace: => of_find_compatible_node => esdhc_of_set_clock => sdhci_set_clock => sdhci_set_ios => mmc_power_up => mmc_rescan 'of_find_compatible_node' function call is required only once at Linux boot time. If I change the implementation to : static void esdhc_of_set_clock(struct sdhci_host *host, unsigned int clock) { static int reduce_clock_flag, check_only_once_flag; /* Workaround to reduce the clock frequency for p1010 esdhc */ if (check_only_once_flag == 0) { if (of_find_compatible_node(NULL, NULL, "fsl,p1010-esdhc")) reduce_clock_flag = 1; check_only_once_flag = 1; } if (reduce_clock_flag == 1) { if (clock > 20000000) clock -= 5000000; if (clock > 40000000) clock -= 5000000; } /* Set the clock */ esdhc_set_clock(host, clock); } It works fine. No more latency issue. Please review this approach. If there is a better way, please do suggest. Thanks Priyanka Jain -----Original Message----- From: Huang Changming-R66093 Sent: Tuesday, February 14, 2012 11:41 AM To: Chris Ball Cc: linux-mmc@xxxxxxxxxxxxxxx; Jain Priyanka-B32167 Subject: RE: [PATCH v7] ESDHC: Workaround for data crc error on p1010rdb Thanks Jerry Huang > -----Original Message----- > From: Chris Ball [mailto:cjb@xxxxxxxxxx] > Sent: Tuesday, February 14, 2012 4:44 AM > To: Huang Changming-R66093 > Cc: linux-mmc@xxxxxxxxxxxxxxx; Jain Priyanka-B32167 > Subject: Re: [PATCH v7] ESDHC: Workaround for data crc error on > p1010rdb > > Hi, > > On Mon, Feb 13 2012, Huang Changming-R66093 wrote: > >> Actually, I think I'm still missing something. Why doesn't this work? > >> > >> +static void esdhc_of_set_clock(struct sdhci_host *host, unsigned > >> +int > >> +clock) { > >> + /* Workaround to reduce the clock frequency for p1010 esdhc */ > >> + if (of_find_compatible_node(NULL, NULL, "fsl,p1010-esdhc")) { > >> + if (clock > 20000000) > >> + clock -= 5000000; > >> + if (clock > 40000000) > >> + clock -= 5000000; > >> + } > >> + > >> + /* Set the clock */ > >> + esdhc_set_clock(host, clock); } > >> > > These codes can work, too. > > I forget the clock will be reduced 5M/10M only when the clock is > > greater than 20MHz/45MHz. > > So I should not test the clock in this function. > > Great, thanks -- please test and submit a patch with the code above, > and I'll merge it. Thanks, Chris. I have sent it again. Jerry Huang -- 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