Re: [PATCH v4 3/4] mmc: core: Break out start_signal_voltage_switch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Kevin and Ulf,

2013/1/8 Ulf Hansson <ulf.hansson@xxxxxxxxxx>:
> On 8 January 2013 01:56, Kevin Liu <keyuan.liu@xxxxxxxxx> wrote:
>> 2013/1/8 Ulf Hansson <ulf.hansson@xxxxxxxxxx>:
>>> On 7 January 2013 16:10, Johan Rudholm <johan.rudholm@xxxxxxxxxxxxxx> wrote:
>>>> Allow callers to access the start_signal_voltage_switch host_ops
>>>> member without going through any cmd11 logic. This is mostly a
>>>> preparation for the following signal voltage switch patch.
>>>>
>>>> Signed-off-by: Johan Rudholm <johan.rudholm@xxxxxxxxxxxxxx>
>>>> ---
>>>>  drivers/mmc/core/core.c |   31 +++++++++++++++++++------------
>>>>  drivers/mmc/core/core.h |    4 ++--
>>>>  drivers/mmc/core/mmc.c  |    8 ++++----
>>>>  drivers/mmc/core/sd.c   |    2 +-
>>>>  drivers/mmc/core/sdio.c |    3 +--
>>>>  5 files changed, 27 insertions(+), 21 deletions(-)
>>>>
>>>> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
>>>> index 285f064..90f8e11 100644
>>>> --- a/drivers/mmc/core/core.c
>>>> +++ b/drivers/mmc/core/core.c
>>>> @@ -1219,7 +1219,22 @@ u32 mmc_select_voltage(struct mmc_host *host, u32 ocr)
>>>>         return ocr;
>>>>  }
>>>>
>>>> -int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, bool cmd11)
>>>> +int __mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage)
>>>> +{
>>>> +       int err = 0;
>>>> +
>>>> +       host->ios.signal_voltage = signal_voltage;
>>>> +       if (host->ops->start_signal_voltage_switch) {
>>>> +               mmc_host_clk_hold(host);
>>>> +               err = host->ops->start_signal_voltage_switch(host, &host->ios);
>>>
>>> Would it not make sense to restore the host->ios.signal_voltage value
>>> if this goes wrong?
>>>
>>
>> Why need to transfer ios to the voltage switch function which only
>> need the voltage value.
>> Why not just transfer the voltage value to the voltage switch
>> function? If return ok then set host->ios.signal_voltage =
>> signal_voltage otherwise do nothing.
>> I did this in my previous patch.
>
> I like the idea!
>
> Although, if the "host->ops->start_signal_voltage_switch" function
> pointer is missing, we should fall back to set the new voltage value
> anyway I think.

How about we keep the definition of start_signal_voltage_switch for
now and maybe send it as a separate patch later? This change is not
really functionally related to this patch series.

I agree that reseting the value of ios.signal_voltage to the original
value on failure is good, as Kevin initially suggested. I'll take care
of this in the next version!

Kind regards, Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux