public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH net v1] ptp: Make max_phase_adjustment sysfs device attribute invisible when not supported
@ 2023-06-27 23:21 Rahul Rameshbabu via ltp
  2023-06-27 23:33 ` Nathan Chancellor
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Rahul Rameshbabu via ltp @ 2023-06-27 23:21 UTC (permalink / raw)
  To: netdev
  Cc: Linux Kernel Functional Testing, Richard Cochran, lkft-triage,
	Nathan Chancellor, Saeed Mahameed, Gal Pressman, Jakub Kicinski,
	Paolo Abeni, Rahul Rameshbabu, David S. Miller, LTP List

The .adjphase operation is an operation that is implemented only by certain
PHCs. The sysfs device attribute node for querying the maximum phase
adjustment supported should not be exposed on devices that do not support
.adjphase.

Fixes: c3b60ab7a4df ("ptp: Add .getmaxphase callback to ptp_clock_info")
Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Reported-by: Nathan Chancellor <nathan@kernel.org>
Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Link: https://lore.kernel.org/netdev/20230627162146.GA114473@dev-arch.thelio-3990X/
Link: https://lore.kernel.org/all/CA+G9fYtKCZeAUTtwe69iK8Xcz1mOKQzwcy49wd+imZrfj6ifXA@mail.gmail.com/
---
 drivers/ptp/ptp_sysfs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/ptp/ptp_sysfs.c b/drivers/ptp/ptp_sysfs.c
index 77219cdcd683..6e4d5456a885 100644
--- a/drivers/ptp/ptp_sysfs.c
+++ b/drivers/ptp/ptp_sysfs.c
@@ -358,6 +358,9 @@ static umode_t ptp_is_attribute_visible(struct kobject *kobj,
 		   attr == &dev_attr_max_vclocks.attr) {
 		if (ptp->is_virtual_clock)
 			mode = 0;
+	} else if (attr == &dev_attr_max_phase_adjustment.attr) {
+		if (!info->adjphase || !info->getmaxphase)
+			mode = 0;
 	}
 
 	return mode;
-- 
2.40.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-07-11 11:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-27 23:21 [LTP] [PATCH net v1] ptp: Make max_phase_adjustment sysfs device attribute invisible when not supported Rahul Rameshbabu via ltp
2023-06-27 23:33 ` Nathan Chancellor
2023-06-28  1:16 ` Andrew Lunn
2023-06-28  2:22   ` Rahul Rameshbabu via ltp
2023-06-28 14:35     ` Andrew Lunn
2023-06-28 17:48       ` Rahul Rameshbabu via ltp
2023-06-28 18:15         ` Andrew Lunn
2023-06-28 20:38   ` Jakub Kicinski
2023-06-28 20:46     ` Andrew Lunn
2023-06-28 20:55       ` Rahul Rameshbabu via ltp
2023-06-29 18:06 ` Jakub Kicinski
2023-06-30  3:33   ` Richard Cochran
2023-06-30  3:32 ` Richard Cochran
2023-07-03  5:10 ` Petr Vorel
2023-07-03 12:53   ` Cyril Hrubis
2023-07-03 20:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox