Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp163508pxa; Wed, 26 Aug 2020 07:29:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzW84V2+RelVK3PyvbsasEUPOlBbmUSDADXuGjB5IGD8rSicCns5gWUnK2RFsTeOcSeyJul X-Received: by 2002:a50:de04:: with SMTP id z4mr15516461edk.10.1598452153918; Wed, 26 Aug 2020 07:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598452153; cv=none; d=google.com; s=arc-20160816; b=ayK5/nXUh9n30bNS89anLM92nJHmNumuP0wv5NbNHjuN35D1GsTCf5iyQkxUY6G2// Rgl5O7c1Xfrb/wgtJP+quOuz8/s/JePbJEXH7XcwqTCK6K3GCHncDf/3qTn0Wo0+zS31 DEB9vuKTsMR+7zBiMVMzeZ3Lq/UXMuEnlHzJ3ZZ3Pi6TK68yyRlEZgVoMpHwCCQ3Yaxr RAH1+Ls/oux5MH6b/HO5KtQR1nX4fir4z8FkzxUUSutoYZv/u74DwxCs2DgekoWRU+bu psVTXUTrE08iN+6ncEBQoUXR9kTo74f1TwmRfocwMjtpQbxGgpRenV3VJ7afklA/Frxb yn9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature; bh=Bwhuv2Mg8XX7hTVE0N5W+Eqr1RkfhHeyhdfuGEzNN3U=; b=s6wkw1mk9FnM8/nFGJBWWBMQLSWf9iXAIWYFwLOQcLzEor4ExY11UCtsRxUG3AEdEh vh5nGqEZxkDYCVYS7+0qZnZBZcjiapbl8Go6I0SgW5lICpCHDZQOx+8m6tN9K04I3XNt WFwFSjqu5E8GGkt+JG+NacGe+hex++oi7SmxYWx/HmPaWXlpQKegnygva+gOnFgTz56Z hrw8cRItyQKjqDB0sDCUXu91OhT6lcj5qp9HLgQvMjl9OKa1TNVmRfgBxAG39hdROdu+ DiNL1BmguON8euC7G2uIrWTgEdY7PeRk1SWKWCyVYKHMRIkD1LFU0KRebVOgJAh7yr+h e0WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=hp7PAqBu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v17si1534556ejd.324.2020.08.26.07.28.50; Wed, 26 Aug 2020 07:29:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=hp7PAqBu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729198AbgHZL4b (ORCPT + 99 others); Wed, 26 Aug 2020 07:56:31 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:18984 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729277AbgHZL4R (ORCPT ); Wed, 26 Aug 2020 07:56:17 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1598442969; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=Bwhuv2Mg8XX7hTVE0N5W+Eqr1RkfhHeyhdfuGEzNN3U=; b=hp7PAqBuXpVH8xRG0qqiaqSIUxeaGOGCS04Ub0tmGJCXh92YcqiKWtXB/X1oh/gnmgF+pgO9 swtISU+kwR4La7LpoJdnYWXFUR0o4zmcRM7mGZUpPZn/aleq45xOK65e0F5PYxvqSGEfHlI3 KR4EoYBnaHCfx2tZMLKNf0nlLOU= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-east-1.postgun.com with SMTP id 5f464dd8222038607afe1398 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 26 Aug 2020 11:56:08 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 9F1B3C433B2; Wed, 26 Aug 2020 11:56:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=2.0 tests=ALL_TRUSTED,NICE_REPLY_A, SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from [192.168.1.100] (unknown [47.8.163.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: akashast) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4DC6EC433C6; Wed, 26 Aug 2020 11:55:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4DC6EC433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=akashast@codeaurora.org Subject: Re: [PATCH V2 1/2] i2c: i2c-qcom-geni: Store DMA mapping data in geni_i2c_dev struct To: Roja Rani Yarubandi , wsa@kernel.org Cc: swboyd@chromium.org, dianders@chromium.org, saiprakash.ranjan@codeaurora.org, gregkh@linuxfoundation.org, mka@chromium.org, msavaliy@qti.qualcomm.com, skakit@codeaurora.org, rnayak@codeaurora.org, agross@kernel.org, bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, sumit.semwal@linaro.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org References: <20200820103522.26242-1-rojay@codeaurora.org> <20200820103522.26242-2-rojay@codeaurora.org> From: Akash Asthana Message-ID: Date: Wed, 26 Aug 2020 17:25:52 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200820103522.26242-2-rojay@codeaurora.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Roja, On 8/20/2020 4:05 PM, Roja Rani Yarubandi wrote: > Store DMA mapping data in geni_i2c_dev struct to enhance DMA mapping > data scope. For example during shutdown callback to unmap DMA mapping, > this stored DMA mapping data can be used to call geni_se_tx_dma_unprep > and geni_se_rx_dma_unprep functions. > > Signed-off-by: Roja Rani Yarubandi > --- > Changes in V2: > - As per Stephen's comments, changed commit text, fixed minor nitpicks. > > drivers/i2c/busses/i2c-qcom-geni.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c > index 7f130829bf01..1fda5c7c2cfc 100644 > --- a/drivers/i2c/busses/i2c-qcom-geni.c > +++ b/drivers/i2c/busses/i2c-qcom-geni.c > @@ -86,6 +86,9 @@ struct geni_i2c_dev { > u32 clk_freq_out; > const struct geni_i2c_clk_fld *clk_fld; > int suspended; > + dma_addr_t tx_dma; > + dma_addr_t rx_dma; > + size_t xfer_len; > }; > > struct geni_i2c_err_log { > @@ -358,6 +361,7 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, > struct geni_se *se = &gi2c->se; > size_t len = msg->len; > > + gi2c->xfer_len = msg->len; nit: gi2c->xfer = len, for tx_one_msg as well. Regards, Akash > if (!of_machine_is_compatible("lenovo,yoga-c630")) > dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); > > @@ -384,6 +388,7 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, > if (dma_buf) { > if (gi2c->err) > geni_i2c_rx_fsm_rst(gi2c); > + gi2c->rx_dma = rx_dma; > geni_se_rx_dma_unprep(se, rx_dma, len); > i2c_put_dma_safe_msg_buf(dma_buf, msg, !gi2c->err); > } > @@ -400,6 +405,7 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, > struct geni_se *se = &gi2c->se; > size_t len = msg->len; > > + gi2c->xfer_len = msg->len; > if (!of_machine_is_compatible("lenovo,yoga-c630")) > dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); > > @@ -429,6 +435,7 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, > if (dma_buf) { > if (gi2c->err) > geni_i2c_tx_fsm_rst(gi2c); > + gi2c->tx_dma = tx_dma; > geni_se_tx_dma_unprep(se, tx_dma, len); > i2c_put_dma_safe_msg_buf(dma_buf, msg, !gi2c->err); > } -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project