[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<MN2PR04MB68627C5DD4EEB073CC4E3EC7BC40A@MN2PR04MB6862.namprd04.prod.outlook.com>
Date: Wed, 2 Jul 2025 18:21:19 +0000
From: Kamaljit Singh <Kamaljit.Singh1@....com>
To: Damien Le Moal <dlemoal@...nel.org>, "kbusch@...nel.org"
<kbusch@...nel.org>, "axboe@...nel.dk" <axboe@...nel.dk>, hch <hch@....de>,
"sagi@...mberg.me" <sagi@...mberg.me>, "linux-nvme@...ts.infradead.org"
<linux-nvme@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
CC: "cassel@...nel.org" <cassel@...nel.org>
Subject: Re: [PATCH v2 2/3] nvme: prevent admin controller from smart log
fetch (LID 2)
Hi Damien,
On 7/1/25 19:14, Damien Le Moal wrote:
>> Similar to a discovery ctrl, prevent an admin-ctrl from getting a smart
>> log. LID 2 is optional for admin controllers to support.
>If it is optional, when the admin controller support it, why prevent it ?
>This is what your code does... Or is it that at this stage of the
>initialization, you do not know yet if the admin controller supports LTD 2 ?
Yes, the latter. If the admin controller does not support LID=2 then GLP
will fail. My suggestion is to revisit this later and add smarts based on
LID=0 (supported log pages) response from the controller.
>
> In the future when support for the newly added LID=0 (supported log
> pages) is added, GLP accesses can be made smarter by basing such calls
> on response from LID=0 reads.
>
> Reference: NVMe Base rev 2.2, sec 3.1.3.5, fig 31.
>
> Signed-off-by: Kamaljit Singh <kamaljit.singh1@....com>
> ---
> drivers/nvme/host/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index a1155fb8d5be..c310634e75f3 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -3705,7 +3705,7 @@ int nvme_init_ctrl_finish(struct nvme_ctrl *ctrl, bool was_suspended)
>
> nvme_configure_opal(ctrl, was_suspended);
>
> - if (!ctrl->identified && !nvme_discovery_ctrl(ctrl)) {
> + if (!ctrl->identified && !nvme_discovery_ctrl(ctrl) && !nvme_admin_ctrl(ctrl)) {
> /*
> * Do not return errors unless we are in a controller reset,
> * the controller works perfectly fine without hwmon.
Thanks,
Kamaljit
Powered by blists - more mailing lists