Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp401147imm; Thu, 6 Sep 2018 04:26:03 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZYAWeDnFyQw1sb9ReCVCbhuywO2NUKldinR7lz9GonJud8SR3avwYOqEOnWnIrhD2jcVIb X-Received: by 2002:a63:3741:: with SMTP id g1-v6mr2237390pgn.59.1536233163442; Thu, 06 Sep 2018 04:26:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536233163; cv=none; d=google.com; s=arc-20160816; b=Ux1NmNMbyv4LGyJp6B0dSQO9/eXP5IEvFfm2VKQAVX5wE2ApR7M5TP4OmELi+enyF4 9LI0PMS4BbTOp6Uuwh9IEDoUCO5U9HSVHIw39W4d/e1dsVX8A1M9VStfnHQBahTFIZTf +rZeTjXBA7O3gkFGZ2/8HNWZYuykUAac/5Q7UC7xkBqByun9i2o94Jf6J7WVeWCmFb9v wGtHYNEK6Be/pLJgvmpjtqJv8x0+8xEzggr+qCrIumRu4R4ak68uIzSJss0YZoc4Ld4g rrhQBqZFwv2/ZKqJyX5RytC2kDcOtlG0nFyl4+oJ9HIeiGvF0wOmgofC+SwZDBTY0e8V kA+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=qLxjrXRdoGff9rqT4C7iBjdkj+/Dau+xmXw4cL6Ygks=; b=J5tws5F67qutMwJXJnRmfnB8dFNWunulg6CGhkImoOEyo1vEOuJ1ySOkq4n8ovpaGf IUyg2ewbq1Yc7C2HlVvpZ2oPl4ocntn4zHtvCPm5jvP+2AOJWkwowBjIvq7kaLWzACyJ ixPGs+5IQQyQGWiMwwr1+jKkTefZrnhi1ywQQH7j7qmh3Pl/p6yl0k+f3ibiK3o+lGFe pNuRoIVFrs1tZCWCTXT77ND67foHYIQBFr0mdkCjQE7NQmShG+DJFey+ziFZitkHDVZO n3goFELYd3kiivtqD4OUwS4LmZkUZ8VC2sic8OPGkqHHEsn6lZakWdYqWe/Fg75a5xNh lZTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j64-v6si4393767pgd.199.2018.09.06.04.25.47; Thu, 06 Sep 2018 04:26:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727994AbeIFPm5 (ORCPT + 99 others); Thu, 6 Sep 2018 11:42:57 -0400 Received: from mga07.intel.com ([134.134.136.100]:62654 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725978AbeIFPm5 (ORCPT ); Thu, 6 Sep 2018 11:42:57 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Sep 2018 04:08:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,337,1531810800"; d="scan'208";a="67995132" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga007.fm.intel.com with SMTP; 06 Sep 2018 04:07:57 -0700 Received: by lahna (sSMTP sendmail emulation); Thu, 06 Sep 2018 14:07:56 +0300 Date: Thu, 6 Sep 2018 14:07:56 +0300 From: Mika Westerberg To: Lukas Wunner Cc: linux-kernel@vger.kernel.org, Andreas Noever , Michael Jamet , Yehezkel Bernat , Lu Baolu Subject: Re: [PATCH 2/2] thunderbolt: Initialize after IOMMUs Message-ID: <20180906110756.GY2283@lahna.fi.intel.com> References: <20180903132012.23531-1-mika.westerberg@linux.intel.com> <20180903132012.23531-2-mika.westerberg@linux.intel.com> <20180905084746.xmckzskxzsdliz3e@wunner.de> <20180905094602.GH2283@lahna.fi.intel.com> <20180906081337.3mosfpfggfmoj633@wunner.de> <20180906103602.GV2283@lahna.fi.intel.com> <20180906110049.gfdhurvkvvdjw7zh@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180906110049.gfdhurvkvvdjw7zh@wunner.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 06, 2018 at 01:00:49PM +0200, Lukas Wunner wrote: > On Thu, Sep 06, 2018 at 01:36:02PM +0300, Mika Westerberg wrote: > > On Thu, Sep 06, 2018 at 10:13:37AM +0200, Lukas Wunner wrote: > > > So with this patch, you rely on the linker ordering nhi_init() after > > > ir_dev_scope_init(), however to the best of my knowledge the link > > > order is not guaranteed. > > > > What says that? > > Within the same initcall level, the ordering is determined by the Makefile > AFAIK. Someone changes the Makefile, your dependency scheme falls apart. There are other drivers doing the same so they would fail as well. It is common practice AFAIK. > > > Looking at commit acb40d841257, which started this, I'm wondering > > > why you did not simply export tbnet_init() and call it from the > > > thunderbolt driver after the property stuff has been fully set up? > > > After all, thunderbolt-net is useless without thunderbolt or am I > > > missing something? Then you could revert back to module_init(). > > > > The same reason you don't call PCI driver functions from PCI core. It > > makes absolutely zero sense. > > > > Thunderbolt is bus and provides driver API to drivers. We hopefully are > > getting other service drivers (say SCSI over TBT) that are going to be > > use the same interfaces. > > Then add a blocking notifier chain into which these service drivers can > hook. Other buses have that as well. It is really too complex to add notifier just for that. This works fine and is not against any kernel principles I am aware of.