Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp216214pxj; Wed, 23 Jun 2021 20:13:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy54Rbaq1jKTgj9stkQljCTZICfFllwyVc3uKiyyxhX/WoLRa1Mdb2hdELM/TAvHHk69qMo X-Received: by 2002:a05:6402:40c3:: with SMTP id z3mr3796755edb.375.1624504380365; Wed, 23 Jun 2021 20:13:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624504380; cv=none; d=google.com; s=arc-20160816; b=jnAFf0njTjUIsr6X8x/DkQlOWJG87r71CkKtkY2ouksv0n9LtOVJY7Gkb4O7vdBVxG o+6pqd8OmGyyjFsZ55sQ40fUWDIIKm49udWRlLeTxaQXNebofwj5uP+h7HYrsYveYgi3 tRgziaUUAtcjWwH8Q740RvnCbN0eE/D2mNygsikRCOssStCaxdlPG25BnHDcawA8CGb5 /rlFTcMUoFEmXNYh7wfWnWetc5E40USBLPuZ1ELmhkpzruZFekVRZ9jD+bJBC8cB9WHt y9U0k/HW/43tCk+VDyBuni+ablqKnJ/QUHiEsF1GqOmXeeOq25KvNei1DPT9sEJzyaWu m+mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=sgYSwawaqqhG8hhwnE8kIjDe/b2DnR5avn6ybUH9MZs=; b=VnMb/233hgFxSJBTrK0JFju8o0nm6dCK0Vwu3LILvtSmQRmGbSAnwX42m6UI/YDjEV /Bt7waIXy/M5fj/rI8CpYcauQlbfr8UFQeZ1PvZb+2Z7lRIoYx5kr3yKilKDL90/Zwsr qCGZqPuBy3Rk7WN2lGXuMsX/dBzeecofplPxGacwSCfsp2L4qMI75QXlBMFoGh4t9kty 9ruNYMyNL6vehWOZLqmxrKh4bbTStav5/Ws9O7wOtdS8zTuBOM0aJcJnnrOFVS/2K1uj bKJvinj45AuALaZLbMc6wMvIY5Z8pgkBx+0gTV1qnObqN0Nuwvie1pNETY7ORQKoOx9h /mxA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id en20si1461952ejc.503.2021.06.23.20.12.37; Wed, 23 Jun 2021 20:13:00 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229822AbhFXDJF (ORCPT + 99 others); Wed, 23 Jun 2021 23:09:05 -0400 Received: from mga11.intel.com ([192.55.52.93]:50860 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229759AbhFXDJE (ORCPT ); Wed, 23 Jun 2021 23:09:04 -0400 IronPort-SDR: NKEkMgnOEX6gyctcOxl4TGnGGDOx6qtiSEty7Qd1xhzuoCxEs0bWUDAE4Td7IfovEUaUAjdRve n8i5yev8N1fw== X-IronPort-AV: E=McAfee;i="6200,9189,10024"; a="204377637" X-IronPort-AV: E=Sophos;i="5.83,295,1616482800"; d="scan'208";a="204377637" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2021 20:06:38 -0700 IronPort-SDR: MFTPXEUqxZsu4NobG6Xruu3TraKUQ1MD94yXs+uRuPlLtq+KoQorhUweEgiBnFMZZLvbO8A/tm /2bluF/uriBg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,295,1616482800"; d="scan'208";a="423920156" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.162]) by orsmga002.jf.intel.com with ESMTP; 23 Jun 2021 20:06:34 -0700 Date: Thu, 24 Jun 2021 11:01:20 +0800 From: Xu Yilun To: Martin =?iso-8859-1?Q?Hundeb=F8ll?= Cc: "Wu, Hao" , Tom Rix , Moritz Fischer , Jean Delvare , Guenter Roeck , Lee Jones , Mark Brown , Martin =?iso-8859-1?Q?Hundeb=F8ll?= , "linux-fpga@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hwmon@vger.kernel.org" , "linux-spi@vger.kernel.org" , Debarati Biswas , "Weight, Russell H" Subject: Re: [PATCH 2/4] fpga: dfl: Move DFH header register macros to linux/dfl.h Message-ID: <20210624030120.GA42039@yilunxu-OptiPlex-7050> References: <20210621070621.431482-1-mhu@silicom.dk> <20210621070621.431482-3-mhu@silicom.dk> <20210622052205.GB27046@yilunxu-OptiPlex-7050> <0257dcaf-348a-375d-6ed8-657974208e30@silicom.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0257dcaf-348a-375d-6ed8-657974208e30@silicom.dk> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 23, 2021 at 01:56:59PM +0200, Martin Hundeb?ll wrote: > > > On 22/06/2021 09.39, Wu, Hao wrote: > > > On Mon, Jun 21, 2021 at 06:19:15PM +0800, Wu, Hao wrote: > > > > > Subject: [PATCH 2/4] fpga: dfl: Move DFH header register macros to > > > linux/dfl.h > > > > > > > > > > From: Debarati Biswas > > > > > > > > > > Device Feature List (DFL) drivers may be defined in subdirectories other > > > > > than drivers/fpga, and each DFL driver should have access to the Device > > > > > Feature Header (DFH) register, which contains revision and type > > > > > information. This change moves the macros specific to the DFH register > > > > > from drivers/fpga/dfl.h to include/linux/dfl.h. > > > > > > > > Looks like it requires to access the revision info in the next patch, because > > > > current dfl_device doesn't expose related information. > > > > > > > > @Yilun, do you have any concern to expose those info via dfl_device? > > > > > > Exposing these header register definitions are good to me. These registers > > > are in DFL device's MMIO region, so it is good to share these info with > > > all DFL drivers. > > > > I mean expose revision via dfl_device, as dfl core already reads the DFL > > header, it sounds duplicate read in each dfl device driver. And if we > > consider this as a common need from dfl device driver, then the code > > can be moved to a common place as well. > > > > I hope from dfl device driver side, it doesn't need to know details of > > how DFH register is defined, only simple way from dfl device data > > structure or some simple helper function, then dfl device driver could > > know all common information from DFH. > > > > How do you think? It's good idea. > > struct dfl_device {} already has "u16 type" and "u16 feature_id", so it would make sense to add "u8 feature_rev" as well? I think we may name it "u8 revision". Thanks, Yilun > > // Martin