Skip to content

Commit 3b70432

Browse files
committed
tgupdate: merge t/DO-NOT-MERGE-mptcp-enabled-by-default into t/upstream base
2 parents ee03b98 + 02ea629 commit 3b70432

File tree

14 files changed

+137
-57
lines changed

14 files changed

+137
-57
lines changed

drivers/bluetooth/btmtk.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -642,12 +642,7 @@ static int btmtk_usb_hci_wmt_sync(struct hci_dev *hdev,
642642
* WMT command.
643643
*/
644644
err = wait_on_bit_timeout(&data->flags, BTMTK_TX_WAIT_VND_EVT,
645-
TASK_INTERRUPTIBLE, HCI_INIT_TIMEOUT);
646-
if (err == -EINTR) {
647-
bt_dev_err(hdev, "Execution of wmt command interrupted");
648-
clear_bit(BTMTK_TX_WAIT_VND_EVT, &data->flags);
649-
goto err_free_wc;
650-
}
645+
TASK_UNINTERRUPTIBLE, HCI_INIT_TIMEOUT);
651646

652647
if (err) {
653648
bt_dev_err(hdev, "Execution of wmt command timed out");

drivers/bluetooth/btnxpuart.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,10 @@ static int ps_setup(struct hci_dev *hdev)
543543
}
544544

545545
if (psdata->wakeup_source) {
546-
ret = devm_request_irq(&serdev->dev, psdata->irq_handler,
547-
ps_host_wakeup_irq_handler,
548-
IRQF_ONESHOT | IRQF_TRIGGER_FALLING,
549-
dev_name(&serdev->dev), nxpdev);
546+
ret = devm_request_threaded_irq(&serdev->dev, psdata->irq_handler,
547+
NULL, ps_host_wakeup_irq_handler,
548+
IRQF_ONESHOT,
549+
dev_name(&serdev->dev), nxpdev);
550550
if (ret)
551551
bt_dev_info(hdev, "error setting wakeup IRQ handler, ignoring\n");
552552
disable_irq(psdata->irq_handler);

drivers/net/ethernet/mellanox/mlxsw/spectrum.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,6 +2375,8 @@ static const struct mlxsw_listener mlxsw_sp_listener[] = {
23752375
ROUTER_EXP, false),
23762376
MLXSW_SP_RXL_NO_MARK(DISCARD_ING_ROUTER_DIP_LINK_LOCAL, FORWARD,
23772377
ROUTER_EXP, false),
2378+
MLXSW_SP_RXL_NO_MARK(DISCARD_ING_ROUTER_SIP_LINK_LOCAL, FORWARD,
2379+
ROUTER_EXP, false),
23782380
/* Multicast Router Traps */
23792381
MLXSW_SP_RXL_MARK(ACL1, TRAP_TO_CPU, MULTICAST, false),
23802382
MLXSW_SP_RXL_L3_MARK(ACL2, TRAP_TO_CPU, MULTICAST, false),

drivers/net/ethernet/mellanox/mlxsw/trap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ enum {
9494
MLXSW_TRAP_ID_DISCARD_ING_ROUTER_IPV4_SIP_BC = 0x16A,
9595
MLXSW_TRAP_ID_DISCARD_ING_ROUTER_IPV4_DIP_LOCAL_NET = 0x16B,
9696
MLXSW_TRAP_ID_DISCARD_ING_ROUTER_DIP_LINK_LOCAL = 0x16C,
97+
MLXSW_TRAP_ID_DISCARD_ING_ROUTER_SIP_LINK_LOCAL = 0x16D,
9798
MLXSW_TRAP_ID_DISCARD_ROUTER_IRIF_EN = 0x178,
9899
MLXSW_TRAP_ID_DISCARD_ROUTER_ERIF_EN = 0x179,
99100
MLXSW_TRAP_ID_DISCARD_ROUTER_LPM4 = 0x17B,

drivers/net/ethernet/wangxun/libwx/wx_vf_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ void wx_setup_vfmrqc_vf(struct wx *wx)
192192
u8 i, j;
193193

194194
/* Fill out hash function seeds */
195-
netdev_rss_key_fill(wx->rss_key, sizeof(wx->rss_key));
195+
netdev_rss_key_fill(wx->rss_key, WX_RSS_KEY_SIZE);
196196
for (i = 0; i < WX_RSS_KEY_SIZE / 4; i++)
197197
wr32(wx, WX_VXRSSRK(i), wx->rss_key[i]);
198198

include/net/bluetooth/bluetooth.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ static inline void sco_exit(void)
647647
#if IS_ENABLED(CONFIG_BT_LE)
648648
int iso_init(void);
649649
int iso_exit(void);
650-
bool iso_enabled(void);
650+
bool iso_inited(void);
651651
#else
652652
static inline int iso_init(void)
653653
{
@@ -659,7 +659,7 @@ static inline int iso_exit(void)
659659
return 0;
660660
}
661661

662-
static inline bool iso_enabled(void)
662+
static inline bool iso_inited(void)
663663
{
664664
return false;
665665
}

include/net/bluetooth/hci_core.h

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ struct hci_conn_hash {
129129
struct list_head list;
130130
unsigned int acl_num;
131131
unsigned int sco_num;
132-
unsigned int iso_num;
132+
unsigned int cis_num;
133+
unsigned int bis_num;
134+
unsigned int pa_num;
133135
unsigned int le_num;
134136
unsigned int le_num_peripheral;
135137
};
@@ -1014,9 +1016,13 @@ static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
10141016
h->sco_num++;
10151017
break;
10161018
case CIS_LINK:
1019+
h->cis_num++;
1020+
break;
10171021
case BIS_LINK:
1022+
h->bis_num++;
1023+
break;
10181024
case PA_LINK:
1019-
h->iso_num++;
1025+
h->pa_num++;
10201026
break;
10211027
}
10221028
}
@@ -1042,9 +1048,13 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
10421048
h->sco_num--;
10431049
break;
10441050
case CIS_LINK:
1051+
h->cis_num--;
1052+
break;
10451053
case BIS_LINK:
1054+
h->bis_num--;
1055+
break;
10461056
case PA_LINK:
1047-
h->iso_num--;
1057+
h->pa_num--;
10481058
break;
10491059
}
10501060
}
@@ -1061,9 +1071,11 @@ static inline unsigned int hci_conn_num(struct hci_dev *hdev, __u8 type)
10611071
case ESCO_LINK:
10621072
return h->sco_num;
10631073
case CIS_LINK:
1074+
return h->cis_num;
10641075
case BIS_LINK:
1076+
return h->bis_num;
10651077
case PA_LINK:
1066-
return h->iso_num;
1078+
return h->pa_num;
10671079
default:
10681080
return 0;
10691081
}
@@ -1073,7 +1085,15 @@ static inline unsigned int hci_conn_count(struct hci_dev *hdev)
10731085
{
10741086
struct hci_conn_hash *c = &hdev->conn_hash;
10751087

1076-
return c->acl_num + c->sco_num + c->le_num + c->iso_num;
1088+
return c->acl_num + c->sco_num + c->le_num + c->cis_num + c->bis_num +
1089+
c->pa_num;
1090+
}
1091+
1092+
static inline unsigned int hci_iso_count(struct hci_dev *hdev)
1093+
{
1094+
struct hci_conn_hash *c = &hdev->conn_hash;
1095+
1096+
return c->cis_num + c->bis_num;
10771097
}
10781098

10791099
static inline bool hci_conn_valid(struct hci_dev *hdev, struct hci_conn *conn)
@@ -1915,6 +1935,8 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
19151935
!hci_dev_test_flag(dev, HCI_RPA_EXPIRED))
19161936
#define adv_rpa_valid(adv) (bacmp(&adv->random_addr, BDADDR_ANY) && \
19171937
!adv->rpa_expired)
1938+
#define le_enabled(dev) (lmp_le_capable(dev) && \
1939+
hci_dev_test_flag(dev, HCI_LE_ENABLED))
19181940

19191941
#define scan_1m(dev) (((dev)->le_tx_def_phys & HCI_LE_SET_PHY_1M) || \
19201942
((dev)->le_rx_def_phys & HCI_LE_SET_PHY_1M))
@@ -1932,6 +1954,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
19321954
((dev)->le_rx_def_phys & HCI_LE_SET_PHY_CODED))
19331955

19341956
#define ll_privacy_capable(dev) ((dev)->le_features[0] & HCI_LE_LL_PRIVACY)
1957+
#define ll_privacy_enabled(dev) (le_enabled(dev) && ll_privacy_capable(dev))
19351958

19361959
#define privacy_mode_capable(dev) (ll_privacy_capable(dev) && \
19371960
((dev)->commands[39] & 0x04))
@@ -1981,14 +2004,23 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
19812004

19822005
/* CIS Master/Slave and BIS support */
19832006
#define iso_capable(dev) (cis_capable(dev) || bis_capable(dev))
2007+
#define iso_enabled(dev) (le_enabled(dev) && iso_capable(dev))
19842008
#define cis_capable(dev) \
19852009
(cis_central_capable(dev) || cis_peripheral_capable(dev))
2010+
#define cis_enabled(dev) (le_enabled(dev) && cis_capable(dev))
19862011
#define cis_central_capable(dev) \
19872012
((dev)->le_features[3] & HCI_LE_CIS_CENTRAL)
2013+
#define cis_central_enabled(dev) \
2014+
(le_enabled(dev) && cis_central_capable(dev))
19882015
#define cis_peripheral_capable(dev) \
19892016
((dev)->le_features[3] & HCI_LE_CIS_PERIPHERAL)
2017+
#define cis_peripheral_enabled(dev) \
2018+
(le_enabled(dev) && cis_peripheral_capable(dev))
19902019
#define bis_capable(dev) ((dev)->le_features[3] & HCI_LE_ISO_BROADCASTER)
1991-
#define sync_recv_capable(dev) ((dev)->le_features[3] & HCI_LE_ISO_SYNC_RECEIVER)
2020+
#define bis_enabled(dev) (le_enabled(dev) && bis_capable(dev))
2021+
#define sync_recv_capable(dev) \
2022+
((dev)->le_features[3] & HCI_LE_ISO_SYNC_RECEIVER)
2023+
#define sync_recv_enabled(dev) (le_enabled(dev) && sync_recv_capable(dev))
19922024

19932025
#define mws_transport_config_capable(dev) (((dev)->commands[30] & 0x08) && \
19942026
(!hci_test_quirk((dev), HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG)))

net/bluetooth/hci_conn.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ static int hci_enhanced_setup_sync(struct hci_dev *hdev, void *data)
339339
case BT_CODEC_TRANSPARENT:
340340
if (!find_next_esco_param(conn, esco_param_msbc,
341341
ARRAY_SIZE(esco_param_msbc)))
342-
return false;
342+
return -EINVAL;
343+
343344
param = &esco_param_msbc[conn->attempt - 1];
344345
cp.tx_coding_format.id = 0x03;
345346
cp.rx_coding_format.id = 0x03;
@@ -830,7 +831,17 @@ static void bis_cleanup(struct hci_conn *conn)
830831
/* Check if ISO connection is a BIS and terminate advertising
831832
* set and BIG if there are no other connections using it.
832833
*/
833-
bis = hci_conn_hash_lookup_big(hdev, conn->iso_qos.bcast.big);
834+
bis = hci_conn_hash_lookup_big_state(hdev,
835+
conn->iso_qos.bcast.big,
836+
BT_CONNECTED,
837+
HCI_ROLE_MASTER);
838+
if (bis)
839+
return;
840+
841+
bis = hci_conn_hash_lookup_big_state(hdev,
842+
conn->iso_qos.bcast.big,
843+
BT_CONNECT,
844+
HCI_ROLE_MASTER);
834845
if (bis)
835846
return;
836847

@@ -2249,7 +2260,7 @@ struct hci_conn *hci_connect_bis(struct hci_dev *hdev, bdaddr_t *dst,
22492260
* the start periodic advertising and create BIG commands have
22502261
* been queued
22512262
*/
2252-
hci_conn_hash_list_state(hdev, bis_mark_per_adv, PA_LINK,
2263+
hci_conn_hash_list_state(hdev, bis_mark_per_adv, BIS_LINK,
22532264
BT_BOUND, &data);
22542265

22552266
/* Queue start periodic advertising and create BIG */

net/bluetooth/hci_event.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6745,8 +6745,8 @@ static void hci_le_cis_established_evt(struct hci_dev *hdev, void *data,
67456745
qos->ucast.out.latency =
67466746
DIV_ROUND_CLOSEST(get_unaligned_le24(ev->p_latency),
67476747
1000);
6748-
qos->ucast.in.sdu = le16_to_cpu(ev->c_mtu);
6749-
qos->ucast.out.sdu = le16_to_cpu(ev->p_mtu);
6748+
qos->ucast.in.sdu = ev->c_bn ? le16_to_cpu(ev->c_mtu) : 0;
6749+
qos->ucast.out.sdu = ev->p_bn ? le16_to_cpu(ev->p_mtu) : 0;
67506750
qos->ucast.in.phy = ev->c_phy;
67516751
qos->ucast.out.phy = ev->p_phy;
67526752
break;
@@ -6760,8 +6760,8 @@ static void hci_le_cis_established_evt(struct hci_dev *hdev, void *data,
67606760
qos->ucast.in.latency =
67616761
DIV_ROUND_CLOSEST(get_unaligned_le24(ev->p_latency),
67626762
1000);
6763-
qos->ucast.out.sdu = le16_to_cpu(ev->c_mtu);
6764-
qos->ucast.in.sdu = le16_to_cpu(ev->p_mtu);
6763+
qos->ucast.out.sdu = ev->c_bn ? le16_to_cpu(ev->c_mtu) : 0;
6764+
qos->ucast.in.sdu = ev->p_bn ? le16_to_cpu(ev->p_mtu) : 0;
67656765
qos->ucast.out.phy = ev->c_phy;
67666766
qos->ucast.in.phy = ev->p_phy;
67676767
break;
@@ -6957,9 +6957,14 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
69576957
continue;
69586958
}
69596959

6960-
if (ev->status != 0x42)
6960+
if (ev->status != 0x42) {
69616961
/* Mark PA sync as established */
69626962
set_bit(HCI_CONN_PA_SYNC, &bis->flags);
6963+
/* Reset cleanup callback of PA Sync so it doesn't
6964+
* terminate the sync when deleting the connection.
6965+
*/
6966+
conn->cleanup = NULL;
6967+
}
69636968

69646969
bis->sync_handle = conn->sync_handle;
69656970
bis->iso_qos.bcast.big = ev->handle;

net/bluetooth/hci_sync.c

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3344,7 +3344,7 @@ static int hci_powered_update_adv_sync(struct hci_dev *hdev)
33443344
* advertising data. This also applies to the case
33453345
* where BR/EDR was toggled during the AUTO_OFF phase.
33463346
*/
3347-
if (hci_dev_test_flag(hdev, HCI_ADVERTISING) ||
3347+
if (hci_dev_test_flag(hdev, HCI_ADVERTISING) &&
33483348
list_empty(&hdev->adv_instances)) {
33493349
if (ext_adv_capable(hdev)) {
33503350
err = hci_setup_ext_adv_instance_sync(hdev, 0x00);
@@ -4531,14 +4531,14 @@ static int hci_le_set_host_feature_sync(struct hci_dev *hdev)
45314531
{
45324532
struct hci_cp_le_set_host_feature cp;
45334533

4534-
if (!cis_capable(hdev))
4534+
if (!iso_capable(hdev))
45354535
return 0;
45364536

45374537
memset(&cp, 0, sizeof(cp));
45384538

45394539
/* Connected Isochronous Channels (Host Support) */
45404540
cp.bit_number = 32;
4541-
cp.bit_value = 1;
4541+
cp.bit_value = iso_enabled(hdev) ? 0x01 : 0x00;
45424542

45434543
return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_HOST_FEATURE,
45444544
sizeof(cp), &cp, HCI_CMD_TIMEOUT);
@@ -6985,8 +6985,6 @@ static void create_pa_complete(struct hci_dev *hdev, void *data, int err)
69856985

69866986
hci_dev_lock(hdev);
69876987

6988-
hci_dev_clear_flag(hdev, HCI_PA_SYNC);
6989-
69906988
if (!hci_conn_valid(hdev, conn))
69916989
clear_bit(HCI_CONN_CREATE_PA_SYNC, &conn->flags);
69926990

@@ -7047,10 +7045,13 @@ static int hci_le_pa_create_sync(struct hci_dev *hdev, void *data)
70477045
/* SID has not been set listen for HCI_EV_LE_EXT_ADV_REPORT to update
70487046
* it.
70497047
*/
7050-
if (conn->sid == HCI_SID_INVALID)
7051-
__hci_cmd_sync_status_sk(hdev, HCI_OP_NOP, 0, NULL,
7052-
HCI_EV_LE_EXT_ADV_REPORT,
7053-
conn->conn_timeout, NULL);
7048+
if (conn->sid == HCI_SID_INVALID) {
7049+
err = __hci_cmd_sync_status_sk(hdev, HCI_OP_NOP, 0, NULL,
7050+
HCI_EV_LE_EXT_ADV_REPORT,
7051+
conn->conn_timeout, NULL);
7052+
if (err == -ETIMEDOUT)
7053+
goto done;
7054+
}
70547055

70557056
memset(&cp, 0, sizeof(cp));
70567057
cp.options = qos->bcast.options;
@@ -7080,6 +7081,12 @@ static int hci_le_pa_create_sync(struct hci_dev *hdev, void *data)
70807081
__hci_cmd_sync_status(hdev, HCI_OP_LE_PA_CREATE_SYNC_CANCEL,
70817082
0, NULL, HCI_CMD_TIMEOUT);
70827083

7084+
done:
7085+
hci_dev_clear_flag(hdev, HCI_PA_SYNC);
7086+
7087+
/* Update passive scan since HCI_PA_SYNC flag has been cleared */
7088+
hci_update_passive_scan_sync(hdev);
7089+
70837090
return err;
70847091
}
70857092

0 commit comments

Comments
 (0)