Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1183122rwb; Fri, 23 Sep 2022 09:11:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7OjwkWfofYS1uIO/rRmYVyvBEmKUM1jmt1BaCVfdfBjoj7tFcHOY+6H2kMCyqNXzJskiwE X-Received: by 2002:a05:6a00:9a7:b0:54c:27c4:3ad6 with SMTP id u39-20020a056a0009a700b0054c27c43ad6mr10084820pfg.9.1663949463882; Fri, 23 Sep 2022 09:11:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663949463; cv=none; d=google.com; s=arc-20160816; b=v94VXwsR47+PTEiF6fwO2UgxtiDEprvwui5pQA2CGxGC89krnh+RGs0/o6iMhfPKOw 9RIkH7rLfgFKQoHVP+fYOttW0E77sin/lU+0bXAcnh7v2A9A13ha6j+TdYkt1qeHVWN4 QrijBaTDUdZdiGE7C+CxeIIAzmTHbQLZVrcIC7a7HYrrbXnAFrWX1bPABR1WLhBuhGDk G84xe1vwwJYdVTS7hmMp7iYvVIyyKDnHG6y+B2/OzwsqH6Zj/EikdlZttokYD7jP04No bvNt6agnL+5SI8fl0u4ULUD81WSYGdBQXGhlU4fgoP6PA8PpgzpG8WRwvJ7F3QkYbjA+ +r2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=2dCkE2tcMEakMuQmQ0RNyXdL95o0xZjlFxpTptLX+nQ=; b=dEl40Vh2hsQvHz3nHflo03D1ayH7zvFewZcnbsUHNJoq+aEr5E8gihDYvgUUHJKOiN M21fOoKGKp45DzU7htjtCVeAV+gpzPO1OcaOnOoH6PLvi0eyso4YNKSzcGhYzUdtWPFM kw4wAW18F5B6CodJdCFWr3xpQwIK/Bu3ZLp0vPr4PSSNUp6oVoZFtZgAJ9zBGyilBkPR qXY1DPyCDcImzJhkIbSmVaPMlaJpMygKAoQfzNKWmwSA6NSU+bQFE/Jp1pbIfeL8S3ra bwR4JPFvTEiX3KWh35hJq5S87KAVeSFUNo+qV+BF72CTpS7Xo+C4DWicUSbCCViPChJX 8v5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FM8izTCS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j2-20020a056a00234200b0052da2ea956csi10120518pfj.371.2022.09.23.09.10.51; Fri, 23 Sep 2022 09:11:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FM8izTCS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232590AbiIWPV4 (ORCPT + 99 others); Fri, 23 Sep 2022 11:21:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232565AbiIWPVd (ORCPT ); Fri, 23 Sep 2022 11:21:33 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9393DF192C; Fri, 23 Sep 2022 08:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663946491; x=1695482491; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=knBQ7zAmYT9oqE/HB/kSwqI8AwDgZ/tNqaN2kNiG/Dc=; b=FM8izTCSgK6EaEHmAAemZhpfH8bVe4mwHrWxO9B2ZYdnV4UHQY830Qjt S8eTJlsB1ypbsuK33Neg2AMZzr6BkwIVeH2KlhsU1q63lNUgZSle5b1uy /dkQITGYQFUaMIC23jaC7p0WH8JChmzfhQJoYlpLTkdM9OHPYg5cjiWWC 69uKUO4ohlqQNuUiewNi2+kI7sReHeKh4FI2jmT146zMjf8CJDqoOrwyh olJkKh2iMHiXEySu0bKgLjFG3nRlhYU0r3plgBep/wVuBHIqTctOmat0D iJSrAAH2ayaKd28i8Q3ieiEy8/jtg5lMXzdHFt0emNFQ5/tK7CtTvK1fw Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10479"; a="283713146" X-IronPort-AV: E=Sophos;i="5.93,339,1654585200"; d="scan'208";a="283713146" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 08:21:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,339,1654585200"; d="scan'208";a="762647111" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001.fm.intel.com with ESMTP; 23 Sep 2022 08:21:11 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1obkUH-006WBG-0B; Fri, 23 Sep 2022 18:21:09 +0300 Date: Fri, 23 Sep 2022 18:21:08 +0300 From: Andy Shevchenko To: matthew.gerlach@linux.intel.com Cc: hao.wu@intel.com, yilun.xu@intel.com, russell.h.weight@intel.com, basheer.ahmed.muddebihal@intel.com, trix@redhat.com, mdf@kernel.org, linux-fpga@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, tianfei.zhang@intel.com, corbet@lwn.net, gregkh@linuxfoundation.org, linux-serial@vger.kernel.org, jirislaby@kernel.org, geert+renesas@glider.be, niklas.soderlund+renesas@ragnatech.se, phil.edworthy@renesas.com, macro@orcam.me.uk, johan@kernel.org, lukas@wunner.de Subject: Re: [PATCH v2 4/6] fpga: dfl: add generic support for MSIX interrupts Message-ID: References: <20220923121745.129167-1-matthew.gerlach@linux.intel.com> <20220923121745.129167-5-matthew.gerlach@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220923121745.129167-5-matthew.gerlach@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 23, 2022 at 05:17:43AM -0700, matthew.gerlach@linux.intel.com wrote: > From: Matthew Gerlach > > Define and use a DFHv1 parameter to add generic support for MSIX > interrupts for DFL devices. ... > + if (fid != FEATURE_ID_AFU && fid != PORT_FEATURE_ID_ERROR && > + fid != PORT_FEATURE_ID_UINT && fid != FME_FEATURE_ID_GLOBAL_ERR) { > + Unneeded blank line. > + v = FIELD_GET(DFH_VERSION, readq(base)); > + switch (v) { This v... > + case 0: > + break; > + > + case 1: > + v = readq(base + DFHv1_CSR_SIZE_GRP); Extra space. ...and this v are semantically different. It's quite hard to deduce their semantics. > + if (FIELD_GET(DFHv1_CSR_SIZE_GRP_HAS_PARAMS, v)) { > + off = dfl_find_param(base + DFHv1_PARAM_HDR, ofst, > + DFHv1_PARAM_ID_MSIX); I guess I have suggested to use temporary variable(s) here. void __iomem *dfhv1 = base + DFHv1...; void __iomem *nth; > + if (off >= 0) { nth = dfhv1 + off; > + ibase = readl(base + DFHv1_PARAM_HDR + > + off + DFHv1_PARAM_MSIX_STARTV); > + inr = readl(base + DFHv1_PARAM_HDR + > + off + DFHv1_PARAM_MSIX_NUMV); ibase = readl(nth + DFHv1_PARAM_MSIX_STARTV); inr = readl(nth + DFHv1_PARAM_MSIX_NUMV); > + dev_dbg(binfo->dev, "start %d num %d fid 0x%x\n", > + ibase, inr, fid); > + } > + } > + break; > + > + default: > + dev_warn(binfo->dev, "unexpected DFH version %lld\n", v); > + break; > + } > + } -- With Best Regards, Andy Shevchenko