From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751440AbbCTR7O (ORCPT ); Fri, 20 Mar 2015 13:59:14 -0400 Received: from smtprelay0046.hostedemail.com ([216.40.44.46]:44439 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750993AbbCTR7L (ORCPT ); Fri, 20 Mar 2015 13:59:11 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1500:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3871:3872:4250:4321:4605:5007:6119:6261:10004:10400:10848:11026:11232:11233:11473:11658:11914:12043:12296:12438:12517:12519:12740:13019:13972:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: judge71_328f930f4d728 X-Filterd-Recvd-Size: 3619 Message-ID: <1426874345.21142.37.camel@perches.com> Subject: Re: [PATCH v1 07/11] intel_th: Add Global Trace Hub driver From: Joe Perches To: Alexander Shishkin Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org, pebolle@tiscali.nl, peter.lachner@intel.com, norbert.schulz@intel.com, keven.boell@intel.com, yann.fouassier@intel.com, laurent.fert@intel.com Date: Fri, 20 Mar 2015 10:59:05 -0700 In-Reply-To: <1426872598-68807-8-git-send-email-alexander.shishkin@linux.intel.com> References: <1426872598-68807-1-git-send-email-alexander.shishkin@linux.intel.com> <1426872598-68807-8-git-send-email-alexander.shishkin@linux.intel.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2015-03-20 at 19:29 +0200, Alexander Shishkin wrote: > Global Trace Hub (GTH) is the central component of Intel TH architecture; > it carries out switching between the trace sources and trace outputs, can > enable/disable tracing, perform STP encoding, internal buffering, control > backpressure from outputs to sources and so on. trivia: > diff --git a/drivers/hwtracing/intel_th/gth.c b/drivers/hwtracing/intel_th/gth.c > +struct gth_output { > + struct gth_device *gth; > + struct intel_th_output *output; > + unsigned int index; > + unsigned int port_type; > + unsigned long master[TH_CONFIGURABLE_MASTERS + 1 / > + BITS_PER_LONG]; DECLARE_BITMAP(master, TH_CONFIGURABLE_MASTERS+ 1); ? > +}; > + > +/** > + * struct gth_device - GTH device > + * @dev: driver core's device > + * @base: register window base address > + * @output_group: attributes describing output ports > + * @master_group: attributes describing master assignments > + * @output: output ports > + * @master: master/output port assignments > + * @gth_lock: serializes accesses to GTH bits > + */ > +struct gth_device { > + struct device *dev; > + void __iomem *base; > + > + struct attribute_group output_group; > + struct attribute_group master_group; > + struct gth_output output[TH_POSSIBLE_OUTPUTS]; > + signed char master[TH_CONFIGURABLE_MASTERS + 1]; why signed? [] > +#define OUTPUT_PARM(_name, _mask, _r, _w) \ > + [TH_OUTPUT_PARM(_name)] = { .name = __stringify(_name), \ > + .mask = (_mask), \ > + .readable = (_r), \ > + .writable = (_w) } > + > +static struct output_parm { const > + const char *name; > + unsigned int mask; > + unsigned int readable : 1, > + writable : 1; > +} output_parms[] = { > + OUTPUT_PARM(port, 0x7, 1, 0), > + OUTPUT_PARM(null, BIT(3), 1, 1), > + OUTPUT_PARM(drop, BIT(4), 1, 1), > + OUTPUT_PARM(reset, BIT(5), 1, 0), > + OUTPUT_PARM(flush, BIT(7), 0, 1), > +}; [] > +static int intel_th_master_attributes(struct gth_device *gth) > +{ > + struct master_attribute *master_attrs; > + struct attribute **attrs; > + int i, nattrs = TH_CONFIGURABLE_MASTERS + 2; > + > + attrs = devm_kzalloc(gth->dev, sizeof(void *) * nattrs, GFP_KERNEL); > + if (!attrs) > + return -ENOMEM; > + > + master_attrs = devm_kzalloc(gth->dev, > + sizeof(struct master_attribute) * nattrs, > + GFP_KERNEL); devm_kcalloc