On Fri, Jan 13, 2012 at 07:05:19AM +0000, Huang Changming-R66093 wrote: > If you read the previous email about this serial patches discussed with other guys, you can understand. > > > -----Original Message----- > > From: Aaron Lu [mailto:aaron.lu@xxxxxxx] > > Sent: Friday, January 13, 2012 2:28 PM > > To: Huang Changming-R66093 > > Cc: linux-mmc@xxxxxxxxxxxxxxx; Chris Ball > > Subject: Re: [PATCH 2/4 v4] MMC/SD: Add callback function to detect card > > > > Hi, > > > > On Fri, Jan 13, 2012 at 04:52:42AM +0000, Huang Changming-R66093 wrote: > > > > > > > For sd hosts, this should only happen for hosts which have > > > > SDHCI_QUIRK_BROKEN_CARD_DETECTION set. > > > Yes, but which will impact the performance. > > > > You only set this bit when your host broke, and if your host has other > > means to detect this, then go with your newly added callback. > To detect the card state, if SDHCI_QUIRK_BROKEN_CARD_DETECTION is set, then driver will send command to card, which will cause the bad performance. > So my patch will do: > 1. use get_cd to detect the card state, if platform don't support this feature(get_cd is not defined in special platform), -ENOSYS will be returned > 2. if -ENOSYS, then send the command to card. OK, this is clear. I didn't know there is a get_cd callback already defined in sdhci_ops with a clear return value description, sorry for the mess. > > I just suggested to change the name and use a different return value for > > this get_cd function, not to add a new function call. > > > The description for get_cd in file "include/linux/mmc/host.h": > * Return values for the get_cd callback should be: > * 0 for a absent card > * 1 for a present card > * -ENOSYS when not supported (equal to NULL callback) > * or a negative errno value when something bad happened > I don't think your suggest is reasonable. Agree. -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html