Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2822997rwi; Tue, 1 Nov 2022 12:12:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM78U5eQBwidLwX1utVvH9wtH5iarsjJjV0OWnZsL50IGKWsS/b9OXVk1F9SNF/4lcnBVnCt X-Received: by 2002:a62:1444:0:b0:56d:1ee8:973e with SMTP id 65-20020a621444000000b0056d1ee8973emr18413430pfu.30.1667329937973; Tue, 01 Nov 2022 12:12:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667329937; cv=none; d=google.com; s=arc-20160816; b=l3BRreAtEegCxQfKcHO9KPkThJ2WAzIsk73U8jAswbf3dH5uVb/55mwPfLSdYxmB/E bV2xHYjGYYjzmcKwsMovmgpAPeVyGM0RPAFqrjhSYQiwmzg8i+86VkM41/0ybDuwGg3K Dt8JUbWRb7R83EhVP+7SwK3wr+3bxSqpI9kXAtAN1VSMrbyx095LfhWq04TAj3Bz/L7I zenmB2CBzGXFspr+uOdtLKlXOoAQMFvzPVLu0+A+lKCwXXuN1iXVMUM81rUsvnnpIIpv fUJYh1ArnhWemdrh4+1LM9VtpV780qyAv0K6RblNWbyFpoJ8NYtAKFX24S95sQTWNMMq vOAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Zb0H0NTG2CJ73I5zObpuFkqRr8fUmS+erKTXXiwWECk=; b=rB20jICo20DW0ksS4cTRsAJ3h2PGh2x9QL/6A5v7SmPezwp31uhh9GNNoXaccgXne1 9uqhS0z+rrzzUu7pQtyNnBSBIRmZjRudcKXL/7jCJJc6z1BaE+Ag8IjEs+ZXFhQGHHVu dnLkAGreA4SQz8OLKdrhe3Wg5jLOhA1Wr38BPeVaSBqbr+nuITeFmO8IVhyTqYQ/8NaT 10LcDPYxnRYthEk+PlCGvfkA1fIxU95kKb//iuKgRl1QrgZ0yLSwlWXhOhSqsaeVQLQ8 wN6l4Ij4muAwc1flmQWs3WCVS6r/JDe7Jk3tyjADZK87dQQwiwrwB1nMCKzoVWki6a3h sF5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=y4nKaGfk; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b13-20020a170903228d00b001870c4c2722si12500125plh.299.2022.11.01.12.12.03; Tue, 01 Nov 2022 12:12:17 -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; dkim=pass header.i=@marcan.st header.s=default header.b=y4nKaGfk; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230013AbiKAS2w (ORCPT + 96 others); Tue, 1 Nov 2022 14:28:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229533AbiKAS2v (ORCPT ); Tue, 1 Nov 2022 14:28:51 -0400 Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA2BB6376; Tue, 1 Nov 2022 11:28:49 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: marcan@marcan.st) by mail.marcansoft.com (Postfix) with ESMTPSA id 855924267B; Tue, 1 Nov 2022 18:28:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1667327328; bh=FNzvVcw0wbF+4/Rh6ZkrNFOkM2Dg97dYxtkFzoT3wCU=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=y4nKaGfkdXYMVrEShBWZHRKdzFtCCDoBLOOkwL3REl6NbF+6M053rcomejdo0EIC8 8okltHpHzXzQXvk/Ali5MJcV8o+VzCM9QwQsr+ke7KllD7CjQjh4756qenmpXBD/b+ rjd+lOKfJNR+YNdlL8HbecQ5GnzPf239Q0vpOg734niZiN08FHz7KVIlSUtOPEzbNv Gk8N6WTMhOxXK7U+9Jd0ARlrsqfIJFP04pHD9Ga2PiRPQp5eQo0onr11YQ3J545Hmx 8zvs8KSKogigqkHYFxWlTXhnFG4Ew4wCWDuJ/EIvg+24dimHGJ+5BED8x8aBUpFj9P uSyl1yIVKueRw== Message-ID: Date: Wed, 2 Nov 2022 03:28:43 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v3] i2c/pasemi: PASemi I2C controller IRQ enablement Content-Language: en-US To: Arminder Singh , linux-kernel@vger.kernel.org Cc: linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, asahi@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, Alyssa Rosenzweig , Sven Peter , Christophe Leroy , Nicholas Piggin , Michael Ellerman References: From: Hector Martin In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS 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 On 07/10/2022 09.42, Arminder Singh wrote: > This patch adds IRQ support to the PASemi I2C controller driver to > increase the performace of I2C transactions on platforms with PASemi I2C > controllers. While primarily intended for Apple silicon platforms, this > patch should also help in enabling IRQ support for older PASemi hardware > as well should the need arise. > > Signed-off-by: Arminder Singh > --- > This version of the patch has been tested on an M1 Ultra Mac Studio, > as well as an M1 MacBook Pro, and userspace launches successfully > while using the IRQ path for I2C transactions. > [...] Please increase the timeout to 100ms for v4. 10ms was always wrong (the datasheet says the hardware clock stretching timeout is 25ms, and most i2c drivers have much larger timeouts), and with the tighter timing achievable with the IRQ patchset we are seeing timeouts in tipd controller requests which can clock-stretch for ~10ms themselves, followed by a spiral of errors as the driver has pretty poor error recovery. Increasing the timeout fixes the immediate problem/regression. Other than that, I now have a patch that makes the whole timeout/error detection/recovery much more robust, but I can submit it after this goes in :) - Hector