From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 252DCC6FA82 for ; Wed, 14 Sep 2022 14:31:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0E0E984A04; Wed, 14 Sep 2022 16:31:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=variscite.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=variscite.com header.i=@variscite.com header.b="fwr1oJNY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E95B884AF5; Wed, 14 Sep 2022 16:31:31 +0200 (CEST) Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2072.outbound.protection.outlook.com [40.107.105.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E776984922 for ; Wed, 14 Sep 2022 16:31:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=variscite.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Nate.D@variscite.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IL8jnyn5PBIpjpKFm0/IPg1VHq/CorteZOPeUrbpZmqKUlyrTg0qwFNDCB9FW7mFiKRT5gfXiypz/t+vF1Kn4MEScSfYfL6LE4bjzzWdw5ajhVBGtL4wg5WHDpe1sppVmzc0GoAQU4VnorOgxy17l7f3iWB6Q6ZJ38HOEU7AY76kwSXh/BwAntCg7Paga2xXgx5ONB2thnRN0FyghPYf6uKoOi/GBnIG3sW8F4G3+aOf2ZH51TdE1rb28kot1g0chvABdEkbjhur7UEyWqVrwscH83jbfTlN5BmYSKEt+itfBn7456t0N0qhHKQmfl/POe6wA18sbEzpufMJDpqh0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lEeEIN7BiJedPjI1Wuv/4sWLGCZHQHfP9TH4/M5R274=; b=JjaOv8Fb1ZIWA3EsimA+OElDAOvRbN0Y8kYNtFKaG0HFJWeWVKP62OJr66iK5YGUIGQsws/XCiiyAiUoV/ziqJcNp4X03rjLkz65Tb6gH1MMMvWYOw9blDMD5QT7w5DkLK+H+Is0+CYjuLH7gFuluc0iamDQVV95Y/Vas3dvr6NodBmA+gSH6Xz5z8He87chuzntFqbdtGZsVfDyE21QHd2uOgYcDycNpLRvW++GWY7Zcg9PgsAcbFQ16sOSf4HIkoFStTUQIzcQSEV5yy2rObNXI00kiQoQSOFpBjxs7QIDN5IIlOq5oGvGzFB+0h0VCaTkzm036V3nswqJYIXQqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=variscite.com; dmarc=pass action=none header.from=variscite.com; dkim=pass header.d=variscite.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=variscite.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lEeEIN7BiJedPjI1Wuv/4sWLGCZHQHfP9TH4/M5R274=; b=fwr1oJNY2rGy6vGHDs/SnQpAaaLz5yZ8xsakmlvtq0v35lz6Bsikq5sDOwETfu/aK1+7ERGslcbLBufgiyC9/h6AEYWxO1sar7xAHwiXYWTRZkcNoD2sUpivaRLZeCALFI2LDAAh3VEKlR7GtaHBXDqhb29LFmWTtXuEud9NZbokquyl1EBqIvQFC5raBgiN8zBTx4XlV9qlJwN+w+WCI0ttR/ccIbymy1qCMyRQNykFvy/cFtUabcBOOwuLukYTpDKeMbbL3aFDPVOimG3Ta+CnouOsvMxBnzNeAgWUW+GRwbsEiJgS/kFZZxObhbava4qbBbYlFZnfsFgF9ZraFA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=variscite.com; Received: from DB9PR08MB6825.eurprd08.prod.outlook.com (2603:10a6:10:2af::9) by DB3PR08MB8985.eurprd08.prod.outlook.com (2603:10a6:10:43f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12; Wed, 14 Sep 2022 14:31:26 +0000 Received: from DB9PR08MB6825.eurprd08.prod.outlook.com ([fe80::a88a:b945:e903:42a8]) by DB9PR08MB6825.eurprd08.prod.outlook.com ([fe80::a88a:b945:e903:42a8%9]) with mapi id 15.20.5612.022; Wed, 14 Sep 2022 14:31:26 +0000 Message-ID: Date: Wed, 14 Sep 2022 09:31:20 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] gpio: uclass: Introduce gpio-hog-optional property Content-Language: en-US To: Tom Rini Cc: Simon Glass , Fabio Estevam , Samuel Holland , Heinrich Schuchardt , Andrew Jeffery , Eddie James , U-Boot Mailing List , eran.m@variscite.com References: <20220912175513.4178793-1-nate.d@variscite.com> <01cfeafe-980c-aad7-7acc-4957c4622aaa@variscite.com> <20220914141646.GR6993@bill-the-cat> From: Nate Drude In-Reply-To: <20220914141646.GR6993@bill-the-cat> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: CH2PR04CA0015.namprd04.prod.outlook.com (2603:10b6:610:52::25) To DB9PR08MB6825.eurprd08.prod.outlook.com (2603:10a6:10:2af::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR08MB6825:EE_|DB3PR08MB8985:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c7aaab9-381d-4b4c-ed97-08da965dce01 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zberzO5o8hHog5Jo8G9sSzovCzldyhXy4gWC+BCU8QKQHIBPqxdxnBLsa5iHbWyRHASWQU9eobmPupX3gFtgWBZQ/oHk9adngu742lJ+BdKaR6rsO3RqwitSWYKSrmX/Pe3GCen7L6z/pKvGWaV2EjsmFGHtyzAFTon/Wh+pzTvzaWZXsa+2liMb/sQ9FHwJc/aCpSsEAI132pfa4CyAe7f+elvUajNWL6qpXKRl4BwyW71PTU36JOxJN+c7a4hSq7PnQXWPGt4PAtDnMiDtc8ueotqHYr6hfVcsNdMzb6kWWiUNPLST5A3mIXy8uDQLLcz/2+TqMP5EW4aviUoOZX8zL9um/kdaqzVMLGvlL2Ojs/J1x0OKjdIvk9Z87jKPpn4796knwsZOpeKUmnlQEZ6VqyR01MnC/jW00gKExOmSIjTqMpfjh6QAeJa7BkafuTtK7PINxBzob1M5eUGLvNE1O0EMBkA+Gf9ev/dTtQIFR1/zTpMkDsiC/unzj6V/klEnS1USl1GifwwgS/CdjJ9D8vIhP/td2lSwvCb9inZcLptfPbFfKe5wjrFB14S3KokwTprP8sjtOTZFqB7lGEzqXhxauRm5gWlcIeC59wjVplzCRzei3kfRE/9BLlqrTI6ONgaxoA/vtuxOykpgI6+pN1aMfh/tKLJWIMRtBJY/HGfXSbeFeBMps/JhMcXuMhn6Zcs2MhQ8McEvMn4wqYdiJzmImYWSU7dQuwZ5Lo/ZCiCrKCNUDZY8U1om32Kvh3In1QzBC6++KdG3wpXRxtiz4eGH4DMrAgttuMEbgxs9LJqL1ZvYYvtsCEt0jRwYQrfxx+2o8aFcCnp0HrCb2eQfmZa3RquuEwYtELACoVQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR08MB6825.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(136003)(366004)(346002)(376002)(39840400004)(451199015)(6666004)(478600001)(8676002)(5660300002)(8936002)(66476007)(2616005)(966005)(83380400001)(107886003)(26005)(53546011)(38100700002)(66946007)(6512007)(186003)(52116002)(6486002)(36756003)(2906002)(38350700002)(31686004)(31696002)(6506007)(86362001)(4326008)(66556008)(316002)(41300700001)(54906003)(6916009)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MWhwVnZZMGhiT2pIdityM1gvS1pWVlFhZndxUktGLzRYUWZFejhnWnZOaVhU?= =?utf-8?B?NTNicFF1M01zSUwwblFhMlRMQ290VTJoYUswb01kTWNVM0tJZTV0V0tSTlc1?= =?utf-8?B?MUNxeU9FcERZSk9YSWxvNXZtK0lGNUpueW5GZWR5RythSUtjRHVJZWJKM3cw?= =?utf-8?B?U0RWaEh2UmxyalViRHlsODl0Qmx5eW5Bbk51djUwNWRrOWZ3RVdOTStWa09L?= =?utf-8?B?MHZnenQxalcxdHZ0MjBINE84RERjaHNObC9jQmlDbkMwSmlBMUJ6UXBVTm9M?= =?utf-8?B?V1hzOUlqdTl0YmxnN3lDWml2cldKb3lLTHJQNmt6bXh3VGJpMWRCM2JwRGFQ?= =?utf-8?B?SUc0T3ZHMGtxQzBlaWhvOWFKUkI2YXdNMEpzL1h5UGxVaHJ4RTNCaGQ2Y2hr?= =?utf-8?B?Ykw3MVRDOWxOT0VDM0JvaVl0VzUvTGRIb1JGcTZyNXBwdnkyOHNKOVp0bVd4?= =?utf-8?B?S205M0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U?= =?utf-8?B?aFY3bGZ2Rk5QS002RkFJTWxRM3ord0srTHU4QlpmK2JVdmhPQ2NhZXBYZmNJ?= =?utf-8?B?RmFnT3V2VkdZYmRQTHVESkdFdGxEaWVkSXBrSFRkOTMrd2YvbXRzZ0xWSGh3?= =?utf-8?B?K2ZiWkV3MnJ3VTducXVBWjBSaEtDVWs3L3VNTXZGZG1WYkdMc3pnMFlyK1Bn?= =?utf-8?B?alBBQitUNUUzKzEvNkNQRjJDMHltRUtIckJmUlpNblBmRGpoSGZYSXZTa3k4?= =?utf-8?B?cSszNEY4REg5ZkdIVVA0dTdoTXZySHZMb0lCb1dEZTZuc0F4bVUvVWpnbUF0?= =?utf-8?B?Y1pGQWI1eEFuRGtHWEVYendWTTZpRjFjV0lsZ2NsOEFDaEtrb0NuamcxS0xm?= =?utf-8?B?SVA1RjMrbTZoVUNxck96V2pPSUl0S0NFL1B1M3I3T05QNXByR3o5QzhpekNP?= =?utf-8?B?elR6alYzcnk3eVVtYzRCdDA3VTlvRVVhMVp5WUZCa283bWUrejJxMXRVUEFa?= =?utf-8?B?RGduYThEWExadURTT1ZuTnEvNU5Tei9XWHJ0SlR5YllyNWpBLzhwWDFqY1dY?= =?utf-8?B?ODVHWmJoUnpYbklKQUQ4Zm40TTR3cXR5cGxFSEVPYXlFWUR3ek8zaWZFS0ZS?= =?utf-8?B?NzlOczByTUswSUR6WEtONzY2VE5ja1BrV1FnbjIrK1hMVWxVY1lJcFBESkhw?= =?utf-8?B?VWkyOURqLzdjUFV0NXdJR1h1Zzlhb1FFTU9weXJTNFRHZWo2MVJpMk1ua3N1?= =?utf-8?Q?cnR5IPFHmm0fgKRHr7E/1v6pl?= X-OriginatorOrg: variscite.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c7aaab9-381d-4b4c-ed97-08da965dce01 X-MS-Exchange-CrossTenant-AuthSource: DB9PR08MB6825.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2022 14:31:25.9329 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 399ae6ac-38f4-4ef0-94a8-440b0ad581de X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Z/Nwv+7hFHAcLwvdDXkLfXrPLGOnEZcoziG73NQkONFqWZy7jYpYwVoiCTRrLDClkZVsPHOzUg9GJjkS/cHvxA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB8985 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Hi All, On 9/14/22 9:16 AM, Tom Rini wrote: > On Wed, Sep 14, 2022 at 08:59:52AM -0500, Nate Drude wrote: >> Hi Simon, >> >> On 9/14/22 7:49 AM, Simon Glass wrote: >>> Hi Nate, >>> >>> On Mon, 12 Sept 2022 at 14:57, Nate Drude wrote: >>>> >>>> Hi Simon and Fabio, >>>> >>>> On 9/12/22 3:16 PM, Simon Glass wrote: >>>>> Hi, >>>>> >>>>> On Mon, 12 Sept 2022 at 12:48, Fabio Estevam wrote: >>>>>> >>>>>> Hi Nate and Simon, >>>>>> >>>>>> On Mon, Sep 12, 2022 at 2:55 PM Nate Drude wrote: >>>>>>> >>>>>>> gpio_hog_probe_all is invoked by init_sequence_r in board_r.c. >>>>>>> If device_probe fails for any gpio-hog, boot hangs with the following error: >>>>>>> >>>>>>>> initcall sequence 00000000fffc8e18 failed at call 000000004023b320 (err=-121) >>>>>>>> ### ERROR ### Please RESET the board ### >>>>>>> >>>>>>> gpio-hog-optional allows the boot sequence to continue if device_probe >>>>>>> fails for optional gpio-hog(s). >>>>>>> >>>>>>> Signed-off-by: Nate Drude >>>>>>> --- >>>>>>> doc/device-tree-bindings/gpio/gpio.txt | 1 + >>>>>>> drivers/gpio/gpio-uclass.c | 4 +++- >>>>>>> 2 files changed, 4 insertions(+), 1 deletion(-) >>>>>>> >>>>>>> diff --git a/doc/device-tree-bindings/gpio/gpio.txt b/doc/device-tree-bindings/gpio/gpio.txt >>>>>>> index 1481ed607d..02d296316b 100644 >>>>>>> --- a/doc/device-tree-bindings/gpio/gpio.txt >>>>>>> +++ b/doc/device-tree-bindings/gpio/gpio.txt >>>>>>> @@ -189,6 +189,7 @@ gpio-controller's driver probe function. >>>>>>> Each GPIO hog definition is represented as a child node of the GPIO controller. >>>>>>> Required properties: >>>>>>> - gpio-hog: A property specifying that this child node represents a GPIO hog. >>>>>>> +- gpio-hog-optional: A property specifying to continue boot when device_probe fails in gpio_hog_probe_all >>>>>> >>>>>> gpio-hog-optional property does not exist in Linux. >>>>>> >>>>>> If this property is introduced then U-Boot and Linux devicetrees will >>>>>> not be in sync. >>>>>> >>>>>> Can this be fixed differently? >>>>> >>>>> Nate, can you send a patch to Linux with the binding update? >>>>> >>>>> Regards, >>>>> Simon >>>> >>>> Thanks for your responses and feedback. >>>> >>>> I don't think gpio-hog-optional is relevant to Linux. >>> >>> Sure, but Linux is (for better or worse) the main repo for the device >>> tree bindings. >> >> I am not understanding the action. I think you're suggesting I update the >> Linux device tree bindings so they stay aligned with U-Boot, adding a >> property gpio-hog-optional after this line: https://github.com/torvalds/linux/blob/v6.0-rc5/Documentation/devicetree/bindings/gpio/gpio.txt#L191 >> >> However, since it's not relevant to Linux, I think it will be confusing >> since it will have no effect and won't be be used in any Linux code. >> >> Can you please advise what description I should use for the >> gpio-hog-optional property so that the Linux maintainers would accept such a >> patch? > > Yes, that would be one way to go about this, and there are other > non-Linux bindings in the Linux kernel tree, but this might be the first > property of an existing binding, so that might also be a bit challenging > to get accepted, or find out what the preferred solution is. > > [snip] >>>> Do you have any suggestions for a better approach? Does it make sense >>>> for gpio_hog_probe_all to cause a fatal error when the gpio hog probe >>>> fails (most devices, including the gpio-expander, will not cause a hang >>>> if they fail to probe)? >>> >>> I think your approach is fine as is. >> >> An alternate approach is to modify the default behavior so that >> gpio_hog_probe_all will not trigger a fatal error. Do you think this is >> better? > > This too would be acceptable. > Thanks for the discussion and feedback. I prefer to avoid changing the bindings in Linux if possible. Would it be acceptable if I rework gpio_hog_probe_all so that it prints an error "Failed to probe device..." if any device_probe fails, but always returns 0 to avoid a fatal error in board_init_r? I can submit a v2 patch, but I want to screen any problems with the approach first. Thanks, Nate