From: linux@arm.linux.org.uk (Russell King - ARM Linux) Date: Wed, 19 Feb 2014 23:22:53 +0000 Subject: [PATCH RFC 31/31] mmc: sdhci-tegra: get rid of special PRESENT_STATE register handling In-Reply-To: <53050E43.3030602@wwwdotorg.org> References: <20140218150801.GD21483@n2100.arm.linux.org.uk> <53050E43.3030602@wwwdotorg.org> Message-ID: <20140219232253.GW21483@n2100.arm.linux.org.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Feb 19, 2014 at 01:04:19PM -0700, Stephen Warren wrote: > On 02/18/2014 08:11 AM, Russell King wrote: > > sdhci-tegra provides a get_ro method, which overrides the checking > > of the write protect bit in the PRESENT_STATE register in sdhci.c: > > > > if (host->flags & SDHCI_DEVICE_DEAD) > > is_readonly = 0; > > else if (host->ops->get_ro) > > is_readonly = host->ops->get_ro(host); > > else > > is_readonly = !(sdhci_readl(host, SDHCI_PRESENT_STATE) > > & SDHCI_WRITE_PROTECT); > > > > This means it's pointless detecting accesses to this register and > > manually setting the SDHCI_WRITE_PROTECT as it has no effect. > > > > This means that the whole of tegra_sdhci_readl() can be removed and > > we can use the builtin sdhci readl functionality here. > > Acked-by: Stephen Warren Thanks. > > =-DO NOT APPLY-= > > Is that just because it's an RFC and you want to make sure it doesn't > get accepted early, or are you explicitly trying to stop people applying > this, testing it, and giving Tested-by? The script was a little too over-zealous. It was just supposed to do the following transformation: --- => =-DO NOT APPLY-= +++ => =+DO NOT APPLY+= which would've made it reversible with a trivial sed expression - but I cocked up because of the utterly random nature of regexp flavours, and instead gave sed this: sed -i 's/^---/=-DO NOT APPLY-=/;s/^\+\+\+/=+DO NOT APPLY+=/' The escaped '+' ends up causing sed to match a single + at the beginning of a line. (Other regexp flavours require you to escape the '+' otherwise it's interpreted as "one or more".) I had added that mode to my script a few months ago, and I just assumed I'd fully tested it when I used it yesterday... clearly not so. So... yes it was designed to stop it being _accepted_ but it should have also been completely reversible for those who wished to apply it via the obvious reversed sed expression. -- FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up. Estimation in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad. Estimate before purchase was "up to 13.2Mbit".