Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp891678rwi; Wed, 2 Nov 2022 20:45:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4xNlRsia8LYMzdg/RtWhjgU467C4yVwqZ/pyKRqd8gYxRNThaPukoLHxvvQzWyE7CZoLHS X-Received: by 2002:a17:906:eecb:b0:73c:5bcb:8eb3 with SMTP id wu11-20020a170906eecb00b0073c5bcb8eb3mr27236110ejb.284.1667447159470; Wed, 02 Nov 2022 20:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667447159; cv=none; d=google.com; s=arc-20160816; b=PJYfBR6aEfWs0YQXTNYhWQcuu8sOD508WunrybeGHi2UQJUAjAP70h5yEkBdqGBmO5 qIH0zsqZr/1X6glOITGuCzr5ZDERrs5PlOMK726fCzl1ongpvuUMIOg4SIJPsJuR5saT 4z0td4d2hF7QrsvSAPyaZV9nWfXfGhJp1uIfZiFCA8ZXghQ5y1RsZdYCijDAcslVZqKi kR3LwY+wWBKV1oBNuzV/4hUm/Z2pR0zYVtTKTTF5etYEEkvHIYfd6Zh63Ows03cV5j9n E1NO/UqIfilHw1EkBtMTXAgWIY9S6BxuqxcLDWw0a0wv8g/BeFusIJbhfoUqRCyxVFzj tf+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:organization:references:in-reply-to:date:cc:to:reply-to :from:subject:message-id:dkim-signature; bh=652iVSm3EZjlQHjvq9xuVbt/fA7epevAsUI0DFYNcGI=; b=Nhh+yD9TczsfqCIL6qjpUTNGu+2evkPguheyV0WZ/R+7j0Y5o66+HOUKMsb+6DflsA Jag+k7DQqAeri7Lfg72JDimhWrHTbk3c8JHfm9C9+QUxWY7C3ykoLC7gEUxmY8oEp+rm RI70pmm9OzaZEJgbGRc4TzX0z+4AKWCaHNvD3hSiBFSCEUScvzkejEGHMeH/9HbDRnZR KFoCdE7/sIzc6Z7Ust8utxkhoxU8jTJrdCogb7P2THMrjoi1eSs7e7F8fJc+411FrA9R qBTZJ6EKxlzHtXi/BCfW2HSSlcTS/pTEwUyYfj7QP2dQqQ02zgKKY410ILzllzynU+63 63PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BJgtm6+R; 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 v3-20020aa7d9c3000000b00458b752f449si16186119eds.91.2022.11.02.20.45.37; Wed, 02 Nov 2022 20:45:59 -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=BJgtm6+R; 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 S230324AbiKCDNK (ORCPT + 97 others); Wed, 2 Nov 2022 23:13:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229548AbiKCDNE (ORCPT ); Wed, 2 Nov 2022 23:13:04 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 452031402B; Wed, 2 Nov 2022 20:12:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667445181; x=1698981181; h=message-id:subject:from:reply-to:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=K0vI5uOf/x137Tle9H7IRzeDNxM47nec6nZEZGKSQEc=; b=BJgtm6+RP+ibeDtXJMZcYtN5o3UX0WNp9oElYehs3GW4p729ai/3Dv+5 UZAyks4qURAKXcz0gyqGz6nuORsNQa9a0vXNC6ZmetWLO73wZInvq2wD3 dGE8VAns/xwJIPocZZABZhgMJt/xLtltIgeoY18FjaeDke9JXKY9m4vMF oT/ZXMEx8AclOi4NHOIHtyLA0GPlrakDs+OLF6mbGn4LeEET5Q2QrkDiT bK2R7be90lB3P3FJat7P/zmNuo9bEhNDTl2uATB0dCNyGbZQPsx9IcvXw F/bN1s0d5/E3qCrnBcC2eC675HRLe7I7ChrIuA0xQ9vCvnPFeIu1ASLz0 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10519"; a="297027442" X-IronPort-AV: E=Sophos;i="5.95,235,1661842800"; d="scan'208";a="297027442" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2022 20:12:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10519"; a="723787972" X-IronPort-AV: E=Sophos;i="5.95,235,1661842800"; d="scan'208";a="723787972" Received: from linux.intel.com ([10.54.29.200]) by FMSMGA003.fm.intel.com with ESMTP; 02 Nov 2022 20:12:58 -0700 Received: from dshivaku-MOBL.amr.corp.intel.com (unknown [10.212.195.54]) by linux.intel.com (Postfix) with ESMTP id 794A4580D42; Wed, 2 Nov 2022 20:12:58 -0700 (PDT) Message-ID: Subject: Re: [PATCH 3/9] platform/x86/intel/sdsi: Support different GUIDs From: "David E. Box" Reply-To: david.e.box@linux.intel.com To: Andy Shevchenko Cc: hdegoede@redhat.com, markgross@kernel.org, srinivas.pandruvada@intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 02 Nov 2022 20:12:58 -0700 In-Reply-To: References: <20221101191023.4150315-1-david.e.box@linux.intel.com> <20221101191023.4150315-4-david.e.box@linux.intel.com> Organization: David E. Box Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 Wed, 2022-11-02 at 12:44 +0200, Andy Shevchenko wrote: > 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? Ack > > ... > > > #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? typo > > ... > > > +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? The constant is used for the file size, which since is static is set to the max. But I'll add defines for these. > > > + break; > > + default: > > + dev_err(priv->dev, "Unrecognized GUID 0x%x\n", table->guid); > > + return -EINVAL; > > + } > > + return 0; > > +}