Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1180884lqt; Fri, 7 Jun 2024 10:08:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUaaaTcykzDenzL3HCnSuwTDc18TQdJUKz7MsVqs+1yuB3872JXjW72MSElps+C42Onnj+VoyACQDpexZVR5mAa36f43RGMV2qAhHuXBg== X-Google-Smtp-Source: AGHT+IGQSSCIIlGKRMnMSdMzTHCtqdpCk+S1E/S9pZOHyQ6nPdgXCT0AFuBIrF64z0vm70jdnzX2 X-Received: by 2002:a17:902:d345:b0:1f4:81ab:75aa with SMTP id d9443c01a7336-1f6d0398523mr27415815ad.47.1717780088278; Fri, 07 Jun 2024 10:08:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717780088; cv=pass; d=google.com; s=arc-20160816; b=MUYFpr+VcDJ4wuI1edUIglsVG5zLR52Cgf9PPyXJmIkfAfk6wcEJQ0tAecn8Zods1S vqI6ux3FLGTYWIT9gRBby0XAmVfnTa/ZwPEXjXwdcqoX1unjtPPY0tPkiu+/r+x5Qok4 Rng8MnKajF53zOBauY19PrpQapiyNldt3xjk7IqXi/S9sB/pvNiByLd+FcbsTzB8MgDz 8PAE8Ud2jKmtLCoQ9dhBR9Ap1aPfeZ63tEIbRab4sZ8Cnq9GHw0IxaYFwMSUReX/EEij tW3nLk+4eB1oyudigk4Jz1+/h6fIstwdnbcEVGUxhi3Fhdn1igfyU4G7PMQaIg3zkcIx znHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zHj/K79H43xlfqHPi++1hQlZOi9fT45WBsM4gL6Ozy0=; fh=KHtXwQL+ZJy1O3ZmoI0P/4troCfokFjuJL5brDONTQo=; b=xeQQQ/ZHOmqZQ5z0xqVp8Uk40zPDOMrOjvH5rRxvQWWWPVImyBjIdlN9YuiTWJjYza cR4XC8d1+oQivl4bN1/2ATv3HHsD1fAoXR+XkL2RN6tmgIr2b/54lelq0UqduKlySA9u 1pj+nfPkqqevYpSf1nX1vziKk7hxyrDya2c2SiUko+RQpy3l+DtHyGreLLclZW7dFz3Z NdomkCg1gFwFCiTBXMWJY4zsIkIRP8QFPmjuS6FqSEza6hLxL0xbcUiOkDl6y6LUTe5F SA26fNcKQ7J4vwmO3AXxVFLfpaqxFlUM9mYpijBDPky0qh2JdP2af2y8dcilpg++ZtIb 6r6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ghhL+aS8; 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-206527-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206527-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd7e4fcdsi13175315ad.370.2024.06.07.10.08.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 10:08:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206527-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ghhL+aS8; 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-206527-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206527-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8A1C9B2354E for ; Fri, 7 Jun 2024 17:05:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B96DB19AD64; Fri, 7 Jun 2024 17:05:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ghhL+aS8" Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 91A18EC2; Fri, 7 Jun 2024 17:05:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717779943; cv=none; b=OXGePNo2DrOWAokjizbKUcArhHeuZw4/hVMsG+1nDkZ1ip4YzMWcTLFEZTiyLHxS7av/I/MjLPucpY1FRN+RXOKL2qE69U4ZaRu7cPci/OgEZ2GbcFjUWkHwBTXbd+qTIsIdDCjhTbzYh4bkxlwbdoTssVsbBf3ShjlBfqf7IjQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717779943; c=relaxed/simple; bh=Am2/Z8lsAFupWmwCt+Zbzylg4sC7Q8nztArl9OEkYIM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Dodn23L/HaOU0ndnQ0nr2/cc70KFeXUclRxdQ1lsCDufrgSroc1QWNU4RG85b5QuqKOhHYaBOcWJpQ4u7fELNvihqDzrbPTFRsoK8uo6tkNJrYTX5uv5Ggn1rmWZe7uBJDJtOVaIeHe3qy81Bjl0f7311kZIYyaEe1lMBR5KaPU= 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=ghhL+aS8; arc=none smtp.client-ip=209.85.214.178 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-pl1-f178.google.com with SMTP id d9443c01a7336-1f480624d10so22134785ad.1; Fri, 07 Jun 2024 10:05:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717779942; x=1718384742; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=zHj/K79H43xlfqHPi++1hQlZOi9fT45WBsM4gL6Ozy0=; b=ghhL+aS8IXZhsLPynxQktX6uYzp7PjIapkJAX5h79YASvoXD9Z4zTZbrE4N6vxdAtC 3vwn+JLmfQCoPT2vxmDqKL1N7FfyPWHNemITB5MYv1m+jWbGf7ad9rZnOETYbnVfbhyx GkIh2rYRPzmUS2x0/fHEqY/smwGqRK1CbwfNSnEvojdAbq9P8QgC5+4pbnbqVcv737mw YQGzDceari/YdzZL32Yd6UEcx02WDRBMLn0cJYe6warMiSBAvAJebxNkOJU1AQMgRBEF UQycdlQoI8qq7Nzh3vG6M+JdMHU0Ddccmk6n9tEMAChMGy8C7z2BFlEv5xR+KMnP8Umx 6tzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717779942; x=1718384742; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zHj/K79H43xlfqHPi++1hQlZOi9fT45WBsM4gL6Ozy0=; b=NNih8cs1spb0uUiB12YXiHHJEbe/ASrrjBMaBLmva1plmgHdOvIxes5+CXqMqxOAsq 9PtVRdIjwpP9JMcB4YE1bqX8vc9pXW8tlWdqiccxjUgegbG0xnyXSC2QiKJKSedAhlNs sf4gComjzPM/K1SLlwq0Ol73Lq+W+m+9+vp3yBQAPWMaCmnwZ49X4t7H8NY2WwtJ2WHU FzaYZsFIAteets4WoU2s5CZKL7gt+T+fXp5zn7ABksaUW7tP0AZ+k9aYOssyvwuSQH2P fsCX6ZrQ5lZq4ennEl6bSSr31OFvWJqG6acA4vtbu807d7BN/muPJH2GwsIvz8fSQroN CDPw== X-Forwarded-Encrypted: i=1; AJvYcCX5gGgIR+FZz87apZTdIaV3JaHKKKPhvy3aEIFhvMSejUt8ekjbP8Iy/oRV9OtdwbGmHAcP+9kDS9rRBu/h1J+24ikpF1ZlRCqUrWLid8fuwkCZb4g/SXO0J6PCCV2ZpFsZwyQzYKePpNayC7zodyeVRlbYpCtrikULy7CK096923E2driT X-Gm-Message-State: AOJu0YwaSHs6YefblYlnyIiHzDxfBhDqlXCLmZM63SLckcopsIWDs6lS zGf06fuONtSEzhlyT2H4Q4tl2XaNhyqb92Ipr/tKKE2ipmJrBuF6 X-Received: by 2002:a17:902:c952:b0:1f6:80e2:e448 with SMTP id d9443c01a7336-1f6d0398fadmr36477375ad.51.1717779941605; Fri, 07 Jun 2024 10:05:41 -0700 (PDT) Received: from google.com ([2620:15c:9d:2:b8e9:3447:a54a:310b]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6bd76cc90sm36923965ad.84.2024.06.07.10.05.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 10:05:41 -0700 (PDT) Date: Fri, 7 Jun 2024 10:05:38 -0700 From: Dmitry Torokhov To: Gregory CLEMENT Cc: Kamel BOUHARA , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Henrik Rydberg , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Marco Felsch , Jeff LaBundy , catalin.popescu@leica-geosystems.com, mark.satterthwaite@touchnetix.com, Thomas Petazzoni , bsp-development.geo@leica-geosystems.com Subject: Re: [PATCH v13 3/3] Input: Add TouchNetix axiom i2c touchscreen driver Message-ID: References: <20240603153929.29218-1-kamel.bouhara@bootlin.com> <20240603153929.29218-4-kamel.bouhara@bootlin.com> <20240605124746.GA57733@tpx1.home> <7ca4a22f903313128de5c0f65a49b319@bootlin.com> <87bk4dfc7b.fsf@BLaptop.bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87bk4dfc7b.fsf@BLaptop.bootlin.com> Hi Gregory, On Fri, Jun 07, 2024 at 09:23:36AM +0200, Gregory CLEMENT wrote: > Hello Dmitry, > > > On Wed, Jun 05, 2024 at 03:48:20PM +0200, Kamel BOUHARA wrote: > >> [...] > >> > >> > > > + > >> > > > + error = devm_request_threaded_irq(dev, client->irq, NULL, > >> > > > + axiom_irq, IRQF_ONESHOT, dev_name(dev), ts); > >> > > > + if (error) { > >> > > > + dev_info(dev, "Request irq failed, falling back to polling mode"); > >> > > > >> > > I do not think you should fall back to polling mode if you fail to get > >> > > interrupt. If it was not specified (client->irq) then I can see that > >> > > we > >> > > might want to fall back, but if the system configured for using > >> > > interrupt and you can not get it you should bail out. > >> > > > >> > > >> > Yes, clear, the polling mode can be decorrelated to the irq not provided > >> > case. > >> > >> Just to make sure I understood, is this what you propose ? > >> > >> if (client->irq) { > >> error = devm_request_threaded_irq(...) > >> if (error) { > >> dev_warn(dev, "failed to request IRQ\n"); > >> client->irq = 0; > >> } > >> } > >> > >> if(!client->irq)?{ > >> // setup polling stuff > >> ... > >> } > > > > No, if you fail to acquire interrupt that was described in ACPI/DT it > > should be treated as an error, like this: > > > > if (client->irq) { > > error = devm_request_threaded_irq(...) > > if (error) > > return dev_err_probe(...); > > } else { > > .. set up polling .. > > } > > > > This also makes sure that if interrupt controller is not ready and > > requests probe deferral we will not end up with device in polling > > mode. > > In the case of probe deferral, I see the benefit of treating it as an > error. However, in the other case, I find it better to fall back to > polling mode with a big error message than just exiting in error. As a > user, I think we prefer having a degraded feature over not having the > feature at all. No, this is not how the drivers work, we do not simply ignore errors and hope for the best. If resources are described in platform definition (be it ACPI or device tree) they need to be there and they need to work. It is true for regulators and reset gpios (you do not ignore errors if you fail to obtain a them in the hope that the device is operable), and you should not ignore errors when trying to set up interrupt. Thanks. -- Dmitry