Re: [PATCH 2/2] mmc: core: Export device/vendor ids from Common CIS for SDIO cards
From: Ulf Hansson
Date: Wed May 27 2020 - 04:14:34 EST
On Wed, 27 May 2020 at 10:00, Pali RohÃr <pali@xxxxxxxxxx> wrote:
> On Wednesday 27 May 2020 09:39:50 Ulf Hansson wrote:
> > On Tue, 26 May 2020 at 17:43, Pali RohÃr <pali@xxxxxxxxxx> wrote:
> > >
> > > Device/vendor ids from Common CIS (Card Information Structure) may be
> > > different as device/vendor ids from CIS on particular SDIO function.
> > >
> > > Export these "main" device/vendor ids for SDIO and SD combo cards at top
> > > level mmc device in sysfs so userspace can do better identification of
> > > connected SDIO and SD combo cards.
> > What would userspace do with this information, more exactly?
> Userspace can e.g. write udev rules based on Common CIS vendor/device
> id. Or can exactly identify SDIO card by CIS vendor/device id. Also it
> can be suitable for "lssdio" tool to print all information about SDIO
> Currently I do not know any way how userspace can retrieve these ids for
> particular SDIO card. And correct identification is important.
> Other important thing is that kernel on some places (e.g. mmc quirks)
> uses Common CIS vendor/device id and on other places (e.g. binding
> drivers) it uses SDIO function device/vendor ids.
> So for debugging and developing kernel drivers it is needed to know
> correct Common CIS vendor/device id and SDIO functions vendor/device
> > Isn't it just sufficient to give events per SDIO func, as we already
> > do in sdio_bus_uevent()?
> No because some SDIO cards have different Common CIS vendor/device id
> and different vendor/device ids for particular SDIO functions.
> Common CIS vendor/device id is the "main" identification of SDIO card,
> functions vendor/device ids just identify one of those functions.
> For example look at my patch "mmc: sdio: Fix macro name for Marvell
> device with ID 0x9134" . Without knowing correct CIS vendor/device id
> I was not able to fully understand problem and mess with names and ids.
> Because mmc quirks list uses CIS vendor/device ids (I guess for obvious
> reason as SDIO functions are not enumerated yet).
Good points, much appreciated to understand the use cases better!
May I suggest that you put some of this information into the commit message?
>  - https://lore.kernel.org/linux-mmc/20200522144412.19712-2-pali@xxxxxxxxxx/