Skip to content

Commit 0dd5dd6

Browse files
committed
Merge tag 'net-6.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from bluetooth, wireless and netfilter. No known outstanding regressions. Current release - regressions: - wifi: iwlwifi: fix hibernation - eth: ionic: prevent tx_timeout due to frequent doorbell ringing Previous releases - regressions: - sched: fix sch_fq incorrect behavior for small weights - wifi: - iwlwifi: take the mutex before running link selection - wfx: repair open network AP mode - netfilter: restore IP sanity checks for netdev/egress - tcp: fix forever orphan socket caused by tcp_abort - mptcp: close subflow when receiving TCP+FIN - bluetooth: fix random crash seen while removing btnxpuart driver Previous releases - always broken: - mptcp: more fixes for the in-kernel PM - eth: bonding: change ipsec_lock from spin lock to mutex - eth: mana: fix race of mana_hwc_post_rx_wqe and new hwc response Misc: - documentation: drop special comment style for net code" * tag 'net-6.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (57 commits) nfc: pn533: Add poll mod list filling check mailmap: update entry for Sriram Yagnaraman selftests: mptcp: join: check re-re-adding ID 0 signal mptcp: pm: ADD_ADDR 0 is not a new address selftests: mptcp: join: validate event numbers mptcp: avoid duplicated SUB_CLOSED events selftests: mptcp: join: check re-re-adding ID 0 endp mptcp: pm: fix ID 0 endp usage after multiple re-creations mptcp: pm: do not remove already closed subflows selftests: mptcp: join: no extra msg if no counter selftests: mptcp: join: check re-adding init endp with != id mptcp: pm: reset MPC endp ID when re-added mptcp: pm: skip connecting to already established sf mptcp: pm: send ACK on an active subflow selftests: mptcp: join: check removing ID 0 endpoint mptcp: pm: fix RM_ADDR ID for the initial subflow mptcp: pm: reuse ID 0 after delete and re-add net: busy-poll: use ktime_get_ns() instead of local_clock() sctp: fix association labeling in the duplicate COOKIE-ECHO case mptcp: pr_debug: add missing \n at the end ...
2 parents d5d547a + febccb3 commit 0dd5dd6

52 files changed

Lines changed: 864 additions & 365 deletions

File tree

Some content is hidden

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

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ Simon Kelley <simon@thekelleys.org.uk>
614614
Sricharan Ramabadhran <quic_srichara@quicinc.com> <sricharan@codeaurora.org>
615615
Srinivas Ramana <quic_sramana@quicinc.com> <sramana@codeaurora.org>
616616
Sriram R <quic_srirrama@quicinc.com> <srirrama@codeaurora.org>
617+
Sriram Yagnaraman <sriram.yagnaraman@ericsson.com> <sriram.yagnaraman@est.tech>
617618
Stanislav Fomichev <sdf@fomichev.me> <sdf@google.com>
618619
Stefan Wahren <wahrenst@gmx.net> <stefan.wahren@i2se.com>
619620
Stéphane Witzmann <stephane.witzmann@ubpmes.univ-bpclermont.fr>

Documentation/process/coding-style.rst

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -629,18 +629,6 @@ The preferred style for long (multi-line) comments is:
629629
* with beginning and ending almost-blank lines.
630630
*/
631631
632-
For files in net/ and drivers/net/ the preferred style for long (multi-line)
633-
comments is a little different.
634-
635-
.. code-block:: c
636-
637-
/* The preferred comment style for files in net/ and drivers/net
638-
* looks like this.
639-
*
640-
* It is nearly the same as the generally preferred comment style,
641-
* but there is no initial almost-blank line.
642-
*/
643-
644632
It's also important to comment data, whether they are basic types or derived
645633
types. To this end, use just one data declaration per line (no commas for
646634
multiple data declarations). This leaves you room for a small comment on each

Documentation/process/maintainer-netdev.rst

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -355,23 +355,6 @@ just do it. As a result, a sequence of smaller series gets merged quicker and
355355
with better review coverage. Re-posting large series also increases the mailing
356356
list traffic.
357357

358-
Multi-line comments
359-
~~~~~~~~~~~~~~~~~~~
360-
361-
Comment style convention is slightly different for networking and most of
362-
the tree. Instead of this::
363-
364-
/*
365-
* foobar blah blah blah
366-
* another line of text
367-
*/
368-
369-
it is requested that you make it look like this::
370-
371-
/* foobar blah blah blah
372-
* another line of text
373-
*/
374-
375358
Local variable ordering ("reverse xmas tree", "RCS")
376359
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
377360

drivers/bluetooth/btintel.c

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/acpi.h>
1313
#include <acpi/acpi_bus.h>
1414
#include <asm/unaligned.h>
15+
#include <linux/efi.h>
1516

1617
#include <net/bluetooth/bluetooth.h>
1718
#include <net/bluetooth/hci_core.h>
@@ -26,6 +27,8 @@
2627
#define ECDSA_OFFSET 644
2728
#define ECDSA_HEADER_LEN 320
2829

30+
#define BTINTEL_EFI_DSBR L"UefiCnvCommonDSBR"
31+
2932
enum {
3033
DSM_SET_WDISABLE2_DELAY = 1,
3134
DSM_SET_RESET_METHOD = 3,
@@ -2616,6 +2619,120 @@ static u8 btintel_classify_pkt_type(struct hci_dev *hdev, struct sk_buff *skb)
26162619
return hci_skb_pkt_type(skb);
26172620
}
26182621

2622+
/*
2623+
* UefiCnvCommonDSBR UEFI variable provides information from the OEM platforms
2624+
* if they have replaced the BRI (Bluetooth Radio Interface) resistor to
2625+
* overcome the potential STEP errors on their designs. Based on the
2626+
* configauration, bluetooth firmware shall adjust the BRI response line drive
2627+
* strength. The below structure represents DSBR data.
2628+
* struct {
2629+
* u8 header;
2630+
* u32 dsbr;
2631+
* } __packed;
2632+
*
2633+
* header - defines revision number of the structure
2634+
* dsbr - defines drive strength BRI response
2635+
* bit0
2636+
* 0 - instructs bluetooth firmware to use default values
2637+
* 1 - instructs bluetooth firmware to override default values
2638+
* bit3:1
2639+
* Reserved
2640+
* bit7:4
2641+
* DSBR override values (only if bit0 is set. Default value is 0xF
2642+
* bit31:7
2643+
* Reserved
2644+
* Expected values for dsbr field:
2645+
* 1. 0xF1 - indicates that the resistor on board is 33 Ohm
2646+
* 2. 0x00 or 0xB1 - indicates that the resistor on board is 10 Ohm
2647+
* 3. Non existing UEFI variable or invalid (none of the above) - indicates
2648+
* that the resistor on board is 10 Ohm
2649+
* Even if uefi variable is not present, driver shall send 0xfc0a command to
2650+
* firmware to use default values.
2651+
*
2652+
*/
2653+
static int btintel_uefi_get_dsbr(u32 *dsbr_var)
2654+
{
2655+
struct btintel_dsbr {
2656+
u8 header;
2657+
u32 dsbr;
2658+
} __packed data;
2659+
2660+
efi_status_t status;
2661+
unsigned long data_size = 0;
2662+
efi_guid_t guid = EFI_GUID(0xe65d8884, 0xd4af, 0x4b20, 0x8d, 0x03,
2663+
0x77, 0x2e, 0xcc, 0x3d, 0xa5, 0x31);
2664+
2665+
if (!IS_ENABLED(CONFIG_EFI))
2666+
return -EOPNOTSUPP;
2667+
2668+
if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
2669+
return -EOPNOTSUPP;
2670+
2671+
status = efi.get_variable(BTINTEL_EFI_DSBR, &guid, NULL, &data_size,
2672+
NULL);
2673+
2674+
if (status != EFI_BUFFER_TOO_SMALL || !data_size)
2675+
return -EIO;
2676+
2677+
status = efi.get_variable(BTINTEL_EFI_DSBR, &guid, NULL, &data_size,
2678+
&data);
2679+
2680+
if (status != EFI_SUCCESS)
2681+
return -ENXIO;
2682+
2683+
*dsbr_var = data.dsbr;
2684+
return 0;
2685+
}
2686+
2687+
static int btintel_set_dsbr(struct hci_dev *hdev, struct intel_version_tlv *ver)
2688+
{
2689+
struct btintel_dsbr_cmd {
2690+
u8 enable;
2691+
u8 dsbr;
2692+
} __packed;
2693+
2694+
struct btintel_dsbr_cmd cmd;
2695+
struct sk_buff *skb;
2696+
u8 status;
2697+
u32 dsbr;
2698+
bool apply_dsbr;
2699+
int err;
2700+
2701+
/* DSBR command needs to be sent for BlazarI + B0 step product after
2702+
* downloading IML image.
2703+
*/
2704+
apply_dsbr = (ver->img_type == BTINTEL_IMG_IML &&
2705+
((ver->cnvi_top & 0xfff) == BTINTEL_CNVI_BLAZARI) &&
2706+
INTEL_CNVX_TOP_STEP(ver->cnvi_top) == 0x01);
2707+
2708+
if (!apply_dsbr)
2709+
return 0;
2710+
2711+
dsbr = 0;
2712+
err = btintel_uefi_get_dsbr(&dsbr);
2713+
if (err < 0)
2714+
bt_dev_dbg(hdev, "Error reading efi: %ls (%d)",
2715+
BTINTEL_EFI_DSBR, err);
2716+
2717+
cmd.enable = dsbr & BIT(0);
2718+
cmd.dsbr = dsbr >> 4 & 0xF;
2719+
2720+
bt_dev_info(hdev, "dsbr: enable: 0x%2.2x value: 0x%2.2x", cmd.enable,
2721+
cmd.dsbr);
2722+
2723+
skb = __hci_cmd_sync(hdev, 0xfc0a, sizeof(cmd), &cmd, HCI_CMD_TIMEOUT);
2724+
if (IS_ERR(skb))
2725+
return -bt_to_errno(PTR_ERR(skb));
2726+
2727+
status = skb->data[0];
2728+
kfree_skb(skb);
2729+
2730+
if (status)
2731+
return -bt_to_errno(status);
2732+
2733+
return 0;
2734+
}
2735+
26192736
int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
26202737
struct intel_version_tlv *ver)
26212738
{
@@ -2650,6 +2767,13 @@ int btintel_bootloader_setup_tlv(struct hci_dev *hdev,
26502767
if (err)
26512768
return err;
26522769

2770+
/* set drive strength of BRI response */
2771+
err = btintel_set_dsbr(hdev, ver);
2772+
if (err) {
2773+
bt_dev_err(hdev, "Failed to send dsbr command (%d)", err);
2774+
return err;
2775+
}
2776+
26532777
/* If image type returned is BTINTEL_IMG_IML, then controller supports
26542778
* intermediate loader image
26552779
*/

drivers/bluetooth/btnxpuart.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,23 @@ static bool ps_wakeup(struct btnxpuart_dev *nxpdev)
449449
return false;
450450
}
451451

452+
static void ps_cleanup(struct btnxpuart_dev *nxpdev)
453+
{
454+
struct ps_data *psdata = &nxpdev->psdata;
455+
u8 ps_state;
456+
457+
mutex_lock(&psdata->ps_lock);
458+
ps_state = psdata->ps_state;
459+
mutex_unlock(&psdata->ps_lock);
460+
461+
if (ps_state != PS_STATE_AWAKE)
462+
ps_control(psdata->hdev, PS_STATE_AWAKE);
463+
464+
ps_cancel_timer(nxpdev);
465+
cancel_work_sync(&psdata->work);
466+
mutex_destroy(&psdata->ps_lock);
467+
}
468+
452469
static int send_ps_cmd(struct hci_dev *hdev, void *data)
453470
{
454471
struct btnxpuart_dev *nxpdev = hci_get_drvdata(hdev);
@@ -1363,7 +1380,6 @@ static int btnxpuart_close(struct hci_dev *hdev)
13631380
{
13641381
struct btnxpuart_dev *nxpdev = hci_get_drvdata(hdev);
13651382

1366-
ps_wakeup(nxpdev);
13671383
serdev_device_close(nxpdev->serdev);
13681384
skb_queue_purge(&nxpdev->txq);
13691385
if (!IS_ERR_OR_NULL(nxpdev->rx_skb)) {
@@ -1516,8 +1532,8 @@ static void nxp_serdev_remove(struct serdev_device *serdev)
15161532
nxpdev->new_baudrate = nxpdev->fw_init_baudrate;
15171533
nxp_set_baudrate_cmd(hdev, NULL);
15181534
}
1519-
ps_cancel_timer(nxpdev);
15201535
}
1536+
ps_cleanup(nxpdev);
15211537
hci_unregister_dev(hdev);
15221538
hci_free_dev(hdev);
15231539
}

0 commit comments

Comments
 (0)