Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2000815ybz; Thu, 23 Apr 2020 09:49:04 -0700 (PDT) X-Google-Smtp-Source: APiQypK4rC8bVd46j3W9aD39PR5gjFUG64VJwtRF0tgewzEJH6FzBa9HOcx3vn3gR2eNCMnce8hk X-Received: by 2002:aa7:c1cf:: with SMTP id d15mr3260836edp.266.1587660544216; Thu, 23 Apr 2020 09:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587660544; cv=none; d=google.com; s=arc-20160816; b=bdtjseAVp/mmh1qv8j2zFl0r0EpEujdWiRQ2S7wLiRcwdKuxtQe7twTH8l5rMgVKX3 yv+FX7rI70INXIYRLCaHRLmQZDhDCrx9M94krkrBG+lX534HDp8sjeJhNPIYEq71LJ0i mdK18SgD2uRlKpCEaLjL69sZl9wOudTrO7e/1qRvRmAn1q/lnY6gAK3VgSkj1cNmQagX SJtfvfl//Svclp1AciigJ9T/nNRE9PZTVhjo19OhvBGc8QQjUjxrNRZ2uP2vjMj+ozK1 IdBMWz+jgx+rcqPAVz+dOK/ldFaQ2aLL9fRk3lbx4sp+gbu2zcTSnNrcRJbJquZgaXow ozRQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tKDw8OQZcIMisiTxBsvq0HEhQVuhSJ2oL6rRmaHita8=; b=l95xAZJPiRZVPtttF1Xs+IWHMGENXqxx4adFZP2UpbcGmqHSsKJEUta/5x3YwUYMEL aMeZpdgVhnUkOXinhbRaU40PW27u0B1obJaHTbU0MAIIr8qsJPZ8Txkhx0p75AU/ynPu 3jkmngLBv0qxfSorhySrRrKjIlnxjSVPos48eDS2oC9kH9OWhHSIlXHTE+JZL3MmROcF wHexLT8BhBs5WBzN8XbN/ckMVXweUTQeUsQQ8/QwGDKyhoLQC9JLnmptVKEumEjfxvJR JZz0egTyMDu/e+qjXlHySJQ5cM0IykVM/nDN1h3nWQ9fljO0aCOqn2LXwbWIkgbLITUs 0ztA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=l+QdGwrB; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si1340213edx.450.2020.04.23.09.48.40; Thu, 23 Apr 2020 09:49:04 -0700 (PDT) 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=@ti.com header.s=ti-com-17Q1 header.b=l+QdGwrB; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729786AbgDWQqJ (ORCPT + 99 others); Thu, 23 Apr 2020 12:46:09 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:46692 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729756AbgDWQqI (ORCPT ); Thu, 23 Apr 2020 12:46:08 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 03NGjuEx113868; Thu, 23 Apr 2020 11:45:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1587660356; bh=tKDw8OQZcIMisiTxBsvq0HEhQVuhSJ2oL6rRmaHita8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=l+QdGwrB0y4GleuBqdWCjgG1tj8QsW+HOWJHHSOadCt+SpoMek1G42USrUoiSf0NV iTrIb47oFnBM0pFEFyiOggQ3ts0eLCK+QzrfoohfmlhIR3QDN2uLZsEQzAjUBsKwkB eFkGAyXm0Muj8xZhp9jgcuDUxeD+jEcQlXHOUL4E= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 03NGjuDL123655 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 23 Apr 2020 11:45:56 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Thu, 23 Apr 2020 11:45:55 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Thu, 23 Apr 2020 11:45:55 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 03NGjtIm012635; Thu, 23 Apr 2020 11:45:55 -0500 From: Dan Murphy To: , , CC: , , , , , Dan Murphy Subject: [PATCH net 2/2] net: phy: DP83TC811: Fix WoL in config init to be disabled Date: Thu, 23 Apr 2020 11:39:47 -0500 Message-ID: <20200423163947.18313-3-dmurphy@ti.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200423163947.18313-1-dmurphy@ti.com> References: <20200423163947.18313-1-dmurphy@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The WoL feature should be disabled when config_init is called and the feature should turned on or off when set_wol is called. In addition updated the calls to modify the registers to use the set_bit and clear_bit function calls. Fixes: 6d749428788b ("net: phy: DP83TC811: Introduce support for the DP83TC811 phy") Signed-off-by: Dan Murphy --- drivers/net/phy/dp83tc811.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/phy/dp83tc811.c b/drivers/net/phy/dp83tc811.c index 06f08832ebcd..48dcd2649272 100644 --- a/drivers/net/phy/dp83tc811.c +++ b/drivers/net/phy/dp83tc811.c @@ -139,10 +139,11 @@ static int dp83811_set_wol(struct phy_device *phydev, value &= ~DP83811_WOL_SECURE_ON; } - value |= (DP83811_WOL_EN | DP83811_WOL_INDICATION_SEL | - DP83811_WOL_CLR_INDICATION); - phy_write_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG, - value); + value |= DP83811_WOL_EN | DP83811_WOL_INDICATION_SEL | + DP83811_WOL_CLR_INDICATION; + + phy_set_bits_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG, + value); } else { phy_clear_bits_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG, DP83811_WOL_EN); @@ -292,8 +293,8 @@ static int dp83811_config_init(struct phy_device *phydev) value = DP83811_WOL_MAGIC_EN | DP83811_WOL_SECURE_ON | DP83811_WOL_EN; - return phy_write_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG, - value); + return phy_clear_bits_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG, + value); } static int dp83811_phy_reset(struct phy_device *phydev) -- 2.25.1