Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2504734ybl; Mon, 20 Jan 2020 04:17:17 -0800 (PST) X-Google-Smtp-Source: APXvYqz6c8wlA6wLSwaIDTLM8pB67znlpwIt3Axum1+cLBTPsXj25NWx7ypp6UgHg9vBb9WgWxs4 X-Received: by 2002:a05:6830:109a:: with SMTP id y26mr14892617oto.227.1579522637081; Mon, 20 Jan 2020 04:17:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579522637; cv=none; d=google.com; s=arc-20160816; b=lQ9gEMouYuKDeZkIbcP2JrPKa4shkXbUokMBbTy92fm3NmGJBdXgSBFMKjDz/80HSf wfitNtZtFiu4a4C5C/1KmJNZuW2sAuacRg/vtg1apA1pnSV8kNmYtdZQH/FtlKAw4fb/ cdkcwqSEvKF38nXbhpFbRLpa74fyr1RflK4YXHLYLO232ztTrtAkmLIZWXAbXtP0Kr8A J3j4QaNaPijHaDJyOM/BP0wmKy0AjIjBsVKtdlMCDBOao8PYx304hsHqKm6sjonAJdPS 5zEK3LDe/g/QRpgWbOTsN5IEl3dyH62TYnvOkW+2aqzb9s/0pJGGa7+ywgHdg1j58C1g zWkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ud0BYtioq1SBrjfh/16NTIeEoGqSw1JUM3y9UzE+M1E=; b=MAFUHKdAjWHLNR17PGc5grgAq51EYez6KAlNf/oz7ld6sVAILpOrYdV2EdKdffGz95 iKxPUh+k53FFjA8NZHOdYrfM8iW+aaM5fBO0QBA6YztRSETENlzMRIbiXeWTmY7MlPKR D4FgPTc8BrhH+hn6Fqq1J3vS8qoNC2GLNlgpEuOWrtrlYvvKNry6T8pZmeJ/FoHWsVdk ie5u1qZZepPh59WcCD/MCU0Dt7T+tlbIeNbbgf+zjgJOzgETJTyyePDLJvU50bTKlghS pnmgBQIRdC7BTKKSGigPQoWsSheGelLR6gKdq1Qe3//l5PihHSfei7Nei7THFRObmL0e XaQA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z65si17228004oia.33.2020.01.20.04.17.03; Mon, 20 Jan 2020 04:17:17 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727990AbgATMOz (ORCPT + 99 others); Mon, 20 Jan 2020 07:14:55 -0500 Received: from smtp1.de.adit-jv.com ([93.241.18.167]:53928 "EHLO smtp1.de.adit-jv.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726589AbgATMOy (ORCPT ); Mon, 20 Jan 2020 07:14:54 -0500 Received: from localhost (smtp1.de.adit-jv.com [127.0.0.1]) by smtp1.de.adit-jv.com (Postfix) with ESMTP id C7E013C00C5; Mon, 20 Jan 2020 13:14:50 +0100 (CET) Received: from smtp1.de.adit-jv.com ([127.0.0.1]) by localhost (smtp1.de.adit-jv.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Bta2hz3l_WGv; Mon, 20 Jan 2020 13:14:42 +0100 (CET) Received: from HI2EXCH01.adit-jv.com (hi2exch01.adit-jv.com [10.72.92.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp1.de.adit-jv.com (Postfix) with ESMTPS id AC1BB3C04C1; Mon, 20 Jan 2020 13:14:42 +0100 (CET) Received: from lxhi-065.adit-jv.com (10.72.93.66) by HI2EXCH01.adit-jv.com (10.72.92.24) with Microsoft SMTP Server (TLS) id 14.3.468.0; Mon, 20 Jan 2020 13:14:42 +0100 Date: Mon, 20 Jan 2020 13:14:39 +0100 From: Eugeniu Rosca To: Geert Uytterhoeven CC: Eugeniu Rosca , Linus Walleij , Bartosz Golaszewski , Jonathan Corbet , Rob Herring , Mark Rutland , Harish Jenny K N , Alexander Graf , Peter Maydell , Paolo Bonzini , Phil Reid , Marc Zyngier , Christoffer Dall , Magnus Damm , "open list:GPIO SUBSYSTEM" , "open list:DOCUMENTATION" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux-Renesas , Linux Kernel Mailing List , QEMU Developers , Eugeniu Rosca Subject: Re: [PATCH v3 0/7] gpio: Add GPIO Aggregator/Repeater Message-ID: <20200120121439.GA24951@lxhi-065.adit-jv.com> References: <20191127084253.16356-1-geert+renesas@glider.be> <20200118014632.GA14644@lxhi-065.adit-jv.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-Originating-IP: [10.72.93.66] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Geert, On Mon, Jan 20, 2020 at 10:33:53AM +0100, Geert Uytterhoeven wrote: > On Sat, Jan 18, 2020 at 2:46 AM Eugeniu Rosca wrote: > > The only unexpected thing is seeing below messages (where gpiochip99 and > > gpiochip22 are inexisting gpiochip names, mistakenly provided on command > > line prior to passing the correct name): > > > > root@rcar-gen3:~# echo gpiochip6 12-13 > /sys/bus/platform/drivers/gpio-aggregator/new_device > > [ 915.572905] gpio-aggregator gpio-aggregator.0: cannot find GPIO chip gpiochip99, deferring > > [ 915.584224] gpio-aggregator gpio-aggregator.2: cannot find GPIO chip gpiochip99, deferring > > [ 915.865281] gpio-aggregator gpio-aggregator.29: cannot find GPIO chip gpiochip22, deferring > > > > Obviously, in the above case, due to a typo in the names, the gpio > > chips will never be found, no matter how long gpio-aggregator defers > > Indeed, that is expected behavior: you have created platform devices > referring to resources that are not available. Got it. Sounds reasonable to me. > > > their probing. Unfortunately, the driver will continuously emit those > > messages, upon each successfully created/aggregated gpiochip. I built > > That is expected behavior, too: every time the driver core manages to > bind a device to a driver, it will retry all previously deferred probes, > in the hope they can be satisfied by the just bound device. > > Note that you can destroy these bogus devices, using e.g. > > # echo gpio-aggregator.0 > \ > /sys/bus/platform/drivers/gpio-aggregator/delete_device Yep, I can get rid of the bogus devices this way. Thanks! > > > gpio-aggregator as a loadable module, if that's relevant. > > Modular or non-modular shouldn't matter w.r.t. this behavior. > Although unloading the module should get rid of the cruft. Yes, indeed! > > > Another comment is that, while the series _does_ allow specifying > > gpio lines in the DTS (this would require a common compatible string > > in gpio_aggregator_dt_ids[] and in the DTS node) and while those lines > > are indeed exposed to userspace, based on my testing, these same gpio > > lines are marked as "used/reserved" by the kernel. This means that > > operating on those gpio pins from userspace will not be possible. > > For instance, gpioget/gpioset return "Device or resource busy": > > > > gpioget: error reading GPIO values: Device or resource busy > > gpioset: error setting the GPIO line values: Device or resource busy > > > > I guess Harish will be unhappy about that, as his expectation was that > > upon merging gpio-aggregator with gpio-inverter, he will be able to > > describe GPIO polarity and names in DTS without "hogging" the pins. > > Perhaps this can be supplemented via an add-on patch later on? > > When aggregating GPIO lines, the original GPIO lines are indeed marked > used/reserved, so you cannot use them from userspace. > However, you are expected to use them through the newly created virtual > gpiochip representing the aggregated GPIO lines. > > You can try this using the "door" example in > Documentation/admin-guide/gpio/gpio-aggregator.rst, after replacing > gpio2 {19,20} by gpio6 {12,13} to suit your H3ULCB. Confirmed. The example works like a charm. One difference between the runtime-created and DTS-created gpiochips is the name: - gpio-aggregator., for the ones created via sysfs - , for the ones created via DTS Seeing this behavior on my target, I believe the expectations of Harish should be met w/o any major limitations. > > > For the whole series (leaving the above findings to your discretion): > > > > Reviewed-by: Eugeniu Rosca > > Tested-by: Eugeniu Rosca The recent [v3] discussion actually applies to [v4], for which I did review and testing. Will relay the signatures to the latest version. Thank you very much. -- Best Regards, Eugeniu