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, 22 Dec 2017 13:43:53 +1100
From:   Benjamin Herrenschmidt <benh@...nel.crashing.org>
To:     Stephen Boyd <sboyd@...eaurora.org>, Joel Stanley <joel@....id.au>
Cc:     Lee Jones <lee.jones@...aro.org>,
        Michael Turquette <mturquette@...libre.com>,
        linux-kernel@...r.kernel.org, linux-clk@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        Andrew Jeffery <andrew@...id.au>, Jeremy Kerr <jk@...abs.org>,
        Rick Altherr <raltherr@...gle.com>,
        Ryan Chen <ryan_chen@...eedtech.com>,
        Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH v6 4/5] clk: aspeed: Register gated clocks

On Fri, 2017-12-22 at 13:36 +1100, Benjamin Herrenschmidt wrote:
> 
> > No you can't sleep here. It needs to delay because this is inside
> > spinlock_irqsave.
> 
> Additionally you really don't want to delay for 10ms with interrupts
> off :-(
> 
> Sadly, it looks like the clk framework already calls you with spinlock
> irqsafe, which is a rather major suckage.
> 
> Stephen, why is that so ? That pretty much makes it impossible to
> do sleeping things, which prevents things like i2c based clock
> controllers etc...

I noticed we do have a few i2c based clock drivers... how are they ever
supposed to work ? i2c bus controllers are allowed to sleep and the i2c
core takes mutexes...

> I think the clk framework needs to be overhauled to use sleeping
> mutexes instead. Doing clock enable/disable at interrupt time is
> a bad idea anyway.
> 
> 
> In the meantime, Joel, you have little choice but do an mdelay
> though that really sucks.
> 
> > > +             /* Take IP out of reset */
> > > +             regmap_update_bits(gate->map, ASPEED_RESET_CTRL, rst, 0);
> > > +     }
> > > +
> > > +     spin_unlock_irqrestore(gate->lock, flags);
> > > +
> > > +     return 0;
> > > +}


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ