2006-01-09 22:15:46

by Anderson Briglia

[permalink] [raw]
Subject: [patch 4/5] Add MMC password protection (lock/unlock) support V3






Attachments:
mmc_sysfs.diff (5.03 kB)

2006-01-10 06:46:55

by Pierre Ossman

[permalink] [raw]
Subject: Re: [patch 4/5] Add MMC password protection (lock/unlock) support V3

Anderson Briglia wrote:

>@@ -238,6 +295,11 @@ int mmc_register_card(struct mmc_card *c
> if (ret)
> device_del(&card->dev);
> }
>+#ifdef CONFIG_MMC_PASSWORDS
>+ ret = device_create_file(&card->dev, &mmc_dev_attr_lockable);
>+ if (ret)
>+ device_del(&card->dev);
>+#endif
> }
> return ret;
> }
>
>

It might be wise to also check the command classes here. I don't believe
SDIO supports locking.

Rgds
Pierre

2006-01-11 13:31:47

by Anderson Briglia

[permalink] [raw]
Subject: Re: [patch 4/5] Add MMC password protection (lock/unlock) support V3

Pierre Ossman wrote:
> Anderson Briglia wrote:
>
>
>>@@ -238,6 +295,11 @@ int mmc_register_card(struct mmc_card *c
>> if (ret)
>> device_del(&card->dev);
>> }
>>+#ifdef CONFIG_MMC_PASSWORDS
>>+ ret = device_create_file(&card->dev, &mmc_dev_attr_lockable);
>>+ if (ret)
>>+ device_del(&card->dev);
>>+#endif
>> }
>> return ret;
>>}
>>
>>
>
>
> It might be wise to also check the command classes here. I don't believe
> SDIO supports locking.

In this case, the lockable attribute will show "unlockable", which is the expected
behavior. The lockable attribute will always be present, the card being lockable or not.

Regards,

Anderson Briglia
INdT - Manaus


2006-01-11 14:59:11

by Russell King

[permalink] [raw]
Subject: Re: [patch 4/5] Add MMC password protection (lock/unlock) support V3

On Wed, Jan 11, 2006 at 09:32:17AM -0400, Anderson Briglia wrote:
> Pierre Ossman wrote:
> > Anderson Briglia wrote:
> >
> >
> >>@@ -238,6 +295,11 @@ int mmc_register_card(struct mmc_card *c
> >> if (ret)
> >> device_del(&card->dev);
> >> }
> >>+#ifdef CONFIG_MMC_PASSWORDS
> >>+ ret = device_create_file(&card->dev, &mmc_dev_attr_lockable);
> >>+ if (ret)
> >>+ device_del(&card->dev);
> >>+#endif
> >> }
> >> return ret;
> >>}
> >>
> >>
> >
> >
> > It might be wise to also check the command classes here. I don't believe
> > SDIO supports locking.
>
> In this case, the lockable attribute will show "unlockable", which is
> the expected behavior. The lockable attribute will always be present,
> the card being lockable or not.

"unlockable" seems to be confusing.

"Unlockable" may mean something which is locked but can be unlocked
(unlock-able). Or it may mean something which can't be locked
(un-lockable).

Maybe returning "unsupported", "locked", "unlocked" etc would be
clearer?

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core