Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp811007rwb; Thu, 15 Dec 2022 02:47:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf4nQ7Y58KCETWeItwJ7SucxnVPX+Odxs7zsFBSInHkQqMEUB3mfjBCFEzpR8vzWDRcrnZMG X-Received: by 2002:a17:906:3781:b0:7ac:8e6a:a674 with SMTP id n1-20020a170906378100b007ac8e6aa674mr23176629ejc.2.1671101226665; Thu, 15 Dec 2022 02:47:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671101226; cv=none; d=google.com; s=arc-20160816; b=fp/1gjMz+HCg/Yk2R35z76jXg+Lpuczi3Fv/80FH9/2r4YfuOWUHWNebpOy77usrhm Zpb1E72wpMIj69QYtelW2oHGfvxJLorugpbMYS4iBRSRCzFV8kSL+WH+qK0JffM0rrBg voXQHBd6C78rbGn8G9mZv9+wCO83AzJZgq5yerG/Ad96RU+kLmjDLRQepwaxgK1xUA/6 F+yWPTKqWOtYVy1LSDM5amT+S3o0/FRrChRCOjYih7U3QkwCODNitR5Nle/JLi0xRT3H S6UANGKt60HK/b0XtG8x8xMJWxH5fq/pfrk3lyQmYmCGGxMKoK9beWToGcPTPzPHPIOy +oWw== 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=yTo8TGtKU04pbZQRNU8q6FUzenVgUlmD/ZCkk+13+Fg=; b=bbljRKU6HXtkW8e3odF+D3cjz6lwUEyF1ZBXku5RjC7d5TpOURiBVK1DGY/rSmbd8g PNlYX0aTx/Dz5Q9B+Nw5wVt0tV6jcRLQMYkXQcwrGRpS+TLrIyE8TNlvE+JO1kdX1Sko bAsXtqd7mBbd+uviD8MxIlq7LCc1Fi0BjXqWn6ZwRF2qgQvtAndWQwNVcP5R5u5FaiEZ ueyYxdSvYmpyh0q9Y/L2XaBXdFWOfgmVXmJ402Z7jIpVqJyUbYdsJlVfNUoVsStqajwl 7TOZF4HTwp1+C2zeLluzcljcoZaBZWPNGF8lM1BuJl+iQTWSlBa8bel+YJ8MtuXQoGgK HAcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eh9+fbEO; 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 hb7-20020a170907160700b0078db3762061si6601166ejc.439.2022.12.15.02.46.50; Thu, 15 Dec 2022 02:47:06 -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=eh9+fbEO; 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 S229829AbiLOK2E (ORCPT + 68 others); Thu, 15 Dec 2022 05:28:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbiLOK17 (ORCPT ); Thu, 15 Dec 2022 05:27:59 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 989ED2B60B; Thu, 15 Dec 2022 02:27:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671100078; x=1702636078; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=qi28k1GX3tjuQZRSTlv4FNTYPFHyVrbTkUewvlsuX54=; b=eh9+fbEOcH5btExXNX80Lz2qCdyazVIoyp37DBfR2P59aYefMVYJnAwE KipGP8ZPvVYmKf8ntKfjKuRZN+M0s0ELThQG8UhFECMof5iSNcoToA4cd kkVk+xAz1qv1pQ46DNaVO+zxm3/r581YwgPRXeB78WITnq4zcA6NQYbSF ZjasCXDOtOrbSynqla0SxCsdkdOauyllpqpOQAy/4ux10FxamZor7gXdF K20rXsx9Bj+FC5EtjOf8jL6RnUqtgYym0TfsvBjYjFIpDd+QDxSENLYcp dh7Pl+faIhpJJI2VnP8eM6/ZvPa6UyEBaoiT503h7+Pb3OqsoEqW6djjN A==; X-IronPort-AV: E=McAfee;i="6500,9779,10561"; a="404911291" X-IronPort-AV: E=Sophos;i="5.96,247,1665471600"; d="scan'208";a="404911291" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2022 02:27:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10561"; a="791582131" X-IronPort-AV: E=Sophos;i="5.96,247,1665471600"; d="scan'208";a="791582131" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001.fm.intel.com with ESMTP; 15 Dec 2022 02:27:52 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1p5lSw-00AHVn-0U; Thu, 15 Dec 2022 12:27:50 +0200 Date: Thu, 15 Dec 2022 12:27:49 +0200 From: Andy Shevchenko To: "Hawa, Hanna" , Wolfram Sang , Linus Walleij Cc: jarkko.nikula@linux.intel.com, mika.westerberg@linux.intel.com, jsd@semihalf.com, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, dwmw@amazon.co.uk, benh@amazon.com, ronenk@amazon.com, talel@amazon.com, jonnyc@amazon.com, hanochu@amazon.com, farbere@amazon.com, itamark@amazon.com Subject: Re: [PATCH v2 1/1] i2c: designware: set pinctrl recovery information from device pinctrl Message-ID: References: <20221214142725.23881-1-hhhawa@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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_NONE, 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 Thu, Dec 15, 2022 at 10:15:35AM +0200, Hawa, Hanna wrote: > On 12/14/2022 6:09 PM, Andy Shevchenko wrote: ... > > > + if (dev->dev->pins && dev->dev->pins->p) > > > + rinfo->pinctrl = dev->dev->pins->p; > > Hmm... I don't see how this field is being used. > > Can you elaborate? > > This field is used in i2c_generic_scl_recovery(), if it's not NULL then the > flow will set the state to GPIO before running the recovery mechanism. > if (bri->pinctrl) > pinctrl_select_state(bri->pinctrl, bri->pins_gpio); OK, but why that function doesn't use the dev->pins->p if it's defined? (As a fallback when rinfo->pinctrl is NULL.) Wolfram? Hanna, it seems you missed I?C maintainer to Cc... ... > I saw that that the change failed in complication for SPARC architecture, as > the pins field is wraparound with CONFIG_PINCTRL in device struct. I though > on two options to solve the compilation error, first by adding wraparound of > CONFIG_PINCTRL when accessing the pins field. And the second option is to > add get function in pinctrl/devinfo.h file, which return the pins field, or > NULL in case the PINCTRL is not defined. Which option you think we can go > with? Getter with a stub sounds better to me, so you won't access some device core fields. Linus, what do you think about all these (including previous paragraph)? -- With Best Regards, Andy Shevchenko