Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2935450rwb; Mon, 16 Jan 2023 01:12:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXtD2d3R1Ojccg1gbk52vpVxbBSudH4OYWS6XwIGOrebNQ/kK87jPGNbtr9VAyTn/kdJ/B2v X-Received: by 2002:aa7:cfd6:0:b0:461:b8bf:ce1b with SMTP id r22-20020aa7cfd6000000b00461b8bfce1bmr10554920edy.34.1673860374549; Mon, 16 Jan 2023 01:12:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673860374; cv=none; d=google.com; s=arc-20160816; b=wRgExdz9+BSEpTJYLYIheJfbxN451CbwrVP7sAzUQhUJyt1NQjdBX9QGi+QS9IEr0S vHwBlTmPkJk707qtTEwZgTXKkf6hVGDGSS5aTmZZH00khVf8btAkn4g4vhM+zUFYOLv7 AVGi9KVxTbf3pWrctus6a3/b3eeXaz3V/lMYhCtYMmKnG0YMkUY8u/xzM7MejtjYjle9 pfluZkeI/rcEGT740qqoUGhG40HAUBDUlqld5lSKvr+Hy7yebwfbwDAFrFDyGY0CPLW3 v8ucO8+26ZAM2UePohx6W87kzBuwSYmHmC8eOHArzJqFLUwZYZXH3JJQ5ys+qgKiXjVJ FSLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=55ylo4QA2CaqLzL7CkyGNxJVenH2KK56GDg8IKBuTQM=; b=EGKaHRucwa5UtrRlhgLklghOOZ4I0iyiWAiUuwZNt+3yNOHg9hGZTOs+7fzGsrWEpT tJpVcUp/V3bkBgwamXflFmFXkl+BAtuiulIsvITjO+WjJTjcBD47vnVs77j2RE9XCVlq +aulFESPjroktkr22ZNDlR5+u00dnkhD5WP1o5g7HbyVB+rW1txlURgszgVZ0ySK+5h/ tBN9un356/MfXfj3vUXGZI2ymZUQ0KrDJvPwX1Q/D9JyCG3/p/oXNq7gAEAU1rHKE9tx pfKgwgC4qCWnmti5RZaFBPiXH+hsnEJ25z8pAfz41+Siq9Op8mD63Sg3CmzgWC7XGEP0 6AJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=M84BtYPX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z11-20020a05640240cb00b0049d3f37b767si7497378edb.268.2023.01.16.01.12.41; Mon, 16 Jan 2023 01:12:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=M84BtYPX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231982AbjAPIiR (ORCPT + 53 others); Mon, 16 Jan 2023 03:38:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232139AbjAPIiP (ORCPT ); Mon, 16 Jan 2023 03:38:15 -0500 Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EC72CC02 for ; Mon, 16 Jan 2023 00:38:14 -0800 (PST) Received: by mail-vs1-xe30.google.com with SMTP id i185so28333217vsc.6 for ; Mon, 16 Jan 2023 00:38:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=55ylo4QA2CaqLzL7CkyGNxJVenH2KK56GDg8IKBuTQM=; b=M84BtYPXkppktUdcm4COHXtqJrKlgGrsInsukvff6NymdkuYX39pF0KhLgxzSxdpQG XS3NsOndmHHtdH4S6I97/JhCeJ8Z2VEHJvb8n+/xNQ4KygKw5B7mbMThO9JdSX1xxHzd IBL9oRUNOplbtd1vSFN9QBQ6STRQAskTe1jzOs3zcLMHdtn1P1ad5C/DoI0deq93s9wL EivsMtOQKxC92k2AEc5WM3uef0lXUF8b/IavhtLpBZKPGdeqbY8DnxxZDXCo/dOTGwGW YFhW1IcHU02PeQdUwKx7kPoWeo32BDZ9deIK7J7BfD6RorltvJFDzVKwP6A9SaKUmmVf cnUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=55ylo4QA2CaqLzL7CkyGNxJVenH2KK56GDg8IKBuTQM=; b=1BZVpEJ4rPTQO7bwvOTKlmfVTKMnQuPlT4PIr75ZWPJl7vZqhPFkoFEwSq2WyNKxho bKjtJ3G8owBmNKeWUAKFWdnanq6Xut4KXK23tN7OlKrJSoSlH2EDgUyeDZUkjFieZcxx +7hHmTW4KFeMfCT3roKBnZ0ZzO90PlTc91ZCawKsqP8vJTVW8erLrpJGKu66ziKzQFvH fUTtE5HGt6RRs7FRf6Qw0PzDI3yUQJ84e/mGqaGJkUsNRLeqU4vq3vmHBSPl9E1Vj1zy cozs6QjF7u4gtnDBclHaA0pD+84CTBVU4fcfBb+DVi8LiIVToXHWcCp04OkBerqiYzJs IqdQ== X-Gm-Message-State: AFqh2kokt9GWYZJmpTovRBK3NAhqzIf0sRtY28baxecdB0daeiuaka/u 5p4eYiMaWcNSpzavq9QfTUH1LlWl1X3CLVG4ujEXzyn0mNGKgA== X-Received: by 2002:a05:6102:1141:b0:3d2:3577:2d05 with SMTP id j1-20020a056102114100b003d235772d05mr811406vsg.9.1673858293353; Mon, 16 Jan 2023 00:38:13 -0800 (PST) MIME-Version: 1.0 References: <20230113205922.2312951-1-andreas@kemnade.info> In-Reply-To: <20230113205922.2312951-1-andreas@kemnade.info> From: Bartosz Golaszewski Date: Mon, 16 Jan 2023 09:38:02 +0100 Message-ID: Subject: Re: [PATCH] gpio: omap: use dynamic allocation of base To: Andreas Kemnade Cc: grygorii.strashko@ti.com, ssantosh@kernel.org, khilman@kernel.org, linus.walleij@linaro.org, linux-omap@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 13, 2023 at 9:59 PM Andreas Kemnade wrote: > > Static allocatin is deprecated and may cause probe mess, > if probe order is unusual. > > like this example > [ 2.553833] twl4030_gpio twl4030-gpio: gpio (irq 145) chaining IRQs 161..178 > [ 2.561401] gpiochip_find_base: found new base at 160 > [ 2.564392] gpio gpiochip5: (twl4030): added GPIO chardev (254:5) > [ 2.564544] gpio gpiochip5: registered GPIOs 160 to 177 on twl4030 > [...] > [ 2.692169] omap-gpmc 6e000000.gpmc: GPMC revision 5.0 > [ 2.697357] gpmc_mem_init: disabling cs 0 mapped at 0x0-0x1000000 > [ 2.703643] gpiochip_find_base: found new base at 178 > [ 2.704376] gpio gpiochip6: (omap-gpmc): added GPIO chardev (254:6) > [ 2.704589] gpio gpiochip6: registered GPIOs 178 to 181 on omap-gpmc > [...] > [ 2.840393] gpio gpiochip7: Static allocation of GPIO base is deprecated, use dynamic allocation. > [ 2.849365] gpio gpiochip7: (gpio-160-191): GPIO integer space overlap, cannot add chip > [ 2.857513] gpiochip_add_data_with_key: GPIOs 160..191 (gpio-160-191) failed to register, -16 > [ 2.866149] omap_gpio 48310000.gpio: error -EBUSY: Could not register gpio chip > > So probing was done in an unusual order, causing mess > and chips not getting their gpio in the end. > > Signed-off-by: Andreas Kemnade > --- > maybe CC stable? not sure about good fixes tag. > > drivers/gpio/gpio-omap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c > index 80ddc43fd875..f5f3d4b22452 100644 > --- a/drivers/gpio/gpio-omap.c > +++ b/drivers/gpio/gpio-omap.c > @@ -1020,7 +1020,7 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc, > if (!label) > return -ENOMEM; > bank->chip.label = label; > - bank->chip.base = gpio; > + bank->chip.base = -1; > } > bank->chip.ngpio = bank->width; > > -- > 2.30.2 > This could potentially break some legacy user-space programs using sysfs but whatever, let's apply it and see if anyone complains. Bart