From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C7A4C433EF for ; Fri, 1 Jul 2022 15:40:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229620AbiGAPks convert rfc822-to-8bit (ORCPT ); Fri, 1 Jul 2022 11:40:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbiGAPkr (ORCPT ); Fri, 1 Jul 2022 11:40:47 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFB8D3FBDA for ; Fri, 1 Jul 2022 08:40:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7Ikg-00007D-92; Fri, 01 Jul 2022 17:40:14 +0200 Received: from [2a0a:edc0:0:900:1d::4e] (helo=lupine) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1o7Ikb-003oL0-QT; Fri, 01 Jul 2022 17:40:13 +0200 Received: from pza by lupine with local (Exim 4.94.2) (envelope-from ) id 1o7Ike-000AJX-H5; Fri, 01 Jul 2022 17:40:12 +0200 Message-ID: Subject: Re: [PATCH v2 0/2] i2c: Add new driver for Renesas RZ/V2M controller From: Philipp Zabel To: Phil Edworthy , Geert Uytterhoeven Cc: Rob Herring , Krzysztof Kozlowski , Wolfram Sang , Andy Shevchenko , Jarkko Nikula , Sam Protsenko , Sven Peter , Jan Dabros , Lukas Bulwahn , Tyrone Ting , Arnd Bergmann , Olof Johansson , Biju Das , Geert Uytterhoeven , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux I2C , Linux-Renesas Date: Fri, 01 Jul 2022 17:40:12 +0200 In-Reply-To: References: <20220628194526.111501-1-phil.edworthy@renesas.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-i2c@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org On Do, 2022-06-30 at 15:16 +0000, Phil Edworthy wrote: [...] > > Which reset driver is handling the reset for this i2c module? > drivers/clk/renesas/rzg2l-cpg.c > See rzg2l_cpg_assert() and rzg2l_cpg_deassert() > Note this driver handles a few different SoCs, the SoC using this i2c > driver is specified in drivers/clk/renesas/r9a09g011-cpg.c Thank you. [...] > > > In order for drivers to work on lots of platforms, should all drivers > use devm_reset_control_get_shared() instead of devm_reset_control_get(), > unless there is a need to reset the hardware at a specific time after > boot (e.g. watchdog with no way out)? Nobody should use devm_reset_control_get(). Those drivers that require direct control should use devm_reset_control_get_exclusive(). All others probably should use the _shared() variant, if it works for them. > So where do we go with this for this i2c driver? In this specific case letting the driver deassert the reset seems to be safe, so I'm fine with the way it is. You could also let the i2c driver call reset_control_assert() during remove() and modify the rzg2l-cpg.c driver to ignore it. That doesn't seem very useful on its own, but it would have the positive effect of documenting the shared-with-firmware reset in the reset controller driver. regards Philipp