Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp364269imm; Fri, 31 Aug 2018 02:30:02 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZdBZXy4GKbapP9Wl+BzEMjfWYOwrBAcEmVUqTGQizb0oLPkJ35SQLmdJBOASXv1u3dZ88x X-Received: by 2002:a17:902:561:: with SMTP id 88-v6mr14369267plf.320.1535707802894; Fri, 31 Aug 2018 02:30:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535707802; cv=none; d=google.com; s=arc-20160816; b=nLpbhGcg8IDISgdhvRIgf7blzUGshm1vP85iZsCUL8oiZXjpxI1hHNbFkofv2pOMx8 w+k3KrV8+UmK+RkF9ekj9l/JaYd22ZzIYj4M5N8QqsEc/4i91QX8f4l3fzZY0uLyHSSE 9s5g7Hq/GsmKVKSt+m6rH+QVd9AqP0beVkvfunJUrobKGHymFXA+3c9ddxnWP7MvbhQD Guz6HkscE5SUL69UcNVgYT6/4bdK/wb8ovbFZh2qiRKbXs4sSlyhjJumXqPCqWN0Jal7 DyW3EewXEmp+5zDoLc2bEYx+cDF9JAD3ZtkqNm8dX+SqCkdqgz2qT/Nv3Ktqo7ECahq2 QFCg== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=SVplp+1KkZuSODDlsy6jRypuYU9Dig4A8X4CzDpXbSY=; b=oPdrc8NXZ7QabYWVvEjd9tjrP8L2pqylmCovow9GH7CApI2lfbTnjVSKOr9kdyN3gc CsbsQln5IHx2H/PcJjypK1tb3wyl7uvu5q6uGlSwGkODA4nGOMZZvZjMo3qcLXok/als xICF8nRV40KCIHyIMNIONpQ4smplo86BonP/Szq0V0BCDpsubqbppi77jJvVFuoFdEAr f5rHoXr7YJ3UhPgqMSYAxkdX9z11YfOspfMqGyVjJxl9OTh3j8L4KY93CdRcEAkvVP3S 16a3xg4Jc/AT/JcAD9ZMejy5Al+pamV2wQo92rkftjLk3uID9AQp//UX4vQdd4yCIYsD V3SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D1LphJ2A; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x5-v6si8720832plo.57.2018.08.31.02.29.48; Fri, 31 Aug 2018 02:30:02 -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=@linaro.org header.s=google header.b=D1LphJ2A; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727765AbeHaMpU (ORCPT + 99 others); Fri, 31 Aug 2018 08:45:20 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:43529 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727410AbeHaMpT (ORCPT ); Fri, 31 Aug 2018 08:45:19 -0400 Received: by mail-oi0-f68.google.com with SMTP id b15-v6so20324205oib.10 for ; Fri, 31 Aug 2018 01:38:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=SVplp+1KkZuSODDlsy6jRypuYU9Dig4A8X4CzDpXbSY=; b=D1LphJ2AUp92m+WLpv7eD/thKV2NBBsVv2YvJPxBsRxeThcffuLCxpiytECtfqZlVt kk9nHNOZ93UxODqD+NOnsXD8wnuT9frAXZQn6mc3lg+C78KZc+sWJeBNINFWupZHdved XS7NNTXxe5sVlgh3QuVKrG7aCA9z1VTDwnsCI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=SVplp+1KkZuSODDlsy6jRypuYU9Dig4A8X4CzDpXbSY=; b=uB70EVIn+jzrvzbNUdLtFAnB7C9wiPvC/Xz8NvVzZ+i5cWyi3Cogl2hvIlMBq/XTUB gOpDKaRY0LiKFMbAN3b36t/9FmmbcR4lxbf4lHjHd6fS+6/FvUPRPujWf8wjYKA8O3C2 pdXwAxlXOOcfd9TlOmaSJIpCvSwTymzFm47peRkc4vCLutb72m+BwgZMjQUFD7jau+eU U7UShifAilWCVlTuqkq/SwwMbVAnzjP+aJHXe7zV60umOJwoR0gv6OUSi3+9iS3wtiYT vKexFcvfLqaLxKjgLZ4wPrK7dglCpqDcgq/INQXRSnQW1Fs55cQVAldKyB97jtrzWizg hP9A== X-Gm-Message-State: APzg51DmHwCTxEu6cz/zFnI5EAaHKxQpGzJpdxQOSz5Ufwz/kyxGcKVJ 5Od1tHDWWcVnb2JR15Dk/bHDcA+E55MzTnFnW9eLlQ== X-Received: by 2002:aca:ef87:: with SMTP id n129-v6mr6629318oih.161.1535704736691; Fri, 31 Aug 2018 01:38:56 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:54a:0:0:0:0:0 with HTTP; Fri, 31 Aug 2018 01:38:56 -0700 (PDT) In-Reply-To: <01c9b188-5b67-40c0-b08d-99a0543ddf54@cesnet.cz> References: <01c9b188-5b67-40c0-b08d-99a0543ddf54@cesnet.cz> From: Baolin Wang Date: Fri, 31 Aug 2018 16:38:56 +0800 Message-ID: Subject: Re: [PATCH v2 1/3] spi: Introduce one new field to set word delay To: =?UTF-8?B?SmFuIEt1bmRyw6F0?= Cc: Mark Brown , linux-spi@vger.kernel.org, Rob Herring , Mark Rutland , Orson Zhai , Chunyan Zhang , Lanqing Liu , DTML , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29 August 2018 at 19:33, Jan Kundr=C3=A1t wrote: > On =C4=8Dtvrtek 16. srpna 2018 14:54:49 CEST, Baolin Wang wrote: >> >> + * @word_delay: clock cycles to inter word delay after each word size >> + * (set by bits_per_word) transmission. > > > I need a similar functionality for talking to a SPI device from userspace > -- see my attempt for implementing this in spi-orion.c at [1]. The device= 's > datasheet says that I should wait, e.g., 3=C2=B5s between each two words.= I > therefore like this patch :). > > The description can be improved because it left me wondering what "clock > this is about. I suppose it's about the SPI clock cycles and not CPU cloc= k > cycles, right? I'll be hapy to patch this once Baolin confirms that that = is > the intended meaning. Sorry for confusing. Since our SPI word delay unit is clock cycle of the SPI clock, so my intention of the word_delay's unit is SPI clock cycles according to our previous discussion. > > It seems that this is only implemented in one newly added driver. I'm > interested in supporting this in spi-orion.c, but that sounds like > driver-specific work for something which is pretty generic. How should th= is > be implemented? Given that drivers for SPI masters can implement a functi= on > which transfers several words at once, there are not that many better > possibilities than adding udelay()s, though. Thoughts? > > What is your plan to do with drivers which do not implement this (yet)? I= f a > spi_transfer gets queued which asks for a word_delay delay, it is silentl= y > ignored now, AFAIU. > > What about userspace support, spidev and spi_ioc_transfer (that's my targ= et, > actually)? Is it OK to s/pad/word_delay/ in the spidev code and pass that= to > the generated struct spi_transfer? In my opinion, once we support specify= ing > this from userspace, one has to definitely check that the SPI controller = is > ready to honor this request. Do we want a new bit in spi_controller.flags > for this? > > With kind regards, > Jan > > [1] https://patchwork.kernel.org/patch/10221397/ --=20 Baolin Wang Best Regards