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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C529C433F5 for ; Thu, 14 Oct 2021 14:37:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1CEAF61156 for ; Thu, 14 Oct 2021 14:37:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1CEAF61156 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dTPWYhDw4cGZesvJ+FjdABGxt5VUIkBOcEAx98mbT+4=; b=x8cAFeSZHAW74p BNSkOIiNYKcKCMtE4keKGFXXtFVoeg5nVa0B+q4t7agv7kUHQvsl6jquckOVcoY1r3kobMYHvmGb6 yUGYzpRzi6kfJA8cas8fQBg4MFsuW87AqtE7Ich0QTuNesKsKoie7aylKjaTfieZYa3YOhCsi7gjo 8uM4uEcGhUEhZIZzPeFmTrWEDz26hp85aXU0gByBWqCvOIMooRpg0jid5wvtWQlO/TjM5XHwlr7Ei 0nxmS7EuFUix0wrwTdMhca92r3ZrxnuXl2mXsATW6GF4uIMnBY9UfaLqKIjpm6dr9IN1RFn0t8MJv d0nSmoRp98dW2uwkHkoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mb1q5-003Tmq-SF; Thu, 14 Oct 2021 14:36:10 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mb1px-003TlF-UY for linux-arm-kernel@lists.infradead.org; Thu, 14 Oct 2021 14:36:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1634222162; x=1665758162; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=UKR5vWCNAno42pYINcB56F+Pp43CdX14ETbyIT5ZJIE=; b=OEZdJH8ANj6twqxiLmnolIBZhRA5XZgaHaPhHPIEkZjJk0VLPpdDnEyr K3qX9O0MR51CcDkxnCxTDFjU+wdHnMxeZeCaI0KZnXp0XQRdiYGdrixG1 qoa+6QZxGiZu9C1LEuj7qN0ocRpYTuc3ij6ZqcRniTXVrTnDD0zhLM/3R yJ5VWxVRXfiO+m2gwQX+z8EsLqWJSj2hJdJFUr5lo1zVZ5Uo9dUpaWOpQ chQ3TJM3QQ+irIVQ1mbkbIanYckrfC6NW82HHxh8lVMZGoeujz5BohINo uYpxZ0tZAZMvz9ApEI8RlHbpl3lEcREiNFoE5jLvNbdu5I/dH56FWEEtg Q==; IronPort-SDR: d+BId0l/vwLu4oBH7WCcy4CC1hRX5GfLxzG3TEWawvTRBPtcFMbCtQXmqjo8hNdV+IgHLQyvuR g96YwPTZVfzII8Z51wwTCgp+297MaRniVrh2iuBLuqJN4VIZ9PdVCau9RMycnZMxcPqyeZYAPF bz3Mk/s2FyLHUrNNg+NmSAU4Q2oHrAGxVGYo4ZDXxt4+ZrhdCI0O8L8Ju0nhNjE6w+i7khBxc6 XlvJ1sbu5NIpsDT9eV06C4LcwA3DL/Kf4BSlV/LPt0h3vMrWTA8yvbZAeSqg0OOlBjrxcXuTPh IkFY3b7qthC/QuYMdgxw3JYz X-IronPort-AV: E=Sophos;i="5.85,372,1624345200"; d="scan'208";a="140290254" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Oct 2021 07:36:00 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Thu, 14 Oct 2021 07:36:00 -0700 Received: from localhost (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Thu, 14 Oct 2021 07:35:59 -0700 Date: Thu, 14 Oct 2021 16:37:33 +0200 From: Horatiu Vultur To: Philipp Zabel CC: , , , , , , , , Subject: Re: [PATCH v3 2/2] pinctrl: microchip sgpio: use reset driver Message-ID: <20211014143733.t2dov6ajjebxlht6@soft-dev3-1.localhost> References: <20211014085929.2579695-1-horatiu.vultur@microchip.com> <20211014085929.2579695-3-horatiu.vultur@microchip.com> <2874212d2f9462880d1b0aae35296162e1277e62.camel@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <2874212d2f9462880d1b0aae35296162e1277e62.camel@pengutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211014_073602_052991_DA9BC68C X-CRM114-Status: GOOD ( 19.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The 10/14/2021 13:47, Philipp Zabel wrote: > > Hi Horatiu, Hi Philipp > > > + reset = devm_reset_control_get_shared(&pdev->dev, "switch"); > > Please use devm_reset_control_get_optional_shared() for optional resets > and handle errors. That will return NULL in case the optional reset is > not specified in the device tree. I will do that. > > It seems weird to me that the reset input to the GPIO controller is > called "switch" reset. You can request a single unnamed reset with > > reset = devm_reset_control_get_shared(&pdev->dev, NULL); > > although that would limit future extendability in case this driver will > ever require to handle multiple separate resets. If you decide to > request the reset control by name, the yaml binding should specify the > same name. I think this requires a little bit more explanation from my side. On lan966x we are facing the following issue. When we try to reset just the switch core then also the sgpio device was reset and there was no way from HW perspective to prevent this. So our solutions was to create a reset driver[1] that will be triggered only one time, by the sgpio driver or by the switch driver. That is the reason why it was called "switch" reset. And that is the purpose of this patch to allow the sgpio driver to reset the switch in case is probed before the switch driver so it would not get reset after that. > > > + if (!IS_ERR(reset)) > > + reset_control_reset(reset); > > With optional resets, this can be just: > > reset_control_reset(reset); Great I will do that. > > regards > Philipp [1] https://lore.kernel.org/lkml/20211013073807.2282230-1-horatiu.vultur@microchip.com/ -- /Horatiu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel