mbox series

[0/3] Remove CONFIG_MMC_BROKEN_CD

Message ID 20200220044534.19600-1-jh80.chung@samsung.com
Headers show
Series Remove CONFIG_MMC_BROKEN_CD | expand

Message

Jaehoon Chung Feb. 20, 2020, 4:45 a.m. UTC
CONFIG_MMC_BROKEN_CD needs not to define to Kconfig.
broken-cd is already provide to dt-property.
If want to poll card-detect, set to broken-cd instead of enabling CONFIG_MMC_BROKEN_CD.

When checked the boards that is eabled CONFIG_MMC_BROKEN_CD,
it also used the value of dt as broken-cd.

Jaehoon Chung (3):
  mmc: jz_mmc; add MMC_CAP_NEEDS_POLL by default
  mmc: check the flags of host_caps about broken-cd
  mmc: Kconfig: remove MMC_BROKEN_CD configuration

 configs/brppt2_defconfig    |  1 -
 configs/ci20_mmc_defconfig  |  1 -
 configs/meerkat96_defconfig |  1 -
 drivers/mmc/Kconfig         |  5 -----
 drivers/mmc/jz_mmc.c        |  6 ++++--
 drivers/mmc/mmc.c           | 10 +++++-----
 6 files changed, 9 insertions(+), 15 deletions(-)

Comments

Tom Rini Feb. 20, 2020, 7:57 p.m. UTC | #1
On Thu, Feb 20, 2020 at 01:45:31PM +0900, Jaehoon Chung wrote:

> CONFIG_MMC_BROKEN_CD needs not to define to Kconfig.
> broken-cd is already provide to dt-property.
> If want to poll card-detect, set to broken-cd instead of enabling CONFIG_MMC_BROKEN_CD.
> 
> When checked the boards that is eabled CONFIG_MMC_BROKEN_CD,
> it also used the value of dt as broken-cd.
> 
> Jaehoon Chung (3):
>   mmc: jz_mmc; add MMC_CAP_NEEDS_POLL by default
>   mmc: check the flags of host_caps about broken-cd
>   mmc: Kconfig: remove MMC_BROKEN_CD configuration
> 
>  configs/brppt2_defconfig    |  1 -
>  configs/ci20_mmc_defconfig  |  1 -
>  configs/meerkat96_defconfig |  1 -
>  drivers/mmc/Kconfig         |  5 -----
>  drivers/mmc/jz_mmc.c        |  6 ++++--
>  drivers/mmc/mmc.c           | 10 +++++-----
>  6 files changed, 9 insertions(+), 15 deletions(-)

Did you size-test this change?  ci20 is extremely tight on space.
Jaehoon Chung Feb. 21, 2020, 1:07 a.m. UTC | #2
Hi Tom,

On 2/21/20 4:57 AM, Tom Rini wrote:
> On Thu, Feb 20, 2020 at 01:45:31PM +0900, Jaehoon Chung wrote:
> 
>> CONFIG_MMC_BROKEN_CD needs not to define to Kconfig.
>> broken-cd is already provide to dt-property.
>> If want to poll card-detect, set to broken-cd instead of enabling CONFIG_MMC_BROKEN_CD.
>>
>> When checked the boards that is eabled CONFIG_MMC_BROKEN_CD,
>> it also used the value of dt as broken-cd.
>>
>> Jaehoon Chung (3):
>>   mmc: jz_mmc; add MMC_CAP_NEEDS_POLL by default
>>   mmc: check the flags of host_caps about broken-cd
>>   mmc: Kconfig: remove MMC_BROKEN_CD configuration
>>
>>  configs/brppt2_defconfig    |  1 -
>>  configs/ci20_mmc_defconfig  |  1 -
>>  configs/meerkat96_defconfig |  1 -
>>  drivers/mmc/Kconfig         |  5 -----
>>  drivers/mmc/jz_mmc.c        |  6 ++++--
>>  drivers/mmc/mmc.c           | 10 +++++-----
>>  6 files changed, 9 insertions(+), 15 deletions(-)
> 
> Did you size-test this change?  ci20 is extremely tight on space.

I didn't check size-test about this. Is there any check-tool?
If there is check-tool, let me know, plz. Then i will check it. (In future, I will check before sending patch.)
I just checked this patch with CI.

Best Regards,
Jaehoon Chung

>
Jaehoon Chung Feb. 21, 2020, 7:21 a.m. UTC | #3
On 2/21/20 10:07 AM, Jaehoon Chung wrote:
> Hi Tom,
> 
> On 2/21/20 4:57 AM, Tom Rini wrote:
>> On Thu, Feb 20, 2020 at 01:45:31PM +0900, Jaehoon Chung wrote:
>>
>>> CONFIG_MMC_BROKEN_CD needs not to define to Kconfig.
>>> broken-cd is already provide to dt-property.
>>> If want to poll card-detect, set to broken-cd instead of enabling CONFIG_MMC_BROKEN_CD.
>>>
>>> When checked the boards that is eabled CONFIG_MMC_BROKEN_CD,
>>> it also used the value of dt as broken-cd.
>>>
>>> Jaehoon Chung (3):
>>>   mmc: jz_mmc; add MMC_CAP_NEEDS_POLL by default
>>>   mmc: check the flags of host_caps about broken-cd
>>>   mmc: Kconfig: remove MMC_BROKEN_CD configuration
>>>
>>>  configs/brppt2_defconfig    |  1 -
>>>  configs/ci20_mmc_defconfig  |  1 -
>>>  configs/meerkat96_defconfig |  1 -
>>>  drivers/mmc/Kconfig         |  5 -----
>>>  drivers/mmc/jz_mmc.c        |  6 ++++--
>>>  drivers/mmc/mmc.c           | 10 +++++-----
>>>  6 files changed, 9 insertions(+), 15 deletions(-)
>>
>> Did you size-test this change?  ci20 is extremely tight on space.
> 
> I didn't check size-test about this. Is there any check-tool?
> If there is check-tool, let me know, plz. Then i will check it. (In future, I will check before sending patch.)
> I just checked this patch with CI.

u-boot.img  : 327573 -> 327625
u-boot-spl.bin : 10336 -> 10464

What is ci20's limitation size?

Best Regards,
Jaehoon Chung

> 
> Best Regards,
> Jaehoon Chung
> 
>>
> 
> 
>
Tom Rini Feb. 21, 2020, 1:38 p.m. UTC | #4
On Fri, Feb 21, 2020 at 10:07:47AM +0900, Jaehoon Chung wrote:
> Hi Tom,
> 
> On 2/21/20 4:57 AM, Tom Rini wrote:
> > On Thu, Feb 20, 2020 at 01:45:31PM +0900, Jaehoon Chung wrote:
> > 
> >> CONFIG_MMC_BROKEN_CD needs not to define to Kconfig.
> >> broken-cd is already provide to dt-property.
> >> If want to poll card-detect, set to broken-cd instead of enabling CONFIG_MMC_BROKEN_CD.
> >>
> >> When checked the boards that is eabled CONFIG_MMC_BROKEN_CD,
> >> it also used the value of dt as broken-cd.
> >>
> >> Jaehoon Chung (3):
> >>   mmc: jz_mmc; add MMC_CAP_NEEDS_POLL by default
> >>   mmc: check the flags of host_caps about broken-cd
> >>   mmc: Kconfig: remove MMC_BROKEN_CD configuration
> >>
> >>  configs/brppt2_defconfig    |  1 -
> >>  configs/ci20_mmc_defconfig  |  1 -
> >>  configs/meerkat96_defconfig |  1 -
> >>  drivers/mmc/Kconfig         |  5 -----
> >>  drivers/mmc/jz_mmc.c        |  6 ++++--
> >>  drivers/mmc/mmc.c           | 10 +++++-----
> >>  6 files changed, 9 insertions(+), 15 deletions(-)
> > 
> > Did you size-test this change?  ci20 is extremely tight on space.
> 
> I didn't check size-test about this. Is there any check-tool?

Yes, buildman has a few different size related options.  I use a wrapper
like this:

#!/bin/bash

# Initial and constant buildman args
ARGS="-devl"
ALL=0
KEEP=0

# Find our arguments
while test $# -ne 0; do
	if [ "$1" == "--all" ]; then
		ALL=1
		shift 1
	elif [ "$1" == "--branch" ]; then
		BRANCH=$2
		shift 2
	elif [ "$1" == "--keep" ]; then
		KEEP=1
		ARGS="$ARGS -k"
		shift 1
	else
		MACHINE=$1
		shift
	fi
done

if [ -z $MACHINE ]; then
	echo Usage: $0 MACHINE [--all] [--keep] [--branch BRANCH]
	exit 1
fi

# If not all, then only first/last
if [ $ALL -ne 1 ]; then
	ARGS="$ARGS --step 0"
fi

if [ ! -z $BRANCH ]; then
	ARGS="$ARGS -b $BRANCH"
else
	ARGS="$ARGS -b `git rev-parse --abbrev-ref HEAD`"
fi

mkdir -p /tmp/$MACHINE

export SOURCE_DATE_EPOCH=`date +%s`
./tools/buildman/buildman -o /tmp/$MACHINE $ARGS -SBC $MACHINE
./tools/buildman/buildman -o /tmp/$MACHINE $ARGS -SsB $MACHINE

[ $KEEP -eq 0 ] && rm -rf /tmp/$MACHINE

This will either build the first/last commit in a series (do things
change at all?) or every commit (What commit introduced the growth I
want to know more about).  I can also tell it to keep the resulting
output directory if I want to dig around the map files more by hand.
Tom Rini Feb. 21, 2020, 5:05 p.m. UTC | #5
On Fri, Feb 21, 2020 at 04:21:52PM +0900, Jaehoon Chung wrote:
> On 2/21/20 10:07 AM, Jaehoon Chung wrote:
> > Hi Tom,
> > 
> > On 2/21/20 4:57 AM, Tom Rini wrote:
> >> On Thu, Feb 20, 2020 at 01:45:31PM +0900, Jaehoon Chung wrote:
> >>
> >>> CONFIG_MMC_BROKEN_CD needs not to define to Kconfig.
> >>> broken-cd is already provide to dt-property.
> >>> If want to poll card-detect, set to broken-cd instead of enabling CONFIG_MMC_BROKEN_CD.
> >>>
> >>> When checked the boards that is eabled CONFIG_MMC_BROKEN_CD,
> >>> it also used the value of dt as broken-cd.
> >>>
> >>> Jaehoon Chung (3):
> >>>   mmc: jz_mmc; add MMC_CAP_NEEDS_POLL by default
> >>>   mmc: check the flags of host_caps about broken-cd
> >>>   mmc: Kconfig: remove MMC_BROKEN_CD configuration
> >>>
> >>>  configs/brppt2_defconfig    |  1 -
> >>>  configs/ci20_mmc_defconfig  |  1 -
> >>>  configs/meerkat96_defconfig |  1 -
> >>>  drivers/mmc/Kconfig         |  5 -----
> >>>  drivers/mmc/jz_mmc.c        |  6 ++++--
> >>>  drivers/mmc/mmc.c           | 10 +++++-----
> >>>  6 files changed, 9 insertions(+), 15 deletions(-)
> >>
> >> Did you size-test this change?  ci20 is extremely tight on space.
> > 
> > I didn't check size-test about this. Is there any check-tool?
> > If there is check-tool, let me know, plz. Then i will check it. (In future, I will check before sending patch.)
> > I just checked this patch with CI.
> 
> u-boot.img  : 327573 -> 327625
> u-boot-spl.bin : 10336 -> 10464
> 
> What is ci20's limitation size?


The ci20 limit is  ((14 * 1024) - 0xa00) for SPL.  So we grow by 100
bytes.  And with that small of an SPL we're not using DT, so, is the
driver still acting correctly?  Can we restructure the change such that
growth is absolutely minimal?  Thanks!
Jaehoon Chung Feb. 24, 2020, 2:38 a.m. UTC | #6
On 2/21/20 10:38 PM, Tom Rini wrote:
> On Fri, Feb 21, 2020 at 10:07:47AM +0900, Jaehoon Chung wrote:
>> Hi Tom,
>>
>> On 2/21/20 4:57 AM, Tom Rini wrote:
>>> On Thu, Feb 20, 2020 at 01:45:31PM +0900, Jaehoon Chung wrote:
>>>
>>>> CONFIG_MMC_BROKEN_CD needs not to define to Kconfig.
>>>> broken-cd is already provide to dt-property.
>>>> If want to poll card-detect, set to broken-cd instead of enabling CONFIG_MMC_BROKEN_CD.
>>>>
>>>> When checked the boards that is eabled CONFIG_MMC_BROKEN_CD,
>>>> it also used the value of dt as broken-cd.
>>>>
>>>> Jaehoon Chung (3):
>>>>   mmc: jz_mmc; add MMC_CAP_NEEDS_POLL by default
>>>>   mmc: check the flags of host_caps about broken-cd
>>>>   mmc: Kconfig: remove MMC_BROKEN_CD configuration
>>>>
>>>>  configs/brppt2_defconfig    |  1 -
>>>>  configs/ci20_mmc_defconfig  |  1 -
>>>>  configs/meerkat96_defconfig |  1 -
>>>>  drivers/mmc/Kconfig         |  5 -----
>>>>  drivers/mmc/jz_mmc.c        |  6 ++++--
>>>>  drivers/mmc/mmc.c           | 10 +++++-----
>>>>  6 files changed, 9 insertions(+), 15 deletions(-)
>>>
>>> Did you size-test this change?  ci20 is extremely tight on space.
>>
>> I didn't check size-test about this. Is there any check-tool?
> 
> Yes, buildman has a few different size related options.  I use a wrapper
> like this:
> 
> #!/bin/bash
> 
> # Initial and constant buildman args
> ARGS="-devl"
> ALL=0
> KEEP=0
> 
> # Find our arguments
> while test $# -ne 0; do
> 	if [ "$1" == "--all" ]; then
> 		ALL=1
> 		shift 1
> 	elif [ "$1" == "--branch" ]; then
> 		BRANCH=$2
> 		shift 2
> 	elif [ "$1" == "--keep" ]; then
> 		KEEP=1
> 		ARGS="$ARGS -k"
> 		shift 1
> 	else
> 		MACHINE=$1
> 		shift
> 	fi
> done
> 
> if [ -z $MACHINE ]; then
> 	echo Usage: $0 MACHINE [--all] [--keep] [--branch BRANCH]
> 	exit 1
> fi
> 
> # If not all, then only first/last
> if [ $ALL -ne 1 ]; then
> 	ARGS="$ARGS --step 0"
> fi
> 
> if [ ! -z $BRANCH ]; then
> 	ARGS="$ARGS -b $BRANCH"
> else
> 	ARGS="$ARGS -b `git rev-parse --abbrev-ref HEAD`"
> fi
> 
> mkdir -p /tmp/$MACHINE
> 
> export SOURCE_DATE_EPOCH=`date +%s`
> ./tools/buildman/buildman -o /tmp/$MACHINE $ARGS -SBC $MACHINE
> ./tools/buildman/buildman -o /tmp/$MACHINE $ARGS -SsB $MACHINE
> 
> [ $KEEP -eq 0 ] && rm -rf /tmp/$MACHINE
> 
> This will either build the first/last commit in a series (do things
> change at all?) or every commit (What commit introduced the growth I
> want to know more about).  I can also tell it to keep the resulting
> output directory if I want to dig around the map files more by hand.

Thanks for sharing! I also checked patch with buildman. This information is helpful to me.

Best Regards,
Jaehoon Chung

>
Jaehoon Chung Feb. 24, 2020, 2:41 a.m. UTC | #7
On 2/22/20 2:05 AM, Tom Rini wrote:
> On Fri, Feb 21, 2020 at 04:21:52PM +0900, Jaehoon Chung wrote:
>> On 2/21/20 10:07 AM, Jaehoon Chung wrote:
>>> Hi Tom,
>>>
>>> On 2/21/20 4:57 AM, Tom Rini wrote:
>>>> On Thu, Feb 20, 2020 at 01:45:31PM +0900, Jaehoon Chung wrote:
>>>>
>>>>> CONFIG_MMC_BROKEN_CD needs not to define to Kconfig.
>>>>> broken-cd is already provide to dt-property.
>>>>> If want to poll card-detect, set to broken-cd instead of enabling CONFIG_MMC_BROKEN_CD.
>>>>>
>>>>> When checked the boards that is eabled CONFIG_MMC_BROKEN_CD,
>>>>> it also used the value of dt as broken-cd.
>>>>>
>>>>> Jaehoon Chung (3):
>>>>>   mmc: jz_mmc; add MMC_CAP_NEEDS_POLL by default
>>>>>   mmc: check the flags of host_caps about broken-cd
>>>>>   mmc: Kconfig: remove MMC_BROKEN_CD configuration
>>>>>
>>>>>  configs/brppt2_defconfig    |  1 -
>>>>>  configs/ci20_mmc_defconfig  |  1 -
>>>>>  configs/meerkat96_defconfig |  1 -
>>>>>  drivers/mmc/Kconfig         |  5 -----
>>>>>  drivers/mmc/jz_mmc.c        |  6 ++++--
>>>>>  drivers/mmc/mmc.c           | 10 +++++-----
>>>>>  6 files changed, 9 insertions(+), 15 deletions(-)
>>>>
>>>> Did you size-test this change?  ci20 is extremely tight on space.
>>>
>>> I didn't check size-test about this. Is there any check-tool?
>>> If there is check-tool, let me know, plz. Then i will check it. (In future, I will check before sending patch.)
>>> I just checked this patch with CI.
>>
>> u-boot.img  : 327573 -> 327625
>> u-boot-spl.bin : 10336 -> 10464
>>
>> What is ci20's limitation size?
> 
> 
> The ci20 limit is  ((14 * 1024) - 0xa00) for SPL.  So we grow by 100
> bytes.  And with that small of an SPL we're not using DT, so, is the
> driver still acting correctly?  Can we restructure the change such that
> growth is absolutely minimal?  Thanks!

I will re-check this side.  I didn't know that ci20 limit is too smaller.
As you mentioned, ci20 SPL  doesn't use dt. So it needs to set to NEEDS_POLL capability.
After checking more, i will resend patches.
Thanks for reviewing. 

Best Regards,
Jaehoon Chung

>