Remove unnecessary patch as backported to kernel 5.10.72 (#3192)

commit e5cb3680b958ed3eb66504c0865f767d760cc9cd
Author: Neil Armstrong <narmstrong@baylibre.com>
Date:   Tue Sep 28 09:36:52 2021 +0200

    mmc: meson-gx: do not use memcpy_to/fromio for dram-access-quirk

    commit 8a38a4d51c5055d0201542e5ea3c0cb287f6e223 upstream.

Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
This commit is contained in:
Vyacheslav 2021-10-13 13:49:41 +03:00 committed by GitHub
parent 4d19f3d4aa
commit ae7c00689e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,96 +0,0 @@
This revets 103a5348c22c3fca8b96c735a9e353b8a0801842
Revert is required hack to get ap6256 wifi working ok on Amlogic.
Propper fix will be added soon...
Milion thx for Neil Armstrong for helping with this!
diff -Naur linux-5.13.5-old/drivers/mmc/host/meson-gx-mmc.c linux-5.13.5-new/drivers/mmc/host/meson-gx-mmc.c
--- linux-5.13.5-old/drivers/mmc/host/meson-gx-mmc.c 2021-07-25 14:37:37.000000000 +0200
+++ linux-5.13.5-new/drivers/mmc/host/meson-gx-mmc.c 2021-07-26 14:45:59.626665204 +0200
@@ -165,7 +165,6 @@
unsigned int bounce_buf_size;
void *bounce_buf;
- void __iomem *bounce_iomem_buf;
dma_addr_t bounce_dma_addr;
struct sd_emmc_desc *descs;
dma_addr_t descs_dma_addr;
@@ -746,47 +745,6 @@
writel(start, host->regs + SD_EMMC_START);
}
-/* local sg copy to buffer version with _to/fromio usage for dram_access_quirk */
-static void meson_mmc_copy_buffer(struct meson_host *host, struct mmc_data *data,
- size_t buflen, bool to_buffer)
-{
- unsigned int sg_flags = SG_MITER_ATOMIC;
- struct scatterlist *sgl = data->sg;
- unsigned int nents = data->sg_len;
- struct sg_mapping_iter miter;
- unsigned int offset = 0;
-
- if (to_buffer)
- sg_flags |= SG_MITER_FROM_SG;
- else
- sg_flags |= SG_MITER_TO_SG;
-
- sg_miter_start(&miter, sgl, nents, sg_flags);
-
- while ((offset < buflen) && sg_miter_next(&miter)) {
- unsigned int len;
-
- len = min(miter.length, buflen - offset);
-
- /* When dram_access_quirk, the bounce buffer is a iomem mapping */
- if (host->dram_access_quirk) {
- if (to_buffer)
- memcpy_toio(host->bounce_iomem_buf + offset, miter.addr, len);
- else
- memcpy_fromio(miter.addr, host->bounce_iomem_buf + offset, len);
- } else {
- if (to_buffer)
- memcpy(host->bounce_buf + offset, miter.addr, len);
- else
- memcpy(miter.addr, host->bounce_buf + offset, len);
- }
-
- offset += len;
- }
-
- sg_miter_stop(&miter);
-}
-
static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd)
{
struct meson_host *host = mmc_priv(mmc);
@@ -830,7 +788,8 @@
if (data->flags & MMC_DATA_WRITE) {
cmd_cfg |= CMD_CFG_DATA_WR;
WARN_ON(xfer_bytes > host->bounce_buf_size);
- meson_mmc_copy_buffer(host, data, xfer_bytes, true);
+ sg_copy_to_buffer(data->sg, data->sg_len,
+ host->bounce_buf, xfer_bytes);
dma_wmb();
}
@@ -999,7 +958,8 @@
if (meson_mmc_bounce_buf_read(data)) {
xfer_bytes = data->blksz * data->blocks;
WARN_ON(xfer_bytes > host->bounce_buf_size);
- meson_mmc_copy_buffer(host, data, xfer_bytes, false);
+ sg_copy_from_buffer(data->sg, data->sg_len,
+ host->bounce_buf, xfer_bytes);
}
next_cmd = meson_mmc_get_next_command(cmd);
@@ -1219,7 +1179,7 @@
* instead of the DDR memory
*/
host->bounce_buf_size = SD_EMMC_SRAM_DATA_BUF_LEN;
- host->bounce_iomem_buf = host->regs + SD_EMMC_SRAM_DATA_BUF_OFF;
+ host->bounce_buf = host->regs + SD_EMMC_SRAM_DATA_BUF_OFF;
host->bounce_dma_addr = res->start + SD_EMMC_SRAM_DATA_BUF_OFF;
} else {
/* data bounce buffer */