Received: by 10.213.65.68 with SMTP id h4csp495489imn; Fri, 6 Apr 2018 04:06:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx484TJJFILXzxqXPCSL9lnYZn4roPw5bfnDJSWqBx3E7pq3XdpTAf4DdvZe1S2R84MCDODlO X-Received: by 2002:a17:902:8c84:: with SMTP id t4-v6mr26707344plo.357.1523012803993; Fri, 06 Apr 2018 04:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523012803; cv=none; d=google.com; s=arc-20160816; b=gqfUfMhSwtAXAOExMHg9R7jq7yoxL4mWakrau6mZ1qdQY60PTF2dsgv9UW9jGIYmSP 6BtpMVE3SthKLoqtgcO5QLVnbsifRsJTCLjiTmAAdmu1s3Hg2kUBF975fZqZZkrDIjkP ZO8aXEST8VSJknA0/Iog4wBQod9ljB/ZE2fVq2LfkGEmC5Wa4CiABjJXK6C+aTYXqUY3 21yY1mxSsB5QXZFMHzS4cZsq18kiX/G26O4XiwQv+eQcjifnGEi3nnIg0QdS0Dqn1ZNz z7lJzImdJVViUazU6Ul18gyE5UcCvtv7vIKiSVGoKsKZjZBPMbGefkduZNseD96pjsyy HUlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=z2gxVOhClVzrYPbb3lqjF9CfqKZmtU9/dHcTINVDGyE=; b=gp5+M+Lt0SgjNwaa5rGhiZQ5x3uez4qxfmEsdXhZkTOpgqm2JlDAO+xOoZLCfcYyTm 1PSl0Xr2ANGpjOVkstNblP10E0spWQVrdzoSH7UGzWRWrIYv7xD0WScO1qryFqSWbtHC uQxdAFN7n/aPIKSwB4HePhfT6pwOmlEU2YyZmHQepluYe3bNdGZ+YisjHT6/2dev6RkW mbyW36xa2MKWrlSy/h07eMKm7TZC1sNompofY99SLxeTwuSxpdzCUp9RcH6m2uQJFfhT XPqtdgkBtxn9nzyYAuF/6DzD5mQx/n5vEBNE1vJJJWXEnbQe/T1cu+EEBQxIjSbxQnPZ 1D9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=oXZVOLRK; 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 k3-v6si8091555pld.221.2018.04.06.04.06.28; Fri, 06 Apr 2018 04:06:43 -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=oXZVOLRK; 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 S1752021AbeDFLFQ (ORCPT + 99 others); Fri, 6 Apr 2018 07:05:16 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:37153 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751434AbeDFLFO (ORCPT ); Fri, 6 Apr 2018 07:05:14 -0400 Received: by mail-wm0-f49.google.com with SMTP id r131so2626584wmb.2; Fri, 06 Apr 2018 04:05:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=z2gxVOhClVzrYPbb3lqjF9CfqKZmtU9/dHcTINVDGyE=; b=oXZVOLRKIMBJwNHCELnQsJsGx6x7A66jcOeBurXl/BCRwd91ROKv7G5YhGj17oASZ/ xnG/NXC+XaFrnsbdY5llEbWSUz7iHOJ9DG1gZFBUKc14yFwgncMFR0x5iRsIaEUNVaoM cth1npPM0N711UYX6VdEhliQQUlM5AcsWYigM8upRtc8W/JkuJhs3CSVaAjepaftYaEQ l4vSsvVNaXKTSoeP9kMzZpgQn2uazHkWvPtvDgDUzYGLF4TPKwyNp+8ey3iEWs2LvihP mJsoV/Hdy3XYy9HcJ7G1ZaL2K2rpQ8I89NAdR2ZBZo0y7nZqRwHSdJybTpISqkYwRtDr xJHQ== 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:references:date :in-reply-to:message-id:user-agent:mime-version; bh=z2gxVOhClVzrYPbb3lqjF9CfqKZmtU9/dHcTINVDGyE=; b=KVglr5CR6fhHiZGuy6JbPsDkLXCO8Y2ZczxuuGZlDCPfjoutyDXLr0dzG68q7YRH7S ZZTVYu6XwGTEgtrIr1sd6RuEsvgQ7BFNBPElwv7cVvKWDF5bmTwwYwTomrm6EN0xlCRz rmIiR8MbnfZ0sF+f8Bmwbllu5Ha6yhCoW9lK3oQkbOVLKVtLLQm/BPzYpnqpYJi7n3J1 1fb1yduS3ajCLJag5nXj683aexpG6qUXnN3+W1PSews+vXRxm4F3DaanbHnRhETCAyOv fGgNMxKFRW5t4FG/rT/EEvl2R/zN4tI4t5CLqDLskPo7U8DYhB4KubwEYRuf81NMyXdw Cm4Q== X-Gm-Message-State: ALQs6tCJR2VwgCh6IgvY7j/N59Mar544GAe3JVmZn0eM4uj437R19bnd +98PKW+/wh+CJvVkwGig9WIfiQqI X-Received: by 10.46.158.199 with SMTP id h7mr16430117ljk.103.1523012708533; Fri, 06 Apr 2018 04:05:08 -0700 (PDT) Received: from localhost ([87.54.42.112]) by smtp.gmail.com with ESMTPSA id 76sm1687170ljs.93.2018.04.06.04.05.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Apr 2018 04:05:07 -0700 (PDT) From: Esben Haabendal To: David Miller Cc: andrew@lunn.ch, f.fainelli@gmail.com, richardcochran@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, rasmus.villemoes@prevas.dk Subject: Re: [PATCH 2/2] net: phy: dp83640: Read strapped configuration settings References: <95678797-bd17-ba3f-8a70-a00b4792a258@gmail.com> <87d0zdjszu.fsf@haabendal.dk> <20180405204049.GD17495@lunn.ch> <20180405.222437.1573582680811455269.davem@davemloft.net> Date: Fri, 06 Apr 2018 13:05:06 +0200 In-Reply-To: <20180405.222437.1573582680811455269.davem@davemloft.net> (David Miller's message of "Thu, 05 Apr 2018 22:24:37 -0400 (EDT)") Message-ID: <87h8oo61el.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) 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 David Miller writes: > From: Andrew Lunn > Date: Thu, 5 Apr 2018 22:40:49 +0200 > >> Or could it still contain whatever state the last boot of Linux, or >> maybe the bootloader, left the PHY in? > > Right, this is my concern as well. I don't think that should happen. With config_init() being called (in phy_init_hw()) after soft_reset(), any state set by software should be cleared. From DP83620 datasheet description of what happens when BMCR_RESET is set: The software reset will reset the device such that all registers will be reset to default values and the hardware configuration values will be maintained. But something else that could be a concern is the risk that there is boards out there with wrong hardware configuration, which works with current Linux (because it ignores hardware configuration). Such designs could break with this patch. If we need to safeguard against that, maybe we could just keep the genphy_read_config() function in the kernel, and let board specific code use it as a phy_fixup where hardware configuration is to be respected. Would that be a better approach? /Esben