Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp668354lqt; Mon, 18 Mar 2024 22:58:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWNCfb5JGelNl0lo0j2XzadLKz/VuCCiIv0fGGjViftXF5gJTtYT3lUSEKoxTaptozkTKTa1cXbMXno6RiaIhaAFI8DmVC+BlsIAoe4ZA== X-Google-Smtp-Source: AGHT+IEfU4Vaf6M7gMFGUFVOmCAQWJJ1fRYp+auH6MgFcOko4CkOXKKwvT0UAs2sG81oE424WYxR X-Received: by 2002:a05:620a:4c8:b0:78a:f3:34eb with SMTP id 8-20020a05620a04c800b0078a00f334ebmr1945451qks.23.1710827881585; Mon, 18 Mar 2024 22:58:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710827881; cv=pass; d=google.com; s=arc-20160816; b=xO6y1t6RwQFMRZ01xfCbU0NofQaeCpJEbGyWiZTrlKiiE+EyBdeCV/an34lCnL2jNv +OdKpV4q7Oyzr+gMkYHSDyI6uLAEkvh5ItlN3u3LeM/hSluKWFOa2uPXnhaSW1DCWbY6 rFEFGuc1tpPBatVizGpiBucUCPsI6Uo3lKyMoG4sSKV9qMryAHzrox4hGkGNfTl6cVDy dIvlH9/9UcUqGFd2IzRWXtMFILzmaV9h1pONFd/stbXtxvsuXAVPc/6RmYtz7oBJmCWt +O0lQA785ELWhZ2/8HvFxL48AURJ5giDC465Pcl0WarRwGRLOX6Ag72ryZTPHFoGPkgy wyHA== 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=qU1YuUK2usTBD/oNselE+jGBp9HJ4AnoBfn+br6909I=; fh=CuRdiZHnupyxsyVt43idodkUN01kmsjbYke869r1y38=; b=MC6EmGv7nle54FZlFdrezqO6RxrvK+FB9UV4n+MLDei3FHX3reShij6+SzE9AMYlaI 4qMOfsRlLqxwS9rxV9YsBjysVsWsDrqUa/4qeRvSHU5fngMdYjwvzjlQ+OgLESZAm/t5 nfjIs2idnD9lIkkgEIRyAcZNXYv1LVOb4Lp+tMF0+vzwwoDnGRaq/7LT5Ckt+j8+Ywm8 i7f4jJL5RcLetXz794E/DyFLCeETglrE8Im/FjCX1WqX1aJU9NMhYrTCxgVwEwDSD+FP 2JtabuBewrU8Un9TnDr8joNDJROxTjO8qre+HVJiVaKZENsH1f2alIh/PBo90yurSsxc hqMA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=j2Q3ISZN; 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-107052-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107052-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id x1-20020ae9e641000000b0078a0e622dbdsi1423911qkl.599.2024.03.18.22.58.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 22:58:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107052-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=j2Q3ISZN; 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-107052-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107052-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4F2C21C219B2 for ; Tue, 19 Mar 2024 05:58:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6BB8F7CF29; Tue, 19 Mar 2024 05:53:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="j2Q3ISZN" 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 9284E53378; Tue, 19 Mar 2024 05:53:45 +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=1710827627; cv=none; b=vCuK3hAg7AE5Y7jKS4ZOGT8ZJCd6AQK7VchWnBXQ4shzTP29FGRwjgP8UuxeIQp3o5Av5rSXKxJcD3jLskltJN1RzxxWYNY4aiOte0Rdjqkop7HuItsd8D7UBCqZDHc9BzrX1ab4s1fxv57UO2Cm5WA1yRMv1nHzXukOiXyD+RY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710827627; c=relaxed/simple; bh=C1KTS43iNb7xCJMeLZHV/iIX5f8wXoKRqUfcQWPIpVg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=GtqUKkL3emuYKJBLtcoG84nUXjmGK1FouJbZ49k/1bfxmyTdWhRBfSmbx4IQWMKk5DU2Vjb3S2FCXPUOhG60jTeNR7Iw0Kp8rGNRO6aBP+5ITlwQO8qqAMRSsF+xjVFtUPP8D7nyfG01xNAQYhgg/v/W3pe01W3HS6ClqONVvpM= 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=j2Q3ISZN; 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=1710827625; x=1742363625; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=C1KTS43iNb7xCJMeLZHV/iIX5f8wXoKRqUfcQWPIpVg=; b=j2Q3ISZN6LpZxcIfejtGpep1Kx5/XtD2AEu5PpJB296KS8+04SwIVhaX PDS88IxUnslPrgm50d0rEsuCFfVwYrTJwvDHna3F0p7ZI6BtIx0ib08P8 UEmSezsWI0kRANsx7lptr3OEzFH4a1B3n48nsgL4hOkljVmrSQwk0Ie/E 2R3Q83F+Cjmmc29Re3/OSQP1IR6hunHWWbFWPvpsrjckMjZJADKkBvMg5 e8Jp+XbxfTrWaagfskjANY/YFzNGrxQsGT1rDx17mCIzL1AYz8DjjVW5z P2W9lm4b8b5nFGLK8ibIXjA6qBfS3i9Y26FwOS/mgkkgUSZxaJo9e5TGC Q==; X-CSE-ConnectionGUID: VmcjLmElSdeXl3on+0k91w== X-CSE-MsgGUID: XBVubKrHSiG17DUa7pipdQ== X-IronPort-AV: E=Sophos;i="6.07,136,1708412400"; d="scan'208";a="19565327" 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:43 -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:31 -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:28 -0700 From: Raju Lakkaraju To: CC: , , , , , , Subject: [PATCH net V1 2/2] net: lan743x: support WOL in MAC even when PHY does not Date: Tue, 19 Mar 2024 11:21:09 +0530 Message-ID: <20240319055110.764002-3-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 Allow WOL support if MAC supports it, even if the PHY does not support it Fixes: e9e13b6adc338 ("lan743x: fix for potential NULL pointer dereference with bare card") Signed-off-by: Raju Lakkaraju --- Change List: ------------ - Change the "phy does not support WOL" print from netif_info() to netif_dbg() drivers/net/ethernet/microchip/lan743x_ethtool.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/microchip/lan743x_ethtool.c b/drivers/net/ethernet/microchip/lan743x_ethtool.c index 8a6ae171e375..7509a19269c3 100644 --- a/drivers/net/ethernet/microchip/lan743x_ethtool.c +++ b/drivers/net/ethernet/microchip/lan743x_ethtool.c @@ -1163,6 +1163,17 @@ static int lan743x_ethtool_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) { struct lan743x_adapter *adapter = netdev_priv(netdev); + int ret; + + if (netdev->phydev) { + ret = phy_ethtool_set_wol(netdev->phydev, wol); + if (ret != -EOPNOTSUPP && ret != 0) + return ret; + + if (ret == -EOPNOTSUPP) + netif_dbg(adapter, drv, adapter->netdev, + "phy does not support WOL\n"); + } adapter->wolopts = 0; if (wol->wolopts & WAKE_UCAST) @@ -1187,8 +1198,7 @@ static int lan743x_ethtool_set_wol(struct net_device *netdev, device_set_wakeup_enable(&adapter->pdev->dev, (bool)wol->wolopts); - return netdev->phydev ? phy_ethtool_set_wol(netdev->phydev, wol) - : -ENETDOWN; + return 0; } #endif /* CONFIG_PM */ -- 2.34.1