Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1555704rwb; Fri, 13 Jan 2023 14:06:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXuVLlaj6MdYi28lxn1111taLmtqie4EQCk6cb1wZGpo5z5/zePjf1t/v93QBx6NyUaPeqhx X-Received: by 2002:a17:906:c25a:b0:7c9:6e0e:1428 with SMTP id bl26-20020a170906c25a00b007c96e0e1428mr67413224ejb.47.1673647578058; Fri, 13 Jan 2023 14:06:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673647578; cv=none; d=google.com; s=arc-20160816; b=RVYv5E3wwIU8X3J3h0U88EGr0XHzpnvIFfeeJ88nLCGHO7qHwB45fNyomBWuB2af7v 0GCcY+SxtlZSbk0ImGwVhzKIRzGmvqU/+xDmYTqqH+YlZmcb6tUD/hNTg3jMQ5XLVdc9 Gqd9KmiFkb6550MNCfNcLcAzS3ADFh4XAI8v9074hLTEDurtEXwGgpd8BFVdJtsqK325 NcdsV9QiaculwQ5t8V3pil/hi+OWchN17bFWF+r6DQZLAkqbPWERdFqIKMJwaRF1DBS/ lEE9BXjrmMp/PnfYZHm5yo+yIwO8WccimxV8ApRxczHZYhK3fKzthKuJYuuInGbUpid1 8Y/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=sNq94sJXTXofGu4Uve2j2Vvw5CD8qRT6p09mQKHUMs8=; b=Es1iZthBrLdLCbMXiU3jmiX4SmU8QkAWIFq+saHRTf9S8s39nUQSmKP4dDXOGrv3gS mPk8F4lwI6QlZZRmrb3C7Q2iqDe6gDO1JDil1epIMgqJPMj5GQE2BRRr8+3lZSsOGlFY n6R99spfdN77MOX0uLCqDGugvKQSFqPTMqLz6+XSg4dCaIgy8+eHgtcfzKKqaYTeZKnt +oVBOEPRING7IpTlvla0YDfXzsN+hqVxVYff2KFtTHEHGM0B9glaIIRH/i6fHDR/SEZg fHwf5q00F3kUKEJNY6O4Ze1UaiDiccti4LxNQx2VocxykbDNR1LPHAhI9mRXGlQi8DEg Chfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EMqeV0Er; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sc18-20020a1709078a1200b007acbac0871csi22435166ejc.420.2023.01.13.14.06.05; Fri, 13 Jan 2023 14:06:18 -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=@intel.com header.s=Intel header.b=EMqeV0Er; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230466AbjAMVcK (ORCPT + 52 others); Fri, 13 Jan 2023 16:32:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230411AbjAMVcC (ORCPT ); Fri, 13 Jan 2023 16:32:02 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2F582AE6; Fri, 13 Jan 2023 13:31:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673645484; x=1705181484; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=SLmxe4+aIxsCW+XX4xedaaboKVOBP5e1UnAYk1kMH7Q=; b=EMqeV0ErT5Pjbmc8ByBZ9DrKwdyLRwOscb0DW9/ueuWpn8lxYi1ewq6I tHPiQ7AWUcNdl1XLY/96ujqQHBtpBHmpZQXI/+WkaHOZY3yFVU1dVwbiY IcN4Hi35cK603H96t7uFJbw44CWqjAMyRwtnOdVW6yKqsm4OYj81r6iY6 MPk0ETIbfx74UBDHl/W+wEHUVh8g+YwlGgLob+nl81UnnlMAl4zWxDSAg K1zR7q9ysTHnI/lug/cQBlcRd0GH67g8BJbL3S9VSTcmKTwbI5HN57QH2 BcvA8fZdRfhkXEZYU6mZKdo8U0H1rUUQoFDmA820sGeoB0N4yjoqBOWO/ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10589"; a="303802037" X-IronPort-AV: E=Sophos;i="5.97,214,1669104000"; d="scan'208";a="303802037" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2023 13:31:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10589"; a="987132454" X-IronPort-AV: E=Sophos;i="5.97,214,1669104000"; d="scan'208";a="987132454" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga005.fm.intel.com with ESMTP; 13 Jan 2023 13:31:20 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pGRdu-008rWo-1S; Fri, 13 Jan 2023 23:31:18 +0200 Date: Fri, 13 Jan 2023 23:31:18 +0200 From: Andy Shevchenko To: Stefan Wahren Cc: Bartosz Golaszewski , Dmitry Torokhov , Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden Subject: Re: [PATCH v2 1/2] pinctrl: bcm: bcm2835: Switch to use ->add_pin_ranges() Message-ID: References: <20230113171051.19309-1-andriy.shevchenko@linux.intel.com> <916654ca-e70f-5663-f3a3-9b370c24aea9@i2se.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <916654ca-e70f-5663-f3a3-9b370c24aea9@i2se.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE 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 Fri, Jan 13, 2023 at 09:13:23PM +0100, Stefan Wahren wrote: > Am 13.01.23 um 18:10 schrieb Andy Shevchenko: ... > > v2: fixed compilation issues (LKP), Cc'ed to the author of original code > > > > Btw, the commit d2b67744fd99 ("pinctrl: bcm2835: implement hook for > > missing gpio-ranges") seems problematic in the fist place due to > > odd of_node_put() call. I dunno how that part had been tested, or > > how it's supposed to work, i.e. where is the counterpart of_node_get(). > > Anyway this change drops it for good. > > The countpart is in of_pinctrl_get(). I was just following the pattern like > in other drivers like gpio-rockchip. The original commit has been tested by > Florian Fainelli and me. I'm not sure if it's safe to drop it completely. Please, elaborate how of_pinctrl_get() increases refcount of the parameter. Maybe I'm looking into a wrong place? > Btw this is not the only platform affected by the gpio-ranges compatibility > issue [1]. This is the only one that uses unnecessary added callback. > > Perhaps we can check gpio-ranges property presence inside the GPIO > > library, so this ->add_pin_ranges() won't be called at all. > > I thought this could be very platform specific, so i implemented a hook. But > yes my initial hack modified gpiolib-of [2]. The point is that possibly documentation of ->add_pin_ranges() should be amended to take care of the cases like this. We don't need two or more hooks to do the same, esp. taking into account that OF specific doesn't cover other cases. > [1] -?https://patchwork.kernel.org/project/linux-arm-msm/patch/20180412190138.12372-1-chunkeey@gmail.com/ > > [2] - https://lore.kernel.org/linux-arm-kernel/75266ed1-666a-138b-80f1-ae9a06b7bdf3@i2se.com/ > > > Also I would like to understand the dance around checking for pin > > control device. The original commit lacks of comments in the non-trivial > > code. Any comment on this? -- With Best Regards, Andy Shevchenko