Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1124572rwb; Thu, 15 Dec 2022 06:44:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf471pfw4iEKU/YLUD6WpKR+La5W+Lgf5CfO4t4a2mRUPpoSxhcMgYy0SZTIDQccxMKSZwS4 X-Received: by 2002:a05:6a20:7f8e:b0:a2:7845:de1d with SMTP id d14-20020a056a207f8e00b000a27845de1dmr34150928pzj.20.1671115464661; Thu, 15 Dec 2022 06:44:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671115464; cv=none; d=google.com; s=arc-20160816; b=UFiTePO1vFVLQ5utLgpPDujuB8+Hiynd5uTfPgykR3Zl5zE61bwfhfNf98soMicaiD TFFRh4a2UK5Ls5E703koPv/fIjr09OWmhKq6MlLKCbwbgWnU8wYHwI5Jkpfu3736H4oe oYDXGBcGxDa3JG4Vs4+gd+Lu39CBy3UDpKfHhGzZ1FcbBy0yZwFl2VKbiZXrnl2Xrbch F/VcEjaJao/seTmAGKdVi38Uj405OX/YTR6RRoOE+ZBeLgm+O+4L15FoZF/fACvN2d0j m1niPA0HcPHI8gL9Odqz7NtksfGK2G9aL/IRMQEX4JhGmM4gf2rRjw0n+8gJ+ghzvYXK poEQ== 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=ZWJCCGajjnlcSU0ERtJA2Tzyvj1nNyfPvgyo5xOAnh8=; b=FaG3OCBynnZwSydCw3rSrXWn7JKn+zpRSwYofr4+ttrgyHeAcVtFQOmtgFoM6RX3Ig fQAFuGBLk16rkG0kHISSnSADfmwwRKhnYEW1PrPFhaTgF6JnkYXTCizv7Bg8wZpONpHe +4Fd26xqMPgG797u9VEcwD3Zm4gMqTzrQXbQmj/EVbBl7TBHpLFuxU4thEOAYKvETgXs SfxetMYuCA9gWBY01pgsZzZDLl5zH/x0nSRhBvkNqXHPUKoEGVgrskVu3Lqu151gqSyf v91zTXJgUiiP/siI4hFQ7OMKOz/uY4E86oFfumOCBGFSdqoZGEht19Zqc/TQ1E4xrJi1 djTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ubJDRqoh; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 138-20020a630390000000b0047776c01d71si2901969pgd.375.2022.12.15.06.44.15; Thu, 15 Dec 2022 06:44:24 -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=@linaro.org header.s=google header.b=ubJDRqoh; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229868AbiLOOG2 (ORCPT + 68 others); Thu, 15 Dec 2022 09:06:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbiLOOG0 (ORCPT ); Thu, 15 Dec 2022 09:06:26 -0500 Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A9D0108E for ; Thu, 15 Dec 2022 06:06:26 -0800 (PST) Received: by mail-yb1-xb34.google.com with SMTP id i186so3556236ybc.9 for ; Thu, 15 Dec 2022 06:06:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZWJCCGajjnlcSU0ERtJA2Tzyvj1nNyfPvgyo5xOAnh8=; b=ubJDRqoh84qjmY5+kL5diw37Q0xrZue0jX5Rml7ru2Qk59v6wd3pVEMfmLHkD1sje+ Fdb7O2f0IpcXKwkmBsU7ZQX2rQ0noHJPcOmsAoI5ukTgLjrVnK2+jj3CiONpwJru+uV6 MVjtZMhIqMRrpe3HAaSZdAkkKPSWV9Puoj3PjAHzC+fKM+2VXxelqwa4A5NfbGS6ZpQF kDi3dsk3mSAOe5JZVmHcAAx8ZcUcE8XrjhIta/Y27F5EZKr3qKyIXwForPHsutViy7Kf PBdSRsODCcSx2iy6F/jHBPMWNI//cr2THVaGyl7x1Q17Ysbszstw5dFN4jXvrm2I2TNr sPyw== 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=ZWJCCGajjnlcSU0ERtJA2Tzyvj1nNyfPvgyo5xOAnh8=; b=LAz59jv2XnyJAoNSyYkXndsOJoGG0hTQyADxxf0/phwdDDU+shKcvbVYyY54P7mRa0 jmrxQQ+K6ICpCv/ve3zYngf74NQY0oVo6WPlNapjjVIGvIq903BClVEheRul927sSCna ToWmTD1AYgXEX8KfdnIMeHPY5+SWxMcexM5RCHX/yJNLcFOWCbdTfYFEgbv//eYHassJ VihbYVfh54aUjKV4cPqS3BY0fPgXCDYcg0LJHvUsI+tZQcezjxeomEQhOh6wV2/IrszD ciXPISM5bs3js3JjmZfVAS2/00WzhWV+Le5OM347EL8UBoHByB+rXrBykcbDzIAhVDzg W5VA== X-Gm-Message-State: ANoB5pkhDVd6mpN/qPdN3bGN+GpqreN/EAuFtl2833NIu3J2tPRGvSqd rr+uuYNALks4of2aEviYb4uVQlObXIQSLzWRkAvi0w== X-Received: by 2002:a25:738c:0:b0:703:25b7:67f3 with SMTP id o134-20020a25738c000000b0070325b767f3mr13142401ybc.54.1671113185408; Thu, 15 Dec 2022 06:06:25 -0800 (PST) MIME-Version: 1.0 References: <20221214142725.23881-1-hhhawa@amazon.com> In-Reply-To: From: Linus Walleij Date: Thu, 15 Dec 2022 15:06:13 +0100 Message-ID: Subject: Re: [PATCH v2 1/1] i2c: designware: set pinctrl recovery information from device pinctrl To: Andy Shevchenko Cc: "Hawa, Hanna" , Wolfram Sang , 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 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,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 11:28 AM Andy Shevchenko wrote: > 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.) I don't understand the context of these things so can't say much about it. > > 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)? A getter may be a good solution, it depends, it can also be pushed somewhere local in the designware i2c driver can it not? I am thinking that the rest of the code that is using that field is certainly not going to work without pinctrl either. Yours, Linus Walleij