Skip to content

Commit 608f1b1

Browse files
committed
Merge tag 'net-6.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Jakub Kicinski: "Including fixes from bpf, wifi and bluetooth. Current release - regressions: - wifi: mt76: mt7915: add back 160MHz channel width support for MT7915 - libbpf: revert poisoning of strlcpy, it broke uClibc-ng Current release - new code bugs: - bpf: improve the coverage of the "allow reads from uninit stack" feature to fix verification complexity problems - eth: am65-cpts: reset PPS genf adj settings on enable Previous releases - regressions: - wifi: mac80211: serialize ieee80211_handle_wake_tx_queue() - wifi: mt76: do not run mt76_unregister_device() on unregistered hw, fix null-deref - Bluetooth: btqcomsmd: fix command timeout after setting BD address - eth: igb: revert rtnl_lock() that causes a deadlock - dsa: mscc: ocelot: fix device specific statistics Previous releases - always broken: - xsk: add missing overflow check in xdp_umem_reg() - wifi: mac80211: - fix QoS on mesh interfaces - fix mesh path discovery based on unicast packets - Bluetooth: - ISO: fix timestamped HCI ISO data packet parsing - remove "Power-on" check from Mesh feature - usbnet: more fixes to drivers trusting packet length - wifi: iwlwifi: mvm: fix mvmtxq->stopped handling - Bluetooth: btintel: iterate only bluetooth device ACPI entries - eth: iavf: fix inverted Rx hash condition leading to disabled hash - eth: igc: fix the validation logic for taprio's gate list - dsa: tag_brcm: legacy: fix daisy-chained switches Misc: - bpf: adjust insufficient default bpf_jit_limit to account for growth of BPF use over the last 5 years - xdp: bpf_xdp_metadata() use EOPNOTSUPP as unique errno indicating no driver support" * tag 'net-6.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (84 commits) Bluetooth: HCI: Fix global-out-of-bounds Bluetooth: mgmt: Fix MGMT add advmon with RSSI command Bluetooth: btsdio: fix use after free bug in btsdio_remove due to unfinished work Bluetooth: L2CAP: Fix responding with wrong PDU type Bluetooth: btqcomsmd: Fix command timeout after setting BD address Bluetooth: btinel: Check ACPI handle for NULL before accessing net: mdio: thunder: Add missing fwnode_handle_put() net: dsa: mt7530: move setting ssc_delta to PHY_INTERFACE_MODE_TRGMII case net: dsa: mt7530: move lowering TRGMII driving to mt7530_setup() net: dsa: mt7530: move enabling disabling core clock to mt7530_pll_setup() net: asix: fix modprobe "sysfs: cannot create duplicate filename" gve: Cache link_speed value from device tools: ynl: Fix genlmsg header encoding formats net: enetc: fix aggregate RMON counters not showing the ranges Bluetooth: Remove "Power-on" check from Mesh feature Bluetooth: Fix race condition in hci_cmd_sync_clear Bluetooth: btintel: Iterate only bluetooth device ACPI entries Bluetooth: ISO: fix timestamped HCI ISO data packet parsing Bluetooth: btusb: Remove detection of ISO packets over bulk Bluetooth: hci_core: Detect if an ACL packet is in fact an ISO packet ...
2 parents 2850630 + 1b4ae19 commit 608f1b1

File tree

106 files changed

+980
-579
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+980
-579
lines changed

Documentation/networking/xdp-rx-metadata.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ metadata is supported, this set will grow:
2323
An XDP program can use these kfuncs to read the metadata into stack
2424
variables for its own consumption. Or, to pass the metadata on to other
2525
consumers, an XDP program can store it into the metadata area carried
26-
ahead of the packet.
26+
ahead of the packet. Not all packets will necessary have the requested
27+
metadata available in which case the driver returns ``-ENODATA``.
2728

2829
Not all kfuncs have to be implemented by the device driver; when not
29-
implemented, the default ones that return ``-EOPNOTSUPP`` will be used.
30+
implemented, the default ones that return ``-EOPNOTSUPP`` will be used
31+
to indicate the device driver have not implemented this kfunc.
32+
3033

3134
Within an XDP frame, the metadata layout (accessed via ``xdp_buff``) is
3235
as follows::

drivers/atm/idt77252.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2909,6 +2909,7 @@ close_card_oam(struct idt77252_dev *card)
29092909

29102910
recycle_rx_pool_skb(card, &vc->rcv.rx_pool);
29112911
}
2912+
kfree(vc);
29122913
}
29132914
}
29142915
}
@@ -2952,6 +2953,15 @@ open_card_ubr0(struct idt77252_dev *card)
29522953
return 0;
29532954
}
29542955

2956+
static void
2957+
close_card_ubr0(struct idt77252_dev *card)
2958+
{
2959+
struct vc_map *vc = card->vcs[0];
2960+
2961+
free_scq(card, vc->scq);
2962+
kfree(vc);
2963+
}
2964+
29552965
static int
29562966
idt77252_dev_open(struct idt77252_dev *card)
29572967
{
@@ -3001,6 +3011,7 @@ static void idt77252_dev_close(struct atm_dev *dev)
30013011
struct idt77252_dev *card = dev->dev_data;
30023012
u32 conf;
30033013

3014+
close_card_ubr0(card);
30043015
close_card_oam(card);
30053016

30063017
conf = SAR_CFG_RXPTH | /* enable receive path */

drivers/bluetooth/btintel.c

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@
2626
#define ECDSA_HEADER_LEN 320
2727

2828
#define BTINTEL_PPAG_NAME "PPAG"
29-
#define BTINTEL_PPAG_PREFIX "\\_SB_.PCI0.XHCI.RHUB"
29+
30+
/* structure to store the PPAG data read from ACPI table */
31+
struct btintel_ppag {
32+
u32 domain;
33+
u32 mode;
34+
acpi_status status;
35+
struct hci_dev *hdev;
36+
};
3037

3138
#define CMD_WRITE_BOOT_PARAMS 0xfc0e
3239
struct cmd_write_boot_params {
@@ -1295,17 +1302,16 @@ static acpi_status btintel_ppag_callback(acpi_handle handle, u32 lvl, void *data
12951302

12961303
status = acpi_get_name(handle, ACPI_FULL_PATHNAME, &string);
12971304
if (ACPI_FAILURE(status)) {
1298-
bt_dev_warn(hdev, "ACPI Failure: %s", acpi_format_exception(status));
1305+
bt_dev_warn(hdev, "PPAG-BT: ACPI Failure: %s", acpi_format_exception(status));
12991306
return status;
13001307
}
13011308

1302-
if (strncmp(BTINTEL_PPAG_PREFIX, string.pointer,
1303-
strlen(BTINTEL_PPAG_PREFIX))) {
1309+
len = strlen(string.pointer);
1310+
if (len < strlen(BTINTEL_PPAG_NAME)) {
13041311
kfree(string.pointer);
13051312
return AE_OK;
13061313
}
13071314

1308-
len = strlen(string.pointer);
13091315
if (strncmp((char *)string.pointer + len - 4, BTINTEL_PPAG_NAME, 4)) {
13101316
kfree(string.pointer);
13111317
return AE_OK;
@@ -1314,7 +1320,8 @@ static acpi_status btintel_ppag_callback(acpi_handle handle, u32 lvl, void *data
13141320

13151321
status = acpi_evaluate_object(handle, NULL, NULL, &buffer);
13161322
if (ACPI_FAILURE(status)) {
1317-
bt_dev_warn(hdev, "ACPI Failure: %s", acpi_format_exception(status));
1323+
ppag->status = status;
1324+
bt_dev_warn(hdev, "PPAG-BT: ACPI Failure: %s", acpi_format_exception(status));
13181325
return status;
13191326
}
13201327

@@ -1323,8 +1330,9 @@ static acpi_status btintel_ppag_callback(acpi_handle handle, u32 lvl, void *data
13231330

13241331
if (p->type != ACPI_TYPE_PACKAGE || p->package.count != 2) {
13251332
kfree(buffer.pointer);
1326-
bt_dev_warn(hdev, "Invalid object type: %d or package count: %d",
1333+
bt_dev_warn(hdev, "PPAG-BT: Invalid object type: %d or package count: %d",
13271334
p->type, p->package.count);
1335+
ppag->status = AE_ERROR;
13281336
return AE_ERROR;
13291337
}
13301338

@@ -1335,6 +1343,7 @@ static acpi_status btintel_ppag_callback(acpi_handle handle, u32 lvl, void *data
13351343

13361344
ppag->domain = (u32)p->package.elements[0].integer.value;
13371345
ppag->mode = (u32)p->package.elements[1].integer.value;
1346+
ppag->status = AE_OK;
13381347
kfree(buffer.pointer);
13391348
return AE_CTRL_TERMINATE;
13401349
}
@@ -2314,42 +2323,48 @@ static int btintel_configure_offload(struct hci_dev *hdev)
23142323

23152324
static void btintel_set_ppag(struct hci_dev *hdev, struct intel_version_tlv *ver)
23162325
{
2317-
acpi_status status;
23182326
struct btintel_ppag ppag;
23192327
struct sk_buff *skb;
23202328
struct btintel_loc_aware_reg ppag_cmd;
2329+
acpi_handle handle;
23212330

2322-
/* PPAG is not supported if CRF is HrP2, Jfp2, JfP1 */
2331+
/* PPAG is not supported if CRF is HrP2, Jfp2, JfP1 */
23232332
switch (ver->cnvr_top & 0xFFF) {
23242333
case 0x504: /* Hrp2 */
23252334
case 0x202: /* Jfp2 */
23262335
case 0x201: /* Jfp1 */
23272336
return;
23282337
}
23292338

2339+
handle = ACPI_HANDLE(GET_HCIDEV_DEV(hdev));
2340+
if (!handle) {
2341+
bt_dev_info(hdev, "No support for BT device in ACPI firmware");
2342+
return;
2343+
}
2344+
23302345
memset(&ppag, 0, sizeof(ppag));
23312346

23322347
ppag.hdev = hdev;
2333-
status = acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
2334-
ACPI_UINT32_MAX, NULL,
2335-
btintel_ppag_callback, &ppag, NULL);
2348+
ppag.status = AE_NOT_FOUND;
2349+
acpi_walk_namespace(ACPI_TYPE_PACKAGE, handle, 1, NULL,
2350+
btintel_ppag_callback, &ppag, NULL);
23362351

2337-
if (ACPI_FAILURE(status)) {
2338-
/* Do not log warning message if ACPI entry is not found */
2339-
if (status == AE_NOT_FOUND)
2352+
if (ACPI_FAILURE(ppag.status)) {
2353+
if (ppag.status == AE_NOT_FOUND) {
2354+
bt_dev_dbg(hdev, "PPAG-BT: ACPI entry not found");
23402355
return;
2341-
bt_dev_warn(hdev, "PPAG: ACPI Failure: %s", acpi_format_exception(status));
2356+
}
23422357
return;
23432358
}
23442359

23452360
if (ppag.domain != 0x12) {
2346-
bt_dev_warn(hdev, "PPAG-BT Domain disabled");
2361+
bt_dev_warn(hdev, "PPAG-BT: domain is not bluetooth");
23472362
return;
23482363
}
23492364

23502365
/* PPAG mode, BIT0 = 0 Disabled, BIT0 = 1 Enabled */
23512366
if (!(ppag.mode & BIT(0))) {
2352-
bt_dev_dbg(hdev, "PPAG disabled");
2367+
bt_dev_dbg(hdev, "PPAG-BT: disabled");
23532368
return;
23542369
}
23552370

drivers/bluetooth/btintel.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,6 @@ struct intel_offload_use_cases {
137137
__u8 preset[8];
138138
} __packed;
139139

140-
/* structure to store the PPAG data read from ACPI table */
141-
struct btintel_ppag {
142-
u32 domain;
143-
u32 mode;
144-
struct hci_dev *hdev;
145-
};
146-
147140
struct btintel_loc_aware_reg {
148141
__le32 mcc;
149142
__le32 sel;

drivers/bluetooth/btqcomsmd.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,21 @@ static int btqcomsmd_setup(struct hci_dev *hdev)
122122
return 0;
123123
}
124124

125+
static int btqcomsmd_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
126+
{
127+
int ret;
128+
129+
ret = qca_set_bdaddr_rome(hdev, bdaddr);
130+
if (ret)
131+
return ret;
132+
133+
/* The firmware stops responding for a while after setting the bdaddr,
134+
* causing timeouts for subsequent commands. Sleep a bit to avoid this.
135+
*/
136+
usleep_range(1000, 10000);
137+
return 0;
138+
}
139+
125140
static int btqcomsmd_probe(struct platform_device *pdev)
126141
{
127142
struct btqcomsmd *btq;
@@ -162,7 +177,7 @@ static int btqcomsmd_probe(struct platform_device *pdev)
162177
hdev->close = btqcomsmd_close;
163178
hdev->send = btqcomsmd_send;
164179
hdev->setup = btqcomsmd_setup;
165-
hdev->set_bdaddr = qca_set_bdaddr_rome;
180+
hdev->set_bdaddr = btqcomsmd_set_bdaddr;
166181

167182
ret = hci_register_dev(hdev);
168183
if (ret < 0)

drivers/bluetooth/btsdio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ static void btsdio_remove(struct sdio_func *func)
354354

355355
BT_DBG("func %p", func);
356356

357+
cancel_work_sync(&data->work);
357358
if (!data)
358359
return;
359360

drivers/bluetooth/btusb.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,21 +1050,11 @@ static int btusb_recv_bulk(struct btusb_data *data, void *buffer, int count)
10501050
hci_skb_expect(skb) -= len;
10511051

10521052
if (skb->len == HCI_ACL_HDR_SIZE) {
1053-
__u16 handle = __le16_to_cpu(hci_acl_hdr(skb)->handle);
10541053
__le16 dlen = hci_acl_hdr(skb)->dlen;
1055-
__u8 type;
10561054

10571055
/* Complete ACL header */
10581056
hci_skb_expect(skb) = __le16_to_cpu(dlen);
10591057

1060-
/* Detect if ISO packet has been sent over bulk */
1061-
if (hci_conn_num(data->hdev, ISO_LINK)) {
1062-
type = hci_conn_lookup_type(data->hdev,
1063-
hci_handle(handle));
1064-
if (type == ISO_LINK)
1065-
hci_skb_pkt_type(skb) = HCI_ISODATA_PKT;
1066-
}
1067-
10681058
if (skb_tailroom(skb) < hci_skb_expect(skb)) {
10691059
kfree_skb(skb);
10701060
skb = NULL;

drivers/net/dsa/b53/b53_mmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ static int b53_mmap_probe_of(struct platform_device *pdev,
263263
if (of_property_read_u32(of_port, "reg", &reg))
264264
continue;
265265

266-
if (reg < B53_CPU_PORT)
266+
if (reg < B53_N_PORTS)
267267
pdata->enabled_ports |= BIT(reg);
268268
}
269269

drivers/net/dsa/mt7530.c

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,9 @@ mt7530_fdb_write(struct mt7530_priv *priv, u16 vid,
396396
/* Set up switch core clock for MT7530 */
397397
static void mt7530_pll_setup(struct mt7530_priv *priv)
398398
{
399+
/* Disable core clock */
400+
core_clear(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN);
401+
399402
/* Disable PLL */
400403
core_write(priv, CORE_GSWPLL_GRP1, 0);
401404

@@ -409,14 +412,19 @@ static void mt7530_pll_setup(struct mt7530_priv *priv)
409412
RG_GSWPLL_EN_PRE |
410413
RG_GSWPLL_POSDIV_200M(2) |
411414
RG_GSWPLL_FBKDIV_200M(32));
415+
416+
udelay(20);
417+
418+
/* Enable core clock */
419+
core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN);
412420
}
413421

414-
/* Setup TX circuit including relevant PAD and driving */
422+
/* Setup port 6 interface mode and TRGMII TX circuit */
415423
static int
416424
mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface)
417425
{
418426
struct mt7530_priv *priv = ds->priv;
419-
u32 ncpo1, ssc_delta, trgint, i, xtal;
427+
u32 ncpo1, ssc_delta, trgint, xtal;
420428

421429
xtal = mt7530_read(priv, MT7530_MHWTRAP) & HWTRAP_XTAL_MASK;
422430

@@ -433,6 +441,10 @@ mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface)
433441
break;
434442
case PHY_INTERFACE_MODE_TRGMII:
435443
trgint = 1;
444+
if (xtal == HWTRAP_XTAL_25MHZ)
445+
ssc_delta = 0x57;
446+
else
447+
ssc_delta = 0x87;
436448
if (priv->id == ID_MT7621) {
437449
/* PLL frequency: 150MHz: 1.2GBit */
438450
if (xtal == HWTRAP_XTAL_40MHZ)
@@ -452,23 +464,12 @@ mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface)
452464
return -EINVAL;
453465
}
454466

455-
if (xtal == HWTRAP_XTAL_25MHZ)
456-
ssc_delta = 0x57;
457-
else
458-
ssc_delta = 0x87;
459-
460467
mt7530_rmw(priv, MT7530_P6ECR, P6_INTF_MODE_MASK,
461468
P6_INTF_MODE(trgint));
462469

463470
if (trgint) {
464-
/* Lower Tx Driving for TRGMII path */
465-
for (i = 0 ; i < NUM_TRGMII_CTRL ; i++)
466-
mt7530_write(priv, MT7530_TRGMII_TD_ODT(i),
467-
TD_DM_DRVP(8) | TD_DM_DRVN(8));
468-
469-
/* Disable MT7530 core and TRGMII Tx clocks */
470-
core_clear(priv, CORE_TRGMII_GSW_CLK_CG,
471-
REG_GSWCK_EN | REG_TRGMIICK_EN);
471+
/* Disable the MT7530 TRGMII clocks */
472+
core_clear(priv, CORE_TRGMII_GSW_CLK_CG, REG_TRGMIICK_EN);
472473

473474
/* Setup the MT7530 TRGMII Tx Clock */
474475
core_write(priv, CORE_PLL_GROUP5, RG_LCDDS_PCW_NCPO1(ncpo1));
@@ -485,13 +486,8 @@ mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface)
485486
RG_LCDDS_PCW_NCPO_CHG | RG_LCCDS_C(3) |
486487
RG_LCDDS_PWDB | RG_LCDDS_ISO_EN);
487488

488-
/* Enable MT7530 core and TRGMII Tx clocks */
489-
core_set(priv, CORE_TRGMII_GSW_CLK_CG,
490-
REG_GSWCK_EN | REG_TRGMIICK_EN);
491-
} else {
492-
for (i = 0 ; i < NUM_TRGMII_CTRL; i++)
493-
mt7530_rmw(priv, MT7530_TRGMII_RD(i),
494-
RD_TAP_MASK, RD_TAP(16));
489+
/* Enable the MT7530 TRGMII clocks */
490+
core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_TRGMIICK_EN);
495491
}
496492

497493
return 0;
@@ -2201,6 +2197,15 @@ mt7530_setup(struct dsa_switch *ds)
22012197

22022198
mt7530_pll_setup(priv);
22032199

2200+
/* Lower Tx driving for TRGMII path */
2201+
for (i = 0; i < NUM_TRGMII_CTRL; i++)
2202+
mt7530_write(priv, MT7530_TRGMII_TD_ODT(i),
2203+
TD_DM_DRVP(8) | TD_DM_DRVN(8));
2204+
2205+
for (i = 0; i < NUM_TRGMII_CTRL; i++)
2206+
mt7530_rmw(priv, MT7530_TRGMII_RD(i),
2207+
RD_TAP_MASK, RD_TAP(16));
2208+
22042209
/* Enable port 6 */
22052210
val = mt7530_read(priv, MT7530_MHWTRAP);
22062211
val &= ~MHWTRAP_P6_DIS & ~MHWTRAP_PHY_ACCESS;

drivers/net/ethernet/freescale/enetc/enetc_ethtool.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,7 @@ static const struct ethtool_rmon_hist_range enetc_rmon_ranges[] = {
370370
};
371371

372372
static void enetc_rmon_stats(struct enetc_hw *hw, int mac,
373-
struct ethtool_rmon_stats *s,
374-
const struct ethtool_rmon_hist_range **ranges)
373+
struct ethtool_rmon_stats *s)
375374
{
376375
s->undersize_pkts = enetc_port_rd(hw, ENETC_PM_RUND(mac));
377376
s->oversize_pkts = enetc_port_rd(hw, ENETC_PM_ROVR(mac));
@@ -393,8 +392,6 @@ static void enetc_rmon_stats(struct enetc_hw *hw, int mac,
393392
s->hist_tx[4] = enetc_port_rd(hw, ENETC_PM_T1023(mac));
394393
s->hist_tx[5] = enetc_port_rd(hw, ENETC_PM_T1522(mac));
395394
s->hist_tx[6] = enetc_port_rd(hw, ENETC_PM_T1523X(mac));
396-
397-
*ranges = enetc_rmon_ranges;
398395
}
399396

400397
static void enetc_get_eth_mac_stats(struct net_device *ndev,
@@ -447,13 +444,15 @@ static void enetc_get_rmon_stats(struct net_device *ndev,
447444
struct enetc_hw *hw = &priv->si->hw;
448445
struct enetc_si *si = priv->si;
449446

447+
*ranges = enetc_rmon_ranges;
448+
450449
switch (rmon_stats->src) {
451450
case ETHTOOL_MAC_STATS_SRC_EMAC:
452-
enetc_rmon_stats(hw, 0, rmon_stats, ranges);
451+
enetc_rmon_stats(hw, 0, rmon_stats);
453452
break;
454453
case ETHTOOL_MAC_STATS_SRC_PMAC:
455454
if (si->hw_features & ENETC_SI_F_QBU)
456-
enetc_rmon_stats(hw, 1, rmon_stats, ranges);
455+
enetc_rmon_stats(hw, 1, rmon_stats);
457456
break;
458457
case ETHTOOL_MAC_STATS_SRC_AGGREGATE:
459458
ethtool_aggregate_rmon_stats(ndev, rmon_stats);

0 commit comments

Comments
 (0)