From: kernel test robot <yujie.liu@intel.com>
To: Vinod Koul <vkoul@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Wolfram Sang <wsa-dev@sang-engineering.com>
Cc: <llvm@lists.linux.dev>, <kbuild-all@lists.01.org>,
<linux-arm-msm@vger.kernel.org>, Vinod Koul <vkoul@kernel.org>,
Andy Gross <agross@kernel.org>,
Sumit Semwal <sumit.semwal@linaro.org>,
Douglas Anderson <dianders@chromium.org>,
Matthias Kaehlcke <mka@chromium.org>, <linux-i2c@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] i2c: qcom-geni: Add support for GPI DMA
Date: Sun, 31 Oct 2021 22:05:39 +0800 [thread overview]
Message-ID: <2df2406f-408b-1340-3f91-f545707a3278@intel.com> (raw)
In-Reply-To: <202110292307.Kb4i0Jf1-lkp@intel.com>
[-- Attachment #1: Type: text/plain, Size: 6797 bytes --]
Hi Vinod,
Thanks for your patch! Perhaps something to improve:
[auto build test WARNING on wsa/i2c/for-next]
[also build test WARNING on v5.15-rc7 next-20211029]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Vinod-Koul/i2c-qcom-geni-Add-support-for-GPI-DMA/20211019-140347
base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: riscv-randconfig-c006-20211028 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5db7568a6a1fcb408eb8988abdaff2a225a8eb72)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/0day-ci/linux/commit/8244d69587ec2d94d34a75f5a3865d250e6880c7
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Vinod-Koul/i2c-qcom-geni-Add-support-for-GPI-DMA/20211019-140347
git checkout 8244d69587ec2d94d34a75f5a3865d250e6880c7
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
>> drivers/i2c/busses/i2c-qcom-geni.c:508:8: warning: Value stored to 'dma_buf' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
void *dma_buf = &buf;
^~~~~~~ ~~~~
vim +/dma_buf +508 drivers/i2c/busses/i2c-qcom-geni.c
8244d69587ec2d9 Vinod Koul 2021-10-19 501
8244d69587ec2d9 Vinod Koul 2021-10-19 502 static int geni_i2c_gpi(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
8244d69587ec2d9 Vinod Koul 2021-10-19 503 struct dma_slave_config *config, dma_addr_t *dma_addr_p,
8244d69587ec2d9 Vinod Koul 2021-10-19 504 void **buf, unsigned int op, struct dma_chan *dma_chan)
8244d69587ec2d9 Vinod Koul 2021-10-19 505 {
8244d69587ec2d9 Vinod Koul 2021-10-19 506 struct gpi_i2c_config *peripheral;
8244d69587ec2d9 Vinod Koul 2021-10-19 507 unsigned int flags;
8244d69587ec2d9 Vinod Koul 2021-10-19 @508 void *dma_buf = &buf;
8244d69587ec2d9 Vinod Koul 2021-10-19 509 dma_addr_t addr;
8244d69587ec2d9 Vinod Koul 2021-10-19 510 enum dma_data_direction map_dirn;
8244d69587ec2d9 Vinod Koul 2021-10-19 511 enum dma_transfer_direction dma_dirn;
8244d69587ec2d9 Vinod Koul 2021-10-19 512 struct dma_async_tx_descriptor *desc;
8244d69587ec2d9 Vinod Koul 2021-10-19 513 int ret;
8244d69587ec2d9 Vinod Koul 2021-10-19 514
8244d69587ec2d9 Vinod Koul 2021-10-19 515 peripheral = config->peripheral_config;
8244d69587ec2d9 Vinod Koul 2021-10-19 516
8244d69587ec2d9 Vinod Koul 2021-10-19 517 dma_buf = i2c_get_dma_safe_msg_buf(msg, 1);
8244d69587ec2d9 Vinod Koul 2021-10-19 518 if (!dma_buf)
8244d69587ec2d9 Vinod Koul 2021-10-19 519 return -ENOMEM;
8244d69587ec2d9 Vinod Koul 2021-10-19 520
8244d69587ec2d9 Vinod Koul 2021-10-19 521 if (op == I2C_WRITE)
8244d69587ec2d9 Vinod Koul 2021-10-19 522 map_dirn = DMA_TO_DEVICE;
8244d69587ec2d9 Vinod Koul 2021-10-19 523 else
8244d69587ec2d9 Vinod Koul 2021-10-19 524 map_dirn = DMA_FROM_DEVICE;
8244d69587ec2d9 Vinod Koul 2021-10-19 525
8244d69587ec2d9 Vinod Koul 2021-10-19 526 addr = dma_map_single(gi2c->se.dev->parent, dma_buf, msg->len, map_dirn);
8244d69587ec2d9 Vinod Koul 2021-10-19 527 if (dma_mapping_error(gi2c->se.dev->parent, addr)) {
8244d69587ec2d9 Vinod Koul 2021-10-19 528 i2c_put_dma_safe_msg_buf(dma_buf, msg, false);
8244d69587ec2d9 Vinod Koul 2021-10-19 529 return -ENOMEM;
8244d69587ec2d9 Vinod Koul 2021-10-19 530 }
8244d69587ec2d9 Vinod Koul 2021-10-19 531
8244d69587ec2d9 Vinod Koul 2021-10-19 532 peripheral->rx_len = msg->len;
8244d69587ec2d9 Vinod Koul 2021-10-19 533 peripheral->op = op;
8244d69587ec2d9 Vinod Koul 2021-10-19 534
8244d69587ec2d9 Vinod Koul 2021-10-19 535 ret = dmaengine_slave_config(dma_chan, config);
8244d69587ec2d9 Vinod Koul 2021-10-19 536 if (ret) {
8244d69587ec2d9 Vinod Koul 2021-10-19 537 dev_err(gi2c->se.dev, "dma config error: %d for op:%d\n", ret, op);
8244d69587ec2d9 Vinod Koul 2021-10-19 538 goto err_config;
8244d69587ec2d9 Vinod Koul 2021-10-19 539 }
8244d69587ec2d9 Vinod Koul 2021-10-19 540
8244d69587ec2d9 Vinod Koul 2021-10-19 541 peripheral->set_config = false;
8244d69587ec2d9 Vinod Koul 2021-10-19 542 peripheral->multi_msg = true;
8244d69587ec2d9 Vinod Koul 2021-10-19 543 flags = DMA_PREP_INTERRUPT | DMA_CTRL_ACK;
8244d69587ec2d9 Vinod Koul 2021-10-19 544
8244d69587ec2d9 Vinod Koul 2021-10-19 545 if (op == I2C_WRITE)
8244d69587ec2d9 Vinod Koul 2021-10-19 546 dma_dirn = DMA_MEM_TO_DEV;
8244d69587ec2d9 Vinod Koul 2021-10-19 547 else
8244d69587ec2d9 Vinod Koul 2021-10-19 548 dma_dirn = DMA_DEV_TO_MEM;
8244d69587ec2d9 Vinod Koul 2021-10-19 549
8244d69587ec2d9 Vinod Koul 2021-10-19 550 desc = dmaengine_prep_slave_single(dma_chan, addr, msg->len, dma_dirn, flags);
8244d69587ec2d9 Vinod Koul 2021-10-19 551 if (!desc) {
8244d69587ec2d9 Vinod Koul 2021-10-19 552 dev_err(gi2c->se.dev, "prep_slave_sg failed\n");
8244d69587ec2d9 Vinod Koul 2021-10-19 553 ret = -EIO;
8244d69587ec2d9 Vinod Koul 2021-10-19 554 goto err_config;
8244d69587ec2d9 Vinod Koul 2021-10-19 555 }
8244d69587ec2d9 Vinod Koul 2021-10-19 556
8244d69587ec2d9 Vinod Koul 2021-10-19 557 desc->callback_result = i2c_gsi_cb_result;
8244d69587ec2d9 Vinod Koul 2021-10-19 558 desc->callback_param = gi2c;
8244d69587ec2d9 Vinod Koul 2021-10-19 559
8244d69587ec2d9 Vinod Koul 2021-10-19 560 dmaengine_submit(desc);
8244d69587ec2d9 Vinod Koul 2021-10-19 561 *dma_addr_p = addr;
8244d69587ec2d9 Vinod Koul 2021-10-19 562
8244d69587ec2d9 Vinod Koul 2021-10-19 563 return 0;
8244d69587ec2d9 Vinod Koul 2021-10-19 564
8244d69587ec2d9 Vinod Koul 2021-10-19 565 err_config:
8244d69587ec2d9 Vinod Koul 2021-10-19 566 dma_unmap_single(gi2c->se.dev->parent, addr, msg->len, map_dirn);
8244d69587ec2d9 Vinod Koul 2021-10-19 567 i2c_put_dma_safe_msg_buf(dma_buf, msg, false);
8244d69587ec2d9 Vinod Koul 2021-10-19 568 return ret;
8244d69587ec2d9 Vinod Koul 2021-10-19 569 }
8244d69587ec2d9 Vinod Koul 2021-10-19 570
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36143 bytes --]
next parent reply other threads:[~2021-10-31 14:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <202110292307.Kb4i0Jf1-lkp@intel.com>
2021-10-31 14:05 ` kernel test robot [this message]
2021-10-19 6:01 Vinod Koul
2021-11-01 16:23 ` Bjorn Andersson
2025-07-07 7:59 ` Csókás Bence
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2df2406f-408b-1340-3f91-f545707a3278@intel.com \
--to=yujie.liu@intel.com \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=dianders@chromium.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mka@chromium.org \
--cc=sumit.semwal@linaro.org \
--cc=vkoul@kernel.org \
--cc=wsa-dev@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®