Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge master.kernel.org:/home/rmk/linux-2.6-mmc

* master.kernel.org:/home/rmk/linux-2.6-mmc:
[MMC] pxamci: fix data timeout calculation

+4 -6
+4 -6
drivers/mmc/pxamci.c
··· 65 65 unsigned int dma_dir; 66 66 }; 67 67 68 - static inline unsigned int ns_to_clocks(unsigned int ns) 69 - { 70 - return (ns * (CLOCKRATE / 1000000) + 999) / 1000; 71 - } 72 - 73 68 static void pxamci_stop_clock(struct pxamci_host *host) 74 69 { 75 70 if (readl(host->base + MMC_STAT) & STAT_CLK_EN) { ··· 108 113 static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data) 109 114 { 110 115 unsigned int nob = data->blocks; 116 + unsigned long long clks; 111 117 unsigned int timeout; 112 118 u32 dcmd; 113 119 int i; ··· 121 125 writel(nob, host->base + MMC_NOB); 122 126 writel(1 << data->blksz_bits, host->base + MMC_BLKLEN); 123 127 124 - timeout = ns_to_clocks(data->timeout_ns) + data->timeout_clks; 128 + clks = (unsigned long long)data->timeout_ns * CLOCKRATE; 129 + do_div(clks, 1000000000UL); 130 + timeout = (unsigned int)clks + (data->timeout_clks << host->clkrt); 125 131 writel((timeout + 255) / 256, host->base + MMC_RDTO); 126 132 127 133 if (data->flags & MMC_DATA_READ) {