Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2855417pxb; Mon, 1 Nov 2021 03:17:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPSoy5hxEAx0iMCm0J6DDZiYKm8Fr8lakfABdxfLc9C0WqtiCdE2Pu2R2OH1f7/FUR7zuF X-Received: by 2002:a05:6602:148b:: with SMTP id a11mr21112855iow.85.1635761878284; Mon, 01 Nov 2021 03:17:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635761878; cv=none; d=google.com; s=arc-20160816; b=WpSVFtTzaLUEwYlhEKwnhnOXlcWSzK5ZMqSHSbkM6CzYmofGJ11KTEZMOIbBi+IfBw dQmvoTWRT9yn9X/pqNMKVCqnZJLFdlawD7Ciwo9Vq4dI42bA3z9MoeV3hVvYFaz10Vez ZndxzZ/QPTmpzAoMtoc64Q17Tt6mjzP2JWERiP+IKCuRZR7sLxcbPoTIPp2HwzHH9ue7 gpt5OgU1VUVXo04A7BAfELPhFK+M0Du5+B8CYIBuXWRCj2KtZ2Ftd22YqbHU06nQzHw7 tMgUmasSlx5WeOK8gQuKpv/lEiooqK7iy0dODHP12z/aQuarZpTvoht9rCLOQnlBkIHc SBpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=yJFL79/9qVZA52HuR8AuXC7HxQ9wiIltZ6IQ1TZjTmk=; b=m11etKy+ynaiVXQRN70YgRVqJaOs6yrhHdQ6irC5vw0OFIWZpyoi4fL11RuFlTMIbV 2xXbZCrEjDRa5Bty06dx6RESZBJgph5fa7yjBlhKtbRZGCsdNPru+OUzJ3lek0niO0tx mjFK7KvtTWXWHwXQbL8c+HgCjSlptUnOVnQudQc5OmUxVh9HLWM8DhGjyNQAJ5JoXh3m KwBkj8AYzvbMAXHtiR239qpBuFCyowbCBWdP84kOF62mSey01t/0Io7RHQphkIml9aj9 gjOHb7uXm0EBSzCYg1tdb+caPM4NMzlph2AdoOLqImrvpnss7UPPlYYEBbt5KywpIk0a 1Tuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si6578822ilf.178.2021.11.01.03.17.47; Mon, 01 Nov 2021 03:17:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231822AbhKAKTW (ORCPT + 99 others); Mon, 1 Nov 2021 06:19:22 -0400 Received: from mga06.intel.com ([134.134.136.31]:12199 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230298AbhKAKTV (ORCPT ); Mon, 1 Nov 2021 06:19:21 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10154"; a="291826685" X-IronPort-AV: E=Sophos;i="5.87,198,1631602800"; d="scan'208";a="291826685" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2021 03:16:48 -0700 X-IronPort-AV: E=Sophos;i="5.87,198,1631602800"; d="scan'208";a="488572933" Received: from shiweiyu-mobl.ccr.corp.intel.com (HELO chenyu5-mobl1) ([10.255.28.221]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2021 03:16:45 -0700 Date: Mon, 1 Nov 2021 18:16:41 +0800 From: Chen Yu To: Andy Shevchenko Cc: linux-acpi@vger.kernel.org, Greg Kroah-Hartman , "Rafael J. Wysocki" , Ard Biesheuvel , Len Brown , Ashok Raj , Mike Rapoport , Aubrey Li , linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 3/4] drivers/acpi: Introduce Platform Firmware Runtime Update Telemetry Message-ID: <20211101101641.GA20219@chenyu5-mobl1> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 27, 2021 at 01:45:00PM +0300, Andy Shevchenko wrote: > On Wed, Oct 27, 2021 at 03:08:05PM +0800, Chen Yu wrote: > > Platform Firmware Runtime Update(PFRU) Telemetry Service is part of RoT > > (Root of Trust), which allows PFRU handler and other PFRU drivers to > > produce telemetry data to upper layer OS consumer at runtime. > > > > The linux provides interfaces for the user to query the parameters of > > Linux kernel > Ok. > > telemetry data, and the user could read out the telemetry data > > accordingly. > > > > The corresponding userspace tool and man page will be introduced at > > tools/power/acpi/pfru. > > ... > > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + blank line? > Ok. > > +#include > > ... > > > +static DEFINE_IDA(pfru_log_ida); > > Do you need any mutex against operations on IDA? (I don't remember > if it incorporates any synchronization primitives). > The IDA uses a spinlock_irqsave() to protect the bitmap. > ... > > Looking into the code I have feelings of d?j?-vu. Has it really had > nothing in common with the previous patch? > They both invokes _DSM to trigger the low level actions. However the input parameters and return ACPI package as well as the functions are different and hard to extract the common code between them. > ... > > > +static int valid_log_level(int level) > > +{ > > + return level == LOG_ERR || level == LOG_WARN || > > + level == LOG_INFO || level == LOG_VERB; > > Indentation. > Ok, will add. > > +} > > ... > > > This ordering in ->probe() is not okay: > devm_*() > non-devm_*() > devm_*() > non-devm_*() > > One mustn't interleave these. The allowed are: > > Case 1: > non-devm_*() > > Case 2: > devm_*() > > Case 3: > devm_*() > non-devm_*() > > Otherwise in ->remove() you have wrong release ordering which may hide > subtle bugs. > Got it. I'll fix it in next version. > Above comment is applicable to the other patch as well as some comments > from there are applicable here. > Ok. Thanks, Chenyu > -- > With Best Regards, > Andy Shevchenko > >