From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Ball Subject: Re: sdhci: Best Practice Question Date: Sun, 26 Sep 2010 17:40:05 +0100 Message-ID: <20100926164005.GC19772@void.printf.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from void.printf.net ([89.145.121.20]:48686 "EHLO void.printf.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752631Ab0IZQkG (ORCPT ); Sun, 26 Sep 2010 12:40:06 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-mmc-owner@vger.kernel.org List-Id: linux-mmc@vger.kernel.org To: Philip Rakity Cc: "linux-mmc@vger.kernel.org" Hi Philip, On Sat, Sep 25, 2010 at 01:08:20PM -0700, Philip Rakity wrote: > The change proposed by Richard Zhu for handling write protect uses > only a callback. > > > static int sdhci_get_ro(struct mmc_host *mmc) > { > struct sdhci_host *host; > unsigned long flags; > int present; > > host = mmc_priv(mmc); > > if (host->ops->get_ro) > return host->ops->get_ro(host); > > spin_lock_irqsave(&host->lock, flags); > > > > What is the correct practice? I think that the get_ro hook is reasonable in this case -- we're saying that the host has a sufficiently weird WP setup that sdhci doesn't know what we're supposed to do (unlike SDHCI_QUIRK_INVERTED_WRITE_PROTECT). I'd be curious to hear what others think, though. Should we be simply moving away from adding new quirks, or just limiting them to cases where a full hook isn't warranted? -- Chris Ball One Laptop Per Child