Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp662628pxj; Tue, 18 May 2021 11:16:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrbua2DE/s5/UI6I91kr3uN/QtXJAfkO/pb8qxpcjemK+qOpl296v4wq2y9r4BdRQEZ8E4 X-Received: by 2002:a17:906:af70:: with SMTP id os16mr7023695ejb.201.1621361811915; Tue, 18 May 2021 11:16:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621361811; cv=none; d=google.com; s=arc-20160816; b=lQIZ+2HB6RrqRz7tnLjVxDZrAjRqEg7jLlCiZwMxqsShV/MUtXXOa0AjwATnY5SZ4Q zo2f++ZMGmvZAyM9iTsEO42Vf32PalxnyDoTaIZigkgCR7jKaKCZzkOG4biBmriwFWKC UB5UWpxLTPyhTnqqaX+zKkdIu11puAGse5mY1ZFylH8nixFqqOW5Uq5+Sy1eBSJ2fkU4 Zep27QSEofC58QQE0SKUctr2gwtAAZUKLJs8q4PGjWs9SiHzA3BRQ8+a4xXBEdiuIrBw q7t5jBc0/YhR6E9zu32Nb47mXNKvZl7iBSRgtKk02z/WJLoG/jLuIWlGVW52Xb+C38/x +7Tg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9jlbJyH3jfq3259nNWubCDO4UrLguynrT3LjQhSuTqs=; b=jGZqk581OpcIUWLrQJeD7kt0wUhVoSO4tnEI5LHc+2JFiMpKtz+LF91H9VrK65JK88 WwyPYZeYyPj7DZior/UvBha+eMujBPrBmRRpxH7nGFJlhwbkPSNHWYflEjDAwFgTU5CX +zNQy5lXfoYEwdpirC4zWH/yJ9+OpckIeFg6CvmsUNhlb+pt8xsGRqryTg3gDyynpUbS DwKY7DwipEk+LODqLjgibZxVsXJr+hu6IoJBGY+695Knn4UTyU1psFisHhKNlbBTyueX l9OulciPcMmnnaq1WBBSHhoBIuTd4laY2+Tm3KftwCqFwlc6GmDu7biagm8Ptn7ZDYvS stug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wPR3+7ql; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y19si18832216edc.411.2021.05.18.11.16.27; Tue, 18 May 2021 11:16:51 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=wPR3+7ql; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345429AbhEQQMx (ORCPT + 99 others); Mon, 17 May 2021 12:12:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:35612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245144AbhEQPsP (ORCPT ); Mon, 17 May 2021 11:48:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C362161962; Mon, 17 May 2021 14:45:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262701; bh=sm8ZH7gysXzcnQnc1SaFFmXLhMTtkYqQ/OCrUYQWeio=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wPR3+7qlzCWZIkVtZGo3W/a2PccCCdK8d07gAad+36xqpE4sOFmALDT81ypauU6Vr 1H5F+mVNXB3LgM/5++SJ7HtbjK0jdVb358swft3JBqlFnpdkYLWsrfs84F2JXLdhrB b9vR0OwLaXL+a8/w8qk3NWXGTJ5gocHc/Wmq97hw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Andy Shevchenko , Jonathan Cameron , Sasha Levin Subject: [PATCH 5.10 224/289] iio: proximity: pulsedlight: Fix rumtime PM imbalance on error Date: Mon, 17 May 2021 16:02:29 +0200 Message-Id: <20210517140312.709800294@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dinghao Liu [ Upstream commit a2fa9242e89f27696515699fe0f0296bf1ac1815 ] When lidar_write_control() fails, a pairing PM usage counter decrement is needed to keep the counter balanced. Fixes: 4ac4e086fd8c5 ("iio: pulsedlight-lidar-lite: add runtime PM") Signed-off-by: Dinghao Liu Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210412053204.4889-1-dinghao.liu@zju.edu.cn Signed-off-by: Jonathan Cameron Signed-off-by: Sasha Levin --- drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c index c685f10b5ae4..cc206bfa09c7 100644 --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c @@ -160,6 +160,7 @@ static int lidar_get_measurement(struct lidar_data *data, u16 *reg) ret = lidar_write_control(data, LIDAR_REG_CONTROL_ACQUIRE); if (ret < 0) { dev_err(&client->dev, "cannot send start measurement command"); + pm_runtime_put_noidle(&client->dev); return ret; } -- 2.30.2