Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1348105lqd; Thu, 25 Apr 2024 12:41:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX6SEswV+G0Gg1sufwCy/7tn11iq0M+gINebCovk2F1LoRu8yhj8HWH025rA9Rf9LBikKeEueKsgnP4j0t+CYb/IqxsbSXXMjxmGLaNFQ== X-Google-Smtp-Source: AGHT+IEsia1QBF0ofIra0R48uABUVDPJ6j29ddZUa5R4Il2WQATVPJ+zCPla180Okrha/xd1kRBo X-Received: by 2002:a05:6a20:96d0:b0:1ac:e0fa:fb24 with SMTP id hq16-20020a056a2096d000b001ace0fafb24mr707190pzc.29.1714074118071; Thu, 25 Apr 2024 12:41:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714074118; cv=pass; d=google.com; s=arc-20160816; b=PbXM3LjKxTWAsF8hIzonfK5x9JUtNrnO+3XDMOtrcFAc3xsfyKGznuGX0ddwcgX5c1 Vfw5FzITA3qmuhkaEMBFysUfMkT2v2wTSYcxySAR9ASqIhvNffln6jK4pwXJqHw5Obtp xOrQbYd/PE/NlnqQUE/EutIbDUia+l/dG4gJLJ+ptjE2aL8ZpPwcNRFzZM1QQSGihI6c S8Datz9EWBwXQa9nVeh9dAO+NLzVL0DNOvuaMhJGeW5iRLpX6LQ3yqng49bZAMJ/36Ds rlmkwLjJPv+8PxSkhwXNwZ3oosnKUrEETHvRNGWXgu+Id7Ybv8JD8HsByT3zvUTbi/lj FcLg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=bCeDyj/azxXR59ysx7fddTqcYUzcbcaYMudaUZrfnAE=; fh=GPbQWg4loClJp5srlHq1KFXa6y+EDrsGeVNHWkqbylA=; b=m59NpICZNqIB5DGSGo3rGXw/vTDP34v9U3UjQVIsDrd8Xq3tSs/m34GEQu+gdohBzF gMmIi9KLdlYBxSkY9EAdlV6+0Id40Vb6mnE5cfNgcB+8pNY11P3MR3gZG8CeY+flVAUc a406U4fodkLelgLuA6c8cHubw9qLzHJLrfWOfLGT4zl3ubBA9Jb4HWYP2JBO/0AxsUnm zQsPochD5nMMa0AIPr2LB0szAxZLfP/KdQ9pk58Rr10pG6iFxxjRaxJGo+MXUWlXL7Lm AUWb6RB7S0e+lPYJ6kqG5aKclIoVQ0brOHEiU7K/HUOxDvTZClMEFAkUHwapsd0kOJ6O yQjg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kl.wtf header.s=key1 header.b=SXJukNhR; arc=pass (i=1 spf=pass spfdomain=kl.wtf dkim=pass dkdomain=kl.wtf dmarc=pass fromdomain=kl.wtf); spf=pass (google.com: domain of linux-kernel+bounces-159081-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159081-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kl.wtf Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 15-20020a056a00070f00b006eb01d66c8esi13663469pfl.332.2024.04.25.12.41.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 12:41:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159081-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kl.wtf header.s=key1 header.b=SXJukNhR; arc=pass (i=1 spf=pass spfdomain=kl.wtf dkim=pass dkdomain=kl.wtf dmarc=pass fromdomain=kl.wtf); spf=pass (google.com: domain of linux-kernel+bounces-159081-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159081-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kl.wtf 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 86DE4B23FB0 for ; Thu, 25 Apr 2024 19:36:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0DFE15252B; Thu, 25 Apr 2024 19:36:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kl.wtf header.i=@kl.wtf header.b="SXJukNhR" Received: from out-174.mta0.migadu.com (out-174.mta0.migadu.com [91.218.175.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C67E14B06B for ; Thu, 25 Apr 2024 19:36:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714073810; cv=none; b=jCV4/lvoSXvfCPuXQh00LPOBeuwQ5/vBdAIOcqTAx3kZ7C3ScDipG53Iz1Ni+ZPFBBlQ57PGc3kya11FQkvHU4vqySfJVMss0lkuylUkbUNzvQ79yHoaW2/WKi/RPvd65hYl1eCafPtREffXeKbWPWkdbdNf9tSxK/p2Fo81Q7s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714073810; c=relaxed/simple; bh=bULNLhL8JjvmllG31dsbkgOA5oEY9WMBez3SwOVtrpI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=UpZ3h22+0aUpcvqwTvvoL2dFOht/loi9ltdi+A08823GjoZjggk2BLzEKYVwch6mANMRqkXIP9H6k0vo01U3oV4QN9KbBmOh4Z/hOb5sctA0d/USmx4GB0vpj6f9m16BCv+EJVxRctAHUHrB7seyZNjpkq2RwVOM63/COwHpgr4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=kl.wtf; spf=pass smtp.mailfrom=kl.wtf; dkim=pass (2048-bit key) header.d=kl.wtf header.i=@kl.wtf header.b=SXJukNhR; arc=none smtp.client-ip=91.218.175.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=kl.wtf Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kl.wtf Message-ID: <836b5226-a6e9-49af-981b-365aa5df1fcb@kl.wtf> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kl.wtf; s=key1; t=1714073806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bCeDyj/azxXR59ysx7fddTqcYUzcbcaYMudaUZrfnAE=; b=SXJukNhRA6IbNlRbP3UJTAPtX9EBcdudA580Xs6MrB1vBzjIJcEDd3XQ7RSUHvTmY6RbCp dtOVV9LRau/cBtwN0g7HG6w6i2Dro49E5iKsoEZQ7z3eesG+4nYrmhN7vTAyg3Y3sL+t+n lB2T5EDz4PMPOsZB9AHIq3un44vpMaOzehOeQpJw1CdWImkluXXNATyFRS2fnjNA7Tk3aH 2erf7LOYBPy0O0tCRpakVTRUECZNjKln326tbvk7Bt9gwB5t3V0StJIFzYUV94r4L2Up6S FyMm8FLhvBOjZBRajw2pUMo4Ahi5GpeYhlT8D8fxypeQNccw4qp4jlhOqMP3MQ== Date: Thu, 25 Apr 2024 21:36:42 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v2 1/3] HID: i2c-hid: Rely on HID descriptor fetch to probe To: Doug Anderson Cc: Jiri Kosina , Dmitry Torokhov , Benjamin Tissoires , Hans de Goede , Maxime Ripard , Kai-Heng Feng , Johan Hovold , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Radoslaw Biernacki , Lukasz Majczak References: <20240423122518.34811-1-kl@kl.wtf> <20240423122518.34811-2-kl@kl.wtf> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kenny Levinsen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 4/24/24 7:00 PM, Doug Anderson wrote: > I worry a little bit about keying just off of -EREMOTEIO. If I'm > skimming the code properly it's up to the different i2c bus controller > to decide which error code to return here. Looking at, for instance, > "i2c-qcom-geni.c", I see: > > [NACK] = {-ENXIO, "NACK: slv unresponsive, check its power/reset-ln"}, Hmm, good point. I decided to go through the drivers and check their behavior on NACK, and based on my quick glance I found (insert accuracy disclaimer): - 52 drivers emitting ENXIO - 14 drivers emitting EREMOTEIO - 11 driver emitting EIO - 5 drivers emitting ETIMEDOUT - 1 driver emitting EAGAIN - 1 driver emitting I2C_ERR_BERR (???) So just EREMOTEIO is definitely not good enough. Looking at the drivers, it seems like the majority of drivers emitting generic error codes could just as well emit ENXIO on NACK. Room for improvement. > Maybe we should just use dev_dbg() in all cases here when we fail to > fetch the descriptor? ...otherwise I think some boards will start > getting a noisy error message. I'm okay with that. I don't like hiding a useful error message, but the smbus probe would also have hidden bus errors. I'll send a v3 with just dev_dbg, then if I (or someone else) end up aligning more i2c drivers on their NACK error we can go to the stricter check and incentivize the drivers to give meaningful error values...