Re: [PATCH v7 1/3] sysfs: added sysfs_link_entry_to_kobj()

From: Jason Gunthorpe
Date: Tue Jun 23 2015 - 12:19:51 EST


On Mon, Jun 22, 2015 at 02:01:54PM -0400, Tejun Heo wrote:
> > TPM is undergoing a migration of core attributes from the
> > platform_device to the core's struct device.
> >
> > The only purpose of the symlink was to provide userspace
> > compatability with the old location.
>
> Ah, yeah, that's painful. Can you please briefly explain why it
> wasn't necessary before? Are you merging multiple devices into one?

Prior to the clean up work starting each and every driver was adding
sysfs files on its own to the platform_device and we had no core
struct tpm.struct device all.

The first cleanup moved all the sysfs creation into core code, but
kept the use of the platform device. A second cleanup added the struct
device and removed the misc_device abuse.

The next round was hoped to bring the core code into alignment with
everything else in the kernel:
- Create sysfs files at the right time so userspace isn't racey
- Don't stomp the drvdata of the platform_device in core code
- Have the understandable lifetime model that most of the rest
of the kernel has

The concept was to move the sysfs files to the natural location on the
core's struct tpm.struct device and leave a symlink behind on the
platform_device for compat.

We could also just move the sysfs file and ignore the compat symlink,
but it is not clear to me if that is an OK UAPI break for sysfs?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/