Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp636518pxb; Tue, 9 Feb 2021 08:49:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6yYgMFbf1M8timEe6v3h98hmKFNJsWn9DX58RWM0Lqt0JiRyQlxrUjJ0nDTZTrQfKpHrH X-Received: by 2002:a50:f296:: with SMTP id f22mr24319724edm.159.1612889341473; Tue, 09 Feb 2021 08:49:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612889341; cv=none; d=google.com; s=arc-20160816; b=QqaulG0wsfrT5uzxv0EdwHIJqfU/Vln9tpFvSHGJU2qVogNNv7OB5dArLcnWZeWVFp fqWb7ZZ3Dbhy6okH5F7xK9pVzCp4nOYjX980qAbCURtrJQHWuScZyPFZ7DRAd9Bt0rXV vtDFRtd78kdleKPg+6PxIpiQF7NJqWdyWSSWaWLshFFyvV176EkArb/7kTtTEiCjUBUT REykrBxjXXwwQ4xD6VgcLQvOE6HH//Yf7jOjs333yVaEfJC24Ag/C5J0uYt72GXjVBWu VwA1P6qmB8v5uswdol4RXo9hGoTK9lzEY731OLA7h2nu8ulk25t6rfMmMTFMXSVDWHCT H17w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NY/Trf8IAXCJ0PG0ClY+O2svJbcABB/zmuNJczwrq/g=; b=rp8WqKJapCYsFhCsJd3tmgpJXM1pcsWgRS+qAIEsSnnWrZaQP7EvTOtPfPZxFJFreL ia6xE0qzMHWP1YUUd9tTfCtqQb2dzxus5/k1JDrFPLRKJMIQA6PNviMTKmIUNVH1EXq7 C5PrBsUG/wCjuPBhDJcg3+OoTk9flNH2SrDe5oGuZMfeaamcYsLQirUAOUTSfEBgXOVJ KwxqQEDLaJuzh1Loa0OLhdYZ0y5m82vFTXpIU/XD8V6yLXkmZCrWWwXrty2nY9uMLC0h gk0Zb3lFTvDUakUiTd1fC3+6OSZf40sUMbVNltA+xxmc4tlltisYjvt0E4eUk8MOueJ6 ujbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=iMOfgVYL; 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 i9si13688391ejf.666.2021.02.09.08.48.38; Tue, 09 Feb 2021 08:49:01 -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=iMOfgVYL; 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 S233136AbhBIQoC (ORCPT + 99 others); Tue, 9 Feb 2021 11:44:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233008AbhBIQlv (ORCPT ); Tue, 9 Feb 2021 11:41:51 -0500 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 004C3C061756; Tue, 9 Feb 2021 08:41:10 -0800 (PST) Received: from mwalle01.fritz.box (unknown [IPv6:2a02:810c:c200:2e91:fa59:71ff:fe9b:b851]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 352E523E75; Tue, 9 Feb 2021 17:41:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1612888860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NY/Trf8IAXCJ0PG0ClY+O2svJbcABB/zmuNJczwrq/g=; b=iMOfgVYL8XjIoepNzn1HjT5xtNNZKsjjawwjgvk4sO9J8U88Kb/z0DTZwrRMEOab4ywBHH JL23EQBOzHAweUTvcF33wi2BS6lhhqcy5pYtqmLuVSXJ8ArohaRC+hQ8oOvuQxqBOiLq4g s2xqVORYz0eM5it6wWx5J7IqikYtF6E= From: Michael Walle To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andrew Lunn , Heiner Kallweit , Russell King , "David S . Miller" , Jakub Kicinski , Michael Walle Subject: [PATCH net-next 6/9] net: phy: icplus: don't set APS_EN bit on IP101G Date: Tue, 9 Feb 2021 17:40:48 +0100 Message-Id: <20210209164051.18156-7-michael@walle.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210209164051.18156-1-michael@walle.cc> References: <20210209164051.18156-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This bit is reserved as 'always-write-1'. While this is not a particular error, because we are only setting it, guard it by checking the model to prevent errors in the future. Signed-off-by: Michael Walle --- drivers/net/phy/icplus.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c index 189a9a34ed5f..a6e1c7611f15 100644 --- a/drivers/net/phy/icplus.c +++ b/drivers/net/phy/icplus.c @@ -250,7 +250,7 @@ static int ip101a_g_probe(struct phy_device *phydev) static int ip101a_g_config_init(struct phy_device *phydev) { struct ip101a_g_phy_priv *priv = phydev->priv; - int err, c; + int err; /* configure the RXER/INTR_32 pin of the 32-pin IP101GR if needed: */ switch (priv->sel_intr32) { @@ -280,11 +280,16 @@ static int ip101a_g_config_init(struct phy_device *phydev) break; } - /* Enable Auto Power Saving mode */ - c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); - c |= IP101A_G_APS_ON; + /* Enable Auto Power Saving mode on IP101A, on IP101G this bit is + * reserved as 'write-one'. + */ + if (priv->model == IP101A) { + err = phy_set_bits(phydev, IP10XX_SPEC_CTRL_STATUS, IP101A_G_APS_ON); + if (err) + return err; + } - return phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c); + return 0; } static int ip101a_g_ack_interrupt(struct phy_device *phydev) -- 2.20.1