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] [day] [month] [year] [list]
Message-ID: <57bf2b79-59ba-4c15-add3-e7029c0b20f4@cogentembedded.com>
Date:   Mon, 15 Apr 2019 20:10:46 +0300
From:   Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:     Simon Horman <horms@...ge.net.au>
Cc:     Andrew Lunn <andrew@...n.ch>, David Miller <davem@...emloft.net>,
        Magnus Damm <magnus.damm@...il.com>, netdev@...r.kernel.org,
        linux-renesas-soc@...r.kernel.org,
        Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
        Wolfram Sang <wsa+renesas@...g-engineering.com>
Subject: Re: [PATCH v2 net-next] ravb: Avoid unsupported internal delay mode
 for R-Car E3/D3

On 04/15/2019 02:45 PM, Simon Horman wrote:

>>>>>>>> According to the R-Car Gen3 Hardware Manual Rev 1.50 of Nov 30, 2018, the
>>>>>>>> TX clock internal delay mode isn't supported on R-Car E3 (r8a77990) or D3
>>>>>>>> (r8a77995). And by extension it is also not supported by RZ/G2E (r9a774c0).
>>>>>>>>
>>>>>>>> This matches all ES versions of the affected SoCs as it is
>>>>>>>> not clear if this problem will be resolved in newer chips.
>>>>>>>> This can be revisited, as necessary.
>>>>>>>>
>>>>>>>> This patch does not error-out if PHY_INTERFACE_MODE_RGMII_ID or
>>>>>>>> PHY_INTERFACE_MODE_RGMII_TXID are used on SoCs where TX clock delay
>>>>>>>> mode is not supported as there is a risk of introducing a regression
>>>>>>>> when used in conjunction with older DT blobs present in the field.
>>>>>>>
>>>>>>> Hi Simon
>>>>>>>
>>>>>>> I think it should at least WARN_ON(). Such blobs are broken, even if
>>>>>>> they do kind of work.
>>>>>>
>>>>>>    Good idea! Simon, third time's a charm? :-)
>>>>>
>>>>> Sure, can do.
>>>>
>>>> How about something like this?
>>>>
>>>> --- a/drivers/net/ethernet/renesas/ravb_main.c
>>>> +++ b/drivers/net/ethernet/renesas/ravb_main.c
>>>> @@ -1980,8 +1987,14 @@ static void ravb_set_delay_mode(struct net_device *ndev)
>>>>  		set |= APSR_DM_RDM;
>>>>  
>>>>  	if (priv->phy_interface == PHY_INTERFACE_MODE_RGMII_ID ||
>>>> -	    priv->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID)
>>>> -		set |= APSR_DM_TDM;
>>>> +	    priv->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) {
>>>> +		if (soc_device_match(ravb_delay_mode_quirk_match))
>>>> +			dev_warn(ndev->dev.parent,
>>>> +				 "phy-mode %s requires TX clock internal delay mode which is not supported by this hardwre revision",
>>>> +				 phy_modes(priv->phy_interface));
>>>
>>> Hi Simon
>>>
>>> The point of the warning is to tell users they should upgrade their DT
>>> blob to one that is not broken. So i think the message should say
>>> this. Also, we want users to notice this, which is why i said
>>> WARN_ON(). Something big so it gets noticed.
>>
>>    I agree in general but I guess you meant WARN() -- WARN_ON() doesn't take
>> a string arg...
> 
> Thanks, how about this?
> 
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index 4f648394e645..9618c4881c83 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -1980,8 +1987,12 @@ static void ravb_set_delay_mode(struct net_device *ndev)
>  		set |= APSR_DM_RDM;
>  
>  	if (priv->phy_interface == PHY_INTERFACE_MODE_RGMII_ID ||
> -	    priv->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID)
> -		set |= APSR_DM_TDM;
> +	    priv->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) {
> +		if (!WARN(soc_device_match(ravb_delay_mode_quirk_match),
> +			  "phy-mode %s requires TX clock internal delay mode which is not supported by this hardware revision. Please update device tree",
> +			  phy_modes(priv->phy_interface)))
> +			set |= APSR_DM_TDM;
> +	}
>  
>  	ravb_modify(ndev, APSR, APSR_DM, set);
>  }

   Looks fine, thanx! :-)

MBR, Sergei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ