Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp228640rdb; Thu, 22 Feb 2024 01:37:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX+Z81ks6VbjKW0XnwCRTjJBfyfw5uV76pfN2FKcm/3QsaWWVYtjZlOU4vozIbUlCJOgFtDv7Aju1W2y3QbP59ifWaK+0WhV5z+zFGb5w== X-Google-Smtp-Source: AGHT+IFHB8yacRFGoBPFl1jOAB6lycKR2/6E3ajJJtDLHNiAeZYAqpUNq3sn10n7YR50D1ka/Vpc X-Received: by 2002:a05:6214:4018:b0:68f:62b5:cfd2 with SMTP id kd24-20020a056214401800b0068f62b5cfd2mr14911512qvb.32.1708594671893; Thu, 22 Feb 2024 01:37:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708594671; cv=pass; d=google.com; s=arc-20160816; b=IFPS1jfx4xi4XZJmRZtzKg5w332V4RvFJZFx2dLHZs0Te/juFpGlD4SZNT39s/pres m5gnoXsZ4r9aXrRhIxr3OEsf30RmR16TQH5CWOptrXowgAgezi8q5V5acrwv4gPkbFOA DmTC+eEQ77Au5mtwXW5LilLty3YllAPkNBnG8jW10dLV4D1cfNMZJiAi2Gi2ewNaImaM 3YpunyLPr0UI8UpHSu1x4KWX7PEczWEoJq1f0estZn251ZcqkG1cL+flgjcehBu1tJ9I kADSqvzebJ+SEjnioISiF9GUCYYBPwhCx9LwsFrh/oQUplJNiNpOwC+UAISjxVNqvGtE F70Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:from:to:cc:subject:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=RtpS10nroKrcjNGLR+XIwHm6KuoDQ2zN2AhYjSQtQ/0=; fh=e+tSaZobpTn+mfrkgE1cPTa5xwbrqI9WeCP7kp+V0po=; b=olu7GUtHIb+Uq+IEyIhZChdJNTP7ld9meFeYytf9W4YE6cnRLelKNgJjEe2SUiRNAg w3kCGXKioY3acql9UrpPGFaRpxYlzIQrQb8rWVhs94F0SNPr0fK3MpLZUL4bvoEwPE6K lKnRow21ee+55qAnE28dNg4rGmTW7Qugo5lICpNrj/8BXZ1opvEzJV07fqj7VwxcNpEd tNE4RYSITy3hoNz8rZKga1TvSB74d0PgnuSyJmOuF/NvpEAdxVEDxDV5Vn2SGjWP/Wxu KX0md3gPOq95M1VqGsDlpIWhwEfLpC8MYOscVyBMoqtA+33mxgdnhV2PTnejwn9sSwbU kdVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=HoxynaFw; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-76235-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76235-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 d5-20020a05621421c500b0068f761b112esi7889908qvh.357.2024.02.22.01.37.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 01:37:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76235-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=@bootlin.com header.s=gm1 header.b=HoxynaFw; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-76235-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76235-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 1CB591C24197 for ; Thu, 22 Feb 2024 09:37:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC676381BF; Thu, 22 Feb 2024 09:37:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="HoxynaFw" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7895017F3; Thu, 22 Feb 2024 09:37:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708594647; cv=none; b=Ki/RVzI8k6k5jLqDjq1mr/8PgFkTxRlfq6w/6yZt83bEi3Z4Ra/jr27Ykt9llczfFGqemlRgBQUdekobPK4K+nE5qvu5aqlM63JA1cQ5DxH2ZFc81nbK2KukJpgg7sD66PmPWIAFOq37FWU3+rAVhr/tyW+/IJ4pprPYv8dcBaw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708594647; c=relaxed/simple; bh=RtpS10nroKrcjNGLR+XIwHm6KuoDQ2zN2AhYjSQtQ/0=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=fJnMjaYAu/UnUbWclLb6It2ZL8F+g9odZ5rea2Mb+p0aS6aA2+s/82VX4pDTHlGHAwJ4B1+z4jKsyK4hR83oF5djzoGrnI+ecCUsCn/iGJHcgZax12fqvTivBHcrgMLKFfIyPNN1dXYqob3H3ME/abaRic6gUFkPe2+3GOFdc1g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=HoxynaFw; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 38A54FF809; Thu, 22 Feb 2024 09:37:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708594642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RtpS10nroKrcjNGLR+XIwHm6KuoDQ2zN2AhYjSQtQ/0=; b=HoxynaFwGBjgKqM3kaCHwq/Y4pT/rSyw1Hz7J/pn8wj94own9puofpBHibT2bUW9syI43e 9xij4loTsECllDsOAotsurK3oTO4xwc0g7o/mf2RdWT1OOxhnesgytZW11JZb0FOyXszQ+ QUk6vkkF9F4XJu+XQ7Sb3YH7/aKy8MvP8tQNIBXXhIK+7QRX1UTGr15r6OZQXGFrK7KRX0 2CO8q88AiaPVrnz01yceCpouuymaTkhShbCQGNK7ACt9mWa/39o7nz5Plamn65gwrOcv4g p3579NftsvVpsWGVsdHfaezX5GV8MKBjpHLCT5SJb1ZE03o2ejOsJjJEGvo0pw== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 22 Feb 2024 10:37:18 +0100 Message-Id: Subject: Re: [PATCH 18/23] gpio: nomadik: support mobileye,eyeq5-gpio Cc: "Bartosz Golaszewski" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Philipp Zabel" , "Thomas Bogendoerfer" , , , , , , "Gregory CLEMENT" , "Vladimir Kondratiev" , "Thomas Petazzoni" , "Tawfik Bayouk" To: "Linus Walleij" From: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: aerc 0.15.2 References: <20240214-mbly-gpio-v1-0-f88c0ccf372b@bootlin.com> <20240214-mbly-gpio-v1-18-f88c0ccf372b@bootlin.com> In-Reply-To: X-GND-Sasl: theo.lebrun@bootlin.com Hello, On Wed Feb 21, 2024 at 8:36 PM CET, Linus Walleij wrote: > On Wed, Feb 21, 2024 at 5:16=E2=80=AFPM Th=C3=A9o Lebrun wrote: > > > > Trying to figure it out... > > > > Can I help in the debugging process? > > Nah, I found it :) > > > Reading the code once again I'd guess > > of_device_get_match_data(&gpio_pdev->dev) could be the root cause. We > > are accessing match data for the GPIO device while probing the pinctrl > > device. Maybe something isn't initialised properly yet? The rest looks > > rather harmless, I've checked all conditional expressions. > > Yep spot on. The nmk_gpio_populate_chip() is sometimes called from > the pinctrl driver before the gpio probe() has been called, so the match > data is NULL and we crash. > > This looks like it does for historical reasons and there could be better > ways to fix it now that Saravana Kannan has fixed up the probe ordering > code. > > The following is one way to fix it for now using device_is_compatible() > (illustrating some other changes I did as well): Thanks for the debugging and the proposed fix. Indeed matching on compatible to avoid match data for a bool makes sense. Thanks, -- Th=C3=A9o Lebrun, Bootlin Embedded Linux and Kernel engineering https://bootlin.com