Skip to content

Commit de2ece7

Browse files
committed
tgupdate: merge t/upstream base into t/upstream
2 parents 54ed7f0 + e82a01d commit de2ece7

File tree

11 files changed

+95
-65
lines changed

11 files changed

+95
-65
lines changed

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4092,6 +4092,12 @@ static int bcmgenet_probe(struct platform_device *pdev)
40924092
for (i = 0; i <= priv->hw_params->rx_queues; i++)
40934093
priv->rx_rings[i].rx_max_coalesced_frames = 1;
40944094

4095+
/* Initialize u64 stats seq counter for 32bit machines */
4096+
for (i = 0; i <= priv->hw_params->rx_queues; i++)
4097+
u64_stats_init(&priv->rx_rings[i].stats64.syncp);
4098+
for (i = 0; i <= priv->hw_params->tx_queues; i++)
4099+
u64_stats_init(&priv->tx_rings[i].stats64.syncp);
4100+
40954101
/* libphy will determine the link state */
40964102
netif_carrier_off(dev);
40974103

drivers/net/phy/qcom/at803x.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727

2828
#define AT803X_LED_CONTROL 0x18
2929

30-
#define AT803X_PHY_MMD3_WOL_CTRL 0x8012
31-
#define AT803X_WOL_EN BIT(5)
32-
3330
#define AT803X_REG_CHIP_CONFIG 0x1f
3431
#define AT803X_BT_BX_REG_SEL 0x8000
3532

@@ -916,30 +913,6 @@ static int at8031_config_init(struct phy_device *phydev)
916913
return at803x_config_init(phydev);
917914
}
918915

919-
static int at8031_set_wol(struct phy_device *phydev,
920-
struct ethtool_wolinfo *wol)
921-
{
922-
int ret;
923-
924-
/* First setup MAC address and enable WOL interrupt */
925-
ret = at803x_set_wol(phydev, wol);
926-
if (ret)
927-
return ret;
928-
929-
if (wol->wolopts & WAKE_MAGIC)
930-
/* Enable WOL function for 1588 */
931-
ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
932-
AT803X_PHY_MMD3_WOL_CTRL,
933-
0, AT803X_WOL_EN);
934-
else
935-
/* Disable WoL function for 1588 */
936-
ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
937-
AT803X_PHY_MMD3_WOL_CTRL,
938-
AT803X_WOL_EN, 0);
939-
940-
return ret;
941-
}
942-
943916
static int at8031_config_intr(struct phy_device *phydev)
944917
{
945918
struct at803x_priv *priv = phydev->priv;

drivers/net/phy/qcom/qca808x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ static struct phy_driver qca808x_driver[] = {
633633
.handle_interrupt = at803x_handle_interrupt,
634634
.get_tunable = at803x_get_tunable,
635635
.set_tunable = at803x_set_tunable,
636-
.set_wol = at803x_set_wol,
636+
.set_wol = at8031_set_wol,
637637
.get_wol = at803x_get_wol,
638638
.get_features = qca808x_get_features,
639639
.config_aneg = qca808x_config_aneg,

drivers/net/phy/qcom/qcom-phy-lib.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,31 @@ int at803x_set_wol(struct phy_device *phydev,
115115
}
116116
EXPORT_SYMBOL_GPL(at803x_set_wol);
117117

118+
int at8031_set_wol(struct phy_device *phydev,
119+
struct ethtool_wolinfo *wol)
120+
{
121+
int ret;
122+
123+
/* First setup MAC address and enable WOL interrupt */
124+
ret = at803x_set_wol(phydev, wol);
125+
if (ret)
126+
return ret;
127+
128+
if (wol->wolopts & WAKE_MAGIC)
129+
/* Enable WOL function for 1588 */
130+
ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
131+
AT803X_PHY_MMD3_WOL_CTRL,
132+
0, AT803X_WOL_EN);
133+
else
134+
/* Disable WoL function for 1588 */
135+
ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
136+
AT803X_PHY_MMD3_WOL_CTRL,
137+
AT803X_WOL_EN, 0);
138+
139+
return ret;
140+
}
141+
EXPORT_SYMBOL_GPL(at8031_set_wol);
142+
118143
void at803x_get_wol(struct phy_device *phydev,
119144
struct ethtool_wolinfo *wol)
120145
{

drivers/net/phy/qcom/qcom.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@
172172
#define AT803X_LOC_MAC_ADDR_16_31_OFFSET 0x804B
173173
#define AT803X_LOC_MAC_ADDR_32_47_OFFSET 0x804A
174174

175+
#define AT803X_PHY_MMD3_WOL_CTRL 0x8012
176+
#define AT803X_WOL_EN BIT(5)
177+
175178
#define AT803X_DEBUG_ADDR 0x1D
176179
#define AT803X_DEBUG_DATA 0x1E
177180

@@ -215,6 +218,8 @@ int at803x_debug_reg_mask(struct phy_device *phydev, u16 reg,
215218
int at803x_debug_reg_write(struct phy_device *phydev, u16 reg, u16 data);
216219
int at803x_set_wol(struct phy_device *phydev,
217220
struct ethtool_wolinfo *wol);
221+
int at8031_set_wol(struct phy_device *phydev,
222+
struct ethtool_wolinfo *wol);
218223
void at803x_get_wol(struct phy_device *phydev,
219224
struct ethtool_wolinfo *wol);
220225
int at803x_ack_interrupt(struct phy_device *phydev);

include/net/af_vsock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ int __vsock_dgram_recvmsg(struct socket *sock, struct msghdr *msg,
243243
int vsock_dgram_recvmsg(struct socket *sock, struct msghdr *msg,
244244
size_t len, int flags);
245245

246-
#ifdef CONFIG_BPF_SYSCALL
247246
extern struct proto vsock_proto;
247+
#ifdef CONFIG_BPF_SYSCALL
248248
int vsock_bpf_update_proto(struct sock *sk, struct sk_psock *psock, bool restore);
249249
void __init vsock_bpf_build_proto(void);
250250
#else

include/net/bluetooth/hci_core.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,8 +1350,7 @@ hci_conn_hash_lookup_big_state(struct hci_dev *hdev, __u8 handle, __u16 state)
13501350
rcu_read_lock();
13511351

13521352
list_for_each_entry_rcu(c, &h->list, list) {
1353-
if (c->type != BIS_LINK || bacmp(&c->dst, BDADDR_ANY) ||
1354-
c->state != state)
1353+
if (c->type != BIS_LINK || c->state != state)
13551354
continue;
13561355

13571356
if (handle == c->iso_qos.bcast.big) {

net/bluetooth/hci_event.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6966,7 +6966,10 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
69666966
bis->iso_qos.bcast.in.sdu = le16_to_cpu(ev->max_pdu);
69676967

69686968
if (!ev->status) {
6969+
bis->state = BT_CONNECTED;
69696970
set_bit(HCI_CONN_BIG_SYNC, &bis->flags);
6971+
hci_debugfs_create_conn(bis);
6972+
hci_conn_add_sysfs(bis);
69706973
hci_iso_setup_path(bis);
69716974
}
69726975
}

net/bluetooth/hci_sync.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@ int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance)
13451345
* Command Disallowed error, so we must first disable the
13461346
* instance if it is active.
13471347
*/
1348-
if (adv && !adv->pending) {
1348+
if (adv) {
13491349
err = hci_disable_ext_adv_instance_sync(hdev, instance);
13501350
if (err)
13511351
return err;
@@ -5493,7 +5493,7 @@ static int hci_disconnect_sync(struct hci_dev *hdev, struct hci_conn *conn,
54935493
{
54945494
struct hci_cp_disconnect cp;
54955495

5496-
if (test_bit(HCI_CONN_BIG_CREATED, &conn->flags)) {
5496+
if (conn->type == BIS_LINK) {
54975497
/* This is a BIS connection, hci_conn_del will
54985498
* do the necessary cleanup.
54995499
*/

net/netlink/af_netlink.c

Lines changed: 49 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ static void netlink_skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
387387
WARN_ON(skb->sk != NULL);
388388
skb->sk = sk;
389389
skb->destructor = netlink_skb_destructor;
390-
atomic_add(skb->truesize, &sk->sk_rmem_alloc);
391390
sk_mem_charge(sk, skb->truesize);
392391
}
393392

@@ -1212,41 +1211,48 @@ struct sk_buff *netlink_alloc_large_skb(unsigned int size, int broadcast)
12121211
int netlink_attachskb(struct sock *sk, struct sk_buff *skb,
12131212
long *timeo, struct sock *ssk)
12141213
{
1214+
DECLARE_WAITQUEUE(wait, current);
12151215
struct netlink_sock *nlk;
1216+
unsigned int rmem;
12161217

12171218
nlk = nlk_sk(sk);
1219+
rmem = atomic_add_return(skb->truesize, &sk->sk_rmem_alloc);
12181220

1219-
if ((atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf ||
1220-
test_bit(NETLINK_S_CONGESTED, &nlk->state))) {
1221-
DECLARE_WAITQUEUE(wait, current);
1222-
if (!*timeo) {
1223-
if (!ssk || netlink_is_kernel(ssk))
1224-
netlink_overrun(sk);
1225-
sock_put(sk);
1226-
kfree_skb(skb);
1227-
return -EAGAIN;
1228-
}
1229-
1230-
__set_current_state(TASK_INTERRUPTIBLE);
1231-
add_wait_queue(&nlk->wait, &wait);
1221+
if ((rmem == skb->truesize || rmem < READ_ONCE(sk->sk_rcvbuf)) &&
1222+
!test_bit(NETLINK_S_CONGESTED, &nlk->state)) {
1223+
netlink_skb_set_owner_r(skb, sk);
1224+
return 0;
1225+
}
12321226

1233-
if ((atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf ||
1234-
test_bit(NETLINK_S_CONGESTED, &nlk->state)) &&
1235-
!sock_flag(sk, SOCK_DEAD))
1236-
*timeo = schedule_timeout(*timeo);
1227+
atomic_sub(skb->truesize, &sk->sk_rmem_alloc);
12371228

1238-
__set_current_state(TASK_RUNNING);
1239-
remove_wait_queue(&nlk->wait, &wait);
1229+
if (!*timeo) {
1230+
if (!ssk || netlink_is_kernel(ssk))
1231+
netlink_overrun(sk);
12401232
sock_put(sk);
1233+
kfree_skb(skb);
1234+
return -EAGAIN;
1235+
}
12411236

1242-
if (signal_pending(current)) {
1243-
kfree_skb(skb);
1244-
return sock_intr_errno(*timeo);
1245-
}
1246-
return 1;
1237+
__set_current_state(TASK_INTERRUPTIBLE);
1238+
add_wait_queue(&nlk->wait, &wait);
1239+
rmem = atomic_read(&sk->sk_rmem_alloc);
1240+
1241+
if (((rmem && rmem + skb->truesize > READ_ONCE(sk->sk_rcvbuf)) ||
1242+
test_bit(NETLINK_S_CONGESTED, &nlk->state)) &&
1243+
!sock_flag(sk, SOCK_DEAD))
1244+
*timeo = schedule_timeout(*timeo);
1245+
1246+
__set_current_state(TASK_RUNNING);
1247+
remove_wait_queue(&nlk->wait, &wait);
1248+
sock_put(sk);
1249+
1250+
if (signal_pending(current)) {
1251+
kfree_skb(skb);
1252+
return sock_intr_errno(*timeo);
12471253
}
1248-
netlink_skb_set_owner_r(skb, sk);
1249-
return 0;
1254+
1255+
return 1;
12501256
}
12511257

12521258
static int __netlink_sendskb(struct sock *sk, struct sk_buff *skb)
@@ -1307,6 +1313,7 @@ static int netlink_unicast_kernel(struct sock *sk, struct sk_buff *skb,
13071313
ret = -ECONNREFUSED;
13081314
if (nlk->netlink_rcv != NULL) {
13091315
ret = skb->len;
1316+
atomic_add(skb->truesize, &sk->sk_rmem_alloc);
13101317
netlink_skb_set_owner_r(skb, sk);
13111318
NETLINK_CB(skb).sk = ssk;
13121319
netlink_deliver_tap_kernel(sk, ssk, skb);
@@ -1383,13 +1390,19 @@ EXPORT_SYMBOL_GPL(netlink_strict_get_check);
13831390
static int netlink_broadcast_deliver(struct sock *sk, struct sk_buff *skb)
13841391
{
13851392
struct netlink_sock *nlk = nlk_sk(sk);
1393+
unsigned int rmem, rcvbuf;
13861394

1387-
if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf &&
1395+
rmem = atomic_add_return(skb->truesize, &sk->sk_rmem_alloc);
1396+
rcvbuf = READ_ONCE(sk->sk_rcvbuf);
1397+
1398+
if ((rmem != skb->truesize || rmem <= rcvbuf) &&
13881399
!test_bit(NETLINK_S_CONGESTED, &nlk->state)) {
13891400
netlink_skb_set_owner_r(skb, sk);
13901401
__netlink_sendskb(sk, skb);
1391-
return atomic_read(&sk->sk_rmem_alloc) > (sk->sk_rcvbuf >> 1);
1402+
return rmem > (rcvbuf >> 1);
13921403
}
1404+
1405+
atomic_sub(skb->truesize, &sk->sk_rmem_alloc);
13931406
return -1;
13941407
}
13951408

@@ -2249,6 +2262,7 @@ static int netlink_dump(struct sock *sk, bool lock_taken)
22492262
struct module *module;
22502263
int err = -ENOBUFS;
22512264
int alloc_min_size;
2265+
unsigned int rmem;
22522266
int alloc_size;
22532267

22542268
if (!lock_taken)
@@ -2258,9 +2272,6 @@ static int netlink_dump(struct sock *sk, bool lock_taken)
22582272
goto errout_skb;
22592273
}
22602274

2261-
if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)
2262-
goto errout_skb;
2263-
22642275
/* NLMSG_GOODSIZE is small to avoid high order allocations being
22652276
* required, but it makes sense to _attempt_ a 32KiB allocation
22662277
* to reduce number of system calls on dump operations, if user
@@ -2283,6 +2294,12 @@ static int netlink_dump(struct sock *sk, bool lock_taken)
22832294
if (!skb)
22842295
goto errout_skb;
22852296

2297+
rmem = atomic_add_return(skb->truesize, &sk->sk_rmem_alloc);
2298+
if (rmem >= READ_ONCE(sk->sk_rcvbuf)) {
2299+
atomic_sub(skb->truesize, &sk->sk_rmem_alloc);
2300+
goto errout_skb;
2301+
}
2302+
22862303
/* Trim skb to allocated size. User is expected to provide buffer as
22872304
* large as max(min_dump_alloc, 32KiB (max_recvmsg_len capped at
22882305
* netlink_recvmsg())). dump will pack as many smaller messages as

0 commit comments

Comments
 (0)