diff mbox

[U-Boot] ARM: board: cm-fx6: fix mmc for old revisions of utilite

Message ID d0e15b3c121b416fb280605ee1bd1800@rwthex-s1-b.rwth-ad.de
State Accepted
Commit c133c503ac9e037ccbc1b7a37c07c4068b32d802
Delegated to: Stefano Babic
Headers show

Commit Message

Christopher Spinrath June 8, 2016, 7:02 p.m. UTC
Old revisions of Utilite (based on cmfx6) do not have a dedicated
card detect pin. But the card is removable by the user and card
detection can be realized with polling (e.g. supported by Linux).

Add the broken-cd property to the mmc device tree instead of the
non-removable property to make card detection possible if polling
is supported.

Fixes: 41855186afd3 ("arm: mx6: cm-fx6: modify device tree for old revisions of utilite")
Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
---
 board/compulab/cm_fx6/cm_fx6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nikita Kiryanov June 15, 2016, 3:15 p.m. UTC | #1
Hi CHristopher,

On Wed, Jun 08, 2016 at 09:02:36PM +0200, Christopher Spinrath wrote:
> Old revisions of Utilite (based on cmfx6) do not have a dedicated
> card detect pin. But the card is removable by the user and card
> detection can be realized with polling (e.g. supported by Linux).
> 
> Add the broken-cd property to the mmc device tree instead of the
> non-removable property to make card detection possible if polling
> is supported.

Acked-by: Nikita Kiryanov <nikita@compulab.co.il>
One nit-pick below:

> 
> Fixes: 41855186afd3 ("arm: mx6: cm-fx6: modify device tree for old revisions of utilite")

This isn't technically a fix; you're enabling new functionality. The
original behavior wasn't buggy, it just lacked the card detect feature.

> Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
> ---
>  board/compulab/cm_fx6/cm_fx6.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> -- 
> 2.8.3
>

Regards,
Nikita Kiryanov
Christopher Spinrath June 15, 2016, 3:38 p.m. UTC | #2
Hi Nikita,

On 06/15/2016 05:15 PM, Nikita Kiryanov wrote:
> Hi CHristopher,
> 
> On Wed, Jun 08, 2016 at 09:02:36PM +0200, Christopher Spinrath wrote:
>> Old revisions of Utilite (based on cmfx6) do not have a dedicated
>> card detect pin. But the card is removable by the user and card
>> detection can be realized with polling (e.g. supported by Linux).
>>
>> Add the broken-cd property to the mmc device tree instead of the
>> non-removable property to make card detection possible if polling
>> is supported.
> 
> Acked-by: Nikita Kiryanov <nikita@compulab.co.il>

How is this patch (and, in general, patches for Utilite/cm-fx6) supposed
to be merged? Due to get_maintainers your are (the only) maintainer
related to the cm-fx6 board. Do you want me to resend the patch (without
the Fixes: tag)?

> One nit-pick below:
> 
>>
>> Fixes: 41855186afd3 ("arm: mx6: cm-fx6: modify device tree for old revisions of utilite")
> 
> This isn't technically a fix; you're enabling new functionality. The
> original behavior wasn't buggy, it just lacked the card detect feature.
>
Well, the card is clearly removable. So IMHO adding the non-removable
property is wrong and this patch corrects/fixes it. But I'm fine either way.

Thanks,
Christopher


>> Signed-off-by: Christopher Spinrath <christopher.spinrath@rwth-aachen.de>
>> ---
>>  board/compulab/cm_fx6/cm_fx6.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> -- 
>> 2.8.3
>>
> 
> Regards,
> Nikita Kiryanov 
>
Igor Grinberg June 16, 2016, 9:05 a.m. UTC | #3
Hi Christopher,

On 06/15/2016 06:38 PM, Christopher Spinrath wrote:
> Hi Nikita,
> 
> On 06/15/2016 05:15 PM, Nikita Kiryanov wrote:
>> Hi CHristopher,
>>
>> On Wed, Jun 08, 2016 at 09:02:36PM +0200, Christopher Spinrath wrote:
>>> Old revisions of Utilite (based on cmfx6) do not have a dedicated
>>> card detect pin. But the card is removable by the user and card
>>> detection can be realized with polling (e.g. supported by Linux).
>>>
>>> Add the broken-cd property to the mmc device tree instead of the
>>> non-removable property to make card detection possible if polling
>>> is supported.
>>
>> Acked-by: Nikita Kiryanov <nikita@compulab.co.il>
> 
> How is this patch (and, in general, patches for Utilite/cm-fx6) supposed
> to be merged?

Well, you've done this almost correctly. You just need to add
Stefano Babic <sbabic@denx.de>
(who is the maintainer of imx) to "cc" or "to" list.
Added now.

> Due to get_maintainers your are (the only) maintainer
> related to the cm-fx6 board.

That is a separate discussion (e.g. how boards of a specific vendor, but
different architectures/platforms should be listed in the MAINTAINERS files).

> Do you want me to resend the patch (without
> the Fixes: tag)?
> 
>> One nit-pick below:
>>
>>>
>>> Fixes: 41855186afd3 ("arm: mx6: cm-fx6: modify device tree for old revisions of utilite")
>>
>> This isn't technically a fix; you're enabling new functionality. The
>> original behavior wasn't buggy, it just lacked the card detect feature.
>>
> Well, the card is clearly removable. So IMHO adding the non-removable
> property is wrong and this patch corrects/fixes it. But I'm fine either way.

Just a little explanation...
Mechanically the card _is_ removable, but for revisions < 1.3, it will
result in errors on the bus as no removal event will be sent to the
subsystem. Moreover, if I'm not mistaken, you have the PRO model, right?
In PRO model, you have internal storage (e.g. SSD) which makes the SD card
an additional and sensibly removable device...
There are additional Utilite models which have the SD card as the only
storage device and those models have the rootfs on the SD card.
In such case, IMO, it is much more appropriate to state that it should be
non-removable.
Nikita Kiryanov June 16, 2016, 10:40 a.m. UTC | #4
Hi Christopher,

On Wed, Jun 15, 2016 at 05:38:10PM +0200, Christopher Spinrath wrote:
> Hi Nikita,
> 
> On 06/15/2016 05:15 PM, Nikita Kiryanov wrote:
> > Hi CHristopher,
> > 
> > On Wed, Jun 08, 2016 at 09:02:36PM +0200, Christopher Spinrath wrote:
> >> Old revisions of Utilite (based on cmfx6) do not have a dedicated
> >> card detect pin. But the card is removable by the user and card
> >> detection can be realized with polling (e.g. supported by Linux).
> >>
> >> Add the broken-cd property to the mmc device tree instead of the
> >> non-removable property to make card detection possible if polling
> >> is supported.
> > 
> > Acked-by: Nikita Kiryanov <nikita@compulab.co.il>
> 
> How is this patch (and, in general, patches for Utilite/cm-fx6) supposed
> to be merged? Due to get_maintainers your are (the only) maintainer
> related to the cm-fx6 board. Do you want me to resend the patch (without
> the Fixes: tag)?
> 
> > One nit-pick below:
> > 
> >>
> >> Fixes: 41855186afd3 ("arm: mx6: cm-fx6: modify device tree for old revisions of utilite")
> > 
> > This isn't technically a fix; you're enabling new functionality. The
> > original behavior wasn't buggy, it just lacked the card detect feature.
> >
> Well, the card is clearly removable. So IMHO adding the non-removable
> property is wrong and this patch corrects/fixes it. But I'm fine either way.

I prefer it without the "Fixes" line, because to me it implies a bug fix
whereas the behavior in the linked patch was an intentional compromise.

Regards,
Nikita Kiryanov
Christopher Spinrath June 16, 2016, 11:21 a.m. UTC | #5
Hi Igor,

On 06/16/2016 11:05 AM, Igor Grinberg wrote:
> Hi Christopher,
> 
> On 06/15/2016 06:38 PM, Christopher Spinrath wrote:
>> Hi Nikita,
>>
>> On 06/15/2016 05:15 PM, Nikita Kiryanov wrote:
>>> Hi CHristopher,
>>>
>>> On Wed, Jun 08, 2016 at 09:02:36PM +0200, Christopher Spinrath wrote:
>>>> Old revisions of Utilite (based on cmfx6) do not have a dedicated
>>>> card detect pin. But the card is removable by the user and card
>>>> detection can be realized with polling (e.g. supported by Linux).
>>>>
>>>> Add the broken-cd property to the mmc device tree instead of the
>>>> non-removable property to make card detection possible if polling
>>>> is supported.
>>>
>>> Acked-by: Nikita Kiryanov <nikita@compulab.co.il>
>>
>> How is this patch (and, in general, patches for Utilite/cm-fx6) supposed
>> to be merged?
> 
> Well, you've done this almost correctly. You just need to add
> Stefano Babic <sbabic@denx.de>
> (who is the maintainer of imx) to "cc" or "to" list.
> Added now.
> 

Thanks!

>> Due to get_maintainers your are (the only) maintainer
>> related to the cm-fx6 board.
> 
> That is a separate discussion (e.g. how boards of a specific vendor, but
> different architectures/platforms should be listed in the MAINTAINERS files).
>

I expected the output of get_maintainers to be complete. But ok, now I
know it's not.

>> Do you want me to resend the patch (without
>> the Fixes: tag)?
>>
>>> One nit-pick below:
>>>
>>>>
>>>> Fixes: 41855186afd3 ("arm: mx6: cm-fx6: modify device tree for old revisions of utilite")
>>>
>>> This isn't technically a fix; you're enabling new functionality. The
>>> original behavior wasn't buggy, it just lacked the card detect feature.
>>>
>> Well, the card is clearly removable. So IMHO adding the non-removable
>> property is wrong and this patch corrects/fixes it. But I'm fine either way.
> 
> Just a little explanation...
> Mechanically the card _is_ removable, but for revisions < 1.3, it will
> result in errors on the bus as no removal event will be sent to the
> subsystem. Moreover, if I'm not mistaken, you have the PRO model, right?
> In PRO model, you have internal storage (e.g. SSD) which makes the SD card
> an additional and sensibly removable device...
> There are additional Utilite models which have the SD card as the only
> storage device and those models have the rootfs on the SD card.
> In such case, IMO, it is much more appropriate to state that it should be
> non-removable.
> 
With the broken-cd property the driver/subsystem knows that the card may
have been removed and checks that if an (false positive) error occurs.

Indeed, I have the Pro model but even for the other models there are use
cases where the card may be removed. For instance, you can use netboot
(think of thin clients) or boot from usb storage. So IMO the broken-cd
property is a better choice for all models.

Cheers,
Christopher
Christopher Spinrath June 16, 2016, 11:22 a.m. UTC | #6
Hi Nikita,

On 06/16/2016 12:40 PM, Nikita Kiryanov wrote:
> Hi Christopher,
> 
> On Wed, Jun 15, 2016 at 05:38:10PM +0200, Christopher Spinrath wrote:
>> Hi Nikita,
>>
>> On 06/15/2016 05:15 PM, Nikita Kiryanov wrote:
>>> Hi CHristopher,
>>>
>>> On Wed, Jun 08, 2016 at 09:02:36PM +0200, Christopher Spinrath wrote:
>>>> Old revisions of Utilite (based on cmfx6) do not have a dedicated
>>>> card detect pin. But the card is removable by the user and card
>>>> detection can be realized with polling (e.g. supported by Linux).
>>>>
>>>> Add the broken-cd property to the mmc device tree instead of the
>>>> non-removable property to make card detection possible if polling
>>>> is supported.
>>>
>>> Acked-by: Nikita Kiryanov <nikita@compulab.co.il>
>>
>> How is this patch (and, in general, patches for Utilite/cm-fx6) supposed
>> to be merged? Due to get_maintainers your are (the only) maintainer
>> related to the cm-fx6 board. Do you want me to resend the patch (without
>> the Fixes: tag)?
>>
>>> One nit-pick below:
>>>
>>>>
>>>> Fixes: 41855186afd3 ("arm: mx6: cm-fx6: modify device tree for old revisions of utilite")
>>>
>>> This isn't technically a fix; you're enabling new functionality. The
>>> original behavior wasn't buggy, it just lacked the card detect feature.
>>>
>> Well, the card is clearly removable. So IMHO adding the non-removable
>> property is wrong and this patch corrects/fixes it. But I'm fine either way.
> 
> I prefer it without the "Fixes" line, because to me it implies a bug fix
> whereas the behavior in the linked patch was an intentional compromise.
> 

Ok, I will send a v2 without the fixes tag and with your Acked-By.

Thanks,
Christopher

> Regards,
> Nikita Kiryanov 
>
Igor Grinberg June 16, 2016, 12:46 p.m. UTC | #7
On 06/16/2016 02:21 PM, Christopher Spinrath wrote:
> Hi Igor,
> 
> On 06/16/2016 11:05 AM, Igor Grinberg wrote:
>> Hi Christopher,
>>
>> On 06/15/2016 06:38 PM, Christopher Spinrath wrote:
>>> Hi Nikita,

[...]

>>>> One nit-pick below:
>>>>
>>>>>
>>>>> Fixes: 41855186afd3 ("arm: mx6: cm-fx6: modify device tree for old revisions of utilite")
>>>>
>>>> This isn't technically a fix; you're enabling new functionality. The
>>>> original behavior wasn't buggy, it just lacked the card detect feature.
>>>>
>>> Well, the card is clearly removable. So IMHO adding the non-removable
>>> property is wrong and this patch corrects/fixes it. But I'm fine either way.
>>
>> Just a little explanation...
>> Mechanically the card _is_ removable, but for revisions < 1.3, it will
>> result in errors on the bus as no removal event will be sent to the
>> subsystem. Moreover, if I'm not mistaken, you have the PRO model, right?
>> In PRO model, you have internal storage (e.g. SSD) which makes the SD card
>> an additional and sensibly removable device...
>> There are additional Utilite models which have the SD card as the only
>> storage device and those models have the rootfs on the SD card.
>> In such case, IMO, it is much more appropriate to state that it should be
>> non-removable.
>>
> With the broken-cd property the driver/subsystem knows that the card may
> have been removed and checks that if an (false positive) error occurs.
> 
> Indeed, I have the Pro model but even for the other models there are use
> cases where the card may be removed. For instance, you can use netboot
> (think of thin clients) or boot from usb storage. So IMO the broken-cd
> property is a better choice for all models.

Yeah, no problem - I'm not saying we should keep the original, just
explaining the rationale behind what was done and why we do not see it
as a fix, but rather as an improvement to cover more use cases.

Thanks for the patch!
diff mbox

Patch

diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
index a21e7b0..712057a 100644
--- a/board/compulab/cm_fx6/cm_fx6.c
+++ b/board/compulab/cm_fx6/cm_fx6.c
@@ -610,7 +610,7 @@  int ft_board_setup(void *blob, bd_t *bd)
 		fdt_shrink_to_minimum(blob); /* Make room for new properties */
 		nodeoffset = fdt_path_offset(blob, USDHC3_PATH);
 		fdt_delprop(blob, nodeoffset, "cd-gpios");
-		fdt_find_and_setprop(blob, USDHC3_PATH, "non-removable",
+		fdt_find_and_setprop(blob, USDHC3_PATH, "broken-cd",
 				     NULL, 0, 1);
 		fdt_find_and_setprop(blob, USDHC3_PATH, "keep-power-in-suspend",
 				     NULL, 0, 1);