From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753937AbcHRJC5 (ORCPT ); Thu, 18 Aug 2016 05:02:57 -0400 Received: from regular1.263xmail.com ([211.150.99.130]:54505 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753180AbcHRJCy (ORCPT ); Thu, 18 Aug 2016 05:02:54 -0400 X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 X-RL-SENDER: zhangqing@rock-chips.com X-FST-TO: broonie@kernel.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: zhangqing@rock-chips.com X-UNIQUE-TAG: <72ab21d7dd3107e837642c5be6210a32> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Elaine Zhang To: broonie@kernel.org Cc: huangtao@rock-chips.com, zyw@rock-chips.com, xxx@rock-chips.com, jay.xu@rock-chips.com, linux-kernel@vger.kernel.org, Elaine Zhang Subject: [PATCH 0/0] regmap: drop cache if the bus transfer error Date: Thu, 18 Aug 2016 17:01:54 +0800 Message-Id: <1471510915-24838-1-git-send-email-zhangqing@rock-chips.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org regmap_write ->_regmap_raw_write -->regcache_write first and than use map->bus->write to wirte i2c or spi But if the i2c or spi transfer failed, But the cache is updated, So if I use regmap_read will get the cache data which is not the real register value. I think the regmap should handle that gracefully, and may be my modify is not the best way. But as I described is how to slove that problem. Elaine Zhang (1): regmap: drop cache if the bus transfer error drivers/base/regmap/regmap.c | 2 ++ 1 file changed, 2 insertions(+) -- 1.9.1