Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3016907pxb; Thu, 10 Feb 2022 10:17:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5iBGDyK2tH05/CFbE5T15C2kVMYKPWaGaOIn3ZCQjGfh3eE1Dp0XZcLxOkK5zu5Pi0Yth X-Received: by 2002:a17:907:2d8d:: with SMTP id gt13mr7527985ejc.583.1644517037410; Thu, 10 Feb 2022 10:17:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644517037; cv=none; d=google.com; s=arc-20160816; b=o8Tu9SEA4AoBei7RnKc+QZwL/GR2loh8cmLJ5mxujP2u+Ni6STScnu6wTuCDkJb7aw JoaRwoWuFS1V7d/M6myf47XeJls4gzCjGCGhqSInzffnL6BsKnRiWQwVescCjr6BczBf 9OK2MuyjpdKo1Hbc0TVwBEA3+4R+J65XrAp3Dy/N2s1oUaaQhIlOXAqMWn/kHf1V7O7L bo13I//84QFnN/8b+GFrZqmDWqHAhNXazPc/VTuNt01bplRBZ+guDg1buTxr+NU041AS tN94lShIXJeoJFiy7lE8f6HyU2MVf1F8f0LH0ZxudYdfiknwcQvLBLlKXJurSdynOXH2 G5tA== 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=VyiRrCTCvD3kSlcteklEwF1Z7ulIFO497MFIShZC2EQ=; b=IQVt+W6vk6KZ/oepA+oxxVtD/3xo3XslMHlprizFt/z5idqD+ENqq+9KRhehBtZJsf cjaj/7Yu03BLbrbfDivNE7rDT3a1XjuUG/FDsx+MOtS4+WPQf2XF7TWVHhe+Py0NA+sy t1VPlwsjhYj0TVhtvU4Ov5BdN/P4hp3+cC+r6TyUQPJPU6OJDwO3d9z4eNNRi3Y/bd60 TZV1/f6+qDRnRVyhTS/z+DFeo2KWXmbC4NwVZ6p72YEfnFhPyw+Th5Y5Ybjiv5qjC3xd JGmtmmAa5q4qip9aUuDgnPLsC2wgwfdkOFTf/HAwi1HvSPkFtHeQdv4xEWNrbPQ6F67b VklQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=lDJDV3gk; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qf19si5218063ejc.902.2022.02.10.10.16.51; Thu, 10 Feb 2022 10:17:17 -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=@bgdev-pl.20210112.gappssmtp.com header.s=20210112 header.b=lDJDV3gk; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245477AbiBJSAU (ORCPT + 99 others); Thu, 10 Feb 2022 13:00:20 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239511AbiBJSAT (ORCPT ); Thu, 10 Feb 2022 13:00:19 -0500 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF373F5 for ; Thu, 10 Feb 2022 10:00:19 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id k25so17231954ejp.5 for ; Thu, 10 Feb 2022 10:00:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VyiRrCTCvD3kSlcteklEwF1Z7ulIFO497MFIShZC2EQ=; b=lDJDV3gk7vJd8epZow77aLEhctdFJiMdWg4bPXyRqV+P8SCznLTjg9qaMrl4uBKi4W FIa5xSqiTkfMTDDaQX3a6eOR3PULr05leKgBb7dtj1Z9aBTmqdnSEHwpCDlCePcizdIr RL4deMl0WEaY0Jh1Ab9JXnycY4MaE3/yjJweZ3uE1EswISDRfgGvftKiIcyY4+H4cJmx ksSJIN7XeO+LqnG802F/TkZsEYNXr+GmnNkQS0ZABy7zH5ImLkTkhCeBnSYlJHR3czCM ubCKLT2cdNKaVcXthXtuVbskMddyIIhCb3KdDg7PxHdghxxP8+GQpQM+WnSRcdvK6IOK wuSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VyiRrCTCvD3kSlcteklEwF1Z7ulIFO497MFIShZC2EQ=; b=419pYnMGGb9Vv20okCDNRX8msXiuesbQajmZIcnR6biQzzuOPSgDEwfy9EK4o/FAoa 6CQzuYaxE9iaoO0Ic8nFNpPi3IP9JjjPcTKSbP9GEzrlr7d39gamTeXkXgi/BatwEjI0 HYLr9RvEhDEUSUH/h4dgKz9TGDn/xCGzxUo8sSCw+kqFcYahXK4F6Pcw7MVzvAix/DfN HNHYypVgdZ6fw52yyhrQp7lBA1Q/1nJjbMgFEgkayGFOsKmDPvDLIE4RkdA4utxTFk46 NHeH4pvjgCJawsuYwAu0G4+3JNlawponUqUSk/sRNPSudRlfK6BrEnl9q0+NwdFIwmwP O6uA== X-Gm-Message-State: AOAM5329OA0DUZeDn4erd7pBOCD4KSaJ03J+Bbx6AuPd/qj+bZFLU1qR vjrKJUBn1jfKGpIP1yu/VC1mcuaKgxPjgUuWGMkWDw== X-Received: by 2002:a17:906:7948:: with SMTP id l8mr7308424ejo.636.1644516018273; Thu, 10 Feb 2022 10:00:18 -0800 (PST) MIME-Version: 1.0 References: <20211116093833.245542-1-shreeya.patel@collabora.com> <874k56znix.fsf@collabora.com> In-Reply-To: <874k56znix.fsf@collabora.com> From: Bartosz Golaszewski Date: Thu, 10 Feb 2022 19:00:07 +0100 Message-ID: Subject: Re: [PATCH v4] gpio: Return EPROBE_DEFER if gc->to_irq is NULL To: Gabriel Krisman Bertazi , Andy Shevchenko Cc: Shreeya Patel , Linus Walleij , Bartosz Golaszewski , wsa@kernel.org, kernel@collabora.com, "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , linux-i2c , kbuild test robot Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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, Feb 10, 2022 at 5:36 PM Gabriel Krisman Bertazi wrote: > > Shreeya Patel writes: > > > We are racing the registering of .to_irq when probing the > > i2c driver. This results in random failure of touchscreen > > devices. > > > > Following errors could be seen in dmesg logs when gc->to_irq is NULL > > > > [2.101857] i2c_hid i2c-FTS3528:00: HID over i2c has not been provided an Int IRQ > > [2.101953] i2c_hid: probe of i2c-FTS3528:00 failed with error -22 > > > > To avoid this situation, defer probing until to_irq is registered. > > > > This issue has been reported many times in past and people have been > > using workarounds like changing the pinctrl_amd to built-in instead > > of loading it as a module or by adding a softdep for pinctrl_amd into > > the config file. > > > > BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=209413 > > Reviewed-by: Linus Walleij > > Reviewed-by: Andy Shevchenko > > Reported-by: kernel test robot > > Signed-off-by: Shreeya Patel > > Hi guys, > > This seems to not have reached the Linus tree on 5.17. If I'm not > mistaken, it also hasn't reached linux-next as of today. Is there > anything I'm missing here? > > This is required to prevent spurious probe crashes of devices like this > FocalTech touchscreen, FT3528, when using pinctrl-amd. We've been > carrying it downstream for quite a while. > > Thanks, > > -- > Gabriel Krisman Bertazi Hi Gabriel! My email address changed in September, that's why I didn't see the email you sent in November to my old one. gpiod_to_irq() can be used in context other than driver probing, I'm worried existing users would not know how to handle it. Also: how come you can get the GPIO descriptor from the provider but its interrupts are not yet set up? Bart