From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 426C318787A for ; Wed, 13 May 2026 09:54:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778666084; cv=none; b=M4PfI8qTsxLazTQbP/iiLGHeuzq+UOCuL3oFjz/Yzw4crcpJNp0fVTrbILH/5gwFHOVZOI2NAi7UEryLAcKiUnJLxeII14Ulagq+DXZUQDI0r6EBsescmto02ssEnCh9CNGw4nzCcAO0rHyEvLft+QJ4Dzp9yWRPYU9bKF4dH6g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778666084; c=relaxed/simple; bh=UWJRzOzDyTTy2s4vpUyoCVqhn90+eaQ6v3y9xCs3UKw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nvHbZFW7IvUgIBlqq/mbC+Y3B8MK7i0X2ZShG1QMP83HJuzupN0pN8ZYJ6ClKqGjoGM11XX1C18c3iY4kn5y9t801x33MZZSesUtcst7jjoL6wi7k7RtLpH7x+4TD1YlMTfKhuENSzSJwBG9+QdbAmP/DPP7Bmo1ul4IhjmD+Ic= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=oCOgbjTw; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="oCOgbjTw" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1FAFB165C; Wed, 13 May 2026 02:54:37 -0700 (PDT) Received: from localhost (e132581.arm.com [10.1.196.87]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E9AF83F85F; Wed, 13 May 2026 02:54:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1778666082; bh=UWJRzOzDyTTy2s4vpUyoCVqhn90+eaQ6v3y9xCs3UKw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oCOgbjTwS8vi1BGeruL32b3lnoaIlpNYKhd29rq/t6HD9KV2el5KQB0SACjYlHeZW lwOaKpIMZ8ZsF8WsNzBFhcvqskAUn7oQ/hSAZxECMMvxt8nsNpjPHPsW10mbwhI/Lf d8gwjnSxfR7wuTBnsBdRYFGjiwZeYrY2nsnrw9tU= Date: Wed, 13 May 2026 10:54:39 +0100 From: Leo Yan To: James Clark Cc: Suzuki K Poulose , Mike Leach , Alexander Shishkin , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] coresight: trbe: Hide enable_sink sysfs file Message-ID: <20260513095439.GD34802@e132581.arm.com> References: <20260507-james-cs-hide-trbe-enable-v1-1-b4e40439f44c@linaro.org> <20260513081551.GC34802@e132581.arm.com> 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 In-Reply-To: On Wed, May 13, 2026 at 10:33:40AM +0100, James Clark wrote: [...] > > > +static umode_t coresight_attr_is_visible(struct kobject *kobj, > > > + struct attribute *attr, int n) > > > { > > > struct device *dev = kobj_to_dev(kobj); > > > + struct coresight_device *csdev = to_coresight_device(dev); > > > if (attr == &dev_attr_label.attr) { > > > if (fwnode_property_present(dev_fwnode(dev), "label")) > > > return attr->mode; > > > else > > > return 0; > > > + } else if (attr == &dev_attr_enable_sink.attr || > > > + attr == &dev_attr_enable_source.attr) { > > > + if (csdev->no_sysfs_mode) > > > + return 0; > > > + else > > > + return attr->mode; > > > > I'd prefer no_sysfs_mode to work as a general flag rather than being > > limited to sink/source devices only. Otherwise, LGTM. > > Which other files would you hide though? These are the only two that I could > think of. > > I wouldn't hide all sysfs files for 'no_sysfs_mode' as there are read only > things that aren't strictly related to sysfs mode. In coresight-sysfs.c, there are two kinds of attributes: the label and the sink/source enable knobs. The label is already handled separately. So we can hide the rest attributes when no_sysfs_mode is set? Thanks, Leo