Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1591936imm; Thu, 14 Jun 2018 00:08:48 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK+CjVLbJKyeit2I4E1iF3NGwyVRGG0A+R4irEH56ezprl3kMSsQW0WkxMs9WYYKfoUSAYN X-Received: by 2002:a17:902:6b04:: with SMTP id o4-v6mr1681169plk.101.1528960127976; Thu, 14 Jun 2018 00:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528960127; cv=none; d=google.com; s=arc-20160816; b=RpRnpYn59EFMd5MMhBsc6jMRutB6rhGjdcaYAYTVtdOEHx/E6vM2Ad/zr33pmO0rcC gyk2BEhOXyoJT3Hp3wwNTFHn+V908ye9xGhfUbzstJ84TjvDxByNuOSq/1VYR8eyKSpz JDyL4uPpR50LFxBqAh5oxAXrQwY0fWKRJycAJgBmY1yThonJATLGdXoeSkoL5zFLihne sOcY0L6VbxXYgRNTky7HiNBkuDuIVsUX2EKWJhT4vnvCMQEz6lxrHkjLgvYOX3g5ZkXA ukBgMbCR4A2Kd/o0JqR/GGEo21etdWN6hBxgOi71RnoAvlsxbPbjsiuWl+6+DkxEyDQB vM8Q== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=8EySKO8VXiT3l56VYmuCETn5jBEMZuMM3nCP+JpdxG0=; b=CY1vx2fKjurdNokbEVMFoxdDKUibhx3Ts6XMMdajAUQz27mv0xsx3BaWHzHUtemcbg z19DkgNjE6PCcX4mlEE6H6tlAWZDpk5h2StnzKWBj921CLmcl7Ig9Y/UcH0YqEWtilEw u88tOhWPk9iw8Jg30PZEabhBZF+eAbjzczMXCr3JcBpCZARxJkhTqXCT74/6Jls8ivEn Zx6p1SsMSCqAwkrptbbTTZPbfF3vSPx5GJpTT9gPmzLGhjQSVBWCiuVMfw/x3a3aa5IT 2zH0wPsra/xD89dMHJrfL82K/ZzehyJxoShutkm0JnsXamEaXvtjd46avN50phet7qlt Jr5A== 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 o184-v6si3922030pga.92.2018.06.14.00.08.33; Thu, 14 Jun 2018 00:08:47 -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; 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 S1754691AbeFNHIE (ORCPT + 99 others); Thu, 14 Jun 2018 03:08:04 -0400 Received: from mail.bootlin.com ([62.4.15.54]:40367 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754589AbeFNHIC (ORCPT ); Thu, 14 Jun 2018 03:08:02 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 13FE720734; Thu, 14 Jun 2018 09:08:00 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (AAubervilliers-681-1-37-30.w90-88.abo.wanadoo.fr [90.88.156.30]) by mail.bootlin.com (Postfix) with ESMTPSA id 6A6A420650; Thu, 14 Jun 2018 09:07:59 +0200 (CEST) Date: Thu, 14 Jun 2018 09:07:58 +0200 From: Boris Brezillon To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org, Greg Kroah-Hartman , Arnd Bergmann , Przemyslaw Sroka , Arkadiusz Golec , Alan Douglas , Bartosz Folta , Damian Kos , Alicja Jurasik-Urbaniak , Cyprian Wronka , Suresh Punnoose , Rafal Ciepiela , Thomas Petazzoni , Nishanth Menon , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Vitor Soares , Geert Uytterhoeven , Linus Walleij , Xiang Lin , linux-gpio@vger.kernel.org Subject: Re: [PATCH v4 01/10] i3c: Add core I3C infrastructure Message-ID: <20180614090758.17180594@bbrezillon> In-Reply-To: <20180614041941.4i2cadzoevujmzha@ninjato> References: <20180330074751.25987-1-boris.brezillon@bootlin.com> <20180330074751.25987-2-boris.brezillon@bootlin.com> <20180614041941.4i2cadzoevujmzha@ninjato> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 14 Jun 2018 13:19:42 +0900 Wolfram Sang wrote: > Hi Boris, > > > +/** > > + * struct i3c_priv_xfer - I3C SDR private transfer > > + * @rnw: encodes the transfer direction. true for a read, false for a write > > + * @len: transfer length in bytes of the transfer > > + * @data: input/output buffer > > + */ > > +struct i3c_priv_xfer { > > + bool rnw; > > + u16 len; > > + union { > > + void *in; > > + const void *out; > > + } data; > > So, this is probably where most payloads end up? > > I didn't notice any sign of DMA in these patches, but given my > experiences, DMA will come sooner or later. And in I2C, this was > problematic because then a lot of drivers were in the wild getting their > buffers from everywhere (stack!). We now have an opt-in approach to mark > buffers as DMA-safe. > > I don't know if typical I3C transfers will be similar to I2C with > usually small payloads where DMA usually makes not much sense. Yet, I > think, that it might be a good idea to think about how this shall be > handled with I3C right away. Maybe simply enforcing buffers to be > DMA-safe. Or whatever. > > A clear rule on that might save you hazzle later. I completely agree. I'll clarify that and for people to pass DMA-able buffers to this struct (just as the SPI framework does). Note that we don't really have a way to ensure that the buffer is actually DMA-safe from the core, because this notion is architecture/SoC dependent. > > Regards, > > Wolfram >