Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933143AbbGJPTW (ORCPT ); Fri, 10 Jul 2015 11:19:22 -0400 Received: from mail-bl2on0140.outbound.protection.outlook.com ([65.55.169.140]:11776 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754033AbbGJPTO (ORCPT ); Fri, 10 Jul 2015 11:19:14 -0400 From: Roy Pledge To: Paul Bolle CC: "linuxppc-dev@lists.ozlabs.org" , "Scott Wood" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 03/11] soc/fsl: Introduce the DPAA BMan portal driver Thread-Topic: [PATCH 03/11] soc/fsl: Introduce the DPAA BMan portal driver Thread-Index: AQHQuodULTISTIQE6ECwnbfbRzLb6J3UtL2AgAAVKnA= Date: Fri, 10 Jul 2015 15:19:11 +0000 Message-ID: References: <1436473322-21247-1-git-send-email-Roy.Pledge@freescale.com> <1436473322-21247-4-git-send-email-Roy.Pledge@freescale.com> <1436535163.20619.216.camel@tiscali.nl> In-Reply-To: <1436535163.20619.216.camel@tiscali.nl> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: tiscali.nl; dkim=none (message not signed) header.d=none; x-originating-ip: [192.88.168.49] x-microsoft-exchange-diagnostics: 1;CY1PR03MB1487;5:9YI4y8u/HkAQYKQGQsuZU2GZbzpd1XJ69TsWeLbgN2jCUVEWq8NjrwuWNIJp5i9sR+NL5YX/e1wE3M1I4/ToPryKzRaoNPbHAq6VZaUroagi0h47n8qwa2SgdAYBr+vQDTO+3E1ClfRh8OgL4edhdA==;24:WFySGLPiYCb0KNlp0Wx6r+q00M8ZriyvasTv0JKaad4hehNpvSTrL9ANgS8g842UmKxkEAbUa+edfMvo77w/YQ+OUk4MbAlWngJKs1+Nn7Y=;20:qAzs/lqWpduDwdCV6dIzyWlWKOFjSv99I6hTG2b3oI7PzF6kSmTDjpwflXDIDAuQV5ofdugMdj5SymRCSVrpKg== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1487; cy1pr03mb1487: X-MS-Exchange-Organization-RulesExecuted x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:CY1PR03MB1487;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1487; x-forefront-prvs: 06339BAE63 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(13464003)(377454003)(164054003)(24454002)(377424004)(5001960100002)(74316001)(5003600100002)(66066001)(110136002)(62966003)(77156002)(102836002)(2900100001)(2950100001)(77096005)(189998001)(92566002)(5002640100001)(86362001)(76176999)(46102003)(54356999)(19580405001)(33656002)(106116001)(50986999)(40100003)(122556002)(87936001)(2656002)(19580395003)(76576001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR03MB1487;H:BN3PR0301MB1267.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jul 2015 15:19:11.0828 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1487 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id t6AFJRSM008720 Content-Length: 6411 Lines: 270 Paul, Thanks you for your valuable feedback so far. Let me try to address a general issue you mention below: unused exported APIs. The QMan and BMan drivers provide a base layer for other blocks built on top of them, for instance an Ethernet Driver, an Encrypt/Decrypt Engine, a pattern matcher, a compress/decompress engine, etc... Some of these drivers will be presented for review in the near future, but in order to try and layer the review/up streaming process we're presenting each layer as independently as possible. If you really were to start dissecting which APIs are called you would come to a very small set of pieces that merely initialize the hardware but don't provide any opportunity for other users to invoke that HW. I hope that this helps you understand our goals in trying to upstream these drivers. Roy > -----Original Message----- > From: Paul Bolle [mailto:pebolle@tiscali.nl] > Sent: Friday, July 10, 2015 9:33 AM > To: Pledge Roy-R01356 > Cc: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; > netdev@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH 03/11] soc/fsl: Introduce the DPAA BMan portal driver > > On do, 2015-07-09 at 16:21 -0400, Roy Pledge wrote: > > --- a/drivers/soc/fsl/qbman/Kconfig > > +++ b/drivers/soc/fsl/qbman/Kconfig > > > +config FSL_DPA_PIRQ_FAST > > + bool > > + default y > > First used in 04/11. > > > +config FSL_DPA_PIRQ_SLOW > > + bool > > + default y > > + > > +config FSL_DPA_PORTAL_SHARE > > + bool > > + default y > > As in 02/11: these three symbols function as aliases for FSL_DPA. Why are > they needed? > > > config FSL_BMAN > > tristate "BMan device management" > > default n > > help > > FSL DPAA BMan driver > > > > +config FSL_BMAN_PORTAL > > + tristate "BMan portal(s)" > > + default n > > + help > > + FSL BMan portal driver > > > --- /dev/null > > +++ b/drivers/soc/fsl/qbman/bman_api.c > > > +struct bman_portal { > > + [...] > > +#ifdef CONFIG_FSL_DPA_CAN_WAIT_SYNC > > This check will always evaluate to true, right? (I'll only report this > once.) > > > + struct bman_pool *rcri_owned; /* only 1 release WAIT_SYNC at > > a time */ > > +#endif > > +#ifdef CONFIG_FSL_DPA_PORTAL_SHARE > > Ditto. > > > + raw_spinlock_t sharing_lock; /* only used if is_shared */ > > + int is_shared; > > + struct bman_portal *sharing_redirect; #endif > > + [...] > > +}; > > > +const struct bman_portal_config *bman_get_portal_config(void) { > > + [...] > > +} > > I couldn't find callers of this function. > > > +EXPORT_SYMBOL(bman_get_portal_config); > > Nor users of this export, obviously. > > > + > > +u32 bman_irqsource_get(void) > > +{ > > + [...] > > +} > > Ditto. > > > +EXPORT_SYMBOL(bman_irqsource_get); > > Ditto. > > > +int bman_p_irqsource_add(struct bman_portal *p, __maybe_unused u32 > > +bits) { > > + [...] > > +} > > +EXPORT_SYMBOL(bman_p_irqsource_add); > > There seem to be no users of this export. > > > +int bman_irqsource_add(__maybe_unused u32 bits) { > > + [...] > > +} > > Unused. > > > +EXPORT_SYMBOL(bman_irqsource_add); > > Ditto. > > > +int bman_irqsource_remove(u32 bits) > > +{ > > + [...] > > +} > > Ditto. > > > +EXPORT_SYMBOL(bman_irqsource_remove); > > Ditto. > > > +u32 bman_poll_slow(void) > > +{ > > + [...] > > +} > > Ditto. > > > +EXPORT_SYMBOL(bman_poll_slow); > > Ditto. > > > +void bman_poll(void) > > +{ > > + [...] > > +} > > Ditto. > > > +EXPORT_SYMBOL(bman_poll); > > Ditto. > > > +static inline struct bm_rcr_entry *try_rel_start(struct bman_portal > > +**p, #ifdef CONFIG_FSL_DPA_CAN_WAIT > > Always true, right? > > > + __maybe_unused struct bman_pool > *pool, #endif > > + __maybe_unused unsigned long > *irqflags, > > + __maybe_unused u32 flags) > > And this is a, well, novel way to declare a function. > > > +{ > > + [...] > > +} > > > +int bman_flush_stockpile(struct bman_pool *pool, u32 flags) { > > + [...] > > +} > > Unused function. > > > +EXPORT_SYMBOL(bman_flush_stockpile); > > So unused export too. > > > +#ifdef CONFIG_FSL_BMAN > > +u32 bman_query_free_buffers(struct bman_pool *pool) { > > + return bm_pool_free_buffers(pool->params.bpid); > > +} > > +EXPORT_SYMBOL(bman_query_free_buffers); > > + > > +int bman_update_pool_thresholds(struct bman_pool *pool, const u32 > > +*thresholds) { > > + u32 bpid; > > + > > + bpid = bman_get_params(pool)->bpid; > > + > > + return bm_pool_set(bpid, thresholds); } > > +EXPORT_SYMBOL(bman_update_pool_thresholds); > > More of the same. > > > +#endif > > > --- /dev/null > > +++ b/drivers/soc/fsl/qbman/bman_portal.c > > > > +module_driver(bman_portal_driver, > > + bman_portal_driver_register, platform_driver_unregister); > > No MODULE_LICENSE() here, nor in the other files that make up this module. > So loading this module will trigger a warning and taint the kernel. > > > --- /dev/null > > +++ b/drivers/soc/fsl/qbman/bman_utils.c > > > +EXPORT_SYMBOL(bman_alloc_bpid_range); > > Unused export. > > > +EXPORT_SYMBOL(bman_release_bpid_range); > > Ditto. > > > +EXPORT_SYMBOL(bman_seed_bpid_range); > > Ditto. > > > +int bman_reserve_bpid_range(u32 bpid, u32 count) { > > + return dpaa_resource_reserve(&bpalloc, bpid, count); } > > +EXPORT_SYMBOL(bman_reserve_bpid_range); > > Because bman_reserve_bpid() is unused, see below, this function and this > export are unused too. > > > --- /dev/null > > +++ b/drivers/soc/fsl/qbman/dpaa_resource.c > > > > +#if defined(CONFIG_FSL_BMAN_PORTAL) || > > +defined(CONFIG_FSL_BMAN_PORTAL_MODULE) > > #if IS_ENABLED(CONFIG_FSL_BMAN_PORTAL) > > > +#ifdef DPAA_RESOURCE_DEBUG > > Never defined. So DUMP() is dead code. > > > --- a/drivers/soc/fsl/qbman/dpaa_sys.h > > +++ b/drivers/soc/fsl/qbman/dpaa_sys.h > > > > +#define CONFIG_TRY_BETTER_MEMCPY > > Please replace the CONFIG_ prefix with something else. > > > +#ifdef CONFIG_TRY_BETTER_MEMCPY > > This will always be true, right? > > > [...] > > +#else > > +#define copy_words memcpy > > +#define copy_shorts memcpy > > +#define copy_bytes memcpy > > +#endif > > > --- /dev/null > > +++ b/include/soc/fsl/bman.h > > > +static inline int bman_reserve_bpid(u32 bpid) { > > + return bman_reserve_bpid_range(bpid, 1); } > > Unused. > > Thanks, > > > Paul Bolle ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?