From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66DAECA9ECF for ; Thu, 31 Oct 2019 13:45:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 47B3C2086D for ; Thu, 31 Oct 2019 13:45:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727657AbfJaNpx (ORCPT ); Thu, 31 Oct 2019 09:45:53 -0400 Received: from verein.lst.de ([213.95.11.211]:51082 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727549AbfJaNpx (ORCPT ); Thu, 31 Oct 2019 09:45:53 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 9B60A68BE1; Thu, 31 Oct 2019 14:45:49 +0100 (CET) Date: Thu, 31 Oct 2019 14:45:49 +0100 From: Christoph Hellwig To: Guenter Roeck Cc: Akinobu Mita , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , LKML , linux-nvme@lists.infradead.org, Linux PM , Chris Healy Subject: Re: [PATCH v2] nvme: Add hardware monitoring support Message-ID: <20191031134549.GB4763@lst.de> References: <20191029223214.18889-1-linux@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 30, 2019 at 07:20:37PM -0700, Guenter Roeck wrote: >> The nvme_init_identify() can be called multiple time in nvme ctrl's >> lifetime (e.g 'nvme reset /dev/nvme*' or suspend/resume paths), so >> should we need to prevent nvme_hwmon_init() from registering hwmon >> device more than twice? >> >> In the nvme thermal zone patchset[1], thernal zone is registered in >> nvme_init_identify and unregistered in nvme_stop_ctrl(). >> > > Doesn't that mean that the initialization should happen in nvme_start_ctrl() > and not here ? I think calling it from nvme_init_identify is fine, it just needs to be in the "if (!ctrl->identified)" section of that function.