Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp1039782lqo; Thu, 9 May 2024 03:01:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWhHVfXi/l0Vq4/+8vDN8yRf4hP6ccdrRdcL/Ne6tieuepJQGnlIjhcMEvt6t01CIoSjHOxipzyJRXPsJCMg+CjrtHEoOljU1VubtAF0w== X-Google-Smtp-Source: AGHT+IFQ9v6hw6rpY3e8rRlbqAt6A1s3+pOr5fsc7qlkJtxU2QqVxL1qrRCaryQW58z8/wjSb3Cr X-Received: by 2002:a05:6102:12c5:b0:47b:c864:fd78 with SMTP id ada2fe7eead31-47f3c3b5698mr5002251137.34.1715248874891; Thu, 09 May 2024 03:01:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715248874; cv=pass; d=google.com; s=arc-20160816; b=z5laP/Jnw+maj/CS6XWbQkJVRHqRokUGCJWXmQkIsMRpHDmiuyhMsnUGf9oCb2D/EV ZK4gi9WIfYdY5rn6UKx8n/hyu0fW5MFAx81ARgeqVMzsCg0eILl4bvgDPtbhFhQEIpAY HEHiSRN1bFKKYWLs7V31jzt+jzgvTjPFZ1iKBglpD2oOxy+IfMreTsx10Tw1rOwCm0rm 8DrI8puMbAJgxHrxRGqJGIHUnJFrNofi9a3GbaaFuRwEoLlyUJDIaIkjjyUuqb+mlqHv 8G9MwJGiTC9d9duQYvPzbvroIBTfNBSB+/kroCe0+CDj2AEcfbqFEmVdF6RR2zQ9hcJv iN7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:to:from:date; bh=qYariv+2IPYeiFMF9jPq1PNwzTekWfkmLH+BVktv9zM=; fh=i8IoTUdColF1R8Hz74hg91SusZXhqHBQpTMKTxzGx2g=; b=O/HeEezrx98qvOsLYjlKpQZ3KYVdfFf+UUgNH7kQw/IwXFjXV1AQs3pP7IiEP81Oy4 JirGxJ4Wjil8kBVYaVVMOOJl/iTVFU+XgbcNZJdBowUGwTKzbBzKI8yHD+doM6fmhnsr yTEs1WuibX7M/eIWH8m766fbr9T+v5Uk2E2XyMVq0FeyYgIjyccICtdQJXhbzjT1GzUK L16TSSjgveHJdUR46uy8+DZKY+Xhq54YBu1ozibdNH890mLj/A1aYcQ1rspsuxLBoW57 EgRYjvs9m4fypb05l0gtjDGyfswY5RXBnX4MbSVbMR81IRI3YnXi8zBA1sQBZgyvxJTG KsTw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-174384-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174384-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43df56dc756si9917361cf.738.2024.05.09.03.01.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 03:01:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174384-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; arc=pass (i=1 spf=pass spfdomain=makrotopia.org); spf=pass (google.com: domain of linux-kernel+bounces-174384-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174384-linux.lists.archive=gmail.com@vger.kernel.org" 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 9BCBE1C220A0 for ; Thu, 9 May 2024 10:01:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED6A214AD3A; Thu, 9 May 2024 10:01:06 +0000 (UTC) Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) (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 A1CF714A600; Thu, 9 May 2024 10:01:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.142.180.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715248866; cv=none; b=Te9K6JV4zg9Jm33/6clEBGeVUF3GVQ5r9A3OlIkYeIir9F1wjbHvsnG6S1eKsUemQJ2Yw9XzNLmMPAZNtfMn+4zofuG7QVE++4f8ANuT4gN2849ADuL65d9VnckydSPAIKNRcEc0crWM9SApXo2JNSzD8nfS8E5tOu6XRyddenM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715248866; c=relaxed/simple; bh=08JimUmQRxTjn4B+q3auuFtqKI5+6brRqqK5PHYKf7Y=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=NpRz1NssUTt4kKFOzBfhaZLb88NioEfz163TTRNWNal+8LMLxT3r5SGHbq6uxV+u+dKmeZfHt1Jg0a9vgZV1uP1ghAdeAO4wn14Bipg4TX1OMufteZ3ks1HHLgQoSJu8i8x896CZyBN77JW70jYJIqkOJsijTxzI8BBnRY11zh0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org; spf=pass smtp.mailfrom=makrotopia.org; arc=none smtp.client-ip=185.142.180.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=makrotopia.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=makrotopia.org Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.97.1) (envelope-from ) id 1s50a2-000000006oK-40ff; Thu, 09 May 2024 10:00:51 +0000 Date: Thu, 9 May 2024 11:00:42 +0100 From: Daniel Golle To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Eric Woudstra , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2] net: phy: air_en8811h: reset netdev rules when LED is set manually Message-ID: <5ed8ea615890a91fa4df59a7ae8311bbdf63cdcf.1715248281.git.daniel@makrotopia.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Setting LED_OFF via brightness_set should deactivate hw control, so make sure netdev trigger rules also get cleared in that case. This fixes unwanted restoration of the default netdev trigger rules and matches the behaviour when using the 'netdev' trigger without any hardware offloading. Fixes: 71e79430117d ("net: phy: air_en8811h: Add the Airoha EN8811H PHY driver") Signed-off-by: Daniel Golle --- v2: send to net-next instead of net tree because driver is present only in net-next tree. Improve commit description while at it. drivers/net/phy/air_en8811h.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/phy/air_en8811h.c b/drivers/net/phy/air_en8811h.c index 4c9a1c9c805e..3cdc8c6b30b6 100644 --- a/drivers/net/phy/air_en8811h.c +++ b/drivers/net/phy/air_en8811h.c @@ -544,6 +544,10 @@ static int air_hw_led_on_set(struct phy_device *phydev, u8 index, bool on) changed |= (priv->led[index].rules != 0); + /* clear netdev trigger rules in case LED_OFF has been set */ + if (!on) + priv->led[index].rules = 0; + if (changed) return phy_modify_mmd(phydev, MDIO_MMD_VEND2, AIR_PHY_LED_ON(index), -- 2.45.0