Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3783080ybi; Mon, 29 Jul 2019 12:32:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9AhqEegoTDpotWdUjT1zdOWrt6D4uu7VXMfDE2k8aV2InJwSaBmLNWJ8clGQZvcdrwH1h X-Received: by 2002:a62:1597:: with SMTP id 145mr36855794pfv.180.1564428741520; Mon, 29 Jul 2019 12:32:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564428741; cv=none; d=google.com; s=arc-20160816; b=gs/2CiiDV2TOMYVR0CXimp8ut8/y+NYgIAyHl7+Os14CoBrMiwumCmR+UYXILsZjp1 PlHJ62I64CFMy2f3arXJrlX4AtKOMEK5AOzqLEzlS/ukmpWacf5o9ll+q67j6UtugI6G t742zbhlUmuwLRrGaOfFCe9cGSwiSrwJVSC2AdwwoA9DwabrvskO2psFUIyIdQhMHAuf 71ktOr4jXjDmuON6WWBxzhRQEeKiTRq2lCfs+vz66e+M83+SiqGASy09IiJ6mNueQw3O AuaRJ42ZSYSw3Tw3TbwMKrV3vHXEcvTE/uhpZRwWlQjIczl/4PbTvJ80gLT/+1SFFGCx Z+yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=36rK/HK+hn9ShW86WqD+0nLj7q4W/VxOZkhyqih9vhY=; b=OA3U+oTFQ4+ErFMFYStLRU10my+V0ulns/Dx33iihl4IlR5TaNBFBiJCT2y7cuLbbg HanOJOtniR5wGQ9diVCqcwXh88zQ38jvotBWXOMk6X6GRWc2sk7hIg7Wz4+osGc+/dPB NdMzz2v1IAFWbHUgfUoqEb6gfmZX3UqZxnsgzHc47UGUr/G3CiQMMKvzo/4f2LbRXpYP NlmsXrPKRupHIDUMG4Y5dGJxSImovMkZUMzCgov4gFpIQegw7U0omD0xh1VzwzTp9hQu UpfrYoWX9fHrolkni5CBCqKRG1jg9EdhT9NY+6DU/g/iFB9LxIH/f+UKPFEFFoz+oa2o qQSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OCusRr0n; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 123si31585648pgb.374.2019.07.29.12.32.06; Mon, 29 Jul 2019 12:32:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OCusRr0n; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729724AbfG2TZy (ORCPT + 99 others); Mon, 29 Jul 2019 15:25:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:38234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729714AbfG2TZw (ORCPT ); Mon, 29 Jul 2019 15:25:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 87BC52070B; Mon, 29 Jul 2019 19:25:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428352; bh=7qawMTny9KFtJNDsICFl5Oou8NOsKIS9zej45N24Lfw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OCusRr0ngJXXZRlBMirUq2K67qrw23y51YTJbD07Qq4WDhxEqcQYdwMtMIgymSnoE sukvFIk7c3x3k/DkuaVmkxgeqXRUedJgTREemvwbrOWkfkuz78t4U0NoTSp5q9jkXm r7LEF+jl13KAG8MQpKxoAPwU6bKld9FhOjLDyTd4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivas Kandagatla , Mark Brown , Sasha Levin Subject: [PATCH 4.14 047/293] regmap: fix bulk writes on paged registers Date: Mon, 29 Jul 2019 21:18:58 +0200 Message-Id: <20190729190826.798989049@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit db057679de3e9e6a03c1bcd5aee09b0d25fd9f5b ] On buses like SlimBus and SoundWire which does not support gather_writes yet in regmap, A bulk write on paged register would be silently ignored after programming page. This is because local variable 'ret' value in regmap_raw_write_impl() gets reset to 0 once page register is written successfully and the code below checks for 'ret' value to be -ENOTSUPP before linearising the write buffer to send to bus->write(). Fix this by resetting the 'ret' value to -ENOTSUPP in cases where gather_writes() is not supported or single register write is not possible. Signed-off-by: Srinivas Kandagatla Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/base/regmap/regmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 8fd08023c0f5..013d0a2b3ba0 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1509,6 +1509,8 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg, map->format.reg_bytes + map->format.pad_bytes, val, val_len); + else + ret = -ENOTSUPP; /* If that didn't work fall back on linearising by hand. */ if (ret == -ENOTSUPP) { -- 2.20.1