Linux RTC
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	rtc-linux@googlegroups.com, kernel@pengutronix.de,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org
Subject: [rtc-linux] Re: [PATCH v1 0/4] rtc: pcf2127: a fix, a cleanup and two questionable features
Date: Thu, 15 Oct 2015 01:50:26 +0200	[thread overview]
Message-ID: <20151014235026.GB3421@piout.net> (raw)
In-Reply-To: <1443777442-15920-1-git-send-email-u.kleine-koenig@pengutronix.de>

On 02/10/2015 at 11:17:18 +0200, Uwe Kleine-K=C3=B6nig wrote :
> Hello,
>=20
> the fix and the cleanup should be fine. Patches 3 and 4 are probably
> wrong (but still state of the art for other in-tree drivers) because
> sysfs_create_file is called too late. See
> http://kroah.com/log/blog/2013/06/26/how-to-create-a-sysfs-file-correctly=
/
> for some details.
>=20
> I failed to find how to do it correctly though:
>  - the attributes are device specific, so device_driver::groups is wrong
>  - for using the i2c's device group it's too late in .probe
>  - the rtc's device is only malloc'd in rtc_device_register and when
>    this returns it's already too late again.
>  - these are neither class nor bus attributes, so these are ruled out, to=
o.
>=20

Most of the drivers currently don't care about that race condition so I
could merge them as-is.
I currently have a PoC that creates the nvram file with the rest of the
sysfs files which solves that. I think this could also be extended to
support battery status.

> Uwe Kleine-K=C3=B6nig (4):
>   rtc: pcf2127: fix reading uninitialized value on RTC_READ_VL ioctl
>   rtc: pcf2127: remove useless driver version
>   rtc: pcf2127: implement reading battery status bits
>   rtc: pcf2127: implement access to nvram
>=20
>  drivers/rtc/rtc-pcf2127.c | 285 ++++++++++++++++++++++++++++++++++++++++=
++----
>  1 file changed, 261 insertions(+), 24 deletions(-)
>=20
> --=20
> 2.6.0
>=20

--=20
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

--=20
--=20
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---=20
You received this message because you are subscribed to the Google Groups "=
rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

      parent reply	other threads:[~2015-10-14 23:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-02  9:17 [rtc-linux] [PATCH v1 0/4] rtc: pcf2127: a fix, a cleanup and two questionable features Uwe Kleine-König
2015-10-02  9:17 ` [rtc-linux] [PATCH v1 1/4] rtc: pcf2127: fix reading uninitialized value on RTC_READ_VL ioctl Uwe Kleine-König
2015-10-18  0:14   ` [rtc-linux] " Alexandre Belloni
2015-10-02  9:17 ` [rtc-linux] [PATCH v1 2/4] rtc: pcf2127: remove useless driver version Uwe Kleine-König
2015-10-18  0:14   ` [rtc-linux] " Alexandre Belloni
2015-10-02  9:17 ` [rtc-linux] [PATCH v1 3/4 RFC] rtc: pcf2127: implement reading battery status bits Uwe Kleine-König
2015-10-02  9:17 ` [rtc-linux] [PATCH v1 4/4 RFC] rtc: pcf2127: implement access to nvram Uwe Kleine-König
2015-10-14 23:50 ` Alexandre Belloni [this message]

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=20151014235026.GB3421@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=a.zummo@towertech.it \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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