Skip to contentSkip to conversation

sdhci: arasan: Add runtime PM support

RFC PATCH In review [email protected] 5 participants 7 messages Mar 29, 2018 – Apr 10, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 sdhci: arasan: Add runtime PM support

From: Manish Narani <[email protected]>

This patch adds runtime PM support in Arasan SD driver.

---
 drivers/mmc/host/sdhci-of-arasan.c | 83 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 81 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-of-arasan.c +81 -2
index c33a5f7..47196b5 100644
@@ -23,6 +23,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/phy/phy.h>
 #include <linux/regmap.h>
 #include <linux/of.h>
@@ -349,6 +350,75 @@ static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = {
 			SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN,
 };
 
+#ifdef CONFIG_PM
+/**
+ * sdhci_arasan_runtime_suspend - Suspend method for the driver
+ * @dev:	Address of the device structure
+ * Returns 0 on success and error value on error
+ *
+ * Put the device in a low power state.
+ */
+static int sdhci_arasan_runtime_suspend(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct sdhci_host *host = platform_get_drvdata(pdev);
+	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+	struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host);
+	int ret;
+
+	ret = sdhci_runtime_suspend_host(host);
+	if (ret)
+		return ret;
+
+	if (host->tuning_mode != SDHCI_TUNING_MODE_3)
+		mmc_retune_needed(host->mmc);
+
+	clk_disable(pltfm_host->clk);
+	clk_disable(sdhci_arasan->clk_ahb);
+
+	return 0;
+}
+
+/**
+ * sdhci_arasan_runtime_resume - Resume method for the driver
+ * @dev:	Address of the device structure
+ * Returns 0 on success and error value on error
+ *
+ * Resume operation after suspend
+ */
+static int sdhci_arasan_runtime_resume(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct sdhci_host *host = platform_get_drvdata(pdev);
+	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+	struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host);
+	int ret;
+
+	ret = clk_enable(sdhci_arasan->clk_ahb);
+	if (ret) {
+		dev_err(dev, "Cannot enable AHB clock.\n");
+		return ret;
+	}
+
+	ret = clk_enable(pltfm_host->clk);
+	if (ret) {
+		dev_err(dev, "Cannot enable SD clock.\n");
+		return ret;
+	}
+
+	ret = sdhci_runtime_resume_host(host);
+	if (ret)
+		goto out;
+
+	return 0;
+out:
+	clk_disable(pltfm_host->clk);
+	clk_disable(sdhci_arasan->clk_ahb);
+
+	return ret;
+}
+#endif /* ! CONFIG_PM */
+
 #ifdef CONFIG_PM_SLEEP
 /**
  * sdhci_arasan_suspend - Suspend method for the driver
@@ -443,8 +513,11 @@ static int sdhci_arasan_resume(struct device *dev)
 }
 #endif /* ! CONFIG_PM_SLEEP */
 
-static SIMPLE_DEV_PM_OPS(sdhci_arasan_dev_pm_ops, sdhci_arasan_suspend,
-			 sdhci_arasan_resume);
+static const struct dev_pm_ops sdhci_arasan_dev_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(sdhci_arasan_suspend, sdhci_arasan_resume)
+	SET_RUNTIME_PM_OPS(sdhci_arasan_runtime_suspend,
+			   sdhci_arasan_runtime_resume, NULL)
+};
 
 static const struct of_device_id sdhci_arasan_of_match[] = {
 	/* SoC-specific compatible strings w/ soc_ctl_map */
@@ -806,6 +879,12 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
 	if (ret)
 		goto err_add_host;
 
+	pm_runtime_set_active(&pdev->dev);
+	pm_runtime_enable(&pdev->dev);
+	pm_runtime_set_autosuspend_delay(&pdev->dev, 2000);
+	pm_runtime_mark_last_busy(&pdev->dev);
+	pm_runtime_use_autosuspend(&pdev->dev);
+
 	return 0;
 
 err_add_host:
Signature · 1 line
2.7.4
#1 lore raw
Quoted 25 lines · On 2018/3/29 13:48, [email protected] wrote:

From: Manish Narani <[email protected]>

This patch adds runtime PM support in Arasan SD driver.

---
  drivers/mmc/host/sdhci-of-arasan.c | 83 +++++++++++++++++++++++++++++++++++++-
  1 file changed, 81 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-of-arasan.c +1 -0
index c33a5f7..47196b5 100644
@@ -23,6 +23,7 @@
  #include <linux/mfd/syscon.h>
  #include <linux/module.h>
  #include <linux/of_device.h>
+#include <linux/pm_runtime.h>
  #include <linux/phy/phy.h>
  #include <linux/regmap.h>
  #include <linux/of.h>
@@ -349,6 +350,75 @@ static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = {
  			SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN,
  };
 

drivers/mmc/host/sdhci-of-arasan.c static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = { · line 362

Quoted 10 lines
drivers/mmc/host/sdhci-of-arasan.c +10 -0
+#ifdef CONFIG_PM
+/**
+ * sdhci_arasan_runtime_suspend - Suspend method for the driver
+ * @dev:	Address of the device structure
+ * Returns 0 on success and error value on error
+ *
+ * Put the device in a low power state.
+ */
+static int sdhci_arasan_runtime_suspend(struct device *dev)
+{

Would you help take care of cqhci_suspend?

Quoted 24 lines
drivers/mmc/host/sdhci-of-arasan.c +24 -0
+	struct platform_device *pdev = to_platform_device(dev);
+	struct sdhci_host *host = platform_get_drvdata(pdev);
+	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+	struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host);
+	int ret;
+
+	ret = sdhci_runtime_suspend_host(host);
+	if (ret)
+		return ret;
+
+	if (host->tuning_mode != SDHCI_TUNING_MODE_3)
+		mmc_retune_needed(host->mmc);
+
+	clk_disable(pltfm_host->clk);
+	clk_disable(sdhci_arasan->clk_ahb);
+
+	return 0;
+}
+
+/**
+ * sdhci_arasan_runtime_resume - Resume method for the driver
+ * @dev:	Address of the device structure
+ * Returns 0 on success and error value on error
+ *

drivers/mmc/host/sdhci-of-arasan.c static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = { · line 396

Quoted 10 lines
drivers/mmc/host/sdhci-of-arasan.c +10 -0
+ * Resume operation after suspend
+ */
+static int sdhci_arasan_runtime_resume(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct sdhci_host *host = platform_get_drvdata(pdev);
+	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+	struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host);
+	int ret;
+

Ditto, for cqhci_resume.

Quoted 56 lines
drivers/mmc/host/sdhci-of-arasan.c +36 -2
+	ret = clk_enable(sdhci_arasan->clk_ahb);
+	if (ret) {
+		dev_err(dev, "Cannot enable AHB clock.\n");
+		return ret;
+	}
+
+	ret = clk_enable(pltfm_host->clk);
+	if (ret) {
+		dev_err(dev, "Cannot enable SD clock.\n");
+		return ret;
+	}
+
+	ret = sdhci_runtime_resume_host(host);
+	if (ret)
+		goto out;
+
+	return 0;
+out:
+	clk_disable(pltfm_host->clk);
+	clk_disable(sdhci_arasan->clk_ahb);
+
+	return ret;
+}
+#endif /* ! CONFIG_PM */
+
  #ifdef CONFIG_PM_SLEEP
  /**
   * sdhci_arasan_suspend - Suspend method for the driver
@@ -443,8 +513,11 @@ static int sdhci_arasan_resume(struct device *dev)
  }
  #endif /* ! CONFIG_PM_SLEEP */
 
-static SIMPLE_DEV_PM_OPS(sdhci_arasan_dev_pm_ops, sdhci_arasan_suspend,
-			 sdhci_arasan_resume);
+static const struct dev_pm_ops sdhci_arasan_dev_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(sdhci_arasan_suspend, sdhci_arasan_resume)
+	SET_RUNTIME_PM_OPS(sdhci_arasan_runtime_suspend,
+			   sdhci_arasan_runtime_resume, NULL)
+};
 
  static const struct of_device_id sdhci_arasan_of_match[] = {
  	/* SoC-specific compatible strings w/ soc_ctl_map */
@@ -806,6 +879,12 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
  	if (ret)
  		goto err_add_host;
 
+	pm_runtime_set_active(&pdev->dev);
+	pm_runtime_enable(&pdev->dev);
+	pm_runtime_set_autosuspend_delay(&pdev->dev, 2000);
+	pm_runtime_mark_last_busy(&pdev->dev);
+	pm_runtime_use_autosuspend(&pdev->dev);
+
  	return 0;
 
  err_add_host:
#2 lore raw

Hi Shawn,

Quoted 39 lines

-----Original Message-----
From: Shawn Lin [mailto:shawn.lin at rock-chips.com]
Sent: Thursday, March 29, 2018 12:57 PM
To: naranimanish at gmail.com
Cc: adrian.hunter at intel.com; michal.simek at xilinx.com; ulf.hansson at linaro.org; linux-mmc at vger.kernel.org; linux-arm- kernel at lists.infradead.org; linux-kernel at vger.kernel.org; shawn.lin at rock- chips.com; Manish Narani <[email protected]>
Subject: Re: [RFC PATCH] sdhci: arasan: Add runtime PM support

Quoted 7 lines · naranimanish at gmail.com

From: Manish Narani <[email protected]>

This patch adds runtime PM support in Arasan SD driver.

---
  drivers/mmc/host/sdhci-of-arasan.c | 83

+++++++++++++++++++++++++++++++++++++-

drivers/mmc/host/sdhci-of-arasan.c static const struct sdhci_pltfm_data

Quoted 16 lines
  1 file changed, 81 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-of-arasan.c +1 -0
index c33a5f7..47196b5 100644
@@ -23,6 +23,7 @@
  #include <linux/mfd/syscon.h>
  #include <linux/module.h>
  #include <linux/of_device.h>
+#include <linux/pm_runtime.h>
  #include <linux/phy/phy.h>
  #include <linux/regmap.h>
  #include <linux/of.h>
@@ -349,6 +350,75 @@ static const struct sdhci_pltfm_data

sdhci_arasan_cqe_pdata = {

Quoted 3 lines
drivers/mmc/host/sdhci-of-arasan.c +0 -0
  			SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN,
  };
 
Quoted 11 lines

drivers/mmc/host/sdhci-of-arasan.c static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = {

Quoted 9 lines
drivers/mmc/host/sdhci-of-arasan.c +9 -0
+#ifdef CONFIG_PM
+/**
+ * sdhci_arasan_runtime_suspend - Suspend method for the driver
+ * @dev:	Address of the device structure
+ * Returns 0 on success and error value on error
+ *
+ * Put the device in a low power state.
+ */
+static int sdhci_arasan_runtime_suspend(struct device *dev) {

Would you help take care of cqhci_suspend?

Yes, sure. Will take care of this in next version of patch.

Quoted 34 lines

drivers/mmc/host/sdhci-of-arasan.c static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = {

Quoted 5 lines
drivers/mmc/host/sdhci-of-arasan.c +4 -0
+	struct platform_device *pdev = to_platform_device(dev);
+	struct sdhci_host *host = platform_get_drvdata(pdev);
+	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+	struct sdhci_arasan_data *sdhci_arasan =

sdhci_pltfm_priv(pltfm_host);

Quoted 17 lines
drivers/mmc/host/sdhci-of-arasan.c +17 -0
+	int ret;
+
+	ret = sdhci_runtime_suspend_host(host);
+	if (ret)
+		return ret;
+
+	if (host->tuning_mode != SDHCI_TUNING_MODE_3)
+		mmc_retune_needed(host->mmc);
+
+	clk_disable(pltfm_host->clk);
+	clk_disable(sdhci_arasan->clk_ahb);
+
+	return 0;
+}
+
+/**
+ * sdhci_arasan_runtime_resume - Resume method for the driver

drivers/mmc/host/sdhci-of-arasan.c static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = {

Quoted 10 lines
drivers/mmc/host/sdhci-of-arasan.c +10 -0
+ * @dev:	Address of the device structure
+ * Returns 0 on success and error value on error
+ *
+ * Resume operation after suspend
+ */
+static int sdhci_arasan_runtime_resume(struct device *dev) {
+	struct platform_device *pdev = to_platform_device(dev);
+	struct sdhci_host *host = platform_get_drvdata(pdev);
+	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+	struct sdhci_arasan_data *sdhci_arasan =

sdhci_pltfm_priv(pltfm_host);

Quoted 4 lines

drivers/mmc/host/sdhci-of-arasan.c static const struct sdhci_pltfm_data · line 394

Quoted 2 lines
drivers/mmc/host/sdhci-of-arasan.c +2 -0
+	int ret;
+

Ditto, for cqhci_resume.

Yes, okay.

Thanks,
Manish

Quoted 58 lines
Quoted 24 lines
drivers/mmc/host/sdhci-of-arasan.c +23 -0
+	ret = clk_enable(sdhci_arasan->clk_ahb);
+	if (ret) {
+		dev_err(dev, "Cannot enable AHB clock.\n");
+		return ret;
+	}
+
+	ret = clk_enable(pltfm_host->clk);
+	if (ret) {
+		dev_err(dev, "Cannot enable SD clock.\n");
+		return ret;
+	}
+
+	ret = sdhci_runtime_resume_host(host);
+	if (ret)
+		goto out;
+
+	return 0;
+out:
+	clk_disable(pltfm_host->clk);
+	clk_disable(sdhci_arasan->clk_ahb);
+
+	return ret;
+}

drivers/mmc/host/sdhci-of-arasan.c static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = {

Quoted 10 lines
drivers/mmc/host/sdhci-of-arasan.c +3 -1
+#endif /* ! CONFIG_PM */
+
  #ifdef CONFIG_PM_SLEEP
  /**
   * sdhci_arasan_suspend - Suspend method for the driver @@ -443,8
+513,11 @@ static int sdhci_arasan_resume(struct device *dev)
  }
  #endif /* ! CONFIG_PM_SLEEP */
 
-static SIMPLE_DEV_PM_OPS(sdhci_arasan_dev_pm_ops,

sdhci_arasan_suspend,

drivers/mmc/host/sdhci-of-arasan.c static int sdhci_arasan_resume(struct device *dev)

Quoted 3 lines
drivers/mmc/host/sdhci-of-arasan.c +2 -1
-			 sdhci_arasan_resume);
+static const struct dev_pm_ops sdhci_arasan_dev_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(sdhci_arasan_suspend,

sdhci_arasan_resume)

Quoted 19 lines
drivers/mmc/host/sdhci-of-arasan.c +9 -0
+	SET_RUNTIME_PM_OPS(sdhci_arasan_runtime_suspend,
+			   sdhci_arasan_runtime_resume, NULL) };
 
  static const struct of_device_id sdhci_arasan_of_match[] = {
  	/* SoC-specific compatible strings w/ soc_ctl_map */ @@ -806,6
+879,12 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
  	if (ret)
  		goto err_add_host;
 
+	pm_runtime_set_active(&pdev->dev);
+	pm_runtime_enable(&pdev->dev);
+	pm_runtime_set_autosuspend_delay(&pdev->dev, 2000);
+	pm_runtime_mark_last_busy(&pdev->dev);
+	pm_runtime_use_autosuspend(&pdev->dev);
+
  	return 0;
 
  err_add_host:
maintainer
#3 lore raw
In reply to [email protected]
Quoted 5 lines · naranimanish at gmail.com

From: Manish Narani <[email protected]>

This patch adds runtime PM support in Arasan SD driver.

Just a couple of comments about style.

Quoted 18 lines
---
 drivers/mmc/host/sdhci-of-arasan.c | 83 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 81 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-of-arasan.c +1 -0
index c33a5f7..47196b5 100644
@@ -23,6 +23,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/phy/phy.h>
 #include <linux/regmap.h>
 #include <linux/of.h>
@@ -349,6 +350,75 @@ static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = {
 			SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN,

drivers/mmc/host/sdhci-of-arasan.c static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = { · line 360

Quoted 10 lines
drivers/mmc/host/sdhci-of-arasan.c +8 -0
 };
 
+#ifdef CONFIG_PM
+/**
+ * sdhci_arasan_runtime_suspend - Suspend method for the driver
+ * @dev:	Address of the device structure
+ * Returns 0 on success and error value on error
+ *
+ * Put the device in a low power state.
+ */

Kernel style is not to put kerneldoc on callback functions.

Quoted 18 lines
drivers/mmc/host/sdhci-of-arasan.c +18 -0
+static int sdhci_arasan_runtime_suspend(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct sdhci_host *host = platform_get_drvdata(pdev);
+	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+	struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host);
+	int ret;
+
+	ret = sdhci_runtime_suspend_host(host);
+	if (ret)
+		return ret;
+
+	if (host->tuning_mode != SDHCI_TUNING_MODE_3)
+		mmc_retune_needed(host->mmc);
+
+	clk_disable(pltfm_host->clk);
+	clk_disable(sdhci_arasan->clk_ahb);
+

drivers/mmc/host/sdhci-of-arasan.c static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = { · line 388

Quoted 10 lines
drivers/mmc/host/sdhci-of-arasan.c +10 -0
+	return 0;
+}
+
+/**
+ * sdhci_arasan_runtime_resume - Resume method for the driver
+ * @dev:	Address of the device structure
+ * Returns 0 on success and error value on error
+ *
+ * Resume operation after suspend
+ */

Kernel style is not to put kerneldoc on callback functions.

Quoted 64 lines
drivers/mmc/host/sdhci-of-arasan.c +44 -2
+static int sdhci_arasan_runtime_resume(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct sdhci_host *host = platform_get_drvdata(pdev);
+	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+	struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host);
+	int ret;
+
+	ret = clk_enable(sdhci_arasan->clk_ahb);
+	if (ret) {
+		dev_err(dev, "Cannot enable AHB clock.\n");
+		return ret;
+	}
+
+	ret = clk_enable(pltfm_host->clk);
+	if (ret) {
+		dev_err(dev, "Cannot enable SD clock.\n");
+		return ret;
+	}
+
+	ret = sdhci_runtime_resume_host(host);
+	if (ret)
+		goto out;
+
+	return 0;
+out:
+	clk_disable(pltfm_host->clk);
+	clk_disable(sdhci_arasan->clk_ahb);
+
+	return ret;
+}
+#endif /* ! CONFIG_PM */
+
 #ifdef CONFIG_PM_SLEEP
 /**
  * sdhci_arasan_suspend - Suspend method for the driver
@@ -443,8 +513,11 @@ static int sdhci_arasan_resume(struct device *dev)
 }
 #endif /* ! CONFIG_PM_SLEEP */
 
-static SIMPLE_DEV_PM_OPS(sdhci_arasan_dev_pm_ops, sdhci_arasan_suspend,
-			 sdhci_arasan_resume);
+static const struct dev_pm_ops sdhci_arasan_dev_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(sdhci_arasan_suspend, sdhci_arasan_resume)
+	SET_RUNTIME_PM_OPS(sdhci_arasan_runtime_suspend,
+			   sdhci_arasan_runtime_resume, NULL)
+};
 
 static const struct of_device_id sdhci_arasan_of_match[] = {
 	/* SoC-specific compatible strings w/ soc_ctl_map */
@@ -806,6 +879,12 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
 	if (ret)
 		goto err_add_host;
 
+	pm_runtime_set_active(&pdev->dev);
+	pm_runtime_enable(&pdev->dev);
+	pm_runtime_set_autosuspend_delay(&pdev->dev, 2000);
+	pm_runtime_mark_last_busy(&pdev->dev);
+	pm_runtime_use_autosuspend(&pdev->dev);
+
 	return 0;
 
 err_add_host:
#4 lore raw

Hi Adrian,

Quoted 29 lines · Adrian Hunter
Quoted 5 lines · naranimanish at gmail.com

From: Manish Narani <[email protected]>

This patch adds runtime PM support in Arasan SD driver.

Just a couple of comments about style.

Quoted 20 lines
---
 drivers/mmc/host/sdhci-of-arasan.c | 83 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 81 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-of-arasan.c +1 -0
index c33a5f7..47196b5 100644
@@ -23,6 +23,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/phy/phy.h>
 #include <linux/regmap.h>
 #include <linux/of.h>
@@ -349,6 +350,75 @@ static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = {
 			SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN,
 };
 
Quoted 10 lines

drivers/mmc/host/sdhci-of-arasan.c static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = { · line 360

Quoted 8 lines
drivers/mmc/host/sdhci-of-arasan.c +8 -0
+#ifdef CONFIG_PM
+/**
+ * sdhci_arasan_runtime_suspend - Suspend method for the driver
+ * @dev:	Address of the device structure
+ * Returns 0 on success and error value on error
+ *
+ * Put the device in a low power state.
+ */

Kernel style is not to put kerneldoc on callback functions.

I have never read that there are some sort of list of functions which shouldn't be covered by kernel-doc.
What's the problem with using kerneldoc format here? Maybe I am not getting your comments.

Thanks,
Michal

maintainer
#5 lore raw
Quoted 43 lines · Michal Simek

Hi Adrian,

Quoted 29 lines · Adrian Hunter
Quoted 5 lines · naranimanish at gmail.com

From: Manish Narani <[email protected]>

This patch adds runtime PM support in Arasan SD driver.

Just a couple of comments about style.

Quoted 20 lines
---
 drivers/mmc/host/sdhci-of-arasan.c | 83 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 81 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-of-arasan.c +1 -0
index c33a5f7..47196b5 100644
@@ -23,6 +23,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/phy/phy.h>
 #include <linux/regmap.h>
 #include <linux/of.h>
@@ -349,6 +350,75 @@ static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = {
 			SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN,
 };
 
Quoted 10 lines

drivers/mmc/host/sdhci-of-arasan.c static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = { · line 360

Quoted 8 lines
drivers/mmc/host/sdhci-of-arasan.c +8 -0
+#ifdef CONFIG_PM
+/**
+ * sdhci_arasan_runtime_suspend - Suspend method for the driver
+ * @dev:	Address of the device structure
+ * Returns 0 on success and error value on error
+ *
+ * Put the device in a low power state.
+ */

Kernel style is not to put kerneldoc on callback functions.

Quoted 4 lines

I have never read that there are some sort of list of functions which shouldn't be covered by kernel-doc.
What's the problem with using kerneldoc format here? Maybe I am not getting your comments.

It is not a list of functions. It is any implementation of a well-known callback. i.e. we already know what ->runtime_suspend() is for, so we don't need untold numbers of drivers describing it in comments.

#6 lore raw
Quoted 44 lines · Adrian Hunter
Quoted 43 lines · Michal Simek

Hi Adrian,

Quoted 39 lines · Adrian Hunter
Quoted 5 lines · naranimanish at gmail.com

From: Manish Narani <[email protected]>

This patch adds runtime PM support in Arasan SD driver.

Just a couple of comments about style.

Quoted 18 lines
---
 drivers/mmc/host/sdhci-of-arasan.c | 83 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 81 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-of-arasan.c +1 -0
index c33a5f7..47196b5 100644
@@ -23,6 +23,7 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/phy/phy.h>
 #include <linux/regmap.h>
 #include <linux/of.h>
@@ -349,6 +350,75 @@ static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = {
 			SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN,

drivers/mmc/host/sdhci-of-arasan.c static const struct sdhci_pltfm_data sdhci_arasan_cqe_pdata = { · line 360

Quoted 10 lines
drivers/mmc/host/sdhci-of-arasan.c +8 -0
 };
 
+#ifdef CONFIG_PM
+/**
+ * sdhci_arasan_runtime_suspend - Suspend method for the driver
+ * @dev:	Address of the device structure
+ * Returns 0 on success and error value on error
+ *
+ * Put the device in a low power state.
+ */

Kernel style is not to put kerneldoc on callback functions.

Quoted 9 lines
Quoted 4 lines

I have never read that there are some sort of list of functions which shouldn't be covered by kernel-doc.
What's the problem with using kerneldoc format here? Maybe I am not getting your comments.

It is not a list of functions. It is any implementation of a well-known callback. i.e. we already know what ->runtime_suspend() is for, so we don't need untold numbers of drivers describing it in comments.

Personally in general I can't see any issue with it especially for people who has no idea how these callbacks are working but I understand your concern here especially when there is anything specific written in connection to this device.

Thanks,
Michal