Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2120151pxb; Sat, 21 Nov 2020 09:26:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzyK7fAVaoSE8FLT/5N1c3TcmhR58n+mkyXICk1saEmvgbKcFuUsX9wALip5Of+1YcXpQ2i X-Received: by 2002:a05:6402:220f:: with SMTP id cq15mr13682263edb.258.1605979606464; Sat, 21 Nov 2020 09:26:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605979606; cv=none; d=google.com; s=arc-20160816; b=jnJNL66s3p6vGhue4o+slAK+VcVji4sgdXfLWrE4Fhks6FgrhwUhyJxko/FM5vvVlx bIAqk3JqT7IYZk6MogZ5sgQlN7KhqQYNnDjTb1KMfE1WjczmVUY09+rWEOf0K6xyPXMb 4SaHUS0bVQyLqO5212pBioeEh7UeZtI73bUO8g69za4oip5qY1DMNBNimXRFvRKy9hdp Fd8DXVzNlcO//8/vkGki/zRp52+Yd1+N1Weqrql/GifkY9tyKXDo/bHAfs2rHjmdxmWY KUGrKGzhDMAB/wwzugUEWOcfhj41tln0vue2NWfMlnxqw6LAGfy8lMx0+nJUtFX7oCDO ohvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=9Pe56GbWvosHLAct0+2p3gV+zb4iIXh9SFK2CSyRxtc=; b=fJaOomKlfCIMpCKCGbHXcQWqktlf79kUhIscoPUC4HBCtrbb/i96Lv524EBGz5ZSuW dhOj1TvESXdIfpL/NMVhE8w8IDwgFJzyfOrxhv+X9fZOcIHPIT43AS4F6zBX6TkdErmX EyiQo8ShsiIXE43skgT96RVWLClYTInVN80CVtZtLjkPb1x+unoF5RIbh8EJWrdWUA8S z71YR6SQWyzPNVuE2qkdxRgitaPHX5yeVnEcPMRjo9VHoIFGOCX9D+0+Fty9PI1OTw9k 3v31jHzFrn92pIMd5CKQfDouKzUiraLR6rUBZi65ZvcfkUe684NirhY2TczLri2iz4Um g6dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Gjunsitt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yk13si1316238ejb.414.2020.11.21.09.26.21; Sat, 21 Nov 2020 09:26:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Gjunsitt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728087AbgKURXC (ORCPT + 99 others); Sat, 21 Nov 2020 12:23:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:41072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727145AbgKURXC (ORCPT ); Sat, 21 Nov 2020 12:23:02 -0500 Received: from archlinux (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B4DF8208CA; Sat, 21 Nov 2020 17:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605979382; bh=yG2OGMLqiBkxwmYUNcyYmCrFrypiBHz3ksLoG91LVDg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Gjunsitt6iiGoM0+hr+GV4rs9pyY5IpsRUW4QXditBE/s/y3+eO8LwCSXa2EpiaPy EVNbj+uRohX35CA/OzUXtmEyPiWfd5w6QWP2Qx7EC/i8RN3HLZJpH/tpzxu7bUNCnu v6O1eGrt5YEnmEoddCTRSXXHALmz25KNC0f50axQ= Date: Sat, 21 Nov 2020 17:22:57 +0000 From: Jonathan Cameron To: Ye Xiang Cc: jikos@kernel.org, srinivas.pandruvada@linux.intel.com, linux-input@vger.kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/4] iio: hid-sensor-trigger: Decrement runtime pm enable count on driver removal Message-ID: <20201121172257.59fa05d5@archlinux> In-Reply-To: <20201119100331.2594-3-xiang.ye@intel.com> References: <20201119100331.2594-1-xiang.ye@intel.com> <20201119100331.2594-3-xiang.ye@intel.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Nov 2020 18:03:29 +0800 Ye Xiang wrote: > To avoid pm_runtime_disable called repeatedly by hid sensor drivers, > decrease runtime pm enable count after call it. > > Signed-off-by: Ye Xiang This sounds like a fix. If so please make that clear and add a fixes tag. If it couldn't have been triggered before, then please explain why in this patch description. Thanks, Jonathan > --- > drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c > index ff375790b7e8..30340abcbc8d 100644 > --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c > +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c > @@ -227,8 +227,10 @@ static int hid_sensor_data_rdy_trigger_set_state(struct iio_trigger *trig, > void hid_sensor_remove_trigger(struct iio_dev *indio_dev, > struct hid_sensor_common *attrb) > { > - if (atomic_read(&attrb->runtime_pm_enable)) > + if (atomic_read(&attrb->runtime_pm_enable)) { > pm_runtime_disable(&attrb->pdev->dev); > + atomic_dec(&attrb->runtime_pm_enable); > + } > > pm_runtime_set_suspended(&attrb->pdev->dev); > pm_runtime_put_noidle(&attrb->pdev->dev);