Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3870662rdb; Mon, 11 Dec 2023 02:22:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IELNfx3ZhJ2FSuidX3yD0xg8wFi5h2v0YfHA2ElO8FMAGVS/LJOAHxILVpt5DwshqAFJtfN X-Received: by 2002:a05:6808:208a:b0:3b8:b063:8254 with SMTP id s10-20020a056808208a00b003b8b0638254mr5851940oiw.86.1702290175180; Mon, 11 Dec 2023 02:22:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702290175; cv=pass; d=google.com; s=arc-20160816; b=1DcPjNCoOa7h52mXsUWyLWm5H6G+ONOGxMFssZtKA9Gzb+YCyl05Q+qGFoPtYNMSF7 EcOAc/tKSmAQf/J1kycwUGjRnre57yTd+7hq5ch696pfwAbGtD1aIkSgI1y2LcWd9Vli iw9IKNktk+bYvsZy0/+tOrdUx1G92uGOxL7Cb/iRkay85PBF3hiEkSbLYuy0GYvgcjLc Gvo3kOkteIrYlc0LN2F1IVvamuuMQYwe0NYfcUhmKRiPZjw3qAG+fAFea++vlPfD2UJt lkgAZoDZT+6wnRwdPIRro4Jwwc53pWtTw6/cCoEJvji2MDYtlXo/jM8tvU9teguU3pEa 6iVQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=wkNVu8BCBYHj+9GrrTL1RInEeIlIgrqTWkAajkbyTKs=; fh=WFcqSubssMIwC0Dm7Plh6RRvLP+WIFWeZgWd743wkLo=; b=k/Sh+eulpN9UiiKCRbVvC6zUEg26gVQp9se4mgiiG1yXPjmOPPkPNIZqLDqgvljwRS Pha3k4sDfao6SEh3/m4Ow4CftEi/yIvrGMJfCbbswk9ei2eb+vcNLipLpizPHZ3XV2oP BVnI/zSqT/lAf60mfkBHnT/pR1qCPoEqOG0ZjobxIpcb2M/uOg/Zkpuiz7UIv4dyAG0J /yzIqTuZp7ZyWRuAI8Ig4SFHYoiU8Mn9Rm7EgtwKGD3FR1SpTeC69GAzvapl96S5NTAg QdM4TrapzJ3DoGOwpQ/N+Hs1zykWgDJtukGsrzstrnBVCJaXzx0Nudn+zi6miKjuH6ZO htwA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=G+RnZEIi; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id h10-20020a63e14a000000b005c67bb15866si5927031pgk.52.2023.12.11.02.22.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 02:22:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=G+RnZEIi; arc=pass (i=1 spf=pass spfdomain=os.amperecomputing.com dkim=pass dkdomain=os.amperecomputing.com dmarc=pass fromdomain=os.amperecomputing.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 814A080914B2; Mon, 11 Dec 2023 02:22:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234815AbjLKKWi (ORCPT + 99 others); Mon, 11 Dec 2023 05:22:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbjLKKWi (ORCPT ); Mon, 11 Dec 2023 05:22:38 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A7C191; Mon, 11 Dec 2023 02:22:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sg4Rsou7wwcdZUWNR0ZD6ReRnhemirOOKRRvfVfa7WiNRrD27+RPj4RG2LDsX9kFeFOtMZTW/FhLoxSabsvFgOHtRejL455cyzb18+Dq70P7z/h3xYhmsBZhzt+QMvCoAPx4AU0kcIdS3e+LMjdml4Wqe8JGC3tN86VOaAW63Gm/OpWQBZ7ZHPyFXY+aLWhuQQeIlU7f/R6HvWuD1aJW61LbEx5gp7X15vzTWkZ/7nouHN/EFEmlp3E8PDPySeEwWxcU7POmKLFIrgztZ5qRaxVUyQrfE6wdj7CilRes8oVsrPO8V/8HW8PGOG50aEirAY3QccXHn2cPHVQxup8kwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wkNVu8BCBYHj+9GrrTL1RInEeIlIgrqTWkAajkbyTKs=; b=FjUR3gWzGBsP87X/WWZOcNpzHlALi52sb+5p+zjmeohonFFfscwwX/3uVD4gYa6MvXW9ms4e+o0M4ftpx3Sde/EBJiJwCYPaC1nUaylZGwVw/zOGEzCk7qavdkHdv+WRHm/BWntk+tY9gdqHvV6VRzXRaJNmU0kl+rpdo2mn8Rc4/q0mZ+YQzUccF7Q1HocfSbrOaZOTNwWtTYfsLN3jwiigY/5FVAK6dWt1vHf7OeztcESDS1d/oYQZ7Y4YfN3od3CYkZ1VtkxcB3FFmFcs+nw3r6EnBEE4ML05COaccWm8MdwD4YDEP78Xs1NAyIEUBQ6T7dfKx76fSjZpOCMbOA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wkNVu8BCBYHj+9GrrTL1RInEeIlIgrqTWkAajkbyTKs=; b=G+RnZEIiJQQtHCP9OQA79+b12wuh6dWV4gSvLOuqIgvk7VoWKgh/x1qZl9tX7xm9rL4YroDl9NhoQ+kubRhNQy0GQXZEclGL1KmBzA/vif5ACylxucvXkUTtnQgBZikEiTS9Oai3R2gB5wV+e9FWY22N/90sgqRWdQSUAYrRvhE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SN4PR01MB7455.prod.exchangelabs.com (2603:10b6:806:202::11) by CO1PR01MB6568.prod.exchangelabs.com (2603:10b6:303:f9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.33; Mon, 11 Dec 2023 10:22:39 +0000 Received: from SN4PR01MB7455.prod.exchangelabs.com ([fe80::5682:1d84:171a:1d68]) by SN4PR01MB7455.prod.exchangelabs.com ([fe80::5682:1d84:171a:1d68%3]) with mapi id 15.20.7068.031; Mon, 11 Dec 2023 10:22:39 +0000 From: Quan Nguyen To: Brendan Higgins , Benjamin Herrenschmidt , Joel Stanley , Andi Shyti , Andrew Jeffery , Wolfram Sang , Jae Hyun Yoo , Guenter Roeck , linux-i2c@vger.kernel.org, openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Cosmo Chou , Open Source Submission , Phong Vo , "Thang Q . Nguyen" , Quan Nguyen Subject: [PATCH v4 0/2] i2c: aspeed: Late ack Tx done irqs and handle coalesced start with stop conditions Date: Mon, 11 Dec 2023 17:22:15 +0700 Message-Id: <20231211102217.2436294-1-quan@os.amperecomputing.com> X-Mailer: git-send-email 2.35.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2P153CA0007.APCP153.PROD.OUTLOOK.COM (2603:1096::17) To SN4PR01MB7455.prod.exchangelabs.com (2603:10b6:806:202::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN4PR01MB7455:EE_|CO1PR01MB6568:EE_ X-MS-Office365-Filtering-Correlation-Id: 800de197-143e-4aec-65a9-08dbfa3319b9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tY8UcZfQqGnOvz8i4bzN9Dh4Lmj1GVS+2ok8YWjTFCiB+nBPJtbn9nDpi2AYHb2iRUmnAJbRBRw8z8mo0P53wa7G3WzVOPkRvnQI3l+6Y0OMk9GSWV0rr6WSKw7Hh1syzHHZwCcljwTOKxbhkfK4R1JXq2HW3srm0bHyk2dnj4ak6a7c1lyDlz6V5FIYBAhC55EYdLnMiNZZqXmHimoYwtc069Bug1UcTqRiY1MtZekUj546VpomfqZtIqFGTHStMJ4cs3wnnrIW/sbrBtM5VQNcHZ0uKTVHGmtti8idkOur4ng1XhEkllfMPHHzjVvM6FaARub4f356w2hS3+MMWEa8wCbqkeqmTo3vVByFRAfYzUHcpRS7UwsdADVUKbftd/rjfC21bOvxIpLSQOqgCTmRG6XVfeqTJnDchJtLtB2NEMMvJQsw+y0NRjyT1s94YgN6Kv7kAOXmQkTsVxwbvDWoumlkmKF/XTDYOEVxlESEAJArrzSR7SFJ/y3hvXCoWClLt5sjt6xn7wmdaBR6nAKyxwOT9MJwqHI5H5ORnY2swdDOvmHfSjfyvrFIEVUe9MGDySOVdeFRywKbT7h4ZmZPhcHZhwWHjlPacvU6LgKeGJ1puktLQkc9v49Yum8Zl5Vfsgorf2vJFjvIAvUImg+Z6C3est8C9OpIjSL6OX4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN4PR01MB7455.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(39850400004)(136003)(396003)(346002)(366004)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(1076003)(26005)(107886003)(2616005)(6506007)(6512007)(6666004)(52116002)(83380400001)(5660300002)(7416002)(41300700001)(2906002)(4326008)(478600001)(966005)(6486002)(8676002)(8936002)(66946007)(110136005)(66556008)(316002)(66476007)(54906003)(86362001)(38100700002)(38350700005)(921008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?dLVzhlg/mHw+f5A3uVvyr2rrRSrcn1B0ErXVcJLgSm4ZmUyockQxMkfBG//D?= =?us-ascii?Q?cspHlK9w8DCqLDNMuC5Wr3MplgrWKWGcesrcQuAmaetNtHd6+ln/fuNos8qr?= =?us-ascii?Q?soe4HGWhKZEUPCvglGhfKeD+SbgYF5t8y8SB36hhCP5Zz1SNJ8YL7Qr7z6G0?= =?us-ascii?Q?G5IH6PFZWauGE/XZkfd1UpXf2qhiQNN19NHIp6yJLfCAJj3dm/QPuBfKi1BJ?= =?us-ascii?Q?nlUGneqWLHld2jMv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?us-ascii?Q?eunSbtBepia5G67koAur9RQo+tyzdiQOAc+pIu3mvlGDOubE0oLkgdGc64rd?= =?us-ascii?Q?byJP/Rrjh/ryjLr3oHchTz6CWdCC7Es28aR8d/Esuo4Vy1P/hXHT67cSlnoo?= =?us-ascii?Q?khGmqrC8sMeiQ+bGsuNZ7Nm03+7e/9bmZ1gXW4u2LlgVsdkS+48WqdfzbgGg?= =?us-ascii?Q?E2gHpm/YEvu4UFOVDjud8LBryAlIQPx41fe24uRXpDTotGp45bGOHKC46gB/?= =?us-ascii?Q?/EW1qdCpScHfMn5Eo6iYuEOf9jzGp1LyRp2Yxn30VMldPudAKittkCzzOJ4I?= =?us-ascii?Q?Qr2/HIfCZe+4+e6gvK4OHLlm3Cf3RRPNh28KiEhbLYV9VvI4yswhyjsJNqzw?= =?us-ascii?Q?ajYmI0xcfbiM1TaqBb+0hWN0fVaDRk2H/wtOar6+AbAxXtwQBbGLGwMMgvUW?= =?us-ascii?Q?K9iibTNfL8RNo7/gevzs6Eh3DyfxOk2YifPjIGWLGI5gg5ZajcVCASmIwLTo?= =?us-ascii?Q?1m7+xh9jrZ4xvMCzMFScvbc=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 800de197-143e-4aec-65a9-08dbfa3319b9 X-MS-Exchange-CrossTenant-AuthSource: SN4PR01MB7455.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2023 10:22:38.9219 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: m2MEKC3BKOotvQ+Q0T+nxfOw1CndocZXpznfOpeFVsuKqkYkxOaZdwjqanGAeD0ks2drovNtvQHyaPEwk1t7ODSGnTqJI+cKXOnoL80xSYI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR01MB6568 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 11 Dec 2023 02:22:52 -0800 (PST) This series consists of two patches to handle the below issues observed when testing with slave mode: + The coalesced stop condition with the start conditions + Early ack'ed of Tx done (ACK and NAK) causing "Unexpected Ack on read request". This series was verified with ast2500 and ast2600. The prior discussion could be found at: https://lore.kernel.org/all/20231208033142.1673232-1-quan@os.amperecomputing.com/ v4: + Switch to use define macro instead of variable [Andrew] + Make the early ack conditionally to avoid unnecessary writel()/readl() [Quan] + Add an extra empty line before the comment in patch 1 [Andrew] v3: + Fix the unconditional write when ack the irqs [Andrew] + Handle the coalesced stop condition with the start conditions [Andrew] + Refactor the code to enhance code readability [Quan] + Revised commit message [Quan] v2: + Split these patches to separate series [Joel] + Added the Fixes lines [Joel] + Fixed multiline comment [Joel] + Refactor irq clearing code [Joel, Guenter] + Revised commit message [Joel, Quan] v1: + These patches are first introduced from this disscusstion https://lore.kernel.org/all/20210519074934.20712-1-quan@os.amperecomputing.com/ Quan Nguyen (2): i2c: aspeed: Handle the coalesced stop conditions with the start conditions. i2c: aspeed: Acknowledge Tx done with and without ACK irq late drivers/i2c/busses/i2c-aspeed.c | 75 +++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 23 deletions(-) -- 2.35.1