lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 5 May 2014 11:14:47 +0200
From:	Ulf Hansson <ulf.hansson@...aro.org>
To:	Sascha Hauer <s.hauer@...gutronix.de>,
	Daniel Willmann <daniel@...alueberwachung.de>
Cc:	Chris Ball <chris@...ntf.net>,
	linux-mmc <linux-mmc@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Shawn Guo <shawn.guo@...aro.org>
Subject: Re: [PATCH] mmc: mxs: fix card detection function for broken card detect

On 28 April 2014 11:36, Sascha Hauer <s.hauer@...gutronix.de> wrote:
> On Mon, Apr 28, 2014 at 11:31:03AM +0200, Ulf Hansson wrote:
>> On 28 April 2014 11:13, Sascha Hauer <s.hauer@...gutronix.de> wrote:
>> > On Sat, Apr 19, 2014 at 11:59:18PM +0200, Daniel Willmann wrote:
>> >> Return -ENOSYS in get_cd if broken-cd is specified in the device tree.
>> >>
>> >> Commit a91fe279ae75 (mmc: mxs: use standard flag for broken card
>> >> detection) sets MMC_CAP_NEEDS_POLL when broken-cd is specified. This
>> >> driver sets this flag unconditionally as it does not support a card
>> >> detect interrupt. Instead, broken-cd means that there is no card detect
>> >> signal connected.
>> >>
>> >> The mmc core checks the get_cd function return value to determine if a
>> >> card is present. Only for a non-zero return value it will attempt to
>> >> initialize the card. So retuning -ENOSYS will allow the card to be
>> >> initialized.
>> >> For comparison, mmc_gpio_get_cd in slot-gpio.c also returns -ENOSYS if
>> >> the card detect GPIO is not valid.
>> >
>> > Short answer for fixing this regression:
>> >
>> > Acked-by: Sascha Hauer <s.hauer@...gutronix.de>
>> >
>> > Long answer:
>> >
>> > This is broken in the MMC OF parser. When the parser finds the
>> > 'broken-cd' property it just sets the MMC_CAP_NEEDS_POLL flag. This is
>> > wrong.  broken-cd means that we cannot rely on any card detection, but
>> > instead have to talk to the card to find out if it's available.
>> > Currently there is no flag to signal this situation, so the host driver
>> > has to handle this by returning true in the get_cd callback, just like
>> > the patch below does.
>> >
>> > IMO the correct solution would be to add a MMC_CAP_CD_NEEDS_TALK_TO_CARD
>> > flag to the core.
>> >
>>
>> So if I understand correct, you want the host-ops->get_cd function to
>> be invoked from the mmc rescan - only when it actually can provide
>> useful information?
>
> Yes.

Until/if that happens, I suggest to go ahead with Daniel's patch as well.

Acked-by: Ulf Hansson <ulf.hansson@...aro.org>

>
> Sascha
>
> --
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ