Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp107354iof; Sun, 5 Jun 2022 22:36:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGeaO6ac379Wla3U4bY6Fb8AWONcz7glmSKcfYzq5J+JKdEui0vLHGOaptarvQ7XD0tRSZ X-Received: by 2002:a17:903:3015:b0:163:c6a5:dcb with SMTP id o21-20020a170903301500b00163c6a50dcbmr22875929pla.38.1654493782811; Sun, 05 Jun 2022 22:36:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654493782; cv=none; d=google.com; s=arc-20160816; b=lpkgit9KJPm5Qm4ORcS1Qfml9kCehk2NQOfEczhnojPq/0jXjUCzvmw+2bnDiQ/0bO ibWufmyXRJxcQaY5jSerdg/VVmfEcnDnt//jmzCrTiFZLkJd88amKph626Cy2BcsDgHq ZdVlbmRSk0AS50oH8bvsnmyppK8PO5CRuqzwQeexNHjep94SxO08Yl0R2YhHk6FEsMT5 kW3lkQ6YHpjpMDeBI50ub2qPJ4AgwW8ItB8ZjEmAh1YFA4SbkmOzfRcfiLEHTKbDsvo8 kW7oykRy0IHs90XJjdPn5AUpAA/b0SMp6JhtZR8pFYp2e2+41fYTHEca7tx16Toq2iJj D/kw== 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=1P0EOqoMenL4iN/lqN045eGHbOBjTvEpPiW5GDycgOQ=; b=hi77r5Lw5yjOPVzuUAbVpaAQSv0MRYB4YtUbnJBJ0SmSHtq6p9fqS9uvZxjkTrpUMK vS5MgFJBNdBc+okBz+y3Fp6QQ47Tmz7Jo9ugiNglt50Ml8kSB8cQiafYAAASUb4XPgfi UIeRn/Msv7GO84NZyV4ymugOJxb44wElVdxEuqzXwasKj37p+eJg2PcsDLHas67ZWnik Ia62QMMUK1CUcq8KfWfMpTE5coa/rSS/0JRSQJee2iPXpc7837iacs4fr4NXcXP7ZnyM l3QgfGYWekKNQJllNgQe1Cu+MBcKh3zRXWuApysdfL8TiL7As//SNaRfX+L8OhnuOy35 1h+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rRJQ3cX1; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id l9-20020a170902f68900b0015ebfc18d5esi21353144plg.582.2022.06.05.22.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 22:36:22 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rRJQ3cX1; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9822B996A0; Sun, 5 Jun 2022 21:36:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236765AbiFDNvM (ORCPT + 99 others); Sat, 4 Jun 2022 09:51:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236674AbiFDNu5 (ORCPT ); Sat, 4 Jun 2022 09:50:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 285DE30F7E; Sat, 4 Jun 2022 06:50:55 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id B3F0160BC1; Sat, 4 Jun 2022 13:50:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1901EC385B8; Sat, 4 Jun 2022 13:50:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654350654; bh=d6+D9ng5G1Kvhv1UO7/YcgjRZpugrzbBdMNBiqJuB18=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=rRJQ3cX19WpPecZLsN4cJv41ZObrO0bpm26XzveAU8NalBZgJySQakI1qVP2G2tg0 ZAPFPZ3+QpnJeGm96OoNAdJrzi3K/wwu/gxo/I4HSODUaTg0KiIKxE7RRDc1H6TWAy 0Vd1cTikIpfUdA9QLZl6rq0N1N0gNjz9DkHQZ289M4m4+LNaRqaxDwVgJu71azxya6 /XRgh7DD1AOV701YIeUCxFrTR1ni71d+PVGfJTuZD56UFDG7p1C9KBo51G6Y/sQLUw 4lfoXiXhg1Ba3Rui3USeKL77quzEonZ9N3jQqUU6V0RjrKe3fYYPebestq/XYNeQRq ZO/aohFuBpnMA== Date: Sat, 4 Jun 2022 14:59:55 +0100 From: Jonathan Cameron To: Dmitry Rokosov Cc: "robh+dt@kernel.org" , "lars@metafoo.de" , "andy.shevchenko@gmail.com" , "noname.nuno@gmail.com" , "linux-iio@vger.kernel.org" , kernel , "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH v1] iio: trigger: move trig->owner init to trigger allocate() stage Message-ID: <20220604145955.2a1108ca@jic23-huawei> In-Reply-To: <20220601174837.20292-1-ddrokosov@sberdevices.ru> References: <20220601174837.20292-1-ddrokosov@sberdevices.ru> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Wed, 1 Jun 2022 17:48:32 +0000 Dmitry Rokosov wrote: > To provide a new IIO trigger to the IIO core, usually driver executes the > following pipeline: allocate()/register()/get(). Before, IIO core assigned > trig->owner as a pointer to the module which registered this trigger at > the register() stage. But actually the trigger object is owned by the > module earlier, on the allocate() stage, when trigger object is > successfully allocated for the driver. > > This patch moves trig->owner initialization from register() > stage of trigger initialization pipeline to allocate() stage to > eliminate all misunderstandings and time gaps between trigger object > creation and owner acquiring. > > Signed-off-by: Dmitry Rokosov Hi Dmitry, I 'think' this is fine, but its in the high risk category that I'd like to keep it on list for a few weeks before applying. Note I'm still keen that in general we keep the flow such that we do allocate()/register()/get() as there is no guarantee that the get() will never do anything that requires the trigger to be registered, even though that is true today. Which is another way of saying I'm still keen we fix up any cases that sneak in after your fix up set dealt with the current ones. Thanks for following up on this! Jonathan