Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp93110imu; Thu, 24 Jan 2019 21:57:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN4txjMHuDAmXpXsMqZcaUr+LmvqAPnwD9N5mOm74ZhCcRP+KHmCdbROVKhtFhbr9Nm0Z5wb X-Received: by 2002:a62:68c5:: with SMTP id d188mr9923299pfc.194.1548395847148; Thu, 24 Jan 2019 21:57:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548395847; cv=none; d=google.com; s=arc-20160816; b=Nfy9W/9R/3g2YUT2sqIeTGrsQQQWrukB5RRQiyAl8+Ud88rbYjoBbDRaB0DqvVzpph QsmFwX3xPlB781pqu5kns2P9xtZnqd4EANLsllDWbbLdyDmEzqYzjUuU+dfiPGzGaLb5 DZBik7bPecdaJ7AZmzm2PsM8E9NM1JLaf16MVk7ogNeJEFD1/s3N95Kcmv92vKCgmY7F c1mtl2SchYg0nCdVqgjQSNHQ9t32dIc8SL4+r3SFdX8MJFQSLosiIMlc1unkZsLATGsP xMUMVKmZ4+rHoBpexQcaKtW7KP28Md3g3Z1yIx4CdBGo8CkdkB9C3p7Zw9pigCJ5fMCd qngQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=oIq5VzwbevlyF+FQ7R0JLZtfms9gCxDV+ruYNPlLjHw=; b=ttf8RjqNdLitzr9tuMH/BxAXHOWrVYEfvgENKQUk0abvUAzz0sb4m3ozjMn9DZJKRJ G4ZYKo/sMi6vd+IaF47pH0VM5LLDWYjutXte4QfanL5b7ZLGUmLcVL9IjBT1GMg+q97R dmW/Tn+4VWEtrTYE9jAVauCZ2L13aQ5Q8e3OMjFMw6HfAuJ9yWQITgLd9LLXQ9LDD31a Wemvz6vPyDepGSw2aj2MYsj5LCsIBPkKjtRTzmrznfHwPrdCxhqrsHdjdDnmQqtTsmiZ ZOewz7JtbPp8Zeqyl4rZuqkC9ECGsLw8WCH5T1B6NHvdl6530HhyvEYxG7tFjbrwM1+a N8UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vGfx4zWd; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si9337208pgk.201.2019.01.24.21.57.08; Thu, 24 Jan 2019 21:57:27 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vGfx4zWd; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726638AbfAYF5D (ORCPT + 99 others); Fri, 25 Jan 2019 00:57:03 -0500 Received: from mail-yw1-f67.google.com ([209.85.161.67]:43797 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726097AbfAYF5D (ORCPT ); Fri, 25 Jan 2019 00:57:03 -0500 Received: by mail-yw1-f67.google.com with SMTP id n21so3458833ywd.10; Thu, 24 Jan 2019 21:57:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oIq5VzwbevlyF+FQ7R0JLZtfms9gCxDV+ruYNPlLjHw=; b=vGfx4zWdd8JZhq/FjnbKasft/97BhsFUkAUT7F+lzWu2V9yf1mxvqXSoVmymS9ySwN d5nOZTuSTB2ic6CuLJs1G7O4fphspSFIR6A7TmQb9HejyGHwgfl6tMGCfJMoeGZi+9iS N11Wtdq8VQ2dKnhePfHzRIW2eflPxI3dWCX+BPxD21U+Ker754ZeXbivrcYegul+TKu4 oAKQ+Jym1Bd0F1JQkeHT3MMnvtJ5ZFrP30rXw1pw55wKafLVkM9bCDBvAe41p5nvS9ga 6yOMdQYaDVFovCS9XNxIGb4N8agNe8PatQfre7JbC2QglffJ0KzkDkxrUjMSH9qKT739 x1Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oIq5VzwbevlyF+FQ7R0JLZtfms9gCxDV+ruYNPlLjHw=; b=OL7qJZpdotuEnLFA/jp0+m/U/zwaz7pfyiCJNS3/N5DdDbWF12KFZo4uMGzA2BgtF5 Gze317kfVfvEOoXK+eKGRzzJN62CjIed4GPe+dY46Hai2jIJ/iaCxcMeo+o4z0ob7/UM XibW0H91rOmZego1iR66QhRXRos47vpFQOdCYHrUkRoywyOEqpvOl51nFF9N+nScQNtK 80PJrBl6dGFJazaoeziLgqHQKl3KHoZNoN9tskIhmtOkF1IYwxXCw18r9CqdwvIP/qeZ 8mdBH8B68XU/R9ibA4gFE7AgU/DCsjHAJDMS4yTzwk/3Ce7Cz7w+jAPEWdYVUilMrroi 4VIA== X-Gm-Message-State: AJcUukeWP5smaRvf0hMo3m5YC1SXREaMphZVsujAFWWLI5PUdoFVc0ym WUZXFmEoYJYbXc89ZlEthLbV2/Y5C0biMBaY1U4= X-Received: by 2002:a81:4411:: with SMTP id r17mr9442063ywa.16.1548395821488; Thu, 24 Jan 2019 21:57:01 -0800 (PST) MIME-Version: 1.0 References: <1548381414-20561-1-git-send-email-justinpopo6@gmail.com> In-Reply-To: From: Justin Chen Date: Thu, 24 Jan 2019 21:56:50 -0800 Message-ID: Subject: Re: [PATCH] iio: adc: ti-ads7950: inconsistency with spi msg To: Florian Fainelli Cc: linux-iio@vger.kernel.org, jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Florian On Thu, Jan 24, 2019 at 8:30 PM Florian Fainelli wrote: > > > Hi Justin, > > On 1/24/19 5:56 PM, justinpopo6@gmail.com wrote: > > From: Justin Chen > > > > To read a channel we require 3 cycles to send, process, and receive > > the data. The transfer buffer for the third transaction is left blank. > > This leaves it up to the SPI driver to decide what to do. > > > > In one particular case, if the tx buffer is not set the spi driver > > sets it to 0xff. This puts the ADC in a alarm programming state, > > therefore the following read to a channel becomes erroneous. > > > > Instead of leaving us to the mercy of the SPI driver, we send the > > ADC cmd on the third transaction to prevent inconsistent behavior. > > Do you think this warrants a Fixes: tag? > This was an issue when the driver was introduced. Should I tag that commit the introduced the driver? > > > > Signed-off-by: Justin Chen > > --- > > drivers/iio/adc/ti-ads7950.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/iio/adc/ti-ads7950.c b/drivers/iio/adc/ti-ads7950.c > > index 0ad6359..5453e10 100644 > > --- a/drivers/iio/adc/ti-ads7950.c > > +++ b/drivers/iio/adc/ti-ads7950.c > > @@ -422,6 +422,7 @@ static int ti_ads7950_probe(struct spi_device *spi) > > st->scan_single_xfer[1].tx_buf = &st->single_tx; > > st->scan_single_xfer[1].len = 2; > > st->scan_single_xfer[1].cs_change = 1; > > + st->scan_single_xfer[2].rx_buf = &st->single_tx; > > Should this be st->scan_single_xfer[2].tx_buf? > Oh yes. Good catch. Careless mistake! v2 incoming. > > st->scan_single_xfer[2].rx_buf = &st->single_rx; > > st->scan_single_xfer[2].len = 2; > > > > > > -- > Florian