Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1466348ybf; Thu, 27 Feb 2020 11:31:19 -0800 (PST) X-Google-Smtp-Source: APXvYqzflu1Q94aWsATip67EcGDItSlR+BperaupeLsTozbLiUSAStMRCC3iI0TCEjUBRdASoW4S X-Received: by 2002:aca:b9c2:: with SMTP id j185mr463852oif.112.1582831879248; Thu, 27 Feb 2020 11:31:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582831879; cv=none; d=google.com; s=arc-20160816; b=A9xqZCLn4e+zUlkwH5quq5tPF2J2tdZc1f4V9UjTTE7bkLsy4y3OXiQ7HCjE4CgFhP jg7gocWlAV6lqbFWbaOAYNDR4Jpo8lVrM4CXhDrB56mfoBXvqGeXh52s/VZiRDQzI07R 0SehuybJDKkg7Ijf+U7d1ojnNqJJ7tq/BqsVX7Os8WWfFEuxq5UwL4KC04FA018xDD7E 4ypjc+Q7N83oAEMn3XvRPQswZIXcD+RDTdFTyvVQPCBgzXWVFKlYn1Fw2pmN0zfENUJ5 yUXTy6nf0K8gP4Fw66sElIEPgLle+FcwttDU0o6TVrve0rWsBjeAaPS6d5G6z6IZd3HU Frbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Ms7ngyPWar2qTVrk3JwekzFVpUj9g8rYLZFTYitG1L4=; b=Jw47rFpgavUs1TJEu5XaSD2VLJWUYj7dOQgmtcMkI74H7JwUSzQHF+h+YKQ0L9BxWJ KO03BMbkiXbvRbgvk8LH2D+32G+dwVpbkpJkHtw4/fkQWuUjGFPQiiS8YogH7kN8S0FW 67r2qgGqgMgJ9a2KT5YTVwhvAFJTu+cw9Q8nNyZ8U6AycWrMST+hJ3BNm8GxFBPIZeEa Qp4Scn0gQdThfmREB0OAhMGr0JC0m60WI/5VW1p6aTRWvbGjOfBfr3fpEXpB7/zp9xN2 BiNqMXZv9dOYPEUzxlZGDrFkMHM3olsM1eCOleQ4aQIpa66CYwV2r2YP4izVqngUt70t NvEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Vg4eJJf5; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f62si419144oib.131.2020.02.27.11.31.06; Thu, 27 Feb 2020 11:31:19 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Vg4eJJf5; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730154AbgB0Tas (ORCPT + 99 others); Thu, 27 Feb 2020 14:30:48 -0500 Received: from mail-yw1-f66.google.com ([209.85.161.66]:41781 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729727AbgB0Tas (ORCPT ); Thu, 27 Feb 2020 14:30:48 -0500 Received: by mail-yw1-f66.google.com with SMTP id h6so693046ywc.8; Thu, 27 Feb 2020 11:30:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Ms7ngyPWar2qTVrk3JwekzFVpUj9g8rYLZFTYitG1L4=; b=Vg4eJJf52nV/QEaLGfoy/7pOMlXMCzJV6BDXgLP+8pOfYvE3LNy/3H/PfrcDKy7q36 u7cwhlZEJJX+7kbyJg2/1DSKsNeuLzw246fD6Knxztsjj8Bf4o0tSEHvVZA6qF0WMeoW 93hpdvMTbKjXeHyc4PVdVHNQWl9pQDquQD0SxKCGIiP2Y0KnPjhfAhYX03LPLQDSGVdP PV9PuPJwl3RHxy0nE5YjVq7St/atqZZzLBkALhdtZBDlQAtzkeLcwNpPxfkHjZ5xveoG P3W4DSI9RBGAa8CjbZd6p1QcwAM1IOzLzgSZdbQqjnYT/ZScv2ym+Q/vvAf/QPfuwcQS N4hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Ms7ngyPWar2qTVrk3JwekzFVpUj9g8rYLZFTYitG1L4=; b=V1IgvmsINcmul4rgKzg2kXMdX5l8NUALZodiwW155MaEshBLVlLyOvhmZWOnds/eBJ 4ingF4B1V4bpSZDYH6JbZPTOXONNQ2SaOMksYrWMRfrpDCZmzn8cDvOmpceYraKrUSzY 7EhUmbnk0mCDsLGwCOUnysfnNCL2jeiRje3YV0dgxJMti51GtbjWVHby17F98QOlftjb DoEj51CEutmDC7OHvIXRNHcmyaauYqV4XS2Gcg4nU3bXLqdIVsJXZ+I8DoqfOwEg9g35 wCI1iXtFDoBn43WGuI+cBv4QSWkNAGeZJaWtxPwsmvidDUAhKLguGmhOHNo7h/CzlyPm qmug== X-Gm-Message-State: APjAAAUyE5kWK0cby7x+TiiwScV59SU6Cfw1Bm3ERuMRHscrfFG8CO30 5tbx/+lP+1ls3DG8DhQiQ5c= X-Received: by 2002:a81:5305:: with SMTP id h5mr953870ywb.31.1582831846997; Thu, 27 Feb 2020 11:30:46 -0800 (PST) Received: from [192.168.1.46] (c-73-88-245-53.hsd1.tn.comcast.net. [73.88.245.53]) by smtp.gmail.com with ESMTPSA id q16sm2846732ywa.110.2020.02.27.11.30.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Feb 2020 11:30:46 -0800 (PST) Subject: Re: [PATCH v2] of: overlay: log the error cause on resolver failure To: Luca Ceresoli , devicetree@vger.kernel.org, Geert Uytterhoeven Cc: Pantelis Antoniou , Rob Herring , linux-kernel@vger.kernel.org, Geert Uytterhoeven References: <20200225164540.4520-1-luca@lucaceresoli.net> <40fdf0f2-85a4-9f84-6994-a59b7b56cec4@lucaceresoli.net> From: Frank Rowand Message-ID: Date: Thu, 27 Feb 2020 13:30:46 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <40fdf0f2-85a4-9f84-6994-a59b7b56cec4@lucaceresoli.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/27/20 2:11 AM, Luca Ceresoli wrote: > Hi Frank, > > On 26/02/20 04:53, Frank Rowand wrote: >> On 2/25/20 10:45 AM, Luca Ceresoli wrote: >>> For some of its error paths, of_resolve_phandles() only logs a very generic >>> error which does not help much in finding the origin of the problem: >>> >>> OF: resolver: overlay phandle fixup failed: -22 >>> >>> Add error messages for all the error paths that don't have one. Now a >>> specific message is always emitted, thus also remove the generic catch-all >>> message emitted before returning. >>> >>> For example, in case a DT overlay has a fixup node that is not present in >>> the base DT __symbols__, this error is now logged: >>> >>> OF: resolver: node gpio9 not found in base DT, fixup failed >>> >>> Signed-off-by: Luca Ceresoli >>> Cc: Geert Uytterhoeven >>> --- >>> >>> I don't know in detail the meaning of the adjust_local_phandle_references() >>> and update_usages_of_a_phandle_reference() error paths, thus I have put >>> pretty generic messages. Any suggestion on better wording would be welcome. >> >> If you have not read the code to understand what the meaning of >> the errors are, you should not be suggesting changes to the error >> messages. >> >> Only one of the issues detected as errors can possibly be something >> other than an error either in the resolver.c code or the dtc >> compiler -- a missing symbol in the live devicetree. This may >> be because of failing to compile the base devicetree without >> symbols, depending on a symbol from another overlay where the >> other overlay has not been applied, or depending on a symbol >> from another overlay where the other overlay is applied but >> the overlay was not compiled with symbols. (Not meant to be >> an exhaustive list, but it might be.) Thus the missing >> symbol problem might be fixable without a fix to kernel >> code. The error message philosophy for overlay related >> errors is to minimize error messages that help diagnose >> the precise cause of a kernel code bug, with the intent >> of keeping the code more compact and readable. When a >> bug occurs, debugging messages can be added for the >> debug session. > > Got it, sorry about that. > >> Following this philosophy, only the message in the second >> patch chunk is ok. > > Then I think you can apply the v1 patch which only contains the message > about the problem I experienced, and which was caused by an incorrect DTO: > > https://patchwork.ozlabs.org/patch/1243987/ > > Just ignore the note saying the patch is not for mainline, it's wrong. > Mostly yes, v1 contains the one place a message should be added. Let me bike shed a little bit though. I suggested a different wording for the message in v2, but I do not think my attempt at wording was precise enough. I would instead suggest: "node label '%s' not found in live devicetree symbols table\n" Some subtle differences. - It is a node label, not a node name. - If multiple overlays are applied, then the intention may have been to supply the node label via a previously applied overlay instead of from the base devicetree. So specifying the live devicetree is more accurate. Please submit v3 for mainline. Thanks, Frank