From: Adrian Hunter <adrian.hunter@intel.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Stefan Wahren <stefan.wahren@i2se.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Alex Dubov <oakad@yahoo.com>,
Thierry Reding <thierry.reding@gmail.com>,
linux-mmc@vger.kernel.org
Subject: [PATCH 13/14] mmc: au1xmmc: Replace kmap_atomic() with kmap_local_page()
Date: Wed, 5 Oct 2022 13:19:50 +0300 [thread overview]
Message-ID: <20221005101951.3165-14-adrian.hunter@intel.com> (raw)
In-Reply-To: <20221005101951.3165-1-adrian.hunter@intel.com>
kmap_local_page() is equivalent to kmap_atomic() except that it does not
disable page faults or preemption. Where possible kmap_local_page() is
preferred to kmap_atomic() - refer kernel highmem documentation.
In this case, there is no need to disable page faults or preemption, so
replace kmap_atomic() with kmap_local_page(), and, correspondingly,
kunmap_atomic() with kunmap_local().
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/au1xmmc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
index c88b039dc9fb..82dd0ae40305 100644
--- a/drivers/mmc/host/au1xmmc.c
+++ b/drivers/mmc/host/au1xmmc.c
@@ -388,7 +388,7 @@ static void au1xmmc_send_pio(struct au1xmmc_host *host)
/* This is the pointer to the data buffer */
sg = &data->sg[host->pio.index];
- sg_ptr = kmap_atomic(sg_page(sg)) + sg->offset + host->pio.offset;
+ sg_ptr = kmap_local_page(sg_page(sg)) + sg->offset + host->pio.offset;
/* This is the space left inside the buffer */
sg_len = data->sg[host->pio.index].length - host->pio.offset;
@@ -409,7 +409,7 @@ static void au1xmmc_send_pio(struct au1xmmc_host *host)
__raw_writel((unsigned long)val, HOST_TXPORT(host));
wmb(); /* drain writebuffer */
}
- kunmap_atomic(sg_ptr);
+ kunmap_local(sg_ptr);
host->pio.len -= count;
host->pio.offset += count;
@@ -446,7 +446,7 @@ static void au1xmmc_receive_pio(struct au1xmmc_host *host)
if (host->pio.index < host->dma.len) {
sg = &data->sg[host->pio.index];
- sg_ptr = kmap_atomic(sg_page(sg)) + sg->offset + host->pio.offset;
+ sg_ptr = kmap_local_page(sg_page(sg)) + sg->offset + host->pio.offset;
/* This is the space left inside the buffer */
sg_len = sg_dma_len(&data->sg[host->pio.index]) - host->pio.offset;
@@ -488,7 +488,7 @@ static void au1xmmc_receive_pio(struct au1xmmc_host *host)
sg_ptr[count] = (unsigned char)(val & 0xFF);
}
if (sg_ptr)
- kunmap_atomic(sg_ptr);
+ kunmap_local(sg_ptr);
host->pio.len -= count;
host->pio.offset += count;
--
2.25.1
next prev parent reply other threads:[~2022-10-05 10:20 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-05 10:19 [PATCH 00/14] mmc: Replace kmap_atomic() with kmap_local_page() Adrian Hunter
2022-10-05 10:19 ` [PATCH 01/14] mmc: sdhci: Remove local_irq_{save,restore}() around k[un]map_atomic() Adrian Hunter
2022-10-05 10:19 ` [PATCH 02/14] mmc: sdhci: Remove local_irq_{save,restore}() around sg_miter_{next,stop}() Adrian Hunter
2022-10-05 10:19 ` [PATCH 03/14] mmc: sdhci: Replace kmap_atomic() with kmap_local_page() Adrian Hunter
2022-10-06 7:03 ` Avri Altman
2022-10-06 7:23 ` Adrian Hunter
2022-10-05 10:19 ` [PATCH 04/14] mmc: bcm2835: Remove local_irq_{save,restore}() around k[un]map_atomic() Adrian Hunter
2022-10-05 10:19 ` [PATCH 05/14] mmc: bcm2835: Remove local_irq_{save,restore}() around sg_miter_{next,stop}() Adrian Hunter
2022-10-05 10:19 ` [PATCH 06/14] mmc: bcm2835: Replace kmap_atomic() with kmap_local_page() Adrian Hunter
2022-10-05 10:19 ` [PATCH 07/14] mmc: mmc_test: Remove local_irq_{save,restore}() around sg_copy_{from,to}_buffer() Adrian Hunter
2022-10-05 10:19 ` [PATCH 08/14] mmc: tifm_sd: Remove local_irq_{save,restore}() around tifm_sd_transfer_data() Adrian Hunter
2022-10-05 10:19 ` [PATCH 09/14] mmc: tifm_sd: Remove local_irq_{save,restore}() around tifm_sd_bounce_block() Adrian Hunter
2022-10-05 10:19 ` [PATCH 10/14] mmc: tifm_sd: Replace kmap_atomic() with kmap_local_page() Adrian Hunter
2022-10-05 10:19 ` [PATCH 11/14] mmc: tmio_mmc_core: Remove local_irq_{save,restore}() around k[un]map_atomic() Adrian Hunter
2022-10-31 19:36 ` Wolfram Sang
2022-11-02 12:06 ` Wolfram Sang
2022-10-05 10:19 ` [PATCH 12/14] mmc: tmio_mmc_core: Replace kmap_atomic() with kmap_local_page() Adrian Hunter
2022-10-31 19:38 ` Wolfram Sang
2022-10-05 10:19 ` Adrian Hunter [this message]
2022-10-05 10:19 ` [PATCH 14/14] mmc: wbsd: " Adrian Hunter
2022-10-24 17:11 ` [PATCH 00/14] mmc: " Ulf Hansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221005101951.3165-14-adrian.hunter@intel.com \
--to=adrian.hunter@intel.com \
--cc=f.fainelli@gmail.com \
--cc=linux-mmc@vger.kernel.org \
--cc=oakad@yahoo.com \
--cc=stefan.wahren@i2se.com \
--cc=thierry.reding@gmail.com \
--cc=ulf.hansson@linaro.org \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).