Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2120660rwl; Mon, 26 Dec 2022 09:09:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXu+4C8fJV1N9+k7JkkSW1FUhWSfZUPXv6G6obytnUlsjTFoPTs4YG8Plrc/PP+EMaUP5+kv X-Received: by 2002:a17:902:6b02:b0:191:1c99:57ef with SMTP id o2-20020a1709026b0200b001911c9957efmr22772696plk.67.1672074580452; Mon, 26 Dec 2022 09:09:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672074580; cv=none; d=google.com; s=arc-20160816; b=t9+1TZQB5tg/6/+ifFpFYoWmBFusND5iCYMHbFmlJmT66q2hx8lF3Jay3yYFawI0VI U/7Dnn+4wIGLAZ18P/jW9kpMFWU0dQD+fAFulYUG/GoLZm3dYi6VplP2WUmiYBOoDGcJ T5Tu4C423SqqO90iamLJVDinCjGShVEfNIv4kCo/LKOSZzmJHHpF5vt/iKLqOgVWAFjU vE2tYLlORvLdUG9AO7CXt+rqIrj3CidofPDdydNDltvQuxukWTgxiqByiynVob+M+puC 0jbQA1x23UYVqmW3A1wO86CPwqJv5zxQojQd7Px/NFKjnu3NPaKDu4cMviM99fh/kltl 17zQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PbjJKqFwfp3UheVEqCOI+Yp3UroBbHgfPrJsMoO5Ahg=; b=Jk5WzoBdUmR65oMH3X3LHMGJXZT98MDy6HHPyRZIUkJNiAbxBLVRKmf0z9fWYviVCY pL7pnOXHfRf5xDbaUhgphc//mGHVl5QaoI7t9cDPY0L0Zt+Iozs1u/yd7ADhkC1t4gYI 33rYaO9YbmpkYn1hJJyG2LuqPZ+ZTMhtjHawm5tfyNNWowY+/mdsaEyiX96i4wls1Y/w 2jJqdXsad8aWqGRuVBWHS/ozPblRFw9/YmWUng1a0bdbUH4qPnhRi8KvEDJU4tvS+66J 9MCUddxxZ6MSt61/EjtFTYNOisidX+LPEHSzItfpFKhbB+ArQNErZzOGFrsiDkv/4lMc TagA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=KectF7bJ; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j4-20020a170902c3c400b001867ea919bdsi11186418plj.25.2022.12.26.09.09.31; Mon, 26 Dec 2022 09:09:40 -0800 (PST) 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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=KectF7bJ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232117AbiLZQy5 (ORCPT + 66 others); Mon, 26 Dec 2022 11:54:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232167AbiLZQyp (ORCPT ); Mon, 26 Dec 2022 11:54:45 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB4FB10A7; Mon, 26 Dec 2022 08:54:44 -0800 (PST) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 58B3C74C; Mon, 26 Dec 2022 17:54:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1672073681; bh=DoKtyUoObjPWlt/9rVCapOp/FYV2kaTGbH2l0JepNuo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KectF7bJdp0Yp1H/3XzbxTtk5jVa5BmGJPqp6hvhEh2ksCMOnWxQcSrBhSf7NFub1 /fE1LP6tk3yxL3J67Tv9fpe0DhGRfQvTxNKavcYSFmCLqqc+pteJW7KqqsSakdmEi+ t+VK5iIofn3L2vLHYisq6D5RJWHz/iOkLIMM3oWE= Date: Mon, 26 Dec 2022 18:54:37 +0200 From: Laurent Pinchart To: Andy Shevchenko Cc: Luca Ceresoli , Tomi Valkeinen , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Wolfram Sang , Matti Vaittinen , Mauro Carvalho Chehab , Peter Rosin , Liam Girdwood , Mark Brown , Sakari Ailus , Michael Tretter , Shawn Tu , Hans Verkuil , Mike Pagano , Krzysztof =?utf-8?Q?Ha=C5=82asa?= , Marek Vasut , Luca Ceresoli Subject: Re: [PATCH v5 1/8] i2c: core: let adapters be notified of client attach/detach Message-ID: References: <20221208104006.316606-1-tomi.valkeinen@ideasonboard.com> <20221208104006.316606-2-tomi.valkeinen@ideasonboard.com> <20221219095143.4b49b447@booty> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS 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 Mon, Dec 19, 2022 at 11:48:51AM +0200, Andy Shevchenko wrote: > On Mon, Dec 19, 2022 at 09:51:43AM +0100, Luca Ceresoli wrote: > > On Sun, 11 Dec 2022 18:55:39 +0200 Laurent Pinchart wrote: > > > On Thu, Dec 08, 2022 at 12:39:59PM +0200, Tomi Valkeinen wrote: > > ... > > > > This may be a stupid question, but couldn't you instead use the > > > BUS_NOTIFY_ADD_DEVICE and BUS_NOTIFY_DEL_DEVICE bus notifiers ? > > > > I'm not sure they would be the correct tool for this task. Bus > > notifiers inform about new events on the 'struct bus_type, i.e. any > > event on the global i2c bus type. In the i2c world this means being > > notified about new _adapters_, which is exactly what > > drivers/i2c/i2c-dev.c does. > > > > Here, however, we need to be informed about new _clients_ being added > > under a specific adapter. > > This is for example exactly what ACPI integration in I2C framework does. But... > > > I'm not sure whether the bus notifiers can > > inform about new clients in addition of new adapters, but they at least > > seem unable to provide per-adapter notification. > > ...personally I don't like notifiers, they looks like overkill for this task. But isn't this patch essentially implementing a custom notification system ? If we need notifiers, why would it be better to add an ad-hoc API for I2C instead of using bus notifiers ? > > Does that seem correct? -- Regards, Laurent Pinchart