[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <01010174689ebbd5-8447b255-ce45-49e0-a6ef-ee35e183953d-000000@us-west-2.amazonses.com>
Date: Mon, 7 Sep 2020 12:51:07 +0000
From: rojay@...eaurora.org
To: Akash Asthana <akashast@...eaurora.org>
Cc: wsa@...nel.org, swboyd@...omium.org, dianders@...omium.org,
saiprakash.ranjan@...eaurora.org, gregkh@...uxfoundation.org,
mka@...omium.org, msavaliy@....qualcomm.com, skakit@...eaurora.org,
rnayak@...eaurora.org, agross@...nel.org,
bjorn.andersson@...aro.org, linux-arm-msm@...r.kernel.org,
linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
sumit.semwal@...aro.org, linux-media@...r.kernel.org,
dri-devel@...ts.freedesktop.org, linaro-mm-sig@...ts.linaro.org
Subject: Re: [PATCH V2 1/2] i2c: i2c-qcom-geni: Store DMA mapping data in
geni_i2c_dev struct
On 2020-08-26 17:25, Akash Asthana wrote:
> 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 <rojay@...eaurora.org>
>> ---
>> 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
>
Okay
>> 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);
>> }
Powered by blists - more mailing lists