From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753615AbdDCObc (ORCPT ); Mon, 3 Apr 2017 10:31:32 -0400 Received: from mga04.intel.com ([192.55.52.120]:15562 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753591AbdDCOb3 (ORCPT ); Mon, 3 Apr 2017 10:31:29 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,270,1486454400"; d="scan'208";a="1130303575" Message-ID: <1491229885.708.106.camel@linux.intel.com> Subject: Re: [PATCH v1] reset: Make optional stuff optional for all users From: Andy Shevchenko To: Philipp Zabel Cc: linux-kernel@vger.kernel.org, Mika Westerberg , Ramiro Oliveira Date: Mon, 03 Apr 2017 17:31:25 +0300 In-Reply-To: <1491229671.2378.73.camel@pengutronix.de> References: <20170403122638.88263-1-andriy.shevchenko@linux.intel.com> <1491229671.2378.73.camel@pengutronix.de> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2017-04-03 at 16:27 +0200, Philipp Zabel wrote: > Hi Andy, > > thank you for the patch. > > On Mon, 2017-04-03 at 15:26 +0300, Andy Shevchenko wrote: > > There is Device Tree oriented check for optional resource. Of course > > it will fail on non-DT platforms. > > > > Remove this check to make things optional for all users. > > > > Fixes: bb475230b8e5 ("reset: make optional functions really > > optional") > > Cc: Ramiro Oliveira > > Signed-off-by: Andy Shevchenko > > --- > > > >  The reset framework is too Device Tree oriented, and who knows what > >  the logic was behind the commit which introduced devm_reset_*() > >  functions without thinking out of the DT box. > > At the time, there was nothing outside of the box to describe reset > lines, and as far as I am aware there still isn't, so the devm_reset_* > should behave as if the reset line is not specified in the non-DT > case. > Returning -EINVAL was reasonable in that case, before the API was > changed to describe unavailable, optional reset controls as rstc = > NULL. Fair enough. > > >  This commit fixes almost all Intel newest boards that have no > > legacy > >  UART since UART driver started using this DT-centric framework. > > Is this is about 8250_dw.c? Unfortunately it sometimes takes a little > while for me to get updated on the big picture, as I only get the > actual > reset driver and framework patches in my inbox. Usually I only see the > reset consumer changes when I actively look for them. Yes, 8250_dw.c in this case. > > But the fault in this case was is with me not considering all possible > code paths influenced by commit bb475230b8e5, in the configurations > that > I can't test myself. Understood. > > >  drivers/reset/core.c | 3 --- > >  1 file changed, 3 deletions(-) > > > > diff --git a/drivers/reset/core.c b/drivers/reset/core.c > > index f1e5e65388bb..62314e663f29 100644 > > --- a/drivers/reset/core.c > > +++ b/drivers/reset/core.c > > @@ -331,9 +331,6 @@ struct reset_control > > *__of_reset_control_get(struct device_node *node, > > Ideally, __of_reset_control_get would not be called at all in the non- > DT > case. I'll change that in the next round, but for now I'd prefer a > small > fix in place. > > >   int rstc_id; > >   int ret; > >   > > - if (!node) > > - return ERR_PTR(-EINVAL); > > - > > This should be > > if (!node) > return optional ? NULL : ERR_PTR(-EINVAL); > > instead. Can you confirm this works for Intel boards with DW UART? I > can > fix it up when applying if you agree. I don't think it worth to change. I specifically checked all of_* calls in that function and they cope pretty nice with node == NULL. So, I rather to go with my initial change. Thanks for review! -- Andy Shevchenko Intel Finland Oy