Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1156981ybe; Wed, 4 Sep 2019 13:37:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxra58jzPplS9KK0xVhbBH21hh7/WFjMovW8t0Oxbd5Hz1I/VBnkpWG84M/DLqCzbQvbLQG X-Received: by 2002:a17:90a:a486:: with SMTP id z6mr123418pjp.13.1567629437095; Wed, 04 Sep 2019 13:37:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567629437; cv=none; d=google.com; s=arc-20160816; b=Tqf3VuQ2IuAPotSolQtyQiJ57X6epvT0hCGqxmofb4FrQRSbvRZmeksUXQ3cn0LH5t 9ssz/DXURa51eFxW4s0jynn3ZsVUeHOL9bb9xvZIa1n0ZpXf2jMFUxT1sQwdN5sRVViY PeBTnp2iLMbMNVymHWhPMXB90bw9sM3h1K1sTajcXkw7fDtjlylTLDLE2LJ/UbQXlEW2 SJyoE1DG9Ae5KfwmUF7Kt8yDxC73gCyOZ09nDUGhq+kFM7xcwBHKtQm+uwtxvmucuWDL QlB+Js0YrD9livrnf8sKCNuArupEzGepHU7SJy2xwWW9XN6j/GnuvPDcrHjXpESWIOlm SkuA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Y9dPfxiGVl9B5eQCHDgsbYOLG2ykYyi/7SM+jtLAnog=; b=DMsSscj89HYQYGbzAZqLjZUqazbWLfkIXUEFy4/0AdF60IXGS9U43bf3bL2yfSRJlR GreXKL9pmGmzPdPyJfdG9ZHNdnk0xt10JJs3NILtC5v47794PGyZOeC22wv9ntdseYnt 927sri8UExUH5SsYU3unBwKTfEeDFuuMxk0F6e0ckDN5jR1HNvxFFBoblnRXOzes8DMA EPNgpxHCHhxaT/De5OfR0Vo6/EXSuYpkDPQqs3HvhwUbVHajMr+hezjn90mM4en+tQKm i5TVOynZ7qAOKsY0N2m6BveChCc9Nr93HJKgfN8nfPOf0F4fjLPhIonN8slY+yITI7ff F05g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="IoH/Dtjs"; 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 o29si18126544pgm.380.2019.09.04.13.36.45; Wed, 04 Sep 2019 13:37: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=@linaro.org header.s=google header.b="IoH/Dtjs"; 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 S1730135AbfIDUfx (ORCPT + 99 others); Wed, 4 Sep 2019 16:35:53 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:41535 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729316AbfIDUfw (ORCPT ); Wed, 4 Sep 2019 16:35:52 -0400 Received: by mail-pf1-f193.google.com with SMTP id b13so13394pfo.8 for ; Wed, 04 Sep 2019 13:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Y9dPfxiGVl9B5eQCHDgsbYOLG2ykYyi/7SM+jtLAnog=; b=IoH/DtjsZSHeuM5ZH1ZL9Fy+rFnrY2sGhJTxYoxekXhLlmUNBAwbZWtGkaZWeLkrWB p/OHUOdc3ZVgXUSWEXgPCdOxzHj6ou+8a/ZlebDKFUrcBI8Zk36WiZ7RUbG2Hn1T5Xy6 q4NVyGK9q203NBKeABXcjGCfEhXMgChZweccIQ+Inc7zwHL8h+V9H4Eoo0tWROMxKNck zeuF2Fq/ec/RE8H+zHbNtYl55DYiCg2BVdGE41d25DtwtA1Bl1qs11JMSGCNhXZoNW7G GszHlkzz1S81UpO64iP8lHJFTqcYhkcuFgvYXx6J8GUw8BLi/FgP2ITaAvZ2KhBllLib M6nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Y9dPfxiGVl9B5eQCHDgsbYOLG2ykYyi/7SM+jtLAnog=; b=Eb2KMwgKOTINqPZphCrJOpT7ID/KnIryt5/ZF5LXIk2+OtwUWyZyTkWM6DPlqlnGKX bzK5QcSJ1P8HwZuksMqc/RILfdftIeUUBm2iRRSTPi/5WzmDuFlkf2v2d/mNjbWGz57Q fsyZk+wJ93ID1fZwkm4u4qJ8d5V1LUgMqBwDyd0ypR8QR0+TxYkgVSKsD88Ik7eBgfK2 I1sXGUev+0yPlW941tHoIXvnovOPKvSDtJT9WxgpCn5HIlimzVDsF4evf4uZjbUcfSk8 QNPwkk8bDIr3Cxt4FrxcPd2Dgqf1Oxgx16WqL86VCpjqT5HkqtzTBHzaq+V2EH8EKOit Ei2Q== X-Gm-Message-State: APjAAAXN0dXYlUvmmfU6Yec6orgVqGPCRFiXKgdEUm0GxWPQxEpb9WAg 0yK3egnRfNVePK0M3ETFUmto4Q== X-Received: by 2002:a63:6a81:: with SMTP id f123mr38808pgc.348.1567629351901; Wed, 04 Sep 2019 13:35:51 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id h70sm14724pgc.36.2019.09.04.13.35.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 13:35:51 -0700 (PDT) Date: Wed, 4 Sep 2019 13:35:48 -0700 From: Bjorn Andersson To: Lee Jones Cc: alokc@codeaurora.org, agross@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] i2c: qcom-geni: Provide an option to select FIFO processing Message-ID: <20190904203548.GC580@tuxbook-pro> References: <20190904113613.14997-1-lee.jones@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190904113613.14997-1-lee.jones@linaro.org> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 04 Sep 04:36 PDT 2019, Lee Jones wrote: The subject implies that we select FIFO mode instead of DMA, but that's not really true, because with DMA enabled we still fall back to FIFO for messages below 32 bytes. So what this does it to disable DMA, which neither the subject or the DT property describes. Also missing is a description of why this is needed. Regards, Bjorn > Signed-off-by: Lee Jones > --- > drivers/i2c/busses/i2c-qcom-geni.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c > index a89bfce5388e..dfdbce067827 100644 > --- a/drivers/i2c/busses/i2c-qcom-geni.c > +++ b/drivers/i2c/busses/i2c-qcom-geni.c > @@ -353,13 +353,16 @@ static void geni_i2c_tx_fsm_rst(struct geni_i2c_dev *gi2c) > static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, > u32 m_param) > { > + struct device_node *np = gi2c->se.dev->of_node; > dma_addr_t rx_dma; > unsigned long time_left; > - void *dma_buf; > + void *dma_buf = NULL; > struct geni_se *se = &gi2c->se; > size_t len = msg->len; > > - dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); > + if (!of_property_read_bool(np, "qcom,geni-se-fifo")) > + dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); > + > if (dma_buf) > geni_se_select_mode(se, GENI_SE_DMA); > else > @@ -392,13 +395,16 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, > static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, > u32 m_param) > { > + struct device_node *np = gi2c->se.dev->of_node; > dma_addr_t tx_dma; > unsigned long time_left; > - void *dma_buf; > + void *dma_buf = NULL; > struct geni_se *se = &gi2c->se; > size_t len = msg->len; > > - dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); > + if (!of_property_read_bool(np, "qcom,geni-se-fifo")) > + dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); > + > if (dma_buf) > geni_se_select_mode(se, GENI_SE_DMA); > else > -- > 2.17.1 >