Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5211864rdb; Wed, 13 Dec 2023 02:06:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWlrjXOARvF1xnBAMV9gmC3bP+GLGWO10MHwV7o/UUWbmCD73evMNYLoueaPirtkmMqb4u X-Received: by 2002:a17:902:a9c4:b0:1d0:b4cc:c23b with SMTP id b4-20020a170902a9c400b001d0b4ccc23bmr3695355plr.43.1702462017172; Wed, 13 Dec 2023 02:06:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702462017; cv=none; d=google.com; s=arc-20160816; b=VOtQ/P8izFiFo2kolEqoQnkojqdUGJh6TyOPQ+YbI7fZaYwK+QuZbwRWGrVthmBWhK Ajotv/WN3lMw3GWpwg5a6e1Spin0Lk0kmMNpxzildodrVzOevCKzS8hmcfC6GM3/DRPY PsiSMPo31V6F2eRvx946cpDdqtkxypjbHvOerKMSfTSAe1n4agYLclnmn+8twCVBsxxu 5jpkheEgD2PfGVyBPEb2PdQSUFeCJgZ6Cx7QujfjfqtZRB1pfilmy0ZTSzJ4LZdDynK8 9KJ24WH7vfMF5LXUWIkmMK5/VFAwuV8lVXCH/EdpbQ/n4NGffSZJP2Bm7opImQLSpAd0 YBDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DU16zi8C8rSb8wBiZF7N3q5YkCOaje3ALTOIqa12Rls=; fh=gVH8nV0e0eJWlD2I6Go1oKrYlmUaKejCputZG3Ec86g=; b=gWN0CyuyqW9y7vMQZGlJVTZIyk56wBuH180xSg4Jnv0k9ipvLZwuT3rb51fJbDRGeW EDjUAgX7PCY7NbJO+gDxMDMMkvIizTXBLp6EWbpoQGLfsw3Xz6CeHzhvbsA9UwwKVJJ4 wAu3SMZRVShBsyG44C9refkbJPC7rvJQ9babTqWk8ZlMGDsSDyWBdaSDxZv0gFx1jhQf fP2ShR7lA8KK66Q0bxb2ZiDwLtph1cG3PDq/jd4hQ/U/GTJstAugAaB3fWu/zZWN7ocN Dp06eDyC2VtzLuNeal1lWy87cbbeqNdokir/9flI61iyCCAgaFKfvACjMzHGVohtPNre g9dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=OPwMqNJt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id c7-20020a170903234700b001d1cbbf8ec3si9465981plh.467.2023.12.13.02.06.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 02:06:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=OPwMqNJt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 28E058072A29; Wed, 13 Dec 2023 02:06:56 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235247AbjLMKGp (ORCPT + 99 others); Wed, 13 Dec 2023 05:06:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235223AbjLMKGo (ORCPT ); Wed, 13 Dec 2023 05:06:44 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC9E883; Wed, 13 Dec 2023 02:06:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=DU16zi8C8rSb8wBiZF7N3q5YkCOaje3ALTOIqa12Rls=; b=OPwMqNJtYxJY74GOJZ4kO51X7g CRxANP+hAK0KpzshNF07PUR0Z48SMf9MSWT/vxNbOjCzx/Wtrf3q/8vW5QSwBhIQJfx/rfvBb2cR7 UyOFgxfKlcbSqKAeHanauqtRS+Z0qgc/GTsF6IwSrtXinvZQYH7XCS9lSvPYYpeNkLgM=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rDM8Y-002nvF-5G; Wed, 13 Dec 2023 11:06:42 +0100 Date: Wed, 13 Dec 2023 11:06:42 +0100 From: Andrew Lunn To: Christian Marangi Cc: Pavel Machek , Lee Jones , "David S. Miller" , Jakub Kicinski , Daniel Golle , Li Zetao , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, Marek =?iso-8859-1?Q?Beh=FAn?= Subject: Re: [PATCH] leds: trigger: netdev: display only supported link speed attribute Message-ID: <8cb5f20f-f9da-4d26-af2d-f63771990fd3@lunn.ch> References: <20231209150724.25565-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231209150724.25565-1-ansuelsmth@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Dec 2023 02:06:56 -0800 (PST) On Sat, Dec 09, 2023 at 04:07:24PM +0100, Christian Marangi wrote: > With the addition of more link speed mode to the netdev trigger, it was > pointed out that there may be a problem with bloating the attribute list > with modes that won't ever be supported by the trigger as the attached > device name doesn't support them. > > To clear and address this problem, change the logic where these > additional trigger modes are added. > > Since the netdev trigger REQUIRE a device name to be set, attach to the > device name change function additional logic to parse the supported link > speed modes using ethtool APIs and add only the supported link speed > modes attribute. > > This only apply to the link speed modes and every other mode is still > provided by default. Deleting the file and then re-creating it is not so nice when handling user space. Have you tried this while holding the file open? Please take a look at the is_visible() method of a sysfs group. If it returns 0, the file is simply not visible in sysfs, but it still exists. It is not a problem if a process holds it open when it becomes invisible. Andrew --- pw-bot: cr