lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 24 Jan 2020 17:09:29 +0100
From:   Eugeniu Rosca <erosca@...adit-jv.com>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
CC:     Eugeniu Rosca <erosca@...adit-jv.com>,
        John Ogness <john.ogness@...utronix.de>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
        Andrew Gabbasov <andrew_gabbasov@...tor.com>,
        Sanjeev Chugh <sanjeev_chugh@...tor.com>,
        Petr Mladek <pmladek@...e.com>,
        Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Daniel Wang <wonderfly@...gle.com>,
        Dean Jenkins <dean_jenkins@...tor.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Dirk Behme <dirk.behme@...bosch.com>,
        Alan Cox <gnomes@...rguk.ukuu.org.uk>,
        Jiri Slaby <jslaby@...e.com>,
        Peter Feiner <pfeiner@...gle.com>,
        "open list:SERIAL DRIVERS" <linux-serial@...r.kernel.org>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Eugeniu Rosca <roscaeugeniu@...il.com>
Subject: Re: [RFC PATCH v1 00/25] printk: new implementation

Hi Geert,

On Wed, Jan 22, 2020 at 08:48:12PM +0100, Geert Uytterhoeven wrote:
> On Wed, Jan 22, 2020 at 5:59 PM Eugeniu Rosca <erosca@...adit-jv.com> wrote:
> > On Wed, Jan 22, 2020 at 08:31:44AM +0100, Geert Uytterhoeven wrote:
> > > On Wed, Jan 22, 2020 at 3:34 AM Eugeniu Rosca <erosca@...adit-jv.com> wrote:
> > > > So, what's specific to R-Car3, based on my testing, is that the issue
> > > > can only be reproduced if the printk storm originates on CPU0

Slight amendment the above statement. Below results are got on R-Car
H3ULCB running renesas-drivers-2020-01-14-v5.5-rc6 (cX stands for CPUx,
whitespace stands for clean audio, '!' stands for distorted audio):

                  printk @:
                  c0 c1 c2 c3 c4 c5 c6 c7
speaker-test @ c0 !
               c1 !  !
               c2 !     !
               c3 !        !
               c4 !           !
               c5 !              !
               c6 !                 !
               c7 !                    !

One can see two patterns in the chart. The audio has glitches whenever:
 - printk and the audio application run on the same CPU, or:
 - printk runs on CPU0

> Yeah, cpu0 is always heavily loaded w.r.t. interrupts.
> Can you reproduce the problem after forcing all interrupts to e.g. cpu1?

With instrumentation shown in [1], the chart suffers below changes:

                  printk @:
                  c0 c1 c2 c3 c4 c5 c6 c7
speaker+test @ c0 !  !
               c1    !
               c2    !  !
               c3    !     !
               c4    !        !
               c5    !           !
               c6    !              !
               c7    !                 !

Any comments on the above empirical results?

[1] IRQ affinity set to CPU1

diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index f06016d38a05..40003a3af4e0 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -1786,6 +1786,12 @@ static int rcar_dmac_chan_probe(struct rcar_dmac *dmac,
 		return ret;
 	}
 
+	ret = irq_set_affinity(rchan->irq, cpumask_of(1));
+	if (ret) {
+		dev_err(dmac->dev, "failed to set IRQ affinity %u (%d)\n", rchan->irq, ret);
+		return ret;
+	}
+
 	return 0;
 }
 
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 9b4ff872e297..c76b38626b6b 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1926,6 +1926,11 @@ static int sci_request_irq(struct sci_port *port)
 			dev_err(up->dev, "Can't allocate %s IRQ\n", desc->desc);
 			goto out_noirq;
 		}
+		ret = irq_set_affinity(irq, cpumask_of(1));
+		if (ret) {
+			dev_err(up->dev, "failed to set IRQ affinity %u (%d)\n", irq, ret);
+			return ret;
+		}
 	}
 
 	return 0;

-- 
Best Regards
Eugeniu Rosca

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ