Skip to content

Commit 1878b73

Browse files
committed
Merge tag 'nvme-6.4-2023-05-18' of git://git.infradead.org/nvme into block-6.4
Pull NVMe fixes from Keith: "nvme fixes for Linux 6.4 - More device quirks (Sagi, Hristo, Adrian, Daniel) - Controller delete race (Maurizo) - Multipath cleanup fix (Christoph)" * tag 'nvme-6.4-2023-05-18' of git://git.infradead.org/nvme: nvme-pci: Add quirk for Teamgroup MP33 SSD nvme: do not let the user delete a ctrl before a complete initialization nvme-multipath: don't call blk_mark_disk_dead in nvme_mpath_remove_disk nvme-pci: clamp max_hw_sectors based on DMA optimized limitation nvme-pci: add quirk for missing secondary temperature thresholds nvme-pci: add NVME_QUIRK_BOGUS_NID for HS-SSD-FUTURE 2048G
2 parents ac5902f + 0649728 commit 1878b73

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

drivers/nvme/host/core.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3585,6 +3585,9 @@ static ssize_t nvme_sysfs_delete(struct device *dev,
35853585
{
35863586
struct nvme_ctrl *ctrl = dev_get_drvdata(dev);
35873587

3588+
if (!test_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags))
3589+
return -EBUSY;
3590+
35883591
if (device_remove_file_self(dev, attr))
35893592
nvme_delete_ctrl_sync(ctrl);
35903593
return count;
@@ -5045,7 +5048,7 @@ void nvme_start_ctrl(struct nvme_ctrl *ctrl)
50455048
* that were missed. We identify persistent discovery controllers by
50465049
* checking that they started once before, hence are reconnecting back.
50475050
*/
5048-
if (test_and_set_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags) &&
5051+
if (test_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags) &&
50495052
nvme_discovery_ctrl(ctrl))
50505053
nvme_change_uevent(ctrl, "NVME_EVENT=rediscover");
50515054

@@ -5056,6 +5059,7 @@ void nvme_start_ctrl(struct nvme_ctrl *ctrl)
50565059
}
50575060

50585061
nvme_change_uevent(ctrl, "NVME_EVENT=connected");
5062+
set_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags);
50595063
}
50605064
EXPORT_SYMBOL_GPL(nvme_start_ctrl);
50615065

drivers/nvme/host/hwmon.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ static umode_t nvme_hwmon_is_visible(const void *_data,
163163
case hwmon_temp_max:
164164
case hwmon_temp_min:
165165
if ((!channel && data->ctrl->wctemp) ||
166-
(channel && data->log->temp_sensor[channel - 1])) {
166+
(channel && data->log->temp_sensor[channel - 1] &&
167+
!(data->ctrl->quirks &
168+
NVME_QUIRK_NO_SECONDARY_TEMP_THRESH))) {
167169
if (data->ctrl->quirks &
168170
NVME_QUIRK_NO_TEMP_THRESH_CHANGE)
169171
return 0444;

drivers/nvme/host/multipath.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,6 @@ void nvme_mpath_remove_disk(struct nvme_ns_head *head)
884884
{
885885
if (!head->disk)
886886
return;
887-
blk_mark_disk_dead(head->disk);
888887
/* make sure all pending bios are cleaned up */
889888
kblockd_schedule_work(&head->requeue_work);
890889
flush_work(&head->requeue_work);

drivers/nvme/host/nvme.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ enum nvme_quirks {
149149
* Reports garbage in the namespace identifiers (eui64, nguid, uuid).
150150
*/
151151
NVME_QUIRK_BOGUS_NID = (1 << 18),
152+
153+
/*
154+
* No temperature thresholds for channels other than 0 (Composite).
155+
*/
156+
NVME_QUIRK_NO_SECONDARY_TEMP_THRESH = (1 << 19),
152157
};
153158

154159
/*

drivers/nvme/host/pci.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2956,7 +2956,7 @@ static struct nvme_dev *nvme_pci_alloc_dev(struct pci_dev *pdev,
29562956
* over a single page.
29572957
*/
29582958
dev->ctrl.max_hw_sectors = min_t(u32,
2959-
NVME_MAX_KB_SZ << 1, dma_max_mapping_size(&pdev->dev) >> 9);
2959+
NVME_MAX_KB_SZ << 1, dma_opt_mapping_size(&pdev->dev) >> 9);
29602960
dev->ctrl.max_segments = NVME_MAX_SEGS;
29612961

29622962
/*
@@ -3402,6 +3402,8 @@ static const struct pci_device_id nvme_id_table[] = {
34023402
.driver_data = NVME_QUIRK_NO_DEEPEST_PS, },
34033403
{ PCI_DEVICE(0x2646, 0x2263), /* KINGSTON A2000 NVMe SSD */
34043404
.driver_data = NVME_QUIRK_NO_DEEPEST_PS, },
3405+
{ PCI_DEVICE(0x2646, 0x5013), /* Kingston KC3000, Kingston FURY Renegade */
3406+
.driver_data = NVME_QUIRK_NO_SECONDARY_TEMP_THRESH, },
34053407
{ PCI_DEVICE(0x2646, 0x5018), /* KINGSTON OM8SFP4xxxxP OS21012 NVMe SSD */
34063408
.driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, },
34073409
{ PCI_DEVICE(0x2646, 0x5016), /* KINGSTON OM3PGP4xxxxP OS21011 NVMe SSD */
@@ -3441,6 +3443,10 @@ static const struct pci_device_id nvme_id_table[] = {
34413443
NVME_QUIRK_IGNORE_DEV_SUBNQN, },
34423444
{ PCI_DEVICE(0x10ec, 0x5763), /* TEAMGROUP T-FORCE CARDEA ZERO Z330 SSD */
34433445
.driver_data = NVME_QUIRK_BOGUS_NID, },
3446+
{ PCI_DEVICE(0x1e4b, 0x1602), /* HS-SSD-FUTURE 2048G */
3447+
.driver_data = NVME_QUIRK_BOGUS_NID, },
3448+
{ PCI_DEVICE(0x10ec, 0x5765), /* TEAMGROUP MP33 2TB SSD */
3449+
.driver_data = NVME_QUIRK_BOGUS_NID, },
34443450
{ PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0061),
34453451
.driver_data = NVME_QUIRK_DMA_ADDRESS_BITS_48, },
34463452
{ PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0065),

0 commit comments

Comments
 (0)