get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1936186/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1936186,
    "url": "http://patchwork.ozlabs.org/api/patches/1936186/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-aspeed/patch/20240516181907.3468796-26-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-26-eajames@linux.ibm.com>",
    "list_archive_url": null,
    "date": "2024-05-16T18:18:52",
    "name": "[v3,25/40] fsi: hub: Add interrupt support",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "11abe84aac669ae34fb82a476e61a1da2787bd02",
    "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-26-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/1936186/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1936186/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=owA/OiAl;\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=owA/OiAl;\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=owA/OiAl;\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 4VgJNf2xNzz1yfq\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 May 2024 04:22:42 +1000 (AEST)",
            "from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4VgJNf0mXhz3fnd\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 17 May 2024 04:22:42 +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 4VgJKM02Yfz3fnb;\n\tFri, 17 May 2024 04:19:50 +1000 (AEST)",
            "from pps.filterd (m0353725.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 44GEwjCg032767;\n\tThu, 16 May 2024 18:19:19 GMT",
            "from ppma22.wdc07v.mail.ibm.com\n (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92])\n\tby mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3y5mce8frq-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 (ppma22.wdc07v.mail.ibm.com [127.0.0.1])\n\tby ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id\n 44GHOpDf020460;\n\tThu, 16 May 2024 18:19:17 GMT",
            "from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4])\n\tby ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3y2kd0bmcn-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tThu, 16 May 2024 18:19:17 +0000",
            "from smtpav05.dal12v.mail.ibm.com (smtpav05.dal12v.mail.ibm.com\n [10.241.53.104])\n\tby smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 44GIJFar26149408\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 1339D58076;\n\tThu, 16 May 2024 18:19:15 +0000 (GMT)",
            "from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id C8A0E5806E;\n\tThu, 16 May 2024 18:19:14 +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:14 +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=YOLIj6L0KAZvactSkelHXB6uAYCWUbFIRDQVWm/PliY=;\n b=owA/OiAlUmRd951wzzPpLhvhHmYWREtmq+8CfVlJQFeIQY15TywgTXh3vUE0W4oOTX+i\n VCBjxxUjLWKsXqr2MaXB+A8B4oF9i36YCtQCcyGLerHimbvBe8n6hlXiuGwae7KH+CLa\n 5ifvwyIedeFVlRiTuOdQ3tSUp2J7qzkbMPKDgnvGy7oyTtgNmoNpVm1nnVwZVYHs6SgF\n aWvI8a4c0Qa7ODMqdSxTxLBQUCprsnLpx91shJo2RTu92zE5EVkBcoRl6KYr7tratuXq\n mCW+tbR1qXPzjgOP1xDFUp5BZ4h4p1G4ose2xMmDVl3sJ8A9fbr1mWn2qBSZfmUqbTPd qQ==",
        "From": "Eddie James <eajames@linux.ibm.com>",
        "To": "linux-fsi@lists.ozlabs.org",
        "Subject": "[PATCH v3 25/40] fsi: hub: Add interrupt support",
        "Date": "Thu, 16 May 2024 13:18:52 -0500",
        "Message-Id": "<20240516181907.3468796-26-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": "Xxr-s5lPq7S7aX6RkbSaXYiYCaLde0WE",
        "X-Proofpoint-ORIG-GUID": "Xxr-s5lPq7S7aX6RkbSaXYiYCaLde0WE",
        "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 mlxlogscore=796 phishscore=0\n adultscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 bulkscore=0\n mlxscore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015\n classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000\n 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": "The hub master receives it's interrupts from the local slave register\nspace, which is handled in the FSI core. Therefore, just route the remote\nslave interrupts to the hub link device interrupts.\n\nSigned-off-by: Eddie James <eajames@linux.ibm.com>\n---\n drivers/fsi/fsi-master-hub.c | 119 ++++++++++++++++++++++++++++++++++-\n 1 file changed, 116 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/fsi/fsi-master-hub.c b/drivers/fsi/fsi-master-hub.c\nindex 91ad6b7728fa2..4dbc542500bbd 100644\n--- a/drivers/fsi/fsi-master-hub.c\n+++ b/drivers/fsi/fsi-master-hub.c\n@@ -7,8 +7,10 @@\n \n #include <linux/delay.h>\n #include <linux/fsi.h>\n+#include <linux/irqchip/chained_irq.h>\n #include <linux/module.h>\n #include <linux/of.h>\n+#include <linux/of_irq.h>\n #include <linux/regmap.h>\n #include <linux/slab.h>\n \n@@ -35,9 +37,10 @@\n  */\n struct fsi_master_hub {\n \tstruct fsi_master\tmaster;\n+\tstruct irq_domain\t*irq_domain;\n \tstruct fsi_device\t*upstream;\n-\tuint32_t\t\taddr, size;\t/* slave-relative addr of */\n-\t\t\t\t\t\t/* master address space */\n+\tuint32_t\t\taddr;\n+\tuint32_t\t\tsize;\n };\n \n #define to_fsi_master_hub(m) container_of(m, struct fsi_master_hub, master)\n@@ -77,10 +80,81 @@ static int hub_master_break(struct fsi_master *master, int link)\n \treturn hub_master_write(master, link, 0, addr, &cmd, sizeof(cmd));\n }\n \n+static int hub_master_link_enable(struct fsi_master *master, int link,\n+\t\t\t\t  bool enable)\n+{\n+\tstruct fsi_master_hub *hub = to_fsi_master_hub(master);\n+\tu32 srsim = 0xff000000 >> (8 * (link % 4));\n+\tint slave_idx = 4 * (link / 4);\n+\t__be32 srsim_be;\n+\tint ret;\n+\n+\tret = fsi_slave_read(hub->upstream->slave, FSI_SLAVE_BASE + FSI_SRSIM0 + slave_idx,\n+\t\t\t     &srsim_be, sizeof(srsim_be));\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tif (enable) {\n+\t\tret = fsi_master_link_enable(master, link, enable);\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\n+\t\tsrsim |= be32_to_cpu(srsim_be);\n+\t\tsrsim_be = cpu_to_be32(srsim);\n+\t\tret = fsi_slave_write(hub->upstream->slave,\n+\t\t\t\t      FSI_SLAVE_BASE + FSI_SRSIM0 + slave_idx, &srsim_be,\n+\t\t\t\t      sizeof(srsim_be));\n+\t} else {\n+\t\tsrsim = be32_to_cpu(srsim_be) & ~srsim;\n+\t\tsrsim_be = cpu_to_be32(srsim);\n+\t\tret = fsi_slave_write(hub->upstream->slave,\n+\t\t\t\t      FSI_SLAVE_BASE + FSI_SRSIM0 + slave_idx, &srsim_be,\n+\t\t\t\t      sizeof(srsim_be));\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\n+\t\tret = fsi_master_link_enable(master, link, enable);\n+\t}\n+\n+\treturn ret;\n+}\n+\n+static irqreturn_t hub_master_irq(int irq, void *data)\n+{\n+\tstruct fsi_master_hub *hub = data;\n+\tstruct fsi_master *parent = hub->upstream->slave->master;\n+\tunsigned int link = 0;\n+\n+\tfor (; link < FSI_HUB_MASTER_MAX_LINKS; ++link) {\n+\t\tif (parent->remote_interrupt_status & (1 << link))\n+\t\t\tfsi_master_irq(&hub->master, hub->irq_domain, link);\n+\t}\n+\n+\treturn IRQ_HANDLED;\n+}\n+\n+static int hub_master_irqd_map(struct irq_domain *domain, unsigned int irq,\n+\t\t\t       irq_hw_number_t hwirq)\n+{\n+\tstruct fsi_master_hub *hub = domain->host_data;\n+\n+\tirq_set_chip_and_handler(irq, &hub->master.irq_chip, handle_simple_irq);\n+\tirq_set_chip_data(irq, &hub->master);\n+\n+\treturn 0;\n+}\n+\n+static const struct irq_domain_ops hub_master_irq_domain_ops = {\n+\t.map = hub_master_irqd_map,\n+};\n+\n static void hub_master_release(struct device *dev)\n {\n \tstruct fsi_master_hub *hub = to_fsi_master_hub(to_fsi_master(dev));\n \n+\tif (hub->irq_domain)\n+\t\tirq_domain_remove(hub->irq_domain);\n+\n \tregmap_exit(hub->master.map);\n \tkfree(hub);\n }\n@@ -135,6 +209,7 @@ static int hub_master_probe(struct device *dev)\n \thub->master.read = hub_master_read;\n \thub->master.write = hub_master_write;\n \thub->master.send_break = hub_master_break;\n+\thub->master.link_enable = hub_master_link_enable;\n \n \tdev_set_drvdata(dev, hub);\n \n@@ -142,9 +217,44 @@ static int hub_master_probe(struct device *dev)\n \tif (rc)\n \t\tgoto err_free;\n \n+\tif (of_property_read_bool(dev->of_node, \"interrupt-controller\")) {\n+\t\tstruct device_node *parent = of_irq_find_parent(dev->of_node);\n+\n+\t\tif (parent) {\n+\t\t\tstruct irq_fwspec fwspec;\n+\t\t\tunsigned int irq;\n+\n+\t\t\tfwspec.fwnode = of_node_to_fwnode(parent);\n+\t\t\tfwspec.param_count = 1;\n+\t\t\tfwspec.param[0] = (fsi_dev->slave->link * FSI_IRQ_COUNT) + 8;\n+\t\t\tirq = irq_create_fwspec_mapping(&fwspec);\n+\t\t\tif (irq) {\n+\t\t\t\tunsigned int size = links * FSI_IRQ_COUNT;\n+\n+\t\t\t\thub->irq_domain = irq_domain_add_linear(dev->of_node, size,\n+\t\t\t\t\t\t\t\t\t&hub_master_irq_domain_ops,\n+\t\t\t\t\t\t\t\t\thub);\n+\n+\t\t\t\tif (hub->irq_domain) {\n+\t\t\t\t\trc = devm_request_irq(dev, irq, hub_master_irq, 0,\n+\t\t\t\t\t\t\t      dev_name(dev), hub);\n+\t\t\t\t\tif (rc) {\n+\t\t\t\t\t\tdev_warn(dev, \"failed to request irq:%u\\n\", irq);\n+\t\t\t\t\t\tirq_domain_remove(hub->irq_domain);\n+\t\t\t\t\t\thub->irq_domain = NULL;\n+\t\t\t\t\t} else {\n+\t\t\t\t\t\tdev_info(dev, \"enabling interrupts irq:%u\\n\", irq);\n+\t\t\t\t\t}\n+\t\t\t\t} else {\n+\t\t\t\t\tdev_warn(dev, \"failed to create irq domain\\n\");\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\t}\n+\n \trc = fsi_master_register(&hub->master);\n \tif (rc)\n-\t\tgoto err_free;\n+\t\tgoto err_irq;\n \n \t/* At this point, fsi_master_register performs the device_initialize(),\n \t * and holds the sole reference on master.dev. This means the device\n@@ -156,6 +266,9 @@ static int hub_master_probe(struct device *dev)\n \tget_device(&hub->master.dev);\n \treturn 0;\n \n+err_irq:\n+\tif (hub->irq_domain)\n+\t\tirq_domain_remove(hub->irq_domain);\n err_free:\n \tkfree(hub);\n err_release:\n",
    "prefixes": [
        "v3",
        "25/40"
    ]
}