mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Qais Yousef <qais.yousef@imgtec.com>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 03/10] ALSA: add AXD Audio Processing IP alsa driver
Date: Thu, 3 Sep 2015 13:46:32 +0100	[thread overview]
Message-ID: <20150903124632.GZ12027@sirena.org.uk> (raw)
In-Reply-To: <55E02871.9050607@imgtec.com>

[-- Attachment #1: Type: text/plain, Size: 3400 bytes --]

On Fri, Aug 28, 2015 at 10:22:57AM +0100, Qais Yousef wrote:
> On 08/27/2015 04:32 PM, Mark Brown wrote:
> >On Thu, Aug 27, 2015 at 01:15:51PM +0100, Qais Yousef wrote:

> >>>>+#define AXD_BASE_VADDR		0xD0000000

> >>>This sounds like something that is going to be platform dependant,
> >>>should this be supplied from board configuration?

> >>I don't expect this to change. Can we add the configuration later if we hit
> >>the need to change it?

> >It should be trivial to make things configurable shouldn't it?

> Yes and I am all with configurability but I don't think it makes sense here.
> AXD will always have its own MMU and will not share virtual address space,
> so the possibility of us wanting to move this somewhere else is really very
> thin. Also I don't think this is the kind of detail we need to concern the
> user with. I'll see if I can make the binary header parsing more flexible so
> we can add more info like this and the one above in the future and be more
> future proof.

So this is a virtual address in the memory map of the DSP?  That's not
what I thought it was.

> >>>>+	memcpy_toio((void *)cached_fw_base, fw->data, fw->size);

> >>>Why the cast here?  I'm also not seeing where we handled the copying to
> >>>I/O in the decompression case?

> >>I couldn't avoid the cast. If cached_fw_base is 'void *' I'll get a warning
> >>when initialising cached_fw_base from CAC_ADDR().

> >Why do you get a warning from that?  Perhaps the warnings are trying to
> >tell us something...

> Because we try to assign an int to a pointer. So the error is 'makes pointer
> from integer without a cast'. To convert an address from uncached to cached
> we need to convert to an int as in MIPS it's a case of adding or subtracting
> a value then convert this value back to it's original form.
> I'll see if I can find a better way to fix the coherency issue when we copy
> through uncached.

Why can't you just use pointer arithmmetic?

> >>Good point. When decompressing crypto_comp_decompress() will write directly
> >>to the memory. It is safe but it doesn't go through the correct API. Not
> >>sure what I can do here.

> >Uncompress to a buffer then write that buffer to the final destination?

> Yes but the binary could be multi MiB so we can't get a temp buffer that
> large. If the crypto API allows decompressing in steps we can use a small
> buffer to move the data iteratively. I'll have a look.

A few megabytes doesn't seem like that big an ask (it's not *nice* but
it's doable with vmalloc()).  Iteratively copying is nicer though.

> >>>>+	/* wake up any task sleeping on command response */
> >>>>+	wake_up(&axd->cmd.wait);
> >>>>+	/* give chance to user land tasks to react to the crash */
> >>>>+	ssleep(2);
> >>>This looks horribly racy, I'd expect us to be trashing and/or killing
> >>>off any active work and resources here.
> >>OK. I was trying to play nicely by giving the chance to userland to repond
> >>to -ERESTART which would be sent from aborting any pending reads/writes.
> >>Are you suggesting to send SIGKILL using force_sig()?
> >No, I'm suggesting tearing down the kernel side of any work and kicking
> >errors back to userspace if it continues to interact with anything that
> >was ongoing.

> OK. This is what we do (see my other email about abort). I'll have a think
> for a way to get rid of the ssleep(). Any ideas are welcome.

Just delete it?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-09-03 12:47 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24 12:39 [PATCH 00/10] Add support for img AXD audio hardware decoder Qais Yousef
2015-08-24 12:39 ` [PATCH 01/10] irqchip: irq-mips-gic: export gic_send_ipi Qais Yousef
2015-08-24 12:49   ` Thomas Gleixner
2015-08-24 13:02     ` Qais Yousef
2015-08-24 13:32       ` Marc Zyngier
2015-08-24 14:27         ` Qais Yousef
2015-08-24 15:07           ` Thomas Gleixner
2015-08-24 16:39             ` Qais Yousef
2015-08-24 17:17               ` Marc Zyngier
2015-08-26 11:23                 ` Qais Yousef
2015-08-26 13:19                   ` Thomas Gleixner
2015-08-26 14:57                     ` Qais Yousef
2015-08-26 15:08                       ` Thomas Gleixner
2015-08-26 15:41                         ` Qais Yousef
2015-08-26 21:40                           ` Thomas Gleixner
2015-08-27  2:22                             ` Jiang Liu
2015-08-28 10:38                             ` Qais Yousef
2015-08-28 14:22                               ` Thomas Gleixner
2015-08-28 15:12                                 ` Qais Yousef
2015-09-02  9:33                                 ` Qais Yousef
2015-09-02  9:55                                   ` Marc Zyngier
2015-09-02 10:48                                     ` Qais Yousef
2015-09-02 11:53                                       ` Marc Zyngier
2015-09-02 13:25                                         ` Qais Yousef
2015-09-02 14:14                                           ` Marc Zyngier
2015-09-02 12:12                                     ` Jason Cooper
2015-08-24 14:55       ` Thomas Gleixner
2015-08-24 15:11         ` Qais Yousef
2015-08-24 12:39 ` [PATCH 02/10] dt: add img,axd.txt device tree binding document Qais Yousef
2015-08-24 13:26   ` Mark Rutland
2015-08-24 13:49     ` Qais Yousef
2015-08-24 12:39 ` [PATCH 03/10] ALSA: add AXD Audio Processing IP alsa driver Qais Yousef
2015-08-26 18:37   ` Mark Brown
2015-08-27 12:15     ` Qais Yousef
2015-08-27 15:32       ` Mark Brown
2015-08-28  9:22         ` Qais Yousef
2015-09-03 12:46           ` Mark Brown [this message]
2015-08-24 12:39 ` [PATCH 04/10] ALSA: axd: add fw binary header manipulation files Qais Yousef
2015-08-24 12:39 ` [PATCH 05/10] ALSA: axd: add buffers " Qais Yousef
2015-08-26 18:43   ` Mark Brown
2015-08-27 14:21     ` Qais Yousef
2015-08-29  9:47       ` Mark Brown
2015-09-01 10:00         ` Qais Yousef
2015-09-03 12:32           ` Mark Brown
2015-09-14  9:11             ` Qais Yousef
2015-09-14 18:50               ` Mark Brown
2015-08-24 12:39 ` [PATCH 06/10] ALSA: axd: add basic files for sending/receiving axd cmds Qais Yousef
2015-08-26 19:16   ` Mark Brown
2015-08-27 15:40     ` Qais Yousef
2015-08-29 10:18       ` Mark Brown
2015-09-01 10:46         ` Qais Yousef
2015-09-03 12:40           ` Mark Brown
2015-08-24 12:39 ` [PATCH 07/10] ALSA: axd: add cmd interface helper functions Qais Yousef
2015-08-24 12:39 ` [PATCH 08/10] ALSA: axd: add low level AXD platform setup files Qais Yousef
2015-08-24 12:39 ` [PATCH 09/10] ALSA: axd: add alsa compress offload operations Qais Yousef
2015-08-24 12:39 ` [PATCH 10/10] ALSA: axd: add Makefile Qais Yousef
2015-08-26 18:04 ` [PATCH 00/10] Add support for img AXD audio hardware decoder Mark Brown
2015-08-27  9:07   ` Qais Yousef

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=20150903124632.GZ12027@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=qais.yousef@imgtec.com \
    --cc=tiwai@suse.com \
    /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

all inboxes | Powered by JetHome®