Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1107343rwn; Thu, 8 Sep 2022 13:36:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR6pIZKDEZUxsQ/aOMMFFgY39Fq8J4RtOtdU06wIgtju8g1nF0U+b7K012tFGI0vrApEeYBb X-Received: by 2002:a05:651c:158e:b0:26b:46a6:bf63 with SMTP id h14-20020a05651c158e00b0026b46a6bf63mr1569728ljq.21.1662669388905; Thu, 08 Sep 2022 13:36:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662669388; cv=none; d=google.com; s=arc-20160816; b=nI6eFYfOhHsdOLRfIAye2GdtOBtO3px7aOKv15GGgxVXpsF4OLszGauPJaeQx4FmaV c01SHep0l6UC8080hNpZyG++s+mbYJdCMnd0ZMBdeYXhp5YpJmix3cOW8ISrs4aDU5lI M28bPk7+G0D8IfKTdkahGerPwl6DNE3z0AO+28k2Zabjaura6AJDOk5zBcNMiuXI7Wo5 jEPhh2uvrOU6b0C2mu+W7JWIt3FO2zMIFx7gcswlNmRNomQ8BuOSa4FGksfhGmkus2AN pMxrEVpJIVlqOO77iVP3Jx+490nFleZZhmn6UMwvOaI9Qn4U2Qy5GMv1PSqwXWXpncHX DLHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=wRIPml75udb6Hr+2h7tc6W0b3r790PHoE/0JQr2GuXU=; b=wkVb/TG3q9/xOBCbHSBXvhY+AnwBLzi8Kxk/Hw3v9O8qtUTfxT9LLbl7G7IHhfT+/h rF/tEOo0jgEGBR/OgwSI6gcARGJ3A/ooqw6CQ7Dit8LCm3o5v3zT7WYEmKj4I68VuOel 0iHYAZv3edqYi6fimTE6oaW08vl6uwmDjGabYKFUbM5mS+/f1rh1+XZ3cO+Rfx9kJgt8 OrFtrXM9NTMlk58zPSJIqIiO3xLovzJk7LWktc/MEB4+eHhKi9Msw6mtKMJGuRQ6HvWr OCNoRKQzfoXgQSM7ds6XF8pDk5pinPWiFitqXMFaiI71VAQBB4ilIYbjcwBaq9wCADAL sPoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Kyn2rGHU; 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 s16-20020a2e81d0000000b0026ad00cde74si2383588ljg.47.2022.09.08.13.36.00; Thu, 08 Sep 2022 13:36:28 -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=Kyn2rGHU; 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 S229742AbiIHUVv (ORCPT + 99 others); Thu, 8 Sep 2022 16:21:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229488AbiIHUVs (ORCPT ); Thu, 8 Sep 2022 16:21:48 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F992EC74A; Thu, 8 Sep 2022 13:21:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662668507; x=1694204507; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=a7T/JGLT6ZN2mqHLe4wvsZL3e/wJbh1R0c15TYv0olA=; b=Kyn2rGHU+Gr2WOKOPlAZ6r6W40cjNWB2GmN2NCoKaR03AfaXwY0Q4BqU W8lIOCgPUhFTHHjArWwDMH+xsfsnoaBz6c1rQqp1NY/deReN+WkOvgmbq CyESzPZtYm46HcscqthtkA5crwSqi+lLppgOy0Lsgbts6iw9jU9swmLG1 QYqpgsBrVO1yBrAA6aHPURYlleL9lWyTkcqbmhM60OsNjVjLPyTw8J/uA H9gdd5eM5QArCM6lLJP8IpJfF/pRnxKNE0YZZFldpGQ1sOgLBFeh/YAVA gsbMwdgnJx3iQhyJRqIy/eiIiKDZwxUBD2FNI5PAKw7V0Y2IvvXj2pito w==; X-IronPort-AV: E=McAfee;i="6500,9779,10464"; a="277703539" X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="277703539" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 13:21:46 -0700 X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="648182741" Received: from rhweight-wrk1.ra.intel.com ([137.102.106.43]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 13:21:45 -0700 Date: Thu, 8 Sep 2022 13:21:57 -0700 (PDT) From: matthew.gerlach@linux.intel.com X-X-Sender: mgerlach@rhweight-WRK1 To: Geert Uytterhoeven cc: Andy Shevchenko , Wu Hao , Xu Yilun , russell.h.weight@intel.com, basheer.ahmed.muddebihal@intel.com, Tom Rix , Moritz Fischer , linux-fpga@vger.kernel.org, "open list:DOCUMENTATION" , Linux Kernel Mailing List , tianfei.zhang@intel.com, Jonathan Corbet , Greg KH , "open list:SERIAL DRIVERS" , Jiri Slaby , Geert Uytterhoeven , =?ISO-8859-15?Q?Niklas_S=F6derlund?= , Phil Edworthy , "Maciej W. Rozycki" , Johan Hovold , Lukas Wunner Subject: Re: [PATCH v1 4/5] fpga: dfl: add generic support for MSIX interrupts In-Reply-To: Message-ID: References: <20220906190426.3139760-1-matthew.gerlach@linux.intel.com> <20220906190426.3139760-5-matthew.gerlach@linux.intel.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Thu, 8 Sep 2022, Geert Uytterhoeven wrote: > Hi Matthew, > > On Thu, Sep 8, 2022 at 7:34 PM wrote: >> On Thu, 8 Sep 2022, Andy Shevchenko wrote: >>> On Wed, Sep 07, 2022 at 02:37:32PM -0700, matthew.gerlach@linux.intel.com wrote: >>>> On Tue, 6 Sep 2022, Andy Shevchenko wrote: >>>>> On Tue, Sep 06, 2022 at 12:04:25PM -0700, matthew.gerlach@linux.intel.com wrote: >>> >>> ... >>> >>>>>> + if (fid != FEATURE_ID_AFU && fid != PORT_FEATURE_ID_ERROR && >>>>>> + fid != PORT_FEATURE_ID_UINT && fid != FME_FEATURE_ID_GLOBAL_ERR) { >>>>>> + v = readq(base); >>>>>> + v = FIELD_GET(DFH_VERSION, v); >>>>>> + >>>>>> + if (v == 1) { >>>>>> + v = readq(base + DFHv1_CSR_SIZE_GRP); >>>>> >>>>> I am already lost what v keeps... >>>>> >>>>> Perhaps >>>>> >>>>> v = readq(base); >>>>> switch (FIELD_GET(DFH_VERSION, v)) { >>>>> case 1: >>>>> ... >>>>> break; >>>>> } >>>> >>>> How about? >>>> if (FIELD_GET(DFH_VERSION, readq(base)) == 1) { >>>> ... >>>> } >>> >>> This one tends to be expanded in the future, so I would keep it switch case. >>> >> >> I'm okay with using the switch statement, but how about the following? >> >> switch (FIELD_GET(DFH_VERSION, readq(base))) { >> case 1: >> ... >> break; >> } > > Would it make sense to print an error if a newer version than 1 is detected? > BTW, what is the expected value when DFHv1 is not detected? Zero > or an arbitrary number? > > Gr{oetje,eeting}s, > > Geert > Hi Geert, Currently, DFHs that are not version 1 should be version 0. I will fill in the switch statement to do nothing for version 0, and the default case will print a warning of an unexpected version. Thanks for the feedback. Matthew Gerlach > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds >