Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp152639lqt; Thu, 18 Apr 2024 10:51:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU5GKiUqCzjRZzTtYLZCckB+i9g9A86hxvt61+xwaHWSSfKVZNd/cU8kJnL5ZjLIGU7yLAMP5wsJIlPuBhO4QqvDjUvLZmPhhXwICKWcQ== X-Google-Smtp-Source: AGHT+IEkF2Yrt0q2m5DwrCMigLr6gew2ul5WjLl8RgTL6+jshIr4JQzUZNHgrrt0wLymWLOUdrkr X-Received: by 2002:a05:620a:2fb:b0:78e:dcb2:4cbb with SMTP id a27-20020a05620a02fb00b0078edcb24cbbmr3744026qko.31.1713462669217; Thu, 18 Apr 2024 10:51:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713462669; cv=pass; d=google.com; s=arc-20160816; b=vvWlOSSSYAq/BpVF3iKkf4vJxtQ5cAl1oYFaDQ+5KY95cuzLRw/o5SrW51wTt5gUfx 6irvLDPt7QwtcX8sotby9uPagaQ4bKztDB8ySbGrK9y1n2gATdJ6/IZgxOwBro1sf0cM crywsD4P1hBdtyMm4NVvEhbWGMZlkF/E2t/Vkkt9ytipMo/UE0I9sHP1p6HtQgLinmjj EHBB81lwX/xfDgjIGcvQoRGXvzxt6b6q+e0oTdrb9QzUcjbclwogvD0DhkRzxC64yPeL V8fq6Mteq5a9Qw6M69AT102PJ39VVc5Tv8RJnEKlgKZt66dIe2MagtBsvi6zW4SsEekw q/ww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=dkim-signature:in-reply-to:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:references:message-id:subject:cc:to:from:date; bh=CpuYA2U5zadpTrpInLy8Sg85CTz03F2QsvGOdLrnGeA=; fh=VEoedhfMvetUwS8JwIhzylJ7uk9AT6d/rDGR6StcPxA=; b=IdMsVNRHgvfifEMLimuBQ5tM/Wf8Npn3wTHrPZdxNU1Mk2d0g8W9ZtC9zUExeOcfnb eehvqReHT6dLvO2uZXN9vCCvA8FxHsW4DIN1dVtjhjONKHeiUa7F/g2Ml1y++OMr//3+ lVGCwedBnIbgNzQ1dy0idYqMW+yZ4LDF4jc+ahBgxPpQnHKrcXvI0fKMRKXYmozEemYr tTAVU9HJApdHyS+3faYCMbYi/XpVXr3WX7QfgbJelGrRXfFvYYCoowaWk7/ApbgfumKa llPCaWMLTLj/yfE+YycEJrRMPIVqVhD8zhGeBGTMBHyqlCgbYFr7+Cg/64RSjJe/BC4E ZmJA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@peacevolution.org header.s=dkim header.b="dR1AH/e9"; arc=pass (i=1 spf=pass spfdomain=peacevolution.org dkim=pass dkdomain=peacevolution.org dmarc=pass fromdomain=peacevolution.org); spf=pass (google.com: domain of linux-kernel+bounces-150594-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150594-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=peacevolution.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b9-20020a05620a118900b0078f0c7108bbsi1807608qkk.145.2024.04.18.10.51.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 10:51:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-150594-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@peacevolution.org header.s=dkim header.b="dR1AH/e9"; arc=pass (i=1 spf=pass spfdomain=peacevolution.org dkim=pass dkdomain=peacevolution.org dmarc=pass fromdomain=peacevolution.org); spf=pass (google.com: domain of linux-kernel+bounces-150594-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-150594-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=peacevolution.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id ED6B11C20FB5 for ; Thu, 18 Apr 2024 17:51:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 521C91779AE; Thu, 18 Apr 2024 17:50:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=peacevolution.org header.i=@peacevolution.org header.b="dR1AH/e9" Received: from a.peacevolution.org (a.peacevolution.org [206.189.193.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F32D3168B06; Thu, 18 Apr 2024 17:50:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=206.189.193.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713462658; cv=none; b=QF6xlZwM0wlt36le8IEhSSCjMF5MEHDK1tKtnslE98zQbogJB3f3SHrGhoMdwchm+nFBidncFUfI+3ET/QXhvGMldzTYULptHdMRwCQTZEYvmKIE6tTl4qT10i3bfPocrlR3oJTEzymHmQIpIoOU5No3c5ZDB42L2CFwzxYkjXQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713462658; c=relaxed/simple; bh=rNe8Fy7Y8K2hLaFXzMJJFlHwm2uFh2o7gtVK7iibMas=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pi+rUf/bPmCQ5HVbtgTSotIG1D2NFTpy2LMzVFJ40gy5iVFsrt7vIFK+Pt2/ARRbfEZkF+RkJcv3AnkXre81X+jVFkw3hpZIzKLvF+Fz9anA7gUQpQIdgsmrdSCSloO4mMWOkIDi28z+LJUgEXxQch8KvsN8hMlD07W8fPqbB10= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=peacevolution.org; spf=pass smtp.mailfrom=peacevolution.org; dkim=pass (1024-bit key) header.d=peacevolution.org header.i=@peacevolution.org header.b=dR1AH/e9; arc=none smtp.client-ip=206.189.193.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=peacevolution.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=peacevolution.org Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by a.peacevolution.org (Postfix) with ESMTPA id 56A0444E48; Thu, 18 Apr 2024 17:50:54 +0000 (UTC) Date: Thu, 18 Apr 2024 13:50:52 -0400 From: Aren To: Andy Shevchenko Cc: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Liam Girdwood , Mark Brown , Ondrej Jirman , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , linux-iio@vger.kernel.org, phone-devel@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Willow Barraco Subject: Re: [PATCH 2/4] iio: light: stk3310: Implement vdd supply and power it off during suspend Message-ID: References: <20240414175300.956243-1-aren@peacevolution.org> <20240414175716.958831-1-aren@peacevolution.org> <20240414175716.958831-2-aren@peacevolution.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spamd-Bar: / Authentication-Results: auth=pass smtp.auth=aren@peacevolution.org smtp.mailfrom=aren@peacevolution.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=peacevolution.org; s=dkim; t=1713462655; h=from:subject:date:message-id:to:cc:mime-version:content-type:content-transfer-encoding:in-reply-to:references; bh=CpuYA2U5zadpTrpInLy8Sg85CTz03F2QsvGOdLrnGeA=; b=dR1AH/e9KzKYSyF/GUm1Q6nVED2/EsOuZ8Eg5UhDFIPVJCfWquLu9qcFxv4fT5yrlV+xzm ojtYymcNuCN6xCcAxKJDRHfnSRZQX8u4hFFQQCvSlHIUfPI4922XfZoe92YYAWUBmUogiU w+yBRCWIPEw/51bWz81gYO3NGCwo6XU= On Thu, Apr 18, 2024 at 06:56:09PM +0300, Andy Shevchenko wrote: > On Thu, Apr 18, 2024 at 6:06 PM Aren wrote: > > On Mon, Apr 15, 2024 at 05:04:53PM +0300, Andy Shevchenko wrote: > > > On Sun, Apr 14, 2024 at 8:57 PM Aren Moynihan wrote: > > ... > > > > > stk3310_set_state(iio_priv(indio_dev), STK3310_STATE_STANDBY); > > > > + if (data->vdd_reg) > > > > + regulator_disable(data->vdd_reg); > > > > > > I forgot to check the order of freeing resources, be sure you have no > > > devm_*() releases happening before this call. > > > > If I understand what you're saying, this should be fine. The driver just > > uses devm to clean up acquired resources after remove is called. Or am I > > missing something and resources could be freed before calling > > stk3310_remove? > > I'm not objecting to that. The point here is that the resources should > be freed in the reversed order. devm-allocated resources are deferred > to be freed after the explicit driver ->remove() callback. At the end > it should not interleave with each other, i.o.w. it should be > probe: devm followed by non-devm > remove: non-devm only. I think what you're describing is already the case, with the exception of parts of the probe function not changed in this patch mixing acquiring resources through devm with configuring the device. I hope I'm not being dense, thanks for the clarification - Aren