lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d10aa31f1258aa2975e3837acb09f26265da91eb.camel@microchip.com>
Date:   Wed, 4 Aug 2021 19:58:15 +0530
From:   Prasanna Vengateshan <prasanna.vengateshan@...rochip.com>
To:     Vladimir Oltean <olteanv@...il.com>,
        "Russell King (Oracle)" <linux@...linux.org.uk>
CC:     Andrew Lunn <andrew@...n.ch>, <netdev@...r.kernel.org>,
        <robh+dt@...nel.org>, <UNGLinuxDriver@...rochip.com>,
        <Woojung.Huh@...rochip.com>, <hkallweit1@...il.com>,
        <davem@...emloft.net>, <kuba@...nel.org>,
        <linux-kernel@...r.kernel.org>, <vivien.didelot@...il.com>,
        <f.fainelli@...il.com>, <devicetree@...r.kernel.org>
Subject: Re: [PATCH v3 net-next 05/10] net: dsa: microchip: add DSA support
 for microchip lan937x

On Wed, 2021-08-04 at 13:46 +0300, Vladimir Oltean wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
> 
> The problem is that I have no clear migration path for the drivers I
> maintain, like sja1105, and I suspect that others might be in the exact
> same situation.
> 
> Currently, if the sja1105 needs to add internal delays in a MAC-to-MAC
> (fixed-link) setup, it does that based on the phy-mode string. So
> "rgmii-id" + "fixed-link" means for sja1105 "add RX and TX RGMII
> internal delays", even though the documentation now says "the MAC should
> not add the RX or TX delays in this case".
> 
> There are 2 cases to think about, old driver with new DT blob and new
> driver with old DT blob. If breakage is involved, I am not actually very
> interested in doing the migration, because even though the interpretation
> of the phy-mode string is inconsistent between the phy-handle and fixed-link
> case (which was deliberate), at least it currently does all that I need it to.
> 
> I am not even clear what is the expected canonical behavior for a MAC
> driver. It parses rx-internal-delay-ps and tx-internal-delay-ps, and
> then what? It treats all "rgmii*" phy-mode strings identically? Or is it
> an error to have "rgmii-rxid" for phy-mode and non-zero rx-internal-delay-ps?
> If it is an error, should all MAC drivers check for it? And if it is an
> error, does it not make migration even more difficult (adding an
> rx-internal-delay-ps property to a MAC OF node which already uses
> "rgmii-id" would be preferable to also having to change the "rgmii-id"
> to "rgmii", because an old kernel might also need to work with that DT
> blob, and that will ignore the new rx-internal-delay-ps property).


Considering the PHY is responsible to add internal delays w.r.to phy-mode, "*-
tx-internal-delay-ps" approach that i was applying to different connections as
shown below by bringing up different examples.

1) Fixed-link MAC-MAC: 
       port@4 {
            .....
            phy-mode = "rgmii";
            rx-internal-delay-ps = <xxx>;
            tx-internal-delay-ps = <xxx>;
            ethernet = <&ethernet>;
            fixed-link {
           	......
            };
          };

2) Fixed-link MAC-Unknown:
        port@5 {
            ......
            phy-mode = "rgmii-id";
            rx-internal-delay-ps = <xxx>;
            tx-internal-delay-ps = <xxx>;
            fixed-link {
           .	....
            };
          };

3) Fixed-link :
        port@5 {
            ......
            phy-mode = "rgmii-id";
            fixed-link {
              .....
            };
          };

>From above examples,
	a) MAC node is responsible to add RGMII delay by parsing "*-internal-
delay-ps" for (1) & (2). Its a known item in this discussion.
	b) Is rgmii-* to be ignored by the MAC in (2) and just apply the delays
from MAC side? Because if its forced to have "rgmii", would it become just -
>interface=*_MODE_RGMII and affects legacy?
	c) if MAC follows standard delay, then it needs to be validated against
"*-internal-delay-ps", may be validating against single value and throw an
error. Might be okay.
	d) For 3), Neither MAC nor other side will apply delays. Expected.


3) MAC-PHY

	i) &test3 {
		phy-handle = <&phy0>;
		phy-mode = "rgmii-id";
		phy0: ethernet-phy@xx {
			.....
			rx-internal-delay = <xxx>;
			tx-internal-delay = <xxx>;
		};
	  };

	ii) &test4 {
		phy-handle = <&phy0>;
		phy-mode = "rgmii";
        	rx-internal-delay-ps = <xxx>;
        	tx-internal-delay-ps = <xxx>;
		phy0: ethernet-phy@xx {
			reg = <x>;
	        };
	     };


For 3(i), I assume phy would apply internal delay values by checking its phydev-
>interface.
For 3(ii), MAC would apply the delays.

Overall, only (b) need a right decision? or any other items are missed?


Prasanna V

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ