linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: stefanr@s5r6.in-berlin.de
Cc: alsa-devel@alsa-project.org,
	linux1394-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, marcan@marcan.st
Subject: Re: [PATCH 0/3] firewire: assist unit driver to compute packet timestamp
Date: Tue, 21 Dec 2021 19:54:42 +0900	[thread overview]
Message-ID: <YcGycqUrptkWYeOV@workstation> (raw)
In-Reply-To: <20211202113457.24011-1-o-takashi@sakamocchi.jp>

Hi Stefan,

Thank you for your long effort to maintain Linux FireWire subsystem. I'd
like to use the timestamp function for my integration in ALSA firewire
stack planned at next version of Linux kernel. I'm glad if getting to
your help for upstreaming.

On Thu, Dec 02, 2021 at 08:34:54PM +0900, Takashi Sakamoto wrote:
> Hi,
> 
> In 1394 OHCI specification, each descriptor of IR/IT/AR/AT DMA context
> has timeStamp field. The value of timeStamp field express the time in
> which the controller accept packet. The resolution of value is isochronous
> cycle count (8,000 Hz) with second up to 7.
> 
> I have a plan to use the value of timeStamp field for ALSA firewire stack
> so that userspace ALSA PCM/Rawmidi applications can get converted timestamp
> (ktime) for PCM frame/MIDI message. The timestamp can ideally express
> finer granularity than the time to invoke IRQ handler (and co).
> 
> Current implementation of Linux FireWire subsystem delivers the value of
> timeStamp field to unit driver for IR/IT/AT DMA context, but not for AR
> DMA context. Additionally, the way to refer to Isochronous Cycle Timer
> Register in MMIO region of 1394 OHCI controller is transaction to local
> node. It includes overhead of transaction and it's preferable to add
> less-overhead way available in any type of IRQ context.
> 
> This patchset adds two functions exposed in kernel space:
> 
>  * fw_card_read_cycle_time()
>     * allow unit driver to access to CYCLE_TIME register in MMIO region
>       without initiate transaction
>  * fw_request_get_timestamp()
>     * allow unit driver to get timestamp of request packet inner request
>       handler
> 
> I note that Hector Martin found kernel null pointer dereference during
> process to remove PCI card and has posted a patch:
> 
>  * https://lore.kernel.org/lkml/20211027113130.8802-1-marcan@marcan.st/
> 
> His patch is included in the series with my comment for relevant commit
> 20802224298c ("firewire: core: add forgotten dummy driver methods, remove
> unused ones"). The patch is required since unit driver can refer to dummy
> driver between removal callback of PCI subsystem and removal callback of
> FireWire subsystem.
> 
> Hector Martin (1):
>   firewire: Add dummy read_csr/write_csr functions
> 
> Takashi Sakamoto (2):
>   firewire: add kernel API to access CYCLE_TIME register
>   firewire: add kernel API to access packet structure in request
>     structure for AR context
> 
>  drivers/firewire/core-card.c        | 39 +++++++++++++++++++++++++++++
>  drivers/firewire/core-cdev.c        |  6 +++--
>  drivers/firewire/core-transaction.c | 18 +++++++++++++
>  include/linux/firewire.h            |  3 +++
>  4 files changed, 64 insertions(+), 2 deletions(-)
> 
> -- 
> 2.32.0


Sincerely yours

Takashi Sakamoto

  parent reply	other threads:[~2021-12-21 10:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02 11:34 [PATCH 0/3] firewire: assist unit driver to compute packet timestamp Takashi Sakamoto
2021-12-02 11:34 ` [PATCH 1/3] firewire: Add dummy read_csr/write_csr functions Takashi Sakamoto
2021-12-02 11:34 ` [PATCH 2/3] firewire: add kernel API to access CYCLE_TIME register Takashi Sakamoto
2021-12-02 11:34 ` [PATCH 3/3] firewire: add kernel API to access packet structure in request structure for AR context Takashi Sakamoto
2021-12-21 10:54 ` Takashi Sakamoto [this message]
2022-01-07 11:01   ` [PATCH 0/3] firewire: assist unit driver to compute packet timestamp Takashi Sakamoto
2022-01-12  3:51     ` Takashi Sakamoto
2022-01-12  7:47       ` Hector Martin

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=YcGycqUrptkWYeOV@workstation \
    --to=o-takashi@sakamocchi.jp \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=marcan@marcan.st \
    --cc=stefanr@s5r6.in-berlin.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;
as well as URLs for NNTP newsgroup(s).