Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp3858212rwi; Wed, 2 Nov 2022 04:07:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Shcze0kl4y8DKcVzAR+Y5n/2Z7MbjJZm86qo66UqBABNdronWXkA2NDpjuOwdEPeH2NMe X-Received: by 2002:a17:90a:5b03:b0:213:e4bc:fbf4 with SMTP id o3-20020a17090a5b0300b00213e4bcfbf4mr15685098pji.74.1667387272380; Wed, 02 Nov 2022 04:07:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667387272; cv=none; d=google.com; s=arc-20160816; b=L6DAlrapY6YHDr4swtKZIwigia4IfIfTB/Yqp+Sgca9rVOva31Sc2nOmppdtUeSRJl OMY2szk8Jkvc6dUkDrxW+j5ryp83gJuemybcLn5IRiyUxM5rUNtIycwRAI4D9oHNnx7Q RYWHEN+gDekiiCDEVSaeVYLVSYo0cNNlx/0VGG/zpZCFIvx0V3zNrcNoGBk9AtHmGety lkVai8qNSS1clYrtpv4Ct0uZs6BZAOPX+y/XCIsfkvqqbNfDAloRh2l5no2/Bc658rOa uTCStUpnSvAKYhSUv1HOS3xgADsyZTJsWMescMZeTeEHHYvrzc652kNLWtzT2WtzG7++ vPuQ== 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=aM1yODDA+FNqkKPF8JZyBaBTn5Oz4+9nOWZMNKy++BI=; b=acjAiZcAkCDVfQkte0PHXWikJDMx/eyf9p6whcBXElRciOcwMdjRAi8NnIoV0Clv6a c5WeQ7cmWfr6hpyYnqiTT9serzLFHbsCBU5Z5/i45lwMB9Y4feHcvZ3LkLrSWFvXzomj 4ulx0Re4e/7BT2LdId+G5RgVkxaFHJZWffkMoHzt02WQqnQjTo1O33KQPO+mBi5plZhQ LyjWSsTeC1gR3b3h5wzQ2YhKfdLg8bZ5/kT6scBEmCZMUClu8nhUwy+PVLqGw1Wj+3N7 M33478C/I5EGEckrilqj/OVNZ2ekb+HUOG5JGIcgoUwYUk/bi0YPi4K4MlGOX9sO8bL+ abHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OWBGsJf9; 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 h19-20020a63f913000000b0046f3dfb97a5si17534120pgi.660.2022.11.02.04.07.33; Wed, 02 Nov 2022 04:07:52 -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=OWBGsJf9; 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 S229548AbiKBKos (ORCPT + 98 others); Wed, 2 Nov 2022 06:44:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230188AbiKBKoj (ORCPT ); Wed, 2 Nov 2022 06:44:39 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0051C205C4; Wed, 2 Nov 2022 03:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667385879; x=1698921879; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=cJ3Y4C/MhfSQfBxw7jsHZujVpv2WrFsLiudBIJN2Ldc=; b=OWBGsJf96lRmMc7p75l96dhq1t4BiIATbgnqkTvTeO0xHJCFf+KXqlRl o+7BOrf6jVZdyyIFblcEmzjbVzuq43yWtzRUao7FK3unenE6/VRLEuDvA nFadlna7TtHlWrjf2H3fXWOrY/zqpx1ClvNraiPWBy7tmO6s3lw6v8yA9 xYxGWOAEql4OoSt4Wi/zNLc6dvfhK3AX+9qM1dVCal5A6iDi7XHGo+ewe rb50f0fWwh3eC3ct0tAqzjBnylWu5nsp3ARQOtNZkysV4MhnKNaQx6iiA YLJJWXyg9sD0i6LBb0co2cNEkYbUYOvnDdqcy+rNJr4j/+BLIHwP1PcAS w==; X-IronPort-AV: E=McAfee;i="6500,9779,10518"; a="310477847" X-IronPort-AV: E=Sophos;i="5.95,232,1661842800"; d="scan'208";a="310477847" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2022 03:44:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10518"; a="776846592" X-IronPort-AV: E=Sophos;i="5.95,232,1661842800"; d="scan'208";a="776846592" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001.fm.intel.com with ESMTP; 02 Nov 2022 03:44:36 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1oqBEY-0068Mu-2c; Wed, 02 Nov 2022 12:44:34 +0200 Date: Wed, 2 Nov 2022 12:44:34 +0200 From: Andy Shevchenko To: "David E. Box" Cc: hdegoede@redhat.com, markgross@kernel.org, srinivas.pandruvada@intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/9] platform/x86/intel/sdsi: Support different GUIDs Message-ID: References: <20221101191023.4150315-1-david.e.box@linux.intel.com> <20221101191023.4150315-4-david.e.box@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221101191023.4150315-4-david.e.box@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 Tue, Nov 01, 2022 at 12:10:17PM -0700, David E. Box wrote: > Newer versions of Intel On Demand hardware may have an expanded list of > registers to support new features. The register layout is identified by a > unique GUID that's read during driver probe. Add support for handling > different GUIDs and add support for current GUIDs [1]. > [1] https://github.com/intel/intel-sdsi/blob/master/os-interface.rst Link: tag? ... > #define SDSI_MIN_SIZE_DWORDS 276 > -#define SDSI_SIZE_CONTROL 8 > #define SDSI_SIZE_MAILBOX 1024 > -#define SDSI_SIZE_REGS 72 > +#define SDSI_SIZE_REGS 80 > #define SDSI_SIZE_CMD sizeof(u64) > +#define SDSI_SIZE_MAILBOX 1024 Why do you need this second time? ... > +static int sdsi_get_layout(struct sdsi_priv *priv, struct disc_table *table) > +{ > + switch (table->guid) { > + case SDSI_GUID_V1: > + priv->control_size = 8; > + priv->registers_size = 72; > + break; > + case SDSI_GUID_V2: > + priv->control_size = 16; > + priv->registers_size = 80; Maybe it makes sense to use previously defined constants here instead of magics? > + break; > + default: > + dev_err(priv->dev, "Unrecognized GUID 0x%x\n", table->guid); > + return -EINVAL; > + } > + return 0; > +} -- With Best Regards, Andy Shevchenko