mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mmc: core: Add a capability for disabling mmc cards
@ 2013-05-14  7:38 Adam Lee
  2013-05-14  7:53 ` Adam Lee
  2013-05-14  8:56 ` Linus Walleij
  0 siblings, 2 replies; 6+ messages in thread
From: Adam Lee @ 2013-05-14  7:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: nico, Doug Anderson, Alim Akhtar

On some systems we need a way to disable MMC card support in a MMC/SD
card slot due to the legal concern.

Add support in the core SD/MMC code to support this.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Adam Lee <adam.lee@canonical.com>
---
 drivers/mmc/core/core.c  |    2 +-
 include/linux/mmc/host.h |    1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index c40396f..4788b88 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2271,7 +2271,7 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
 		return 0;
 	if (!mmc_attach_sd(host))
 		return 0;
-	if (!mmc_attach_mmc(host))
+	if (!(host->caps2 & MMC_CAP2_NO_MMC) && !mmc_attach_mmc(host))
 		return 0;
 
 	mmc_power_off(host);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index e326ae2..ffe5c3d 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -281,6 +281,7 @@ struct mmc_host {
 #define MMC_CAP2_PACKED_CMD	(MMC_CAP2_PACKED_RD | \
 				 MMC_CAP2_PACKED_WR)
 #define MMC_CAP2_NO_PRESCAN_POWERUP (1 << 14)	/* Don't power up before scan */
+#define MMC_CAP2_NO_MMC		(1 << 15)	/* Only SD supported, not MMC */
 
 	mmc_pm_flag_t		pm_caps;	/* supported pm features */
 
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mmc: core: Add a capability for disabling mmc cards
  2013-05-14  7:38 [PATCH] mmc: core: Add a capability for disabling mmc cards Adam Lee
@ 2013-05-14  7:53 ` Adam Lee
  2013-05-14 11:19   ` Chris Ball
  2013-05-14  8:56 ` Linus Walleij
  1 sibling, 1 reply; 6+ messages in thread
From: Adam Lee @ 2013-05-14  7:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: nico, Doug Anderson, Alim Akhtar, Chris Ball, Ulf Hansson,
	Johan Rudholm, Jaehoon Chung, Konstantin Dorfman, linux-mmc

On Tue, May 14, 2013 at 03:38:17PM +0800, Adam Lee wrote:
> On some systems we need a way to disable MMC card support in a MMC/SD
> card slot due to the legal concern.
> 
> Add support in the core SD/MMC code to support this.

CC more addresses.

Yes, this capability seems odd, but linux computer vendors need this to
avoid legal problems. Please review, thanks.

-- 
Regards,
Adam Lee
Hardware Enablement

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mmc: core: Add a capability for disabling mmc cards
  2013-05-14  7:38 [PATCH] mmc: core: Add a capability for disabling mmc cards Adam Lee
  2013-05-14  7:53 ` Adam Lee
@ 2013-05-14  8:56 ` Linus Walleij
  1 sibling, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2013-05-14  8:56 UTC (permalink / raw)
  To: Adam Lee
  Cc: linux-kernel, Nicolas Pitre, Doug Anderson, Alim Akhtar,
	Sebastian Rasmussen

On Tue, May 14, 2013 at 9:38 AM, Adam Lee <adam.lee@canonical.com> wrote:

> On some systems we need a way to disable MMC card support in a MMC/SD
> card slot due to the legal concern.
>
> Add support in the core SD/MMC code to support this.
>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
> Signed-off-by: Adam Lee <adam.lee@canonical.com>

(...)
>  #define MMC_CAP2_NO_PRESCAN_POWERUP (1 << 14)  /* Don't power up before scan */
> +#define MMC_CAP2_NO_MMC                (1 << 15)       /* Only SD supported, not MMC */

I would name that MMC_CAP2_DISABLE_MMC_BUT_NOT_SD
because that is what it means.

People wanting to set that capability for said legal reasons
will not read the git log.

So also encode what you just said in the comment for the CAP
so it is crystal clear what this is for.

I'm a bit ambivalent about what kind of benefits this provides
to human users of the Linux kernel, while I do understand the
benefit it provides for legal bodies...

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mmc: core: Add a capability for disabling mmc cards
  2013-05-14  7:53 ` Adam Lee
@ 2013-05-14 11:19   ` Chris Ball
  2013-05-14 15:04     ` Doug Anderson
  2013-05-14 16:50     ` Nicolas Pitre
  0 siblings, 2 replies; 6+ messages in thread
From: Chris Ball @ 2013-05-14 11:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: nico, Doug Anderson, Alim Akhtar, Ulf Hansson, Johan Rudholm,
	Jaehoon Chung, Konstantin Dorfman, linux-mmc

Hi,

On Tue, May 14 2013, Adam Lee wrote:
> On Tue, May 14, 2013 at 03:38:17PM +0800, Adam Lee wrote:
>> On some systems we need a way to disable MMC card support in a MMC/SD
>> card slot due to the legal concern.
>> 
>> Add support in the core SD/MMC code to support this.
>
> CC more addresses.
>
> Yes, this capability seems odd, but linux computer vendors need this to
> avoid legal problems. Please review, thanks.

This has already been NACKed by Nicolas:

https://patchwork.kernel.org/patch/1359121/

(At least, I think it has -- your forward doesn't include the patch
itself.)

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mmc: core: Add a capability for disabling mmc cards
  2013-05-14 11:19   ` Chris Ball
@ 2013-05-14 15:04     ` Doug Anderson
  2013-05-14 16:50     ` Nicolas Pitre
  1 sibling, 0 replies; 6+ messages in thread
From: Doug Anderson @ 2013-05-14 15:04 UTC (permalink / raw)
  To: Chris Ball
  Cc: linux-kernel, nico, Alim Akhtar, Ulf Hansson, Johan Rudholm,
	Jaehoon Chung, Konstantin Dorfman, linux-mmc

Chris / Adam,

On Tue, May 14, 2013 at 4:19 AM, Chris Ball <cjb@laptop.org> wrote:
> This has already been NACKed by Nicolas:
>
> https://patchwork.kernel.org/patch/1359121/
>
> (At least, I think it has -- your forward doesn't include the patch
> itself.)

Yup, it got NAKed.  Unless something has changed I think that
interested parties will need to carry this as a local patch.

-Doug

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mmc: core: Add a capability for disabling mmc cards
  2013-05-14 11:19   ` Chris Ball
  2013-05-14 15:04     ` Doug Anderson
@ 2013-05-14 16:50     ` Nicolas Pitre
  1 sibling, 0 replies; 6+ messages in thread
From: Nicolas Pitre @ 2013-05-14 16:50 UTC (permalink / raw)
  To: Chris Ball
  Cc: linux-kernel, Doug Anderson, Alim Akhtar, Ulf Hansson,
	Johan Rudholm, Jaehoon Chung, Konstantin Dorfman, linux-mmc

On Tue, 14 May 2013, Chris Ball wrote:

> Hi,
> 
> On Tue, May 14 2013, Adam Lee wrote:
> > On Tue, May 14, 2013 at 03:38:17PM +0800, Adam Lee wrote:
> >> On some systems we need a way to disable MMC card support in a MMC/SD
> >> card slot due to the legal concern.
> >> 
> >> Add support in the core SD/MMC code to support this.
> >
> > CC more addresses.
> >
> > Yes, this capability seems odd, but linux computer vendors need this to
> > avoid legal problems. Please review, thanks.
> 
> This has already been NACKed by Nicolas:
> 
> https://patchwork.kernel.org/patch/1359121/
> 
> (At least, I think it has -- your forward doesn't include the patch
> itself.)

I certainly did.  Technical amputations driven by legal stupidities 
don't belong in the mainline kernel.


Nicolas

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-05-14 16:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-14  7:38 [PATCH] mmc: core: Add a capability for disabling mmc cards Adam Lee
2013-05-14  7:53 ` Adam Lee
2013-05-14 11:19   ` Chris Ball
2013-05-14 15:04     ` Doug Anderson
2013-05-14 16:50     ` Nicolas Pitre
2013-05-14  8:56 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®