Message ID | 20220615090259.1121405-4-quan@os.amperecomputing.com |
---|---|
State | Changes Requested |
Headers | show
Return-Path: <linux-i2c-owner@vger.kernel.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.a=rsa-sha256 header.s=selector2 header.b=rEZh3U14; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=<UNKNOWN>) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LNK9P57BVz9sG0 for <incoming@patchwork.ozlabs.org>; Wed, 15 Jun 2022 19:03:53 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347063AbiFOJDv (ORCPT <rfc822;incoming@patchwork.ozlabs.org>); Wed, 15 Jun 2022 05:03:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347035AbiFOJDu (ORCPT <rfc822;linux-i2c@vger.kernel.org>); Wed, 15 Jun 2022 05:03:50 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2122.outbound.protection.outlook.com [40.107.237.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D00DE38BC4; Wed, 15 Jun 2022 02:03:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MeaAFKx8KsTxyAtT/rlemxx0LuzSjrNpGj8VzPBSiX0rPVtE0L2LHcFrFxz+WhtRMk1MrOQiHQPRzOf5sGTRP2qQsQhVCgrYGnAFVl4Nsp+zQuuKBdUaFqVunceDzMFtTrNSMCnerjB+AEwBbRjwS3c5sX8i8fZ3KL1E/0zB540/y19fs2/DKb3YRFCFDdASOqvSz8TL/7lsvQ4uV2OoRe1jvCTzT/bwooBqPWaHKLgJ1rZISgqzJoIZRJWTP6vgqeLwWNXwfmohchuFtDMT94lP0pIPkaK6/bt0IYww+2AeHIl+Vuq2rzevXUk5rUU8DuEnyaKXqOWhVDxHy4quOw== 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=yY+JGXPT07FYHFt/DZ+nLA+W08wbKn7f4XO1Mu0iF0E=; b=N731RStz6bgBX0RdQY5MdQDDhUy0x01AtsCm3NDuIarkn5Tk9IqRZn2RD4OmHXC16Vqexu3mSiXJVLGcT+pp0t4jLrg6HD+5Y6KzcccG7I9ka3u/mTiMMcHQMT7UOF8KoRcyr0s9qrSb/rtXs1uMZRQ/SCoMBZhcxZfRsPARvYoYrONR/K0xZUH4UwybtwTcYOpj7N6tw73jZEbhNmKcwNoptVeCHrqOe6bwMvLXFIz8rrioPK6lG3oJg5NyKQBhpZ8dau5clCrKMuoyhXA1KZq0YUHNwv9rvcwpE4+VHALTeWNKBNy72Y1HjZH8YqPGE2uXVrdXdleqXWYRcYQC4g== 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=yY+JGXPT07FYHFt/DZ+nLA+W08wbKn7f4XO1Mu0iF0E=; b=rEZh3U14eaaorob5C55RA/ERxesr4ki4roZo6pnG1Cs/s4igKpkG1ASXmCaaKz4tlc1IAZosRGvseW9b5AbhhTBDpI7hxaicX3oKHdhJgOoGY2y//qgsV6p9txN+69KjEdvslXaRwjAbFdaXbRshZlQyvJ/lQGWgkKrP6YoMvNk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SJ0PR01MB7282.prod.exchangelabs.com (2603:10b6:a03:3f2::24) by BY5PR01MB6049.prod.exchangelabs.com (2603:10b6:a03:1bd::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.12; Wed, 15 Jun 2022 09:03:42 +0000 Received: from SJ0PR01MB7282.prod.exchangelabs.com ([fe80::7535:773:f979:893e]) by SJ0PR01MB7282.prod.exchangelabs.com ([fe80::7535:773:f979:893e%7]) with mapi id 15.20.5332.020; Wed, 15 Jun 2022 09:03:42 +0000 From: Quan Nguyen <quan@os.amperecomputing.com> To: Quan Nguyen <quan@os.amperecomputing.com>, Corey Minyard <minyard@acm.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Brendan Higgins <brendanhiggins@google.com>, Benjamin Herrenschmidt <benh@kernel.crashing.org>, Joel Stanley <joel@jms.id.au>, Andrew Jeffery <andrew@aj.id.au>, Wolfram Sang <wsa@kernel.org>, openipmi-developer@lists.sourceforge.net, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org Cc: Open Source Submission <patches@amperecomputing.com>, Phong Vo <phong@os.amperecomputing.com>, "Thang Q . Nguyen" <thang@os.amperecomputing.com> Subject: [PATCH v8 3/3] i2c: aspeed: Assert NAK when slave is busy Date: Wed, 15 Jun 2022 16:02:59 +0700 Message-Id: <20220615090259.1121405-4-quan@os.amperecomputing.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220615090259.1121405-1-quan@os.amperecomputing.com> References: <20220615090259.1121405-1-quan@os.amperecomputing.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR06CA0189.apcprd06.prod.outlook.com (2603:1096:4:1::21) To SJ0PR01MB7282.prod.exchangelabs.com (2603:10b6:a03:3f2::24) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ba968699-d8d6-4ff9-4d5c-08da4eadf120 X-MS-TrafficTypeDiagnostic: BY5PR01MB6049:EE_ X-Microsoft-Antispam-PRVS: <BY5PR01MB60497F459A3FB6D89BBF1C0EF2AD9@BY5PR01MB6049.prod.exchangelabs.com> X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zGKtg09K2Ga+07FilLNmiWGZi5Fue4wQ277TV9JyI11B5ePC9gLhFMULVnKkrUlJSs0cnI5ScBeewqAylQuuq+jr+M4VrHjIjI3NocYRWKPVFqYTF4GHW6yvf1bVpPO4zk5iMG0h2enqgTxX780czV5Jgr5hSZHidlA31Y3aY6cTt3yTQlA2QNBj6oGCK747Lm1vF8b0v16EoT/I16yyp2gRE44PLP9pjynoeGxUn1UeDDgIoaqdP7n1qfglbeGIozBgpcilroh+lJVFGE5a1+IGr2J1QaSJhpJRAeTXnYRQmmj2ubzU/8jvZCg5uKjRQvEICyjyuu1A0JKaVQVfvn2FePNho46cWVBgX+9EtakC/CEiEZuggF4kG91zt5rBEmPR17cVQWQVM0fIOeJibsPmq1PMyEdZxLIjHY7vF7M8vqxOpyCocR+8BFwsCn6lIGGUWLh3MmBeBjx1hUiRU4LjDbWZJS1myoX/iAQ4qlEAhVOXYKLbY5yyvKGyAawTYruZ70HWOOlIktRyFjB6YDhbDWpPkdbatITIrAuh0osFxHIRoMMZzP/amDl0wZ68Lb5yjSzwY5dZCOE9Nf+xrg+JcQZe1J1XtGt5p8YJr1XxffNMfCNbwXikVgQpAV/zKlRuSjR0w8MDmp0nYFgEBLhpNpHKpblqVCPk3qOELEjtcJzT8IuBwIICBjOsD291GWTZZmIeVKNftLatthx3b0UkBM3RLi6306i9OSBEVRQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR01MB7282.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(366004)(66556008)(66476007)(6666004)(508600001)(4326008)(83380400001)(38350700002)(8676002)(1076003)(2616005)(6486002)(316002)(107886003)(52116002)(8936002)(186003)(66946007)(6506007)(5660300002)(2906002)(6512007)(110136005)(26005)(54906003)(38100700002)(86362001)(921005)(7416002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Zcci+qM+7J2sVgi3h54Oih7Oq+rN5lVdzvUOr/kyWCarCse62Di1djmOM1iCifaNrX9uPR6iMIF9/MAMEC57BOEK6towWofbJ5cBDRmnis9etiUxyyiVumETLzbB6wbSY0mexH7fS9dMd9wHR8rXCXBE0z1TtzJdVulus7v/upEshzJrqTCO4cy7NlcqZI6CUnLNJ8yn6I59Ul9NHr8Z/d6MOhNph/g6T4G4UZfRYTcwFYep0QaXhU8oafmlE4V3EUx0b2chSEbDmZUSVyGHURyZCfE9Alne+tv6E+cx42z2qImWqlopt1XNcvM1zPOzKkRQslf8+AQnMmX0RbjR6Y5MFxqY/cnbPaL9DpcCL6QYWuzbr9BvDtlQvp13P//tZ6dE9/UjVJnteHI6Kh5Ud8z73vhQXFqDxyBgSsu2b6PxvTji083cVrklqcQFUWDFQSBA5EeGMt2CA4BmaiyZ7QgqR7gBca8RqHRliE0qh5ItkI4PPkydcfp6r5IBj26wJwW57qQ2ZKsUY5qfqEpDCsZIBaJu0lI5rM+jKs/oWri81S3eKw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dBwbC2MRwDlslfQjWy21dgR+1eqTaQGY7Ztky2l0HDe3JkNfPABaZqBNoXG7pQ6yd/mvgy0Mf0G0B8LUPwEi97J5ep4W0OI7hGAqYKzoC+ceN5lDRrCfVmMLwrgJjJCSZcwvlsJleN7HW7ZEa X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: ba968699-d8d6-4ff9-4d5c-08da4eadf120 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR01MB7282.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2022 09:03:42.0110 (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: +4LE9NuCeXTGzIR8NWYgChCT08uhXibQpey3CXP7Rdo/+Ra1PGN8vhNraZZiRstATqkvM4WfrjRnbnvxERQfTuwpw692UfJdazTaetsv2MU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR01MB6049 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: <linux-i2c.vger.kernel.org> X-Mailing-List: linux-i2c@vger.kernel.org |
Series |
Add SSIF BMC driver
|
expand
|
diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c index 771e53d3d197..ebc2b92656c8 100644 --- a/drivers/i2c/busses/i2c-aspeed.c +++ b/drivers/i2c/busses/i2c-aspeed.c @@ -244,6 +244,7 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status) u32 command, irq_handled = 0; struct i2c_client *slave = bus->slave; u8 value; + int ret; if (!slave) return 0; @@ -311,7 +312,9 @@ static u32 aspeed_i2c_slave_irq(struct aspeed_i2c_bus *bus, u32 irq_status) break; case ASPEED_I2C_SLAVE_WRITE_REQUESTED: bus->slave_state = ASPEED_I2C_SLAVE_WRITE_RECEIVED; - i2c_slave_event(slave, I2C_SLAVE_WRITE_REQUESTED, &value); + ret = i2c_slave_event(slave, I2C_SLAVE_WRITE_REQUESTED, &value); + if (ret == -EBUSY) + writel(ASPEED_I2CD_M_S_RX_CMD_LAST, bus->base + ASPEED_I2C_CMD_REG); break; case ASPEED_I2C_SLAVE_WRITE_RECEIVED: i2c_slave_event(slave, I2C_SLAVE_WRITE_RECEIVED, &value);
When processing I2C_SLAVE_WRITE_REQUESTED event, if slave returns -EBUSY, i2c controller should issue RxCmdLast command to assert NAK on the bus. Signed-off-by: Quan Nguyen <quan@os.amperecomputing.com> --- v7 -> v8: + None v6: + New introduced in v6 [Quan] drivers/i2c/busses/i2c-aspeed.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)