Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1516978 > unrolled thread

[PATCH v2 0/2] PM / devfreq: Use the resource-managed function for devfreq device

Started byChanwoo Choi <cw00.choi@samsung.com>
First post2016-11-08 10:20 +0100
Last post2016-11-09 02:30 +0100
Articles 8 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 0/2] PM / devfreq: Use the resource-managed function for  devfreq device Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-08 10:20 +0100
    [PATCH v2 1/2] PM / devfreq: rk3399_dmc: Use the resource-managed  function to add devfreq dev Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-08 10:20 +0100
    [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add  devfreq device Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-08 10:20 +0100
      Re: [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device "Martin K. Petersen" <martin.petersen@oracle.com> - 2016-11-09 01:20 +0100
    [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add  devfreq device Chanwoo Choi <cw00.choi@samsung.com> - 2016-11-08 10:20 +0100
      Re: [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to  add devfreq device Subhash Jadavani <subhashj@codeaurora.org> - 2016-11-08 21:50 +0100
    RE: [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device MyungJoo Ham <myungjoo.ham@samsung.com> - 2016-11-09 02:30 +0100
    RE: [PATCH v2 1/2] PM / devfreq: rk3399_dmc: Use the resource-managed function to add devfreq dev MyungJoo Ham <myungjoo.ham@samsung.com> - 2016-11-09 02:30 +0100

#1516978 — [PATCH v2 0/2] PM / devfreq: Use the resource-managed function for devfreq device

FromChanwoo Choi <cw00.choi@samsung.com>
Date2016-11-08 10:20 +0100
Subject[PATCH v2 0/2] PM / devfreq: Use the resource-managed function for devfreq device
Message-ID<sBaJr-7rN-7@gated-at.bofh.it>
This patch just uses the resource-managed function when adding the new devfreq
deivce. This function handles the memory and delete of devfreq instance
automatically.

Changes from v1:
- Rebased these patches on linux-next (20161108)

Chanwoo Choi (2):
  PM / devfreq: rk3399_dmc: Use the resource-managed function to add devfreq dev
  scsi: ufs: Use the resource-managed function to add devfreq device

 drivers/devfreq/rk3399_dmc.c | 2 +-
 drivers/scsi/ufs/ufshcd.c    | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

-- 
1.9.1

[toc] | [next] | [standalone]


#1516979 — [PATCH v2 1/2] PM / devfreq: rk3399_dmc: Use the resource-managed function to add devfreq dev

FromChanwoo Choi <cw00.choi@samsung.com>
Date2016-11-08 10:20 +0100
Subject[PATCH v2 1/2] PM / devfreq: rk3399_dmc: Use the resource-managed function to add devfreq dev
Message-ID<sBaJs-7rN-19@gated-at.bofh.it>
In reply to#1516978
This patch uses the resource-managed to add the devfreq device.
This function will make it easy to handle the devfreq device.

- struct devfreq *devm_devfreq_add_device(struct device *dev,
				  struct devfreq_dev_profile *profile,
				  const char *governor_name,
				  void *data);

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/devfreq/rk3399_dmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c
index e24b73d66659..3f8f4381cd4a 100644
--- a/drivers/devfreq/rk3399_dmc.c
+++ b/drivers/devfreq/rk3399_dmc.c
@@ -436,7 +436,7 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
 
 	rk3399_devfreq_dmc_profile.initial_freq = data->rate;
 
-	data->devfreq = devfreq_add_device(dev,
+	data->devfreq = devm_devfreq_add_device(dev,
 					   &rk3399_devfreq_dmc_profile,
 					   "simple_ondemand",
 					   &data->ondemand_data);
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1516981 — [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device

FromChanwoo Choi <cw00.choi@samsung.com>
Date2016-11-08 10:20 +0100
Subject[PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device
Message-ID<sBaJs-7rN-25@gated-at.bofh.it>
In reply to#1516978
This patch uses the resource-managed to add the devfreq device.
This function will make it easy to handle the devfreq device.

- struct devfreq *devm_devfreq_add_device(struct device *dev,
				  struct devfreq_dev_profile *profile,
				  const char *governor_name,
				  void *data);
Cc: Vinayak Holikatti <vinholikatti@gmail.com>
Cc: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/scsi/ufs/ufshcd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index e491c4bda32f..e8c5ba274830 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -6250,8 +6250,6 @@ void ufshcd_remove(struct ufs_hba *hba)
 	ufshcd_hba_stop(hba, true);
 
 	ufshcd_exit_clk_gating(hba);
-	if (ufshcd_is_clkscaling_enabled(hba))
-		devfreq_remove_device(hba->devfreq);
 	ufshcd_hba_exit(hba);
 }
 EXPORT_SYMBOL_GPL(ufshcd_remove);
@@ -6579,7 +6577,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
 	}
 
 	if (ufshcd_is_clkscaling_enabled(hba)) {
-		hba->devfreq = devfreq_add_device(dev, &ufs_devfreq_profile,
+		hba->devfreq = devm_devfreq_add_device(dev, &ufs_devfreq_profile,
 						   "simple_ondemand", NULL);
 		if (IS_ERR(hba->devfreq)) {
 			dev_err(hba->dev, "Unable to register with devfreq %ld\n",
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1517670 — Re: [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device

From"Martin K. Petersen" <martin.petersen@oracle.com>
Date2016-11-09 01:20 +0100
SubjectRe: [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device
Message-ID<sBoMp-8k7-25@gated-at.bofh.it>
In reply to#1516981
>>>>> "Chanwoo" == Chanwoo Choi <cw00.choi@samsung.com> writes:

Chanwoo> This patch uses the resource-managed to add the devfreq device.
Chanwoo> This function will make it easy to handle the devfreq device.

Applied to 4.10/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

[toc] | [prev] | [next] | [standalone]


#1516989 — [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device

FromChanwoo Choi <cw00.choi@samsung.com>
Date2016-11-08 10:20 +0100
Subject[PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device
Message-ID<sBaJs-7rN-39@gated-at.bofh.it>
In reply to#1516978
This patch uses the resource-managed to add the devfreq device.
This function will make it easy to handle the devfreq device.

- struct devfreq *devm_devfreq_add_device(struct device *dev,
				  struct devfreq_dev_profile *profile,
				  const char *governor_name,
				  void *data);
Cc: Vinayak Holikatti <vinholikatti@gmail.com>
Cc: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/scsi/ufs/ufshcd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index e491c4bda32f..e8c5ba274830 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -6250,8 +6250,6 @@ void ufshcd_remove(struct ufs_hba *hba)
 	ufshcd_hba_stop(hba, true);
 
 	ufshcd_exit_clk_gating(hba);
-	if (ufshcd_is_clkscaling_enabled(hba))
-		devfreq_remove_device(hba->devfreq);
 	ufshcd_hba_exit(hba);
 }
 EXPORT_SYMBOL_GPL(ufshcd_remove);
@@ -6579,7 +6577,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
 	}
 
 	if (ufshcd_is_clkscaling_enabled(hba)) {
-		hba->devfreq = devfreq_add_device(dev, &ufs_devfreq_profile,
+		hba->devfreq = devm_devfreq_add_device(dev, &ufs_devfreq_profile,
 						   "simple_ondemand", NULL);
 		if (IS_ERR(hba->devfreq)) {
 			dev_err(hba->dev, "Unable to register with devfreq %ld\n",
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1517570 — Re: [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device

FromSubhash Jadavani <subhashj@codeaurora.org>
Date2016-11-08 21:50 +0100
SubjectRe: [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device
Message-ID<sBlvb-5XM-9@gated-at.bofh.it>
In reply to#1516989
On 2016-11-08 01:16, Chanwoo Choi wrote:
> This patch uses the resource-managed to add the devfreq device.
> This function will make it easy to handle the devfreq device.
> 
> - struct devfreq *devm_devfreq_add_device(struct device *dev,
> 				  struct devfreq_dev_profile *profile,
> 				  const char *governor_name,
> 				  void *data);
> Cc: Vinayak Holikatti <vinholikatti@gmail.com>
> Cc: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
> Cc: Martin K. Petersen <martin.petersen@oracle.com>
> Cc: linux-scsi@vger.kernel.org
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
>  drivers/scsi/ufs/ufshcd.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index e491c4bda32f..e8c5ba274830 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -6250,8 +6250,6 @@ void ufshcd_remove(struct ufs_hba *hba)
>  	ufshcd_hba_stop(hba, true);
> 
>  	ufshcd_exit_clk_gating(hba);
> -	if (ufshcd_is_clkscaling_enabled(hba))
> -		devfreq_remove_device(hba->devfreq);
>  	ufshcd_hba_exit(hba);
>  }
>  EXPORT_SYMBOL_GPL(ufshcd_remove);
> @@ -6579,7 +6577,7 @@ int ufshcd_init(struct ufs_hba *hba, void
> __iomem *mmio_base, unsigned int irq)
>  	}
> 
>  	if (ufshcd_is_clkscaling_enabled(hba)) {
> -		hba->devfreq = devfreq_add_device(dev, &ufs_devfreq_profile,
> +		hba->devfreq = devm_devfreq_add_device(dev, &ufs_devfreq_profile,
>  						   "simple_ondemand", NULL);
>  		if (IS_ERR(hba->devfreq)) {
>  			dev_err(hba->dev, "Unable to register with devfreq %ld\n",

LGTM.
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>

-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [next] | [standalone]


#1517714 — RE: [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device

FromMyungJoo Ham <myungjoo.ham@samsung.com>
Date2016-11-09 02:30 +0100
SubjectRE: [PATCH v2 2/2] scsi: ufs: Use the resource-managed function to add devfreq device
Message-ID<sBpS9-u5-15@gated-at.bofh.it>
In reply to#1516978

[Multipart message — attachments visible in raw view] — view raw

> This patch uses the resource-managed to add the devfreq device.
> This function will make it easy to handle the devfreq device.
> 
> - struct devfreq *devm_devfreq_add_device(struct device *dev,
> 				  struct devfreq_dev_profile *profile,
> 				  const char *governor_name,
> 				  void *data);
> Cc: Vinayak Holikatti <vinholikatti@gmail.com>
> Cc: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
> Cc: Martin K. Petersen <martin.petersen@oracle.com>
> Cc: linux-scsi@vger.kernel.org
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>

> ---
>  drivers/scsi/ufs/ufshcd.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 

[toc] | [prev] | [next] | [standalone]


#1517715 — RE: [PATCH v2 1/2] PM / devfreq: rk3399_dmc: Use the resource-managed function to add devfreq dev

FromMyungJoo Ham <myungjoo.ham@samsung.com>
Date2016-11-09 02:30 +0100
SubjectRE: [PATCH v2 1/2] PM / devfreq: rk3399_dmc: Use the resource-managed function to add devfreq dev
Message-ID<sBpS9-u5-9@gated-at.bofh.it>
In reply to#1516978

[Multipart message — attachments visible in raw view] — view raw

> This patch uses the resource-managed to add the devfreq device.
> This function will make it easy to handle the devfreq device.
> 
> - struct devfreq *devm_devfreq_add_device(struct device *dev,
> 				  struct devfreq_dev_profile *profile,
> 				  const char *governor_name,
> 				  void *data);
> 
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>


> ---
>  drivers/devfreq/rk3399_dmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c
> index e24b73d66659..3f8f4381cd4a 100644
> --- a/drivers/devfreq/rk3399_dmc.c
> +++ b/drivers/devfreq/rk3399_dmc.c
> @@ -436,7 +436,7 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
>  
>  	rk3399_devfreq_dmc_profile.initial_freq = data->rate;
>  
> -	data->devfreq = devfreq_add_device(dev,
> +	data->devfreq = devm_devfreq_add_device(dev,
>  					   &rk3399_devfreq_dmc_profile,
>  					   "simple_ondemand",
>  					   &data->ondemand_data);
> -- 
> 1.9.1
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web