Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp668450lqt; Mon, 18 Mar 2024 22:58:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJU8x+5KavwZqYCwWIzqIsl/U+vG20G/dLVoqkVQJwj4LcQ/GIGET3qp5lmj/xbV75uis2rOVruUPv4I3NNchXqtBan6lrSFLQxoAKwg== X-Google-Smtp-Source: AGHT+IFDkk00C88E7VzsxCZ/Qzb0wKg44CWsdSoXiVbu2bCWUDywUwKxGG7xgkN49wjzLKMo09Ki X-Received: by 2002:a17:906:4699:b0:a46:d04b:66e7 with SMTP id a25-20020a170906469900b00a46d04b66e7mr1484808ejr.25.1710827903247; Mon, 18 Mar 2024 22:58:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710827903; cv=pass; d=google.com; s=arc-20160816; b=XGBm+mIBUBG+omRENW6UcDpTwUOawEyi0MEsRl25rfW6GDbXDfwes22hoglfoLd1DY idE1QOSCzj3a8YDSqHKYIhgu+g4ppdQE/b76e9/Mgx0N7W5mHs4Q5o7mzQH0Y71msdTz vutRm2NfTI7PQg7IjC2gyTHEPQIq0bdydF790OAmPqoA/dVGilwivtYDobCgxQ3SN76S Xt7ta8u6LMf9bOZfsCwwsv/Tr9g2SHw0o+Lvs4zyjECByyxUsRCjZzVhSLZIG7XmyROl 1XPNGxtcKvP7vNSTR8jhgZL0nk/O9wutGeO08xBvm5d4lWqmobvozktGvFZWB3RtGuKw Qyug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=hMJLYp3bUdQDUmlN0A3fqFP9IGZpsMVR8Mx4xPeBhlo=; fh=CuRdiZHnupyxsyVt43idodkUN01kmsjbYke869r1y38=; b=V2mcDou6MmWaO4IQph9n7+AE8W6927MgKkjQ90ROLVFzEa9ekF4zVoFeu7AWFMxCF9 I13k2zzAH3NUdO9Nw+NcwdBpFUvctVnmCURzbjIkb3mgjQZAjvLs/5BsXA+efEmFLUpe epc8D/QKuglFzhRGO+hftKsK5/zqtU7CJpBj0dNHYcP9ovcGob/P42oWX6oat+jaUP2x Zx8XlsOl4yVOTg4hPZ3JeP+DkxEi2QpfGQIQSpIBCDvT2WR6Rvejc7xVyG8m1E+tRdeo DweRna3P3FeZtUm+BrJxFQY3Am6YVz+s5kCm7razdZZ72GayxlU9aqCol8+9vb6NQp0V KTtw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=Te6P2tL3; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-107053-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107053-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ku7-20020a170907788700b00a4645257729si5008656ejc.527.2024.03.18.22.58.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 22:58:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107053-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=Te6P2tL3; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-107053-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107053-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 007D41F22796 for ; Tue, 19 Mar 2024 05:58:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 396437D3F0; Tue, 19 Mar 2024 05:53:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="Te6P2tL3" Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE3257C6CE; Tue, 19 Mar 2024 05:53:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710827629; cv=none; b=q0mFVcFusxFBuTCOugQidZewdmcYncyFfTM+gXhKkxC8ykksVcGmSjYuUhOaPYTwBuU+wOLqH6cDQT6tRNqX+00ooMZucFrhmTX1AQ8xinYXxL4y8sAqMNbFAAUccLt6ywT/8P+5qzayyJKG/ZvworII3G+nRkDe2ugzYXWypM8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710827629; c=relaxed/simple; bh=PsieqNlg0izoRjsoe59ZVNJpX8rC5zYulh4OIjSqqjA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ocoI1/7a8V0fu0f8OpN0mB/R+YWKTP8pV9f5jJGYwfev1iH/mJdfA14b6fzjohvgon6qQ3gRKxVnpKOmWOmkEl6CZybNvgm4ry4hCluQQB10dIqQjoQoovBPUWzJHcxRi9Hfaxh6nzUQWxNvqPAzfo5XbkWoq3jF+BChM44Zf6s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=Te6P2tL3; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1710827627; x=1742363627; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PsieqNlg0izoRjsoe59ZVNJpX8rC5zYulh4OIjSqqjA=; b=Te6P2tL3f9mJP5kZI/uN5cG/3Q9pVTYhlnxM1ICiBF4MC0GnUX/MTV0B 6cS9Mm54fTcnng/QuRJEBf1r0HJgL6sl32JPEg93EVXn+Mlus/2N3/Cyu gNgR/1AxCAuyAQR2eG3vczUKgvPu91HfXJ/8ExnEZp+yVc7WFGnJKACyq kprb/4TPTKQrpNXA4lgzOplABDHn9FpoX6GgJz+6CljsYViuieb6cb0wJ K0VbSUbfXxv4UXHUMqo109O+oI9K1Q5VVAJRWRSV3QysHvGzpUOcqRKVL a2A5aQdJq4m16tZgvfFzRut0/LKawNHQW0Q53k1C0phOvFR1CEqzDKz/8 g==; X-CSE-ConnectionGUID: VmcjLmElSdeXl3on+0k91w== X-CSE-MsgGUID: 9Q9gbBK7RZu/13jyP3vR4g== X-IronPort-AV: E=Sophos;i="6.07,136,1708412400"; d="scan'208";a="19565333" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 18 Mar 2024 22:53:44 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 18 Mar 2024 22:53:35 -0700 Received: from HYD-DK-UNGSW21.microchip.com (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Mon, 18 Mar 2024 22:53:32 -0700 From: Raju Lakkaraju To: CC: , , , , , , Subject: [PATCH net V1 3/3] net: lan743x: Address problems with wake option flags configuration sequences Date: Tue, 19 Mar 2024 11:21:10 +0530 Message-ID: <20240319055110.764002-4-Raju.Lakkaraju@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240319055110.764002-1-Raju.Lakkaraju@microchip.com> References: <20240319055110.764002-1-Raju.Lakkaraju@microchip.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain WOL secure-on and magic packet configuration table: -------------------------------------------------------------------------------- | Ethtool Ops | Send magic packet | Send magic packet | Send magic packet | | | | with password | with wrong password| -------------------------------------------------------------------------------- |WAKE_MAGIC (g) | wake | wake | wake | -------------------------------------------------------------------------------- |WAKE_SECURE_MAGIC| no wake | wake | no wake | | (s) | | | | -------------------------------------------------------------------------------- | WAKE_MAGIC & | | | | |WAKE_SECURE_MAGIC| wake | wake | wake | | (gs) | | | | -------------------------------------------------------------------------------- Fixes: 6b3768ac8e2b3 ("net: lan743x: Add support to Secure-ON WOL") Signed-off-by: Raju Lakkaraju --- Change List: ------------ V0 -> V1: - Fix the wake option flags configuration sequences drivers/net/ethernet/microchip/lan743x_ethtool.c | 3 +-- drivers/net/ethernet/microchip/lan743x_main.c | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/microchip/lan743x_ethtool.c b/drivers/net/ethernet/microchip/lan743x_ethtool.c index 4899582b3d1d..442c52aa0b0e 100644 --- a/drivers/net/ethernet/microchip/lan743x_ethtool.c +++ b/drivers/net/ethernet/microchip/lan743x_ethtool.c @@ -1188,8 +1188,7 @@ static int lan743x_ethtool_set_wol(struct net_device *netdev, adapter->wolopts |= WAKE_PHY; if (wol->wolopts & WAKE_ARP) adapter->wolopts |= WAKE_ARP; - if (wol->wolopts & WAKE_MAGICSECURE && - wol->wolopts & WAKE_MAGIC) { + if (wol->wolopts & WAKE_MAGICSECURE) { memcpy(adapter->sopass, wol->sopass, sizeof(wol->sopass)); adapter->wolopts |= WAKE_MAGICSECURE; } else { diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c index 5641b466d70d..43e8e35fe9d0 100644 --- a/drivers/net/ethernet/microchip/lan743x_main.c +++ b/drivers/net/ethernet/microchip/lan743x_main.c @@ -3639,9 +3639,15 @@ static void lan743x_pm_set_wol(struct lan743x_adapter *adapter) lan743x_csr_write(adapter, MAC_MP_SO_LO, sopass); sopass = *(u16 *)&adapter->sopass[4]; lan743x_csr_write(adapter, MAC_MP_SO_HI, sopass); - wucsr |= MAC_MP_SO_EN_; + wucsr |= MAC_MP_SO_EN_ | MAC_WUCSR_MPEN_; + macrx |= MAC_RX_RXEN_; + pmtctl |= PMT_CTL_WOL_EN_ | PMT_CTL_MAC_D3_RX_CLK_OVR_; } + if (adapter->wolopts & WAKE_MAGICSECURE && + adapter->wolopts & WAKE_MAGIC) + wucsr &= ~MAC_MP_SO_EN_; + lan743x_csr_write(adapter, MAC_WUCSR, wucsr); lan743x_csr_write(adapter, PMT_CTL, pmtctl); lan743x_csr_write(adapter, MAC_RX, macrx); -- 2.34.1