From 293814bb4958d7d17650d7d18e59d0fbe1b501b1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 3 Jan 2024 12:27:54 +0100 Subject: [PATCH] 5.10-stable patches added patches: bluetooth-smp-fix-crash-when-receiving-new-connection-when-debug-is-enabled.patch spi-atmel-fix-pdc-transfer-setup-bug.patch --- ...new-connection-when-debug-is-enabled.patch | 50 +++++++++++++++++++ queue-5.10/series | 2 + ...spi-atmel-fix-pdc-transfer-setup-bug.patch | 45 +++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 queue-5.10/bluetooth-smp-fix-crash-when-receiving-new-connection-when-debug-is-enabled.patch create mode 100644 queue-5.10/spi-atmel-fix-pdc-transfer-setup-bug.patch diff --git a/queue-5.10/bluetooth-smp-fix-crash-when-receiving-new-connection-when-debug-is-enabled.patch b/queue-5.10/bluetooth-smp-fix-crash-when-receiving-new-connection-when-debug-is-enabled.patch new file mode 100644 index 00000000000..53bb8ccb910 --- /dev/null +++ b/queue-5.10/bluetooth-smp-fix-crash-when-receiving-new-connection-when-debug-is-enabled.patch @@ -0,0 +1,50 @@ +From 995fca15b73ff8f92888cc2d5d95f17ffdac74ba Mon Sep 17 00:00:00 2001 +From: Luiz Augusto von Dentz +Date: Mon, 14 Jun 2021 10:46:44 -0700 +Subject: Bluetooth: SMP: Fix crash when receiving new connection when debug is enabled + +From: Luiz Augusto von Dentz + +commit 995fca15b73ff8f92888cc2d5d95f17ffdac74ba upstream. + +When receiving a new connection pchan->conn won't be initialized so the +code cannot use bt_dev_dbg as the pointer to hci_dev won't be +accessible. + +Fixes: 2e1614f7d61e4 ("Bluetooth: SMP: Convert BT_ERR/BT_DBG to bt_dev_err/bt_dev_dbg") +Signed-off-by: Luiz Augusto von Dentz +Signed-off-by: Marcel Holtmann +Signed-off-by: Greg Kroah-Hartman +--- + net/bluetooth/smp.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/net/bluetooth/smp.c ++++ b/net/bluetooth/smp.c +@@ -3239,7 +3239,7 @@ static inline struct l2cap_chan *smp_new + { + struct l2cap_chan *chan; + +- bt_dev_dbg(pchan->conn->hcon->hdev, "pchan %p", pchan); ++ BT_DBG("pchan %p", pchan); + + chan = l2cap_chan_create(); + if (!chan) +@@ -3260,7 +3260,7 @@ static inline struct l2cap_chan *smp_new + */ + atomic_set(&chan->nesting, L2CAP_NESTING_SMP); + +- bt_dev_dbg(pchan->conn->hcon->hdev, "created chan %p", chan); ++ BT_DBG("created chan %p", chan); + + return chan; + } +@@ -3364,7 +3364,7 @@ static void smp_del_chan(struct l2cap_ch + { + struct smp_dev *smp; + +- bt_dev_dbg(chan->conn->hcon->hdev, "chan %p", chan); ++ BT_DBG("chan %p", chan); + + smp = chan->data; + if (smp) { diff --git a/queue-5.10/series b/queue-5.10/series index 120da5f45df..33437af1383 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -71,3 +71,5 @@ netfilter-nf_tables-skip-set-commit-for-deleted-destroyed-sets.patch dm-integrity-don-t-modify-bio-s-immutable-bio_vec-in-integrity_metadata.patch tracing-kprobes-return-eaddrnotavail-when-func-matches-several-symbols.patch revert-mips-loongson64-enable-dma-noncoherent-support.patch +bluetooth-smp-fix-crash-when-receiving-new-connection-when-debug-is-enabled.patch +spi-atmel-fix-pdc-transfer-setup-bug.patch diff --git a/queue-5.10/spi-atmel-fix-pdc-transfer-setup-bug.patch b/queue-5.10/spi-atmel-fix-pdc-transfer-setup-bug.patch new file mode 100644 index 00000000000..0334e006ff3 --- /dev/null +++ b/queue-5.10/spi-atmel-fix-pdc-transfer-setup-bug.patch @@ -0,0 +1,45 @@ +From 75e33c55ae8fb4a177fe07c284665e1d61b02560 Mon Sep 17 00:00:00 2001 +From: Ville Baillie +Date: Tue, 21 Sep 2021 07:21:32 +0000 +Subject: spi: atmel: Fix PDC transfer setup bug + +From: Ville Baillie + +commit 75e33c55ae8fb4a177fe07c284665e1d61b02560 upstream. + +atmel_spi_dma_map_xfer to never be called in PDC mode. This causes the +driver to silently fail. + +This patch changes the conditional to match the behaviour of the +previous commit before the refactor. + +Fixes: 5fa5e6dec762 ("spi: atmel: Switch to transfer_one transfer method") +Signed-off-by: Ville Baillie +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20210921072132.21831-1-villeb@bytesnap.co.uk +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/spi/spi-atmel.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/spi/spi-atmel.c ++++ b/drivers/spi/spi-atmel.c +@@ -1315,7 +1315,7 @@ static int atmel_spi_one_transfer(struct + * DMA map early, for performance (empties dcache ASAP) and + * better fault reporting. + */ +- if ((!master->cur_msg_mapped) ++ if ((!master->cur_msg->is_dma_mapped) + && as->use_pdc) { + if (atmel_spi_dma_map_xfer(as, xfer) < 0) + return -ENOMEM; +@@ -1394,7 +1394,7 @@ static int atmel_spi_one_transfer(struct + } + } + +- if (!master->cur_msg_mapped ++ if (!master->cur_msg->is_dma_mapped + && as->use_pdc) + atmel_spi_dma_unmap_xfer(master, xfer); + -- 2.47.3