[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdYaq3YH+HSYh7ChSyBF8=pscYEU_URu8oZpgSik0MtT-Q@mail.gmail.com>
Date: Thu, 12 Oct 2017 09:32:06 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Jin Qian <jinqian@...roid.com>
Cc: Ulf Hansson <ulf.hansson@...aro.org>,
Jin Qian <jinqian@...gle.com>,
Shawn Lin <shawn.lin@...k-chips.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Jaehoon Chung <jh80.chung@...sung.com>,
Uri Yanai <uri.yanai@...disk.com>,
Chanho Min <chanho.min@....com>,
Jungseung Lee <js07.lee@...sung.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>
Subject: Re: [PATCHv2 1/1] ANDROID: mmc: core: export emmc revision
On Wed, Oct 11, 2017 at 10:51 PM, Jin Qian <jinqian@...roid.com> wrote:
> From: Jin Qian <jinqian@...gle.com>
>
> Expose emmc revision as part of device attributes.
>
> Signed-off-by: Jin Qian <jinqian@...roid.com>
So have you tried and seen what happens with an MMC that
is not an eMMC, i.e. a good old MMC card from back in the days?
Does it display all zeroes or something?
I think it is by far a better idea that Android start to read out these
things using the ioctl() operation and cut this sysfs business.
Example, see:
https://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git/tree/mmc_cmds.c
there is int read_extcsd() immediately in the top of the file.
The ioctl()s are a much better way to do this.
The ioctl() will read the extcsd
on the fly from the card, and what you see in sysfs is just read
when the card is initialized and then kept static.
Since the extcsd is not static but can change at runtime, I think
what you want to to is ioctl()s.
If we start to support reading extcsd from sysfs, the implementation
cannot just use the static copy of ext_csd like this, it needs to
ask the card for it using MMC_DRV_OP_GET_EXT_CSD
see
commit 627c3ccfb46ada2583eac434127ad5d75e1ac33c
"mmc: debugfs: Move block debugfs into block module"
Yours,
Linus Walleij
Powered by blists - more mailing lists