{"id":1936126,"url":"http://patchwork.ozlabs.org/api/patches/1936126/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-aspeed/patch/20240516181907.3468796-32-eajames@linux.ibm.com/","project":{"id":57,"url":"http://patchwork.ozlabs.org/api/projects/57/?format=json","name":"Linux ASPEED SoC development","link_name":"linux-aspeed","list_id":"linux-aspeed.lists.ozlabs.org","list_email":"linux-aspeed@lists.ozlabs.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20240516181907.3468796-32-eajames@linux.ibm.com>","list_archive_url":null,"date":"2024-05-16T18:18:58","name":"[v3,31/40] i2c: fsi: Add boolean for skip stop command on abort","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"1be3f924071b770122fe2dcf6bd4ad5de9a8f407","submitter":{"id":74989,"url":"http://patchwork.ozlabs.org/api/people/74989/?format=json","name":"Eddie James","email":"eajames@linux.ibm.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-aspeed/patch/20240516181907.3468796-32-eajames@linux.ibm.com/mbox/","series":[{"id":407101,"url":"http://patchwork.ozlabs.org/api/series/407101/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-aspeed/list/?series=407101","date":"2024-05-16T18:18:31","name":"fsi: Add interrupt support","version":3,"mbox":"http://patchwork.ozlabs.org/series/407101/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/1936126/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/1936126/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-aspeed-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-aspeed@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","linux-aspeed@lists.ozlabs.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=Tu6i9VdJ;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org;\n envelope-from=linux-aspeed-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=Tu6i9VdJ;\n\tdkim-atps=neutral","lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=linux.ibm.com","lists.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=Tu6i9VdJ;\n\tdkim-atps=neutral","lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com\n (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com;\n envelope-from=eajames@linux.ibm.com; receiver=lists.ozlabs.org)"],"Received":["from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (secp384r1))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4VgJLN47txz1yfq\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 May 2024 04:20:44 +1000 (AEST)","from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4VgJLN1j3Hz3fqW\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 May 2024 04:20:44 +1000 (AEST)","from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n [148.163.156.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4VgJJw5cvSz3fq2;\n\tFri, 17 May 2024 04:19:28 +1000 (AEST)","from pps.filterd (m0353727.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 44GGkw93021245;\n\tThu, 16 May 2024 18:19:21 GMT","from ppma23.wdc07v.mail.ibm.com\n (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93])\n\tby mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3y5nycr8dc-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tThu, 16 May 2024 18:19:20 +0000","from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1])\n\tby ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id\n 44GHmnXO006183;\n\tThu, 16 May 2024 18:19:19 GMT","from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9])\n\tby ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3y2mgmud39-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tThu, 16 May 2024 18:19:19 +0000","from smtpav05.dal12v.mail.ibm.com (smtpav05.dal12v.mail.ibm.com\n [10.241.53.104])\n\tby smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 44GIJGA542140022\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n\tThu, 16 May 2024 18:19:18 GMT","from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id C90C858078;\n\tThu, 16 May 2024 18:19:16 +0000 (GMT)","from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 8AD6858080;\n\tThu, 16 May 2024 18:19:16 +0000 (GMT)","from slate16.aus.stglabs.ibm.com (unknown [9.61.107.19])\n\tby smtpav05.dal12v.mail.ibm.com (Postfix) with ESMTP;\n\tThu, 16 May 2024 18:19:16 +0000 (GMT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com;\n h=from : to : cc : subject\n : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding; s=pp1;\n bh=tzPFGbo6X3zcNdVJFT3Zq8NM38ZKt/TD8N6qjoX5nmY=;\n b=Tu6i9VdJy9SqOE8YPfw7wKNhmxqklFXeVtDHH08z4aciF5vj2Dewv/DF5iYdHIsVf6BD\n oWiIIxBqgiSw0cmJ0/M1b3SD02JSKK+x6XrslHBALqLmraTVYAnHewXSfp8FxtLIqLUh\n 80G+E/XQTLBH0wJHiEfRwZcDqYXH64YjKnYAQB5M7yWBLJGRZG6Qn5Rnzgcw8eE5aT75\n lBCiQeVK1nvFGXHYXmpIIwWVcGaV8Ez8+6LPonpnyby57oYEpkaKe3LN10LZTT9CwuNt\n dNnt+ZvuykIJ1D2UY+VmBrVoCbuypaFUTP3pdo2lDXXTn6ljeWKNElrzYpE5iRgTMEWR OQ==","From":"Eddie James <eajames@linux.ibm.com>","To":"linux-fsi@lists.ozlabs.org","Subject":"[PATCH v3 31/40] i2c: fsi: Add boolean for skip stop command on abort","Date":"Thu, 16 May 2024 13:18:58 -0500","Message-Id":"<20240516181907.3468796-32-eajames@linux.ibm.com>","X-Mailer":"git-send-email 2.39.3","In-Reply-To":"<20240516181907.3468796-1-eajames@linux.ibm.com>","References":"<20240516181907.3468796-1-eajames@linux.ibm.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-TM-AS-GCONF":"00","X-Proofpoint-GUID":"HC54uwD7Go1XxXnYpXpr9t0lMi06jJCP","X-Proofpoint-ORIG-GUID":"HC54uwD7Go1XxXnYpXpr9t0lMi06jJCP","X-Proofpoint-Virus-Version":"vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26\n definitions=2024-05-16_07,2024-05-15_01,2023-05-22_02","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n clxscore=1015 bulkscore=0\n malwarescore=0 priorityscore=1501 mlxscore=0 phishscore=0 suspectscore=0\n mlxlogscore=999 adultscore=0 lowpriorityscore=0 impostorscore=0\n spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1\n engine=8.12.0-2405010000 definitions=main-2405160132","X-BeenThere":"linux-aspeed@lists.ozlabs.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux ASPEED SoC development <linux-aspeed.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linux-aspeed>,\n <mailto:linux-aspeed-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linux-aspeed/>","List-Post":"<mailto:linux-aspeed@lists.ozlabs.org>","List-Help":"<mailto:linux-aspeed-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linux-aspeed>,\n <mailto:linux-aspeed-request@lists.ozlabs.org?subject=subscribe>","Cc":"andi.shyti@kernel.org, linux-aspeed@lists.ozlabs.org, jk@ozlabs.org,\n alistair@popple.id.au, linux-kernel@vger.kernel.org,\n linux-spi@vger.kernel.org, broonie@kernel.org, andrew@codeconstruct.com.au,\n linux-i2c@vger.kernel.org","Errors-To":"linux-aspeed-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org","Sender":"\"Linux-aspeed\"\n <linux-aspeed-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"},"content":"In preparation for interrupt support, store whether to skip the\nfinal stop command during the abort procedure instead of checking\nthe previously read status register in the abort function.\n\nSigned-off-by: Eddie James <eajames@linux.ibm.com>\n---\n drivers/i2c/busses/i2c-fsi.c | 18 +++++++++++-------\n 1 file changed, 11 insertions(+), 7 deletions(-)","diff":"diff --git a/drivers/i2c/busses/i2c-fsi.c b/drivers/i2c/busses/i2c-fsi.c\nindex 022f1287aa0e3..614d830419bb8 100644\n--- a/drivers/i2c/busses/i2c-fsi.c\n+++ b/drivers/i2c/busses/i2c-fsi.c\n@@ -116,6 +116,9 @@\n #define I2C_STAT_ANY_RESP\t(I2C_STAT_ERR |\t\t\t\t\\\n \t\t\t\t I2C_STAT_DAT_REQ |\t\t\t\\\n \t\t\t\t I2C_STAT_CMD_COMP)\n+#define I2C_STAT_SKIP_STOP\t(I2C_STAT_PARITY |\t\t\t\\\n+\t\t\t\t I2C_STAT_LOST_ARB |\t\t\t\\\n+\t\t\t\t I2C_STAT_STOP_ERR)\n \n /* extended status register */\n #define I2C_ESTAT_FIFO_SZ\tGENMASK(31, 24)\n@@ -150,6 +153,7 @@ struct fsi_i2c_master {\n \tstruct mutex\t\tlock;\n \tu32\t\t\tclock_div;\n \tu8\t\t\tfifo_size;\n+\tbool\t\t\tskip_stop;\n };\n \n struct fsi_i2c_port {\n@@ -459,31 +463,30 @@ static int fsi_i2c_reset_engine(struct fsi_i2c_master *i2c, u16 port)\n \treturn 0;\n }\n \n-static int fsi_i2c_abort(struct fsi_i2c_port *port, u32 status)\n+static int fsi_i2c_abort(struct fsi_i2c_port *port)\n {\n \tstruct fsi_i2c_master *i2c = port->master;\n \tu32 cmd = I2C_CMD_WITH_STOP;\n \tunsigned long start;\n-\tu32 stat;\n+\tu32 status;\n \tint rc;\n \n \trc = fsi_i2c_reset_engine(i2c, port->port);\n \tif (rc)\n \t\treturn rc;\n \n-\trc = fsi_i2c_read_reg(i2c->fsi, I2C_FSI_STAT, &stat);\n+\trc = fsi_i2c_read_reg(i2c->fsi, I2C_FSI_STAT, &status);\n \tif (rc)\n \t\treturn rc;\n \n \t/* if sda is low, peform full bus reset */\n-\tif (!(stat & I2C_STAT_SDA_IN)) {\n+\tif (!(status & I2C_STAT_SDA_IN)) {\n \t\trc = fsi_i2c_reset_bus(i2c, port);\n \t\tif (rc)\n \t\t\treturn rc;\n \t}\n \n-\t/* skip final stop command for these errors */\n-\tif (status & (I2C_STAT_PARITY | I2C_STAT_LOST_ARB | I2C_STAT_STOP_ERR))\n+\tif (i2c->skip_stop)\n \t\treturn 0;\n \n \t/* write stop command */\n@@ -534,7 +537,8 @@ static int fsi_i2c_handle_status(struct fsi_i2c_port *port,\n \tint rc;\n \n \tif (status & I2C_STAT_ERR) {\n-\t\trc = fsi_i2c_abort(port, status);\n+\t\tport->master->skip_stop = status & I2C_STAT_SKIP_STOP;\n+\t\trc = fsi_i2c_abort(port);\n \t\tif (rc)\n \t\t\treturn rc;\n \n","prefixes":["v3","31/40"]}