From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AD5FC43381 for ; Tue, 19 Feb 2019 04:59:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4678221848 for ; Tue, 19 Feb 2019 04:59:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550552371; bh=lRL+rUw+kQXLoGbkYAiB5sO0vBv7pP6uC/jOPLIJssk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=n7Vpy5lpzXBozbTBoWLmQqP6JjW2z9lPhFXNzrt6wMROaeRS3+NdRxosEdOgzDNH6 KIhVcHrQK7hWkMivO7zKJGE0GdJPX1i6Q4vdxWoxDTqFfGby4W7kzFdEl6N0ezIzxH WtL5biiOYrQuy00J1k+kHvmJjoH3+IdTkB/ivUcc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726355AbfBSE7a (ORCPT ); Mon, 18 Feb 2019 23:59:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:54004 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbfBSE7a (ORCPT ); Mon, 18 Feb 2019 23:59:30 -0500 Received: from localhost (unknown [106.200.226.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A3F56217D9; Tue, 19 Feb 2019 04:59:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550552369; bh=lRL+rUw+kQXLoGbkYAiB5sO0vBv7pP6uC/jOPLIJssk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oYyrJa//3FHwCSo6aWh2HwMZpyvMGJsZQkLNsQBMi1slutqX34bQz4hzjfLDZLSxX 9cYPf9GLDeyP0W+JqeFHY0vM8VJybBxxn20xCU1uldXBc6zRaPVN4yCOMp5KzhxUmf ayuQb5tDy7Mtu58oCfU5G5rXRyPPFVbzmGEHG36U= Date: Tue, 19 Feb 2019 10:29:20 +0530 From: Vinod Koul To: Andrew Lunn Cc: David S Miller , linux-arm-msm@vger.kernel.org, Bjorn Andersson , netdev@vger.kernel.org, Niklas Cassel , Florian Fainelli , Michal =?utf-8?B?Vm9rw6HEjQ==?= Subject: Re: [PATCH] net: dsa: qca8k: Enable delay for RGMII_ID mode Message-ID: <20190219045920.GR21884@vkoul-mobl> References: <20190218130352.9373-1-vkoul@kernel.org> <20190218133309.GB14879@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190218133309.GB14879@lunn.ch> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Andrew, On 18-02-19, 14:33, Andrew Lunn wrote: > On Mon, Feb 18, 2019 at 06:33:51PM +0530, Vinod Koul wrote: > > RGMII_ID specifies that we should have internal delay, so resurrect the > > delay addition routine but under the RGMII_ID mode. > > > > Fixes: 40269aa9f40a ("net: dsa: qca8k: disable delay for RGMII mode") > > Signed-off-by: Vinod Koul > > --- > > drivers/net/dsa/qca8k.c | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c > > index a4b6cda38016..aa1f7f1b20d3 100644 > > --- a/drivers/net/dsa/qca8k.c > > +++ b/drivers/net/dsa/qca8k.c > > @@ -443,6 +443,18 @@ qca8k_set_pad_ctrl(struct qca8k_priv *priv, int port, int mode) > > val = QCA8K_PORT_PAD_RGMII_EN; > > qca8k_write(priv, reg, val); > > break; > > + case PHY_INTERFACE_MODE_RGMII_ID: > > + /* RGMII_ID needs internal delay. This is enabled through > > + * PORT5_PAD_CTRL for all ports, rather than individual port > > + * registers > > + */ > > + qca8k_write(priv, reg, > > + QCA8K_PORT_PAD_RGMII_EN | > > + QCA8K_PORT_PAD_RGMII_TX_DELAY(3) | > > + QCA8K_PORT_PAD_RGMII_RX_DELAY(3)); > > + qca8k_write(priv, QCA8K_REG_PORT5_PAD_CTRL, > > + QCA8K_PORT_PAD_RGMII_RX_DELAY_EN); > > + break; > > Hi Vinod > > So i'm still confused if this is global, or per-port. The first > register written looks to be per-port, although only for ports 0 and > 6. The second write seems to be global. This is still a global write which enables the delay in all the ports (as was the case previously) > Is there a danger that port 0 has PHY_INTERFACE_MODE_RGMII_ID and port > 6 has PHY_INTERFACE_MODE_RGMII, and we end up with delays disabled? > Maybe we should try to detect this, and return an error? If that was the case, I would presume people would have reported an issue that it doesn't work for them..? > > case PHY_INTERFACE_MODE_SGMII: > > qca8k_write(priv, reg, QCA8K_PORT_PAD_SGMII_EN); > > break; > > I think it would be good to add the other two PHY_INTERFACE_MODE_RGMII > modes to the default clause so we get an error reported that they are > not implemented. That is still the case: default: pr_err("xMII mode %d not supported\n", mode); return -EINVAL; -- ~Vinod