diff mbox

[RFC,5/5] mmc: mmci: move ST specific sdio setup under a condition

Message ID 1407845127-8448-1-git-send-email-srinivas.kandadgatla@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Srinivas Kandagatla Aug. 12, 2014, 12:05 p.m. UTC
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

This patch moves ST specific sdio setup under a vendor id condition,
this will ensure that the ST specfic setup is not done on other vendor
like Qualcomm.

Originally the issue was detected while testing WLAN ath6kl on IFC6410
board with APQ8064 SOC.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/mmc/host/mmci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Linus Walleij Aug. 13, 2014, 8:58 a.m. UTC | #1
On Tue, Aug 12, 2014 at 2:05 PM, Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:

> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>
> This patch moves ST specific sdio setup under a vendor id condition,
> this will ensure that the ST specfic setup is not done on other vendor
> like Qualcomm.
>
> Originally the issue was detected while testing WLAN ath6kl on IFC6410
> board with APQ8064 SOC.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

So instead of again checking hw_designer (I think that's a bit
messy) and instead of having the flag bool sdio from patch
1, why not introduce 2 flags in vendor_data:

bool st_sdio;
bool qcom_sdio;

> +++ b/drivers/mmc/host/mmci.c
> @@ -828,7 +828,8 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
>                          * otherwise the transfer will not start. The threshold
>                          * depends on the rate of MCLK.
>                          */
> -                       if (data->flags & MMC_DATA_WRITE &&
> +                       if (host->hw_designer == AMBA_VENDOR_ST &&
> +                           data->flags & MMC_DATA_WRITE &&

And this becomes just

if (variant->st_sdio)...

>                             (host->size < 8 ||
>                              (host->size <= 8 && host->mclk > 50000000)))
>                                 clk = host->clk_reg & ~variant->clkreg_enable;

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Srinivas Kandagatla Aug. 13, 2014, 9:45 a.m. UTC | #2
Thankyou Linus for the feedback.

On 13/08/14 09:58, Linus Walleij wrote:
> On Tue, Aug 12, 2014 at 2:05 PM, Srinivas Kandagatla
> <srinivas.kandagatla@linaro.org> wrote:
>
>> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>>
>> This patch moves ST specific sdio setup under a vendor id condition,
>> this will ensure that the ST specfic setup is not done on other vendor
>> like Qualcomm.
>>
>> Originally the issue was detected while testing WLAN ath6kl on IFC6410
>> board with APQ8064 SOC.
>>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>
> So instead of again checking hw_designer (I think that's a bit
> messy) and instead of having the flag bool sdio from patch
> 1, why not introduce 2 flags in vendor_data:
>
> bool st_sdio;
> bool qcom_sdio;

Thats good idea,

If we rename the existing sdio flag to st_sdio, then we can get rid of 
the first patch too. As there is no specific sdio logic required for qcom.

I will send the change in next version.

thanks
srini
>
>> +++ b/drivers/mmc/host/mmci.c
>> @@ -828,7 +828,8 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
>>                           * otherwise the transfer will not start. The threshold
>>                           * depends on the rate of MCLK.
>>                           */
>> -                       if (data->flags & MMC_DATA_WRITE &&
>> +                       if (host->hw_designer == AMBA_VENDOR_ST &&
>> +                           data->flags & MMC_DATA_WRITE &&
>
> And this becomes just
>
> if (variant->st_sdio)...
>
>>                              (host->size < 8 ||
>>                               (host->size <= 8 && host->mclk > 50000000)))
>>                                  clk = host->clk_reg & ~variant->clkreg_enable;
>
> Yours,
> Linus Walleij
>
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 848e2bb..1783be7 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -828,7 +828,8 @@  static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
 			 * otherwise the transfer will not start. The threshold
 			 * depends on the rate of MCLK.
 			 */
-			if (data->flags & MMC_DATA_WRITE &&
+			if (host->hw_designer == AMBA_VENDOR_ST &&
+			    data->flags & MMC_DATA_WRITE &&
 			    (host->size < 8 ||
 			     (host->size <= 8 && host->mclk > 50000000)))
 				clk = host->clk_reg & ~variant->clkreg_enable;