Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp45060rwb; Mon, 26 Sep 2022 14:29:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6a8tIUdwQIv7khM3z5Tn9GzhUJISonQSkC0jF6Lu3xLPM2JnBnfDFZmCdRzjxUR1G2l2I7 X-Received: by 2002:a63:5714:0:b0:43c:4a0d:f94d with SMTP id l20-20020a635714000000b0043c4a0df94dmr15882392pgb.488.1664227764429; Mon, 26 Sep 2022 14:29:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664227764; cv=none; d=google.com; s=arc-20160816; b=Tg189YTXGADqGQhwwBUqPBT+gd3vsN8Zzk//w7p4gLpWGudoucQAjH47+yKo0lN7DU QjryQycTQMniOrO62ODS30GwXuOil/QFCD2vDkyvpJh2ig8bGcchiVulT6AusT53Tioh uqunEPxcEs8oUIe2bmIIwcjReqjcgDkEz4Ktr4epaERAbjjnCKJVea3PqEqygO79z1Zi uTlWa54bx/j6HHyq9ar3t2htwVI0nnEhBje7PUinBDobdO7GsAkWcF6tPneGyy77gN1r znz7M3zYDrRgwP3hQ3iFp6JW6z1352MSCeofUUXyTTwmtWnoi77+cVxjUgfPzd7vrVHm PQRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=U7j1BSK/whVDXCQlD6EERbGeBnGg1eh5lr1VDVapoy0=; b=vS0rQtNQymuumlkzVUZ7RxXBYLIBVmsDoYD01pGatkd6/kePAj+0l8qtIvkGw3fqdj Yx1KWHg9v9S0vuY/HaaxWEXtWZ7DAR98Kn1ko5GxQwIuvfrzWYr4lM+Ra2FlErvxdwwS Fl6MEt/SW4JDOKyPmKf/roELZX2kazfFmh/KzL3FBTT3G970nff9dGPjg9xJDBQBdI6H LNgtsijvyrsG+RKGuMyFhAX2crNst5XW/FyJUEXPdIqe+9KN5gOixHmHjcDcWjuGiKD/ dHM2eo1tkYamhgzEkMWj2oidJqIDnRHJQd0ITm94YUP0DZ8VQeba18NgP5Yp5y25KsJQ FT8Q== ARC-Authentication-Results: i=1; mx.google.com; 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 r69-20020a632b48000000b0043a0121bb28si18805111pgr.811.2022.09.26.14.29.13; Mon, 26 Sep 2022 14:29:24 -0700 (PDT) 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; 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 S230138AbiIZVUb (ORCPT + 99 others); Mon, 26 Sep 2022 17:20:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbiIZVU3 (ORCPT ); Mon, 26 Sep 2022 17:20:29 -0400 X-Greylist: delayed 1800 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 26 Sep 2022 14:20:28 PDT Received: from mail.inka.de (mail.inka.de [IPv6:2a04:c9c7:0:1073:217:a4ff:fe3b:e77c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6900872EC9; Mon, 26 Sep 2022 14:20:28 -0700 (PDT) Received: from mail3.berkhan-weisser.de ([2a03:4000:54:b9a::4]) by mail.inka.de with esmtpsa id 1ocudL-003t0q-4k; Mon, 26 Sep 2022 22:23:19 +0200 Received: from 127.0.0.1 (helo=localhost.localdomain) by mail3.berkhan-weisser.de with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1ocudK-007Trr-OP; Mon, 26 Sep 2022 22:23:18 +0200 From: Enrik Berkhan To: linux-input@vger.kernel.org Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Rishi Gupta , Enrik Berkhan Subject: [PATCH v1 2/4] HID: mcp2221: enable HID I/O during GPIO probe Date: Mon, 26 Sep 2022 22:22:37 +0200 Message-Id: <20220926202239.16379-3-Enrik.Berkhan@inka.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220926202239.16379-1-Enrik.Berkhan@inka.de> References: <20220926202239.16379-1-Enrik.Berkhan@inka.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=unavailable 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 As soon as the GPIO driver part will be enabled in mcp2221_probe(), the first HID reports will be exchanged with the chip because the GPIO driver immediately calls mcp_gpio_get_direction(). HID I/O has to be enabled explicitly during mcp2221_probe() to receive response reports. Otherwise, all four mcp_gpio_get_direction() calls will run into the four second timeout of mcp_send_report(), which will block the driver for about 16s during startup. Signed-off-by: Enrik Berkhan --- drivers/hid/hid-mcp2221.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/hid/hid-mcp2221.c b/drivers/hid/hid-mcp2221.c index 0ca2a7b96825..5d8898f3f2e3 100644 --- a/drivers/hid/hid-mcp2221.c +++ b/drivers/hid/hid-mcp2221.c @@ -902,6 +902,9 @@ static int mcp2221_probe(struct hid_device *hdev, mcp->gc->can_sleep = 1; mcp->gc->parent = &hdev->dev; + /* Enable reception of HID reports during GPIO initialization */ + hid_device_io_start(hdev); + ret = devm_gpiochip_add_data(&hdev->dev, mcp->gc, mcp); if (ret) goto err_gc; -- 2.34.1