Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp266387lqm; Tue, 30 Apr 2024 22:24:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWQKxgygKWlvKfhPLRnCZSWCydEN7VdVdFpmQ1EHD+M306EVaiszmfSDP60gJdSr+nD3IBGu55zR8WNN2BDCNADPnUh55q0CtJMkdOVOw== X-Google-Smtp-Source: AGHT+IEUjx8CE4oMC0RVyPIFKk9Y3od09kZZFm2g2x8P9jMWEVq5JpKbk5mPBInifYdL4VPY5APY X-Received: by 2002:a05:620a:3bc8:b0:78f:1480:3690 with SMTP id yf8-20020a05620a3bc800b0078f14803690mr1551317qkn.54.1714541065913; Tue, 30 Apr 2024 22:24:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714541065; cv=pass; d=google.com; s=arc-20160816; b=jYtIV0Vot7/sBnxSQW5GtLOS0+B8AoFye+iyf+9+dEv3OiBoGQtAeSnDXd66Ssrsml Hnmuq+4sS3ZqCEKARC93aH7bmqz1lYjgPU+zlX4GK0NbFN2BOLVUAx1szcS1RQuF0Ek+ qVYNCiB68MTrzuWBmKccBZnLMUXB7NhuoNggX54tkvuwzJCqUCKkDJzPl/65oys4L8TT UvJ2wSrVyatAxIgUyXQ+zGanAhZmldUPC9E7ZMzVkpMfu8hYqNyh+EUiWO04Md4WUj+k P+/CtlERr9xFWOTXILqZdLFpWL+xxlSCvkO0248Ff0NT/CIz5UOrx7tJr8uPE3pWaYRe XIkw== 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=DY5QCzdG2l5n9xOYJTH9mAFpqSJJ9rQm13TN9QItwbA=; fh=Y2HBb9afhDam3bc1pBMU9lf5fcgtV6BUVNzJPCXU7Ns=; b=DswiTS/adZR2eE21ngodbAYw5fvZ+ujVx1UG2xWwLcY9hY8CxprBz4DvJF58Dtvkp0 HxUBy4X347F8toqIxk1RG68Cevo4qpY+UaFYdHRy6dMBHBdNKdjibQDwTUenxblgtfsy e/yh/aJZHtvZomfHxRpwW2LpBirbIpSU56eTTLUZnzPMgUWxGX1k7JRLaGoPj4/xybqf MLk0Gwvxi1nfC4Cac7Jxc9E3yMZdG/HSXYIoBywYHthT1ZmvX2hgMXIFWl4AKVGctSNi InuaRGC1wsAbQH4qKwizahUulTs5LPAD4xXo8E/7oDbtnihFK3VVCJFjHoTDpjk0lEVg DeXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kl.wtf header.s=key1 header.b=hf2VBGy0; 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-164943-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164943-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kl.wtf Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i2-20020a37c202000000b00790f370cfdasi6294102qkm.80.2024.04.30.22.24.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 22:24:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164943-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kl.wtf header.s=key1 header.b=hf2VBGy0; 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-164943-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164943-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 81E141C21987 for ; Wed, 1 May 2024 05:24:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5CD7D4642A; Wed, 1 May 2024 05:24:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kl.wtf header.i=@kl.wtf header.b="hf2VBGy0" Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) (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 0259B45BF1 for ; Wed, 1 May 2024 05:24:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714541059; cv=none; b=DTeKBSpgH4QPPNmvpWLjHKtuggfo5Mq0ztTJw9yLd3vSuRIxisR+NUG7WAW5JAj6IjiHInYZlNDyIOMeJzBexUOMfhi7LlaYJNtJaYDy0g2g01FM0jgUN1OlG3isLEKTmYNC3Z1jpHReA1Udt/GCr6AK/Gwn2oYka/N+mPUJWBU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714541059; c=relaxed/simple; bh=W6vQknOCG9pH+KpiTCI9n0o+sqxHWVPRqivmOUwN4wU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=SYI7DToqPj9v6EJ+xeXJhkdwfEMxX6L1RSUWgS5J8zlqs4mOwL7NJZTg3MCwj5IyOIsSR6ygAD5U1I0OF5m1LpBBWrNIIail2SnVHmCrAwRQ3/SvctjlNvUY6TDcxXeP4v1G1YQb1UshII45+MsTwtFEeSjQKBc3J7eEKnKMr+0= 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=hf2VBGy0; arc=none smtp.client-ip=95.215.58.188 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: <26070c7a-4005-4bb4-b4af-779bfc415dea@kl.wtf> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kl.wtf; s=key1; t=1714541052; 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=DY5QCzdG2l5n9xOYJTH9mAFpqSJJ9rQm13TN9QItwbA=; b=hf2VBGy0lVBFv/YVa68S9xhqplWrtjAcAvXPKeohrhdgYWNn+SfInIqhAbzGn5aFpWSBWD fXSek3RABzu0zWhAB/dtVmfAdpJm9msJXv88ZqxCuAcimMExS+VY/1723GxzyBHEKN6iD8 PEsSniZPD3YloWzhNIqrUm0NxQGRcFncMAOTS4AB14LnpEOfjq5kU8gi3OffZ9j2Tqerl8 9y4v6jJclwhl1boFvdYcRV59LThvWa5JFrR7ppIEDe1TMj7O1dbyfDvEbxb5iqrdAoPfzo LNGULD8FGqFG39Cq2AlZFDfXf8maPFq+rCx5b1kgJ8w+ai+fATBqfK4bK5pfWA== Date: Wed, 1 May 2024 07:24:08 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v3 1/3] HID: i2c-hid: Rely on HID descriptor fetch to probe To: Dmitry Torokhov Cc: Jiri Kosina , Dmitry Torokhov , Benjamin Tissoires , Douglas Anderson , 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: <20240426225739.2166-1-kl@kl.wtf> <20240426225739.2166-2-kl@kl.wtf> <5aa9f745-7f6a-4873-90ba-79c55335905c@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/30/24 11:41 PM, Dmitry Torokhov wrote: > I actually believe there is. On Chromebooks we may source components > from several vendors and use them in our devices. The components > are electrically compatible with each other, have exactly the same > connector, and therefore interchangeable. Because of that at probe time > we do not quite know if the device is there at given address, or not > (i.e. the touchpad could be from a different vendor and listening on > another address) and we need to make a quick determination whether we > should continue with probe or not. Maybe I should clarify what I meant: All I2C operations start with the master writing the slave address to the bus. When a slave reads its own address off the bus, it pulls the data line low to ACK. If no device is present on the bus with the specified address, the line stays high which is a NACK. This means that on the bus level, we have a clear error condition specifically for no device with the specified address being present on the bus. Whether the operation used is a dummy read or our first actual write should not matter - if the address is not acknowledged, the device is not present (or able to talk I2C). The problem lies in whether this "no device present on bus" error is reported clearly to us: Some drivers use -ENXIO specifically for this, some use it also for NACKs on written data, some report it but use other return codes for it, etc. Even if we stick to the smbus probe in the long run, if we get to the point where we can rely on the error codes from I2C drivers we would be able to correctly log and propagate other error classes like bus errors or I2C driver issues which are all currently silenced as "nothing at address" by the smbus probe. > I am not sure we can fully unify what Windows does and what Linux does, > mainly because our firmwares are different (I think Windows devices do a > lot more device discovery in firmware, Chrome OS historically tried to > limit amount of code in its firmware). We also need to make sure it > works on non-ACPI systems/ARM. Good point. My main focus is also quirky behaviors we have added to replicate Windows behavior, the smbus probe just stood out in my bus traces. I already sent https://lore.kernel.org/all/20240429233924.6453-1-kl@kl.wtf/ which goes back to improving the bus probe.