Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp465061imm; Wed, 29 Aug 2018 04:35:17 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdaef+NkiRVXVadkocOEY/RPBp6NBCN9yUVd+lJbT8L1H/wa9113KiEPmrp45WBWElD6UQZH X-Received: by 2002:a65:608b:: with SMTP id t11-v6mr5460273pgu.259.1535542517262; Wed, 29 Aug 2018 04:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535542517; cv=none; d=google.com; s=arc-20160816; b=jaXhxvGObPchObLKduOklQkmBbtwEQ5j5mguadm1FhIU8rBnHvi33HTN0tIVCXcosG dE8PurbYeopkiXJDyuNBEl1lPXzgI+6T1sGay0SLnKQSEdUMjuIZS5wYO07PFCcgcPBn uGsM8IeLMd8JpVluEtEUzgzDXXmXVVg6DDemEn5F5EhA1uZAhZKDo79OawP6vkXM8+SK 9Fk/5UYO72YIoQAo75Xq2GXUJj0J0JIEJIaHmOt3ug3drTdAi5h7fqw1oMIawu98SGEG VxRm1h7G6l/MsGqj6WfIg8dXmwUFiLsg/X8T8Fqe/G5kOJqdj9O7r4IWgeA8IW6vPmBZ mh3w== 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:user-agent :organization:references:in-reply-to:message-id:mime-version:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=JmDLKNyTmbXKcmKClmkMFZdZmKvHhYRGgfeN/Po7ltk=; b=lfWOpujStm+SDtLImEwNXxis13ypLvgbUK6f99V0mIMPzuPm53j8MmVhRzC1umJdbJ 21t3SltApq8PkiDHcp8bgwNa3AwCqO4woIDYE3oEMfTbL+XhPjVyGJkKCR+UJDDe5lXK Ne2k1xmAJoSL0Tw60dnDMAxdxKJZFx6RgDx7PhN5mdYi0MsQdIzp9uvzby8fM5ayx+1o Ilhm8VcAqNL0M6qXVD2LwT9twG0eFfXBPZhW7V/204egDauJ8YCVjrRA5S/LO9SeE8ba GB9TnMCBLU1tOVxrgqBqJMFhUneiCLDgy7F8QHH6AV3YI/3eZB1NYFSUYpbExBWft6w/ omJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cesnet.cz header.s=office2 header.b=A9wflGtW; 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=cesnet.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r14-v6si3447205pfa.44.2018.08.29.04.35.02; Wed, 29 Aug 2018 04:35:17 -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=@cesnet.cz header.s=office2 header.b=A9wflGtW; 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=cesnet.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728398AbeH2P34 (ORCPT + 99 others); Wed, 29 Aug 2018 11:29:56 -0400 Received: from office2.cesnet.cz ([195.113.144.244]:34652 "EHLO office2.cesnet.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727264AbeH2P34 (ORCPT ); Wed, 29 Aug 2018 11:29:56 -0400 Received: from localhost (ip-89-102-27-77.net.upcbroadband.cz [89.102.27.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by office2.cesnet.cz (Postfix) with ESMTPSA id 735A2400063; Wed, 29 Aug 2018 13:33:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesnet.cz; s=office2; t=1535542405; bh=JmDLKNyTmbXKcmKClmkMFZdZmKvHhYRGgfeN/Po7ltk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=A9wflGtW8J0St83JJ0l18hAiadcWqKNVxdd9C+e5tjhVw7zGSPWFD4C9iLsoAFdze +w/kz6PSiwvU0UGdxDdB0/Xdzva3y3XYwALJlD9jmVO076i4iiKV/zVT+WAw1eHVvi PVKiCOAT9D+IUp5Dddwps3n9Xn5QzJpgIx3IEThg= From: =?iso-8859-1?Q?Jan_Kundr=E1t?= To: Baolin Wang , , Cc: , , , , , , Subject: Re: [PATCH v2 1/3] spi: Introduce one new field to set word delay Date: Wed, 29 Aug 2018 13:33:24 +0200 MIME-Version: 1.0 Message-ID: <01c9b188-5b67-40c0-b08d-99a0543ddf54@cesnet.cz> In-Reply-To: References: Organization: CESNET User-Agent: Trojita/v0.7-361-gfee56b6f-dirty; Qt/5.11.0; xcb; Linux; Gentoo Base System release 2.4.1 Content-Type: text/plain; charset=utf-8; format=flowed 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 =C4=8Dtvrtek 16. srpna 2018 14:54:49 CEST, Baolin Wang wrote: > + * @word_delay: clock cycles to inter word delay after each word size > + *=09(set by bits_per_word) transmission. I need a similar functionality for talking to a SPI device from userspace =20= -- see my attempt for implementing this in spi-orion.c at [1]. The device's=20= datasheet says that I should wait, e.g., 3=C2=B5s between each two words. I=20= therefore like this patch :). The description can be improved because it left me wondering what "clock=20 this is about. I suppose it's about the SPI clock cycles and not CPU clock=20= cycles, right? I'll be hapy to patch this once Baolin confirms that that is=20= the intended meaning. It seems that this is only implemented in one newly added driver. I'm=20 interested in supporting this in spi-orion.c, but that sounds like=20 driver-specific work for something which is pretty generic. How should this=20= be implemented? Given that drivers for SPI masters can implement a function=20= which transfers several words at once, there are not that many better=20 possibilities than adding udelay()s, though. Thoughts? What is your plan to do with drivers which do not implement this (yet)? If=20= a spi_transfer gets queued which asks for a word_delay delay, it is=20 silently ignored now, AFAIU. What about userspace support, spidev and spi_ioc_transfer (that's my=20 target, actually)? Is it OK to s/pad/word_delay/ in the spidev code and=20 pass that to the generated struct spi_transfer? In my opinion, once we=20 support specifying this from userspace, one has to definitely check that=20 the SPI controller is ready to honor this request. Do we want a new bit in=20= spi_controller.flags for this? With kind regards, Jan [1] https://patchwork.kernel.org/patch/10221397/