lantiq: ltq-atm/ltq-ptm: fix showtime handling on driver load
authorMartin Schiller <ms@dev.tdt.de>
Thu, 29 Jun 2017 04:54:00 +0000 (06:54 +0200)
committerMathias Kresin <dev@kresin.me>
Sun, 6 Aug 2017 07:22:03 +0000 (09:22 +0200)
This is needed to be able to load the ltq-atm/ltq-ptm driver
from a notify script during synchronization, because the line can
reach showtime state before the driver is fully loaded.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
package/kernel/lantiq/ltq-atm/src/ltq_atm.c
package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c
package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c

index 1208dd87dd1ec2983e6bc78d4819b5aea6e29481..a08fa22ce24a602d3e15e06eb5ae2688eb5c4975 100644 (file)
@@ -1866,15 +1866,11 @@ static int ltq_atm_probe(struct platform_device *pdev)
        port_cell.port_num = ATM_PORT_NUMBER;
        ifx_mei_atm_showtime_check(&g_showtime, &port_cell, &g_xdata_addr);
        if ( g_showtime ) {
-               for ( i = 0; i < ATM_PORT_NUMBER; i++ )
-                       if ( port_cell.tx_link_rate[i] != 0 )
-                               break;
-               for ( j = 0; j < ATM_PORT_NUMBER; j++ )
-                       g_atm_priv_data.port[j].tx_max_cell_rate =
-                               port_cell.tx_link_rate[j] != 0 ? port_cell.tx_link_rate[j] : port_cell.tx_link_rate[i];
+               atm_showtime_enter(&port_cell, &g_xdata_addr);
+       } else {
+               qsb_global_set();
        }
 
-       qsb_global_set();
        validate_oam_htu_entry();
 
        ifx_mei_atm_showtime_enter = atm_showtime_enter;
index 00a967b34b39d934c99a8a436a8b03ec1c851861..4ce2e90ccdf87b43fd7b7bd01fd08fb7e7e7e564 100644 (file)
@@ -1518,6 +1518,9 @@ static int ifx_ptm_init(void)
 
     port_cell.port_num = 1;
     ifx_mei_atm_showtime_check(&g_showtime, &port_cell, &xdata_addr);
+    if ( g_showtime ) {
+       ptm_showtime_enter(&port_cell, &g_xdata_addr);
+    }
 
     ifx_mei_atm_showtime_enter = ptm_showtime_enter;
     ifx_mei_atm_showtime_exit  = ptm_showtime_exit;
index 0a357f1742bfb2a0ab2ff55767ac2cac85fa28a2..22f1e23c4a4b2901259d357dd2cca81875996b91 100644 (file)
@@ -1022,7 +1022,10 @@ static int ifx_ptm_init(void)
     enable_irq(PPE_MAILBOX_IGU1_INT);
 
     ifx_mei_atm_showtime_check(&g_showtime, &port_cell, &g_xdata_addr);
-    
+    if ( g_showtime ) {
+       ptm_showtime_enter(&port_cell, &g_xdata_addr);
+    }
+
     ifx_mei_atm_showtime_enter = ptm_showtime_enter;
     ifx_mei_atm_showtime_exit  = ptm_showtime_exit;