linux/drivers/ptp
Richard Cochran 62582a7ee7 ptp: Avoid deadlocks in the programmable pin code.
The PTP Hardware Clock (PHC) subsystem offers an API for configuring
programmable pins.  User space sets or gets the settings using ioctls,
and drivers verify dialed settings via a callback.  Drivers may also
query pin settings by calling the ptp_find_pin() method.

Although the core subsystem protects concurrent access to the pin
settings, the implementation places illogical restrictions on how
drivers may call ptp_find_pin().  When enabling an auxiliary function
via the .enable(on=1) callback, drivers may invoke the pin finding
method, but when disabling with .enable(on=0) drivers are not
permitted to do so.  With the exception of the mv88e6xxx, all of the
PHC drivers do respect this restriction, but still the locking pattern
is both confusing and unnecessary.

This patch changes the locking implementation to allow PHC drivers to
freely call ptp_find_pin() from their .enable() and .verify()
callbacks.

V2 ChangeLog:
- fixed spelling in the kernel doc
- add Vladimir's tested by tag

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Reported-by: Yangbo Lu <yangbo.lu@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-30 11:16:38 -07:00
..
idt8a340_reg.h ptp: clockmatrix: Rework clockmatrix version information. 2020-01-07 13:51:23 -08:00
Kconfig ptp: add VMware virtual PTP clock driver 2020-03-05 17:25:07 -08:00
Makefile ptp: add VMware virtual PTP clock driver 2020-03-05 17:25:07 -08:00
ptp_chardev.c ptp: Avoid deadlocks in the programmable pin code. 2020-03-30 11:16:38 -07:00
ptp_clock.c ptp: Avoid deadlocks in the programmable pin code. 2020-03-30 11:16:38 -07:00
ptp_clockmatrix.c ptp: clockmatrix: Rework clockmatrix version information. 2020-01-07 13:51:23 -08:00
ptp_clockmatrix.h ptp: Add a ptp clock driver for IDT ClockMatrix. 2019-11-03 17:35:40 -08:00
ptp_dte.c ptp: ptp_dte: use devm_platform_ioremap_resource() to simplify code 2019-10-10 16:21:13 -07:00
ptp_idt82p33.c ptp: Add a ptp clock driver for IDT 82P33 SMU. 2020-02-24 13:08:46 -08:00
ptp_idt82p33.h ptp: Add a ptp clock driver for IDT 82P33 SMU. 2020-02-24 13:08:46 -08:00
ptp_ines.c ptp: Add a driver for InES time stamping IP core. 2019-12-25 19:51:34 -08:00
ptp_kvm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
ptp_pch.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 167 2019-05-30 11:26:39 -07:00
ptp_private.h ptp: fix the race between the release of ptp_clock and cdev 2019-12-30 20:19:27 -08:00
ptp_qoriq_debugfs.c ptp_qoriq: add little enadian support 2019-02-12 12:58:48 -05:00
ptp_qoriq.c ptp_qoriq: drop the code of alarm 2020-02-16 18:30:41 -08:00
ptp_sysfs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
ptp_vmw.c ptp: add VMware virtual PTP clock driver 2020-03-05 17:25:07 -08:00