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.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham 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 4C90EC282CE for ; Tue, 4 Jun 2019 07:32:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2323024BCA for ; Tue, 4 Jun 2019 07:32:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726713AbfFDHcz (ORCPT ); Tue, 4 Jun 2019 03:32:55 -0400 Received: from verein.lst.de ([213.95.11.211]:33841 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726589AbfFDHcz (ORCPT ); Tue, 4 Jun 2019 03:32:55 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 3F56D68B02; Tue, 4 Jun 2019 09:32:30 +0200 (CEST) Date: Tue, 4 Jun 2019 09:32:29 +0200 From: Christoph Hellwig To: Akinobu Mita Cc: Christoph Hellwig , linux-nvme@lists.infradead.org, linux-pm@vger.kernel.org, Zhang Rui , Eduardo Valentin , Daniel Lezcano , Keith Busch , Jens Axboe , Sagi Grimberg , Minwoo Im , Kenneth Heitke , Chaitanya Kulkarni Subject: Re: [PATCH v3 3/3] nvme: notify thermal framework when temperature threshold events occur Message-ID: <20190604073229.GI15680@lst.de> References: <1558888143-5121-1-git-send-email-akinobu.mita@gmail.com> <1558888143-5121-4-git-send-email-akinobu.mita@gmail.com> <20190601090353.GE6453@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Sun, Jun 02, 2019 at 10:46:12PM +0900, Akinobu Mita wrote: > 2019年6月1日(土) 18:04 Christoph Hellwig : > > > > So before we allowed userspace to get smart AEN notifications through > > uevent, and would expect userspace to clear the AEN. I think this > > could at least potentially break existing userspace by now doing that > > in kernel space. > > This change unconditionally sets NVME_SMART_CRIT_TEMPERATURE flag in > nvme_enable_aen(), it could be problematic for existing userspace. > So it's better to provide a knob to enable/disable the event notification > and we can utilize get_mode()/set_mode() in the thermal_zone_device_ops. > > Other than that, this change doesn't remove ctrl->aen_result, so existing > userspace still receives NVME_AEN=* uevents. And that is the problem. Because for notifications we expect userspace to read the log page and clear the event, while we are not doing it in kernel space.