linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Aleksandar Markovic <aleksandar.m.mail@gmail.com>
Cc: "Laurent Vivier" <laurent@vivier.eu>,
	"Filip Bozuta" <Filip.Bozuta@rt-rk.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"Max Filippov" <jcmvbkbc@gmail.com>,
	"amarkovic@wavecomp.com" <amarkovic@wavecomp.com>,
	"philmd@redhat.com" <philmd@redhat.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	linux-rtc@vger.kernel.org
Subject: Re: [PATCH 08/12] linux-user: Add support for setting alsa timer enhanced read using ioctl
Date: Fri, 17 Jan 2020 22:45:28 +0100	[thread overview]
Message-ID: <CAK8P3a1YrK4_Xx13821P58rn1L_xZN5gJYt-Pef+aHdM-_V85g@mail.gmail.com> (raw)
In-Reply-To: <CAL1e-=gv_L0fuq9t8mmOiZ2D-CwpPrZZOjwrDwKwe09jvWJpXQ@mail.gmail.com>

On Fri, Jan 17, 2020 at 9:50 PM Aleksandar Markovic
<aleksandar.m.mail@gmail.com> wrote:

> Alexandre (and Arnd too, or any other person knowledgeable in the area),
>
> I just need to clarify a couple of details with you, please.
>
> Firstly, here is what man page rtc(4) says:
>
> "The /dev/rtc (or /dev/rtc0, /dev/rtc1, etc.) device can be opened
> only once (until it is closed) and it is read-only. On read(2) and
> select(2) the calling process is blocked until the next interrupt from
> that RTC is received. Following the interrupt, the process can read a
> long integer, of which the least significant byte contains a bit mask
> encoding the types of interrupt that occurred, while the remaining 3
> bytes contain the number of interrupts since the last read(2)."
>
> So, it looks read() will always return only 4 bytes of useful info
> (regardless of host being 32-bit/64-bit).

It says "long integer", which is 64-bit on a 64-bit machine.

> My questions are:
>
> - Is the description in man page genuinely accurate?

Starting with linux-2.6.18, there is another possibility: If an
application asks for exactly four bytes on a 64-bit kernel,
it gets the lower four bytes, as it would on a 32-bit kernel.

This is a hack that was introduced for running 32-bit compat
tasks.

For any other size less than sizeof(long), the kernel reports
an EINVAL error, and for anything larger or equal to sizeof(long)
it attempts to output a long word.

> - To me (but I am really an outsider to using RTC in applications),
> this feature (blocking read()/select()) even looks very nice and
> convenient, in all fairness. But I would like to ask you: Is this
> feature used rarely or frequently by other libraries/tools/etc.? In
> other words, is the feature "obscure" or "crucial" part of RTC kernel
> support? Or, something in between?

> - Does MC146818 support this feature?

No idea, I'll leave these for Alexandre or someone else to answer.

      Arnd

  reply	other threads:[~2020-01-17 21:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1579103618-20217-1-git-send-email-Filip.Bozuta@rt-rk.com>
     [not found] ` <1579103618-20217-9-git-send-email-Filip.Bozuta@rt-rk.com>
     [not found]   ` <CAK8P3a187rPhma7Q6o+hCF3h0=5MLZwh49+JqKt6BvVsAB1efQ@mail.gmail.com>
     [not found]     ` <ceaf44c0-fd6c-c280-7f95-7bc133553089@vivier.eu>
     [not found]       ` <CAK8P3a36KqWD4fKBLDpFhJg079bNdJDSDUAP2Zu_i1+H62Q6ZQ@mail.gmail.com>
     [not found]         ` <518d717d-9f1e-e00e-f2a9-df8861241d1c@rt-rk.com>
     [not found]           ` <cdcce2a3-00f5-f6d1-3083-dc36892ac5b4@vivier.eu>
     [not found]             ` <CAL1e-=i3-nYJMo6ptA7fdcK8r6P4vv20x2+LLV6BA9ELO8H53w@mail.gmail.com>
     [not found]               ` <CAL1e-=g8X___59zLPKLRjFNAP9bs3rVWhc8+OhMuF3TriBiynw@mail.gmail.com>
2020-01-16 12:00                 ` [PATCH 08/12] linux-user: Add support for setting alsa timer enhanced read using ioctl Arnd Bergmann
2020-01-17 20:50                   ` Aleksandar Markovic
2020-01-17 21:45                     ` Arnd Bergmann [this message]
2020-01-17 21:54                     ` Alexandre Belloni

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=CAK8P3a1YrK4_Xx13821P58rn1L_xZN5gJYt-Pef+aHdM-_V85g@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=Filip.Bozuta@rt-rk.com \
    --cc=aleksandar.m.mail@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=amarkovic@wavecomp.com \
    --cc=berrange@redhat.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=laurent@vivier.eu \
    --cc=linux-rtc@vger.kernel.org \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).