Skip to content

Commit 6d732e8

Browse files
committed
Merge tag 'nvme-6.15-2025-05-01' of git://git.infradead.org/nvme into block-6.15
Pull NVMe fixes from Christoph: "nvme fixes for Linux 6.15 - fix queue unquiesce check on PCI slot_reset (Keith Busch) - fix premature queue removal and I/O failover in nvme-tcp (Michael Liang) - don't restore null sk_state_change (Alistair Francis) - select CONFIG_TLS where needed (Alistair Francis) - always free derived key data (Hannes Reinecke) - more quirks (Wentao Guan)" * tag 'nvme-6.15-2025-05-01' of git://git.infradead.org/nvme: nvmet-auth: always free derived key data nvmet-tcp: don't restore null sk_state_change nvmet-tcp: select CONFIG_TLS from CONFIG_NVME_TARGET_TCP_TLS nvme-tcp: select CONFIG_TLS from CONFIG_NVME_TCP_TLS nvme-tcp: fix premature queue removal and I/O failover nvme-pci: add quirks for WDC Blue SN550 15b7:5009 nvme-pci: add quirks for device 126f:1001 nvme-pci: fix queue unquiesce check on slot_reset
2 parents a584b26 + 8edb86b commit 6d732e8

File tree

6 files changed

+42
-5
lines changed

6 files changed

+42
-5
lines changed

drivers/nvme/host/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ config NVME_TCP_TLS
102102
depends on NVME_TCP
103103
select NET_HANDSHAKE
104104
select KEYS
105+
select TLS
105106
help
106107
Enables TLS encryption for NVMe TCP using the netlink handshake API.
107108

drivers/nvme/host/pci.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3575,7 +3575,7 @@ static pci_ers_result_t nvme_slot_reset(struct pci_dev *pdev)
35753575

35763576
dev_info(dev->ctrl.device, "restart after slot reset\n");
35773577
pci_restore_state(pdev);
3578-
if (!nvme_try_sched_reset(&dev->ctrl))
3578+
if (nvme_try_sched_reset(&dev->ctrl))
35793579
nvme_unquiesce_io_queues(&dev->ctrl);
35803580
return PCI_ERS_RESULT_RECOVERED;
35813581
}
@@ -3623,6 +3623,9 @@ static const struct pci_device_id nvme_id_table[] = {
36233623
.driver_data = NVME_QUIRK_BOGUS_NID, },
36243624
{ PCI_DEVICE(0x1217, 0x8760), /* O2 Micro 64GB Steam Deck */
36253625
.driver_data = NVME_QUIRK_DMAPOOL_ALIGN_512, },
3626+
{ PCI_DEVICE(0x126f, 0x1001), /* Silicon Motion generic */
3627+
.driver_data = NVME_QUIRK_NO_DEEPEST_PS |
3628+
NVME_QUIRK_IGNORE_DEV_SUBNQN, },
36263629
{ PCI_DEVICE(0x126f, 0x2262), /* Silicon Motion generic */
36273630
.driver_data = NVME_QUIRK_NO_DEEPEST_PS |
36283631
NVME_QUIRK_BOGUS_NID, },
@@ -3646,6 +3649,9 @@ static const struct pci_device_id nvme_id_table[] = {
36463649
NVME_QUIRK_IGNORE_DEV_SUBNQN, },
36473650
{ PCI_DEVICE(0x15b7, 0x5008), /* Sandisk SN530 */
36483651
.driver_data = NVME_QUIRK_BROKEN_MSI },
3652+
{ PCI_DEVICE(0x15b7, 0x5009), /* Sandisk SN550 */
3653+
.driver_data = NVME_QUIRK_BROKEN_MSI |
3654+
NVME_QUIRK_NO_DEEPEST_PS },
36493655
{ PCI_DEVICE(0x1987, 0x5012), /* Phison E12 */
36503656
.driver_data = NVME_QUIRK_BOGUS_NID, },
36513657
{ PCI_DEVICE(0x1987, 0x5016), /* Phison E16 */

drivers/nvme/host/tcp.c

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,7 +1946,7 @@ static void __nvme_tcp_stop_queue(struct nvme_tcp_queue *queue)
19461946
cancel_work_sync(&queue->io_work);
19471947
}
19481948

1949-
static void nvme_tcp_stop_queue(struct nvme_ctrl *nctrl, int qid)
1949+
static void nvme_tcp_stop_queue_nowait(struct nvme_ctrl *nctrl, int qid)
19501950
{
19511951
struct nvme_tcp_ctrl *ctrl = to_tcp_ctrl(nctrl);
19521952
struct nvme_tcp_queue *queue = &ctrl->queues[qid];
@@ -1965,6 +1965,31 @@ static void nvme_tcp_stop_queue(struct nvme_ctrl *nctrl, int qid)
19651965
mutex_unlock(&queue->queue_lock);
19661966
}
19671967

1968+
static void nvme_tcp_wait_queue(struct nvme_ctrl *nctrl, int qid)
1969+
{
1970+
struct nvme_tcp_ctrl *ctrl = to_tcp_ctrl(nctrl);
1971+
struct nvme_tcp_queue *queue = &ctrl->queues[qid];
1972+
int timeout = 100;
1973+
1974+
while (timeout > 0) {
1975+
if (!test_bit(NVME_TCP_Q_ALLOCATED, &queue->flags) ||
1976+
!sk_wmem_alloc_get(queue->sock->sk))
1977+
return;
1978+
msleep(2);
1979+
timeout -= 2;
1980+
}
1981+
dev_warn(nctrl->device,
1982+
"qid %d: timeout draining sock wmem allocation expired\n",
1983+
qid);
1984+
}
1985+
1986+
static void nvme_tcp_stop_queue(struct nvme_ctrl *nctrl, int qid)
1987+
{
1988+
nvme_tcp_stop_queue_nowait(nctrl, qid);
1989+
nvme_tcp_wait_queue(nctrl, qid);
1990+
}
1991+
1992+
19681993
static void nvme_tcp_setup_sock_ops(struct nvme_tcp_queue *queue)
19691994
{
19701995
write_lock_bh(&queue->sock->sk->sk_callback_lock);
@@ -2032,7 +2057,9 @@ static void nvme_tcp_stop_io_queues(struct nvme_ctrl *ctrl)
20322057
int i;
20332058

20342059
for (i = 1; i < ctrl->queue_count; i++)
2035-
nvme_tcp_stop_queue(ctrl, i);
2060+
nvme_tcp_stop_queue_nowait(ctrl, i);
2061+
for (i = 1; i < ctrl->queue_count; i++)
2062+
nvme_tcp_wait_queue(ctrl, i);
20362063
}
20372064

20382065
static int nvme_tcp_start_io_queues(struct nvme_ctrl *ctrl,

drivers/nvme/target/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ config NVME_TARGET_TCP_TLS
9898
bool "NVMe over Fabrics TCP target TLS encryption support"
9999
depends on NVME_TARGET_TCP
100100
select NET_HANDSHAKE
101+
select TLS
101102
help
102103
Enables TLS encryption for the NVMe TCP target using the netlink handshake API.
103104

drivers/nvme/target/auth.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,13 +600,12 @@ void nvmet_auth_insert_psk(struct nvmet_sq *sq)
600600
pr_warn("%s: ctrl %d qid %d failed to refresh key, error %ld\n",
601601
__func__, sq->ctrl->cntlid, sq->qid, PTR_ERR(tls_key));
602602
tls_key = NULL;
603-
kfree_sensitive(tls_psk);
604603
}
605604
if (sq->ctrl->tls_key)
606605
key_put(sq->ctrl->tls_key);
607606
sq->ctrl->tls_key = tls_key;
608607
#endif
609-
608+
kfree_sensitive(tls_psk);
610609
out_free_digest:
611610
kfree_sensitive(digest);
612611
out_free_psk:

drivers/nvme/target/tcp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,6 +1560,9 @@ static void nvmet_tcp_restore_socket_callbacks(struct nvmet_tcp_queue *queue)
15601560
{
15611561
struct socket *sock = queue->sock;
15621562

1563+
if (!queue->state_change)
1564+
return;
1565+
15631566
write_lock_bh(&sock->sk->sk_callback_lock);
15641567
sock->sk->sk_data_ready = queue->data_ready;
15651568
sock->sk->sk_state_change = queue->state_change;

0 commit comments

Comments
 (0)