Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1227016pxb; Wed, 10 Feb 2021 03:24:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMXiaifYPmXJtnL6pDD4oHzjs08bAlRMsbBRW5v0dzhgnGKtaV88hgujj5x7hdRoOcDmb2 X-Received: by 2002:a05:6402:14c9:: with SMTP id f9mr2777595edx.90.1612956297512; Wed, 10 Feb 2021 03:24:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612956297; cv=none; d=google.com; s=arc-20160816; b=t9o3DWATaDHHYulDnZNi7XHChcElsTqlg8iLJXMmWPvGKwS+a6nYRXtQ2M/InsuU0M 99oO+iiwumW/mKTh5iwUTRX7TV3AFB2Bk2I+oIQDdelBgQGGqJaL6xlxVgz5nAPFz0be MWxQ+5PlF9GLx9IKRkOxExQ2Q/EsdOBmmTWe4ISxdigt1lTgzcyGe9bzIwZCruRaJ7iv jIBy6iNwnIYtE6/evehyDoZNQXxQ5EiR/6EeFuXJIMNN5hF8lKfILMDzl0kGE8QXYqod 00D7fV8vRt86Xn1mohuwLJwbbz6zri+bGT7uWordD+JSE1CkmlNzZpgqoH3LWaV3C/dB Y7Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=O3hOdHbd8TlmpvkNZrPrCPOXWwvYrsaTiI23G0yqJfE=; b=zYXqWXG599eQ8tXzaKKVE4tYxjK3hwkVakAcroSUEvr5Idj+XBVRD3fW0yXFrxVyGQ 2La7tR8MjZZyrgr67cU729OqvJkz6TGxFUAsJXRNY+ghLEEowj0p9XXXRZoHkz1MAy3n zum2jN6dHEM1AZCp/QTtdTbH61FOKy/qPQ/JdSewzl5nM4IN90MYKrbYMxxxcP3p8M9u k0pZkZngj7ZMj55yQ6+UBCtF3aIUQLOnT4ccyVCVdcT/YGpIlxzRyTXnuw1DFblLmgcQ VYs3OQKa6ZOS4CAsXABvXKIBaeWgEf+saNvs3Nl0SsXLgJkSr0iO8rAObyp8r8OwERVp BoJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=A4y9998+; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fx12si1055253ejb.286.2021.02.10.03.24.34; Wed, 10 Feb 2021 03:24:57 -0800 (PST) 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=@walle.cc header.s=mail2016061301 header.b=A4y9998+; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231703AbhBJLXi (ORCPT + 99 others); Wed, 10 Feb 2021 06:23:38 -0500 Received: from ssl.serverraum.org ([176.9.125.105]:57147 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230448AbhBJLPR (ORCPT ); Wed, 10 Feb 2021 06:15:17 -0500 Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id C9C5522EE4; Wed, 10 Feb 2021 12:14:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1612955676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O3hOdHbd8TlmpvkNZrPrCPOXWwvYrsaTiI23G0yqJfE=; b=A4y9998+3utye6ediaZeN35Q4/BQTaiQLICs4Eo6vqFSnpcz5L7OoHPoB4wRpAndy5adHz bx6twguoCzqkoDQ1SfHUN4l3brqXVBXAMKs3UXQcGce6nPM1JZvu623j3KYoaK8uEPQaSA TDiBwvDzY8J/dmk8fI3uGFvqMO9+hIM= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 10 Feb 2021 12:14:35 +0100 From: Michael Walle To: Russell King - ARM Linux admin Cc: Heiner Kallweit , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn , "David S . Miller" , Jakub Kicinski Subject: Re: [PATCH net-next 7/9] net: phy: icplus: select page before writing control register In-Reply-To: <20210210104900.GS1463@shell.armlinux.org.uk> References: <20210209164051.18156-1-michael@walle.cc> <20210209164051.18156-8-michael@walle.cc> <20210210103059.GR1463@shell.armlinux.org.uk> <20210210104900.GS1463@shell.armlinux.org.uk> User-Agent: Roundcube Webmail/1.4.10 Message-ID: <3a9716ffafc632d2963d3eee673fb0b1@walle.cc> X-Sender: michael@walle.cc Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2021-02-10 11:49, schrieb Russell King - ARM Linux admin: > On Wed, Feb 10, 2021 at 11:38:18AM +0100, Michael Walle wrote: >> Am 2021-02-10 11:30, schrieb Russell King - ARM Linux admin: >> > On Wed, Feb 10, 2021 at 08:03:07AM +0100, Heiner Kallweit wrote: >> > > On 09.02.2021 17:40, Michael Walle wrote: >> > > > +out: >> > > > + return phy_restore_page(phydev, oldpage, err); >> > > >> > > If a random page was set before entering config_init, do we actually >> > > want >> > > to restore it? Or wouldn't it be better to set the default page as >> > > part >> > > of initialization? >> > >> > I think you've missed asking one key question: does the paging on this >> > PHY affect the standardised registers at 0..15 inclusive, or does it >> > only affect registers 16..31? >> >> For this PHY it affects only registers >=16. But that doesn't >> invaldiate >> the point that for other PHYs this might affect all regsisters. Eg. >> ones >> where you could select between fiber and copper pages, right? > > You are modifying the code using ip101a_g_* functions, which is only > used for the IP101A and IP101G PHYs. Do these devices support fiber > in a way that change the first 16 registers? The PHY doesn't support fiber and register 0..15 are always available regardless of the selected page for the IP101G. genphy_() stuff will work, but the IP101G PHY driver specific functions, like interrupt and mdix will break if someone is messing with the page register from userspace. So Heiner's point was, that there are other PHY drivers which also break when a user changes registers from userspace and no one seemed to cared about that for now. I guess it boils down to: how hard should we try to get the driver behave correctly if the user is changing registers. Or can we just make the assumption that if the PHY driver sets the page selection to its default, all the other callbacks will work on this page. -michael