Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3156152imw; Mon, 11 Jul 2022 03:07:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sK7/GVIx2O4G8KrK5h546h6UC3i5ho7HywJMCeU0GjFxPA76xIAPtfEYSYZ1L+VBO9rg4V X-Received: by 2002:a17:902:f549:b0:16c:483f:3a9f with SMTP id h9-20020a170902f54900b0016c483f3a9fmr4902935plf.134.1657534039146; Mon, 11 Jul 2022 03:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657534039; cv=none; d=google.com; s=arc-20160816; b=g6y3F3mpXaK0QD0LC05Ss1xngfO+cit21QAAMmE4BKolhMa7oyE/sGC8EWSTS34J8t rdlaj2gAPX8k9yxaeruL8HxqVgNUqBWaedmVuZvPiWXzCmhu1xOK23ES7KTwg71VBGOR iHG72VlpsFAC0V2geVENcfxKWXdIwXNHDkosHs/NsKwmlQ8e47/cE8MJajaRGNe9vsYc gVPIUE3k6XvDC7GI3gclW9CrqG9wOxcHXxYddISi1sb//++iJlpS9flAkPheYXuJfWOK oHAK3aKYgqLk8PbzaW7wMlbKDDHS7b5+XrOAjPLsqOc7KC7IefBwrcYjw5vLUMtxq9F9 f6gg== 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=/urHEMzh2bc5TwNR8Jg3HlbigYCzgoWwkXUrjrAfWC8=; b=r795MFsWEgNehd3FIRfPVG3giWjWuHNZXKdNjRIR5y1oas226VSSbAemV5K/1/ouRz t9mI0dJsVJ3HXc+GqgFzMzMZW2/S+Gu2hMmADFsNICQbIbX5keWl7Jsm51DpmHbeh1VU f//hcmkEsNXaUx226cgrybADAI2z8wQEj8uauG8zv8bz/JxFIusQ4ztztPzL/KvvIZEd 1X/xXsSJaRvD0/WLTgH0+GcG4DYFWt0jyLvdtNR8EXHgmsBMIH5FOziSpAj629PVa8Fn nu6eP8VoeHnrXyyUm5LPgkjs/tgj9aDWypSaCpgFxwXyp1jDevAPhlhbuwjpZylOqeV5 wwzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XGmSAiIG; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c4-20020a633504000000b00412825845e4si9001210pga.360.2022.07.11.03.07.07; Mon, 11 Jul 2022 03:07:19 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=XGmSAiIG; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229951AbiGKIhM (ORCPT + 99 others); Mon, 11 Jul 2022 04:37:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229666AbiGKIgs (ORCPT ); Mon, 11 Jul 2022 04:36:48 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02A0712AB1; Mon, 11 Jul 2022 01:36:27 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id h62so4958839ybb.11; Mon, 11 Jul 2022 01:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/urHEMzh2bc5TwNR8Jg3HlbigYCzgoWwkXUrjrAfWC8=; b=XGmSAiIGZxYQeqyvett+yhyFmsQZIVbGMwwau29NqEDDZPY0DoB9heByadkEGBc83p l5oh2J4YHg2IziqPBXZiLKUyUW2PD9Xj6y9pN2AFk1LxWcDX29uChlfblfaMI6ChU+5a eEAN+gV66aQ9r7TPYbU8Q4C6W5HmboykOURNxDgEhuAQQ0X/Rkr4nl4XNxVnKLaRuesi 2cJHC+XzmH6peK8BcO/O3VyhoyIMfRGnLAzFnbMPyCm/znRvt//8nJcWwP9NnXA9cLsn rVhIt6dYM+jz4jtZU47j2c9u7Xiny4kcW5uLj6V9Z8QaoBzgWO78hSx27k0gIw5JpxK/ NgIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/urHEMzh2bc5TwNR8Jg3HlbigYCzgoWwkXUrjrAfWC8=; b=XQNjZyRTi1brE0KeK19ifkfmD3xB0z7Q+hg7L8BD5Svh/f+B0xAcm/39mSAa1u7UC4 KjtPittk3EFjFkKx0bEnED2RRhnihHHTDX6vAcc506V+cCk32eFCGfZquhZvTk1A5aQu urx9LLtahpCz9gw8y8A6WIUaa6YrsdNwpnkPA7t12CrK05h7OBonloo8w6oC/Mb0EKfz mt6y9+x2Erf1mWqvtMIdXoI+lJmeEjFsDtPD34yXP9QiO+xqeT/L0mJ5JmRBPBLZdxbl Tv+e6TUjlG0DUcrKi5DZfyK1d3yvGiR5i34kPjVxIb40CkavgbdLoDuTWydfy6Y6FxUk roTw== X-Gm-Message-State: AJIora9kOiNb/OEGsTntGYrZiIPiNI/5ZNKeLlsVqzmpwzoZPyycMyPG +XENCdNeOeS2HzhVcOKjB417d3mJHJtJMQGfVA8= X-Received: by 2002:a05:6902:c4:b0:64b:4677:331b with SMTP id i4-20020a05690200c400b0064b4677331bmr15665437ybs.93.1657528586108; Mon, 11 Jul 2022 01:36:26 -0700 (PDT) MIME-Version: 1.0 References: <20220708195510.2951661-1-horatiu.vultur@microchip.com> <20220708195510.2951661-3-horatiu.vultur@microchip.com> <20220711065547.drpgq466ueujkxah@soft-dev3-1.localhost> In-Reply-To: <20220711065547.drpgq466ueujkxah@soft-dev3-1.localhost> From: Andy Shevchenko Date: Mon, 11 Jul 2022 10:35:49 +0200 Message-ID: Subject: Re: [PATCH v2 2/2] pinctrl: ocelot: Fix pincfg To: Horatiu Vultur Cc: Colin Foster , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Linus Walleij , kavyasree.kotagiri@microchip.com, Alexandre Belloni , Microchip Linux Driver Support , Maxime Chevallier , Michael Walle Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Mon, Jul 11, 2022 at 8:51 AM Horatiu Vultur wrote: > The 07/09/2022 00:02, Andy Shevchenko wrote: > > On Fri, Jul 8, 2022 at 10:17 PM Colin Foster > > wrote: > > > On Fri, Jul 08, 2022 at 09:55:10PM +0200, Horatiu Vultur wrote: Please, remove unneeded context when replying! ... > > > > - .max_register = 32, > > > > > > What happens in /sys/kernel/debug/regmap/*-pincfg/{range,registers} when > > > there's no max register? > > > > Good question! > > If .max_register is missing then I got the following: > > # cd /sys/kernel/debug/regmap/e2004064.pinctrl-pincfg/ > # cat range > 0-0 > # cat registers > 0: 00000005 This is effectively a regression. > > > Should it be this? > > > > > > struct regmap_config regmap_config = { > > > ... > > > }; > > > regmap_config.max_register = info->desc->npins * regmap_config.reg_stride; > > > > > > > .name = "pincfg", > > > > }; > > > > If regmap configuration may be const, I would prefer to have a > > hardcoded value and different configuration based on the chip, but if > > it's not feasible, then this could suffice. > > What about if we do something like: > > const struct regmap_config regmap_config = { > ... > .max_register = info->desc->npins * 4, > ... > }; > > This is based on what Colin suggested only that we keep the const. As long as it's const, I like it. -- With Best Regards, Andy Shevchenko