linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/14] mmc: Replace kmap_atomic() with kmap_local_page()
@ 2022-10-05 10:19 Adrian Hunter
  2022-10-05 10:19 ` [PATCH 01/14] mmc: sdhci: Remove local_irq_{save,restore}() around k[un]map_atomic() Adrian Hunter
                   ` (14 more replies)
  0 siblings, 15 replies; 21+ messages in thread
From: Adrian Hunter @ 2022-10-05 10:19 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Stefan Wahren, Florian Fainelli, Wolfram Sang, Alex Dubov,
	Thierry Reding, linux-mmc

Hi

Here are patches primarily aimed at replacing kmap_atomic() with
kmap_local_page().

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 these cases, there is no need to disable page faults or preemption, so
kmap_atomic() is replaced with kmap_local_page(), and, correspondingly,
kunmap_atomic() with kunmap_local().

That work raised the question of why local_irq_{save,restore}() was being
used with k[un]map_atomic().  It turns out to be for legacy reasons that
have gone away.

A long time ago the kmap_atomic API required a slot to be provided which
risked the possibility that other code might use the same slot at the
same time. Disabling interrupts prevented the possibility of an interrupt
handler doing that. However, that went away with
commit 3e4d3af501cc ("mm: stack based kmap_atomic()").

The work is mostly divided into separate patches, to enable separate review
for driver reviewers and to enable separate reverts if necessary.


Adrian Hunter (14):
      mmc: sdhci: Remove local_irq_{save,restore}() around k[un]map_atomic()
      mmc: sdhci: Remove local_irq_{save,restore}() around sg_miter_{next,stop}()
      mmc: sdhci: Replace kmap_atomic() with kmap_local_page()
      mmc: bcm2835: Remove local_irq_{save,restore}() around k[un]map_atomic()
      mmc: bcm2835: Remove local_irq_{save,restore}() around sg_miter_{next,stop}()
      mmc: bcm2835: Replace kmap_atomic() with kmap_local_page()
      mmc: mmc_test: Remove local_irq_{save,restore}() around sg_copy_{from,to}_buffer()
      mmc: tifm_sd: Remove local_irq_{save,restore}() around tifm_sd_transfer_data()
      mmc: tifm_sd: Remove local_irq_{save,restore}() around tifm_sd_bounce_block()
      mmc: tifm_sd: Replace kmap_atomic() with kmap_local_page()
      mmc: tmio_mmc_core: Remove local_irq_{save,restore}() around k[un]map_atomic()
      mmc: tmio_mmc_core: Replace kmap_atomic() with kmap_local_page()
      mmc: au1xmmc: Replace kmap_atomic() with kmap_local_page()
      mmc: wbsd: Replace kmap_atomic() with kmap_local_page()

 drivers/mmc/core/mmc_test.c              |  5 -----
 drivers/mmc/host/au1xmmc.c               |  8 ++++----
 drivers/mmc/host/bcm2835.c               | 12 ++----------
 drivers/mmc/host/renesas_sdhi_sys_dmac.c |  5 ++---
 drivers/mmc/host/sdhci.c                 | 30 ++++++++----------------------
 drivers/mmc/host/tifm_sd.c               | 28 ++++++++++------------------
 drivers/mmc/host/tmio_mmc.h              | 11 ++++-------
 drivers/mmc/host/tmio_mmc_core.c         | 10 ++++------
 drivers/mmc/host/wbsd.c                  | 10 +++++-----
 9 files changed, 39 insertions(+), 80 deletions(-)


Regards
Adrian

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2022-11-02 12:06 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 13/14] mmc: au1xmmc: " Adrian Hunter
2022-10-05 10:19 ` [PATCH 14/14] mmc: wbsd: " Adrian Hunter
2022-10-24 17:11 ` [PATCH 00/14] mmc: " Ulf Hansson

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).