From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62391CAC5A7 for ; Tue, 23 Sep 2025 08:20:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sx3JnukKcin3hQdFQWZ5JtPeTp2j19rhqeAQMxkJ/LQ=; b=RvfdHrVx3X6UbjnISPs7D4UeT7 Cu47ezXFL973GxqT6shjurpZXTV/Epc5y/8xszcZUDQXD7QTSnEHSWsaqBng3HvD/eM5in9E0l3Ew //uuk+GSkOtQGqtCBH8ch2lyTsHZ3N4cZBd6zPJfFBq9FmZrMNFQgHR1HvEfHOk+AA8wog/5ctrhW NlEZL6ur6wTh/NKqOVhoO+tWpRGIutJ+mSPKwZl6T9S6vb9RiuYRxyB2cfoGsBR+lRTGVhyy9A+Ps YP2zG8gELvdnllNrASco4CNzSd1ZywvXunDU2+9LwUyArp1DGvvcn10aNRZynm0V1sSSrcWGl1+sa q69DZyIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v0yG7-0000000CnOO-0ptu; Tue, 23 Sep 2025 08:20:23 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v0yG2-0000000CnMk-2UCQ for linux-arm-kernel@lists.infradead.org; Tue, 23 Sep 2025 08:20:22 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58N81mXD015882; Tue, 23 Sep 2025 10:20:07 +0200 Received: from pa4pr04cu001.outbound.protection.outlook.com (mail-francecentralazon11013054.outbound.protection.outlook.com [40.107.162.54]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 49b7pf3g3a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Sep 2025 10:20:07 +0200 (MEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=B8yC2eEY6lpYfxXnoCYUavI738eapqkRQ6sScmrjM6IlrPTUp21r1lKva2VCEpEH1fV+fgoP9vOuzjLrHL8GDLrDORJLuMz1DGuR0IMUZDMEbUsxXKKFWhmenqwwTt9tNDHIz5C0MbOBlbq4UL5ToWqip6LdKawNghGjpvQuwxlubjowgIiRq6fMD2I/3QiCCYeh5kk6X+uL4Ym6R86mUEA98C2PHzQgt1TgoVNb0n6KidPVm9VHE0sKrj9s1MwrCeY78y/rjRqHz1Wclat+s9fJCU5dBLZI0w2h++JAZUHAyOqTNM/d9AXexpmwxh9Duscl+7qawyJU4bm8p4giDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sx3JnukKcin3hQdFQWZ5JtPeTp2j19rhqeAQMxkJ/LQ=; b=PNmjEPbYOwsg7RKWuZdFek8RNX7sRE05xjRSEt+fpjmqNvWYk5bS7CjsLsExQ9DdGO37XI501dDrh/h3kisVrJjSd/8FnM4t5MBjyBewe5xxGGUR1m8b06xeoiyXbzgrqXWlfbnSHXaDvU2Ur9evN0HY8PaewBvlrq8lw8jRHXOQscUIGFgdMDUHJCjKxr7XuqOQ2rA9k5t86zQdOB2PcmaYmK3QTFCTNYysS05ErnGrnnMRtM2JQMM+QWVC9+/UFYC8uKBKm6FeD2qAcsJQiTRXldCs8kNML6ixfXOCX8ZTqHJd/jo+3Pk0GExl6//vtRy+4mEa33Fjhjfv/na7bw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 164.130.1.44) smtp.rcpttodomain=lunn.ch smtp.mailfrom=foss.st.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=foss.st.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sx3JnukKcin3hQdFQWZ5JtPeTp2j19rhqeAQMxkJ/LQ=; b=gVpn7jA21WYyV0MCy4szjDY7w//DGhlHt+crdvGI4MyBEC9OoOZ1/LbuMEZjJU7ZwqZyyay59ixDCt+Jf1cTy7HacyV83Pxvb8ayihqnKKGmuAIp9PTLpHDP6FicVcJEbF39ltpkFrNupDYDjEJCVZFWWoSBQUPkjk0Xc5SgCYqUWMyI5kOyGkBYOeFlEm2nrP6h1unFRnHz6omDXFRQ5mGRP2KdtN9uKr5agepayQx4NUsi+DsZViuw+K52U4dat/So/uaUMbHzZ0oXEiCIMAS8dYwuVQC8WfuNMDfK+yHxzqyP4C+lnTGBTOFh4iYCMl71ppmlw70ulmNxVLPnxw== Received: from DUZPR01CA0299.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b7::10) by DBAPR10MB4059.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:1cc::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9137.19; Tue, 23 Sep 2025 08:20:05 +0000 Received: from DU2PEPF0001E9C1.eurprd03.prod.outlook.com (2603:10a6:10:4b7:cafe::2a) by DUZPR01CA0299.outlook.office365.com (2603:10a6:10:4b7::10) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9137.20 via Frontend Transport; Tue, 23 Sep 2025 08:20:10 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 164.130.1.44) smtp.mailfrom=foss.st.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=foss.st.com; Received-SPF: Fail (protection.outlook.com: domain of foss.st.com does not designate 164.130.1.44 as permitted sender) receiver=protection.outlook.com; client-ip=164.130.1.44; helo=smtpO365.st.com; Received: from smtpO365.st.com (164.130.1.44) by DU2PEPF0001E9C1.mail.protection.outlook.com (10.167.8.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9137.12 via Frontend Transport; Tue, 23 Sep 2025 08:20:05 +0000 Received: from SHFDAG1NODE1.st.com (10.75.129.69) by smtpO365.st.com (10.250.44.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.57; Tue, 23 Sep 2025 10:12:44 +0200 Received: from [10.48.87.141] (10.48.87.141) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.57; Tue, 23 Sep 2025 10:20:03 +0200 Message-ID: Date: Tue, 23 Sep 2025 10:20:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v2 2/4] net: stmmac: stm32: add WoL from PHY support To: Andrew Lunn CC: "Russell King (Oracle)" , Andrew Lunn , "David S. Miller" , "Eric Dumazet" , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Alexandre Torgue , Christophe Roullier , Heiner Kallweit , Simon Horman , Tristram Ha , Florian Fainelli , , , , , References: <20250917-wol-smsc-phy-v2-0-105f5eb89b7f@foss.st.com> <20250917-wol-smsc-phy-v2-2-105f5eb89b7f@foss.st.com> <72ad4e2d-42fa-41c2-960d-c0e7ea80c6ff@foss.st.com> <46f9bdf8-a35c-4e94-9d4d-c87219444029@lunn.ch> Content-Language: en-US From: Gatien CHEVALLIER In-Reply-To: <46f9bdf8-a35c-4e94-9d4d-c87219444029@lunn.ch> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.48.87.141] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE1.st.com (10.75.129.69) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PEPF0001E9C1:EE_|DBAPR10MB4059:EE_ X-MS-Office365-Filtering-Correlation-Id: b6bc1368-e908-4002-2812-08ddfa7a002c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|7416014|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?B?cEhKakh6dXRYS0c2ZjhiQXJwNVpvMm9kdFJ3NDJMRkhBUSt3SlFWZ2RhVExG?= =?utf-8?B?QmpBOEREcG52ZlFVQ3VsazBJb2hOUkgrbnlTUGZCc3VZVGhzcHhxSlNET25k?= =?utf-8?B?SW9XbkxGTmI5Uzg0ZElydTJQSTh4WmpLVnBLYkVFdFBUTlNqQjB0aHRBd3VF?= =?utf-8?B?RVNtMm9mRVVjU0Jyc3ZwVFA5ZXk0K0VtOHhHVjNUcVVrOFVCMUFWTnVVL1Bh?= =?utf-8?B?N3hoNFpVc1g3c092L0QrUUV0eVhEUDU5aTZ1Y0ZkZStqe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RY:IT;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:smtpO365.st.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(7416014)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: foss.st.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2025 08:20:05.1205 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6bc1368-e908-4002-2812-08ddfa7a002c X-MS-Exchange-CrossTenant-Id: 75e027c9-20d5-47d5-b82f-77d7cd041e8f X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=75e027c9-20d5-47d5-b82f-77d7cd041e8f;Ip=[164.130.1.44];Helo=[smtpO365.st.com] X-MS-Exchange-CrossTenant-AuthSource: DU2PEPF0001E9C1.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR10MB4059 X-Proofpoint-ORIG-GUID: VtkRA6V57Kanfe_j4AjST6aPkFkBMBgT X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTIyMDEzNSBTYWx0ZWRfXx6qMbWoDhfCb MxPI8JUtBAEbEOats4q2VUq5Zpbeaul7afHyZXSdioOizW3nrllz0jyrKqXGEp0qCghvwoiguQ9 GoxIj7pFajJ9It7SsNaugO8v0mA+55G8GIoxUAPNnhi+UaA6Byau1JZ0JOZFoU7uAxT3gjq0Jim s0JW/IuVeJ+PJ1CJQckIxZYeAhPjf/kxo06i7vJmuYur3y3eZPNsspXYz+QOQJSFV7PCpp8kEdo FPpY0el/ePESiRVjFfPaGsDLxSXFijgx+3OwdTR+cxNzTDNK6askpJDd01Xmo4A7hK4Bg8ZXFTE gRv3vWQoDnBgqocJ84al0H412sEXv0WaV9O3bGpn7GDk4zAoYeZ8kMAFEfMSLEeTrzIVrSBBTwL YlZudpij X-Authority-Analysis: v=2.4 cv=IvYecK/g c=1 sm=1 tr=0 ts=68d25837 cx=c_pps a=+ohsn0u86qlID4FyhhUwTg==:117 a=Tm9wYGWyy1fMlzdxM1lUeQ==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=h8e1o3o8w34MuCiiGQrqVE4VwXA=:19 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=ei1tl_lDKmQA:10 a=IkcTkHD0fZMA:10 a=yJojWOMRYYMA:10 a=s63m1ICgrNkA:10 a=KrXZwBdWH7kA:10 a=E3GHTLob2G1mBu3on-8A:9 a=QEXdDO2ut3YA:10 X-Proofpoint-GUID: VtkRA6V57Kanfe_j4AjST6aPkFkBMBgT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-23_01,2025-09-22_05,2025-03-28_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 adultscore=0 clxscore=1015 impostorscore=0 phishscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509220135 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250923_012019_231346_095DA881 X-CRM114-Status: GOOD ( 27.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 9/18/25 17:34, Andrew Lunn wrote: >>> Andrew has previously suggested that MAC drivers should ask the PHY >>> whether WoL is supported, but this pre-supposes that PHY drivers are >>> coded correctly to only report WoL capabilities if they are really >>> capable of waking the system. As shown in your smsc PHY driver patch, >>> this may not be the case. >> >> So how can we distinguish whether a PHY that implements WoL features >> is actually able (wired) to wake up the system? By adding the >> "wakeup-source" property to the PHY node? >> >> Therefore, only set the "can wakeup" capability when both the PHY >> supports WoL and the property is present in the PHY node? > > There are layering issue to solve, and backwards compatibility > problems, but basically yes. > Ack > I would prefer to keep the phylib API simple. Call get_wol() and it > returns an empty set if the PHY is definitely not capable of waking > the system. Calling set_wol() returns -EOPNOTSUPP, or maybe -EINVAL, > if it definitely cannot wake the system. > > However, 'wakeup-source' on its own is not sufficient. It indicates > the PHY definitely can wake the system. However, it being missing does > not tell us it cannot wake the system, because old DT blobs never had > it, but i assume some work, and some are broken. > > We need the PHY driver involved as well. If the driver only supports > WoL via interrupts, and phy_interrupt_is_valid() returns False, it > cannot wake the system. > > There other tests we can make, like device_can_wakeup(). In the end, > we probably have some cases where we know it should work, some cases > we know it will not work, and a middle ground, shrug our shoulders, it > might work, try it and see. > >> However, this does not solve the actual static pin function >> configuration for pins that can, if correct alternate function is >> selected, generate interrupts, in PHY drivers. >> >> It would be nice to be able to apply some kind of pinctrl to configure >> the PHY pins over the MDIO bus thanks to some kind of pinctrl hogging. > > I don't think it needs to be hogging. From what i remember of pinctrl, > when a driver is probed, pinctrl-0 is activated. It is not limited to > pins which the driver directly uses. So if LED2 is connected to a pin, > pinctrl can at least select the needed function for that pin. > Ok, I'll see where it takes me in a separate patch-set. Thank you for the feedback and clarifications. Gatien > Andrew