From: Marek Vasut Date: Mon, 21 Sep 2020 18:26:34 +0200 Subject: [PATCH] net: ravb: Fix NULL pointer access In-Reply-To: References: <20200915141038.3371-1-biju.das.jz@bp.renesas.com> <0ae44ba9-0781-906d-537e-f1e115ccd903@gmail.com> <94436429-6470-c1b7-6b5e-a096f4b37472@gmail.com> <684dc047-8b62-942f-33f1-cd2626d99fb7@gmail.com> <442b1e73-6c7d-47bd-f58d-377e7a091c11@gmail.com> Message-ID: <432b8394-d1e5-9b68-03a9-1e26bce18ac7@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 9/20/20 9:34 AM, Biju Das wrote: Hi, [...] >>> if we remove writephyext, by looking the code at [1], rxc-skew-ps will be >> taken from the device tree[3] and "txc-skew-pc" will be the default >> value(0xf). >>> [3]https://elixir.bootlin.com/u-boot/v2020.10-rc4/source/arch/arm/dts/ >>> salvator-common.dtsi#L331 >> >> So you want to check whether each RCar3 DT contains a PHY node and that >> PHY node has rxc-skew-ps and txc-skew-ps , which combined then results >> into a register value (0xf << 5) | (0x19 << 0) . > > rxc-skew-ps set in DTS is 1500. 1 step is 60 ps, so 1500/60 = 25 which is 0x19 and this value will be overridden and stored in ofcfg->grp's val[0]. OK, good, thanks. >>> I will check this and let you know the results after checking on RCar board. >> Unfortunately currently I don't have RCar board. >> >> It's enough to just check the DTs and verify that they set the matching >> correct values of rxc-skew-ps/txc-skew-ps . I can test it on the real hardware. > > Yes, that way we can make sure the mapping operation is correct for this phy. 1500 in dts after mapping operation should override > ofcfg->grp's val[0] with 0x19. > >> If you want, you can add the txc-skew-ps into the Linux R-Car3 DTs too. > > We don't need to set txc-skew-ps in dts, since it is same as default value and is filled in ofcfg->grp's val[1]. > We can avoid unnecessary mapping operations by not specifying in device tree, for default values. Hopefully the default setting will not change in some new revision of the PHY then.