Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4742836pjb; Mon, 27 Jul 2020 04:07:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzt+BwBVCYj2gNsX/3RG/YzBkmL87SCmrkDXHoQjWSRYEyx4hyH6nnQLQ5TNGUQ0b4ccnUs X-Received: by 2002:a05:6402:d06:: with SMTP id eb6mr20147100edb.211.1595848052722; Mon, 27 Jul 2020 04:07:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595848052; cv=none; d=google.com; s=arc-20160816; b=1LKkQ025osCglCa1/ynsdiXbgywxJCEGrT2T7aczv4VfvJ4VU4gOAZzc1BSgIyQBYd iO66UsFtAEGeU5WV6tsP43ImhGujT7EU8O00p8AW158wXwRkySkDlzPrZYJDJafXANm/ aR0nmP304/vSRjyb/MxDUWKBHmvkwWiYIXikch6NdzQWZfFlf+BfyaA7SDdNpH9//Wg7 hx7IQggs7oWcz86IqhrLUkjEaKf1FDh+HaI1m6K7A2UrTGauWYCkHnygWcsdDrA+n0/J H6gAh0/pSAQJvVM3hCFpK5QTDpLiHynwiEb44YxMAy4SjujqPFdx/aGwFoAiNHktvKVg orEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=oIEKzcok0AHytuejxAqDHox+Hv/4xCQLeQwpksAUjBk=; b=sC32IMbsikHflB3FyigC3FyPDYqaxDJ4rg2zS+Ex25TTBzuTqUoj6WkRRbm2+G/9yq CQGE8wxmdaSyT81h7yguxuGFG4YisIGdZmZZVC7gfoh0oLa5ksLNhn+glGD3RYwY4CQp J/kT1UKTH5YNlZ5vbfP0QEJOYwGZ4VD8KkSJvjy2wrer05n+0ZMEztZDHEE6nwvWy+jZ iC/Iv21NHg7BaZ3dsq3IlKX2GWpDmO/gSy4+Tfk8SuAq3zDws8egePF6NuET8gMBIFYW vUZlhL/8jTri/AjKKnBl9brvuxUz47h812d1c1hSesuKv8hXd5nPKA40737Gh9rwTjCj CXMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NATaD6DO; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bm20si3967003edb.583.2020.07.27.04.07.10; Mon, 27 Jul 2020 04:07:32 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NATaD6DO; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728331AbgG0KyH (ORCPT + 99 others); Mon, 27 Jul 2020 06:54:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726269AbgG0KyG (ORCPT ); Mon, 27 Jul 2020 06:54:06 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C42C9C061794; Mon, 27 Jul 2020 03:54:05 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id 72so7813956ple.0; Mon, 27 Jul 2020 03:54:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oIEKzcok0AHytuejxAqDHox+Hv/4xCQLeQwpksAUjBk=; b=NATaD6DOFsQ65caJoNxzMR1zR5wWv1mukgUlz/BQxbkOyAc5URJ66Y+8cdha222tlD khfhBoARpbTJAfxfgmxzI25DrnSdQBWxkRBW4/FLvsE89WqdYen4yWtLcPPRWXfcPiQW Gik2kR8VvdLGEoWhb8f0jxxfsTaN1VITh/z6fnufWcLt+xSwyDnNjizNAmxx5ggA+Tl+ ij30otw8WWxa0Me518bb4RvNp+5dOrGeuixKwriyJ/GTmZ0NBZVS3RelFEGMegirNXO3 /3CobaheVraCdrqydqqbQPsNUyqVJl8E46cp9mILLaxCGk4jnpvgGsPmnunjnFgO7aeq LL8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oIEKzcok0AHytuejxAqDHox+Hv/4xCQLeQwpksAUjBk=; b=KFpEi9J7MISEH0iONR3nJaoIUpy0/uMKA/LAMhltjDKbfVXw7z1AQjnxp2o/SriHim uJuKTVon0Bjt9ronjDl0Y6XbOrIZi3T2Tc7ByWlVuf2o6mbtsk8DoZ/3gFp0koUgUiW3 NFlj/XBVZIrYM6FGjjId2CqYKok9LdLF/4ssMm9cmh1Ejmdh1ur6bp96131NkZ48ZQAp z/+OGhVsS7//yWhetkUrg7BazCkHRquMbvGFehDG01Pgj9+0A1mvhxQ2wroEQSfTLFdF 1Z3GWJ6VK2r2OVw/VBuQ0MD2KzIJvCyNCwSTu8KBkfQYwG2tEm8EARw6ZhdSroP2ZL+z Vbxw== X-Gm-Message-State: AOAM531VNSC8Fqc3q/FwaSo1uzXPU6wyjmp5i/xcObqRBTlyez+7LFnm D0JGsdeshRQFLlGZMtlKZzOp/VE/eoTY0pj4u0scEdNa X-Received: by 2002:a17:90a:498b:: with SMTP id d11mr19017924pjh.129.1595847245382; Mon, 27 Jul 2020 03:54:05 -0700 (PDT) MIME-Version: 1.0 References: <0bad52e6e10ff2e8d8a19f95bab7642ec5e71838.1595838334.git.sramani@mellanox.com> In-Reply-To: <0bad52e6e10ff2e8d8a19f95bab7642ec5e71838.1595838334.git.sramani@mellanox.com> From: Andy Shevchenko Date: Mon, 27 Jul 2020 13:53:50 +0300 Message-ID: Subject: Re: [PATCH v1] platform/mellanox: mlxbf-pmc: Add Mellanox BlueField PMC driver To: Shravan Kumar Ramani Cc: Andy Shevchenko , Darren Hart , Vadim Pasternak , Jiri Pirko , Platform Driver , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 27, 2020 at 12:02 PM Shravan Kumar Ramani wrote: > > The performance modules in BlueField are present in several hardware > blocks and each block provides access to these stats either through > counters that can be programmed to monitor supported events or > through memory-mapped registers that hold the relevant information. > The hardware blocks that include a performance module are: > * Tile (block containing 2 cores and a shared L2 cache) > * TRIO (PCIe root complex) > * MSS (Memory Sub-system containing the Memory Controller and L3 cache) > * GIC (Interrupt controller) > * SMMU (System Memory Management Unit) > The mlx_pmc driver provides access to all of these performance modules > through a hwmon sysfs interface. Just brief comments: - consider to revisit header block to see what is really necessary and what can be dropped - add comma to the arrays where last line is not a termination - look at match_string() / sysfs_match_string() API, I think they can be utilised here - UUID manipulations (esp. with that GUID_INIT() against non-constant) seems too much, consider refactoring and cleaning up these pieces - use kstroto*() API instead of sscanf. It has a range check -- With Best Regards, Andy Shevchenko