Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1174428ybx; Thu, 31 Oct 2019 06:47:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLV5IJ5lYhvgcYCXi3RsdHNe00ezCJ0wYDWEKvkM/hxIEMLzC99a8p4jamUWBm8OUrYMs+ X-Received: by 2002:a17:906:4e55:: with SMTP id g21mr4228461ejw.0.1572529672455; Thu, 31 Oct 2019 06:47:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572529672; cv=none; d=google.com; s=arc-20160816; b=QlKpQSZHpUocsgjDORjBm+FQ18Pm5aBNcGDnH2CCxxAHk0fmLsOUBK5QQAXdCpl7jS FhDRudmauxiS+YPjJQbfkN7EZ2m9MAjwP+aLsb/SPUDr63r2N8L922Hglmh8Wp+9g8FY 86njLbCnNe9mb/U3j4OVwDSp7xm25EY9MqXD0tmQKSLFxsng0HJb4GMm4IfjUsE5CLwK vEfvTv5aAwChT9cCobBB0vP9BaE4yiVH+JMavCh/rXtfq1hVEJRnR1dE22Z95v6SXJYR VrPNBNGKI3OXLZiXv9Y949Y0zitUoegX0GbRZ+Npdb4wRCSS41IWsvrVYduOdCWlGeDM euSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=zjpoI2Ta9pLawZVeMX6SeT+6PrDQXtoTPmpMqV1u3wE=; b=TNKd4OvVYjwBJHsO2BcUU0EHjFpoCOPBGIevKdV/TQ4tz2a9GEi7lUGLcy0aZA4NId NiLwYvwTxzqW+qTgDsroCU/GBZl1SP9E1DEfzttanHk2weyHoMnnzHE4Lzxgwf3OM7j5 9t3T/TuRZ3boQ41akSYJR/a1QOMVMbU5gZlngIDbbIKN6NHlV54+g28XRzHHfF5Bfn/R HQER9qMpVXYiKT9bCdVx7FfsptCxAdUGV7KAUMLRa0e2O7HnchYz27KJ4taPSemDdttx epQKLoySjozFXXi2FAFNL8awRDs0IUi+GXD7aTnaFnh/bVwnr1QSO0Y96fcOmfsBWSHU nFYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12si4644661edi.301.2019.10.31.06.47.28; Thu, 31 Oct 2019 06:47:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727653AbfJaNpx (ORCPT + 99 others); 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.