Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1118960ybi; Fri, 2 Aug 2019 09:35:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6Gy8InUOyv5ePMYUqP1OAUoXNO9uqf51UEYhjP/8IdK/MGXyBnffhirvUywyHnwsmEkl7 X-Received: by 2002:aa7:93bb:: with SMTP id x27mr62440900pff.10.1564763702394; Fri, 02 Aug 2019 09:35:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564763702; cv=none; d=google.com; s=arc-20160816; b=uLipKEbZCbiXjpFzEWEA1VW6+NXiBfpFCICKuf1bI3QK09iKZ0bGLjKWvqYfA2SlIQ VlvndfPa02NSeRc+CvvlkBHEm0frlsRZSpbv7tVlrK1Nlv0RVoZBEjXP0LRsJP8GJdO9 SxRBziCPSLZD+6eMAsMbBePnNCGpqjt1hQYwAHi2piY6v7rSfTO/wFn5ScTM47WSNqzn LSPc4b3m/UHo17oNe+bJY4xZQ9HKvz9XrzMLDv1Caozwg6FVVnraqpGRXjcAM4fvjr+H fkm8xZKh3cLThhmbP4eoarxPXkegeNKuFm5mi4gCdyGhYVZKgrKFKDmonWyqFkUh3hVY WphA== 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=2TlAPmzyhcHf2vbDqYNU4sDySyOdwzuQj44T50wvZIA=; b=jq5mNklfdSJjOQpd6ygF+PI1juVqAuszQZo+LNJ4KiHAcT4QpyCMXy98oqfxvdyFRT QxNmSPn0wxqPARl7r5wY6iNBLJ30z1P71TgSCxkGffRk3PIyLkwo8+P4G/Gil9xJSNlb UQk/zD4jJUffKWHjCZiJs5fF9HJJKuYHRKb1Nj8l6RLQJWYWoDbeucyThpASzqY2iCdD YfabWwAnoQI47XMdD8JHd8R3ZfmR3f4gIJ+Wd+swlNxmjGZQhXA5lkVJGUEPSl1HSGkf QdZjf2jbvQFcaV6F4/6rEueuiAdjgDMaeMjLpkvRwG6fiNLhXEYy7wjLEZiA3up6uF2+ 30tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="FnD+V1//"; 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 f91si35663577plf.300.2019.08.02.09.34.46; Fri, 02 Aug 2019 09:35:02 -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="FnD+V1//"; 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 S2391827AbfHBJmO (ORCPT + 99 others); Fri, 2 Aug 2019 05:42:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:44342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391403AbfHBJmL (ORCPT ); Fri, 2 Aug 2019 05:42:11 -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 630F220679; Fri, 2 Aug 2019 09:42:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564738930; bh=HmTvGqBfYt/sJX2ofqMKF6l5UKXzQApS2gjp3aXKD3E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FnD+V1//rwC7KB24vKjkKTQ7j0OS3HHEYa7cVI69x6NTrNk1RgJmB7Jd4seq8VfSd 74tPGx6I+1tv/x5W7DldT2LyU/JdwreNDpdh6A519UJvgjuhU6t/ZS2zuM5JymEjMs HMVTB2yI3t1WAujC9m2Rr1NhLXDhbQ5W0utLZdac= 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.9 036/223] regmap: fix bulk writes on paged registers Date: Fri, 2 Aug 2019 11:34:21 +0200 Message-Id: <20190802092241.320506038@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092238.692035242@linuxfoundation.org> References: <20190802092238.692035242@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 69c84fddfe8a..1799a1dfa46e 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1506,6 +1506,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