Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9928967ybi; Wed, 24 Jul 2019 12:30:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCs4szVoeHO5AafWVEz+FrtD7qY+rxiV02pp5Agk0oZI0W2iuOE8uDokc77UY5gdeXHk1K X-Received: by 2002:a17:902:724a:: with SMTP id c10mr81583922pll.298.1563996630721; Wed, 24 Jul 2019 12:30:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563996630; cv=none; d=google.com; s=arc-20160816; b=u/KruU+6NuS9pjeAsY2JZtoqF8h433uYpH5uVTTzwjnqZpZFGUIufLQVD88Hk2bQFk LMh4vE7UmW7/zl6TxuUNs18oaWAZXMnAjsTexWULd2Qup/Y/3m0nI+fb/MYdUVU4uvu4 Mxeis5veA7vWCMth0PCY69Yd9dA3o8GRIAPjg9AnYGv9IWzVBNO5/QvWS1suDhox4ZmP wnubId3CFjTsAztdNDq/IUJbqgjmyAfRcVF2fROUDmB56BWJivPbrmoPGNtmSgagzfWS X94LuKLlDQ5nDsQmv5tJP+0GsWchjFF1Z5dMaKp3TDSaaLoeJPa1BAHFoi3JDCnSLdlm GWsA== 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=jp4j4R/p3+sltP59J9tmtlOQl8WL4bZ4vZnYkXtvlMU=; b=rEYHBiBhhpgnEj/4DH055ReZV+6jKACx5RKmWGkLhTHPH2f5cw9b4oz/ji/c1IkY9J LfbXCt9jXgMjTSViJHv7C/nYa4GuubpSyH7NSz2uw0Vc7WcpouWzVqCytKsXsaR4eouK hFAvg5xdbrMaEP/7BK3L9dvedxQ0fNsAPzaeHaHQV1577WmANpe620k7W7FeoDf83+kW AQeUHoLm5tkBgsz12DbIc1EGL/6KZSXV1RtVF4+JtJeyfYAVrRoPtwRDH8s4U6qtP1hB L7s+OYnteaiez6EmqmHiTcIxnXLDaoOn7bmbjGZ200GtE0CK/VKzLBqbMK/g8IQA/sC7 Lwtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=n5HDU5xf; 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 201si14837762pfc.173.2019.07.24.12.30.15; Wed, 24 Jul 2019 12:30:30 -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=n5HDU5xf; 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 S1728630AbfGXT1J (ORCPT + 99 others); Wed, 24 Jul 2019 15:27:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:44310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728572AbfGXT0z (ORCPT ); Wed, 24 Jul 2019 15:26:55 -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 81F0D22387; Wed, 24 Jul 2019 19:26:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996415; bh=JCPTuGfRM364P6BBf0xXm6vZVjJevDMqfh/vxoEhrBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n5HDU5xfZbpVxw/Y+kqBx1LrjKtzu88cGIdbNyWMZtbrjwxRDlnvn5i03360uZ8q/ 9aD9BLLs+KqOzI2n+E+8KVr+GqnL6YfEF3Hf+RviEhvMLRujw8GJN5pbxIH7tZ0Hdz g9sQ3zHUVwxJDRsiI0nB4fK0g7AEkHmlov9P/ji8= 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 5.2 089/413] regmap: fix bulk writes on paged registers Date: Wed, 24 Jul 2019 21:16:20 +0200 Message-Id: <20190724191741.433561892@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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 f1025452bb39..19f57ccfbe1d 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -1637,6 +1637,8 @@ static int _regmap_raw_write_impl(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