Devicetree
 help / color / mirror / Atom feed
From: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
To: Jaehoon Chung
	<jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Subject: Re: [PATCHv2 05/10] mmc: dw_mmc: call the dw_mci_prep_stop_abort() by default
Date: Thu, 17 Nov 2016 15:49:55 +0800	[thread overview]
Message-ID: <d4b0cab4-8db3-052b-13aa-ecd5765aef97@rock-chips.com> (raw)
In-Reply-To: <868dbb62-4b0d-3492-0b13-093ce63c5cde-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

在 2016/11/17 13:05, Jaehoon Chung 写道:
> On 11/16/2016 06:16 PM, Shawn Lin wrote:
>> 在 2016/11/15 18:12, Jaehoon Chung 写道:
>>> stop_cmdr should be set to values relevant to stop command.
>>> It migth be assigned to values whatever there is mrq->stop or not.
>>> Then it doesn't need to use dw_mci_prepare_command().
>>> It's enough to use the prep_stop_abort for preparing stop command.
>>>
>>
>> Have you considered to clean up the logic of preparing abort cmd
>> within dw_mci_prepare_command?
>
> I have considered this..but i didn't check fully for this logic.
> I think it's possible to clean and make more simpler than now.
>
> how about thinking more after applying these patch-set? :)

it's okay :)

>
> Best Regards,
> Jaehoon Chung
>
>>
>>
>>         if (cmd->opcode == MMC_STOP_TRANSMISSION ||
>>             cmd->opcode == MMC_GO_IDLE_STATE ||
>>             cmd->opcode == MMC_GO_INACTIVE_STATE ||
>>             (cmd->opcode == SD_IO_RW_DIRECT &&
>>              ((cmd->arg >> 9) & 0x1FFFF) == SDIO_CCCR_ABORT))
>>                 cmdr |= SDMMC_CMD_STOP;
>>
>>
>>> Signed-off-by: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
>>> Tested-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
>>> ---
>>>  drivers/mmc/host/dw_mmc.c | 15 +++++----------
>>>  1 file changed, 5 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>>> index 3cda68c..12e1107 100644
>>> --- a/drivers/mmc/host/dw_mmc.c
>>> +++ b/drivers/mmc/host/dw_mmc.c
>>> @@ -385,7 +385,7 @@ static void dw_mci_start_command(struct dw_mci *host,
>>>
>>>  static inline void send_stop_abort(struct dw_mci *host, struct mmc_data *data)
>>>  {
>>> -    struct mmc_command *stop = data->stop ? data->stop : &host->stop_abort;
>>> +    struct mmc_command *stop = &host->stop_abort;
>>>
>>>      dw_mci_start_command(host, stop, host->stop_cmdr);
>>>  }
>>> @@ -1277,10 +1277,7 @@ static void __dw_mci_start_request(struct dw_mci *host,
>>>          spin_unlock_irqrestore(&host->irq_lock, irqflags);
>>>      }
>>>
>>> -    if (mrq->stop)
>>> -        host->stop_cmdr = dw_mci_prepare_command(slot->mmc, mrq->stop);
>>> -    else
>>> -        host->stop_cmdr = dw_mci_prep_stop_abort(host, cmd);
>>> +    host->stop_cmdr = dw_mci_prep_stop_abort(host, cmd);
>>>  }
>>>
>>>  static void dw_mci_start_request(struct dw_mci *host,
>>> @@ -1890,8 +1887,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
>>>              if (test_and_clear_bit(EVENT_DATA_ERROR,
>>>                             &host->pending_events)) {
>>>                  dw_mci_stop_dma(host);
>>> -                if (data->stop ||
>>> -                    !(host->data_status & (SDMMC_INT_DRTO |
>>> +                if (!(host->data_status & (SDMMC_INT_DRTO |
>>>                                 SDMMC_INT_EBE)))
>>>                      send_stop_abort(host, data);
>>>                  state = STATE_DATA_ERROR;
>>> @@ -1927,8 +1923,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
>>>              if (test_and_clear_bit(EVENT_DATA_ERROR,
>>>                             &host->pending_events)) {
>>>                  dw_mci_stop_dma(host);
>>> -                if (data->stop ||
>>> -                    !(host->data_status & (SDMMC_INT_DRTO |
>>> +                if (!(host->data_status & (SDMMC_INT_DRTO |
>>>                                 SDMMC_INT_EBE)))
>>>                      send_stop_abort(host, data);
>>>                  state = STATE_DATA_ERROR;
>>> @@ -2004,7 +1999,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
>>>              host->cmd = NULL;
>>>              host->data = NULL;
>>>
>>> -            if (mrq->stop)
>>> +            if (!mrq->sbc && mrq->stop)
>>>                  dw_mci_command_complete(host, mrq->stop);
>>>              else
>>>                  host->cmd_status = 0;
>>>
>>
>>
>
>
>
>


-- 
Best Regards
Shawn Lin

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-11-17  7:49 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-15 10:12 [PATCHv2 00/10] mmc: dw_mmc: clean the codes for dwmmc controller Jaehoon Chung
2016-11-15 10:12 ` [PATCHv2 02/10] mmc: dw_mmc: fix the debug message for checking card's present Jaehoon Chung
     [not found]   ` <20161115101232.3854-3-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  9:01     ` Shawn Lin
2016-11-15 10:12 ` [PATCHv2 03/10] mmc: dw_mmc: change the DW_MCI_FREQ_MIN from 400K to 100K Jaehoon Chung
     [not found]   ` <20161115101232.3854-4-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  9:06     ` Shawn Lin
2016-11-15 10:12 ` [PATCHv2 04/10] mmc: dw_mmc: use the hold register when send stop command Jaehoon Chung
     [not found]   ` <20161115101232.3854-5-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  9:09     ` Shawn Lin
2016-11-15 10:12 ` [PATCHv2 05/10] mmc: dw_mmc: call the dw_mci_prep_stop_abort() by default Jaehoon Chung
     [not found]   ` <20161115101232.3854-6-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  9:16     ` Shawn Lin
     [not found]       ` <6d7625c0-8588-5d11-7475-38fa611d8614-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-11-17  5:05         ` Jaehoon Chung
     [not found]           ` <868dbb62-4b0d-3492-0b13-093ce63c5cde-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-17  7:49             ` Shawn Lin [this message]
2016-11-15 10:12 ` [PATCHv2 07/10] mmc: dw_mmc: use the cookie's enum values for post/pre_req() Jaehoon Chung
     [not found] ` <20161115101232.3854-1-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-15 10:12   ` [PATCHv2 01/10] mmc: dw_mmc: display the real register value on debugfs Jaehoon Chung
     [not found]     ` <20161115101232.3854-2-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  9:04       ` Shawn Lin
2016-11-15 10:12   ` [PATCHv2 06/10] mmc: core: move the cookie's enum values from sdhci.h to mmc.h Jaehoon Chung
     [not found]     ` <20161115101232.3854-7-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  7:53       ` Jaehoon Chung
     [not found]         ` <12405f58-695d-03d8-407f-d7471e93a6de-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  8:09           ` Adrian Hunter
2016-11-16  8:25             ` Jaehoon Chung
     [not found]               ` <89535076-4a77-64a5-68d9-ce15e03b8fb3-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  8:28                 ` Adrian Hunter
     [not found]                   ` <d5321daf-b449-e556-ccf1-cd82d497ea85-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-11-16  8:58                     ` Jaehoon Chung
2016-11-16  9:04                       ` Adrian Hunter
     [not found]                         ` <3e05ec88-af1d-9996-bbdb-c453f7e4bb07-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-11-16  9:23                           ` Jaehoon Chung
2016-11-15 10:12   ` [PATCHv2 08/10] mmc: dw_mmc: remove the unnecessary mmc_data structure Jaehoon Chung
     [not found]     ` <20161115101232.3854-9-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  9:18       ` Shawn Lin
2016-11-15 10:12   ` [PATCHv2 09/10] mmc: dw_mmc: The "clock-freq-min-max" property was deprecated Jaehoon Chung
     [not found]     ` <20161115101232.3854-10-jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-11-16  9:19       ` Shawn Lin
2016-11-16 13:45     ` Rob Herring
2016-11-15 10:12   ` [PATCHv2 10/10] Documentation: synopsys-dw-mshc: remove the unused properties Jaehoon Chung
2016-11-16  9:21     ` Shawn Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4b0cab4-8db3-052b-13aa-ecd5765aef97@rock-chips.com \
    --to=shawn.lin-tnx95d0mmh7dzftrwevzcw@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
    --cc=jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox