Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7464468ybl; Wed, 15 Jan 2020 23:35:09 -0800 (PST) X-Google-Smtp-Source: APXvYqzvIkw8yQxbFWmbKwFnh5Xprx+poM7UaniudXGLXqZXs+d6z1qJo9x7RaCtVFNdEqEETOdd X-Received: by 2002:aca:f1d4:: with SMTP id p203mr3141810oih.116.1579160109170; Wed, 15 Jan 2020 23:35:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579160109; cv=none; d=google.com; s=arc-20160816; b=pJ7+HkgPDZZYg5Pvf6zVguzveKLiKp6Wen/c1yYTXGwueqPgNbY4ODr0yBJ33ngabP AkcqPgEJLFZqnlD9xwVUvjzx/T7/SQ2Y22NBTWsiodL6EhbEKr9t0MOWX4ugmRVVn4/n xu+tKTIeoHcd958869oylzp+umb9/6gw0VDeOtZBAH4JPBNX3O9t+AjYBEo6eN5L22ro B0dfDeQ8MS/N13PnbRe6LONPXVEY7YflS9EgZ3eibCjL5d1Hb/NdK4NK8a69XAlFVTBo KrsGEGM0+KJTXfMFesnnBLmpXQPttRDdztooMsHzaz//0fkxV1WOtE7wW2H+f+SAe8wC p1tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=DMPaU1mJGb03hUEyA50bK6Jo31dXuiA1RxtBZqzgCPI=; b=nuebVVMJtuDAfjneKy8kb0HwFEk1n/ne+F3ICOxAuqLMTyRp/6RABauCYXy1tISccD AIxg4iKMorjvr0AsuBEdN2vbqdpONr0ibMTNkRq/DmMF9ISHe+yeHOckvtY46qvz0Wyw QQ/RwlYvFBE8ZfH7wgPB+Dgc0KJ6JKk261MwDydYgHieYPZj87RdGlNFq55MwNrg5Dzv 2VhM3qSzygH0SCgMcFJ3nL5KN5qxP/WR6zEo2zDXwS+P6jmFBTPmCSnGz1kf5qTeiWa0 T79sP2VWdjhVkCvKywp1ibRAjN2By4nY+4AzUZQ7LwYne28t38ruLqlStiuoCyGHL7qH OfJg== ARC-Authentication-Results: i=1; mx.google.com; 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 b133si11478821oif.244.2020.01.15.23.34.56; Wed, 15 Jan 2020 23:35:09 -0800 (PST) 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; 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 S1730599AbgAPHXc (ORCPT + 99 others); Thu, 16 Jan 2020 02:23:32 -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