linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] phy: exynos-mipi-video: simplify check for coupled phy status
       [not found] <CGME20161107104844eucas1p2b5571119dff76e33d6ec038c359224f7@eucas1p2.samsung.com>
@ 2016-11-07 10:48 ` Marek Szyprowski
  2016-11-07 18:50   ` Javier Martinez Canillas
  2016-11-15 13:33   ` Kishon Vijay Abraham I
  0 siblings, 2 replies; 5+ messages in thread
From: Marek Szyprowski @ 2016-11-07 10:48 UTC (permalink / raw)
  To: linux-kernel, linux-samsung-soc
  Cc: Marek Szyprowski, Sylwester Nawrocki, Kishon Vijay Abraham I,
	Krzysztof Kozlowski

There is no need to access regmap of coupled phy to check its state - such
information is already in the phy device itself, so use it directly. This
let us to avoid possible access to registers of the device in the disabled
power domain if the coupled phy is already disabled.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
---
 drivers/phy/phy-exynos-mipi-video.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/phy/phy-exynos-mipi-video.c b/drivers/phy/phy-exynos-mipi-video.c
index 8b851f7..6bee04c 100644
--- a/drivers/phy/phy-exynos-mipi-video.c
+++ b/drivers/phy/phy-exynos-mipi-video.c
@@ -229,19 +229,6 @@ struct exynos_mipi_video_phy {
 	spinlock_t slock;
 };
 
-static inline int __is_running(const struct exynos_mipi_phy_desc *data,
-			struct exynos_mipi_video_phy *state)
-{
-	u32 val;
-	int ret;
-
-	ret = regmap_read(state->regmaps[data->resetn_map], data->resetn_reg, &val);
-	if (ret)
-		return 0;
-
-	return val & data->resetn_val;
-}
-
 static int __set_phy_state(const struct exynos_mipi_phy_desc *data,
 			   struct exynos_mipi_video_phy *state, unsigned int on)
 {
@@ -251,7 +238,7 @@ static int __set_phy_state(const struct exynos_mipi_phy_desc *data,
 
 	/* disable in PMU sysreg */
 	if (!on && data->coupled_phy_id >= 0 &&
-	    !__is_running(state->phys[data->coupled_phy_id].data, state)) {
+	    state->phys[data->coupled_phy_id].phy->power_count == 0) {
 		regmap_read(state->regmaps[data->enable_map], data->enable_reg,
 			    &val);
 		val &= ~data->enable_val;
-- 
1.9.1

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

* Re: [PATCH RESEND] phy: exynos-mipi-video: simplify check for coupled phy status
  2016-11-07 10:48 ` [PATCH RESEND] phy: exynos-mipi-video: simplify check for coupled phy status Marek Szyprowski
@ 2016-11-07 18:50   ` Javier Martinez Canillas
  2016-11-08  6:27     ` Marek Szyprowski
  2016-11-15 13:33   ` Kishon Vijay Abraham I
  1 sibling, 1 reply; 5+ messages in thread
From: Javier Martinez Canillas @ 2016-11-07 18:50 UTC (permalink / raw)
  To: Marek Szyprowski, linux-kernel, linux-samsung-soc
  Cc: Sylwester Nawrocki, Kishon Vijay Abraham I, Krzysztof Kozlowski

Hello Marek,

On 11/07/2016 07:48 AM, Marek Szyprowski wrote:
> There is no need to access regmap of coupled phy to check its state - such
> information is already in the phy device itself, so use it directly. This
> let us to avoid possible access to registers of the device in the disabled
> power domain if the coupled phy is already disabled.
>

Do you think this patch needs also go to stable?

> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

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

* Re: [PATCH RESEND] phy: exynos-mipi-video: simplify check for coupled phy status
  2016-11-07 18:50   ` Javier Martinez Canillas
@ 2016-11-08  6:27     ` Marek Szyprowski
  2016-11-08 11:33       ` Javier Martinez Canillas
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Szyprowski @ 2016-11-08  6:27 UTC (permalink / raw)
  To: Javier Martinez Canillas, linux-kernel, linux-samsung-soc
  Cc: Sylwester Nawrocki, Kishon Vijay Abraham I, Krzysztof Kozlowski

Hi Javier,


On 2016-11-07 19:50, Javier Martinez Canillas wrote:
> On 11/07/2016 07:48 AM, Marek Szyprowski wrote:
>> There is no need to access regmap of coupled phy to check its state - such
>> information is already in the phy device itself, so use it directly. This
>> let us to avoid possible access to registers of the device in the disabled
>> power domain if the coupled phy is already disabled.
>>
> Do you think this patch needs also go to stable?

Nope, there is no such need, because the problem with potential power domain
is specific for Exynos 5433, which is not yet merged to mainline.

>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
>> ---
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

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

* Re: [PATCH RESEND] phy: exynos-mipi-video: simplify check for coupled phy status
  2016-11-08  6:27     ` Marek Szyprowski
@ 2016-11-08 11:33       ` Javier Martinez Canillas
  0 siblings, 0 replies; 5+ messages in thread
From: Javier Martinez Canillas @ 2016-11-08 11:33 UTC (permalink / raw)
  To: Marek Szyprowski, linux-kernel, linux-samsung-soc
  Cc: Sylwester Nawrocki, Kishon Vijay Abraham I, Krzysztof Kozlowski

Hello Marek,

On 11/08/2016 03:27 AM, Marek Szyprowski wrote:
> Hi Javier,
> 
> 
> On 2016-11-07 19:50, Javier Martinez Canillas wrote:
>> On 11/07/2016 07:48 AM, Marek Szyprowski wrote:
>>> There is no need to access regmap of coupled phy to check its state - such
>>> information is already in the phy device itself, so use it directly. This
>>> let us to avoid possible access to registers of the device in the disabled
>>> power domain if the coupled phy is already disabled.
>>>
>> Do you think this patch needs also go to stable?
> 
> Nope, there is no such need, because the problem with potential power domain
> is specific for Exynos 5433, which is not yet merged to mainline.
>

Thanks for the clarification. It wasn't clear for me from the commit
message where did you face this issue.
 
>>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>>> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
>>> ---
>> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
> 
> Best regards

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

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

* Re: [PATCH RESEND] phy: exynos-mipi-video: simplify check for coupled phy status
  2016-11-07 10:48 ` [PATCH RESEND] phy: exynos-mipi-video: simplify check for coupled phy status Marek Szyprowski
  2016-11-07 18:50   ` Javier Martinez Canillas
@ 2016-11-15 13:33   ` Kishon Vijay Abraham I
  1 sibling, 0 replies; 5+ messages in thread
From: Kishon Vijay Abraham I @ 2016-11-15 13:33 UTC (permalink / raw)
  To: Marek Szyprowski, linux-kernel, linux-samsung-soc
  Cc: Sylwester Nawrocki, Krzysztof Kozlowski



On Monday 07 November 2016 04:18 PM, Marek Szyprowski wrote:
> There is no need to access regmap of coupled phy to check its state - such
> information is already in the phy device itself, so use it directly. This
> let us to avoid possible access to registers of the device in the disabled
> power domain if the coupled phy is already disabled.
> 
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>

merged to phy -next.

Thanks
Kishon
> ---
>  drivers/phy/phy-exynos-mipi-video.c | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/drivers/phy/phy-exynos-mipi-video.c b/drivers/phy/phy-exynos-mipi-video.c
> index 8b851f7..6bee04c 100644
> --- a/drivers/phy/phy-exynos-mipi-video.c
> +++ b/drivers/phy/phy-exynos-mipi-video.c
> @@ -229,19 +229,6 @@ struct exynos_mipi_video_phy {
>  	spinlock_t slock;
>  };
>  
> -static inline int __is_running(const struct exynos_mipi_phy_desc *data,
> -			struct exynos_mipi_video_phy *state)
> -{
> -	u32 val;
> -	int ret;
> -
> -	ret = regmap_read(state->regmaps[data->resetn_map], data->resetn_reg, &val);
> -	if (ret)
> -		return 0;
> -
> -	return val & data->resetn_val;
> -}
> -
>  static int __set_phy_state(const struct exynos_mipi_phy_desc *data,
>  			   struct exynos_mipi_video_phy *state, unsigned int on)
>  {
> @@ -251,7 +238,7 @@ static int __set_phy_state(const struct exynos_mipi_phy_desc *data,
>  
>  	/* disable in PMU sysreg */
>  	if (!on && data->coupled_phy_id >= 0 &&
> -	    !__is_running(state->phys[data->coupled_phy_id].data, state)) {
> +	    state->phys[data->coupled_phy_id].phy->power_count == 0) {
>  		regmap_read(state->regmaps[data->enable_map], data->enable_reg,
>  			    &val);
>  		val &= ~data->enable_val;
> 

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

end of thread, other threads:[~2016-11-15 13:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20161107104844eucas1p2b5571119dff76e33d6ec038c359224f7@eucas1p2.samsung.com>
2016-11-07 10:48 ` [PATCH RESEND] phy: exynos-mipi-video: simplify check for coupled phy status Marek Szyprowski
2016-11-07 18:50   ` Javier Martinez Canillas
2016-11-08  6:27     ` Marek Szyprowski
2016-11-08 11:33       ` Javier Martinez Canillas
2016-11-15 13:33   ` Kishon Vijay Abraham I

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).