[LEDE-DEV] Ethernet link up/down mt7688 board not detected by hotplug

Baptiste Clenet bapclenet at gmail.com
Tue Jul 26 03:39:45 PDT 2016


Anyone has seen same behaviour on its mt7628, mt7688 or ralink board
which uses esw_rt3052.c driver?
Thanks

2016-07-19 18:19 GMT+02:00 Baptiste Clenet <bapclenet at gmail.com>:
> Additional information:
> Board is down and ethernet unplugged.
> Board is switched on, I wait for end of boot then I plug ethernet
> cable, here; hotplug is call ACTION=ifup
> Then I unplug, no hotplug call, then I plug, no hotplug call.
> I don't understand why it is called only if I boot without ethernet
>
> 2016-07-19 15:35 GMT+02:00 Baptiste Clenet <bapclenet at gmail.com>:
>> Hi,
>>
>> I added two scripts in hotplug /etc/htoplug.d/net and /iface to check
>> when the interface eth0 is up or down or even link up/down.
>> Each time I plug the cable, Kernel driver says:
>> [ 1376.480000] rt305x-esw 10110000.esw: link changed 0x01
>> and unplug:
>> [ 1373.490000] rt305x-esw 10110000.esw: link changed 0x00
>>
>> Nevertheless, it seems that no ACTION is raised on hotplug so I can't
>> detect if eth0 is link up or down.
>> Thing is, I would like, every time I unplug the ethernet cable, that the
>> interface is set down.
>>
>> The ethernet driver for this part is the irq handler:
>> static irqreturn_t esw_interrupt(int irq, void *_esw)
>> {
>> struct rt305x_esw *esw = (struct rt305x_esw *) _esw;
>> u32 status;
>>
>> status = esw_r32(esw, RT305X_ESW_REG_ISR);
>> if (status & RT305X_ESW_PORT_ST_CHG) {
>> u32 link = esw_r32(esw, RT305X_ESW_REG_POA);
>> link >>= RT305X_ESW_POA_LINK_SHIFT;
>> link &= RT305X_ESW_POA_LINK_MASK;
>> dev_info(esw->dev, "link changed 0x%02X\n", link);
>> }
>> esw_w32(esw, status, RT305X_ESW_REG_ISR);
>>
>> return IRQ_HANDLED;
>> }
>>
>> It does not seem to send a SIGNAL to kernel for a LINK UP/DOWN. Is
>> that normal and how can I detect that ethernet is plug/unplug?
>>
>> Cheers,
>>
>> --
>> Baptiste
>
>
>
> --
> Baptiste



-- 
Baptiste



More information about the Lede-dev mailing list