Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp967682pxy; Thu, 22 Apr 2021 18:56:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7WrffCCx+61JgBrfJiJmtikTCz/7riw/KoVVofpqDriYlX/SsPPIafSjAPmsmr1WL2fZW X-Received: by 2002:a17:906:4756:: with SMTP id j22mr1574895ejs.506.1619142984007; Thu, 22 Apr 2021 18:56:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619142984; cv=none; d=google.com; s=arc-20160816; b=i6CZWTct8kgBkFsvKGktbIQnJ6MW7tvJXehbaYZypa4eH2dtrQyc363he15VQx5SD8 pqsViWUwgz2Hu6u+7oYg6d37vNszPAggl9cmSTZdPHEdbISD4GAkfPLKzd+rC8v0EfCG wMqJAEevfIuNkikLeUcD8dJX4NHSrLuRw0rx0DWIii7EiHv37wl/xPldWalboh6/L73w 2oO5l/nF7Gh1H0NpPc8jQ5Mf0SEvaxD6IMJdDxqdw3RW+7cxu0Ye0UlkdKzSxmry1Zj+ uWrGr1X99yZ6nUka041DYyuPrIJtCBafSKRI6mYf4jbc1Gthyat8T2ktHxEEVfmuRs6U UEkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=3AapXKx/UR2C9m5toXV3NnksmytSDvqetzIlr+4AOIQ=; b=rtJdCoXPJdN/QHkxmxfm9CmtDnQaV+K2yFz/u4UhlMQ3kTnOrTLZtBusA7Rs2IrOc+ b0ppUUnHkhIVvh/Huvb37MIRaaPuSA590Tq0qab9jsccCiquPH6lRGyQpuZLNOEelSyB X65syE3o9gPYjK+FR/g0c6I85fcU1v0sOUMyvrgntt5q4HubYUY2QYJ1SnXiwfNGfQhc P9XHfRfkNhOZlT9EPatMdvK0KS/ScAByoxhSOR7B3RyXM2/OCXUexZNZ2xcc7rTD1wxW 8q8DDU4lqpR9hPB+W9GPc278xVQCTB9vTjjQYVMERuBae+E9/YDLoJa19DJeuyXikac4 lC1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Yq+hWTpy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l23si3987524ejc.104.2021.04.22.18.55.58; Thu, 22 Apr 2021 18:56:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Yq+hWTpy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240490AbhDWByZ (ORCPT + 99 others); Thu, 22 Apr 2021 21:54:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240012AbhDWByY (ORCPT ); Thu, 22 Apr 2021 21:54:24 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5695C061574; Thu, 22 Apr 2021 18:53:48 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id em21-20020a17090b0155b029014e204a81e6so3666206pjb.1; Thu, 22 Apr 2021 18:53:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=3AapXKx/UR2C9m5toXV3NnksmytSDvqetzIlr+4AOIQ=; b=Yq+hWTpyUb5jC2aBPRWWAT+1pNXN/PmmoktnFe3+ZoIKpoi9HD+uuf610lPw33ctPd Pe1o/4yySjl6O6sverUn9FEPzsuL6C956CAdI1JBBryV5WxvxwW8BYCS4akZ+6MGeSrb 9LdOLdQGOZbP4+UrfkjrzBsrGPgzVkNXzaPV3ejf7YniWLsyKIucQ3S6RZUQcm7+EwpA BieKb/DD2vCGtesqvFbmIQQ4oiILAZlvW3+d/i4weL1A8EiY1N9s+JKdPMtdQU5uYAWf ixJto0TfgEHUM7JCxkCreznNHG7uapUOrwvD2NYnFK4K5oV8cxUK2NKMU3/QWuysHgdB OjSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3AapXKx/UR2C9m5toXV3NnksmytSDvqetzIlr+4AOIQ=; b=r8L7XbjuxIrHcR8kYKMt2iCAjY0z++ByGy2VxgmDV1qlYTEZ2J/w3HLK2/1fPHBWv6 Hb4/1jOfKZarkOyIZUjBbaQX/MtiVxYuSXYAHipglV/FgiVmJdaU8VkdX8pB5BogkaTG +iHqJJyc4mw/E+O0lr5th7P3oaGHZVYJ2Mgs0VsN1SHiabOiQwdXIqYgOQ8jAIwfUGWX UFG1+3bFzJShWBL+MOGoEZueT00IICtulasZJzviD6S4rgQXcy9eQ61IVLNezah3IA10 2XfsOyQOwPvW2uNpFR8MdqoruZ140pnXTWd2hB6yhWrj4pZKCE7UK2UASsyJch7Iwtj1 XjrA== X-Gm-Message-State: AOAM5310ibpO9KCMpYq2kS6T0kDOL4IB1GXSVmRhj25iYY4PtGwKPkTC l6FkVcjGs4MMBFtQ1io4aLJz3IFajeI= X-Received: by 2002:a17:90b:1646:: with SMTP id il6mr3110884pjb.27.1619142828040; Thu, 22 Apr 2021 18:53:48 -0700 (PDT) Received: from [10.230.29.202] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 16sm6073884pjk.15.2021.04.22.18.53.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Apr 2021 18:53:47 -0700 (PDT) Subject: Re: [PATCH 02/14] drivers: net: dsa: qca8k: tweak internal delay to oem spec To: Ansuel Smith Cc: Andrew Lunn , Vivien Didelot , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Rob Herring , Heiner Kallweit , Russell King , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210423014741.11858-1-ansuelsmth@gmail.com> <20210423014741.11858-3-ansuelsmth@gmail.com> From: Florian Fainelli Message-ID: Date: Thu, 22 Apr 2021 18:53:45 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <20210423014741.11858-3-ansuelsmth@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/22/2021 6:47 PM, Ansuel Smith wrote: > The original code had the internal dalay set to 1 for tx and 2 for rx. > Apply the oem internal dalay to fix some switch communication error. > > Signed-off-by: Ansuel Smith > --- > drivers/net/dsa/qca8k.c | 6 ++++-- > drivers/net/dsa/qca8k.h | 9 ++++----- > 2 files changed, 8 insertions(+), 7 deletions(-) > > diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c > index a6d35b825c0e..b8bfc7acf6f4 100644 > --- a/drivers/net/dsa/qca8k.c > +++ b/drivers/net/dsa/qca8k.c > @@ -849,8 +849,10 @@ qca8k_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode, > */ > qca8k_write(priv, reg, > QCA8K_PORT_PAD_RGMII_EN | > - QCA8K_PORT_PAD_RGMII_TX_DELAY(QCA8K_MAX_DELAY) | > - QCA8K_PORT_PAD_RGMII_RX_DELAY(QCA8K_MAX_DELAY)); > + QCA8K_PORT_PAD_RGMII_TX_DELAY(1) | > + QCA8K_PORT_PAD_RGMII_RX_DELAY(2) | > + QCA8K_PORT_PAD_RGMII_TX_DELAY_EN | > + QCA8K_PORT_PAD_RGMII_RX_DELAY_EN); There are standard properties in order to configure a specific RX and TX delay: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/ethernet-controller.yaml#n125 can you use that mechanism and parse that property, or if nothing else, allow an user to override delays via device tree using these standard properties? -- Florian