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()").
When the second argument to kmap_atomic was removed by commit
482fce997e14
("mmc: remove the second argument of k[un]map_atomic()"),
local_irq_{save,restore}() should have been removed also.
Remove it now.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20221005101951.3165-12-adrian.hunter@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
/* The only sg element can be unaligned, use our bounce buffer then */
if (!aligned) {
- unsigned long flags;
- void *sg_vaddr = tmio_mmc_kmap_atomic(sg, &flags);
+ void *sg_vaddr = tmio_mmc_kmap_atomic(sg);
sg_init_one(&host->bounce_sg, host->bounce_buf, sg->length);
memcpy(host->bounce_buf, sg_vaddr, host->bounce_sg.length);
- tmio_mmc_kunmap_atomic(sg, &flags, sg_vaddr);
+ tmio_mmc_kunmap_atomic(sg, sg_vaddr);
host->sg_ptr = &host->bounce_sg;
sg = host->sg_ptr;
}
void tmio_mmc_disable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
irqreturn_t tmio_mmc_irq(int irq, void *devid);
-static inline char *tmio_mmc_kmap_atomic(struct scatterlist *sg,
- unsigned long *flags)
+static inline char *tmio_mmc_kmap_atomic(struct scatterlist *sg)
{
- local_irq_save(*flags);
return kmap_atomic(sg_page(sg)) + sg->offset;
}
static inline void tmio_mmc_kunmap_atomic(struct scatterlist *sg,
- unsigned long *flags, void *virt)
+ void *virt)
{
kunmap_atomic(virt - sg->offset);
- local_irq_restore(*flags);
}
#ifdef CONFIG_PM
void *sg_virt;
unsigned short *buf;
unsigned int count;
- unsigned long flags;
if (host->dma_on) {
pr_err("PIO IRQ in DMA mode!\n");
return;
}
- sg_virt = tmio_mmc_kmap_atomic(host->sg_ptr, &flags);
+ sg_virt = tmio_mmc_kmap_atomic(host->sg_ptr);
buf = (unsigned short *)(sg_virt + host->sg_off);
count = host->sg_ptr->length - host->sg_off;
host->sg_off += count;
- tmio_mmc_kunmap_atomic(host->sg_ptr, &flags, sg_virt);
+ tmio_mmc_kunmap_atomic(host->sg_ptr, sg_virt);
if (host->sg_off == host->sg_ptr->length)
tmio_mmc_next_sg(host);
static void tmio_mmc_check_bounce_buffer(struct tmio_mmc_host *host)
{
if (host->sg_ptr == &host->bounce_sg) {
- unsigned long flags;
- void *sg_vaddr = tmio_mmc_kmap_atomic(host->sg_orig, &flags);
+ void *sg_vaddr = tmio_mmc_kmap_atomic(host->sg_orig);
memcpy(sg_vaddr, host->bounce_buf, host->bounce_sg.length);
- tmio_mmc_kunmap_atomic(host->sg_orig, &flags, sg_vaddr);
+ tmio_mmc_kunmap_atomic(host->sg_orig, sg_vaddr);
}
}