From d3f288beda3b6faaf73fee268da4338a17b1a0b8 Mon Sep 17 00:00:00 2001 From: Venkatesh Yadav Abbarapu Date: Tue, 20 Apr 2021 21:25:20 -0600 Subject: [PATCH] vid_phy_ctrl: Fix the logic for num of vphy lanes This patch fixes the logic for number of video phy lane port nodes. When the number of video phy lanes is greater than 4, the driver assertion fails. root@xilinx-zcu102-2020_2:~# modprobe phy-xilinx-vphy [ 26.669408] kernel BUG at /usr/src/debug/kernel-module-dp/5.4.0-r0/git/dp/phy-vphy.c:1104! [ 26.677686] Internal error: Oops - BUG: 0 [#1] SMP [ 26.682485] Modules linked in: phy_xilinx_vphy(O+) dmaproxy(O) [ 26.688339] CPU: 2 PID: 841 Comm: modprobe Tainted: G O 5.4.0-xilinx-v2020.2 #1 [ 26.696954] Hardware name: ZynqMP ZCU102 Rev1.0 (DT) [ 26.701148] pstate: 60000005 (nZCv daif -PAN -UAO) [ 26.705969] pc : xvphy_probe+0x410/0x944 [phy_xilinx_vphy] [ 26.711483] lr : xvphy_probe+0x3f8/0x944 [phy_xilinx_vphy] [ 26.716979] sp : ffff8000117638d0 [ 26.720303] x29: ffff8000117638d0 x28: 00000000ffffffff [ 26.725623] x27: ffff800008a595a0 x26: ffff00007faf0cd0 [ 26.730944] x25: 0000000000000004 x24: ffff00007c850fc0 [ 26.736267] x23: ffff00007d2ae800 x22: ffff000079eb50c8 [ 26.741588] x21: ffff00007d2ae810 x20: ffff800008a59ab8 [ 26.746908] x19: ffff00007faf1e88 x18: 0000000000000000 [ 26.752228] x17: 0000000000000000 x16: 0000000000000000 [ 26.757548] x15: ffff00007c8513e8 x14: 2f30303030353130 [ 26.762871] x13: 0000000000000040 x12: 0000000000000228 [ 26.768192] x11: 0000000000000000 x10: 0000000000000000 [ 26.773512] x9 : 0000000000000000 x8 : ffff00007ab07700 [ 26.778832] x7 : 0000000000000000 x6 : 000000000000003f [ 26.784152] x5 : 0000000000000040 x4 : ffff00007d2aeaa8 [ 26.789476] x3 : ffff00007ab07680 x2 : 0000000000000000 [ 26.794796] x1 : ffff00007ab07700 x0 : ffff00007ab07680 [ 26.800116] Call trace: [ 26.802590] xvphy_probe+0x410/0x944 [phy_xilinx_vphy] [ 26.807743] platform_drv_probe+0x50/0xa0 [ 26.811769] really_probe+0xd8/0x2f8 [ 26.815353] driver_probe_device+0x54/0xe8 [ 26.819457] device_driver_attach+0x6c/0x78 [ 26.823650] __driver_attach+0x54/0xd0 [ 26.827409] bus_for_each_dev+0x6c/0xc0 [ 26.831253] driver_attach+0x20/0x28 [ 26.834840] bus_add_driver+0x148/0x1e0 [ 26.838684] driver_register+0x60/0x110 [ 26.842530] __platform_driver_register+0x44/0x50 [ 26.847256] xvphy_driver_init+0x20/0x1000 [phy_xilinx_vphy] [ 26.852929] do_one_initcall+0x50/0x190 [ 26.856775] do_init_module+0x50/0x1f0 [ 26.860532] load_module+0x1ca4/0x2218 [ 26.864290] __do_sys_finit_module+0xd0/0xe8 [ 26.868570] __arm64_sys_finit_module+0x1c/0x28 [ 26.873110] el0_svc_common.constprop.0+0x68/0x160 [ 26.877911] el0_svc_handler+0x6c/0x88 [ 26.881668] el0_svc+0x8/0xc [ 26.884561] Code: 39002419 7100133f b9001c1c 54fffb21 (d4210000) [ 26.890660] ---[ end trace c67f0361a9ad5e6d ]--- Signed-off-by: Sandeep Gundlupet Raju --- vid_phy_ctrl/data/vid_phy_ctrl.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vid_phy_ctrl/data/vid_phy_ctrl.tcl b/vid_phy_ctrl/data/vid_phy_ctrl.tcl index 5b1d15b..0a3fb8e 100644 --- a/vid_phy_ctrl/data/vid_phy_ctrl.tcl +++ b/vid_phy_ctrl/data/vid_phy_ctrl.tcl @@ -59,7 +59,7 @@ proc generate {drv_handle} { if {[llength $use_gt_ch4_hdmi]} { hsi::utils::add_new_dts_param "${node}" "xlnx,use-gt-ch4-hdmi" $use_gt_ch4_hdmi int } - for {set ch 0} {$ch <= $tx_no_of_channels} {incr ch} { + for {set ch 0} {$ch < $tx_no_of_channels} {incr ch} { set phy_node [add_or_get_dt_node -n "vphy_lane@$ch" -l vphy_lane$ch -p $node] hsi::utils::add_new_dts_param "$phy_node" "#phy-cells" 4 int } -- 2.17.1