Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2588064pxb; Mon, 17 Jan 2022 01:30:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJzK0pg3t47kED04RG+YKsdEF2hCrC8iuSInz1Z1j0fhEbXBQEd7u5AMFQzmNJktpyrMkvVV X-Received: by 2002:a05:6a00:16c7:b0:4a4:edfe:4625 with SMTP id l7-20020a056a0016c700b004a4edfe4625mr20084510pfc.58.1642411821327; Mon, 17 Jan 2022 01:30:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642411821; cv=none; d=google.com; s=arc-20160816; b=LlPzxrpjo58Fk8ZtHVpWsE/EOP3qT9Elz7DWuJirSLy3BZqm/puHaG16p6hCF61xye 4n61iiyp3oPkBGEPsrPFSAWWFpP6n25k340yOFv+Flxs/r+n9/BpVpfWmXRW9WP903JJ XUy/ZZ9H5edq3W3LNz9YeQlRhvg5cINhGjdCpAuJ/Y4aOhF6cYxjv0GeU7OnRHDoLEd/ ZsgU7W2GO9COoT6uRQyvV5IY6gyHCZwu+3q7PrITaM5cHg9cpiYKhs+nu454+uCMDrJP Ny1Mvg21Xo4Q7IQe3Vgpk7ydNq5KpMuZj/CKY2n7T9DDJauIE6aJY1rOPR2GvoVSP8tW 1OcA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=3+E1HqsWCZERoZJOOFMC6HqdsCkaBNIfWbIAQ2F13wk=; b=UmOcLDeIt+LsOaZuFUzkMTkAbSKd+3skWv0GyIukyUogDtDP7nOvpzNebSrHeFeHWM ZVyTK4s9XQ9DuMqeT9MBNlt/tv5tQdGs8BQuhmMmSsQtZJQ+Z3KXvBlej4sudo2GKxMo I5hRMBPUtvaDz/zM7D11orlSPy7OdlFrBRbviMlkDq9yvDyMaMMVSG7n45CETJSsuaqZ jOZNAjD3r9lAh+QtcXUC93nM9meV6/1p7uiJcjsSc7G95fZ7u086EVmOrShN0gFWvb6f C8irVRhQLPvxUu3SyczP4Kk48I7QYijksuAtC643h81p9QT63w8YqGUR7ycbf5HbatzL rRgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IBZK89MD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d20si13203636pgl.159.2022.01.17.01.30.09; Mon, 17 Jan 2022 01:30:21 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IBZK89MD; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235933AbiAPRwB (ORCPT + 99 others); Sun, 16 Jan 2022 12:52:01 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:52130 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231300AbiAPRwA (ORCPT ); Sun, 16 Jan 2022 12:52:00 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C5DBDB80D89 for ; Sun, 16 Jan 2022 17:51:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2176C36AE9; Sun, 16 Jan 2022 17:51:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642355518; bh=e196+80gZDFY6t38nfH8INeMt4XIIH4zE3u56D+0ETk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IBZK89MD3fkHSnoBqePCmvh9XjBqaAo8v8fFwWAYKowaOMQMa9/l7IMebZ9BRMc5F I0HUJq5SMrhZGzA3YtUepSIJ7lAheItdpax5zyb/pOCo1N3poD7f+V4c0X5oz9OwTg g6+KAPNwz3eOdF1G3GDcxWtCz8V9bsUM/CGO3qXbkLRLYYE2sdhzc08YmleiuLKaGD nmf+Oq/BynP9Lg1ot9oGddsNF02SqGJPT4kEHnIu3Pqmyy4WGg7PgohUw0hi3xh/ak u0JUirbyMkBpT5fNufTQItJ8b3GhQTZgWMhOPyN7KoxzFsii0rm86JnsULxB4c2Bzy gJdclsJPxg3iA== Date: Sun, 16 Jan 2022 17:57:56 +0000 From: Jonathan Cameron To: Gwendal Grignou Cc: Mauro Carvalho Chehab , Dmitry Torokhov , bleung@chromium.org, groeck@chromium.org, myungjoo.ham@samsung.com, cw00.choi@samsung.com, benjamin.tissoires@redhat.com, hverkuil-cisco@xs4all.nl, lee.jones@linaro.org, pmalani@chromium.org, sre@kernel.org, thierry.reding@gmail.com, u.kleine-koenig@pengutronix.de, lgirdwood@gmail.com, a.zummo@towertech.it, cychiang@chromium.org, perex@perex.cz, linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/17] Add export symbol namespace PL_CHROMEOS Message-ID: <20220116175756.54919398@jic23-huawei> In-Reply-To: References: <20220105220653.122451-1-gwendal@chromium.org> <20220106110558.49dd6f26@coco.lan> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 10 Jan 2022 01:31:23 -0800 Gwendal Grignou wrote: > On Thu, Jan 6, 2022 at 2:06 AM Mauro Carvalho Chehab wrote: > > > > Em Wed, 5 Jan 2022 20:26:36 -0800 > > Gwendal Grignou escreveu: > > > > > On Wed, Jan 5, 2022 at 2:58 PM Dmitry Torokhov wrote: > > > > > > > > Hi Gwendal, > > > > > > > > On Wed, Jan 5, 2022 at 2:07 PM Gwendal Grignou wrote: > > > > > > > > > > Add a symbol namespace for functions exported by the plaform chromeos > > > > > subsystem. > > > > > > > > It would be great to explain why this is needed/desirable. What are > > > > the benefits of introducing this namespace? What problem are you > > > > trying to solve? > > > The issue came when reviewing an iio sensor > > > (https://www.spinics.net/lists/linux-iio/msg66280.html). I wanted to > > > be ahead of the curve (for once). > > > > Patch 01 should clearly document the reason why this is needed. > > Yet, see below. > > > > While I see value on using namespaces, we should have extra care when > > this is used for kAPIs designed for a product/system. I mean, what > > prevents that the affected drivers won't support some day different > > non-ChromeOS products? We have a media driver originally written to > > work with the One Laptop Per Children hardware, that used some > > product-specific kAPIs, that were extended a couple years later to > > cover different types of hardware. > > > > What happens if some day, a driver introduced to be used on a ChromeOS > > hardware would also be used by a non-ChromeOS hardware? This could > > become messy as times goes by. Hi Mauro, I'm not sure I see why this case is a problem or any worse than the namespacing that already exists in the function names. We name a lot of stuff after first device that used it and some of it lives for ever. Sure, sometime it makes sense to rename when something becomes more generic, but we can do that here as needed. > > > > Instead, IMO, it would make sense to have per-subsystem namespaces. > > So, for instance, placing iio under an IIO-specific namespace > > (and the same for other subsystems) makes more sense on my > > eyes, as the namespace boundary will be clearer, and an IIO driver > > will always be IIO, no matter on what hardware such driver would > > be used. > I based this patchset on the current/future use in the IIO subsystem, > where the namespaces are used for small subsystem like HID, > IIO_HID_ATTRIBUTES, or code shared among sensors drivers of the same > vendor (LTC2497, more to come). Not particularly intended to be vendor based, more library module and client of library cases. Obviously it's relatively rare for multiple vendors to produce IIO devices that are sufficiently compatible to share code beyond the IIO core, but it does happen. In that particular case the library is called LTC2497 as it was the first part to use it it and there wasn't a sensible generic name. Vast majority of IIO cases will be a core module exporting stuff to i2c and spi specific modules. We have drivers named after a particular part that support parts from multiple vendors of many different names. So in a similar fashion I'm not that worried about having some future driver have to include one of the namespaces that is named after some other part. Perhaps the issue here is that the chromeos platform stuff has a name tightly coupled to a somewhat 'generic' but also somewhat closed hardware ecosystem? (Not really relevant here but I do longer term plan to move the main IIO core into a namespace, but focusing on the smaller cases first as I think both are valid). So I'm in support of this series but maybe you are right in waiting for the dust to settle :) Note I'd also like to see an IIO_CHROMEOS or similar NS for the symbols exported by cros_ec_sensors_core.c. Eventually I'd expect some of the IIO chromeos modules to have MODULE_IMPORT_NS(IIO); MODULE_IMPORT_NS(IIO_CHROMEOS); MODULE_IMPORT_NS(PL_CHROMEOS); and probably some others... Jonathan > Since the usage of namespace in the kernel is not clearly defined yet, > I wait for the dust to settle and more usage to emerge before tuning > this patchset. > > Thanks, > Gwendal. > > > > Thanks, > > Mauro