Commit 723b43daec7ee2ddb600cfcb9b0253d4a71c3915

Authored by Bin Meng
Committed by Tom Rini
1 parent 6305db9604

blk: Remove various places that do flush cache after read

All these places seem to inherit the codes from the MMC driver where
a FIXME was put in the comment. However the correct operation after
read should be cache invalidate, not flush.

The underlying drivers should be responsible for the cache operation.
Remove these codes completely.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: York Sun <york.sun@nxp.com>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: York Sun <york.sun@nxp.com>

Showing 8 changed files with 0 additions and 31 deletions Side-by-side Diff

arch/arm/cpu/armv8/fsl-layerscape/ppa.c
... ... @@ -107,9 +107,6 @@
107 107 return -EIO;
108 108 }
109 109  
110   - /* flush cache after read */
111   - flush_cache((ulong)fitp, cnt * 512);
112   -
113 110 ret = fdt_check_header(fitp);
114 111 if (ret) {
115 112 free(fitp);
... ... @@ -134,9 +131,6 @@
134 131 }
135 132 debug("Read PPA header to 0x%p\n", ppa_hdr_ddr);
136 133  
137   - /* flush cache after read */
138   - flush_cache((ulong)ppa_hdr_ddr, cnt * 512);
139   -
140 134 ppa_esbc_hdr = (uintptr_t)ppa_hdr_ddr;
141 135 #endif
142 136  
... ... @@ -164,9 +158,6 @@
164 158 return -EIO;
165 159 }
166 160  
167   - /* flush cache after read */
168   - flush_cache((ulong)ppa_fit_addr, cnt * 512);
169   -
170 161 #elif defined(CONFIG_SYS_LS_PPA_FW_IN_NAND)
171 162 struct fdt_header fit;
172 163  
... ... @@ -208,9 +199,6 @@
208 199 }
209 200 debug("Read PPA header to 0x%p\n", ppa_hdr_ddr);
210 201  
211   - /* flush cache after read */
212   - flush_cache((ulong)ppa_hdr_ddr, fw_length);
213   -
214 202 ppa_esbc_hdr = (uintptr_t)ppa_hdr_ddr;
215 203 #endif
216 204  
... ... @@ -232,9 +220,6 @@
232 220 CONFIG_SYS_LS_PPA_FW_ADDR);
233 221 return -EIO;
234 222 }
235   -
236   - /* flush cache after read */
237   - flush_cache((ulong)ppa_fit_addr, fw_length);
238 223 #else
239 224 #error "No CONFIG_SYS_LS_PPA_FW_IN_xxx defined"
240 225 #endif
board/toradex/common/tdx-cfg-block.c
... ... @@ -129,8 +129,6 @@
129 129 ret = -EIO;
130 130 goto out;
131 131 }
132   - /* Flush cache after read */
133   - flush_cache((ulong)(unsigned char *)config_block, 512);
134 132 } else {
135 133 /* Just writing one 512 byte block */
136 134 if (blk_dwrite(mmc_get_blk_desc(mmc), blk_start, 1,
... ... @@ -293,8 +293,6 @@
293 293 curr_device, blk, cnt);
294 294  
295 295 n = blk_dread(mmc_get_blk_desc(mmc), blk, cnt, addr);
296   - /* flush cache after read */
297   - flush_cache((ulong)addr, cnt * 512); /* FIXME */
298 296 printf("%d blocks read: %s\n", n, (n == cnt) ? "OK" : "ERROR");
299 297  
300 298 return (n == cnt) ? CMD_RET_SUCCESS : CMD_RET_FAILURE;
drivers/block/blk-uclass.c
... ... @@ -294,9 +294,6 @@
294 294 if (IS_ERR_VALUE(n))
295 295 return n;
296 296  
297   - /* flush cache after read */
298   - flush_cache((ulong)buffer, blkcnt * desc->blksz);
299   -
300 297 return n;
301 298 }
302 299  
drivers/block/blk_legacy.c
... ... @@ -232,9 +232,6 @@
232 232 if (IS_ERR_VALUE(n))
233 233 return n;
234 234  
235   - /* flush cache after read */
236   - flush_cache((ulong)buffer, blkcnt * desc->blksz);
237   -
238 235 return n;
239 236 }
240 237  
... ... @@ -405,8 +405,6 @@
405 405 mmc_init(mmc);
406 406 (void)mmc->block_dev.block_read(&mmc->block_dev, blk, cnt,
407 407 addr);
408   - /* flush cache after read */
409   - flush_cache((ulong)addr, cnt * 512);
410 408 }
411 409 #elif defined(CONFIG_SYS_QE_FMAN_FW_IN_REMOTE)
412 410 void *addr = (void *)CONFIG_SYS_FMAN_FW_ADDR;
drivers/net/phy/cortina.c
... ... @@ -177,8 +177,6 @@
177 177 mmc_init(mmc);
178 178 (void)mmc->block_dev.block_read(&mmc->block_dev, blk, cnt,
179 179 addr);
180   - /* flush cache after read */
181   - flush_cache((ulong)addr, cnt * 512);
182 180 }
183 181 #endif
184 182  
... ... @@ -221,8 +221,6 @@
221 221 mmc_init(mmc);
222 222 (void)mmc->block_dev.block_read(&mmc->block_dev, blk, cnt,
223 223 addr);
224   - /* flush cache after read */
225   - flush_cache((ulong)addr, cnt * 512);
226 224 }
227 225 #endif
228 226 if (!u_qe_upload_firmware(addr))