Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1166101rbb; Mon, 26 Feb 2024 00:14:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWXtz/WBPSZ7TWnj36MQVQT38AVTegz3C/BJklw1kZqunXCunK3B+PJ6QoG1mAE6x5BjuNJ2jZwY/1fopJgeHQDzfi7mI48XdKptBhu2w== X-Google-Smtp-Source: AGHT+IFMiQaGTIbL7tajG2f+vH4nHxRZXRsCJG33a+YdUbep5sb489zkfJ0H3dh+UPz6y6c/KHtA X-Received: by 2002:a17:903:2342:b0:1dc:30d7:ff37 with SMTP id c2-20020a170903234200b001dc30d7ff37mr8673191plh.42.1708935265823; Mon, 26 Feb 2024 00:14:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708935265; cv=pass; d=google.com; s=arc-20160816; b=hJgKj5xa/BR6wM5KvqIhjl+rdq8ig9UYuXZCuX8QzZWoR288JiEH54fAWc0suF895T 9rix+MtgCq5Jy5i7Yjk9nja0ojAN4xTbUj6oqMEBkztcdvfNMEktrCcyrNR5n22va+kI woewS9kBxIE6sRwgF3kIq/8vk4EAOUYHHdNvB8IZVbDuXblVcrDuKg9jbkHgTh3ttjF5 e+rroUxDtVrpylfFvNYJLhZskRAkruCnVzSygjm8aQg/vRsMImDDrU60EO8Z22+I2w1W hd8p7YWdLavP8TgfEniAzvibeBrcRT3pUe38zcSQ1Ba/8j35DDeesPM1nva4Lp6vq0w8 KVRQ== 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=PLmxaGFx/aCKZqWM20Lk5eNgYq/n0aOk5ncRaTReads=; fh=t5mU/efashKLQFDT0uAK2M58u5ivElUsCaq9ZfgpCqs=; b=tJUvbe9m+CVfJ+IdcfcWPnVgHzKXigAdqNxsz6VwHCDxTvJE0ek4BeruiNBF+nuM2a Mice+yMvwFwinmoN3WY6HwuqwEA4puX1NmYeTE/azqEyOFEpfNAqSD8M6WYN6sr7Rdby 0Jr42Rb+C4AkCTCHZMc++yEeb/CqStCXO00iyCeMkXr4nr4XSJiT1T0bzXRtAHjDt6b6 gC9et2aMOvV/P7uPVgt2faILurShR/SA7dtyN5K37vx/XZHfH71qBRAO16hLAOrm/mCn arr4wgC295FtTw4PawNZmMH77S+tjcCFq3ESsYcv42pr/lIHpTvf66CeP/33BiF6j0bI mWFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=qBZnUCsK; 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-80731-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80731-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id a11-20020a170902eccb00b001db29e3ba29si3383988plh.77.2024.02.26.00.14.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 00:14:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80731-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=qBZnUCsK; 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-80731-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80731-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 4E786B228EB for ; Mon, 26 Feb 2024 08:12:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DEC5B1CD28; Mon, 26 Feb 2024 08:11:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="qBZnUCsK" 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 82C491C6B9; Mon, 26 Feb 2024 08:11:42 +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=1708935104; cv=none; b=uvRxYOY5CxbyAXiMottH2EzQAq6IY2cG1UIT1m5Nfx0HZiqgpbzxerBUpEPvDG7bt/4EVTfrHUsVnEX28UP24n/5sA5UwFXOc1kYdcLptVtKVlQsfCfhNO50gRib593S9MbuLFdQ2wU+jKE8WMWL9GVgZhgT01SK0FIF7eoywO8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708935104; c=relaxed/simple; bh=lyIH/iR0IvIHyZ54d9mVMoKqHxpDbkSiGX45uKepstw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fmhO+9o1R/K08SNmSY9rPu6P+3/zkUhvATocd0Kxb2+GGp+JDIu+AefP+m6xPD+DHD5zEynNRyRAAvRg550mcfbOZECyk12jgyX543VzhJNTksj0PwrlO92SkahmtWAXA52cJBlQ0aCPX1LkHrGrnIr2HFJBnsjsWvfklfsY+Wg= 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=qBZnUCsK; 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=1708935103; x=1740471103; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lyIH/iR0IvIHyZ54d9mVMoKqHxpDbkSiGX45uKepstw=; b=qBZnUCsKO+XJpqvKDngomdZSfMhBWqP7cdqEwNmBvGJAim9/yE+UDENv 1h5+PaFw6gor03n/qv4n27tKnlvmIZY8QtC3kuO8K4y8fw22qYNSTFyNe GEIdLDxzknNwEanIcHUWX117q5ld2Wg4TlSKLDitxMXAVzJHg5u6LsXN5 oGECXIPt6Xbq0BCsvLO1XPE3F5j5XJvajzN1q6URyB/HxPmU8CnWvB5gV sChuEzhBNv6kMbQRgTvFVPecDxWZA6lnJEJGUVH6anii707YFVDPGge5X zxl6HFBTYGfu530HG8bA8jhsdAmTcrveZgXqiCGZvxiT7rzIf9QSUS77U A==; X-CSE-ConnectionGUID: Af2UcUQzQhuuU426y0lnaA== X-CSE-MsgGUID: 22CCoZfJTlWOgv32FyoUxg== X-IronPort-AV: E=Sophos;i="6.06,185,1705388400"; d="scan'208";a="247559925" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 26 Feb 2024 01:11:39 -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, 26 Feb 2024 01:11: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, 26 Feb 2024 01:11:32 -0700 From: Raju Lakkaraju To: CC: , , , , , Subject: [PATCH net 3/3] net: lan743x: Address problems with wake option flags configuration sequences Date: Mon, 26 Feb 2024 13:39:34 +0530 Message-ID: <20240226080934.46003-4-Raju.Lakkaraju@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240226080934.46003-1-Raju.Lakkaraju@microchip.com> References: <20240226080934.46003-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 Wake options handling has been reworked as follows: a. We only enable secure on magic packet when both secure and magic wol options are requested together. b. If secure-on magic packet had been previously enabled, and a subsequent command does not include it, we add it. This was done to workaround a problem with the 'pm-suspend' application which is unaware of secure-on magic packet being enabled and can unintentionally disable it prior to putting the system into suspend. Fixes: 6b3768ac8e2b3 ("net: lan743x: Add support to Secure-ON WOL") Signed-off-by: Raju Lakkaraju --- drivers/net/ethernet/microchip/lan743x_ethtool.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ethernet/microchip/lan743x_ethtool.c b/drivers/net/ethernet/microchip/lan743x_ethtool.c index 4899582b3d1d..cda4df2ac1cd 100644 --- a/drivers/net/ethernet/microchip/lan743x_ethtool.c +++ b/drivers/net/ethernet/microchip/lan743x_ethtool.c @@ -1165,6 +1165,16 @@ static int lan743x_ethtool_set_wol(struct net_device *netdev, struct lan743x_adapter *adapter = netdev_priv(netdev); int ret; + if (wol->wolopts && wol->wolopts != adapter->wolopts && + adapter->wolopts & WAKE_MAGICSECURE) { + wol->wolopts |= WAKE_MAGICSECURE; + netif_warn(adapter, drv, adapter->netdev, + "Ensure secure-on magic packet remains enabled if not explicitly disabled\n"); + } + + if ((wol->wolopts & WAKE_MAGICSECURE) && !(wol->wolopts & WAKE_MAGIC)) + return -EINVAL; + if (netdev->phydev) { ret = phy_ethtool_set_wol(netdev->phydev, wol); if (ret != -EOPNOTSUPP && ret != 0) -- 2.34.1