From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754724AbcG1KKP (ORCPT ); Thu, 28 Jul 2016 06:10:15 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:64453 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752508AbcG1KKK (ORCPT ); Thu, 28 Jul 2016 06:10:10 -0400 From: Arnd Bergmann To: Philipp Zabel Cc: Masahiro Yamada , Hans de Goede , Lee Jones , Linux Kernel Mailing List , linux-arm-kernel , Axel Lin , Maxime Ripard Subject: Re: Why do we need reset_control_get_optional() ? Date: Thu, 28 Jul 2016 12:09:25 +0200 Message-ID: <5955443.3UvZHD6laK@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-28-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <1469698980.12835.18.camel@pengutronix.de> References: <1469698980.12835.18.camel@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:s0Dqr1H4kPq5fxENg/XN8oXRhjHRwRIGP5SnwVtH5k5kFvbOArj aHjdi10bxTNC1fy1/BkK2lBXjGhP2HDN4TZE+IZM2fZCeTT58GM4IlEZHj4bVxqeIRm3RJl BpFd6BXj65xazYv2H/WWt3jK/pBMfa5mNkckX1sA1ZIxsoU1tWvSstZk9qj5V0ebWjj8kAw IijhVPtJ9d6LAXzwDwcBA== X-UI-Out-Filterresults: notjunk:1;V01:K0:C1hGBLOgwo4=:jAdVAMuHHGBOr7XkDD/J9G SKdHas4rr2dNu3byPDIncM6TYhDehtWtPU4XdzlhvTAN6A6QIFg4MabGVhuTibaMlJ4Zzzvab yFouSSTSMOhuO1KlxOGHEAOOvvQZYBk9bxGdbu+FJWBrpz7FtQIEvZ6UhFtogwmccbtFKVLrg 9Co5ofx9fa+28Bm/ODBE7MsNEqP+8lyEZhcRHPQGPiUX34bsmR1x9RibZoxr4qrlV769tm07y 6ZrCYXSIIiMSzk7b4x1fXcGSBRy+XpvM4F7xqm9/HhuI2GeMQvqfi/J71PI+XS4zljqD7ojH/ n35LzqXO/hJHzdSLWIazugCopb7MFddET9rppQwbLct+zx+OIqfL1IxvZIwWd5izl9y8f8idm gwZxPO+rpCBvv4s/2GqWG0h9dAihvpZ5bAJT50W8117bHk7ruNRiC9qT3kNInSj5Qu3Lbq9oa bYS9w985ObaHK4raGsot2tNPrGMWUTuTMPA6ya+rdTLgKBnm9EFg8CzA5Lcwe1JsE3Z83L3op TkwUuC74CpzoWG2cNBTy+OxzxJmGaLBaXv3/keszlyg8/Al6XK/c7ZZLQhhlDrBlniT8aG/kF LwPsLyhvnUfj1mmyhp7NjJFWyqct/bvo2699iR0s75QpNguAJAKwYdkJdg7zm2aFUIwCi+uhX x5x22+UhBVecgCq2vOLkYPF1dRDzlmvt8/rByawRH9qvD6/9CeuO3BF79iiYj+dYUp2NPSKoe 8TLjTTbDNWRSeH/c Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday, July 28, 2016 11:43:00 AM CEST Philipp Zabel wrote: > > I want to deprecate _optional variants in the following steps: > > > > [1] Add "depends on RESET_CONTROLLER" to drivers > > for which reset_control is mandatory. > > > > We can find those driver easily by grepping > > the reference to non-optional reset_control_get(). > > Since we have the stubs, the RESET_CONTROLLER dependency is only at > runtime, not at build time. > > I think Arnd wanted to move this in the opposite direction and remove > the configurable RESET_CONTROLLER symbol. Maybe we should let all > drivers that currently request non-optional resets have: > depends on (ARCH_HAS_)RESET_CONTROLLER || COMPILE_TEST > ? There are various ways to improve the current situation. I think it's important that a driver that has an optional reset line behaves in exactly the same way whether the reset subsystem is enabled or disabled when no reset line is provided for a machine. When a driver requires a reset line, we can either have a build-time failure when the reset subsystem is disabled (enforcing the Kconfig dependency), or cause a runtime failure if either there is no reset line or the subsystem is disabled. In my experimental patch, I make the _optional functions return NULL if no "resets" property is provided but return an error if there are reset lines but the subsystem is disabled, i.e. an optional reset must be used if it's in the DT, but can be ignored otherwise. Arnd