get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2228085,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2228085/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ide/patch/20260425065509.733544-1-dayou5941@163.com/",
    "project": {
        "id": 13,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/13/?format=api",
        "name": "Linux IDE development",
        "link_name": "linux-ide",
        "list_id": "linux-ide.vger.kernel.org",
        "list_email": "linux-ide@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null
    },
    "msgid": "<20260425065509.733544-1-dayou5941@163.com>",
    "date": "2026-04-25T06:55:09",
    "name": "[v2] ata: ahci: fail probe if BAR too small for claimed ports",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "ea75bb9d63636032d26561ad16d423d91f8efdbf",
    "submitter": {
        "id": 93214,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/93214/?format=api",
        "name": "李佑鸿",
        "email": "dayou5941@163.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-ide/patch/20260425065509.733544-1-dayou5941@163.com/mbox/",
    "series": [
        {
            "id": 501423,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501423/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-ide/list/?series=501423",
            "date": "2026-04-25T06:55:09",
            "name": "[v2] ata: ahci: fail probe if BAR too small for claimed ports",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/501423/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2228085/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2228085/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <linux-ide+bounces-5532-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-ide@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256\n header.s=s110527 header.b=ParYK4ks;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.105.105.114; helo=tor.lore.kernel.org;\n envelope-from=linux-ide+bounces-5532-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (1024-bit key) header.d=163.com header.i=@163.com\n header.b=\"ParYK4ks\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=117.135.210.2",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=163.com",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=163.com"
        ],
        "Received": [
            "from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g2gbl0CPnz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 25 Apr 2026 16:56:34 +1000 (AEST)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 424DD301B4ED\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 25 Apr 2026 06:56:32 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 4C5A842048;\n\tSat, 25 Apr 2026 06:56:29 +0000 (UTC)",
            "from m16.mail.163.com (m16.mail.163.com [117.135.210.2])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 84FDC40DFB9\n\tfor <linux-ide@vger.kernel.org>; Sat, 25 Apr 2026 06:56:25 +0000 (UTC)",
            "from localhost.localdomain (unknown [])\n\tby gzga-smtp-mtada-g1-3 (Coremail) with SMTP id\n _____wC3NNBOZexpnzCLBg--.21294S2;\n\tSat, 25 Apr 2026 14:55:11 +0800 (CST)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777100189; cv=none;\n b=Po2ImHJVvQKr7tzqi7GSoccjwILz3w5cbpHm16qVDuR6D7hKFWr0teGXNixRnLpgEXGQOMzggsna0YifJ6rhVki69fLcXf9/J2CypWuppEp0iz3FFFLS6A0k5jL1jrJrOkJ6Ow4TFHCH5s2blR+vAEGV81ks8Sd0xLOv9enyB3M=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777100189; c=relaxed/simple;\n\tbh=snJGRbmvJsbYuKsGTG19GwkPxd5gMzlvXbfxs0ydHs8=;\n\th=From:To:Cc:Subject:Date:Message-Id:MIME-Version;\n b=NJdA0m1xrPqLu28v9CquuY8HqwK4p9LiyRcKW+jIDJ09Z4Ytc5GZEUxRDav0zI4SBig0KWF6q6Xkpqxj9x9PO9sTn3eh0kDYrJC1XfkmB6+t1e5luY3Ln8itnPTqys2r724vN44XyVwZAsyt9W5QEwkRg9+V63j7kpAdlZ0qX+U=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=163.com;\n spf=pass smtp.mailfrom=163.com;\n dkim=pass (1024-bit key) header.d=163.com header.i=@163.com\n header.b=ParYK4ks; arc=none smtp.client-ip=117.135.210.2",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;\n\ts=s110527; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=IS\n\tSqXdS4KGQqvbpOPr80nM+mCUTCiZX6ouWTLo7K4s4=; b=ParYK4ksirkC6Y7h80\n\tiO/ercMnHiGYzAPXFNv5NIKW9HYDwYXi5w1Es378Bej5gocVGcQQnXKzUwJmovTO\n\tlN9kvRgaaXQ5urChjYhphtrfLsB2zZoz4TWsbj7o+jRJIeQFmZpz6yrpWXPrzIEe\n\teQTflLwIl8pghoGKgUtyo9nK4=",
        "From": "dayou5941@163.com",
        "To": "linux-ide@vger.kernel.org",
        "Cc": "damien.lemoal@opensource.wdc.com,\n\tniklas.soderlund@corigine.com,\n\tliyouhong@kylinos.cn,\n\tDamien Le Moal <dlemoal@kernel.org>",
        "Subject": "[PATCH v2] ata: ahci: fail probe if BAR too small for claimed ports",
        "Date": "Sat, 25 Apr 2026 14:55:09 +0800",
        "Message-Id": "<20260425065509.733544-1-dayou5941@163.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-ide@vger.kernel.org",
        "List-Id": "<linux-ide.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-ide+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-ide+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-CM-TRANSID": "_____wC3NNBOZexpnzCLBg--.21294S2",
        "X-Coremail-Antispam": "1Uf129KBjvJXoWxJF4DCryfZF1fKFWDKFW5GFg_yoW5GrW3pF\n\tW7KFsYkrWjgFy7Xa18Aan7Zry3GwsxWa47trZ8Gan3trn0k3s7WF1Sya47Aay3J3s8G3WI\n\tq3yqqr1rur1UZaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2\n\t9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jozuXUUUUU=",
        "X-CM-SenderInfo": "5gd103ivzuiqqrwthudrp/xtbC+g8CsGnsZU-t1wAA3S"
    },
    "content": "From: liyouhong <liyouhong@kylinos.cn>\n\nWhen an AHCI controller is disabled in BIOS, its HOST_CAP register may\ncontain invalid values (e.g., 0xFFFFFFFF) indicating an impossibly large\nnumber of ports. If CAP.NP claims more ports than can physically fit\nwithin the mapped BAR region, accessing port registers beyond the BAR\nboundary causes a kernel panic.\n\nAdd validation in ahci_init_one() to check that the BAR size is\nsufficient for the number of ports claimed in CAP.NP. The check\ncalculates the required MMIO size as:\n\n  required_size = 0x100 (global registers) + max_ports * 0x80\n\nIf required_size exceeds the actual BAR size, the probe fails with\n-ENODEV, preventing the panic and providing a clear error message.\n\nThis solution follows the suggestion by Damien Le Moal and Niklas Cassel\nto detect and reject obviously broken controller configurations early.\n\nv2:\n- Complete rewrite based on community feedback\n- Move check from libahci.c to ahci.c\n- Fail probe early instead of attempting to work around invalid state\n- Implement BAR size validation as suggested\n\nReported-by: liyouhong <liyouhong@kylinos.cn>\nSuggested-by: Damien Le Moal <dlemoal@kernel.org>\nSuggested-by: Niklas Cassel <niklas.soderlund@corigine.com>\nSigned-off-by: liyouhong <liyouhong@kylinos.cn>",
    "diff": "diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c\nindex 1d73a53370cf..09026ea12cde 100644\n--- a/drivers/ata/ahci.c\n+++ b/drivers/ata/ahci.c\n@@ -1888,6 +1888,23 @@ static ssize_t remapped_nvme_show(struct device *dev,\n \n static DEVICE_ATTR_RO(remapped_nvme);\n \n+static int ahci_validate_bar_size(struct pci_dev *pdev, void __iomem *mmio)\n+{\n+\tu32 cap = readl(mmio + HOST_CAP);\n+\tunsigned int max_ports = ahci_nr_ports(cap);\n+\tu32 last_port_end = 0x100 + (max_ports * 0x80);\n+\tresource_size_t bar_size = pci_resource_len(pdev, AHCI_PCI_BAR_STANDARD);\n+\n+\tif (last_port_end > bar_size) {\n+\t\tdev_err(&pdev->dev,\n+\t\t\t\"AHCI: BAR5 too small for %u ports (last port ends at %u, BAR %llu)\\n\",\n+\t\t\tmax_ports, last_port_end, (unsigned long long)bar_size);\n+\t\treturn -ENODEV;\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)\n {\n \tunsigned int board_id = ent->driver_data;\n@@ -1988,6 +2005,10 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)\n \tif (!hpriv->mmio)\n \t\treturn -ENOMEM;\n \n+\trc = ahci_validate_bar_size(pdev, hpriv->mmio);\n+\tif (rc)\n+\t\treturn rc;\n+\n \t/* detect remapped nvme devices */\n \tahci_remap_check(pdev, ahci_pci_bar, hpriv);\n \n",
    "prefixes": [
        "v2"
    ]
}