Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1035493lqp; Sun, 14 Apr 2024 10:48:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUsFYZYjQFNt9y0iQvogsroih2qh9LVG8UVJDmnX/u2135Inq0hd+EkZFnXrP2sVy6cFkUp09kgJMdSjZvTm179vIHfhIvrvWEgHiS+vw== X-Google-Smtp-Source: AGHT+IFfYkwmIpPkT8P/7Pbf72sFtgdqDCUf+ETVCh4XVd2AT1MzWu/OKYHpyeGK6lbSIf1KbULw X-Received: by 2002:a05:6214:911:b0:69b:2aa8:dc56 with SMTP id dj17-20020a056214091100b0069b2aa8dc56mr7155215qvb.36.1713116893447; Sun, 14 Apr 2024 10:48:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713116893; cv=pass; d=google.com; s=arc-20160816; b=S3OUSG1YAiBOLaRR0icYurEafuMqAE7BpCNKfFU1e8+wZYw2HCm2coW4d+2dsAPUu9 pyaLn/ZJGp1k1sObfH7LxS+YpA89y4xJzCcBhMz+/9+D6kyEJweTBZAiYutZUgBZhvfg 3Y46hpTZPPTsLFsGGXcBE30VMHQzIEpr9KSHAkWiixKW1Fg4V0CfSFzSm3Pam4CzbLlL iEiHyJw+0CeipAHWDFUa2/I8bqJuddwk+ftu01CabL6u9dCLtL3smS9dQtlg93TiwTV8 l2sAVGi6+HJiL2+A9+ricjODqI5/pgl2bn0stKUkIxvVziBAe/+ZRX3YD0nksnu61jtg YyIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=4sC8EDioQFXn8NicLfeAlG5gQhPw/Yd6MO4qGojEFBk=; fh=FzyDK/mZc+fPphgfRFJ0CFUi57kgha9L5atGR2vCleo=; b=ETj+2aXqkO4wdy1++X90WwPoWr9x2uaKqEJXayaqODe/uFXyyxd5N9EckDT61BbhLW R7Jd33FpJAzTxOKPoIFavSoSIgz+1Hme5YI3iRHGb5fLW50O+FgL48mYt27XFUh4m4EX Tf3Vs9Z97xmvSTMy7zK6AtfLVOAVOFBZWtbQ8IVnvyIRauSXRv4kqED8afIhSvUbAkm6 yhi3RrghSvX7w54S5/SWUUvLSbKBpDL1nxHsEYpcFehxZyVqIyBX15kfhWZJTn6W8hxq 7L0lvzPF354mfqRw6FpJrEB3TFok8EazUbYRjDWZBBt5vI45MWUX0PnL7zCvOnoWMYWr mQNQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MzS6E60Z; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-144311-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144311-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ev13-20020a0562140a8d00b0069b22177e9csi624086qvb.45.2024.04.14.10.48.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Apr 2024 10:48:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144311-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MzS6E60Z; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-144311-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144311-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 22BEB1C21254 for ; Sun, 14 Apr 2024 17:48:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9714C135A68; Sun, 14 Apr 2024 17:48:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MzS6E60Z" Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67DC317551; Sun, 14 Apr 2024 17:48:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713116884; cv=none; b=erpnBXZdKUs5ekNh16Cq/FFaOFXrup0b8qFJjbiCd7tBvZ5MdPC8EMvp4TcNMubDawrEXuw9KbpVEEikVE5Z02NIjX/HMkU6in9QMSfGX7m+Z/Alv7GxPXJmUXx+hYApBk/1Bmj3B5SZl6t4LBzYtyyuLE4y/ATGRYtrpvoVVSA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713116884; c=relaxed/simple; bh=qNFTB58BB/3tcqDqqOf5notEGqrOnOZOZkP6bfgMgAw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=AXhk2J3W5DbLFsQa0Rsrpcr9wkYNzogEMzsvmiOtK1+upRvJ6SNmWDwzEgWAlqQ2d2teEQE/yQ4FhQe69x9bIbJqad8bHqCxlpx4L1k7s6mypJ8nnfRAMJe/gXS2+Sw2f/xeJMZUKnkDfl+e+eTnJ/xbeT9oQYIbx3gHAK7eM2Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MzS6E60Z; arc=none smtp.client-ip=209.85.161.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-5ac5376c4b2so1562062eaf.2; Sun, 14 Apr 2024 10:48:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713116882; x=1713721682; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=4sC8EDioQFXn8NicLfeAlG5gQhPw/Yd6MO4qGojEFBk=; b=MzS6E60ZzOj9fN9DvFGlaDWC9r/emMQE7QDsNrZMV7NP+r6X+ZesUR4O/7udlWMW79 su7qUalVhxokkXWn3++R0WY2A+3ok24p5VSpNqGhMQLzE3I20zF6BxNx0gACml8vuK6V lPHWZBnH38AVyKNckXYIPXvu3buuyeZooq+W+d5sLaSiD/hfD5pXztAEi4Wbo8l7h91q W/7FJV9NXcB8fsHoL3kZc9D65qMC0p7wwdNeo1rRjDURRV3f17wDAmFb0iBVR6olAyqk AJ+lFIpVhVZF2U9S3f9nJJHchdy45S3Elh2HAI3zHNlIBNxFQ+8EBK7E9DUpzBPT1J2K +5Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713116882; x=1713721682; 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=4sC8EDioQFXn8NicLfeAlG5gQhPw/Yd6MO4qGojEFBk=; b=Y5BqPbbWa5mr5zmwgBYW9j9r8Vk816iE2Q+ZdpAy3iz4PEkoT+IzQ7AzS3D5+CRzLs HEAjrVtEQgd6U1AXrzvCroSJ+stCfSwZGEHAJwl+UNOzxwxEcrlklYGDjQlrU10CwQFB bc740ob8Ut0bCYtNXknlvR7pO+SqeyibTnY23Bk++PF9NjFdTvcGC3J7FsGVLs5r9mX7 aQlAa5bDZk/78uiKLSqdOfD9ABZAPACudeRgZEJBdgEeGdZ5W4uhdzjun4HGijkcUsq1 2mGAYdm1txs8LvpdsGCl/FCG9QclHiUFlp1SKdg/taonkAR8neVwSxrNvFbaM3GtUFkI G1nw== X-Forwarded-Encrypted: i=1; AJvYcCVpIPC3pocYvxxWF9U6iH7TtUBBmq4BdFq/zv/HDWIP+YmuaK+y3rN2KMAuZ+N8gtAMtd5jCLnjKzaoNWRX0+8uxlTYLS/5gFlwRhdwwNetBRwqyoYgMw76CATclr77xGomok6OKeXAXjNBl+0zKR61CfGD7jVRtmHNbP9lHuJba6MkDA== X-Gm-Message-State: AOJu0Yx962uW4aIxk2JbgFvLMdgoA1FrOEjbd/IDrT+g/BVP4bnDp3jp +7Qnv8o4PRmZzBCSQT3LTiLY4t+rnhikNLNLXSL4ocoA28BtvuziMeRkEnS88pae7xEYNMRvPGf qJIpGi1vxYJQpd+nmIo9xMPpRrSM= X-Received: by 2002:a05:6359:4246:b0:183:ddb0:eb03 with SMTP id ko6-20020a056359424600b00183ddb0eb03mr13659348rwb.21.1713116882371; Sun, 14 Apr 2024 10:48:02 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20221228164813.67964-1-hhhawa@amazon.com> <20221228164813.67964-3-hhhawa@amazon.com> <416340b6-33a9-4b9e-bdc5-c5a9cffb3055@gmail.com> In-Reply-To: From: Robert Marko Date: Sun, 14 Apr 2024 19:47:50 +0200 Message-ID: Subject: Re: [PATCH v5 2/2] i2c: Set i2c pinctrl recovery info from it's device pinctrl To: Dan Carpenter Cc: Hanna Hawa , andriy.shevchenko@linux.intel.com, wsa@kernel.org, linus.walleij@linaro.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@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" On Sun, 14 Apr 2024 at 12:34, Dan Carpenter wrote: > > On Thu, Apr 11, 2024 at 07:08:56PM +0200, Robert Marko wrote: > > > > On 28. 12. 2022. 17:48, Hanna Hawa wrote: > > > Currently the i2c subsystem rely on the controller device tree to > > > initialize the pinctrl recovery information, part of the drivers does > > > not set this field (rinfo->pinctrl), for example i2c DesignWare driver. > > > > > > The pins information is saved part of the device structure before probe > > > and it's done on pinctrl_bind_pins(). > > > > > > Make the i2c init recovery to get the device pins if it's not > > > initialized by the driver from the device pins. > > > > > > Signed-off-by: Hanna Hawa > > > Reviewed-by: Andy Shevchenko > > > --- > > > drivers/i2c/i2c-core-base.c | 5 ++++- > > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c > > > index 7539b0740351..fb5644457452 100644 > > > --- a/drivers/i2c/i2c-core-base.c > > > +++ b/drivers/i2c/i2c-core-base.c > > > @@ -34,6 +34,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > #include > > > #include > > > #include > > > @@ -282,7 +283,9 @@ static void i2c_gpio_init_pinctrl_recovery(struct i2c_adapter *adap) > > > { > > > struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; > > > struct device *dev = &adap->dev; > > > - struct pinctrl *p = bri->pinctrl; > > > + struct pinctrl *p = bri->pinctrl ?: dev_pinctrl(dev->parent); > > > + > > > + bri->pinctrl = p; > > > > Hi Hanna, > > I know this has already been merged, but setting bri->pinctrl breaks PXA > > recovery. > > This is patch is a year and half old so it's a bit late to just revert > it... Hi there, I know it's old but I just tried it on 6.6 in OpenWrt. > > What does "breaks" mean in this context? Is there a NULL dereference? > Do you have a stack trace? It's really hard to get inspired to look at > the code when the bug report is so vague... I admit that I did not explain this properly, but if bri->pinctrl is set then PXA I2C is completely broken as in it doesn't work at all, there are no errors other than trying to probe for I2C devices will time out. We had the same symptoms when PXA was converted to generic I2C recovery and that had to be reverted. I think its probably some pinctrl issue but nobody has been able to track it down. Regards, Robert > > regards, > dan carpenter