From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752062AbcGXQ1c (ORCPT ); Sun, 24 Jul 2016 12:27:32 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:46261 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751340AbcGXQ1b (ORCPT ); Sun, 24 Jul 2016 12:27:31 -0400 Subject: Re: [PATCH -next] xtensa: Fix build error due to missing include file To: Rob Herring , Max Filippov References: <1469319895-17578-1-git-send-email-linux@roeck-us.net> <5794596C.6040809@roeck-us.net> Cc: Chris Zankel , "linux-xtensa@linux-xtensa.org" , LKML , Kefeng Wang From: Guenter Roeck Message-ID: <5794EC6D.4050504@roeck-us.net> Date: Sun, 24 Jul 2016 09:27:25 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: linux@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: linux@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/24/2016 08:18 AM, Rob Herring wrote: > On Sun, Jul 24, 2016 at 9:20 AM, Max Filippov wrote: >> On Sun, Jul 24, 2016 at 9:00 AM, Guenter Roeck wrote: >>> On 07/23/2016 05:45 PM, Max Filippov wrote: >>>> >>>> On Sun, Jul 24, 2016 at 3:24 AM, Guenter Roeck wrote: >>>>> >>>>> Commit 69d99e6c0d621f ("xtensa: Remove unnecessary of_platform_populate >>>>> with default match table") dropped various include files from >>>>> arch/xtensa/kernel/setup.c. This results in the following build error. >>>>> >>>>> arch/xtensa/kernel/setup.c: In function ‘xtensa_dt_io_area’: >>>>> arch/xtensa/kernel/setup.c:213:2: error: >>>>> implicit declaration of function ‘of_read_ulong’ >>>>> >>>>> Fixes: 69d99e6c0d621f ("xtensa: Remove unnecessary of_platform_populate >>>>> with default match table") >>>>> Cc: Kefeng Wang >>>>> Cc: Rob Herring >>>>> Signed-off-by: Guenter Roeck >>>>> --- >>>>> I would suggest to merge this patch into the commit causing the problem >>>>> if possible. >>>>> >>>>> arch/xtensa/kernel/setup.c | 1 + >>>>> 1 file changed, 1 insertion(+) >>>> >>>> >>>> Acked-by: Max Filippov >>>> >>> >>> Heads up: xtensa images build after this patch, but the image that >>> previously failed to build (generic_kc705_defconfig) doesn't boot, >>> at least not with qemu. I don't know if this is caused by 69d99e6c0d621f >>> or by some other patch. >> >> It seems to be booting, but serial console is non-functional. >> With commit 69d99e6c0d621f ("xtensa: Remove unnecessary of_platform_populate >> with default match table") I see the following message during boot: >> >> [ 6.375284] of_serial fd050020.serial: clk or clock-frequency not defined >> >> Reverting that commit fixes serial console for me. >> Any suggestions on what might go wrong? > > Probably the init order changed somehow and deferred probe is not > supported correctly. > While the message is due to -EPROBE_DEFER (and there should really be no message in this case), I suspect that the underlying problem is that of_clk_init() is now called way too early, before the clock source is fully initialized. Specifically, the call now happens before the message "clocksource: Switched to clocksource ccount", which at least looks suspicious. If I move of_clk_init() back into xtensa_device_probe(), to be called as device_initcall(), everything is fine. Guenter