Re: [PATCH] sdhci: Add quirk to support polling for card presence

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Philip Langdale wrote:
> @@ -806,11 +819,18 @@ static void sdhci_tasklet_card(unsigned long param)
>  			host->mrq->cmd->error = MMC_ERR_FAILED;
>  			tasklet_schedule(&host->finish_tasklet);
>  		}
> -	}
>
> -	spin_unlock_irqrestore(&host->lock, flags);
> +		spin_unlock_irqrestore(&host->lock, flags);
> +
>   

Where's the unlock for the other branch?

> +		host->present = present;
>
>   

And this should be protected by the lock :)

> +		mmc_detect_change(host->mmc, msecs_to_jiffies(500));
> +	}
>   

Perhaps we should have a different delay here. After all, we're no
longer delaying against an interrupt.

> -	mmc_detect_change(host->mmc, msecs_to_jiffies(500));
> +	if (host->chip->quirks & SDHCI_QUIRK_NO_CARD_DETECT_INT) {
> +		host->detect_timer.expires = jiffies + 3 * HZ;
> +		add_timer(&host->detect_timer);
> +	}
>  }
>
>  static void sdhci_tasklet_finish(unsigned long param)
>   

I wonder if three seconds is a bit much. You might give up and yank the
card in that time.

Keep up the good work. :)

Rgds

-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux