Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp883209pxk; Thu, 17 Sep 2020 20:16:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgG16MOfpn2+PqKqr7+rFPJQXXpo7a8nYYxmTTCc/M9YIfO7vJ8AA+E7WiOY6UqBsNkI+Q X-Received: by 2002:a17:906:454e:: with SMTP id s14mr34706869ejq.137.1600398970386; Thu, 17 Sep 2020 20:16:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600398970; cv=none; d=google.com; s=arc-20160816; b=kzRsyXvmp1pJAI23n49ABgIu/Jmavll0DHTNBnip5Aq75QX2xEP+Pm9RqDGTwteOzM pE0QUuFTf3RsE5r3jwKn8k/nigoWS3WVtwwKlGnMlujnJZ+gYiRaFcPXxhode+h8Dyyg kzEL4AVro0WYzhRMaf1aQ13pYMYLemgDMUDLW3tX7PaoGTj1cws6ROTa8Hi4FDMDltPa OfXxF5IyzuOIph5Y3ffqockTxlus2CH6wFGVR20zLytGQ+FtrbvDK9clrnSb8yWtPoGC FTUt1PNQqvDW3HkvwyT9p7oGcgMgd8tAfT2E7P7aRmSNsBYvPJ5/zrSgLo9cfs2sHDbq fSFQ== 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:date:subject:cc:to:from :dkim-signature; bh=dTEEEsqTFayLPL88a3LMtPc1z0xwI7NSSpqczVY4WGc=; b=FMSbaRtxFQVLp2ODl4EmBTljF8uErMr1w4Kb/nHzOWT67UMreZY5XtJi/pfgCuhtDN H0aJtJn8ttSgrizym8v/xp6YTbK8+RTlVuqGjheS5D5lvjQ5w415gv+nSoNHlRIUm9ZZ 6oqTFDybdMiAdKjPVPxnNmgNnewfDc1yniEByAgB6Lpfip2jokl09DKRAnDGvxbL/0fa c563MhfZev4bf+Uf0zk+ezZxhskyfEqaUyLGjTfJkRAt9bZOJAwwxUIgB16m4+T57ZAk IjCXYhZAPMkBrZy3xyssJ7ksYO4SJKrF6a9aYVHucpVlhkOz6nnAAxsBEwrjo4QaIkq6 q41w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oTAac59j; 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 w17si1131346eds.432.2020.09.17.20.15.47; Thu, 17 Sep 2020 20:16:10 -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=@kernel.org header.s=default header.b=oTAac59j; 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 S1730242AbgIRDO4 (ORCPT + 99 others); Thu, 17 Sep 2020 23:14:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:46050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726476AbgIRCBo (ORCPT ); Thu, 17 Sep 2020 22:01:44 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BBF5322211; Fri, 18 Sep 2020 02:01:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394496; bh=D9Mmu44ONv5Ajq1SJwLkYrBw/Ft5CgqnmIC5zOjSj+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oTAac59j1QfDBeM4F3Lz3++DLWk0/nwQ4mqfExjyH6ogIg+KXryIV+GiNfBr9xnZ8 3ZEWfWf4E5GVZVCJmgsr4EhLKBYPHLzMk4nuLUi1dKj2J1VlgtUiJ5bwCVKpfIK58X IAOn5K8K6DmCBO8JH8S7s8FGoiEUL3ICwpd1VJMo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin , linux-media@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 021/330] media: smiapp: Fix error handling at NVM reading Date: Thu, 17 Sep 2020 21:56:01 -0400 Message-Id: <20200918020110.2063155-21-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sakari Ailus [ Upstream commit a5b1d5413534607b05fb34470ff62bf395f5c8d0 ] If NVM reading failed, the device was left powered on. Fix that. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/i2c/smiapp/smiapp-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index 42805dfbffeb9..06edbe8749c64 100644 --- a/drivers/media/i2c/smiapp/smiapp-core.c +++ b/drivers/media/i2c/smiapp/smiapp-core.c @@ -2327,11 +2327,12 @@ smiapp_sysfs_nvm_read(struct device *dev, struct device_attribute *attr, if (rval < 0) { if (rval != -EBUSY && rval != -EAGAIN) pm_runtime_set_active(&client->dev); - pm_runtime_put(&client->dev); + pm_runtime_put_noidle(&client->dev); return -ENODEV; } if (smiapp_read_nvm(sensor, sensor->nvm)) { + pm_runtime_put(&client->dev); dev_err(&client->dev, "nvm read failed\n"); return -ENODEV; } -- 2.25.1