Skip to content

Commit 3560db8

Browse files
Russell Kingcjb
authored andcommitted
mmc: sdhci: push card_tasklet into threaded irq handler
There's no requirement to have the card tasklet separate now that we have a threaded interrupt handler, so kill this and move the called code into the threaded part of the handler. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Tested-by: Markus Pargmann <mpa@pengutronix.de> Tested-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <chris@printf.net>
1 parent 781e989 commit 3560db8

2 files changed

Lines changed: 10 additions & 16 deletions

File tree

‎drivers/mmc/host/sdhci.c‎

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,15 +2128,6 @@ static const struct mmc_host_ops sdhci_ops = {
21282128
* *
21292129
\*****************************************************************************/
21302130

2131-
static void sdhci_tasklet_card(unsigned long param)
2132-
{
2133-
struct sdhci_host *host = (struct sdhci_host*)param;
2134-
2135-
sdhci_card_event(host->mmc);
2136-
2137-
mmc_detect_change(host->mmc, msecs_to_jiffies(200));
2138-
}
2139-
21402131
static void sdhci_tasklet_finish(unsigned long param)
21412132
{
21422133
struct sdhci_host *host;
@@ -2477,7 +2468,10 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id)
24772468

24782469
sdhci_writel(host, intmask & (SDHCI_INT_CARD_INSERT |
24792470
SDHCI_INT_CARD_REMOVE), SDHCI_INT_STATUS);
2480-
tasklet_schedule(&host->card_tasklet);
2471+
2472+
host->thread_isr |= intmask & (SDHCI_INT_CARD_INSERT |
2473+
SDHCI_INT_CARD_REMOVE);
2474+
result = IRQ_WAKE_THREAD;
24812475
}
24822476

24832477
if (intmask & SDHCI_INT_CMD_MASK)
@@ -2534,6 +2528,11 @@ static irqreturn_t sdhci_thread_irq(int irq, void *dev_id)
25342528
host->thread_isr = 0;
25352529
spin_unlock_irqrestore(&host->lock, flags);
25362530

2531+
if (isr & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) {
2532+
sdhci_card_event(host->mmc);
2533+
mmc_detect_change(host->mmc, msecs_to_jiffies(200));
2534+
}
2535+
25372536
if (isr & SDHCI_INT_CARD_INT) {
25382537
sdio_run_irqs(host->mmc);
25392538

@@ -3224,8 +3223,6 @@ int sdhci_add_host(struct sdhci_host *host)
32243223
/*
32253224
* Init tasklets.
32263225
*/
3227-
tasklet_init(&host->card_tasklet,
3228-
sdhci_tasklet_card, (unsigned long)host);
32293226
tasklet_init(&host->finish_tasklet,
32303227
sdhci_tasklet_finish, (unsigned long)host);
32313228

@@ -3290,7 +3287,6 @@ int sdhci_add_host(struct sdhci_host *host)
32903287
free_irq(host->irq, host);
32913288
#endif
32923289
untasklet:
3293-
tasklet_kill(&host->card_tasklet);
32943290
tasklet_kill(&host->finish_tasklet);
32953291

32963292
return ret;
@@ -3334,7 +3330,6 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)
33343330

33353331
del_timer_sync(&host->timer);
33363332

3337-
tasklet_kill(&host->card_tasklet);
33383333
tasklet_kill(&host->finish_tasklet);
33393334

33403335
if (host->vmmc) {

‎include/linux/mmc/sdhci.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ struct sdhci_host {
164164
dma_addr_t adma_addr; /* Mapped ADMA descr. table */
165165
dma_addr_t align_addr; /* Mapped bounce buffer */
166166

167-
struct tasklet_struct card_tasklet; /* Tasklet structures */
168-
struct tasklet_struct finish_tasklet;
167+
struct tasklet_struct finish_tasklet; /* Tasklet structures */
169168

170169
struct timer_list timer; /* Timer for timeouts */
171170

0 commit comments

Comments
 (0)