Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp889654rdb; Tue, 19 Sep 2023 13:18:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELlOx1J4b3hFwJJJd/VqZOCHO+F8m4HX0zdfg8C5ZHsJ1BUfdVhIRLBde3JDzJ2wRj1fhZ X-Received: by 2002:a05:6a00:13a9:b0:690:1c1b:aefd with SMTP id t41-20020a056a0013a900b006901c1baefdmr878928pfg.5.1695154735475; Tue, 19 Sep 2023 13:18:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695154735; cv=none; d=google.com; s=arc-20160816; b=NrNDyXg92+vEf/31+zae7vmWUam50QbU/DRrJzyU0bsK8sAZlJPxO9k6pIbyTJkpQO XwTbBt1fAnc+fgUX4+ba7W9XLQiAlKfnjtTtDV06HxNT8dgWCcNQDINWgp+CXXcXN/3S v8wIf3UGxHPoASY5+CyXVNVXwP6b5tQkB7T5LFgzauGbny+xeyggMFpT47YQVAjMpQnZ HeD+6V4s/aM0E+uYK4jDlG+lrbEsrUfQs5rn3qZtorOsF/BhztbzaM+k15ixdKeSbzTP qkr3fz/OqTuyLdcEwoChmnzCRlTMfrsQCZq64zxk71xPuYDpTGUP/03yIksNNzUtSLFp KMDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ZXJATLGe/WfIktgoMPXg04Y8kCGTEYPfQUQyvrst4q0=; fh=VjUrb3vhawZDNuWMblZdbQdjE9faKzp2oXaFESL9PQA=; b=qKK70eS66MoV6mVlpmN9owPe8xmtW50EhPGLLxeDRRPL9gG7Cu4n8QY7Z4mfp7fyhZ XrhkkG2XMKsEP+Olo0YadKDJRpDPIBa02cbTnkdIfTEvuCEijrT2n2KQ2v3KGXjyKpGk M/XRc+X7kx9me1o76kJM6dKgAtBpGfqW5Vo/clFGKAQCsFEM+wOGjkbOqpjqRjKD+UxL oV2r32lxigVESPZ6h/q9xs7wVlkFk8+GS2NhQmHO4U4hS4OFNgCZU7up/mHgORcK3i3j MRKOzdfZry2S1z3Gba8+1qdH2trJfWmBuy+1drgzBmc4yspy0JaR56+2fTaoDxlPnHSc sRIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DGZRsWze; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id br15-20020a056a00440f00b0068fca4405aasi10253506pfb.338.2023.09.19.13.18.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 13:18:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DGZRsWze; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 033B48242F7C; Tue, 19 Sep 2023 11:16:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229853AbjISSQQ (ORCPT + 99 others); Tue, 19 Sep 2023 14:16:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229891AbjISSQN (ORCPT ); Tue, 19 Sep 2023 14:16:13 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 017D799 for ; Tue, 19 Sep 2023 11:16:07 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-9a9cd066db5so794312966b.0 for ; Tue, 19 Sep 2023 11:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695147366; x=1695752166; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZXJATLGe/WfIktgoMPXg04Y8kCGTEYPfQUQyvrst4q0=; b=DGZRsWzeGzwUjlKOUpw8mGGfM7DlU1NPR0GDE2Y48D3CNJ4TT57/V6Nnj245lHbDoy HLJn76Ra5OdF0DtB44XuZIuBe1QhlhI/iXIiKb67IHpFfkThBv1XdZJI1hwUMld7OAFk Ui5ddmBd838Vgdb2LZgQQJAUnaw/ThxrwHKT8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695147366; x=1695752166; h=content-transfer-encoding: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=ZXJATLGe/WfIktgoMPXg04Y8kCGTEYPfQUQyvrst4q0=; b=ppvrt/4/IG1f/EQwNmO0cLxv8UwKT7PIDGK4X95anURWGwIfbS56ZzVdbrKkpOwZUj 89Lz8bNwDG27tYTWSB3fXWuqCsrSvMbP1kpNqh4vVq7Si2Bg/gVgSx3ISXY1FgHpJz2d 7f/QWyL9VFHudXd8Z5CNrevxPkWLfi9OJ9v3INBNAso+K5/waxZ7J7x4wgRoU6Kari7p 5couTf5/DYRs1hCg6NsMb+feeraNdy9Xg1Yh+BOJRo3c8ox5p3+OOfFjGlncRZUEDH6t 9WeAguGl3QSkWg39UqLaaiE9JQ5VNhXmiQAVnh4HHKUXPgZ78chniGc+TDoKH75OLq3W PoNQ== X-Gm-Message-State: AOJu0YxY3h31GJbVA2hJY2piYFG1VwJ0LCeCy5AbcqO+5uF9s5ExV5TM 7Q7pu60p/phyeUzNBbpq8dyGUHjw8gBj/Fz7vE2p8FC/ X-Received: by 2002:a17:906:a10e:b0:99c:6825:ca06 with SMTP id t14-20020a170906a10e00b0099c6825ca06mr133395ejy.12.1695147365857; Tue, 19 Sep 2023 11:16:05 -0700 (PDT) Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com. [209.85.208.48]) by smtp.gmail.com with ESMTPSA id o26-20020a170906359a00b009875a6d28b0sm8102670ejb.51.2023.09.19.11.16.05 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Sep 2023 11:16:05 -0700 (PDT) Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-52fa364f276so2145a12.1 for ; Tue, 19 Sep 2023 11:16:05 -0700 (PDT) X-Received: by 2002:a50:d71b:0:b0:51a:1ffd:10e with SMTP id t27-20020a50d71b000000b0051a1ffd010emr3828edi.3.1695147364758; Tue, 19 Sep 2023 11:16:04 -0700 (PDT) MIME-Version: 1.0 References: <20230918125851.310-1-johan+linaro@kernel.org> In-Reply-To: From: Doug Anderson Date: Tue, 19 Sep 2023 11:15:46 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] HID: i2c-hid: fix handling of unpopulated devices To: Johan Hovold 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" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 groat.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 (groat.vger.email [0.0.0.0]); Tue, 19 Sep 2023 11:16:26 -0700 (PDT) Hi, On Tue, Sep 19, 2023 at 12:07=E2=80=AFAM Johan Hovold wr= ote: > > > c) To solve this in the core, we have to make sure we properly handle > > (without hanging/failing) multiple partially-conflicting devices and > > devices that might acquire resources in arbitrary orders. > > > > Though the above solution detecting the pinctrl conflicts sounds > > appealing and I'm currently working on prototyping it, I'm still not > > 100% convinced. I'm worried about the above downsides. > > Yes, I agree that we'd need to take a broader look at this and not just > focus on the immediate pinctrl issue. OK. FWIW, I got blocked on trying to solve this in the core automatically by just using the conflicting "pinctrl" entries. There are probably some ways to get it solved, but none of them are easy. > > Personally, I feel like we could add information to the device tree > > that would help us out. The question is: is this an abuse of device > > tree for something that Linux ought to be able to figure out on its > > own, or is it OK? To make it concrete, I was thinking about something > > like this: > > > > / { > > tp_ex_group: trackpad-exclusion-group { > > members =3D <&tp1>, <&tp2>, <&tp3>; > > }; > > }; > > > > &i2c_bus { > > tp1: trackpad@10 { > > ... > > mutual-exclusion-group =3D <&tp_ex_group>; > > }; > > tp2: trackpad@20 { > > ... > > mutual-exclusion-group =3D <&tp_ex_group>; > > }; > > tp3: trackpad@30 { > > ... > > mutual-exclusion-group =3D <&tp_ex_group>; > > }; > > }; > > > > Then the device core would know not to probe devices in the same > > "mutual-exclusion-group" at the same time. > > > > If DT folks are OK with the "mutual-exclusion-group" idea then I'll > > probably backburner my attempt to make this work on the pinctrl level > > and go with that. > > I expressed something along these lines in the thread above: I'm going to try coding up the above to see how it looks. Assuming nothing comes up, I'll try to have something in the next few days. > It seems we'd need some way to describe the devices as mutually > exclusive... > > but given that we had prior art for handling simple cases and due to > lack of time, I left it on the ever-growing todo list. > > 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. 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... -Doug