[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230627233344.GA1914803@dev-arch.thelio-3990X>
Date: Tue, 27 Jun 2023 16:33:44 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Rahul Rameshbabu <rrameshbabu@...dia.com>
Cc: netdev@...r.kernel.org, Richard Cochran <richardcochran@...il.com>,
Paolo Abeni <pabeni@...hat.com>, Jakub Kicinski <kuba@...nel.org>,
Saeed Mahameed <saeed@...nel.org>, Gal Pressman <gal@...dia.com>,
"David S. Miller" <davem@...emloft.net>,
lkft-triage@...ts.linaro.org, LTP List <ltp@...ts.linux.it>,
Naresh Kamboju <naresh.kamboju@...aro.org>,
Linux Kernel Functional Testing <lkft@...aro.org>
Subject: Re: [PATCH net v1] ptp: Make max_phase_adjustment sysfs device
attribute invisible when not supported
On Tue, Jun 27, 2023 at 04:21:39PM -0700, Rahul Rameshbabu wrote:
> 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@...dia.com>
> Reported-by: Nathan Chancellor <nathan@...nel.org>
> Reported-by: Naresh Kamboju <naresh.kamboju@...aro.org>
> Reported-by: Linux Kernel Functional Testing <lkft@...aro.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/
Thanks a lot for the fix!
Tested-by: Nathan Chancellor <nathan@...nel.org>
> ---
> 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
>
Powered by blists - more mailing lists