Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: ahmadexp@gmail.com
Cc: netdev@vger.kernel.org, richardcochran@gmail.com,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, vladimir.oltean@nxp.com,
	vadim.fedorenko@linux.dev, andrew+netdev@lunn.ch, arnd@arndb.de,
	john.stultz@linaro.org, rmk+kernel@armlinux.org.uk
Subject: Re: [PATCH net v6 1/2] ptp: serialize sysfs enable requests with ioctl paths
Date: Fri, 27 Nov 2026 17:09:37 +0000	[thread overview]
Message-ID: <179579937722.3135.2568812643544816671@kernel.org> (raw)
In-Reply-To: <20261126-timecard-core-v6-1-ahmadexp@gmail.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] Several statements in the changelog of "ptp: serialize sysfs
  enable requests with ioctl paths" do not match the patch or the tree.
- [Low] The commit's Author identity is 'ahmadexp <ahmadexp@gmail.com>',
  but the only sign-off is 'Signed-off-by: Ahmad Byagowi…

--

ptp: serialize sysfs enable requests with ioctl paths

This commit takes ptp->pincfg_mux around the ops->enable() callback in
extts_enable_store(), period_store() and pps_enable_store(). This
serializes the sysfs stores with the ioctl paths, which already hold that
mutex. If acquiring the mutex is interrupted, the stores return
-ERESTARTSYS.

Link: https://lore.kernel.org/r/179548551283.3135.17206659598806657887@kernel.org

> ptp: serialize sysfs enable requests with ioctl paths
>
> EXTTS, PPS and period sysfs stores invoke the clock driver callback without the pincfg_mux mutex. The ioctl paths and pin configuration changes use that mutex, so sysfs can race with those operations and with other sysfs requests.
>
> Take pincfg_mux around each enable callback. Keep validation and permission checks outside the critical section, propagate callback failures, and return -ERESTARTSYS when mutex acquisition is interrupted. The mutex is required because disable callbacks may sleep while draining an IRQ.
>
> A coding assistant helped identify the missing serialization, develop the fix and regression tests, and prepare this changelog. The source-derived tests exercise the actual callbacks with controlled scheduling; KUnit coverage uses the actual stores under lock contention.
>
> Fixes: d94ba80ebbea ("ptp: Added a brand new class driver for ptp clocks.")

[Severity: Low]

A few parts of this changelog don't seem to match the patch or the tree.

Does "propagate callback failures" describe a change in this patch? All
three stores already returned the ops->enable() error before this patch.
For example:

drivers/ptp/ptp_sysfs.c:extts_enable_store() {
    ...
	err = ops->enable(ops, &req, enable ? 1 : 0);
	if (err)
		goto out;

	return count;
out:
	return err;
}

The diff only adds the lock and unlock around the call.

The changelog mentions regression tests, source-derived tests and KUnit
coverage of the stores under lock contention. The patch only touches
drivers/ptp/ptp_sysfs.c. No test is included here or in a later patch.

Could these references be dropped, or the tests posted?

Could the changelog also name the contract that makes the missing lock a
real bug? The ptp_find_pin() kernel-doc says:

include/linux/ptp_clock_kernel.h:
 * The caller must hold ptp_clock::pincfg_mux.  Drivers do not have
 * access to that mutex as ptp_clock is an opaque type.  However, the
 * core code acquires the mutex before invoking the driver's
 * ptp_clock_info::enable() callback, and so drivers may call this
 * function from that context.

ptp_find_pin() reads ptp->info->pin_config without taking any lock
itself. About 30 drivers call it from their enable() callback, including
mlx5_extts_configure(), igb, lan743x and micrel. When those callbacks run
from the sysfs stores, they read pin_config without pincfg_mux held.

Is d94ba80ebbea the right Fixes target? pincfg_mux did not exist in that
commit. It was added later by 6092315dfdec ("ptp: introduce programmable
pins.").

Commit 62582a7ee783 ("ptp: Avoid deadlocks in the programmable pin
code.") is where the core started holding pincfg_mux around the ioctl
enable() calls, and where ptp_find_pin() was documented to rely on it.
That commit locked the ioctl paths but not the sysfs stores.

Would this be a better tag?

Fixes: 62582a7ee783 ("ptp: Avoid deadlocks in the programmable pin code.")

> Signed-off-by: Ahmad Byagowi <ahmadexp@gmail.com>

[Severity: Low]

The Author of this commit is "ahmadexp <ahmadexp@gmail.com>", but the
Signed-off-by uses "Ahmad Byagowi <ahmadexp@gmail.com>". The email
matches and the name does not, so checkpatch reports
FROM_SIGN_OFF_MISMATCH.

Could the author name be changed to match the sign-off?

Separately, the changelog paragraphs aren't wrapped at 75 columns, which
checkpatch also flags.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261126-timecard-core-v6-0-ahmadexp%40gmail.com

  reply	other threads:[~2026-11-27 17:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 16:41 [PATCH net v6 0/2] ptp: serialize requests and stop unassigned timestamps Ahmad Byagowi
2026-11-26 16:41 ` [PATCH net v6 1/2] ptp: serialize sysfs enable requests with ioctl paths Ahmad Byagowi
2026-11-27 17:09   ` netdev-bot+sashiko [this message]
2026-11-26 16:41 ` [PATCH net v6 2/2] ptp: disable unassigned timestamp channels on unregister Ahmad Byagowi
2026-11-27 17:09   ` netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179579937722.3135.2568812643544816671@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=ahmadexp@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=john.stultz@linaro.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=vadim.fedorenko@linux.dev \
    --cc=vladimir.oltean@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox