From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753147AbcFIWSk (ORCPT ); Thu, 9 Jun 2016 18:18:40 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:34866 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932193AbcFIWSh (ORCPT ); Thu, 9 Jun 2016 18:18:37 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Thu, 09 Jun 2016 15:14:30 -0700 From: Stefan Agner To: Thomas Gleixner Cc: Dong Aisheng , Shawn Guo , Lucas Stach , Michael Turquette , Stephen Boyd , linux-kernel@vger.kernel.org, mingo@redhat.com, kernel@pengutronix.de, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/2] clk: imx: do not sleep if IRQ's are still disabled In-Reply-To: References: <20160426012341.GB8870@tiger> <1461663072.7839.17.camel@pengutronix.de> <20160427015835.GE30692@tiger> <20160602145915.GA31124@shlinux2> <20160607070440.GA32573@shlinux2> Message-ID: <1162370a4389413d2d4ff0eb79ff13ac@agner.ch> User-Agent: Roundcube Webmail/1.1.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016-06-09 13:08, Thomas Gleixner wrote: > On Tue, 7 Jun 2016, Dong Aisheng wrote: >> Then it may need introduce a lot changes and increase many new core APIs. >> Is that a problem? > > No. That's all better than each driver having broken workarounds. It's a > common problem so it wants to be addressed at the core level. There you have a > central point to do this and you can still catch abusers which call stuff from > the wrong context. The hacks in the drivers don't allow that because they look > at the context, i.e. irq disabled, instead of checking the system state. IMHO, the hacky part of my patch was how I detected whether to use sleep or delay. That said I am ok with API extension too, I guess it is fairly common use case... I found at least 6 clock prepare functions with sleep in it (and some udelays, all between 1-100). Your proposed solution uses "early_boot_or_suspend_resume" which I did not found as a convenient function in the wild :-) How would you implement that? -- Stefan