Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2048779rdh; Sat, 28 Oct 2023 20:36:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4nujQ08XJ82vuM+Xlkd5RzLFRRechBWxO6GAwWWyVE557+uv8YBG1Ni+zyjKJJupzp8SN X-Received: by 2002:aca:1a02:0:b0:398:5d57:3d08 with SMTP id a2-20020aca1a02000000b003985d573d08mr6955711oia.37.1698550572446; Sat, 28 Oct 2023 20:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698550572; cv=none; d=google.com; s=arc-20160816; b=nFqF6KMkhVVFZsy6nwkT5+LYI48JVWl626KsE6wUgQIJjqz2iX81UxuO8gLSF4CXnc mniEI5WPPNKt5dto37hsuZm/Gr90vDkEm93g1JkZzpE8frW0v5EamNSaQI8UJanTjOtc INTyZ3ShrSazgQffhQH8pjuwSZZXnvWhXLy3djhWGPAx6gOti2HrUb12762T7Yg5Vlqz +keLoLRPPZhfROK5XjkpB3Rch1+D820O6LuHXxxbQBcfZIBtN1ovfgLAAhNCthCfSmxD Gj/kOLk6QIUyLxke42NQC2j4P7PgcIa5RY86C+t24lA1ox4nOLAHIvz8dlh6x8knG1wr i8qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=xjDo8XieKuMeFuZXOm0zzgIaw5X9UobfJiGgfoOcHjM=; fh=yTnFsGhLcQWO9chgfAkVxlQpLjJzonkAqJsbcTxHTvM=; b=nlivowGnolV3THswOy2m24/Fhgw9zAj1VLP+tUc7prdaTG67gzyYJTA8HHPudvFySI XoBvNAS9wjYyNle1cDt8d018DY4JESeiOA23lknAnPXM9UQVUkNJjpGgqK9bRcYgvnma JGc8ZGTd3sPnVFdf3YThwXEscixpS8KaJc6CPdRnN8WKy2ujGFVRarSpRT1yGq41xzQe +Plhl88EvvxeYVlNKNupLP0T8XJTkyoP+qgbkIkvhb3VE7wlQToMwst4Wfikz7C4FVCG EL2KXT0WXK2zfyqigr/FvYfcSa42bn3Up1hQ6CZrYAMW9M1ob5Cr9878PzmOrOGKAgvO WaeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cXyKUof1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id r20-20020a6560d4000000b005b89359f859si3087067pgv.777.2023.10.28.20.36.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 20:36:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=cXyKUof1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 81059806A976; Sat, 28 Oct 2023 20:35:54 -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 S229529AbjJ2DfZ (ORCPT + 99 others); Sat, 28 Oct 2023 23:35:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjJ2DfX (ORCPT ); Sat, 28 Oct 2023 23:35:23 -0400 Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04F8FCF; Sat, 28 Oct 2023 20:35:21 -0700 (PDT) Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3b2ea7cc821so2385171b6e.1; Sat, 28 Oct 2023 20:35:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698550520; x=1699155320; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=xjDo8XieKuMeFuZXOm0zzgIaw5X9UobfJiGgfoOcHjM=; b=cXyKUof1TRpySLccxkrcGfCBFfQ7PhYnz6I1VRxbV+53xIv61ihpQqUDd93jWNGH5Z ok8r8+ixr4X+Vy2S3zMy1OwR52iuxg20C04iUi5W5pb9a7f7DYoj1qRunSyigRz01xG4 UWUgXy4eE3hgXB7gD5X6iEAzM29QVb+9edAa+FW88BnYK14R0pRpPCVz97FqM7mNoVSH r+o15Hab38gcd7s8Cd+pGYT6v4MkXdhzt9NFB0682iiHL/xPPJEv1xtvMcLRTsbhzhiu V7ZY2dJQMDf6UHRwNgkeywXfkBPiOcRVt7RUoKs5LWUeT/IELC5PckV/EhzBt27gm/Cu wm3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698550520; x=1699155320; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xjDo8XieKuMeFuZXOm0zzgIaw5X9UobfJiGgfoOcHjM=; b=h+WooqlU4mo4Hwj8D9y3tdrIB2Uh9powZaMsmjmzhFxxYVMQgRJlPlTuFyeD2nxzaA KLT1BAzLSYDq/Zult29gOiei//DP2DfCSkATFMXFhNTLVTUnyH3cN6dKSmqw85T1ZJea BlhCT7Czgx0WEgzAr73u7QzdguXvdFl+DdUIwu8W2MATG4Gk7cLizeGguXi6lKYcL0ga 2V3o15P/ss79S2RuHnIKvsQGgkx3hpnj8Ml5fs1KOHLJ6LS9YKabI2gSkQoHQC/NNkJc swvUO59pRSuNrL1amj+DHcTllflhyPmFOj11fa80lxm1acbUuc15XmW60jGJo6wJmYEY KNPQ== X-Gm-Message-State: AOJu0YwP1qeREbt+w9GgBCF3lcOQGLbJH8gHRA6KWRCs1tHxQTOZ7l3d nUWQOJ3Qgs8wJRmjR4SR/lQ= X-Received: by 2002:aca:1909:0:b0:3b2:df82:812e with SMTP id l9-20020aca1909000000b003b2df82812emr7406778oii.32.1698550520181; Sat, 28 Oct 2023 20:35:20 -0700 (PDT) Received: from google.com ([205.220.129.30]) by smtp.gmail.com with ESMTPSA id m13-20020aa7900d000000b006b8ffc49ba5sm3604895pfo.38.2023.10.28.20.35.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 20:35:19 -0700 (PDT) Date: Sun, 29 Oct 2023 03:34:59 +0000 From: Dmitry Torokhov To: James Hilliard Cc: linux-input@vger.kernel.org, Linus Walleij , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] Input: cyttsp5 - improve error handling and remove regmap Message-ID: References: <20231025013939.353553-1-james.hilliard1@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 howler.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 (howler.vger.email [0.0.0.0]); Sat, 28 Oct 2023 20:35:55 -0700 (PDT) On Sat, Oct 28, 2023 at 03:31:00AM -0600, James Hilliard wrote: > On Fri, Oct 27, 2023 at 1:59 PM Dmitry Torokhov > wrote: > > > Hi James, > > > > On Tue, Oct 24, 2023 at 07:39:38PM -0600, James Hilliard wrote: > > > The vendor cyttsp5 driver does not use regmap for i2c support, it > > > would appear this is due to regmap not providing sufficient levels > > > of control to handle various error conditions that may be present > > > under some configuration/firmware variants. > > > > > > To improve reliability lets refactor the cyttsp5 i2c interface to > > > function more like the vendor driver and implement some of the error > > > handling retry/recovery techniques present there. > > > > Sorry but you need to elaborate more on what is missing in regmap and > > how vendor code is better. In my experience vendors rarely follow kernel > > development and either are not aware of the latest kernel APIs, or they > > simply have the driver written to what we had in 3.x kernels and have > > not really updated it since then. > > > > I'm unaware of a way to do essentially raw reads when using regmap, for > example I don't know of a way to implement the cyttsp5_deassert_read > function using regmap, maybe there's a way I'm not aware of however? What is wrong with current way of reading from the input register? It should clear the interrupt line. > > In general the issue with regmap seems to be that regmap always does > operations against specific registers and prevents doing raw i2c operations > needed to handle some hardware/firmware issues for some variants. What are those issues and why do they need raw access. > > Note that I'm not exactly doing things the same way the vendor driver does, > I have simplified the error recovery/retry code paths in the startup > function. > > > > > > > > > > As part of this rather than assuming the device is in bootloader mode > > > we should first check that the device is in bootloader and only > > > attempt to launch the app if it actually is in the bootloader. > > > > I would prefer if this was split into a separate patch. > > > > I think this change is somewhat intertwined with the probe retry/recovery > logic > changes and is a bit tricky to split out without breaking the startup > sequence > from my testing at least. I understand that it might be tricky but each logical change should stand on its own. Thanks. -- Dmitry