Received: by 10.213.65.68 with SMTP id h4csp2106452imn; Thu, 5 Apr 2018 09:04:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx489Gdqj8KvdAZlAC5lVvtZerVSIqvCc1MuG+kaDObri/LexwwobOf6PLvOpazogJGEti2q/ X-Received: by 2002:a17:902:a514:: with SMTP id s20-v6mr22912973plq.272.1522944276646; Thu, 05 Apr 2018 09:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522944276; cv=none; d=google.com; s=arc-20160816; b=A2gMdiFPzBW3mrhh6vZaOAldczwPL467vz/Wh1UfqN4o4iXFzb9gVWmkUrkE/T0Yfw KVGRzuh3umL0KAiOFfzY+8H9THNhgb/IR8T3d9OUf6G3Te+/HIaFCLAzXOR47/NAPjgY ITc0R9hDfw1atTdt3//JfeXKoE+kSbMlObqxCX9yrfufPngdA2l/NLA+3ayVZaFta2Om plcJEQou0/bTw6RjDKidQljly2j6SRXl7BntFC+Q0YhX6ZccRDaW4MdOr8368hVcFtbs kPrZJMTa+/Zj8frp8Dn6lNR+kKld6injU4agRiBuLyvSoyZSDvv6np0Xb0aPQ+NJEEdw Mp0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=viI2fFwhax0e99f/ObJ2AGmSh3PmgnoBv436cbnToGA=; b=gr++SaanOE0NS9MJhuTPmOcrofCWuJPjtnY1atU5egICpYHGFAIc55dT2gX0oPQv5Y V3rF73kqLhIPJWg6jbWYbBr6inI4xlEeL9bEkMSHbuZ3KZo6CsWEKKTY89sQ4YPdOp1u dnbwh1V63ZYhUMHFmcNBw3ADMEmNCw+z81lk8Wx4esiFwWG+ECqNeCNxOD8Q3Kiwkyze Wtl1y1gokOZ1LZ9zCHajykszUbD5M30ubN/9GZ5TQIaDaOB4zJTBME2FVYEg+UsnHdO4 bd1ZUwN44lXYl5c44ZAD0CVrlRu+KYC/gpbMFhwXTUVKZwJuoGCPCy/rbeKZ/3EhpAgF XwDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=U8/P8Tq3; 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=pass (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 1-v6si6240388plo.228.2018.04.05.09.04.22; Thu, 05 Apr 2018 09:04:36 -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=pass header.i=@gmail.com header.s=20161025 header.b=U8/P8Tq3; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751470AbeDEQCq (ORCPT + 99 others); Thu, 5 Apr 2018 12:02:46 -0400 Received: from mail-ot0-f196.google.com ([74.125.82.196]:39019 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751195AbeDEQCp (ORCPT ); Thu, 5 Apr 2018 12:02:45 -0400 Received: by mail-ot0-f196.google.com with SMTP id a14-v6so9583530otf.6; Thu, 05 Apr 2018 09:02:44 -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=viI2fFwhax0e99f/ObJ2AGmSh3PmgnoBv436cbnToGA=; b=U8/P8Tq3HAOjP6ByVxBFvA56MDTlxn3W+XzdgdKg9S3nau2zK2HNckyLVEo1WrmxiT 0igSE6YOv9jhEdTcBOBTzYViUmpUXCUmZc0/KDv2u1YZ0Cv2G0Brhpr0B5KBGI8pwEGD Y/UccKSeYxdBzzi2HiAUZgIO6bI1HsY2OY90C5JNcEocuwMAHER1qsZIM+RE6niFJQVO uDZGuC91wvcS4lXbjUr8PhCQP1H+3eIJ+7vPG1YasAjAw/vLO9YKREz5Jb++w4ZvMWO+ 74g/bezi1wKcr0aKlL0JdCdrl2L1hFOcTjnY8JLQEzc+tuY8dMjiyrahbJpLj6MT97ee xTYQ== 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=viI2fFwhax0e99f/ObJ2AGmSh3PmgnoBv436cbnToGA=; b=MhL67/clFhX8gKgT8varpt2ejC39h+xJ4NGnHWE/qBZ4tkPoeFYVRBvjSBxGaUhXuR NgSaz4cim5mTaDCYxk2fwwxq+yw7lamMEFw8xOg+2bP5mpGQGpFBe5D9AmVDA0w/q4uw yvBRL4WmAMtNMgFKpvGl1ah9MOnML5wrER/veULWIckFWER23ULL/AAot1nv1R4MPJ9N jPcizvG8wuRlG1Ei3y4Hbg4Ul1xvxpaP3MmMW5OsM8UyW8lx0uIKNplm54vw1FqscK25 KkUp9chPzKtsmxmYTMuOOwKQHjIzbHpy3rdlsDyALra5oChpY7KA3sfzoSWl5evpyy9j aypA== X-Gm-Message-State: ALQs6tB1BUUgMzIe0FFYvdWa7gtTb0XbBCEgCWzvo7TwmW5iF9IqyUjR LPjcI60UceO7WlNYEKSPFm0= X-Received: by 2002:a9d:2186:: with SMTP id s6-v6mr472607otb.133.1522944159793; Thu, 05 Apr 2018 09:02:39 -0700 (PDT) Received: from [192.168.1.3] (ip68-109-195-31.pv.oc.cox.net. [68.109.195.31]) by smtp.gmail.com with ESMTPSA id b45-v6sm4999835otb.1.2018.04.05.09.02.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Apr 2018 09:02:38 -0700 (PDT) Subject: Re: [PATCH 2/2] net: phy: dp83640: Read strapped configuration settings To: esben.haabendal@gmail.com, Richard Cochran , Andrew Lunn , "open list:PTP HARDWARE CLOCK SUPPORT" , open list Cc: Esben Haabendal , Rasmus Villemoes References: <20180405114424.8519-1-esben.haabendal@gmail.com> <20180405114424.8519-2-esben.haabendal@gmail.com> From: Florian Fainelli Message-ID: <95678797-bd17-ba3f-8a70-a00b4792a258@gmail.com> Date: Thu, 5 Apr 2018 09:02:38 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180405114424.8519-2-esben.haabendal@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? In general, we do not really want to preserve too much of what the PHY has been previously configured with, provided that the PHY driver can re-instate these configuration values. 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? This really looks like a recipe for disaster when you could just disable auto-negotiation with ethtool. > > Signed-off-by: Esben Haabendal > Cc: Rasmus Villemoes > --- > drivers/net/phy/dp83640.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c > index 654f42d00092..01e21b4998ad 100644 > --- a/drivers/net/phy/dp83640.c > +++ b/drivers/net/phy/dp83640.c > @@ -1134,6 +1134,10 @@ static int dp83640_probe(struct phy_device *phydev) > if (!dp83640) > goto no_memory; > > + err = genphy_read_config(phydev); > + if (err) > + goto no_config; > + > dp83640->phydev = phydev; > INIT_DELAYED_WORK(&dp83640->ts_work, rx_timestamp_work); > > @@ -1166,6 +1170,7 @@ static int dp83640_probe(struct phy_device *phydev) > > no_register: > clock->chosen = NULL; > +no_config: > kfree(dp83640); > no_memory: > dp83640_clock_put(clock); > -- Florian