From owner-freebsd-arm@freebsd.org Wed Aug 9 22:39:25 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B82ADD762C for ; Wed, 9 Aug 2017 22:39:25 +0000 (UTC) (envelope-from freebsdnewbie@freenet.de) Received: from mout2.freenet.de (mout2.freenet.de [IPv6:2001:748:100:40::2:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "*.freenet.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5AF56340E; Wed, 9 Aug 2017 22:39:24 +0000 (UTC) (envelope-from freebsdnewbie@freenet.de) Received: from [195.4.92.142] (helo=mjail2.freenet.de) by mout2.freenet.de with esmtpa (ID freebsdnewbie@freenet.de) (port 25) (Exim 4.89 #1) id 1dfZdI-0005lT-QA; Thu, 10 Aug 2017 00:39:20 +0200 Received: from localhost ([::1]:48457 helo=mjail2.freenet.de) by mjail2.freenet.de with esmtpa (ID freebsdnewbie@freenet.de) (Exim 4.85 #1) id 1dfZbW-0005eK-4E; Thu, 10 Aug 2017 00:37:30 +0200 Received: from mx5.freenet.de ([195.4.92.15]:56564) by mjail2.freenet.de with esmtpa (ID freebsdnewbie@freenet.de) (Exim 4.85 #1) id 1dfZY2-00011U-RQ; Thu, 10 Aug 2017 00:33:55 +0200 Received: from p5ddd5df9.dip0.t-ipconnect.de ([93.221.93.249]:16225 helo=[192.168.178.45]) by mx5.freenet.de with esmtpsa (ID freebsdnewbie@freenet.de) (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (port 587) (Exim 4.89 #1) id 1dfZY8-0004dx-Jg; Thu, 10 Aug 2017 00:34:00 +0200 Subject: Re: devicetree vs. MODULE_DEPEND To: Ian Lepore References: <20170809205919.GA62042@freebsd-t420.fritz.box> <1502315961.50720.75.camel@freebsd.org> Cc: freebsd-arm@freebsd.org From: =?UTF-8?Q?Manuel_St=c3=bchn?= Message-ID: <4bde70fb-04e4-7d1d-ad5b-3a8f80d6993e@freenet.de> Date: Thu, 10 Aug 2017 00:33:25 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1502315961.50720.75.camel@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originated-At: 93.221.93.249!16225 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Aug 2017 22:39:25 -0000 On Wed, 09 Aug 2017 15:59:21 -0600, Ian Lepore wrote > On Wed, 2017-08-09 at 22:59 +0200, Manuel Stühn wrote: >> Hi list, >> >> is it correct, that the sequence in the devicetree-blob defines the >> probing sequence without considering the MODULE_DEPEND-macro? >> >> I stumbled over an unexpected behavior during the ti_pruss-driver >> development. Because the ti-pruss is gone in the default devicetree, >> I >> activate it via the overlay-framework and put it to the address >> "/ocp/pruss@4a300000". The devicetree-blob contains the entry and >> the >> driver gets probed, but it fails to enable its clock. >> This is quite obvious as according to dmesg the am335x_prcm0 is >> probed >> _after_ the ti_pruss0 device. So I tried to handle this by adding an >> explicit dependency to ti_prcm into the ti_pruss driver like: >> MODULE_DEPEND(ti_pruss, ti_prcm, 1, 1, 1); >> >> It compiles cleanly, unfortunately this changes nothing. Only placing >> it >> in the devicetree after the prcm-node or loading it as a module >> after >> the OS booted up makes the device probe correctly. >> >> Any ideas? > > MODULE_DEPEND only affects the kernel linker. It ensures that other > modules you depend on automatically get loaded along with your module. > > Try the attached patch to ensure that the clocks driver is loaded > earlier than drivers that might rely on it. > The patch works for me, thanks for your help!