From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96C81C33CB6 for ; Thu, 16 Jan 2020 07:23:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6EA562087E for ; Thu, 16 Jan 2020 07:23:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730639AbgAPHXd (ORCPT ); Thu, 16 Jan 2020 02:23:33 -0500 Received: from stcim.de ([78.46.90.227]:47336 "EHLO stcim.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730400AbgAPHX3 (ORCPT ); Thu, 16 Jan 2020 02:23:29 -0500 Received: from [2001:4dd4:d47c:0:a288:b4ff:fee5:f5cc] (helo=porty) by stcim with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1irzUv-0004a2-CJ; Thu, 16 Jan 2020 08:23:21 +0100 Date: Thu, 16 Jan 2020 08:23:20 +0100 From: Stefan Lengfeld To: Marco Felsch Cc: support.opensource@diasemi.com, linux@roeck-us.net, Adam.Thomson.Opensource@diasemi.com, linux-watchdog@vger.kernel.org, kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] watchdog: da9062: make restart handler atomic safe Message-ID: <20200116072320.f7ia3e76hx7yknqb@porty> References: <20200115162307.7336-1-m.felsch@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200115162307.7336-1-m.felsch@pengutronix.de> X-PGP-Key: https://stefanchrist.eu/personal/Stefan_Lengfeld_0xE44A23B289092311.asc User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marco, On Wed, Jan 15, 2020 at 05:23:07PM +0100, Marco Felsch wrote: > The restart handler is executed during the shutdown phase which is > atomic/irq-less. The i2c framework supports atomic transfers since > commit 63b96983a5dd ("i2c: core: introduce callbacks for atomic > transfers") to address this use case. Using regmap within an atomic > context is allowed only if the regmap type is MMIO and the cache type > 'flat' or no cache is used. Using the i2c_smbus_write_byte_data() > function can be done without additional tests because: > 1) the DA9062 is an i2c-only device and > 2) the i2c framework emulates the smbus protocol if the host adapter > does not support smbus_xfer by using the master_xfer. > > Signed-off-by: Marco Felsch Reviewed-by: Stefan Lengfeld On Wed, Marco Flesch wrote [1]: > I will send a v2 to cover Guenter's suggestion. Can I keep your reviewed > by tag? Yes, you can keep it. See above. I also checked by reading the code that 'i2c_smbus_write_byte_data' behaves the same as 'i2c_transfer'. Just with some indirections. Kind regards, Stefan [1]: https://www.spinics.net/lists/linux-watchdog/msg17194.html