Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp968755ybl; Wed, 21 Aug 2019 08:11:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxK3onkSxSjd1mXSk9RzmZhrThxRD/TetpVr7e5cVPOUaAVvNslTqyH3yrzYoF3G2O36wBk X-Received: by 2002:aa7:8b52:: with SMTP id i18mr36850621pfd.194.1566400263114; Wed, 21 Aug 2019 08:11:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566400263; cv=none; d=google.com; s=arc-20160816; b=K2OK31b+ySsPrIO+7thR5oRZgwRFSqdEVAlOBn2yu0y3+wPj7VnO/Oyx+cN9Rh39tb h5VUtFfZaxyMGSWUKOZCrQBO864iVfRMv8Q6BuU8k2KDzbjJ0gPRsw+NxZ7W37Z4dGup 4ET30JG+/1t1pxGfKlySslKxO7Ak9eygAvmC1hDRPjj57jR7sWr3Hr8USHKnIJSEBJjE CixVMcDPfR0d9xUcAfM0nOBwSzRpG2CnrpNR/EIJYGVWOhbxFW6Pp1sA5Gh+PT9Dz1aT Tj5LD3OBQmIRif8KeytSgt+yc5gdGEtYrY7bJa/0pXOef1EU/IN/NKD0FbXu/Lc95vQl nLVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=1GzCr/Q/lrNxJ5ZCKN3gri+fJ69DHOMcKQ/j+UEDc4U=; b=mVW2tAQbKwcIeIYhfJPw4QuaCgOAucKFInUe3N5zp/8Gk8oHOwzmy7pMGQpw3jok/Y +Wc5AqdbDvmLoP46eXD4OtmjcK67vV775QtyM46pr6eCkKPRDUHtU8wVtWUHni5g/GJE 30oBd8VXN03wegHkCR1LnEmDcGvsOpWNCdrrQULJuj0jxWu3zIGWN4Dr/KzUZIWn/F03 WaWE0F7EC7NOp8hOFwAJqE2MIGidwrjYfYJA/KQ5YAH81GMhFisNd88tmHqHjwXYCMng 0Clqndk+gcMK5N4USpL0ItE6pb28Aw2zh+R09d+sx7fX2K+xQ0jYPnNLolprMxu0eDZZ f5zQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc10si14955668plb.171.2019.08.21.08.10.47; Wed, 21 Aug 2019 08:11:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728195AbfHUMaj (ORCPT + 99 others); Wed, 21 Aug 2019 08:30:39 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:53047 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726371AbfHUMai (ORCPT ); Wed, 21 Aug 2019 08:30:38 -0400 Received: from localhost (lfbn-1-17395-211.w86-250.abo.wanadoo.fr [86.250.200.211]) (Authenticated sender: maxime.ripard@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id B0B90100007; Wed, 21 Aug 2019 12:30:35 +0000 (UTC) Date: Wed, 21 Aug 2019 14:30:35 +0200 From: Maxime Ripard To: Samuel Holland Cc: Chen-Yu Tsai , Jassi Brar , Michael Turquette , Stephen Boyd , Rob Herring , Mark Rutland , Corentin Labbe , Vasily Khoruzhick , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 04/10] mailbox: sunxi-msgbox: Add a new mailbox driver Message-ID: <20190821123035.tl4aakijjhw3bwbk@flea> References: <20190820032311.6506-1-samuel@sholland.org> <20190820032311.6506-5-samuel@sholland.org> <20190820111825.2w55fleehrnon27u@core.my.home> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mrpxrcur5riymvjn" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --mrpxrcur5riymvjn Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 20, 2019 at 08:07:53AM -0500, Samuel Holland wrote: > On 8/20/19 6:18 AM, Ond=C5=99ej Jirman wrote: > >> + reset =3D devm_reset_control_get(dev, NULL); > >> + if (IS_ERR(reset)) { > >> + ret =3D PTR_ERR(reset); > >> + dev_err(dev, "Failed to get reset control: %d\n", ret); > >> + goto err_disable_unprepare; > >> + } > >> + > >> + ret =3D reset_control_deassert(reset); > >> + if (ret) { > >> + dev_err(dev, "Failed to deassert reset: %d\n", ret); > >> + goto err_disable_unprepare; > >> + } > > > > You need to assert the reset again from now on, in error paths. devm > > will not do that for you. > > I know, and that's intentional. This same message box device is used for = ATF to > communicate with SCP firmware (on a different channel). This could be hap= pening > on a different core while Linux is running. So Linux is not allowed to de= assert > the reset. clk_disable_unprepare() is only okay because the clock is mark= ed as > critical. I agree with Ondrej that since this is clearly not the standard use of the API, this must have a big comment explaining why we're doing it this way. Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --mrpxrcur5riymvjn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXV05awAKCRDj7w1vZxhR xbIJAP9yrpmQb5VASu0xwjQKiF8z6Qkk63ohQogxkr2k66hwcAEAulMS7ROeVRrO iA0Lo17qVmuTaZnBbSFPofjTOChqgAQ= =0XW2 -----END PGP SIGNATURE----- --mrpxrcur5riymvjn--