All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v1 10/10] Bluetooth: btmtksdio: add MT7921s Bluetooth support
Date: Sun, 10 Oct 2021 21:35:47 +0800	[thread overview]
Message-ID: <202110102139.kxNcGe7h-lkp@intel.com> (raw)
In-Reply-To: <cae32b7d93a13273c7610ce7c2b82129847ee587.1633728573.git.objelf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 6235 bytes --]

Hi,

I love your patch! Perhaps something to improve:

[auto build test WARNING on bluetooth-next/master]
[also build test WARNING on next-20211008]
[cannot apply to linus/master bluetooth/master v5.15-rc4]
[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/sean-wang-mediatek-com/Add-MT7921-SDIO-Bluetooth-support/20211009-062620
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
config: riscv-randconfig-s031-20211010 (attached as .config)
compiler: riscv32-linux-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/0day-ci/linux/commit/a6d87b17fbe3a647ea639749d3f264f7a0194b14
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review sean-wang-mediatek-com/Add-MT7921-SDIO-Bluetooth-support/20211009-062620
        git checkout a6d87b17fbe3a647ea639749d3f264f7a0194b14
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=riscv SHELL=/bin/bash drivers/bluetooth/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
>> drivers/bluetooth/btmtksdio.c:218:34: sparse: sparse: cast to restricted __le32
   drivers/bluetooth/btmtksdio.c:444:63: sparse: sparse: Using plain integer as NULL pointer
   drivers/bluetooth/btmtksdio.c:490:63: sparse: sparse: Using plain integer as NULL pointer
   drivers/bluetooth/btmtksdio.c:503:63: sparse: sparse: Using plain integer as NULL pointer

vim +218 drivers/bluetooth/btmtksdio.c

   122	
   123	static int mtk_hci_wmt_sync(struct hci_dev *hdev,
   124				    struct btmtk_hci_wmt_params *wmt_params)
   125	{
   126		struct btmtksdio_dev *bdev = hci_get_drvdata(hdev);
   127		struct btmtk_hci_wmt_evt_funcc *wmt_evt_funcc;
   128		u32 hlen, status = BTMTK_WMT_INVALID;
   129		struct btmtk_hci_wmt_evt *wmt_evt;
   130		struct btmtk_hci_wmt_cmd *wc;
   131		struct btmtk_wmt_hdr *hdr;
   132		int err;
   133	
   134		/* Send the WMT command and wait until the WMT event returns */
   135		hlen = sizeof(*hdr) + wmt_params->dlen;
   136		if (hlen > 255)
   137			return -EINVAL;
   138	
   139		wc = kzalloc(hlen, GFP_KERNEL);
   140		if (!wc)
   141			return -ENOMEM;
   142	
   143		hdr = &wc->hdr;
   144		hdr->dir = 1;
   145		hdr->op = wmt_params->op;
   146		hdr->dlen = cpu_to_le16(wmt_params->dlen + 1);
   147		hdr->flag = wmt_params->flag;
   148		memcpy(wc->data, wmt_params->data, wmt_params->dlen);
   149	
   150		set_bit(BTMTKSDIO_TX_WAIT_VND_EVT, &bdev->tx_state);
   151	
   152		err = __hci_cmd_send(hdev, 0xfc6f, hlen, wc);
   153		if (err < 0) {
   154			clear_bit(BTMTKSDIO_TX_WAIT_VND_EVT, &bdev->tx_state);
   155			goto err_free_wc;
   156		}
   157	
   158		/* The vendor specific WMT commands are all answered by a vendor
   159		 * specific event and will not have the Command Status or Command
   160		 * Complete as with usual HCI command flow control.
   161		 *
   162		 * After sending the command, wait for BTMTKSDIO_TX_WAIT_VND_EVT
   163		 * state to be cleared. The driver specific event receive routine
   164		 * will clear that state and with that indicate completion of the
   165		 * WMT command.
   166		 */
   167		err = wait_on_bit_timeout(&bdev->tx_state, BTMTKSDIO_TX_WAIT_VND_EVT,
   168					  TASK_INTERRUPTIBLE, HCI_INIT_TIMEOUT);
   169		if (err == -EINTR) {
   170			bt_dev_err(hdev, "Execution of wmt command interrupted");
   171			clear_bit(BTMTKSDIO_TX_WAIT_VND_EVT, &bdev->tx_state);
   172			goto err_free_wc;
   173		}
   174	
   175		if (err) {
   176			bt_dev_err(hdev, "Execution of wmt command timed out");
   177			clear_bit(BTMTKSDIO_TX_WAIT_VND_EVT, &bdev->tx_state);
   178			err = -ETIMEDOUT;
   179			goto err_free_wc;
   180		}
   181	
   182		/* Parse and handle the return WMT event */
   183		wmt_evt = (struct btmtk_hci_wmt_evt *)bdev->evt_skb->data;
   184		if (wmt_evt->whdr.op != hdr->op) {
   185			bt_dev_err(hdev, "Wrong op received %d expected %d",
   186				   wmt_evt->whdr.op, hdr->op);
   187			err = -EIO;
   188			goto err_free_skb;
   189		}
   190	
   191		switch (wmt_evt->whdr.op) {
   192		case BTMTK_WMT_SEMAPHORE:
   193			if (wmt_evt->whdr.flag == 2)
   194				status = BTMTK_WMT_PATCH_UNDONE;
   195			else
   196				status = BTMTK_WMT_PATCH_DONE;
   197			break;
   198		case BTMTK_WMT_FUNC_CTRL:
   199			wmt_evt_funcc = (struct btmtk_hci_wmt_evt_funcc *)wmt_evt;
   200			if (be16_to_cpu(wmt_evt_funcc->status) == 0x404)
   201				status = BTMTK_WMT_ON_DONE;
   202			else if (be16_to_cpu(wmt_evt_funcc->status) == 0x420)
   203				status = BTMTK_WMT_ON_PROGRESS;
   204			else
   205				status = BTMTK_WMT_ON_UNDONE;
   206			break;
   207		case BTMTK_WMT_PATCH_DWNLD:
   208			if (wmt_evt->whdr.flag == 2)
   209				status = BTMTK_WMT_PATCH_DONE;
   210			else if (wmt_evt->whdr.flag == 1)
   211				status = BTMTK_WMT_PATCH_PROGRESS;
   212			else
   213				status = BTMTK_WMT_PATCH_UNDONE;
   214			break;
   215		case BTMTK_WMT_REGISTER:
   216			if (bdev->evt_skb->len == 18) {
   217				memcpy(&status, bdev->evt_skb->data + 14, sizeof(u32));
 > 218				status = le32_to_cpu(status);
   219			}
   220			break;
   221		}
   222	
   223		if (wmt_params->status)
   224			*wmt_params->status = status;
   225	
   226	err_free_skb:
   227		kfree_skb(bdev->evt_skb);
   228		bdev->evt_skb = NULL;
   229	err_free_wc:
   230		kfree(wc);
   231	
   232		return err;
   233	}
   234	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28444 bytes --]

      parent reply	other threads:[~2021-10-10 13:35 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08 22:10 [PATCH v1 00/10] Add MT7921 SDIO Bluetooth support sean.wang
2021-10-08 22:10 ` sean.wang
2021-10-08 22:10 ` [PATCH v1 01/10] Bluetooth: mediatek: add BT_MTK module sean.wang
2021-10-08 22:10   ` sean.wang
2021-10-08 22:10 ` [PATCH v1 02/10] Bluetooth: btmtksido: rely on " sean.wang
2021-10-08 22:10   ` sean.wang
2021-10-08 22:10 ` [PATCH v1 03/10] Bluetooth: btmtksdio: add .set_bdaddr support sean.wang
2021-10-08 22:10   ` sean.wang
2021-10-08 22:10 ` [PATCH v1 04/10] Bluetooth: btmtksdio: explicitly set WHISR as write-1-clear sean.wang
2021-10-08 22:10   ` sean.wang
2021-10-08 22:10 ` [PATCH v1 05/10] Bluetooth: btmtksdio: move interrupt service to work sean.wang
2021-10-08 22:10   ` sean.wang
2021-10-08 22:10 ` [PATCH v1 06/10] Bluetooth: btmtksdio: update register CSDIOCSR operation sean.wang
2021-10-08 22:10   ` sean.wang
2021-10-08 22:10 ` [PATCH v1 07/10] Bluetooth: btmtksdio: use register CRPLR to read packet length sean.wang
2021-10-08 22:10   ` sean.wang
2021-10-08 22:10 ` [PATCH v1 08/10] Bluetooth: btmtksdio: transmit packet according to the status TX_EMPTY sean.wang
2021-10-08 22:10   ` sean.wang
2021-10-08 22:10 ` [PATCH v1 09/10] mmc: add MT7921 SDIO identifiers for MediaTek Bluetooth devices sean.wang
2021-10-08 22:10   ` sean.wang
2021-10-08 22:10 ` [PATCH v1 10/10] Bluetooth: btmtksdio: add MT7921s Bluetooth support sean.wang
2021-10-08 22:10   ` sean.wang
2021-10-09 16:00   ` Pali Rohár
2021-10-09 16:00     ` Pali Rohár
2021-10-10 13:35   ` kernel test robot [this message]

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=202110102139.kxNcGe7h-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.