diff mbox series

[1/3] dt-bindings: mmc: Add DTS property to disable DCMDs on Arasan controllers

Message ID 20190301164349.60589-1-christoph.muellner@theobroma-systems.com (mailing list archive)
State New, archived
Headers show
Series [1/3] dt-bindings: mmc: Add DTS property to disable DCMDs on Arasan controllers | expand

Commit Message

Christoph Muellner March 1, 2019, 4:43 p.m. UTC
Direct commands (DCMDs) are an optional feature of eMMC 5.1's command
queue engine (CQE). The Arasan eMMC 5.1 controller uses the CQHCI,
which exposes a control register bit to enable the feature.
The current implementation sets this bit unconditionally.

This patch allows to surpress the feature activation,
by specifying the property disable-cqe-dcmd.

Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
---
 drivers/mmc/host/sdhci-of-arasan.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Philipp Tomsich March 1, 2019, 4:45 p.m. UTC | #1
> On 01.03.2019, at 17:43, Christoph Muellner <christoph.muellner@theobroma-systems.com> wrote:
> 
> This patch documents the new proprty disable-cqe-dcmd

typo: proprty -> property

> for the Arasan eMMC 5.1 driver.
> 
> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
> Documentation/devicetree/bindings/mmc/arasan,sdhci.txt | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
> index 1edbb049cccb..ec699bf98b7c 100644
> --- a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
> +++ b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
> @@ -44,6 +44,10 @@ Optional Properties:
>     properly. Test mode can be used to force the controller to function.
>   - xlnx,int-clock-stable-broken: when present, the controller always reports
>     that the internal clock is stable even when it is not.
> +  - disable-cqe-dcmd: The eMMC 5.1 standard specifies direct commands (DCMDs)
> +    as part of the command queue engine (CQE). On controllers with a CQHCI,
> +    such as the Arasan eMMC 5.1 host controller, the driver has to enable DCMDs.
> +    This is done unless disable-cqe-dcmd is specified.
> 
> Example:
> 	sdhci@e0100000 {
> -- 
> 2.11.0
>
Heiko Stübner March 1, 2019, 6:17 p.m. UTC | #2
Am Freitag, 1. März 2019, 17:43:45 CET schrieb Christoph Muellner:
> Direct commands (DCMDs) are an optional feature of eMMC 5.1's command
> queue engine (CQE). The Arasan eMMC 5.1 controller uses the CQHCI,
> which exposes a control register bit to enable the feature.
> The current implementation sets this bit unconditionally.
> 
> This patch allows to surpress the feature activation,
> by specifying the property disable-cqe-dcmd.
> 
> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Patch subject is needs improvement :-) .
I did scratch my head a lot regarding "where is the code change"
until I actually looked into the patch itself, so you probably want

	mmc: sdhci-of-arasan: Add DTS property to disable DCMDs

or similar instead of "dt-bindings: ..." here to match the subsystem.


Heiko

> ---
>  drivers/mmc/host/sdhci-of-arasan.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
> index c9e3e050ccc8..88dc3f00a5be 100644
> --- a/drivers/mmc/host/sdhci-of-arasan.c
> +++ b/drivers/mmc/host/sdhci-of-arasan.c
> @@ -832,7 +832,10 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
>  		host->mmc_host_ops.start_signal_voltage_switch =
>  					sdhci_arasan_voltage_switch;
>  		sdhci_arasan->has_cqe = true;
> -		host->mmc->caps2 |= MMC_CAP2_CQE | MMC_CAP2_CQE_DCMD;
> +		host->mmc->caps2 |= MMC_CAP2_CQE;
> +
> +		if (!of_property_read_bool(np, "disable-cqe-dcmd"))
> +			host->mmc->caps2 |= MMC_CAP2_CQE_DCMD;
>  	}
>  
>  	ret = sdhci_arasan_add_host(sdhci_arasan);
>
Christoph Muellner March 1, 2019, 6:19 p.m. UTC | #3
> On 01.03.2019, at 19:17, Heiko Stuebner <heiko@sntech.de> wrote:
> 
> Am Freitag, 1. März 2019, 17:43:45 CET schrieb Christoph Muellner:
>> Direct commands (DCMDs) are an optional feature of eMMC 5.1's command
>> queue engine (CQE). The Arasan eMMC 5.1 controller uses the CQHCI,
>> which exposes a control register bit to enable the feature.
>> The current implementation sets this bit unconditionally.
>> 
>> This patch allows to surpress the feature activation,
>> by specifying the property disable-cqe-dcmd.
>> 
>> Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
>> Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> 
> Patch subject is needs improvement :-) .
> I did scratch my head a lot regarding "where is the code change"
> until I actually looked into the patch itself, so you probably want
> 
> 	mmc: sdhci-of-arasan: Add DTS property to disable DCMDs
> 
> or similar instead of "dt-bindings: ..." here to match the subsystem.

Yes, I've spotted this as well after sending it.
I've already renamed to "mmc: sdhci-of-arasan: Add DTS property to disable DCMDs." for v2.

Thanks,
Christoph

> 
> 
> Heiko
> 
>> ---
>> drivers/mmc/host/sdhci-of-arasan.c | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
>> index c9e3e050ccc8..88dc3f00a5be 100644
>> --- a/drivers/mmc/host/sdhci-of-arasan.c
>> +++ b/drivers/mmc/host/sdhci-of-arasan.c
>> @@ -832,7 +832,10 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
>> 		host->mmc_host_ops.start_signal_voltage_switch =
>> 					sdhci_arasan_voltage_switch;
>> 		sdhci_arasan->has_cqe = true;
>> -		host->mmc->caps2 |= MMC_CAP2_CQE | MMC_CAP2_CQE_DCMD;
>> +		host->mmc->caps2 |= MMC_CAP2_CQE;
>> +
>> +		if (!of_property_read_bool(np, "disable-cqe-dcmd"))
>> +			host->mmc->caps2 |= MMC_CAP2_CQE_DCMD;
>> 	}
>> 
>> 	ret = sdhci_arasan_add_host(sdhci_arasan);
>> 
> 
> 
> 
>
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index c9e3e050ccc8..88dc3f00a5be 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -832,7 +832,10 @@  static int sdhci_arasan_probe(struct platform_device *pdev)
 		host->mmc_host_ops.start_signal_voltage_switch =
 					sdhci_arasan_voltage_switch;
 		sdhci_arasan->has_cqe = true;
-		host->mmc->caps2 |= MMC_CAP2_CQE | MMC_CAP2_CQE_DCMD;
+		host->mmc->caps2 |= MMC_CAP2_CQE;
+
+		if (!of_property_read_bool(np, "disable-cqe-dcmd"))
+			host->mmc->caps2 |= MMC_CAP2_CQE_DCMD;
 	}
 
 	ret = sdhci_arasan_add_host(sdhci_arasan);