linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: stmmac: fix length of PTP clock's name string
       [not found] <20191007154306.95827-1-antonio.borneo@st.com>
@ 2019-10-07 15:43 ` Antonio Borneo
  2019-10-09 23:10   ` Jakub Kicinski
  2019-10-07 15:43 ` [PATCH] net: stmmac: fix disabling flexible PPS output Antonio Borneo
  2019-10-07 15:43 ` [PATCH] net: stmmac: add flexible PPS to dwmac 4.10a Antonio Borneo
  2 siblings, 1 reply; 15+ messages in thread
From: Antonio Borneo @ 2019-10-07 15:43 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	David S. Miller, netdev
  Cc: Antonio Borneo, linux-kernel, linux-stm32, Maxime Coquelin,
	linux-arm-kernel

The field "name" in struct ptp_clock_info has a fixed size of 16
chars and is used as zero terminated string by clock_name_show()
in drivers/ptp/ptp_sysfs.c
The current initialization value requires 17 chars to fit also the
null termination, and this causes overflow to the next bytes in
the struct when the string is read as null terminated:
	hexdump -C /sys/class/ptp/ptp0/clock_name
	00000000  73 74 6d 6d 61 63 5f 70  74 70 5f 63 6c 6f 63 6b  |stmmac_ptp_clock|
	00000010  a0 ac b9 03 0a                                    |.....|
where the extra 4 bytes (excluding the newline) after the string
represent the integer 0x03b9aca0 = 62500000 assigned to the field
"max_adj" that follows "name" in the same struct.

There is no strict requirement for the "name" content and in the
comment in ptp_clock_kernel.h it's reported it should just be 'A
short "friendly name" to identify the clock'.
Replace it with "stmmac ptp".

Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
Fixes: 92ba6888510c ("stmmac: add the support for PTP hw clock driver")
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
index 173493db038c..df638b18b72c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
@@ -164,7 +164,7 @@ static int stmmac_enable(struct ptp_clock_info *ptp,
 /* structure describing a PTP hardware clock */
 static struct ptp_clock_info stmmac_ptp_clock_ops = {
 	.owner = THIS_MODULE,
-	.name = "stmmac_ptp_clock",
+	.name = "stmmac ptp",
 	.max_adj = 62500000,
 	.n_alarm = 0,
 	.n_ext_ts = 0,
-- 
2.23.0


_______________________________________________
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] 15+ messages in thread

* [PATCH] net: stmmac: fix disabling flexible PPS output
       [not found] <20191007154306.95827-1-antonio.borneo@st.com>
  2019-10-07 15:43 ` [PATCH] net: stmmac: fix length of PTP clock's name string Antonio Borneo
@ 2019-10-07 15:43 ` Antonio Borneo
  2019-10-09 23:10   ` Jakub Kicinski
  2019-10-07 15:43 ` [PATCH] net: stmmac: add flexible PPS to dwmac 4.10a Antonio Borneo
  2 siblings, 1 reply; 15+ messages in thread
From: Antonio Borneo @ 2019-10-07 15:43 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	David S. Miller, netdev
  Cc: Antonio Borneo, linux-kernel, linux-stm32, Maxime Coquelin,
	linux-arm-kernel

Accordingly to Synopsys documentation [1] and [2], when bit PPSEN0
in register MAC_PPS_CONTROL is set it selects the functionality
command in the same register, otherwise selects the functionality
control.
Command functionality is required to either enable (command 0x2)
and disable (command 0x5) the flexible PPS output, but the bit
PPSEN0 is currently set only for enabling.

Set the bit PPSEN0 to properly disable flexible PPS output.

Tested on STM32MP15x, based on dwmac 4.10a.

[1] DWC Ethernet QoS Databook 4.10a October 2014
[2] DWC Ethernet QoS Databook 5.00a September 2017

Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
Fixes: 9a8a02c9d46d ("net: stmmac: Add Flexible PPS support")
---
 drivers/net/ethernet/stmicro/stmmac/dwmac5.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c
index 3f4f3132e16b..e436fa160c7d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c
@@ -515,6 +515,7 @@ int dwmac5_flex_pps_config(void __iomem *ioaddr, int index,
 
 	if (!enable) {
 		val |= PPSCMDx(index, 0x5);
+		val |= PPSEN0;
 		writel(val, ioaddr + MAC_PPS_CONTROL);
 		return 0;
 	}
-- 
2.23.0


_______________________________________________
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] 15+ messages in thread

* [PATCH] net: stmmac: add flexible PPS to dwmac 4.10a
       [not found] <20191007154306.95827-1-antonio.borneo@st.com>
  2019-10-07 15:43 ` [PATCH] net: stmmac: fix length of PTP clock's name string Antonio Borneo
  2019-10-07 15:43 ` [PATCH] net: stmmac: fix disabling flexible PPS output Antonio Borneo
@ 2019-10-07 15:43 ` Antonio Borneo
  2019-10-09 22:26   ` Jakub Kicinski
  2 siblings, 1 reply; 15+ messages in thread
From: Antonio Borneo @ 2019-10-07 15:43 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	David S. Miller, netdev
  Cc: Antonio Borneo, linux-kernel, linux-stm32, Maxime Coquelin,
	linux-arm-kernel

All the registers and the functionalities used in the callback
dwmac5_flex_pps_config() are common between dwmac 4.10a [1] and
5.00a [2].

Reuse the same callback for dwmac 4.10a too.

Tested on STM32MP15x, based on dwmac 4.10a.

[1] DWC Ethernet QoS Databook 4.10a October 2014
[2] DWC Ethernet QoS Databook 5.00a September 2017

Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
index 2cb9c53f93b8..3006047213ea 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
@@ -864,6 +864,7 @@ const struct stmmac_ops dwmac410_ops = {
 	.pcs_get_adv_lp = dwmac4_get_adv_lp,
 	.debug = dwmac4_debug,
 	.set_filter = dwmac4_set_filter,
+	.flex_pps_config = dwmac5_flex_pps_config,
 	.set_mac_loopback = dwmac4_set_mac_loopback,
 	.update_vlan_hash = dwmac4_update_vlan_hash,
 	.sarc_configure = dwmac4_sarc_configure,
-- 
2.23.0


_______________________________________________
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] 15+ messages in thread

* Re: [PATCH] net: stmmac: add flexible PPS to dwmac 4.10a
  2019-10-07 15:43 ` [PATCH] net: stmmac: add flexible PPS to dwmac 4.10a Antonio Borneo
@ 2019-10-09 22:26   ` Jakub Kicinski
  2020-11-24 14:15     ` Ahmad Fatoum
  0 siblings, 1 reply; 15+ messages in thread
From: Jakub Kicinski @ 2019-10-09 22:26 UTC (permalink / raw)
  To: Antonio Borneo
  Cc: Alexandre Torgue, netdev, linux-kernel, linux-stm32, Jose Abreu,
	Maxime Coquelin, Giuseppe Cavallaro, David S. Miller,
	linux-arm-kernel

On Mon, 7 Oct 2019 17:43:06 +0200, Antonio Borneo wrote:
> All the registers and the functionalities used in the callback
> dwmac5_flex_pps_config() are common between dwmac 4.10a [1] and
> 5.00a [2].
> 
> Reuse the same callback for dwmac 4.10a too.
> 
> Tested on STM32MP15x, based on dwmac 4.10a.
> 
> [1] DWC Ethernet QoS Databook 4.10a October 2014
> [2] DWC Ethernet QoS Databook 5.00a September 2017
> 
> Signed-off-by: Antonio Borneo <antonio.borneo@st.com>

Applied to net-next.

_______________________________________________
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] 15+ messages in thread

* Re: [PATCH] net: stmmac: fix disabling flexible PPS output
  2019-10-07 15:43 ` [PATCH] net: stmmac: fix disabling flexible PPS output Antonio Borneo
@ 2019-10-09 23:10   ` Jakub Kicinski
  0 siblings, 0 replies; 15+ messages in thread
From: Jakub Kicinski @ 2019-10-09 23:10 UTC (permalink / raw)
  To: Antonio Borneo
  Cc: Alexandre Torgue, netdev, linux-kernel, linux-stm32, Jose Abreu,
	Maxime Coquelin, Giuseppe Cavallaro, David S. Miller,
	linux-arm-kernel

On Mon, 7 Oct 2019 17:43:05 +0200, Antonio Borneo wrote:
> Accordingly to Synopsys documentation [1] and [2], when bit PPSEN0
> in register MAC_PPS_CONTROL is set it selects the functionality
> command in the same register, otherwise selects the functionality
> control.
> Command functionality is required to either enable (command 0x2)
> and disable (command 0x5) the flexible PPS output, but the bit
> PPSEN0 is currently set only for enabling.
> 
> Set the bit PPSEN0 to properly disable flexible PPS output.
> 
> Tested on STM32MP15x, based on dwmac 4.10a.
> 
> [1] DWC Ethernet QoS Databook 4.10a October 2014
> [2] DWC Ethernet QoS Databook 5.00a September 2017
> 
> Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
> Fixes: 9a8a02c9d46d ("net: stmmac: Add Flexible PPS support")

Applied to net, queued for stable.

_______________________________________________
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] 15+ messages in thread

* Re: [PATCH] net: stmmac: fix length of PTP clock's name string
  2019-10-07 15:43 ` [PATCH] net: stmmac: fix length of PTP clock's name string Antonio Borneo
@ 2019-10-09 23:10   ` Jakub Kicinski
  0 siblings, 0 replies; 15+ messages in thread
From: Jakub Kicinski @ 2019-10-09 23:10 UTC (permalink / raw)
  To: Antonio Borneo
  Cc: Alexandre Torgue, netdev, linux-kernel, linux-stm32, Jose Abreu,
	Maxime Coquelin, Giuseppe Cavallaro, David S. Miller,
	linux-arm-kernel

On Mon, 7 Oct 2019 17:43:04 +0200, Antonio Borneo wrote:
> The field "name" in struct ptp_clock_info has a fixed size of 16
> chars and is used as zero terminated string by clock_name_show()
> in drivers/ptp/ptp_sysfs.c
> The current initialization value requires 17 chars to fit also the
> null termination, and this causes overflow to the next bytes in
> the struct when the string is read as null terminated:
> 	hexdump -C /sys/class/ptp/ptp0/clock_name
> 	00000000  73 74 6d 6d 61 63 5f 70  74 70 5f 63 6c 6f 63 6b  |stmmac_ptp_clock|
> 	00000010  a0 ac b9 03 0a                                    |.....|
> where the extra 4 bytes (excluding the newline) after the string
> represent the integer 0x03b9aca0 = 62500000 assigned to the field
> "max_adj" that follows "name" in the same struct.
> 
> There is no strict requirement for the "name" content and in the
> comment in ptp_clock_kernel.h it's reported it should just be 'A
> short "friendly name" to identify the clock'.
> Replace it with "stmmac ptp".
> 
> Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
> Fixes: 92ba6888510c ("stmmac: add the support for PTP hw clock driver")

Applied to net, queued for stable.

For future submissions please indicate the target tree. Networking fixes
should go to the net tree and have [PATCH net] in the subject, while
normal patches such as new features and clean ups should be tagged as
[PATCH net-next].

_______________________________________________
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] 15+ messages in thread

* Re: [PATCH] net: stmmac: add flexible PPS to dwmac 4.10a
  2019-10-09 22:26   ` Jakub Kicinski
@ 2020-11-24 14:15     ` Ahmad Fatoum
  2020-11-24 14:23       ` Antonio Borneo
                         ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2020-11-24 14:15 UTC (permalink / raw)
  To: Jakub Kicinski, Antonio Borneo
  Cc: Pengutronix Kernel Team, has, Alexandre Torgue, netdev,
	linux-kernel, linux-stm32, Jose Abreu, Maxime Coquelin,
	Giuseppe Cavallaro, David S. Miller, linux-arm-kernel

Hello Jakub,

On 10.10.19 00:26, Jakub Kicinski wrote:
> On Mon, 7 Oct 2019 17:43:06 +0200, Antonio Borneo wrote:
>> All the registers and the functionalities used in the callback
>> dwmac5_flex_pps_config() are common between dwmac 4.10a [1] and
>> 5.00a [2].
>>
>> Reuse the same callback for dwmac 4.10a too.
>>
>> Tested on STM32MP15x, based on dwmac 4.10a.
>>
>> [1] DWC Ethernet QoS Databook 4.10a October 2014
>> [2] DWC Ethernet QoS Databook 5.00a September 2017
>>
>> Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
> 
> Applied to net-next.

This patch seems to have been fuzzily applied at the wrong location.
The diff describes extension of dwmac 4.10a and so does the @@ line:

  @@ -864,6 +864,7 @@ const struct stmmac_ops dwmac410_ops = {

The patch was applied mainline as 757926247836 ("net: stmmac: add
flexible PPS to dwmac 4.10a"), but it extends dwmac4_ops instead:

  @@ -938,6 +938,7 @@ const struct stmmac_ops dwmac4_ops = {

I don't know if dwmac4 actually supports FlexPPS, so I think it's
better to be on the safe side and revert 757926247836 and add the
change for the correct variant.

Cheers,
Ahmad


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
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] 15+ messages in thread

* Re: [PATCH] net: stmmac: add flexible PPS to dwmac 4.10a
  2020-11-24 14:15     ` Ahmad Fatoum
@ 2020-11-24 14:23       ` Antonio Borneo
  2020-11-24 18:20         ` Jakub Kicinski
  2020-11-24 14:27       ` Ahmad Fatoum
  2020-11-24 22:37       ` [PATCH] net: stmmac: fix incorrect merge of patch upstream Antonio Borneo
  2 siblings, 1 reply; 15+ messages in thread
From: Antonio Borneo @ 2020-11-24 14:23 UTC (permalink / raw)
  To: Ahmad Fatoum, Jakub Kicinski
  Cc: Pengutronix Kernel Team, has, Alexandre Torgue, netdev,
	linux-kernel, linux-stm32, Jose Abreu, Maxime Coquelin,
	Giuseppe Cavallaro, David S. Miller, linux-arm-kernel

On Tue, 2020-11-24 at 15:15 +0100, Ahmad Fatoum wrote:
> Hello Jakub,
> 
> On 10.10.19 00:26, Jakub Kicinski wrote:
> > On Mon, 7 Oct 2019 17:43:06 +0200, Antonio Borneo wrote:
> > > All the registers and the functionalities used in the callback
> > > dwmac5_flex_pps_config() are common between dwmac 4.10a [1] and
> > > 5.00a [2].
> > > 
> > > Reuse the same callback for dwmac 4.10a too.
> > > 
> > > Tested on STM32MP15x, based on dwmac 4.10a.
> > > 
> > > [1] DWC Ethernet QoS Databook 4.10a October 2014
> > > [2] DWC Ethernet QoS Databook 5.00a September 2017
> > > 
> > > Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
> > 
> > Applied to net-next.
> 
> This patch seems to have been fuzzily applied at the wrong location.
> The diff describes extension of dwmac 4.10a and so does the @@ line:
> 
>   @@ -864,6 +864,7 @@ const struct stmmac_ops dwmac410_ops = {
> 
> The patch was applied mainline as 757926247836 ("net: stmmac: add
> flexible PPS to dwmac 4.10a"), but it extends dwmac4_ops instead:
> 
>   @@ -938,6 +938,7 @@ const struct stmmac_ops dwmac4_ops = {
> 
> I don't know if dwmac4 actually supports FlexPPS, so I think it's
> better to be on the safe side and revert 757926247836 and add the
> change for the correct variant.

Agree,
the patch get applied to the wrong place!

Antonio

> 
> Cheers,
> Ahmad
> 
> 



_______________________________________________
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] 15+ messages in thread

* Re: [PATCH] net: stmmac: add flexible PPS to dwmac 4.10a
  2020-11-24 14:15     ` Ahmad Fatoum
  2020-11-24 14:23       ` Antonio Borneo
@ 2020-11-24 14:27       ` Ahmad Fatoum
  2020-11-24 22:37       ` [PATCH] net: stmmac: fix incorrect merge of patch upstream Antonio Borneo
  2 siblings, 0 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2020-11-24 14:27 UTC (permalink / raw)
  To: Antonio Borneo, Jakub Kicinski
  Cc: Maxime Coquelin, has, Alexandre Torgue, netdev, linux-kernel,
	David S. Miller, Jose Abreu, Pengutronix Kernel Team,
	Giuseppe Cavallaro, linux-stm32, linux-arm-kernel

To += Jakub's new address

On 24.11.20 15:15, Ahmad Fatoum wrote:
> Hello Jakub,
> 
> On 10.10.19 00:26, Jakub Kicinski wrote:
>> On Mon, 7 Oct 2019 17:43:06 +0200, Antonio Borneo wrote:
>>> All the registers and the functionalities used in the callback
>>> dwmac5_flex_pps_config() are common between dwmac 4.10a [1] and
>>> 5.00a [2].
>>>
>>> Reuse the same callback for dwmac 4.10a too.
>>>
>>> Tested on STM32MP15x, based on dwmac 4.10a.
>>>
>>> [1] DWC Ethernet QoS Databook 4.10a October 2014
>>> [2] DWC Ethernet QoS Databook 5.00a September 2017
>>>
>>> Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
>>
>> Applied to net-next.
> 
> This patch seems to have been fuzzily applied at the wrong location.
> The diff describes extension of dwmac 4.10a and so does the @@ line:
> 
>   @@ -864,6 +864,7 @@ const struct stmmac_ops dwmac410_ops = {
> 
> The patch was applied mainline as 757926247836 ("net: stmmac: add
> flexible PPS to dwmac 4.10a"), but it extends dwmac4_ops instead:
> 
>   @@ -938,6 +938,7 @@ const struct stmmac_ops dwmac4_ops = {
> 
> I don't know if dwmac4 actually supports FlexPPS, so I think it's
> better to be on the safe side and revert 757926247836 and add the
> change for the correct variant.
> 
> Cheers,
> Ahmad
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
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] 15+ messages in thread

* Re: [PATCH] net: stmmac: add flexible PPS to dwmac 4.10a
  2020-11-24 14:23       ` Antonio Borneo
@ 2020-11-24 18:20         ` Jakub Kicinski
  2020-11-24 18:27           ` Antonio Borneo
  0 siblings, 1 reply; 15+ messages in thread
From: Jakub Kicinski @ 2020-11-24 18:20 UTC (permalink / raw)
  To: Antonio Borneo
  Cc: Pengutronix Kernel Team, Ahmad Fatoum, Alexandre Torgue, netdev,
	linux-kernel, linux-stm32, Jose Abreu, Maxime Coquelin,
	Giuseppe Cavallaro, kuba, has, David S. Miller, linux-arm-kernel

On Tue, 24 Nov 2020 15:23:27 +0100 Antonio Borneo wrote:
> On Tue, 2020-11-24 at 15:15 +0100, Ahmad Fatoum wrote:
> > On 10.10.19 00:26, Jakub Kicinski wrote:  
> > > On Mon, 7 Oct 2019 17:43:06 +0200, Antonio Borneo wrote:  
> > > > All the registers and the functionalities used in the callback
> > > > dwmac5_flex_pps_config() are common between dwmac 4.10a [1] and
> > > > 5.00a [2].
> > > > 
> > > > Reuse the same callback for dwmac 4.10a too.
> > > > 
> > > > Tested on STM32MP15x, based on dwmac 4.10a.
> > > > 
> > > > [1] DWC Ethernet QoS Databook 4.10a October 2014
> > > > [2] DWC Ethernet QoS Databook 5.00a September 2017
> > > > 
> > > > Signed-off-by: Antonio Borneo <antonio.borneo@st.com>  
> > > 
> > > Applied to net-next.  
> > 
> > This patch seems to have been fuzzily applied at the wrong location.
> > The diff describes extension of dwmac 4.10a and so does the @@ line:
> > 
> >   @@ -864,6 +864,7 @@ const struct stmmac_ops dwmac410_ops = {
> > 
> > The patch was applied mainline as 757926247836 ("net: stmmac: add
> > flexible PPS to dwmac 4.10a"), but it extends dwmac4_ops instead:
> > 
> >   @@ -938,6 +938,7 @@ const struct stmmac_ops dwmac4_ops = {
> > 
> > I don't know if dwmac4 actually supports FlexPPS, so I think it's
> > better to be on the safe side and revert 757926247836 and add the
> > change for the correct variant.  
> 
> Agree,
> the patch get applied to the wrong place!

:-o

This happens sometimes with stable backports but I've never seen it
happen working on "current" branches.

Sorry about that!

Would you mind sending the appropriate patches? I can do the revert if
you prefer, but since you need to send the fix anyway..

_______________________________________________
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] 15+ messages in thread

* Re: [PATCH] net: stmmac: add flexible PPS to dwmac 4.10a
  2020-11-24 18:20         ` Jakub Kicinski
@ 2020-11-24 18:27           ` Antonio Borneo
  2020-11-24 18:56             ` Jakub Kicinski
  0 siblings, 1 reply; 15+ messages in thread
From: Antonio Borneo @ 2020-11-24 18:27 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Pengutronix Kernel Team, Ahmad Fatoum, Alexandre Torgue, netdev,
	linux-kernel, linux-stm32, Jose Abreu, Maxime Coquelin,
	Giuseppe Cavallaro, has, David S. Miller, linux-arm-kernel

On Tue, 2020-11-24 at 10:20 -0800, Jakub Kicinski wrote:
> On Tue, 24 Nov 2020 15:23:27 +0100 Antonio Borneo wrote:
> > On Tue, 2020-11-24 at 15:15 +0100, Ahmad Fatoum wrote:
> > > On 10.10.19 00:26, Jakub Kicinski wrote:  
> > > > On Mon, 7 Oct 2019 17:43:06 +0200, Antonio Borneo wrote:  
> > > > > All the registers and the functionalities used in the callback
> > > > > dwmac5_flex_pps_config() are common between dwmac 4.10a [1] and
> > > > > 5.00a [2].
> > > > > 
> > > > > Reuse the same callback for dwmac 4.10a too.
> > > > > 
> > > > > Tested on STM32MP15x, based on dwmac 4.10a.
> > > > > 
> > > > > [1] DWC Ethernet QoS Databook 4.10a October 2014
> > > > > [2] DWC Ethernet QoS Databook 5.00a September 2017
> > > > > 
> > > > > Signed-off-by: Antonio Borneo <antonio.borneo@st.com>  
> > > > 
> > > > Applied to net-next.  
> > > 
> > > This patch seems to have been fuzzily applied at the wrong location.
> > > The diff describes extension of dwmac 4.10a and so does the @@ line:
> > > 
> > >   @@ -864,6 +864,7 @@ const struct stmmac_ops dwmac410_ops = {
> > > 
> > > The patch was applied mainline as 757926247836 ("net: stmmac: add
> > > flexible PPS to dwmac 4.10a"), but it extends dwmac4_ops instead:
> > > 
> > >   @@ -938,6 +938,7 @@ const struct stmmac_ops dwmac4_ops = {
> > > 
> > > I don't know if dwmac4 actually supports FlexPPS, so I think it's
> > > better to be on the safe side and revert 757926247836 and add the
> > > change for the correct variant.  
> > 
> > Agree,
> > the patch get applied to the wrong place!
> 
> :-o
> 
> This happens sometimes with stable backports but I've never seen it
> happen working on "current" branches.
> 
> Sorry about that!
> 
> Would you mind sending the appropriate patches? I can do the revert if
> you prefer, but since you need to send the fix anyway..

You mean sending two patches one for revert and one to re-apply the code?
Or a single patch for the fix?

Antonio


_______________________________________________
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] 15+ messages in thread

* Re: [PATCH] net: stmmac: add flexible PPS to dwmac 4.10a
  2020-11-24 18:27           ` Antonio Borneo
@ 2020-11-24 18:56             ` Jakub Kicinski
  0 siblings, 0 replies; 15+ messages in thread
From: Jakub Kicinski @ 2020-11-24 18:56 UTC (permalink / raw)
  To: Antonio Borneo
  Cc: Pengutronix Kernel Team, Ahmad Fatoum, Alexandre Torgue, netdev,
	linux-kernel, linux-stm32, Jose Abreu, Maxime Coquelin,
	Giuseppe Cavallaro, has, David S. Miller, linux-arm-kernel

On Tue, 24 Nov 2020 19:27:03 +0100 Antonio Borneo wrote:
> On Tue, 2020-11-24 at 10:20 -0800, Jakub Kicinski wrote:
> > On Tue, 24 Nov 2020 15:23:27 +0100 Antonio Borneo wrote:  
> > > On Tue, 2020-11-24 at 15:15 +0100, Ahmad Fatoum wrote:  
> > > > On 10.10.19 00:26, Jakub Kicinski wrote:    
> > > > > On Mon, 7 Oct 2019 17:43:06 +0200, Antonio Borneo wrote:    
> > > > > > All the registers and the functionalities used in the callback
> > > > > > dwmac5_flex_pps_config() are common between dwmac 4.10a [1] and
> > > > > > 5.00a [2].
> > > > > > 
> > > > > > Reuse the same callback for dwmac 4.10a too.
> > > > > > 
> > > > > > Tested on STM32MP15x, based on dwmac 4.10a.
> > > > > > 
> > > > > > [1] DWC Ethernet QoS Databook 4.10a October 2014
> > > > > > [2] DWC Ethernet QoS Databook 5.00a September 2017
> > > > > > 
> > > > > > Signed-off-by: Antonio Borneo <antonio.borneo@st.com>    
> > > > > 
> > > > > Applied to net-next.    
> > > > 
> > > > This patch seems to have been fuzzily applied at the wrong location.
> > > > The diff describes extension of dwmac 4.10a and so does the @@ line:
> > > > 
> > > >   @@ -864,6 +864,7 @@ const struct stmmac_ops dwmac410_ops = {
> > > > 
> > > > The patch was applied mainline as 757926247836 ("net: stmmac: add
> > > > flexible PPS to dwmac 4.10a"), but it extends dwmac4_ops instead:
> > > > 
> > > >   @@ -938,6 +938,7 @@ const struct stmmac_ops dwmac4_ops = {
> > > > 
> > > > I don't know if dwmac4 actually supports FlexPPS, so I think it's
> > > > better to be on the safe side and revert 757926247836 and add the
> > > > change for the correct variant.    
> > > 
> > > Agree,
> > > the patch get applied to the wrong place!  
> > 
> > :-o
> > 
> > This happens sometimes with stable backports but I've never seen it
> > happen working on "current" branches.
> > 
> > Sorry about that!
> > 
> > Would you mind sending the appropriate patches? I can do the revert if
> > you prefer, but since you need to send the fix anyway..  
> 
> You mean sending two patches one for revert and one to re-apply the code?
> Or a single patch for the fix?

Either way is fine by me. If I was doing it - I'd probably send just one
patch, but if you prefer to revert first - nothing wrong with that.

_______________________________________________
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] 15+ messages in thread

* [PATCH] net: stmmac: fix incorrect merge of patch upstream
  2020-11-24 14:15     ` Ahmad Fatoum
  2020-11-24 14:23       ` Antonio Borneo
  2020-11-24 14:27       ` Ahmad Fatoum
@ 2020-11-24 22:37       ` Antonio Borneo
  2020-11-25 10:55         ` Ahmad Fatoum
  2020-11-25 19:26         ` Jakub Kicinski
  2 siblings, 2 replies; 15+ messages in thread
From: Antonio Borneo @ 2020-11-24 22:37 UTC (permalink / raw)
  To: Alexandre Torgue, Jose Abreu, David S. Miller, Jakub Kicinski
  Cc: Ahmad Fatoum, Antonio Borneo, netdev, linux-kernel, stable,
	Maxime Coquelin, linux-stm32, linux-arm-kernel

Commit 757926247836 ("net: stmmac: add flexible PPS to dwmac
4.10a") was intended to modify the struct dwmac410_ops, but it got
somehow badly merged and modified the struct dwmac4_ops.

Revert the modification in struct dwmac4_ops and re-apply it
properly in struct dwmac410_ops.

Fixes: 757926247836 ("net: stmmac: add flexible PPS to dwmac 4.10a")
Cc: stable@vger.kernel.org # v5.6+
Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
Reported-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
To: Alexandre Torgue <alexandre.torgue@st.com>
To: Jose Abreu <joabreu@synopsys.com>
To: "David S. Miller" <davem@davemloft.net>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: netdev@vger.kernel.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
In-Reply-To: <42960ede-9355-1277-9a6f-4eac3c22365c@pengutronix.de>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
index 002791b77356..ced6d76a0d85 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
@@ -1171,7 +1171,6 @@ const struct stmmac_ops dwmac4_ops = {
 	.pcs_get_adv_lp = dwmac4_get_adv_lp,
 	.debug = dwmac4_debug,
 	.set_filter = dwmac4_set_filter,
-	.flex_pps_config = dwmac5_flex_pps_config,
 	.set_mac_loopback = dwmac4_set_mac_loopback,
 	.update_vlan_hash = dwmac4_update_vlan_hash,
 	.sarc_configure = dwmac4_sarc_configure,
@@ -1213,6 +1212,7 @@ const struct stmmac_ops dwmac410_ops = {
 	.pcs_get_adv_lp = dwmac4_get_adv_lp,
 	.debug = dwmac4_debug,
 	.set_filter = dwmac4_set_filter,
+	.flex_pps_config = dwmac5_flex_pps_config,
 	.set_mac_loopback = dwmac4_set_mac_loopback,
 	.update_vlan_hash = dwmac4_update_vlan_hash,
 	.sarc_configure = dwmac4_sarc_configure,

base-commit: 9bd2702d292cb7b565b09e949d30288ab7a26d51
-- 
2.29.2


_______________________________________________
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] 15+ messages in thread

* Re: [PATCH] net: stmmac: fix incorrect merge of patch upstream
  2020-11-24 22:37       ` [PATCH] net: stmmac: fix incorrect merge of patch upstream Antonio Borneo
@ 2020-11-25 10:55         ` Ahmad Fatoum
  2020-11-25 19:26         ` Jakub Kicinski
  1 sibling, 0 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2020-11-25 10:55 UTC (permalink / raw)
  To: Antonio Borneo, Alexandre Torgue, Jose Abreu, David S. Miller,
	Jakub Kicinski
  Cc: netdev, linux-kernel, stable, Maxime Coquelin, linux-stm32,
	linux-arm-kernel

Hello,

On 24.11.20 23:37, Antonio Borneo wrote:
> Commit 757926247836 ("net: stmmac: add flexible PPS to dwmac
> 4.10a") was intended to modify the struct dwmac410_ops, but it got
> somehow badly merged and modified the struct dwmac4_ops.
> 
> Revert the modification in struct dwmac4_ops and re-apply it
> properly in struct dwmac410_ops.
> 
> Fixes: 757926247836 ("net: stmmac: add flexible PPS to dwmac 4.10a")
> Cc: stable@vger.kernel.org # v5.6+

I don't think extension of dwmac410_ops should be backported to stable.
It's a new feature and should go into net-next like any other.
The fix that could be backported is reverting the unintentional change
of dwmac4.

Cheers,
Ahmad

> Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
> Reported-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> To: Alexandre Torgue <alexandre.torgue@st.com>
> To: Jose Abreu <joabreu@synopsys.com>
> To: "David S. Miller" <davem@davemloft.net>
> To: Jakub Kicinski <kuba@kernel.org>
> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
> Cc: netdev@vger.kernel.org
> Cc: linux-stm32@st-md-mailman.stormreply.com
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> In-Reply-To: <42960ede-9355-1277-9a6f-4eac3c22365c@pengutronix.de>
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
> index 002791b77356..ced6d76a0d85 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
> @@ -1171,7 +1171,6 @@ const struct stmmac_ops dwmac4_ops = {
>  	.pcs_get_adv_lp = dwmac4_get_adv_lp,
>  	.debug = dwmac4_debug,
>  	.set_filter = dwmac4_set_filter,
> -	.flex_pps_config = dwmac5_flex_pps_config,
>  	.set_mac_loopback = dwmac4_set_mac_loopback,
>  	.update_vlan_hash = dwmac4_update_vlan_hash,
>  	.sarc_configure = dwmac4_sarc_configure,
> @@ -1213,6 +1212,7 @@ const struct stmmac_ops dwmac410_ops = {
>  	.pcs_get_adv_lp = dwmac4_get_adv_lp,
>  	.debug = dwmac4_debug,
>  	.set_filter = dwmac4_set_filter,
> +	.flex_pps_config = dwmac5_flex_pps_config,
>  	.set_mac_loopback = dwmac4_set_mac_loopback,
>  	.update_vlan_hash = dwmac4_update_vlan_hash,
>  	.sarc_configure = dwmac4_sarc_configure,
> 
> base-commit: 9bd2702d292cb7b565b09e949d30288ab7a26d51
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
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] 15+ messages in thread

* Re: [PATCH] net: stmmac: fix incorrect merge of patch upstream
  2020-11-24 22:37       ` [PATCH] net: stmmac: fix incorrect merge of patch upstream Antonio Borneo
  2020-11-25 10:55         ` Ahmad Fatoum
@ 2020-11-25 19:26         ` Jakub Kicinski
  1 sibling, 0 replies; 15+ messages in thread
From: Jakub Kicinski @ 2020-11-25 19:26 UTC (permalink / raw)
  To: Antonio Borneo
  Cc: Ahmad Fatoum, Alexandre Torgue, netdev, linux-kernel, stable,
	linux-stm32, Jose Abreu, Maxime Coquelin, David S. Miller,
	linux-arm-kernel

On Tue, 24 Nov 2020 23:37:29 +0100 Antonio Borneo wrote:
> Commit 757926247836 ("net: stmmac: add flexible PPS to dwmac
> 4.10a") was intended to modify the struct dwmac410_ops, but it got
> somehow badly merged and modified the struct dwmac4_ops.
> 
> Revert the modification in struct dwmac4_ops and re-apply it
> properly in struct dwmac410_ops.
> 
> Fixes: 757926247836 ("net: stmmac: add flexible PPS to dwmac 4.10a")
> Cc: stable@vger.kernel.org # v5.6+
> Signed-off-by: Antonio Borneo <antonio.borneo@st.com>
> Reported-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

Applied, and queued for 5.9 (all other 5.5+ branches are EOL by now).

Thanks!

_______________________________________________
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] 15+ messages in thread

end of thread, other threads:[~2020-11-25 19:27 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20191007154306.95827-1-antonio.borneo@st.com>
2019-10-07 15:43 ` [PATCH] net: stmmac: fix length of PTP clock's name string Antonio Borneo
2019-10-09 23:10   ` Jakub Kicinski
2019-10-07 15:43 ` [PATCH] net: stmmac: fix disabling flexible PPS output Antonio Borneo
2019-10-09 23:10   ` Jakub Kicinski
2019-10-07 15:43 ` [PATCH] net: stmmac: add flexible PPS to dwmac 4.10a Antonio Borneo
2019-10-09 22:26   ` Jakub Kicinski
2020-11-24 14:15     ` Ahmad Fatoum
2020-11-24 14:23       ` Antonio Borneo
2020-11-24 18:20         ` Jakub Kicinski
2020-11-24 18:27           ` Antonio Borneo
2020-11-24 18:56             ` Jakub Kicinski
2020-11-24 14:27       ` Ahmad Fatoum
2020-11-24 22:37       ` [PATCH] net: stmmac: fix incorrect merge of patch upstream Antonio Borneo
2020-11-25 10:55         ` Ahmad Fatoum
2020-11-25 19:26         ` Jakub Kicinski

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