Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2865633ybb; Sun, 22 Mar 2020 09:31:52 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsYeHClWqUFUa8nS2yxDBeeoBf0vvlAYP1TyK9IFub2PZNWdMjQPlYRB6lmphBYH+KaD9cB X-Received: by 2002:a9d:23e4:: with SMTP id t91mr14738314otb.125.1584894712342; Sun, 22 Mar 2020 09:31:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584894712; cv=none; d=google.com; s=arc-20160816; b=ozlDCxiK3YxXUgkUCqpmO86t8WtR3y01gWsAQpUeNgkeWueeLlpno9AXLKOc/ECi5k XEt2m83+PJBj/Wc7Jfdi9wN2ZxSYhXK2lEXX6rU7WV9tmTsp+vl27l0k+qawiMpPDVx2 +c3cFBeX/ZYSEsV63X56bFX6ldNbpWgTuK0O5qFYPIwRg8dWGCGcgsEMpo8a5sjNth/1 xh/4aKahPUvq9pPLyyL/M/yhYR9rvjf0d4pTE9UTPOSfiJQYAtn4cpy2EgwcPcrSa5zT AQ85YyGZW2Bi1Ouuyp00Bz+ucn4h2R8F7l8Npr6JaCJUXT5WH5zF10Bhw/6YszL+48mR lQrA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=U2PsHC7X3x66l9gfkY76TiZXU6hEAghHJid1tmnnw6U=; b=nJKZOnhYNlT0UkVCiziKxpcSlu1ZCSuGnVvyh38CXHeMCt5Sdzs0emPvRp/ayEBUqy VYTLgL5mxgGhLn3+gcb8tUYVJHZdgkgMyIeAIPl7CYLVca7lOYezecTxu32OmlFZCN4p KT8uV6HS8ROHVjHFFrU1fXket4KdRmeFoDfYC401FPbAa1hMJK7IdrFQs/otVhAcgzlG 08kvv9dDSZkTQYBeak7KdErbm6qrxOZ5P0oiSMamA7p309oeI69vKpAZZw0pfSSFCOD0 wSrb3Ilc/wxDVriR5Yv4KTTFvpUTyFGbyonPtyts+qLjkfFEuUL/HlY89Tk4UFdZxobu nqyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=Q8MQfK9D; 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 o18si6533728otk.80.2020.03.22.09.31.39; Sun, 22 Mar 2020 09:31:52 -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=@rere.qmqm.pl header.s=1 header.b=Q8MQfK9D; 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 S1726765AbgCVQaS (ORCPT + 99 others); Sun, 22 Mar 2020 12:30:18 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:24702 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726538AbgCVQaS (ORCPT ); Sun, 22 Mar 2020 12:30:18 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 48ljfb12z3z2G; Sun, 22 Mar 2020 17:30:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1584894615; bh=WBVUeZvvAtzwJpBPNVmG/7qOTMhN+wXaL0m8YSl6fJw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Q8MQfK9DXHUg05IyeRUEfbADewHv7+54iqPT9tBwq3ZbUId3/+m2znh1CJkuEMCvQ ePMEE0MEXRLNbetINKdV97r/aTX9S5/rQcKqQodG8mhzCIv+/AXKp7dJXKJLp5goNG 2WwGMKioK4t9sahQA35xGEXSWPEjQD1NjLrq/Axi+GB1JiKv5PpTv02ad7k1O24jGF 9FlW1YC3l7vEfGzoa6sVjfX9LSjI2TXzj8RBL0ErWC7JmILGjipe/9iNUq7aMcHh30 zAbog5EXd4oJlaHdV2LvyVaMNuxQ2+10F2fbaB81h2zM91KWrOVt/EVvV638cICccZ B5gHf2kiPnJdQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.2 at mail Date: Sun, 22 Mar 2020 17:30:13 +0100 From: =?iso-8859-2?Q?Micha=B3_Miros=B3aw?= To: Wolfram Sang Cc: Ludovic Desroches , Nicolas Ferre , Alexandre Belloni , Dmitry Osipenko , Stefan Lengfeld , Marco Felsch , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] i2c: at91: support atomic write xfer Message-ID: <20200322163013.GA25488@qmqm.qmqm.pl> References: <55613934b7d14ae4122b648c20351b63b03a1385.1584851536.git.mirq-linux@rere.qmqm.pl> <20200322143004.GB1091@ninjato> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200322143004.GB1091@ninjato> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 22, 2020 at 03:30:04PM +0100, Wolfram Sang wrote: > > > + /* FIXME: only single write request supported to 7-bit addr */ > > Hmm, this is quite limited. Would it be very hard to support multiple > messages? Or reads? 10 bits don't matter. I don't expect this to be used for much more than a simple write to PMIC to kill the power. So this patch is tailor made for exactly this purpose. Though, if you would go for full support of atomic transfers, then I would suggest to hack the non-atomic path to be usable in atomic mode instead (some I2C drivers do just that, eg. i2c-tegra). BTW, I found this comment in i2c-core.h: * We only allow atomic transfers for very late communication, e.g. to send * the powerdown command to a PMIC. Atomic transfers are a corner case and not * for generic use! I think this covers the idea. > > + if (!dev->pdata->has_alt_cmd) > > + return -EOPNOTSUPP; > > We should handle this in probe(), I think: > > if (dev->pdata->has_alt_cmd) > at91_twi_algorithm.master_xfer_atomic = at91_twi_xfer_atomic; This would mean writable ops structure - something I try hard to avoid. We can use another copy of i2c_algorithm structure if needed, though. Best Regards Micha??Miros?aw