Re: [linux-yocto][v5.15/standard/preempt-rt/nxp-sdk-5.15/nxp-s32g][PATCH] drivers: stmmac: add condition check on phydev

2023-12-12 Thread Bruce Ashfield
merged.

Bruce

In message: 
[linux-yocto][v5.15/standard/preempt-rt/nxp-sdk-5.15/nxp-s32g][PATCH] drivers: 
stmmac: add condition check on phydev
on 13/12/2023 quanyang.w...@windriver.com wrote:

> From: Quanyang Wang 
> 
> When stmmac is using fixed-link mode, dev->phydev is NULL after calling
> stmmac_init_phy, so we need to add condition check if dev->phydev is
> NULL pointer. This patch is to fix the following calltrace:
> 
> Unable to handle kernel NULL pointer dereference at virtual address 
> 0435
> Mem abort info:
>   ESR = 0x9605
>   EC = 0x25: DABT (current EL), IL = 32 bits
>   SET = 0, FnV = 0
>   EA = 0, S1PTW = 0
>   FSC = 0x05: level 1 translation fault
> Data abort info:
>   ISV = 0, ISS = 0x0005
>   CM = 0, WnR = 0
> user pgtable: 4k pages, 39-bit VAs, pgdp=000882fea000
> [0435] pgd=, p4d=, 
> pud=
> Internal error: Oops: 9605 [#1] PREEMPT_RT SMP
> Modules linked in: 8021q pfeng(O) s32cc_adc llce_core ci_hdrc_imx usbmisc_imx 
> flexcan firmware_class industrialio_triggered_buffer i2c_imx kfifo_buf 
> pwm_fsl_ftm sch_fq_codel openvswitch nsh nf_conncount nf_nat nf_conntrack 
> nf_defrag_ipv6 nf_defrag_ipv4 fuse
> CPU: 5 PID: 375 Comm: dhcpcd Tainted: G   O   
> 6.1.62-rt10-yocto-preempt-rt #66
> Hardware name: Freescale S32G399A (DT)
> pstate: 6005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : __stmmac_open+0x374/0x418
> lr : __stmmac_open+0x370/0x418
> sp : ffc00c633a50
> x29: ffc00c633a50 x28: 1043 x27: ff8800371e00
> x26:  x25: 000a x24: ff8802eec240
> x23: ff8800d8dc10 x22: ff8800cae000 x21: 
> x20: ff88026c8000 x19: ff88026c89c0 x18: 0020
> x17:  x16:  x15: ff8802eec6d8
> x14: 0001 x13: ffc0094cfefa x12: ffc0094cfef6
> x11: 0040 x10: 000a x9 : ffc0080a5414
> x8 : 000a x7 : 647968703d3d3d3d x6 : 
> x5 : ff885bfb6ae0 x4 :  x3 : 0027
> x2 :  x1 :  x0 : 0018
> Call trace:
>  __stmmac_open+0x374/0x418
>  stmmac_open+0x48/0xa0
>  __dev_open+0x10c/0x1c8
>  __dev_change_flags+0x174/0x1d0
>  dev_change_flags+0x2c/0x70
>  devinet_ioctl+0x664/0x738
>  inet_ioctl+0x1e4/0x1f8
>  sock_do_ioctl+0x50/0x100
>  sock_ioctl+0x234/0x358
>  __arm64_sys_ioctl+0xb0/0xf8
>  invoke_syscall+0x58/0x120
>  el0_svc_common.constprop.0+0x4c/0xf8
>  do_el0_svc+0x34/0xc0
>  el0_svc+0x2c/0x88
>  el0t_64_sync_handler+0xb8/0xc0
>  el0t_64_sync+0x18c/0x190
> Code: b0003440 910f6000 940f8975 f9448a81 (3950d420)
> 
> Signed-off-by: Quanyang Wang 
> ---
> Hi Bruce,
> Would you please help merge this patch to the branches:
>   v5.15/standard/preempt-rt/nxp-sdk-5.15/nxp-s32g
>   v5.15/standard/nxp-sdk-5.15/nxp-s32g
> Thanks,
> Quanyang
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c 
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 1816b87020be3..b9c06e17cf1bf 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -3840,7 +3840,8 @@ static int stmmac_open(struct net_device *dev)
>   stmmac_enable_all_dma_irq(priv);
>  
>   /* Indicate that the MAC is responsible for PHY PM */
> - dev->phydev->mac_managed_pm = true;
> + if (dev->phydev)
> + dev->phydev->mac_managed_pm = true;
>  
>   return 0;
>  
> -- 
> 2.36.1
> 

In message: 
[linux-yocto][v5.15/standard/preempt-rt/nxp-sdk-5.15/nxp-s32g][PATCH] dts: 
Aptiv-FL: enable gmac0 device node
on 13/12/2023 quanyang.w...@windriver.com wrote:

> From: Quanyang Wang 
> 
> Enable gmac0 device and set it to be a fixed link.
> 
> Signed-off-by: Quanyang Wang 
> ---
> Hi Bruce,
> Would you please help merge this patch to the branches:
>   v5.15/standard/preempt-rt/nxp-sdk-5.15/nxp-s32g
>   v5.15/standard/nxp-sdk-5.15/nxp-s32g
> Thanks,
> Quanyang
> ---
>  arch/arm64/boot/dts/freescale/s32gxxxa-cvc-fl.dtsi | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/freescale/s32gxxxa-cvc-fl.dtsi 
> b/arch/arm64/boot/dts/freescale/s32gxxxa-cvc-fl.dtsi
> index f3569655f83d4..537eda907e80d 100644
> --- a/arch/arm64/boot/dts/freescale/s32gxxxa-cvc-fl.dtsi
> +++ b/arch/arm64/boot/dts/freescale/s32gxxxa-cvc-fl.dtsi
> @@ -37,11

[linux-yocto][v5.15/standard/preempt-rt/nxp-sdk-5.15/nxp-s32g][PATCH] drivers: stmmac: add condition check on phydev

2023-12-12 Thread quanyang.wang via lists.yoctoproject.org
From: Quanyang Wang 

When stmmac is using fixed-link mode, dev->phydev is NULL after calling
stmmac_init_phy, so we need to add condition check if dev->phydev is
NULL pointer. This patch is to fix the following calltrace:

Unable to handle kernel NULL pointer dereference at virtual address 
0435
Mem abort info:
  ESR = 0x9605
  EC = 0x25: DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
  FSC = 0x05: level 1 translation fault
Data abort info:
  ISV = 0, ISS = 0x0005
  CM = 0, WnR = 0
user pgtable: 4k pages, 39-bit VAs, pgdp=000882fea000
[0435] pgd=, p4d=, 
pud=
Internal error: Oops: 9605 [#1] PREEMPT_RT SMP
Modules linked in: 8021q pfeng(O) s32cc_adc llce_core ci_hdrc_imx usbmisc_imx 
flexcan firmware_class industrialio_triggered_buffer i2c_imx kfifo_buf 
pwm_fsl_ftm sch_fq_codel openvswitch nsh nf_conncount nf_nat nf_conntrack 
nf_defrag_ipv6 nf_defrag_ipv4 fuse
CPU: 5 PID: 375 Comm: dhcpcd Tainted: G   O   
6.1.62-rt10-yocto-preempt-rt #66
Hardware name: Freescale S32G399A (DT)
pstate: 6005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __stmmac_open+0x374/0x418
lr : __stmmac_open+0x370/0x418
sp : ffc00c633a50
x29: ffc00c633a50 x28: 1043 x27: ff8800371e00
x26:  x25: 000a x24: ff8802eec240
x23: ff8800d8dc10 x22: ff8800cae000 x21: 
x20: ff88026c8000 x19: ff88026c89c0 x18: 0020
x17:  x16:  x15: ff8802eec6d8
x14: 0001 x13: ffc0094cfefa x12: ffc0094cfef6
x11: 0040 x10: 000a x9 : ffc0080a5414
x8 : 000a x7 : 647968703d3d3d3d x6 : 
x5 : ff885bfb6ae0 x4 :  x3 : 0027
x2 :  x1 :  x0 : 0018
Call trace:
 __stmmac_open+0x374/0x418
 stmmac_open+0x48/0xa0
 __dev_open+0x10c/0x1c8
 __dev_change_flags+0x174/0x1d0
 dev_change_flags+0x2c/0x70
 devinet_ioctl+0x664/0x738
 inet_ioctl+0x1e4/0x1f8
 sock_do_ioctl+0x50/0x100
 sock_ioctl+0x234/0x358
 __arm64_sys_ioctl+0xb0/0xf8
 invoke_syscall+0x58/0x120
 el0_svc_common.constprop.0+0x4c/0xf8
 do_el0_svc+0x34/0xc0
 el0_svc+0x2c/0x88
 el0t_64_sync_handler+0xb8/0xc0
 el0t_64_sync+0x18c/0x190
Code: b0003440 910f6000 940f8975 f9448a81 (3950d420)

Signed-off-by: Quanyang Wang 
---
Hi Bruce,
Would you please help merge this patch to the branches:
v5.15/standard/preempt-rt/nxp-sdk-5.15/nxp-s32g
v5.15/standard/nxp-sdk-5.15/nxp-s32g
Thanks,
Quanyang
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c 
b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 1816b87020be3..b9c06e17cf1bf 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3840,7 +3840,8 @@ static int stmmac_open(struct net_device *dev)
stmmac_enable_all_dma_irq(priv);
 
/* Indicate that the MAC is responsible for PHY PM */
-   dev->phydev->mac_managed_pm = true;
+   if (dev->phydev)
+   dev->phydev->mac_managed_pm = true;
 
return 0;
 
-- 
2.36.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#13422): 
https://lists.yoctoproject.org/g/linux-yocto/message/13422
Mute This Topic: https://lists.yoctoproject.org/mt/103143892/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-