All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: i2c-stm32f7: improve loopback in timing algorithm
@ 2019-03-06 15:12 ` Bich HEMON
  0 siblings, 0 replies; 9+ messages in thread
From: Bich HEMON @ 2019-03-06 15:12 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Maxime Coquelin, Alexandre TORGUE,
	Pierre Yves MORDRET, Wolfram Sang, linux-i2c, devicetree,
	linux-stm32, linux-arm-kernel, linux-kernel
  Cc: Bich HEMON

From: Nicolas Le Bayon <nicolas.le.bayon@st.com>

This avoids useless loops inside the I2C timing algorithm.
Actually, we support only one possible solution per prescaler value.
So after finding a solution with a prescaler, the algorithm can
switch directly to the next prescaler value.

Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Bich Hemon <bich.hemon@st.com>
---
 drivers/i2c/busses/i2c-stm32f7.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index 4284fc9..48337be 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -476,8 +476,12 @@ static int stm32f7_i2c_compute_timing(struct stm32f7_i2c_dev *i2c_dev,
 
 					list_add_tail(&v->node,
 						      &solutions);
+					break;
 				}
 			}
+
+			if (p_prev == p)
+				break;
 		}
 	}
 
-- 
1.9.1

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

* [PATCH] i2c: i2c-stm32f7: improve loopback in timing algorithm
@ 2019-03-06 15:12 ` Bich HEMON
  0 siblings, 0 replies; 9+ messages in thread
From: Bich HEMON @ 2019-03-06 15:12 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Maxime Coquelin, Alexandre TORGUE,
	Pierre Yves MORDRET, Wolfram Sang, linux-i2c, devicetree,
	linux-stm32, linux-arm-kernel, linux-kernel
  Cc: Bich HEMON

From: Nicolas Le Bayon <nicolas.le.bayon@st.com>

This avoids useless loops inside the I2C timing algorithm.
Actually, we support only one possible solution per prescaler value.
So after finding a solution with a prescaler, the algorithm can
switch directly to the next prescaler value.

Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Bich Hemon <bich.hemon@st.com>
---
 drivers/i2c/busses/i2c-stm32f7.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index 4284fc9..48337be 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -476,8 +476,12 @@ static int stm32f7_i2c_compute_timing(struct stm32f7_i2c_dev *i2c_dev,
 
 					list_add_tail(&v->node,
 						      &solutions);
+					break;
 				}
 			}
+
+			if (p_prev == p)
+				break;
 		}
 	}
 
-- 
1.9.1

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

* [PATCH] i2c: i2c-stm32f7: improve loopback in timing algorithm
@ 2019-03-06 15:12 ` Bich HEMON
  0 siblings, 0 replies; 9+ messages in thread
From: Bich HEMON @ 2019-03-06 15:12 UTC (permalink / raw)
  To: Rob Herring, Mark Rutland, Maxime Coquelin, Alexandre TORGUE,
	Pierre Yves MORDRET, Wolfram Sang, linux-i2c, devicetree,
	linux-stm32, linux-arm-kernel, linux-kernel
  Cc: Bich HEMON

From: Nicolas Le Bayon <nicolas.le.bayon@st.com>

This avoids useless loops inside the I2C timing algorithm.
Actually, we support only one possible solution per prescaler value.
So after finding a solution with a prescaler, the algorithm can
switch directly to the next prescaler value.

Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
Signed-off-by: Bich Hemon <bich.hemon@st.com>
---
 drivers/i2c/busses/i2c-stm32f7.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index 4284fc9..48337be 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -476,8 +476,12 @@ static int stm32f7_i2c_compute_timing(struct stm32f7_i2c_dev *i2c_dev,
 
 					list_add_tail(&v->node,
 						      &solutions);
+					break;
 				}
 			}
+
+			if (p_prev == p)
+				break;
 		}
 	}
 
-- 
1.9.1

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] i2c: i2c-stm32f7: improve loopback in timing algorithm
  2019-03-06 15:12 ` Bich HEMON
  (?)
@ 2019-03-07 10:22   ` Pierre Yves MORDRET
  -1 siblings, 0 replies; 9+ messages in thread
From: Pierre Yves MORDRET @ 2019-03-07 10:22 UTC (permalink / raw)
  To: Bich HEMON, Rob Herring, Mark Rutland, Maxime Coquelin,
	Alexandre TORGUE, Wolfram Sang, linux-i2c, devicetree,
	linux-stm32, linux-arm-kernel, linux-kernel

Hi

Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>

Thanks

On 3/6/19 4:12 PM, Bich HEMON wrote:
> From: Nicolas Le Bayon <nicolas.le.bayon@st.com>
> 
> This avoids useless loops inside the I2C timing algorithm.
> Actually, we support only one possible solution per prescaler value.
> So after finding a solution with a prescaler, the algorithm can
> switch directly to the next prescaler value.
> 
> Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
> Signed-off-by: Bich Hemon <bich.hemon@st.com>
> ---
>  drivers/i2c/busses/i2c-stm32f7.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
> index 4284fc9..48337be 100644
> --- a/drivers/i2c/busses/i2c-stm32f7.c
> +++ b/drivers/i2c/busses/i2c-stm32f7.c
> @@ -476,8 +476,12 @@ static int stm32f7_i2c_compute_timing(struct stm32f7_i2c_dev *i2c_dev,
>  
>  					list_add_tail(&v->node,
>  						      &solutions);
> +					break;
>  				}
>  			}
> +
> +			if (p_prev == p)
> +				break;
>  		}
>  	}
>  
> 

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

* Re: [PATCH] i2c: i2c-stm32f7: improve loopback in timing algorithm
@ 2019-03-07 10:22   ` Pierre Yves MORDRET
  0 siblings, 0 replies; 9+ messages in thread
From: Pierre Yves MORDRET @ 2019-03-07 10:22 UTC (permalink / raw)
  To: Bich HEMON, Rob Herring, Mark Rutland, Maxime Coquelin,
	Alexandre TORGUE, Wolfram Sang, linux-i2c, devicetree,
	linux-stm32, linux-arm-kernel, linux-kernel

Hi

Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>

Thanks

On 3/6/19 4:12 PM, Bich HEMON wrote:
> From: Nicolas Le Bayon <nicolas.le.bayon@st.com>
> 
> This avoids useless loops inside the I2C timing algorithm.
> Actually, we support only one possible solution per prescaler value.
> So after finding a solution with a prescaler, the algorithm can
> switch directly to the next prescaler value.
> 
> Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
> Signed-off-by: Bich Hemon <bich.hemon@st.com>
> ---
>  drivers/i2c/busses/i2c-stm32f7.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
> index 4284fc9..48337be 100644
> --- a/drivers/i2c/busses/i2c-stm32f7.c
> +++ b/drivers/i2c/busses/i2c-stm32f7.c
> @@ -476,8 +476,12 @@ static int stm32f7_i2c_compute_timing(struct stm32f7_i2c_dev *i2c_dev,
>  
>  					list_add_tail(&v->node,
>  						      &solutions);
> +					break;
>  				}
>  			}
> +
> +			if (p_prev == p)
> +				break;
>  		}
>  	}
>  
> 

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

* Re: [PATCH] i2c: i2c-stm32f7: improve loopback in timing algorithm
@ 2019-03-07 10:22   ` Pierre Yves MORDRET
  0 siblings, 0 replies; 9+ messages in thread
From: Pierre Yves MORDRET @ 2019-03-07 10:22 UTC (permalink / raw)
  To: Bich HEMON, Rob Herring, Mark Rutland, Maxime Coquelin,
	Alexandre TORGUE, Wolfram Sang, linux-i2c, devicetree,
	linux-stm32, linux-arm-kernel, linux-kernel

Hi

Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>

Thanks

On 3/6/19 4:12 PM, Bich HEMON wrote:
> From: Nicolas Le Bayon <nicolas.le.bayon@st.com>
> 
> This avoids useless loops inside the I2C timing algorithm.
> Actually, we support only one possible solution per prescaler value.
> So after finding a solution with a prescaler, the algorithm can
> switch directly to the next prescaler value.
> 
> Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
> Signed-off-by: Bich Hemon <bich.hemon@st.com>
> ---
>  drivers/i2c/busses/i2c-stm32f7.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
> index 4284fc9..48337be 100644
> --- a/drivers/i2c/busses/i2c-stm32f7.c
> +++ b/drivers/i2c/busses/i2c-stm32f7.c
> @@ -476,8 +476,12 @@ static int stm32f7_i2c_compute_timing(struct stm32f7_i2c_dev *i2c_dev,
>  
>  					list_add_tail(&v->node,
>  						      &solutions);
> +					break;
>  				}
>  			}
> +
> +			if (p_prev == p)
> +				break;
>  		}
>  	}
>  
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] i2c: i2c-stm32f7: improve loopback in timing algorithm
  2019-03-06 15:12 ` Bich HEMON
  (?)
@ 2019-03-20 17:00   ` Wolfram Sang
  -1 siblings, 0 replies; 9+ messages in thread
From: Wolfram Sang @ 2019-03-20 17:00 UTC (permalink / raw)
  To: Bich HEMON
  Cc: Rob Herring, Mark Rutland, Maxime Coquelin, Alexandre TORGUE,
	Pierre Yves MORDRET, linux-i2c, devicetree, linux-stm32,
	linux-arm-kernel, linux-kernel

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

On Wed, Mar 06, 2019 at 03:12:32PM +0000, Bich HEMON wrote:
> From: Nicolas Le Bayon <nicolas.le.bayon@st.com>
> 
> This avoids useless loops inside the I2C timing algorithm.
> Actually, we support only one possible solution per prescaler value.
> So after finding a solution with a prescaler, the algorithm can
> switch directly to the next prescaler value.
> 
> Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
> Signed-off-by: Bich Hemon <bich.hemon@st.com>

Applied to for-next, thanks!

Pierre-Yves, there are two binding patches for stm32 still open, if you
have some time for it...


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] i2c: i2c-stm32f7: improve loopback in timing algorithm
@ 2019-03-20 17:00   ` Wolfram Sang
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfram Sang @ 2019-03-20 17:00 UTC (permalink / raw)
  To: Bich HEMON
  Cc: Rob Herring, Mark Rutland, Maxime Coquelin, Alexandre TORGUE,
	Pierre Yves MORDRET, linux-i2c, devicetree, linux-stm32,
	linux-arm-kernel, linux-kernel

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

On Wed, Mar 06, 2019 at 03:12:32PM +0000, Bich HEMON wrote:
> From: Nicolas Le Bayon <nicolas.le.bayon@st.com>
> 
> This avoids useless loops inside the I2C timing algorithm.
> Actually, we support only one possible solution per prescaler value.
> So after finding a solution with a prescaler, the algorithm can
> switch directly to the next prescaler value.
> 
> Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
> Signed-off-by: Bich Hemon <bich.hemon@st.com>

Applied to for-next, thanks!

Pierre-Yves, there are two binding patches for stm32 still open, if you
have some time for it...


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] i2c: i2c-stm32f7: improve loopback in timing algorithm
@ 2019-03-20 17:00   ` Wolfram Sang
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfram Sang @ 2019-03-20 17:00 UTC (permalink / raw)
  To: Bich HEMON
  Cc: Mark Rutland, devicetree, Alexandre TORGUE, linux-kernel,
	Pierre Yves MORDRET, Rob Herring, linux-i2c, Maxime Coquelin,
	linux-stm32, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 615 bytes --]

On Wed, Mar 06, 2019 at 03:12:32PM +0000, Bich HEMON wrote:
> From: Nicolas Le Bayon <nicolas.le.bayon@st.com>
> 
> This avoids useless loops inside the I2C timing algorithm.
> Actually, we support only one possible solution per prescaler value.
> So after finding a solution with a prescaler, the algorithm can
> switch directly to the next prescaler value.
> 
> Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com>
> Signed-off-by: Bich Hemon <bich.hemon@st.com>

Applied to for-next, thanks!

Pierre-Yves, there are two binding patches for stm32 still open, if you
have some time for it...


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-03-20 17:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-06 15:12 [PATCH] i2c: i2c-stm32f7: improve loopback in timing algorithm Bich HEMON
2019-03-06 15:12 ` Bich HEMON
2019-03-06 15:12 ` Bich HEMON
2019-03-07 10:22 ` Pierre Yves MORDRET
2019-03-07 10:22   ` Pierre Yves MORDRET
2019-03-07 10:22   ` Pierre Yves MORDRET
2019-03-20 17:00 ` Wolfram Sang
2019-03-20 17:00   ` Wolfram Sang
2019-03-20 17:00   ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.