Received: by 10.213.65.68 with SMTP id h4csp2360678imn; Thu, 5 Apr 2018 13:36:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/eg7LwPPoPpBvfV2jCRKwj4zRI+aLj3HZgMmY635aE+f8bLSyoRmtgIxjEhuqaZifRPXKL X-Received: by 10.167.133.85 with SMTP id y21mr5044289pfn.139.1522960607947; Thu, 05 Apr 2018 13:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522960607; cv=none; d=google.com; s=arc-20160816; b=fPFjyh+c5YlmdCXMaPSU3rVpZpWdDcesy8F+yuVM8aERxt3PxYcv1cmr69Rnehlwnx F/lyZeKhiL0ZAEYU4z/5j0ImyQ+hZuRquAI3uQiY6O2MZKs8xY2kZxQV6CaQmPlUUceq BhJk7W66F/NVS/S0hQJ1YpOoaeZzaVfRvHBZApCKk/ukfSEsbqKZC0BYoTafIfM8XnNZ lzta7mymhPQokbZ9OS2Vp+cyCCipOLELhM734w6QelsVIEqIW2USuwgbhaY2qzOgWOz8 gJEzgAmHKoDfmqz89DsjPpiehZYxoWnsN1Xf4CDWhtGARbZHSbmG0urvHtuJpu5MXlwM iCIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=jXZGmCrkP1/u85i8aLWS/MDAOyOaJMm6Ij34rZaBi0A=; b=cRqp3WiT885ayL3b71nuaxzJrkEpPmHzGKkC5gowGddJYQVznuK/xF5EN1cDI3+Ela QEkpGTJEmW0+/2jLsi364AGAZowLJKDapfzad43yVEY5wiBXskyF1phKLHBuf8esFS/k WrJMegS8n2zK+AVp8w5ZUqZePpT/PHHB0qCEPqLIddund0LcFaS/RE+5nw9RwnPTcFlj tvG37p0OkdtPL3iq2QmAUVyXrNB8dTCVoRssfB44hlQiZyuyajavA0dO+0Xnk3GqdlHC fG3wfriDHUZejMA5gl5d28YDvxlRgBee3Ig7sXUKhSB/Q1Ejz82MZyGZHq8fWWypJPxM BUlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=lU+cyYO/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10si6085753pgf.833.2018.04.05.13.36.34; Thu, 05 Apr 2018 13:36:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=lU+cyYO/; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753795AbeDEUem (ORCPT + 99 others); Thu, 5 Apr 2018 16:34:42 -0400 Received: from mail-wr0-f179.google.com ([209.85.128.179]:45083 "EHLO mail-wr0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753773AbeDEUej (ORCPT ); Thu, 5 Apr 2018 16:34:39 -0400 Received: by mail-wr0-f179.google.com with SMTP id u11so30490989wri.12; Thu, 05 Apr 2018 13:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=jXZGmCrkP1/u85i8aLWS/MDAOyOaJMm6Ij34rZaBi0A=; b=lU+cyYO/S01ejyevUQ287VEav1W6PgAX8fOPPHX/6yV/43ZyjdfQw6AZbVCGlLjn+9 b7hyBoT/X1EzxP9hpIiY4SkoN3nc7BDr6z3Rr3z9gObC4uvn812T3tV1HH9/D37nNWMg ezghyNJ+o5iebc5ZcCONPB3IfZY6c4CkKTVVsmaj84f2yq7vkFbbO9ChFbqaAWA41LKR 7KG7gqIoeBER6l8VCAgAo3or/cvZCJS+Wsb78ur5CA31kN8FP15sa4E6OcNmhmnQWBdU RyXsBweU5lXtJ9E0kl/Y1r3D9H9CHO8vfHhE1nTSOPtujptc4RftajTth0+36EmaxaXG 8aOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=jXZGmCrkP1/u85i8aLWS/MDAOyOaJMm6Ij34rZaBi0A=; b=mvyGS5diSidTQoT0zDtc3nlo9Nm9nq19C7BtCXlydOG831MeEYHax+NmuQ2S8synQ5 K2PLWdvc+y944/ng9GbDQ/CzfHreY1aCKaOVAXy2iU/xszrChlxKmbKsFojvHtCH9SXQ 0+JdxgELNv0dvv/a5PS9obPaZplzQk7Y94ae97eV4osk7YdLD9o3SJDpQ5pOS41lBVXT Cb7yW+l5TA6DHwAQMuuVa3tOzFGHL4W7CngwSqrpNjGDLWiRld4zMOPpZpYkPCW+7WRz b9Z44I6P9HVo+K2NKRtkQATI1AyhRxcK8waTBxCaKGgNoikb6omXKSGZTXkQhFEwBk2j muMQ== X-Gm-Message-State: ALQs6tBmTcRqLTZYcBBx5++tOiP1f/EHmMzp4Gfnxb7Wo580afQxAw0L myPU+pcrGdDNE52xxnDEorA= X-Received: by 2002:a19:6d03:: with SMTP id i3-v6mr14377484lfc.34.1522960477774; Thu, 05 Apr 2018 13:34:37 -0700 (PDT) Received: from localhost (87-57-30-174-static.dk.customer.tdc.net. [87.57.30.174]) by smtp.gmail.com with ESMTPSA id j74-v6sm1690868lfg.92.2018.04.05.13.34.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Apr 2018 13:34:37 -0700 (PDT) From: Esben Haabendal To: Florian Fainelli Cc: Richard Cochran , Andrew Lunn , "open list\:PTP HARDWARE CLOCK SUPPORT" , open list , Rasmus Villemoes Subject: Re: [PATCH 2/2] net: phy: dp83640: Read strapped configuration settings In-Reply-To: <95678797-bd17-ba3f-8a70-a00b4792a258@gmail.com> (Florian Fainelli's message of "Thu, 5 Apr 2018 09:02:38 -0700") References: <20180405114424.8519-1-esben.haabendal@gmail.com> <20180405114424.8519-2-esben.haabendal@gmail.com> <95678797-bd17-ba3f-8a70-a00b4792a258@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Date: Thu, 05 Apr 2018 22:34:35 +0200 Message-ID: <878ta1jstg.fsf@haabendal.dk> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Florian Fainelli writes: > On 04/05/2018 04:44 AM, esben.haabendal@gmail.com wrote: >> From: Esben Haabendal >> >> Read configration settings, to allow automatic forced speed/duplex setup >> by hardware strapping. > > OK but why? What problem is this solving for you? It is ensuring that the PHY is configured according to the HW design. If the HW design has set the strap configuration to fx. fixed 100 Mbit full-duplex, this avoids Linux configuring it for auto-negotiation. > In general, we do not really want to preserve too much of what the PHY > has been previously configured with, Even when this "previous" configuration is the configuration selected by the board configuration? > provided that the PHY driver can re-instate these configuration > values. This is sort of what I try to do here. The PHY driver needs to check the BMCR register to figure out what the strapped configuration was. Without that, it is necessary for software configuration to duplicate the exact same configuration as is encoded in the strap configuration in order for the PHY to be configured as it is supposed to. > I just wonder how this can be robust when you connect this PHY with > auto-negotiation disabled to a peer that expects a set of link > parameters not covered by the default advertisement values? I assume it will fail just as it will if you use ethtool to configure the PHY wrongly. > This really looks like a recipe for disaster when you could just > disable auto-negotiation with ethtool. The current PHY driver approach to always default to enable auto-negotation, and then allow user-space to configure it differently with ethtool. With this patch, the default configuration is chosen based on the strap configuration, but user-space can still change the configuration with ethtool if needed / desired. I don't think it is such a big change. Bringing up the PHY with a default configuration according to HW strapping instead of an in-kernel SW hard-coded value sounds like a good idea to me. /Esben