Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3743804pxk; Tue, 29 Sep 2020 05:19:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGOPSEW/YhdaQpb387PVHPo9o88xuq7XUo3YmupgJgjhOJW9uM6KFg0v9Pjn6VgXVTOlsn X-Received: by 2002:aa7:cb8f:: with SMTP id r15mr3013522edt.356.1601381956528; Tue, 29 Sep 2020 05:19:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601381956; cv=none; d=google.com; s=arc-20160816; b=i8hL8VFVmxZNGuttrurKvef2KVCUofp4W/opUX4Ves5KRSaHG/VvAU85wm44aS8L2G N8EOSbh+w6htXm98eEac+U15kYzwy6QNKpE/GfAF3/xBtLV8CtTXs0YLtP2Z8o0C3UAz FHw8eEdziFbgWJikXYrWZKPf39IdIqf3vvCdgnv5yzI3YHe4ImwRyR7NRYWiJdiLLnVM 5dfy8fYcYVFdocHItXQQ0zEC9HKLvjf5lYAB2YrOYMgLuWfzyvMRZduwoDYGqN9kJmt6 x6w8s9tISMMrAC7z01vnkuGXf7bEWA7Wx7jgoO0No9KHEPyk12bAU+O6jfDi3wfFaztk /CeA== 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=dTEEEsqTFayLPL88a3LMtPc1z0xwI7NSSpqczVY4WGc=; b=YmW5MUv5J3CtgqOee9fi2oYUT8CtOmB26OG0OWy2Ut/IY1OY9lOcunAtDGOeHzpdHR HB7rSRKF7vYCBDyUyihTrHiLFaiz1pE7oZ7yGnUVZN5UKiyU27pie7MtCcx7LPgNjaWh WBMI+BvkOKKyW5wYuj4Xx+axfSvqk2MUH6p4POEI9Dx3Wi24K0yjHNY8kxCJsbdAIxqb ZLE+NNRMl1ua2JXGN00hBYtvsVtedIDLEUECMzArBHoPBRv033c3XbTUxVtW+qVEkojM Zvkr1DsVcbJ++edupWdYVq/JyJbIPcWz/i9VuwBQZzKR9xJIeIzV3llMOHlwaihHfd40 F8EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="jMrSE2e/"; 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=fail (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 18si3159443edv.184.2020.09.29.05.18.53; Tue, 29 Sep 2020 05:19:16 -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="jMrSE2e/"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732365AbgI2MRx (ORCPT + 99 others); Tue, 29 Sep 2020 08:17:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:50012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730001AbgI2Lgx (ORCPT ); Tue, 29 Sep 2020 07:36:53 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 172A723E51; Tue, 29 Sep 2020 11:31:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379115; bh=D9Mmu44ONv5Ajq1SJwLkYrBw/Ft5CgqnmIC5zOjSj+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jMrSE2e/w1cHxMCewZKu5lz5kbbSRkfR+s8AYf+Rp3pSkcGNdKAzGFSLbUOHrAFs1 KJUGZ2eBg+PZHzxoMMPmDADucU3NDtzVQ87sTmvqcYdOw4ZFkNybTlCFpLjbZhTWf3 Q28QBtplzJkJd49B2xLFa3Y5qzLY+hrVBGSeIm2c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.4 020/388] media: smiapp: Fix error handling at NVM reading Date: Tue, 29 Sep 2020 12:55:51 +0200 Message-Id: <20200929110011.461358505@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929110010.467764689@linuxfoundation.org> References: <20200929110010.467764689@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: 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