Received: by 2002:a05:7412:518d:b0:e2:908c:2ebd with SMTP id fn13csp425294rdb; Thu, 5 Oct 2023 09:43:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGiPUAL8OFGy3JB6QfNXs6OcKzFBproVKl+wwTdsoTXAAxIlnxWLNjRnBiHmIdVMcV4G9M/ X-Received: by 2002:a9d:774b:0:b0:6bd:603:797f with SMTP id t11-20020a9d774b000000b006bd0603797fmr5178824otl.37.1696524207725; Thu, 05 Oct 2023 09:43:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696524207; cv=none; d=google.com; s=arc-20160816; b=G5SaHK9ddxJ37nu4YoLEZ/xxefN2dJ16P4SnlkWlTRyxdIQzlnbLUVggCPlJVQbK0f zNBoBNiwxyClQxwrK+sqGhzTV/oktsfwuA5VFrejd/pu1gO+9fpUek/9oJye5lyu85zZ 04+4uxQbF+w5rPXAK5QQmJtY50OD+xsd1fZ9oYJwe86l2B7YYs+52J+HfPeVRMIn5NTp aayhKh/4/LXwM8M/xx71iWqdsOh6qgFj2SUalADbfJUTTzhvMTGT6/5bXXp0mzPr4Ofx RLXeWNv6L09EMaLpqC/g5dK6xddOimQBpOayHmq8kuXvSTeYZhICRWyi5NshreaCdFSc 0zDQ== 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=Fmpm/y06U0/9riyHMMSe5cH0ucZInbAT/vXKTDHZnrc=; fh=CR/T/8yS81RzPtidvxAAd3swsiBa5aj1GZbA3QiLQnU=; b=wc8LZYL2l03cCAOwMqadQaXR8fLBxOtghvpCt5rx0aBkMGKP54fpWH1UqMUh0d3gIw PX6e2s8FLFZMFNt0w5JzXwMab657bdxss6HFKRnYswuPd/4V6uyHP2kACU7K8zQH9MZp HybqDGS7ltmUENQ6Rh1aqYBmQ33JTJGH4DceTLtzcnd+AGfY40PNbuQNXubBKSs+uHMh Nmlm1UTIudstJH4OvxwV4oBxB+6ut55jXLAsVQBxeDc7m6mzouzNr4EvkAgizQ83YFOo 3oPo+hTQ/MLVMEMWGT7xE/ibDrVDjM7SPeiukLopamIbJI3IYnakpdlCiPerlphLPH5p /SRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UBVl0WIv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id e18-20020a63e012000000b0057771e49c25si1764964pgh.693.2023.10.05.09.43.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Oct 2023 09:43:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UBVl0WIv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 50D3180C9DEF; Thu, 5 Oct 2023 09:43:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230364AbjJEQms (ORCPT + 99 others); Thu, 5 Oct 2023 12:42:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232834AbjJEQkc (ORCPT ); Thu, 5 Oct 2023 12:40:32 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63F7A6F86 for ; Thu, 5 Oct 2023 09:31:55 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-50435ad51bbso1515919e87.2 for ; Thu, 05 Oct 2023 09:31:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1696523512; x=1697128312; 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=Fmpm/y06U0/9riyHMMSe5cH0ucZInbAT/vXKTDHZnrc=; b=UBVl0WIvvp9UJQqfrp5NwP8PggszHWeWmgvqz79jMrl5wM0BQw3y3uUa563ChtEeB1 47cApKlLXqEmIJwMbDqZMYKG7Arke1wwY3TJ4A2NO22MVeimdG+JgMQ85HmQq3YAWZ4T WtuWENurfx036e/U0VqPzY5K8IqF9xlGs9S5w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696523512; x=1697128312; 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=Fmpm/y06U0/9riyHMMSe5cH0ucZInbAT/vXKTDHZnrc=; b=gAhb/5BhKO+JjXLwXDQaYc7Y2JHv+jQeX7BLmFNO0Lp8sXHbtAC1rlKRsmwoFfbeXx SwwUWdLw0cPXwDe+9MvytziARI7i59XSJMxSZ8uwk7wkL2T9/P1DoVavgDTCCgjARq1r GDXugLfUvACIc0vsbeqQ6W1zg8goKsurkdMbUZXljYzOqXDJoDnsyDAqc9VD4iC5MYka 31nMno0ashu3XXfSAqdFcM/5zvsFvwNIW8n+rSOAIJOhaDCz8P2+p8Dy6dji+2zCD4I2 hY+7MuwrzHWczAHfwuIVp1HNITcFAgqCDt6cDW5qFRxdKQqOnUFwGdSqg7tDMDHJ6YMQ oeKQ== X-Gm-Message-State: AOJu0YwaUEnH2JgEhACGvL0x0VIf2KPQ2B/Hv/cKU9YFvwhYb23dGbMG 0XkrdL0u9wzPCtZbawhAb8kaUA/xDoQUDaCtAoqrwhyu X-Received: by 2002:a05:6512:2821:b0:502:f2a8:d391 with SMTP id cf33-20020a056512282100b00502f2a8d391mr7372280lfb.45.1696523511948; Thu, 05 Oct 2023 09:31:51 -0700 (PDT) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com. [209.85.167.52]) by smtp.gmail.com with ESMTPSA id f26-20020ac2533a000000b0050567350d90sm361578lfh.109.2023.10.05.09.31.51 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Oct 2023 09:31:51 -0700 (PDT) Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-5032a508e74so5032e87.1 for ; Thu, 05 Oct 2023 09:31:51 -0700 (PDT) X-Received: by 2002:ac2:558c:0:b0:502:cdb6:f316 with SMTP id v12-20020ac2558c000000b00502cdb6f316mr38425lfg.3.1696523510776; Thu, 05 Oct 2023 09:31:50 -0700 (PDT) MIME-Version: 1.0 References: <20231002155857.24584-1-johan+linaro@kernel.org> In-Reply-To: From: Doug Anderson Date: Thu, 5 Oct 2023 09:31:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] HID: i2c-hid: fix handling of unpopulated devices To: Benjamin Tissoires Cc: Johan Hovold , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Maxime Ripard Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 05 Oct 2023 09:43:26 -0700 (PDT) Hi, On Thu, Oct 5, 2023 at 12:10=E2=80=AFAM Benjamin Tissoires wrote: > > On Oct 02 2023, Johan Hovold wrote: > > A recent commit reordered probe so that the interrupt line is now > > requested before making sure that the device exists. > > > > This breaks machines like the Lenovo ThinkPad X13s which rely on the > > HID driver to probe second-source devices and only register the variant > > that is actually populated. Specifically, the interrupt line may now > > already be (temporarily) claimed when doing asynchronous probing of the > > touchpad: > > > > genirq: Flags mismatch irq 191. 00082008 (hid-over-i2c) vs. 00082= 008 (hid-over-i2c) > > i2c_hid_of 21-0015: Could not register for hid-over-i2c interrupt= , irq =3D 191, ret =3D -16 > > i2c_hid_of: probe of 21-0015 failed with error -16 > > > > Fix this by restoring the old behaviour of first making sure the device > > exists before requesting the interrupt line. > > > > Note that something like this should probably be implemented also for > > "panel followers", whose actual probe is currently effectively deferred > > until the DRM panel is probed (e.g. by powering down the device after > > making sure it exists and only then register it as a follower). > > > > Fixes: 675cd877c952 ("HID: i2c-hid: Rearrange probe() to power things u= p later") > > Cc: Douglas Anderson > > Cc: Maxime Ripard > > Signed-off-by: Johan Hovold > > --- > > > > Changes in v2 > > - initialise ihid->is_panel_follower sooner to avoid repeated property > > lookups and so that it can be used consistently throughout the drive= r > > for code that differs for "panel followers" > > Patches looks good to me, but I can not test it unfortunately. > > Doug, would you mind sending us your Ack or tested-by? Sure. Patches look OK to me, so if you're good with them then I'm good with them too. Reviewed-by: Douglas Anderson I tested this on a board by adding a second i2c-hid device in the device tree and confirming that things appeared to work OK. I also tried this with a board setup to use panel-follower (but _not_ two sources of touchscreens) and that also worked OK. Thus: Tested-by: Douglas Anderson As expected, combining panel-follower with two sources of touchscreen _didn't_ work because only one of them is able to acquire the interrupt. This is fine with me as there is nobody currently doing that. I'm still of the belief that we need a more complete solution for that and I'll continue to work on it. Thanks! -Doug