* [PATCH] nvme-pci: refresh visible attrs for cmb attributes
@ 2023-02-16 16:44 Keith Busch
2023-02-16 20:46 ` Sagi Grimberg
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Keith Busch @ 2023-02-16 16:44 UTC (permalink / raw)
To: linux-nvme, hch; +Cc: sagi, Keith Busch
From: Keith Busch <kbusch@kernel.org>
The sysfs group containing the cmb attributes is registered before the
driver knows if they need to be visible or not. Update the group when
cmb attributes are known to exist so the visibility setting is correct.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217037
Fixes: 86adbf0cdb9ec65 ("nvme: simplify transport specific device attribute handling")
Signed-off-by: Keith Busch <kbusch@kernel.org>
---
drivers/nvme/host/pci.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 6d88ddd355657..c11e0cfeef0f3 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -110,6 +110,7 @@ struct nvme_queue;
static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown);
static void nvme_delete_io_queues(struct nvme_dev *dev);
+static void nvme_update_attrs(struct nvme_dev *dev);
/*
* Represents an NVM Express device. Each nvme_dev is a PCI function.
@@ -1923,6 +1924,8 @@ static void nvme_map_cmb(struct nvme_dev *dev)
if ((dev->cmbsz & (NVME_CMBSZ_WDS | NVME_CMBSZ_RDS)) ==
(NVME_CMBSZ_WDS | NVME_CMBSZ_RDS))
pci_p2pmem_publish(pdev, true);
+
+ nvme_update_attrs(dev);
}
static int nvme_set_host_mem(struct nvme_dev *dev, u32 bits)
@@ -2209,6 +2212,11 @@ static const struct attribute_group *nvme_pci_dev_attr_groups[] = {
NULL,
};
+static void nvme_update_attrs(struct nvme_dev *dev)
+{
+ sysfs_update_group(&dev->ctrl.device->kobj, &nvme_pci_dev_attrs_group);
+}
+
/*
* nirqs is the number of interrupts available for write and read
* queues. The core already reserved an interrupt for the admin queue.
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme-pci: refresh visible attrs for cmb attributes
2023-02-16 16:44 [PATCH] nvme-pci: refresh visible attrs for cmb attributes Keith Busch
@ 2023-02-16 20:46 ` Sagi Grimberg
2023-02-17 5:30 ` Linux regression tracking (Thorsten Leemhuis)
2023-02-17 7:30 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Sagi Grimberg @ 2023-02-16 20:46 UTC (permalink / raw)
To: Keith Busch, linux-nvme, hch; +Cc: Keith Busch
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme-pci: refresh visible attrs for cmb attributes
2023-02-16 16:44 [PATCH] nvme-pci: refresh visible attrs for cmb attributes Keith Busch
2023-02-16 20:46 ` Sagi Grimberg
@ 2023-02-17 5:30 ` Linux regression tracking (Thorsten Leemhuis)
2023-02-17 7:30 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Linux regression tracking (Thorsten Leemhuis) @ 2023-02-17 5:30 UTC (permalink / raw)
To: Keith Busch, linux-nvme, hch; +Cc: sagi, Keith Busch
On 16.02.23 17:44, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
Thx for looking into this and creating a fix so quickly.
> The sysfs group containing the cmb attributes is registered before the
> driver knows if they need to be visible or not. Update the group when
> cmb attributes are known to exist so the visibility setting is correct.
There are two small details that would be nice to have.
Having a
Reported-by: michallinuxstuff <michallinuxstuff@gmail.com>
here would be fair.
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=217037
> Fixes: 86adbf0cdb9ec65 ("nvme: simplify transport specific device attribute handling")
And a
Cc: stable@vger.kernel.org # 6.1.y
here would be wise to ensure this is fixed in 6.1 as well, as the change
apparently was backported [no, a fixes tag is not enough to ensure that].
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> [...]
Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)
--
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
If I did something stupid, please tell me, as explained on that page.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvme-pci: refresh visible attrs for cmb attributes
2023-02-16 16:44 [PATCH] nvme-pci: refresh visible attrs for cmb attributes Keith Busch
2023-02-16 20:46 ` Sagi Grimberg
2023-02-17 5:30 ` Linux regression tracking (Thorsten Leemhuis)
@ 2023-02-17 7:30 ` Christoph Hellwig
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2023-02-17 7:30 UTC (permalink / raw)
To: Keith Busch; +Cc: linux-nvme, hch, sagi, Keith Busch
Thanks,
applied to nvme-6.2
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-02-17 7:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-16 16:44 [PATCH] nvme-pci: refresh visible attrs for cmb attributes Keith Busch
2023-02-16 20:46 ` Sagi Grimberg
2023-02-17 5:30 ` Linux regression tracking (Thorsten Leemhuis)
2023-02-17 7:30 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox