<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>39714</bug_id>
          
          <creation_ts>2021-02-22 13:04:02 +0300</creation_ts>
          <short_desc>Байкал-М: сетевые интерфейсы неработоспособны (прошивка из SDK-M 5.1)</short_desc>
          <delta_ts>2021-04-26 12:03:58 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>kernel-image-std-def</component>
          <version>unstable</version>
          <rep_platform>aarch64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexey Sheplyakov">asheplyakov</reporter>
          <assigned_to name="Alexey Sheplyakov">asheplyakov</assigned_to>
          <cc>aen</cc>
    
    <cc>iv</cc>
    
    <cc>kernelbot</cc>
    
    <cc>placeholder</cc>
    
    <cc>vt</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>196427</commentid>
    <comment_count>0</comment_count>
    <who name="Alexey Sheplyakov">asheplyakov</who>
    <bug_when>2021-02-22 13:04:02 +0300</bug_when>
    <thetext># ip -o link 
1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000\    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: &lt;BROADCAST,MULTICAST&gt; mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000\    link/ether 4c:a5:15:40:00:b4 brd ff:ff:ff:ff:ff:ff
3: eth1: &lt;BROADCAST,MULTICAST&gt; mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000\    link/ether 4c:a5:15:40:00:b5 brd ff:ff:ff:ff:ff:ff

В момент, когда NetworkManager пытается поднять интерфейсы, ядро ругается:

[  322.951355] baikal-dwmac 30250000.eth1 eth1: no phy at addr -1
[  322.957229] baikal-dwmac 30250000.eth1 eth1: stmmac_open: Cannot attach to PHY (error: -19)
[  323.678463] baikal-dwmac 30240000.eth0 eth0: no phy at addr -1
[  323.684338] baikal-dwmac 30240000.eth0 eth0: stmmac_open: Cannot attach to PHY (error: -19)
[  324.332557] baikal-dwmac 30250000.eth1 eth1: no phy at addr -1
[  324.338435] baikal-dwmac 30250000.eth1 eth1: stmmac_open: Cannot attach to PHY (error: -19)
[  325.047651] baikal-dwmac 30240000.eth0 eth0: no phy at addr -1
[  325.053531] baikal-dwmac 30240000.eth0 eth0: stmmac_open: Cannot attach to PHY (error: -19)
[  325.700741] baikal-dwmac 30250000.eth1 eth1: no phy at addr -1
[  325.706621] baikal-dwmac 30250000.eth1 eth1: stmmac_open: Cannot attach to PHY (error: -19)
[  326.419960] baikal-dwmac 30240000.eth0 eth0: no phy at addr -1
[  326.425836] baikal-dwmac 30240000.eth0 eth0: stmmac_open: Cannot attach to PHY (error: -19)
[  327.073932] baikal-dwmac 30250000.eth1 eth1: no phy at addr -1
[  327.079809] baikal-dwmac 30250000.eth1 eth1: stmmac_open: Cannot attach to PHY (error: -19)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>196435</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Sheplyakov">asheplyakov</who>
    <bug_when>2021-02-23 17:39:15 +0300</bug_when>
    <thetext>Та же проблема наблюдается с ядром 5.10.17.
Только оно более толково ругается:

[   16.930217] Micrel KSZ9031 Gigabit PHY stmmac-1:03: phy_poll_reset failed: -110
[   16.937708] baikal-dwmac 30240000.eth0 eth0: no phy at addr -1
[   16.943575] baikal-dwmac 30240000.eth0 eth0: stmmac_open: Cannot attach to PHY (error: -19)
[   17.596114] Micrel KSZ9031 Gigabit PHY stmmac-2:03: phy_poll_reset failed: -110
[   17.603602] baikal-dwmac 30250000.eth1 eth1: no phy at addr -1
[   17.609468] baikal-dwmac 30250000.eth1 eth1: stmmac_open: Cannot attach to PHY (error: -19)
[   18.245793] Micrel KSZ9031 Gigabit PHY stmmac-1:03: phy_poll_reset failed: -110
[   18.253293] baikal-dwmac 30240000.eth0 eth0: no phy at addr -1
[   18.259163] baikal-dwmac 30240000.eth0 eth0: stmmac_open: Cannot attach to PHY (error: -19)
[   18.884032] Micrel KSZ9031 Gigabit PHY stmmac-2:03: phy_poll_reset failed: -110
[   18.891528] baikal-dwmac 30250000.eth1 eth1: no phy at addr -1
[   18.897397] baikal-dwmac 30250000.eth1 eth1: stmmac_open: Cannot attach to PHY (error: -19)
[   19.572000] Micrel KSZ9031 Gigabit PHY stmmac-1:03: phy_poll_reset failed: -110
[   19.579485] baikal-dwmac 30240000.eth0 eth0: no phy at addr -1
[   19.585353] baikal-dwmac 30240000.eth0 eth0: stmmac_open: Cannot attach to PHY (error: -19)
[   20.227617] Micrel KSZ9031 Gigabit PHY stmmac-2:03: phy_poll_reset failed: -110
[   20.235105] baikal-dwmac 30250000.eth1 eth1: no phy at addr -1
[   20.240980] baikal-dwmac 30250000.eth1 eth1: stmmac_open: Cannot attach to PHY (error: -19)
[   20.918167] Micrel KSZ9031 Gigabit PHY stmmac-1:03: phy_poll_reset failed: -110
[   20.925671] baikal-dwmac 30240000.eth0 eth0: no phy at addr -1
[   20.931571] baikal-dwmac 30240000.eth0 eth0: stmmac_open: Cannot attach to PHY (error: -19)
[   21.573394] Micrel KSZ9031 Gigabit PHY stmmac-2:03: phy_poll_reset failed: -110
[   21.580879] baikal-dwmac 30250000.eth1 eth1: no phy at addr -1
[   21.586750] baikal-dwmac 30250000.eth1 eth1: stmmac_open: Cannot attach to PHY (error: -19)
[   22.254807] Micrel KSZ9031 Gigabit PHY stmmac-1:03: phy_poll_reset failed: -110
[   22.262294] baikal-dwmac 30240000.eth0 eth0: no phy at addr -1
[   22.268162] baikal-dwmac 30240000.eth0 eth0: stmmac_open: Cannot attach to PHY (error: -19)
[   22.893576] Micrel KSZ9031 Gigabit PHY stmmac-2:03: phy_poll_reset failed: -110
[   22.901074] baikal-dwmac 30250000.eth1 eth1: no phy at addr -1
[   22.906941] baikal-dwmac 30250000.eth1 eth1: stmmac_open: Cannot attach to PHY (error: -19)

Если добавить в blacklist micrel, то интерфейсы успешно поднимаются с generic PHY:

echo &apos;blacklist micrel&apos; | sudo tee /etc/modprobe.d/micrel_disable.conf

sudo rmmod dwmac_baikal
sudo rmmod dwmac_generic
sudo modprobe dwmac_baikal

  227.019142] baikal-dwmac 30240000.eth0: IRQ eth_wake_irq not found
[  227.025359] baikal-dwmac 30240000.eth0: IRQ eth_lpi not found
[  227.031222] baikal-dwmac 30240000.eth0: PTP uses main clock
[  227.036830] baikal-dwmac 30240000.eth0: no reset control found
[  227.042698] baikal-dwmac 30240000.eth0: Baikal Electronics DWMAC glue driver
[  227.049987] baikal-dwmac 30240000.eth0: User ID: 0x10, Synopsys ID: 0x37
[  227.056718] baikal-dwmac 30240000.eth0:      DWMAC1000
[  227.061535] baikal-dwmac 30240000.eth0: DMA HW capability register supported
[  227.068608] baikal-dwmac 30240000.eth0: RX Checksum Offload Engine supported
[  227.075680] baikal-dwmac 30240000.eth0: COE Type 2
[  227.080492] baikal-dwmac 30240000.eth0: TX Checksum insertion supported
[  227.087131] baikal-dwmac 30240000.eth0: Wake-Up On Lan supported
[  227.093160] baikal-dwmac 30240000.eth0: Enhanced/Alternate descriptors
[  227.099711] baikal-dwmac 30240000.eth0: Enabled extended descriptors
[  227.106087] baikal-dwmac 30240000.eth0: Ring mode enabled
[  227.111508] baikal-dwmac 30240000.eth0: Enable RX Mitigation via HW Watchdog Timer
[  227.134831] libphy: stmmac: probed
[  227.143571] baikal-dwmac 30250000.eth1: IRQ eth_wake_irq not found
[  227.149790] baikal-dwmac 30250000.eth1: IRQ eth_lpi not found
[  227.155661] baikal-dwmac 30250000.eth1: PTP uses main clock
[  227.161265] baikal-dwmac 30250000.eth1: no reset control found
[  227.166521] baikal-dwmac 30240000.eth0 eth0: PHY [stmmac-1:03] driver [Generic PHY] (irq=POLL)
[  227.167128] baikal-dwmac 30250000.eth1: Baikal Electronics DWMAC glue driver
[  227.167695] baikal-dwmac 30250000.eth1: User ID: 0x10, Synopsys ID: 0x37
[  227.189594] baikal-dwmac 30250000.eth1:      DWMAC1000
[  227.194415] baikal-dwmac 30250000.eth1: DMA HW capability register supported
[  227.201496] baikal-dwmac 30250000.eth1: RX Checksum Offload Engine supported
[  227.208572] baikal-dwmac 30250000.eth1: COE Type 2
[  227.213384] baikal-dwmac 30250000.eth1: TX Checksum insertion supported
[  227.220022] baikal-dwmac 30250000.eth1: Wake-Up On Lan supported
[  227.226055] baikal-dwmac 30250000.eth1: Enhanced/Alternate descriptors
[  227.232605] baikal-dwmac 30250000.eth1: Enabled extended descriptors
[  227.238982] baikal-dwmac 30250000.eth1: Ring mode enabled
[  227.244405] baikal-dwmac 30250000.eth1: Enable RX Mitigation via HW Watchdog Timer
[  227.252993] PHY re-inited for Baikal DWMAC
[  227.267855] libphy: stmmac: probed
[  227.286873] baikal-dwmac 30240000.eth0 eth0: No Safety Features support found
[  227.294058] baikal-dwmac 30240000.eth0 eth0: No MAC Management Counters available
[  227.301569] baikal-dwmac 30240000.eth0 eth0: IEEE 1588-2008 Advanced Timestamp supported
[  227.309878] baikal-dwmac 30240000.eth0 eth0: registered PTP clock
[  227.316350] baikal-dwmac 30240000.eth0 eth0: configuring for phy/rgmii-id link mode
[  227.384914] baikal-dwmac 30250000.eth1 eth1: PHY [stmmac-2:03] driver [Generic PHY] (irq=POLL)
[  227.398091] PHY re-inited for Baikal DWMAC
[  227.415515] NET: Registered protocol family 17
[  227.431900] baikal-dwmac 30250000.eth1 eth1: No Safety Features support found
[  227.439109] baikal-dwmac 30250000.eth1 eth1: No MAC Management Counters available
[  227.446633] baikal-dwmac 30250000.eth1 eth1: IEEE 1588-2008 Advanced Timestamp supported
[  227.454979] baikal-dwmac 30250000.eth1 eth1: registered PTP clock
[  227.461438] baikal-dwmac 30250000.eth1 eth1: configuring for phy/rgmii-id link mode
[  230.395154] baikal-dwmac 30240000.eth0: fix_mac_speed new speed 1000
[  230.401542] baikal-dwmac 30240000.eth0: setting TX2 clock frequency to 250000000
[  230.411617] baikal-dwmac 30240000.eth0 eth0: Link is Up - 1Gbps/Full - flow control off
[  230.419677] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

Но судя по device tree, должен быть именно micrel:

                       gmdio0: gmac0_mdio {
                                compatible = &quot;snps,dwmac-mdio&quot;;
                                #address-cells = &lt;1&gt;;
                                #size-cells = &lt;0&gt;;

                                gmac0_phy: ethernet-phy@3 {
                                        compatible = &quot;micrel,ksz9031&quot;, &quot;ethernet-phy-id0022.1620&quot;, &quot;ethernet-phy-ieee802.3-c22&quot;;
                                        reg = &lt;0x3&gt;;

                                txd0-skew-ps = &lt;0&gt;;
                                txd1-skew-ps = &lt;0&gt;;
                                txd2-skew-ps = &lt;0&gt;;
                                txd3-skew-ps = &lt;0&gt;;
                                txc-skew-ps  = &lt;0xff&gt;;
                                };
                        };</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>196436</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Sheplyakov">asheplyakov</who>
    <bug_when>2021-02-23 18:00:28 +0300</bug_when>
    <thetext>&quot;родное&quot; ядро из SDK-M 5.1 также не может завести Ethernet, ровно с такими же ошибками</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>196439</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Sheplyakov">asheplyakov</who>
    <bug_when>2021-02-23 18:18:03 +0300</bug_when>
    <thetext>Возможная причина (но это не точно):

[    3.044974] of_get_named_gpiod_flags: parsed &apos;reset-gpios&apos; property of node &apos;/soc/pcie@2220000[0]&apos; - status (0)
[    4.979660] of_get_named_gpiod_flags: can&apos;t parse &apos;reset-gpios&apos; property of node &apos;/soc/eth0@30240000/gmac0_mdio[0]&apos;
[    4.990156] of_get_named_gpiod_flags: can&apos;t parse &apos;reset-gpio&apos; property of node &apos;/soc/eth0@30240000/gmac0_mdio[0]&apos;
[    5.026236] of_get_named_gpiod_flags: can&apos;t parse &apos;snps,reset-gpios&apos; property of node &apos;/soc/eth0@30240000[0]&apos;
[    5.036209] of_get_named_gpiod_flags: can&apos;t parse &apos;snps,reset-gpio&apos; property of node &apos;/soc/eth0@30240000[0]&apos;
[    5.092791] of_get_named_gpiod_flags: can&apos;t parse &apos;reset-gpios&apos; property of node &apos;/soc/eth0@30240000/gmac0_mdio/ethernet-phy@3[0]&apos;
[    5.104585] of_get_named_gpiod_flags: can&apos;t parse &apos;reset-gpio&apos; property of node &apos;/soc/eth0@30240000/gmac0_mdio/ethernet-phy@3[0]&apos;
[    5.234831] of_get_named_gpiod_flags: can&apos;t parse &apos;reset-gpios&apos; property of node &apos;/soc/eth1@30250000/gmac1_mdio[0]&apos;
[    5.248219] of_get_named_gpiod_flags: can&apos;t parse &apos;reset-gpio&apos; property of node &apos;/soc/eth1@30250000/gmac1_mdio[0]&apos;
[    5.278226] of_get_named_gpiod_flags: can&apos;t parse &apos;snps,reset-gpios&apos; property of node &apos;/soc/eth1@30250000[0]&apos;
[    5.292959] of_get_named_gpiod_flags: can&apos;t parse &apos;snps,reset-gpio&apos; property of node &apos;/soc/eth1@30250000[0]&apos;
[    5.417730] of_get_named_gpiod_flags: can&apos;t parse &apos;reset-gpios&apos; property of node &apos;/soc/eth1@30250000/gmac1_mdio/ethernet-phy@3[0]&apos;
[    5.429525] of_get_named_gpiod_flags: can&apos;t parse &apos;reset-gpio&apos; property of node &apos;/soc/eth1@30250000/gmac1_mdio/ethernet-phy@3[0]&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>196440</commentid>
    <comment_count>4</comment_count>
    <who name="Dmitry V. Levin">ldv</who>
    <bug_when>2021-02-23 19:35:16 +0300</bug_when>
    <thetext>А почему Component: kernel-image-std-def?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>196448</commentid>
    <comment_count>5</comment_count>
    <who name="Anton V. Boyarshinov">boyarsh</who>
    <bug_when>2021-02-24 10:15:18 +0300</bug_when>
    <thetext>(Ответ для Alexey Sheplyakov на комментарий #2)
&gt; &quot;родное&quot; ядро из SDK-M 5.1 также не может завести Ethernet, ровно с такими
&gt; же ошибками

Какая... красота...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>196449</commentid>
    <comment_count>6</comment_count>
    <who name="Anton V. Boyarshinov">boyarsh</who>
    <bug_when>2021-02-24 10:17:07 +0300</bug_when>
    <thetext>(Ответ для Dmitry V. Levin на комментарий #4)
&gt; А почему Component: kernel-image-std-def?

Потому, что проблема наблюдается именно при использовании kernel-image-std-def из Сизифа. То есть понятно, что проблема внесена новой прошивкой Байкала, но на них, увы, можно повесить сколько угодно собак -- результат бывает далеко не всегда и всегда долго...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>196622</commentid>
    <comment_count>7</comment_count>
    <who name="Alexey Sheplyakov">asheplyakov</who>
    <bug_when>2021-03-01 16:42:46 +0300</bug_when>
    <thetext>Патч: http://git.altlinux.org/people/asheplyakov/packages/linux.git?p=linux.git;a=patch;h=db2dd662880e9951352754636f71dcee4b50e122</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>196623</commentid>
    <comment_count>8</comment_count>
    <who name="Alexey Sheplyakov">asheplyakov</who>
    <bug_when>2021-03-01 16:56:19 +0300</bug_when>
    <thetext>(In reply to Anton V. Boyarshinov from comment #6)
&gt; (Ответ для Dmitry V. Levin на комментарий #4)
&gt; &gt; А почему Component: kernel-image-std-def?
&gt; 
&gt; Потому, что проблема наблюдается именно при использовании
&gt; kernel-image-std-def из Сизифа. То есть понятно, что проблема внесена новой
&gt; прошивкой Байкала,

Нет. Проблема не зависит от версии прошивки. Я не вполне разобрался в особенностях байкаловского dwmac. И баг в драйвере был всегда. Я тестировал драйвер только с generic PHY. А байкаловцы взяли &quot;мой&quot; драйвер для 5.4 без изменений.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>196649</commentid>
    <comment_count>9</comment_count>
    <who name="Alexey Sheplyakov">asheplyakov</who>
    <bug_when>2021-03-02 17:01:56 +0300</bug_when>
    <thetext>Исправлено в kernel-image-std-def 5.4.101-alt1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>198120</commentid>
    <comment_count>10</comment_count>
    <who name="Alexey Sheplyakov">asheplyakov</who>
    <bug_when>2021-04-26 12:03:58 +0300</bug_when>
    <thetext>Исправлено в kernel-image-std-def 5.4.101-alt1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>