All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Alain Michaud <alainm@chromium.org>, linux-bluetooth@vger.kernel.org
Cc: kbuild-all@lists.01.org, Alain Michaud <alainm@chromium.org>
Subject: Re: [PATCH v3 2/3] bluetooth:allow scatternet connections if supported.
Date: Thu, 23 Apr 2020 12:21:54 +0800	[thread overview]
Message-ID: <202004231235.XDseHufn%lkp@intel.com> (raw)
In-Reply-To: <20200421155954.137391-3-alainm@chromium.org>

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

Hi Alain,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on bluetooth-next/master]
[also build test WARNING on v5.7-rc2 next-20200422]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Alain-Michaud/bluetooth-Adding-driver-and-quirk-defs-for-multi-role-LE/20200423-083451
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
config: c6x-allyesconfig (attached as .config)
compiler: c6x-elf-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=c6x 

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

All warnings (new ones prefixed by >>):

   net/bluetooth/hci_event.c: In function 'check_pending_le_conn':
>> net/bluetooth/hci_event.c:5291:39: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
    5291 |  if (hdev->conn_hash.le_num_slave > 0 &&
         |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
    5292 |      (hdev->quirks & HCI_QUIRK_VALID_LE_STATES) == 0 ||
         |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +5291 net/bluetooth/hci_event.c

  5270	
  5271	/* This function requires the caller holds hdev->lock */
  5272	static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev,
  5273						      bdaddr_t *addr,
  5274						      u8 addr_type, u8 adv_type,
  5275						      bdaddr_t *direct_rpa)
  5276	{
  5277		struct hci_conn *conn;
  5278		struct hci_conn_params *params;
  5279	
  5280		/* If the event is not connectable don't proceed further */
  5281		if (adv_type != LE_ADV_IND && adv_type != LE_ADV_DIRECT_IND)
  5282			return NULL;
  5283	
  5284		/* Ignore if the device is blocked */
  5285		if (hci_bdaddr_list_lookup(&hdev->blacklist, addr, addr_type))
  5286			return NULL;
  5287	
  5288		/* Most controller will fail if we try to create new connections
  5289		 * while we have an existing one in slave role.
  5290		 */
> 5291		if (hdev->conn_hash.le_num_slave > 0 &&
  5292		    (hdev->quirks & HCI_QUIRK_VALID_LE_STATES) == 0 ||
  5293		     !(hdev->le_states[3] & 0x10))
  5294			return NULL;
  5295	
  5296		/* If we're not connectable only connect devices that we have in
  5297		 * our pend_le_conns list.
  5298		 */
  5299		params = hci_pend_le_action_lookup(&hdev->pend_le_conns, addr,
  5300						   addr_type);
  5301		if (!params)
  5302			return NULL;
  5303	
  5304		if (!params->explicit_connect) {
  5305			switch (params->auto_connect) {
  5306			case HCI_AUTO_CONN_DIRECT:
  5307				/* Only devices advertising with ADV_DIRECT_IND are
  5308				 * triggering a connection attempt. This is allowing
  5309				 * incoming connections from slave devices.
  5310				 */
  5311				if (adv_type != LE_ADV_DIRECT_IND)
  5312					return NULL;
  5313				break;
  5314			case HCI_AUTO_CONN_ALWAYS:
  5315				/* Devices advertising with ADV_IND or ADV_DIRECT_IND
  5316				 * are triggering a connection attempt. This means
  5317				 * that incoming connections from slave device are
  5318				 * accepted and also outgoing connections to slave
  5319				 * devices are established when found.
  5320				 */
  5321				break;
  5322			default:
  5323				return NULL;
  5324			}
  5325		}
  5326	
  5327		conn = hci_connect_le(hdev, addr, addr_type, BT_SECURITY_LOW,
  5328				      HCI_LE_AUTOCONN_TIMEOUT, HCI_ROLE_MASTER,
  5329				      direct_rpa);
  5330		if (!IS_ERR(conn)) {
  5331			/* If HCI_AUTO_CONN_EXPLICIT is set, conn is already owned
  5332			 * by higher layer that tried to connect, if no then
  5333			 * store the pointer since we don't really have any
  5334			 * other owner of the object besides the params that
  5335			 * triggered it. This way we can abort the connection if
  5336			 * the parameters get removed and keep the reference
  5337			 * count consistent once the connection is established.
  5338			 */
  5339	
  5340			if (!params->explicit_connect)
  5341				params->conn = hci_conn_get(conn);
  5342	
  5343			return conn;
  5344		}
  5345	
  5346		switch (PTR_ERR(conn)) {
  5347		case -EBUSY:
  5348			/* If hci_connect() returns -EBUSY it means there is already
  5349			 * an LE connection attempt going on. Since controllers don't
  5350			 * support more than one connection attempt at the time, we
  5351			 * don't consider this an error case.
  5352			 */
  5353			break;
  5354		default:
  5355			BT_DBG("Failed to connect: err %ld", PTR_ERR(conn));
  5356			return NULL;
  5357		}
  5358	
  5359		return NULL;
  5360	}
  5361	

---
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: 52562 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kbuild test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v3 2/3] bluetooth:allow scatternet connections if supported.
Date: Thu, 23 Apr 2020 12:21:54 +0800	[thread overview]
Message-ID: <202004231235.XDseHufn%lkp@intel.com> (raw)
In-Reply-To: <20200421155954.137391-3-alainm@chromium.org>

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

Hi Alain,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on bluetooth-next/master]
[also build test WARNING on v5.7-rc2 next-20200422]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Alain-Michaud/bluetooth-Adding-driver-and-quirk-defs-for-multi-role-LE/20200423-083451
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
config: c6x-allyesconfig (attached as .config)
compiler: c6x-elf-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=c6x 

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

All warnings (new ones prefixed by >>):

   net/bluetooth/hci_event.c: In function 'check_pending_le_conn':
>> net/bluetooth/hci_event.c:5291:39: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
    5291 |  if (hdev->conn_hash.le_num_slave > 0 &&
         |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
    5292 |      (hdev->quirks & HCI_QUIRK_VALID_LE_STATES) == 0 ||
         |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +5291 net/bluetooth/hci_event.c

  5270	
  5271	/* This function requires the caller holds hdev->lock */
  5272	static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev,
  5273						      bdaddr_t *addr,
  5274						      u8 addr_type, u8 adv_type,
  5275						      bdaddr_t *direct_rpa)
  5276	{
  5277		struct hci_conn *conn;
  5278		struct hci_conn_params *params;
  5279	
  5280		/* If the event is not connectable don't proceed further */
  5281		if (adv_type != LE_ADV_IND && adv_type != LE_ADV_DIRECT_IND)
  5282			return NULL;
  5283	
  5284		/* Ignore if the device is blocked */
  5285		if (hci_bdaddr_list_lookup(&hdev->blacklist, addr, addr_type))
  5286			return NULL;
  5287	
  5288		/* Most controller will fail if we try to create new connections
  5289		 * while we have an existing one in slave role.
  5290		 */
> 5291		if (hdev->conn_hash.le_num_slave > 0 &&
  5292		    (hdev->quirks & HCI_QUIRK_VALID_LE_STATES) == 0 ||
  5293		     !(hdev->le_states[3] & 0x10))
  5294			return NULL;
  5295	
  5296		/* If we're not connectable only connect devices that we have in
  5297		 * our pend_le_conns list.
  5298		 */
  5299		params = hci_pend_le_action_lookup(&hdev->pend_le_conns, addr,
  5300						   addr_type);
  5301		if (!params)
  5302			return NULL;
  5303	
  5304		if (!params->explicit_connect) {
  5305			switch (params->auto_connect) {
  5306			case HCI_AUTO_CONN_DIRECT:
  5307				/* Only devices advertising with ADV_DIRECT_IND are
  5308				 * triggering a connection attempt. This is allowing
  5309				 * incoming connections from slave devices.
  5310				 */
  5311				if (adv_type != LE_ADV_DIRECT_IND)
  5312					return NULL;
  5313				break;
  5314			case HCI_AUTO_CONN_ALWAYS:
  5315				/* Devices advertising with ADV_IND or ADV_DIRECT_IND
  5316				 * are triggering a connection attempt. This means
  5317				 * that incoming connections from slave device are
  5318				 * accepted and also outgoing connections to slave
  5319				 * devices are established when found.
  5320				 */
  5321				break;
  5322			default:
  5323				return NULL;
  5324			}
  5325		}
  5326	
  5327		conn = hci_connect_le(hdev, addr, addr_type, BT_SECURITY_LOW,
  5328				      HCI_LE_AUTOCONN_TIMEOUT, HCI_ROLE_MASTER,
  5329				      direct_rpa);
  5330		if (!IS_ERR(conn)) {
  5331			/* If HCI_AUTO_CONN_EXPLICIT is set, conn is already owned
  5332			 * by higher layer that tried to connect, if no then
  5333			 * store the pointer since we don't really have any
  5334			 * other owner of the object besides the params that
  5335			 * triggered it. This way we can abort the connection if
  5336			 * the parameters get removed and keep the reference
  5337			 * count consistent once the connection is established.
  5338			 */
  5339	
  5340			if (!params->explicit_connect)
  5341				params->conn = hci_conn_get(conn);
  5342	
  5343			return conn;
  5344		}
  5345	
  5346		switch (PTR_ERR(conn)) {
  5347		case -EBUSY:
  5348			/* If hci_connect() returns -EBUSY it means there is already
  5349			 * an LE connection attempt going on. Since controllers don't
  5350			 * support more than one connection attempt at the time, we
  5351			 * don't consider this an error case.
  5352			 */
  5353			break;
  5354		default:
  5355			BT_DBG("Failed to connect: err %ld", PTR_ERR(conn));
  5356			return NULL;
  5357		}
  5358	
  5359		return NULL;
  5360	}
  5361	

---
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: 52562 bytes --]

  parent reply	other threads:[~2020-04-23  4:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21 15:59 [PATCH v3 0/3] bluetooth:Adding driver and quirk defs for multi-role LE Alain Michaud
2020-04-21 15:59 ` [PATCH v3 1/3] " Alain Michaud
2020-04-21 15:59 ` [PATCH v3 2/3] bluetooth:allow scatternet connections if supported Alain Michaud
2020-04-22 17:36   ` Marcel Holtmann
2020-04-23  4:21   ` kbuild test robot [this message]
2020-04-23  4:21     ` kbuild test robot
2020-04-21 15:59 ` [PATCH v3 3/3] bluetooth:btusb: Adding support for LE scatternet to Jfp and ThP Alain Michaud
2020-04-23 14:43 [PATCH v3 0/3] bluetooth:Adding driver and quirk defs for multi-role LE Alain Michaud
2020-04-23 14:43 ` [PATCH v3 2/3] bluetooth:allow scatternet connections if supported Alain Michaud

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=202004231235.XDseHufn%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alainm@chromium.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-bluetooth@vger.kernel.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.