diff mbox

[02/18] mmc: meson-gx: remove code for unsupported CMD23

Message ID 642a46aa-416c-32a3-f9ef-3feafca72636@gmail.com (mailing list archive)
State Superseded
Headers show

Commit Message

Heiner Kallweit Feb. 14, 2017, 8:05 p.m. UTC
CMD23 isn't supported on meson-gx and therefore the "set block count"
command isn't used. So remove this dead code.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/mmc/host/meson-gx-mmc.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Kevin Hilman Feb. 15, 2017, 4:54 p.m. UTC | #1
Heiner Kallweit <hkallweit1@gmail.com> writes:

> CMD23 isn't supported on meson-gx and therefore the "set block count"
> command isn't used. So remove this dead code.

I'm admittedly a bit unfamiliar with the MMC spec and wrote this driver
mostly by looking at the vendor driver, so forgive the silly
questions...

Why isn't CMD23 supported, and should we support instead of deleting
this support?

Kevin

> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/mmc/host/meson-gx-mmc.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
> index 1ad66f84..e89bdf5f 100644
> --- a/drivers/mmc/host/meson-gx-mmc.c
> +++ b/drivers/mmc/host/meson-gx-mmc.c
> @@ -555,11 +555,7 @@ static void meson_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
>  	writel(0, host->regs + SD_EMMC_START);
>  
>  	host->mrq = mrq;
> -
> -	if (mrq->sbc)
> -		meson_mmc_start_cmd(mmc, mrq->sbc);
> -	else
> -		meson_mmc_start_cmd(mmc, mrq->cmd);
> +	meson_mmc_start_cmd(mmc, mrq->cmd);
>  }
>  
>  static int meson_mmc_read_resp(struct mmc_host *mmc, struct mmc_command *cmd)
> @@ -690,7 +686,7 @@ static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id)
>  	}
>  
>  	meson_mmc_read_resp(host->mmc, cmd);
> -	if (!data || !data->stop || mrq->sbc)
> +	if (!data || !data->stop)
>  		meson_mmc_request_done(host->mmc, mrq);
>  	else
>  		meson_mmc_start_cmd(host->mmc, data->stop);
Heiner Kallweit Feb. 16, 2017, 7:03 a.m. UTC | #2
Am 15.02.2017 um 17:54 schrieb Kevin Hilman:
> Heiner Kallweit <hkallweit1@gmail.com> writes:
> 
>> CMD23 isn't supported on meson-gx and therefore the "set block count"
>> command isn't used. So remove this dead code.
> 
> I'm admittedly a bit unfamiliar with the MMC spec and wrote this driver
> mostly by looking at the vendor driver, so forgive the silly
> questions...
> 
> Why isn't CMD23 supported, and should we support instead of deleting
> this support?
> 
As far as I understand this needs to be supported by the host controller.
And setting the respective host flag to enable CMD23 mode lead to a
non-working driver when testing on my system.


> Kevin
> 
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>>  drivers/mmc/host/meson-gx-mmc.c | 8 ++------
>>  1 file changed, 2 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
>> index 1ad66f84..e89bdf5f 100644
>> --- a/drivers/mmc/host/meson-gx-mmc.c
>> +++ b/drivers/mmc/host/meson-gx-mmc.c
>> @@ -555,11 +555,7 @@ static void meson_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
>>  	writel(0, host->regs + SD_EMMC_START);
>>  
>>  	host->mrq = mrq;
>> -
>> -	if (mrq->sbc)
>> -		meson_mmc_start_cmd(mmc, mrq->sbc);
>> -	else
>> -		meson_mmc_start_cmd(mmc, mrq->cmd);
>> +	meson_mmc_start_cmd(mmc, mrq->cmd);
>>  }
>>  
>>  static int meson_mmc_read_resp(struct mmc_host *mmc, struct mmc_command *cmd)
>> @@ -690,7 +686,7 @@ static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id)
>>  	}
>>  
>>  	meson_mmc_read_resp(host->mmc, cmd);
>> -	if (!data || !data->stop || mrq->sbc)
>> +	if (!data || !data->stop)
>>  		meson_mmc_request_done(host->mmc, mrq);
>>  	else
>>  		meson_mmc_start_cmd(host->mmc, data->stop);
>
Ulf Hansson Feb. 16, 2017, 8:14 a.m. UTC | #3
On 16 February 2017 at 08:03, Heiner Kallweit <hkallweit1@gmail.com> wrote:
> Am 15.02.2017 um 17:54 schrieb Kevin Hilman:
>> Heiner Kallweit <hkallweit1@gmail.com> writes:
>>
>>> CMD23 isn't supported on meson-gx and therefore the "set block count"
>>> command isn't used. So remove this dead code.
>>
>> I'm admittedly a bit unfamiliar with the MMC spec and wrote this driver
>> mostly by looking at the vendor driver, so forgive the silly
>> questions...
>>
>> Why isn't CMD23 supported, and should we support instead of deleting
>> this support?
>>
> As far as I understand this needs to be supported by the host controller.
> And setting the respective host flag to enable CMD23 mode lead to a
> non-working driver when testing on my system.

CMD23 can be supported by the host *driver*, you don't need HW-support
to implement this.

You may for example be inspired by the mmci.c driver to understand how
to implement this. Looks for "mrq->sbc".

[...]

Kind regards
Uffe
Heiner Kallweit Feb. 16, 2017, 5:49 p.m. UTC | #4
Am 16.02.2017 um 09:14 schrieb Ulf Hansson:
> On 16 February 2017 at 08:03, Heiner Kallweit <hkallweit1@gmail.com> wrote:
>> Am 15.02.2017 um 17:54 schrieb Kevin Hilman:
>>> Heiner Kallweit <hkallweit1@gmail.com> writes:
>>>
>>>> CMD23 isn't supported on meson-gx and therefore the "set block count"
>>>> command isn't used. So remove this dead code.
>>>
>>> I'm admittedly a bit unfamiliar with the MMC spec and wrote this driver
>>> mostly by looking at the vendor driver, so forgive the silly
>>> questions...
>>>
>>> Why isn't CMD23 supported, and should we support instead of deleting
>>> this support?
>>>
>> As far as I understand this needs to be supported by the host controller.
>> And setting the respective host flag to enable CMD23 mode lead to a
>> non-working driver when testing on my system.
> 
> CMD23 can be supported by the host *driver*, you don't need HW-support
> to implement this.
> 
Thanks for the explanation. I think I got confused by this comment in
core/block.c: "If CMD23 is supported by card and host, [..]"
I interpreted this as "host controller needs to support this feature".

> You may for example be inspired by the mmci.c driver to understand how
> to implement this. Looks for "mrq->sbc".
> 
> [...]
> 
> Kind regards
> Uffe
>
Heiner Kallweit Feb. 19, 2017, 7:36 p.m. UTC | #5
Am 15.02.2017 um 17:54 schrieb Kevin Hilman:
> Heiner Kallweit <hkallweit1@gmail.com> writes:
> 
>> CMD23 isn't supported on meson-gx and therefore the "set block count"
>> command isn't used. So remove this dead code.
> 
> I'm admittedly a bit unfamiliar with the MMC spec and wrote this driver
> mostly by looking at the vendor driver, so forgive the silly
> questions...
> 
> Why isn't CMD23 supported, and should we support instead of deleting
> this support?
> 
After clarification by Ulf that CMD23 is not a host feature but a host
driver feature I added this feature to the driver.
I will submit it once the smaller refactorings are applied.

Heiner

> Kevin
> 
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>> ---
>>  drivers/mmc/host/meson-gx-mmc.c | 8 ++------
>>  1 file changed, 2 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
>> index 1ad66f84..e89bdf5f 100644
>> --- a/drivers/mmc/host/meson-gx-mmc.c
>> +++ b/drivers/mmc/host/meson-gx-mmc.c
>> @@ -555,11 +555,7 @@ static void meson_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
>>  	writel(0, host->regs + SD_EMMC_START);
>>  
>>  	host->mrq = mrq;
>> -
>> -	if (mrq->sbc)
>> -		meson_mmc_start_cmd(mmc, mrq->sbc);
>> -	else
>> -		meson_mmc_start_cmd(mmc, mrq->cmd);
>> +	meson_mmc_start_cmd(mmc, mrq->cmd);
>>  }
>>  
>>  static int meson_mmc_read_resp(struct mmc_host *mmc, struct mmc_command *cmd)
>> @@ -690,7 +686,7 @@ static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id)
>>  	}
>>  
>>  	meson_mmc_read_resp(host->mmc, cmd);
>> -	if (!data || !data->stop || mrq->sbc)
>> +	if (!data || !data->stop)
>>  		meson_mmc_request_done(host->mmc, mrq);
>>  	else
>>  		meson_mmc_start_cmd(host->mmc, data->stop);
>
diff mbox

Patch

diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index 1ad66f84..e89bdf5f 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -555,11 +555,7 @@  static void meson_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
 	writel(0, host->regs + SD_EMMC_START);
 
 	host->mrq = mrq;
-
-	if (mrq->sbc)
-		meson_mmc_start_cmd(mmc, mrq->sbc);
-	else
-		meson_mmc_start_cmd(mmc, mrq->cmd);
+	meson_mmc_start_cmd(mmc, mrq->cmd);
 }
 
 static int meson_mmc_read_resp(struct mmc_host *mmc, struct mmc_command *cmd)
@@ -690,7 +686,7 @@  static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id)
 	}
 
 	meson_mmc_read_resp(host->mmc, cmd);
-	if (!data || !data->stop || mrq->sbc)
+	if (!data || !data->stop)
 		meson_mmc_request_done(host->mmc, mrq);
 	else
 		meson_mmc_start_cmd(host->mmc, data->stop);