Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1936178/?format=api
{ "id": 1936178, "url": "http://patchwork.ozlabs.org/api/patches/1936178/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-aspeed/patch/20240516181907.3468796-21-eajames@linux.ibm.com/", "project": { "id": 57, "url": "http://patchwork.ozlabs.org/api/projects/57/?format=api", "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-21-eajames@linux.ibm.com>", "list_archive_url": null, "date": "2024-05-16T18:18:47", "name": "[v3,20/40] fsi: aspeed: Switch to spinlock", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "15ca8a06d440be4b191db5193bf8364e15ad32a7", "submitter": { "id": 74989, "url": "http://patchwork.ozlabs.org/api/people/74989/?format=api", "name": "Eddie James", "email": "eajames@linux.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-aspeed/patch/20240516181907.3468796-21-eajames@linux.ibm.com/mbox/", "series": [ { "id": 407101, "url": "http://patchwork.ozlabs.org/api/series/407101/?format=api", "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/1936178/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1936178/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=JfUkLGqR;\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=JfUkLGqR;\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=JfUkLGqR;\n\tdkim-atps=neutral", "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com\n (client-ip=148.163.158.5; helo=mx0b-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 4VgJNJ5KMSz1yfq\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 May 2024 04:22:24 +1000 (AEST)", "from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4VgJNJ374jz3fpd\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 May 2024 04:22:24 +1000 (AEST)", "from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n [148.163.158.5])\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 4VgJKG0nMDz3fqV;\n\tFri, 17 May 2024 04:19:45 +1000 (AEST)", "from pps.filterd (m0356516.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 44GHgglc003311;\n\tThu, 16 May 2024 18:19:19 GMT", "from ppma21.wdc07v.mail.ibm.com\n (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91])\n\tby mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3y5pse82hv-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tThu, 16 May 2024 18:19:18 +0000", "from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1])\n\tby ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id\n 44GIAFtW002257;\n\tThu, 16 May 2024 18:19:18 GMT", "from smtprelay06.wdc07v.mail.ibm.com ([172.16.1.73])\n\tby ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3y2m0pkfun-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tThu, 16 May 2024 18:19:18 +0000", "from smtpav05.dal12v.mail.ibm.com (smtpav05.dal12v.mail.ibm.com\n [10.241.53.104])\n\tby smtprelay06.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 44GIJF9D4391626\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n\tThu, 16 May 2024 18:19:17 GMT", "from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 8CF9A58052;\n\tThu, 16 May 2024 18:19:13 +0000 (GMT)", "from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 4E88858087;\n\tThu, 16 May 2024 18:19:13 +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:13 +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=7144/LG2eNgprd/415eaf17snNBOk8+YXJ4liDEExS4=;\n b=JfUkLGqR0w44sdi7TCORDZY4JSPiNwMHvZTFE1EhV6dmOnkT+PxQ8pweSdJYxXQMTibb\n h7hgdnmb2GiyLOsWMsFBziAO6Qmy2MsnoY1/+/bp8dCJ6u5N6CDe/cr0MXd7C+dH7sBh\n 1IXs6/9GtUAqgy88VxNy+ORTN7xjWTPZlIvNlDrkJgR4SaA0/Y7UYg7tVS4voAYKlWaP\n gXdOxg8zQt1BqqTlyEu/cbpQlVnlAqXfE3R3ttaWQKbBX6k2wkNFpMGx0KYM6Cu5ei36\n NGnnjNZCPQbriycKsVc6vKGaU/jCOsZuUrXJlbd/11zgwwiqJ/lNyEeHW8kHVHC8l22s Kw==", "From": "Eddie James <eajames@linux.ibm.com>", "To": "linux-fsi@lists.ozlabs.org", "Subject": "[PATCH v3 20/40] fsi: aspeed: Switch to spinlock", "Date": "Thu, 16 May 2024 13:18:47 -0500", "Message-Id": "<20240516181907.3468796-21-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-ORIG-GUID": "eKL6peb-uWDAiGtkcxoarInplCb8X2xR", "X-Proofpoint-GUID": "eKL6peb-uWDAiGtkcxoarInplCb8X2xR", "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 bulkscore=0 adultscore=0\n suspectscore=0 lowpriorityscore=0 mlxscore=0 priorityscore=1501\n spamscore=0 impostorscore=0 phishscore=0 mlxlogscore=990 clxscore=1015\n malwarescore=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, switch to a spinlock rather\nthan a mutex.\n\nSigned-off-by: Eddie James <eajames@linux.ibm.com>\n---\n drivers/fsi/fsi-master-aspeed.c | 25 ++++++++++++++-----------\n 1 file changed, 14 insertions(+), 11 deletions(-)", "diff": "diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c\nindex 10ca23cf58c2e..176e596b4391b 100644\n--- a/drivers/fsi/fsi-master-aspeed.c\n+++ b/drivers/fsi/fsi-master-aspeed.c\n@@ -8,11 +8,11 @@\n #include <linux/io.h>\n #include <linux/mfd/syscon.h>\n #include <linux/module.h>\n-#include <linux/mutex.h>\n #include <linux/of.h>\n #include <linux/platform_device.h>\n #include <linux/regmap.h>\n #include <linux/slab.h>\n+#include <linux/spinlock.h>\n #include <linux/iopoll.h>\n #include <linux/gpio/consumer.h>\n \n@@ -24,7 +24,7 @@ struct fsi_master_aspeed_data {\n \n struct fsi_master_aspeed {\n \tstruct fsi_master\tmaster;\n-\tstruct mutex\t\tlock;\t/* protect HW access */\n+\tspinlock_t\t\tlock;\t/* protect HW access */\n \tstruct device\t\t*dev;\n \tvoid __iomem\t\t*base;\n \tvoid __iomem\t\t*ctrl;\n@@ -251,6 +251,7 @@ static int aspeed_master_read(struct fsi_master *master, int link,\n \t\t\tuint8_t id, uint32_t addr, void *val, size_t size)\n {\n \tstruct fsi_master_aspeed *aspeed = to_fsi_master_aspeed(master);\n+\tunsigned long flags;\n \tint ret;\n \n \tif (id > 0x3)\n@@ -259,7 +260,7 @@ static int aspeed_master_read(struct fsi_master *master, int link,\n \taddr |= id << 21;\n \taddr += link * FSI_HUB_LINK_SIZE;\n \n-\tmutex_lock(&aspeed->lock);\n+\tspin_lock_irqsave(&aspeed->lock, flags);\n \n \tswitch (size) {\n \tcase 1:\n@@ -278,7 +279,7 @@ static int aspeed_master_read(struct fsi_master *master, int link,\n \n \tret = check_errors(aspeed, ret);\n done:\n-\tmutex_unlock(&aspeed->lock);\n+\tspin_unlock_irqrestore(&aspeed->lock, flags);\n \treturn ret;\n }\n \n@@ -286,6 +287,7 @@ static int aspeed_master_write(struct fsi_master *master, int link,\n \t\t\tuint8_t id, uint32_t addr, const void *val, size_t size)\n {\n \tstruct fsi_master_aspeed *aspeed = to_fsi_master_aspeed(master);\n+\tunsigned long flags;\n \tint ret;\n \n \tif (id > 0x3)\n@@ -294,7 +296,7 @@ static int aspeed_master_write(struct fsi_master *master, int link,\n \taddr |= id << 21;\n \taddr += link * FSI_HUB_LINK_SIZE;\n \n-\tmutex_lock(&aspeed->lock);\n+\tspin_lock_irqsave(&aspeed->lock, flags);\n \n \tswitch (size) {\n \tcase 1:\n@@ -313,7 +315,7 @@ static int aspeed_master_write(struct fsi_master *master, int link,\n \n \tret = check_errors(aspeed, ret);\n done:\n-\tmutex_unlock(&aspeed->lock);\n+\tspin_unlock_irqrestore(&aspeed->lock, flags);\n \treturn ret;\n }\n \n@@ -396,15 +398,16 @@ static ssize_t cfam_reset_store(struct device *dev, struct device_attribute *att\n \t\t\t\tconst char *buf, size_t count)\n {\n \tstruct fsi_master_aspeed *aspeed = dev_get_drvdata(dev);\n+\tunsigned long flags;\n \n \ttrace_fsi_master_aspeed_cfam_reset(true);\n-\tmutex_lock(&aspeed->lock);\n+\tspin_lock_irqsave(&aspeed->lock, flags);\n \tgpiod_set_value(aspeed->cfam_reset_gpio, 1);\n-\tusleep_range(900, 1000);\n+\tudelay(900);\n \tgpiod_set_value(aspeed->cfam_reset_gpio, 0);\n-\tusleep_range(900, 1000);\n+\tudelay(900);\n \tregmap_write(aspeed->master.map, FSI_MRESP0, FSI_MRESP_RST_ALL_MASTER);\n-\tmutex_unlock(&aspeed->lock);\n+\tspin_unlock_irqrestore(&aspeed->lock, flags);\n \ttrace_fsi_master_aspeed_cfam_reset(false);\n \n \treturn count;\n@@ -498,6 +501,7 @@ static int fsi_master_aspeed_probe(struct platform_device *pdev)\n \t\treturn -ENOMEM;\n \n \taspeed->dev = &pdev->dev;\n+\tspin_lock_init(&aspeed->lock);\n \n \taspeed->base = devm_platform_ioremap_resource(pdev, 0);\n \tif (IS_ERR(aspeed->base)) {\n@@ -583,7 +587,6 @@ static int fsi_master_aspeed_probe(struct platform_device *pdev)\n \n \tdev_set_drvdata(&pdev->dev, aspeed);\n \n-\tmutex_init(&aspeed->lock);\n \trc = fsi_master_init(&aspeed->master, clk_get_rate(aspeed->clk));\n \tif (rc)\n \t\tgoto err_regmap;\n", "prefixes": [ "v3", "20/40" ] }