Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1149999rdb; Wed, 20 Sep 2023 00:32:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG1jx3kHt3OhXuRIxOUa8k3fVdhDU1uswnTtakfyXSsCzvcp/kURxqWDbzLQC07qN5ZwZ0g X-Received: by 2002:a17:90a:e610:b0:273:e090:6096 with SMTP id j16-20020a17090ae61000b00273e0906096mr2528093pjy.11.1695195161713; Wed, 20 Sep 2023 00:32:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695195161; cv=none; d=google.com; s=arc-20160816; b=DfeCw47RD6Hf3UskvgL7co7OOtfjgwwekF++dpmadEkwTE/RSFVKAv12aAe4l7YB6u VX0l/k4gT1NIR2mWiKi6U/G+wrUqePKxDGS3dfn52g7+2eySd6NPZiGhozdH8iyqaIa4 vMSxtZ3pZFAuRnzer7v4YVo/KBSmQ6MYIL4fMl0YEo32TBYWIXnyBJ7wylzvzWtU1esQ rFA1vDKO4jS/1ycQgFPVR4UcOb+l2+ggohXvxfkDY4XKe8zhV6mFjlrGjt2+bxOgcS9W zVvdvJKn7dQZNMAP8KQ3oVta9vmg7N5FZc79lTSGvbjHj/vzVcaPpUagJ0UcR563w1+B VnDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=i67Pd3FgF9amUdJkkD3h8q1GlAvKniDMUlnahj7PZJ8=; fh=aMtcVPpq0VEGKtJeCK2HulsYu9xD32mtiHf9HITOT40=; b=J/58KC+8CxtGijWnPOc2o7aSYDmuVi5IMk7YlK3mYRMIXEx8X8tipbzuzLIrS6hNpU tG9JQ1bUfuHqmSibbXy8uci3mBUrzbtaFEEpi12gpI9M8XN9mZJGJqC2Ta73dG1eF+uk 5wEdw/hEgsFl9FObSVyKS/bxoACjfJBs1GH1Q8LDCHxkxunSivizukEeTDhD7Tv4Pxtg oDA2/Qw3oKoLCX4JotasSubPYiO5VSn5QuM1ro3O9J0Qq2nWXkyyiZdOGbV+kkoxuPRC uyBBvuX6OfDiW0UmIZtqmk21lXHxMFatGi0nUfEjPe8qrJyaSouPH7xwjC+3pwgVJbrm j1wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H+kD+g2q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id f23-20020a17090ac29700b00274d9ad80dbsi987361pjt.121.2023.09.20.00.32.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 00:32:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H+kD+g2q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id A55CD802B117; Wed, 20 Sep 2023 00:26:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233534AbjITH0L (ORCPT + 99 others); Wed, 20 Sep 2023 03:26:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233602AbjITH0J (ORCPT ); Wed, 20 Sep 2023 03:26:09 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12229CA; Wed, 20 Sep 2023 00:26:02 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B7C2C433C7; Wed, 20 Sep 2023 07:26:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695194761; bh=X9yOJUrjbWjEiTh3oxcVWNpA9x66namZO18j2DCtN20=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=H+kD+g2qcMwNqpfEO7M07AvF7mj0L2bWq9J+lhxLXC5Zv1dIeob7kY1rrVuRwy2wn akDNc2Q9cWeWeMjfXM2O72qeESctR/xVOIH9600vNp05V0VFuT01QEtxIe7envji46 Kug1Ox3t1DdD8ceidkDfa4WPtmuXz/G7qafrk9KhIoTDo/pQ51gpdXIMupjA4bRPk0 RbClZGqhXy4LyHl20I5dugCOoGsgH/YclPT5NHpxUQmhUN7ls21L9qwrzYjxJlqyDT zDn3aaeJNv5rti4DuNoC/ED3BhxOTptixs4LOs9xMlszJrOSbinRxnAQlR2o33qmuR 4Ed7283WVi2KQ== Received: from johan by xi.lan with local (Exim 4.96) (envelope-from ) id 1qirbE-0002wI-2Q; Wed, 20 Sep 2023 09:26:17 +0200 Date: Wed, 20 Sep 2023 09:26:16 +0200 From: Johan Hovold To: Doug Anderson Cc: Johan Hovold , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Maxime Ripard , Dmitry Torokhov , LinusW , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "open list:GPIO SUBSYSTEM" Subject: Re: [PATCH] HID: i2c-hid: fix handling of unpopulated devices Message-ID: References: <20230918125851.310-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 20 Sep 2023 00:26:18 -0700 (PDT) On Tue, Sep 19, 2023 at 11:15:46AM -0700, Doug Anderson wrote: > On Tue, Sep 19, 2023 at 12:07 AM Johan Hovold wrote: > > But regardless of what a long-term proper solution to this may look > > like, we need to fix the regression in 6.6-rc1 by restoring the old > > behaviour. > > OK, fair enough. I'll take a look at your patch, though I think the > person that really needs to approve it is Benjamin... > > Style-wise, I will say that Benjamin really wanted to keep the "panel > follower" code out of the main probe routine. Some of my initial > patches adding "panel follower" looked more like the results after > your patch but Benjamin really wasn't happy until there were no > special cases for panel-followers in the main probe routine. This is > why the code is structured as it is. Ok, I prefer not hiding away things like that as it obscures what's really going on, for example, in this case, that you register a device without really having probed it. As I alluded to in the commit message, you probably want to be able to support second-source touchscreen panel followers as well at some point and then deferring checking whether device is populated until the panel is powered on is not going to work. I skimmed the thread were you added this, but I'm not sure I saw any reason for why powering on the panel follower temporarily during probe would not work? > Thinking that way, is there any reason you can't just move the > i2c_hid_init_irq() into __do_i2c_hid_core_initial_power_up()? You > could replace the call to enable_irq() with it and then remove the > `IRQF_NO_AUTOEN` flag? I think that would also solve the issue if you > wanted to use a 2nd source + the panel follower concept? Both devices > would probe, but only one of them would actually grab the interrupt > and only one of them would actually create real HID devices. We might > need to do some work to keep from trying again at every poweron of the > panel, but it would probably be workable? I think this would also be a > smaller change... That was my first idea as well, but conceptually it is more correct to request resources at probe time and not at some later point when you can no longer fail probe. You'd also need to handle the fact that the interrupt may never have been requested when remove() is called, which adds unnecessary complexity. Johan