linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 9/9] radeon: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)
@ 2013-06-18  8:24 Yijing Wang
  2013-06-25 12:06 ` Yijing Wang
  0 siblings, 1 reply; 7+ messages in thread
From: Yijing Wang @ 2013-06-18  8:24 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: linux-kernel, Hanjun Guo, jiang.liu, Yijing Wang, linux-fbdev

Pci core has been saved pm cap register offset by pdev->pm_cap in pci_pm_init()
in init path. So we can use pdev->pm_cap instead of using
pci_find_capability(pdev, PCI_CAP_ID_PM) for better performance and simplified code.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/video/aty/radeon_pm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
index 92bda58..f7091ec 100644
--- a/drivers/video/aty/radeon_pm.c
+++ b/drivers/video/aty/radeon_pm.c
@@ -2805,7 +2805,7 @@ static void radeonfb_early_resume(void *data)
 void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep)
 {
 	/* Find PM registers in config space if any*/
-	rinfo->pm_reg = pci_find_capability(rinfo->pdev, PCI_CAP_ID_PM);
+	rinfo->pm_reg = rinfo->pdev->pm_cap;
 
 	/* Enable/Disable dynamic clocks: TODO add sysfs access */
 	if (rinfo->family == CHIP_FAMILY_RS480)
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 9/9] radeon: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)
  2013-06-18  8:24 [PATCH 9/9] radeon: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM) Yijing Wang
@ 2013-06-25 12:06 ` Yijing Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Yijing Wang @ 2013-06-25 12:06 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard
  Cc: Yijing Wang, Benjamin Herrenschmidt, Tomi Valkeinen,
	linux-kernel, linux-fbdev

Ping....?

On 2013/6/18 16:24, Yijing Wang wrote:
> Pci core has been saved pm cap register offset by pdev->pm_cap in pci_pm_init()
> in init path. So we can use pdev->pm_cap instead of using
> pci_find_capability(pdev, PCI_CAP_ID_PM) for better performance and simplified code.
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: linux-fbdev@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  drivers/video/aty/radeon_pm.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
> index 92bda58..f7091ec 100644
> --- a/drivers/video/aty/radeon_pm.c
> +++ b/drivers/video/aty/radeon_pm.c
> @@ -2805,7 +2805,7 @@ static void radeonfb_early_resume(void *data)
>  void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep)
>  {
>  	/* Find PM registers in config space if any*/
> -	rinfo->pm_reg = pci_find_capability(rinfo->pdev, PCI_CAP_ID_PM);
> +	rinfo->pm_reg = rinfo->pdev->pm_cap;
>  
>  	/* Enable/Disable dynamic clocks: TODO add sysfs access */
>  	if (rinfo->family == CHIP_FAMILY_RS480)
> 


-- 
Thanks!
Yijing


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 9/9] radeon: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)
  2013-06-27  6:34     ` Tomi Valkeinen
@ 2013-06-27  6:50       ` Yijing Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Yijing Wang @ 2013-06-27  6:50 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: Andrew Morton, linux-kernel, Benjamin Herrenschmidt,
	Jean-Christophe Plagniol-Villard, linux-fbdev

On 2013/6/27 14:34, Tomi Valkeinen wrote:
> On 27/06/13 04:51, Yijing Wang wrote:
>> On 2013/6/26 21:15, Tomi Valkeinen wrote:
> 
>>> I couldn't find the rest of this series, and I'm not familiar with PCI.
>>> So: is this patch and "aty128fb: use pdev->pm_cap instead of
>>> pci_find_capability(..,PCI_CAP_ID_PM)" safe to apply for fbdev-3.11
>>> without anything else? I.e. has the PCI core changes been merged in 3.10
>>> or ealier?
>>
>> Hi Tomi,
>>    Thanks for your reply. Yes, it's safe, because PCI core has been use pdev->pm_cap to save
>> the pm capability offset already. And PCI core changes related this pm init code has been merged
>> long long ago(since year 2008). This series changes just to simplifier driver code about pm code.
>> It's not necessary to access pci device register to get pm cap again, drivers can use pci device pm_cap
>> member. and this series had no changes in PCI core. The rest of this series like for bnx2, bnx2x etc has
>> been tested and accepted by other subsystems.
> 
> Ok, thanks. I'll apply the two patches to my fbdev-3.11 branch.
> 
>  Tomi
> 
> 

Thanks very much!

-- 
Thanks!
Yijing


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 9/9] radeon: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)
  2013-06-27  1:51   ` Yijing Wang
@ 2013-06-27  6:34     ` Tomi Valkeinen
  2013-06-27  6:50       ` Yijing Wang
  0 siblings, 1 reply; 7+ messages in thread
From: Tomi Valkeinen @ 2013-06-27  6:34 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Andrew Morton, linux-kernel, Benjamin Herrenschmidt,
	Jean-Christophe Plagniol-Villard, linux-fbdev

[-- Attachment #1: Type: text/plain, Size: 1048 bytes --]

On 27/06/13 04:51, Yijing Wang wrote:
> On 2013/6/26 21:15, Tomi Valkeinen wrote:

>> I couldn't find the rest of this series, and I'm not familiar with PCI.
>> So: is this patch and "aty128fb: use pdev->pm_cap instead of
>> pci_find_capability(..,PCI_CAP_ID_PM)" safe to apply for fbdev-3.11
>> without anything else? I.e. has the PCI core changes been merged in 3.10
>> or ealier?
> 
> Hi Tomi,
>    Thanks for your reply. Yes, it's safe, because PCI core has been use pdev->pm_cap to save
> the pm capability offset already. And PCI core changes related this pm init code has been merged
> long long ago(since year 2008). This series changes just to simplifier driver code about pm code.
> It's not necessary to access pci device register to get pm cap again, drivers can use pci device pm_cap
> member. and this series had no changes in PCI core. The rest of this series like for bnx2, bnx2x etc has
> been tested and accepted by other subsystems.

Ok, thanks. I'll apply the two patches to my fbdev-3.11 branch.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 9/9] radeon: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)
  2013-06-26 13:15 ` Tomi Valkeinen
@ 2013-06-27  1:51   ` Yijing Wang
  2013-06-27  6:34     ` Tomi Valkeinen
  0 siblings, 1 reply; 7+ messages in thread
From: Yijing Wang @ 2013-06-27  1:51 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: Andrew Morton, linux-kernel, Benjamin Herrenschmidt,
	Jean-Christophe Plagniol-Villard, linux-fbdev

On 2013/6/26 21:15, Tomi Valkeinen wrote:
> On 26/06/13 04:13, Yijing Wang wrote:
>> Pci core has been saved pm cap register offset by pdev->pm_cap in pci_pm_init()
>> in init path. So we can use pdev->pm_cap instead of using
>> pci_find_capability(pdev, PCI_CAP_ID_PM) for better performance and simplified code.
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
>> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> Cc: linux-fbdev@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org
>> ---
>>  drivers/video/aty/radeon_pm.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
>> index 92bda58..f7091ec 100644
>> --- a/drivers/video/aty/radeon_pm.c
>> +++ b/drivers/video/aty/radeon_pm.c
>> @@ -2805,7 +2805,7 @@ static void radeonfb_early_resume(void *data)
>>  void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep)
>>  {
>>  	/* Find PM registers in config space if any*/
>> -	rinfo->pm_reg = pci_find_capability(rinfo->pdev, PCI_CAP_ID_PM);
>> +	rinfo->pm_reg = rinfo->pdev->pm_cap;
>>  
>>  	/* Enable/Disable dynamic clocks: TODO add sysfs access */
>>  	if (rinfo->family == CHIP_FAMILY_RS480)
> 
> I couldn't find the rest of this series, and I'm not familiar with PCI.
> So: is this patch and "aty128fb: use pdev->pm_cap instead of
> pci_find_capability(..,PCI_CAP_ID_PM)" safe to apply for fbdev-3.11
> without anything else? I.e. has the PCI core changes been merged in 3.10
> or ealier?

Hi Tomi,
   Thanks for your reply. Yes, it's safe, because PCI core has been use pdev->pm_cap to save
the pm capability offset already. And PCI core changes related this pm init code has been merged
long long ago(since year 2008). This series changes just to simplifier driver code about pm code.
It's not necessary to access pci device register to get pm cap again, drivers can use pci device pm_cap
member. and this series had no changes in PCI core. The rest of this series like for bnx2, bnx2x etc has
been tested and accepted by other subsystems.

link:
https://patchwork.kernel.org/patch/2739861/
https://patchwork.kernel.org/patch/2739761/
https://patchwork.kernel.org/patch/2739771/
https://patchwork.kernel.org/patch/2739801/


Thanks!
Yijing

> 
>  Tomi
> 
> 


-- 
Thanks!
Yijing


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 9/9] radeon: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)
  2013-06-26  1:13 Yijing Wang
@ 2013-06-26 13:15 ` Tomi Valkeinen
  2013-06-27  1:51   ` Yijing Wang
  0 siblings, 1 reply; 7+ messages in thread
From: Tomi Valkeinen @ 2013-06-26 13:15 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Andrew Morton, linux-kernel, Benjamin Herrenschmidt,
	Jean-Christophe Plagniol-Villard, linux-fbdev

[-- Attachment #1: Type: text/plain, Size: 1627 bytes --]

On 26/06/13 04:13, Yijing Wang wrote:
> Pci core has been saved pm cap register offset by pdev->pm_cap in pci_pm_init()
> in init path. So we can use pdev->pm_cap instead of using
> pci_find_capability(pdev, PCI_CAP_ID_PM) for better performance and simplified code.
> 
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: linux-fbdev@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> ---
>  drivers/video/aty/radeon_pm.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
> index 92bda58..f7091ec 100644
> --- a/drivers/video/aty/radeon_pm.c
> +++ b/drivers/video/aty/radeon_pm.c
> @@ -2805,7 +2805,7 @@ static void radeonfb_early_resume(void *data)
>  void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep)
>  {
>  	/* Find PM registers in config space if any*/
> -	rinfo->pm_reg = pci_find_capability(rinfo->pdev, PCI_CAP_ID_PM);
> +	rinfo->pm_reg = rinfo->pdev->pm_cap;
>  
>  	/* Enable/Disable dynamic clocks: TODO add sysfs access */
>  	if (rinfo->family == CHIP_FAMILY_RS480)

I couldn't find the rest of this series, and I'm not familiar with PCI.
So: is this patch and "aty128fb: use pdev->pm_cap instead of
pci_find_capability(..,PCI_CAP_ID_PM)" safe to apply for fbdev-3.11
without anything else? I.e. has the PCI core changes been merged in 3.10
or ealier?

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 9/9] radeon: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)
@ 2013-06-26  1:13 Yijing Wang
  2013-06-26 13:15 ` Tomi Valkeinen
  0 siblings, 1 reply; 7+ messages in thread
From: Yijing Wang @ 2013-06-26  1:13 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Yijing Wang, Benjamin Herrenschmidt,
	Jean-Christophe Plagniol-Villard, Tomi Valkeinen, linux-fbdev

Pci core has been saved pm cap register offset by pdev->pm_cap in pci_pm_init()
in init path. So we can use pdev->pm_cap instead of using
pci_find_capability(pdev, PCI_CAP_ID_PM) for better performance and simplified code.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/video/aty/radeon_pm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
index 92bda58..f7091ec 100644
--- a/drivers/video/aty/radeon_pm.c
+++ b/drivers/video/aty/radeon_pm.c
@@ -2805,7 +2805,7 @@ static void radeonfb_early_resume(void *data)
 void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlist, int force_sleep)
 {
 	/* Find PM registers in config space if any*/
-	rinfo->pm_reg = pci_find_capability(rinfo->pdev, PCI_CAP_ID_PM);
+	rinfo->pm_reg = rinfo->pdev->pm_cap;
 
 	/* Enable/Disable dynamic clocks: TODO add sysfs access */
 	if (rinfo->family == CHIP_FAMILY_RS480)
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-06-27  6:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-18  8:24 [PATCH 9/9] radeon: use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM) Yijing Wang
2013-06-25 12:06 ` Yijing Wang
2013-06-26  1:13 Yijing Wang
2013-06-26 13:15 ` Tomi Valkeinen
2013-06-27  1:51   ` Yijing Wang
2013-06-27  6:34     ` Tomi Valkeinen
2013-06-27  6:50       ` Yijing Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).