linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] PTP attribute handling cleanup
@ 2017-02-14 18:23 Dmitry Torokhov
  2017-02-14 18:23 ` [PATCH v2 1/4] ptp: do not explicitly set drvdata in ptp_clock_register() Dmitry Torokhov
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Dmitry Torokhov @ 2017-02-14 18:23 UTC (permalink / raw)
  To: Richard Cochran; +Cc: David S. Miller, netdev, linux-kernel

PTP core was creating some attributes, such as "period" and "fifo", and the
entire "pins" attribute group, after creating class deevice, which creates
a race for userspace: uevent may arrive before all attributes are created.

This series of patches switches PTP to use is_visible() to control
visibility of attributes in a group, and device_create_with_groups() to
ensure that attributes are created before we notify userspace of a new
device.

v2:
- added Richard's acked-by to patch #1
- removed use of kmalloc_array in favor of kcalloc in patch #2 at
  Richard's request
- added a cover letter

v1:
- initial patch set

Dmitry Torokhov (4):
  ptp: do not explicitly set drvdata in ptp_clock_register()
  ptp: use kcalloc when allocating arrays
  ptp: use is_visible method to hide unused attributes
  ptp: create "pins" together with the rest of attributes

 drivers/ptp/ptp_clock.c   |  22 +++---
 drivers/ptp/ptp_private.h |   7 +-
 drivers/ptp/ptp_sysfs.c   | 167 ++++++++++++++++++----------------------------
 3 files changed, 80 insertions(+), 116 deletions(-)

Thanks.

-- 
Dmitry

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

end of thread, other threads:[~2017-02-17 16:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-14 18:23 [PATCH v2 0/4] PTP attribute handling cleanup Dmitry Torokhov
2017-02-14 18:23 ` [PATCH v2 1/4] ptp: do not explicitly set drvdata in ptp_clock_register() Dmitry Torokhov
2017-02-14 18:23 ` [PATCH v2 2/4] ptp: use kcalloc when allocating arrays Dmitry Torokhov
2017-02-14 18:23 ` [PATCH v2 3/4] ptp: use is_visible method to hide unused attributes Dmitry Torokhov
2017-02-14 18:23 ` [PATCH v2 4/4] ptp: create "pins" together with the rest of attributes Dmitry Torokhov
2017-02-15 17:22 ` [PATCH v2 0/4] PTP attribute handling cleanup David Miller
2017-02-16 10:30   ` Richard Cochran
2017-02-16 20:19 ` Richard Cochran
2017-02-17 16:03   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).