get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1641668,
    "url": "http://patchwork.ozlabs.org/api/patches/1641668/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ide/patch/20220610081801.11854-14-Sergey.Semin@baikalelectronics.ru/",
    "project": {
        "id": 13,
        "url": "http://patchwork.ozlabs.org/api/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,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20220610081801.11854-14-Sergey.Semin@baikalelectronics.ru>",
    "list_archive_url": null,
    "date": "2022-06-10T08:17:51",
    "name": "[v4,13/23] ata: libahci: Discard redundant force_port_map parameter",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "0bbdcd9ee53a0424f998edfc65b745fd8bb18550",
    "submitter": {
        "id": 78624,
        "url": "http://patchwork.ozlabs.org/api/people/78624/?format=api",
        "name": "Serge Semin",
        "email": "Sergey.Semin@baikalelectronics.ru"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-ide/patch/20220610081801.11854-14-Sergey.Semin@baikalelectronics.ru/mbox/",
    "series": [
        {
            "id": 304159,
            "url": "http://patchwork.ozlabs.org/api/series/304159/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-ide/list/?series=304159",
            "date": "2022-06-10T08:17:42",
            "name": "ata: ahci: Add DWC/Baikal-T1 AHCI SATA support",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/304159/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1641668/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1641668/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-ide-owner@vger.kernel.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "bilbo.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=baikalelectronics.ru header.i=@baikalelectronics.ru\n header.a=rsa-sha256 header.s=mail header.b=pSb9doOz;\n\tdkim-atps=neutral",
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2620:137:e000::1:20; helo=out1.vger.email;\n envelope-from=linux-ide-owner@vger.kernel.org; receiver=<UNKNOWN>)"
        ],
        "Received": [
            "from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20])\n\tby bilbo.ozlabs.org (Postfix) with ESMTP id 4LKDPs3wgVz9s5V\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Jun 2022 18:18:57 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n        id S1347451AbiFJISw (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n        Fri, 10 Jun 2022 04:18:52 -0400",
            "from lindbergh.monkeyblade.net ([23.128.96.19]:35856 \"EHLO\n        lindbergh.monkeyblade.net\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n        with ESMTP id S1347244AbiFJISl (ORCPT\n        <rfc822;linux-ide@vger.kernel.org>); Fri, 10 Jun 2022 04:18:41 -0400",
            "from mail.baikalelectronics.com (mail.baikalelectronics.com\n [87.245.175.230])\n        by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8E99B2453AE;\n        Fri, 10 Jun 2022 01:18:24 -0700 (PDT)",
            "from mail (mail.baikal.int [192.168.51.25])\n        by mail.baikalelectronics.com (Postfix) with ESMTP id 389B816A1;\n        Fri, 10 Jun 2022 11:19:06 +0300 (MSK)",
            "from localhost (192.168.53.207) by mail (192.168.51.25) with\n Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 10 Jun 2022 11:18:14 +0300"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 mail.baikalelectronics.com 389B816A1",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=baikalelectronics.ru; s=mail; t=1654849146;\n        bh=rCo7ZHGnBDh7rOvYOigVWDBCADB9Ck2vksFAutZCEoY=;\n        h=From:To:CC:Subject:Date:In-Reply-To:References:From;\n        b=pSb9doOz4dZmuXFT2Lvw5s3Rwwsp74BJilW1IsdDAjFCb0b3hV9O67/YG9ci9ocvA\n         2alKC0qmx7E1P7f3s7Bm1nvQlO7McThNGMXKNhE6maviAa8DTF4DbgZl9/1W09SZj/\n         +yEXYuAPYYK0hO5vVsUkHtcNOJnvaTahVuE9vyzQ=",
        "From": "Serge Semin <Sergey.Semin@baikalelectronics.ru>",
        "To": "Damien Le Moal <damien.lemoal@opensource.wdc.com>,\n        Hans de Goede <hdegoede@redhat.com>,\n        Jens Axboe <axboe@kernel.dk>, Hannes Reinecke <hare@suse.de>",
        "CC": "Serge Semin <Sergey.Semin@baikalelectronics.ru>,\n        Serge Semin <fancer.lancer@gmail.com>,\n        Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>,\n        Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>,\n        Rob Herring <robh+dt@kernel.org>, <linux-ide@vger.kernel.org>,\n        <linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>",
        "Subject": "[PATCH v4 13/23] ata: libahci: Discard redundant force_port_map\n parameter",
        "Date": "Fri, 10 Jun 2022 11:17:51 +0300",
        "Message-ID": "<20220610081801.11854-14-Sergey.Semin@baikalelectronics.ru>",
        "In-Reply-To": "<20220610081801.11854-1-Sergey.Semin@baikalelectronics.ru>",
        "References": "<20220610081801.11854-1-Sergey.Semin@baikalelectronics.ru>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-ClientProxiedBy": "MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25)",
        "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n        DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS,\n        T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no\n        version=3.4.6",
        "X-Spam-Checker-Version": "SpamAssassin 3.4.6 (2021-04-09) on\n        lindbergh.monkeyblade.net",
        "Precedence": "bulk",
        "List-ID": "<linux-ide.vger.kernel.org>",
        "X-Mailing-List": "linux-ide@vger.kernel.org"
    },
    "content": "Currently there are four port-map-related fields declared in the\nahci_host_priv structure and used to setup the HBA ports mapping. First\nthe ports-mapping is read from the PI register and immediately stored in\nthe saved_port_map field. If forced_port_map is initialized with non-zero\nvalue then its value will have greater priority over the value read from\nPI, thus it will override the saved_port_map field. That value will be\nthen masked by a non-zero mask_port_map field and after some sanity checks\nit will be stored in the ahci_host_priv.port_map field as a final port\nmapping.\n\nAs you can see the logic is a bit too complicated for such a simple task.\nWe can freely get rid from at least one of the fields with no change to\nthe implemented semantic. The force_port_map field can be replaced with\ntaking non-zero saved_port_map value into account. So if saved_port_map is\npre-initialized by the low level drivers (platform drivers) then it will\nhave greater priority over the value read from PI register and will be\nused as actual HBA ports mapping later on. Thus the ports map forcing task\nwill be just transferred from force_port_map to the saved_port_map field.\n\nThis modification will perfectly fit into the feature of having OF-based\ninitialization of the HW-init HBA CSR fields we are about to introduce in\nthe next commit.\n\nSigned-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>\nReviewed-by: Hannes Reinecke <hare@suse.de>\n---\n drivers/ata/ahci.c             |  2 +-\n drivers/ata/ahci.h             |  1 -\n drivers/ata/libahci.c          | 10 ++++++----\n drivers/ata/libahci_platform.c |  2 +-\n 4 files changed, 8 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c\nindex 397dfd27c90d..9bc8fa77e92f 100644\n--- a/drivers/ata/ahci.c\n+++ b/drivers/ata/ahci.c\n@@ -656,7 +656,7 @@ static void ahci_pci_save_initial_config(struct pci_dev *pdev,\n {\n \tif (pdev->vendor == PCI_VENDOR_ID_JMICRON && pdev->device == 0x2361) {\n \t\tdev_info(&pdev->dev, \"JMB361 has only one port\\n\");\n-\t\thpriv->force_port_map = 1;\n+\t\thpriv->saved_port_map = 1;\n \t}\n \n \t/*\ndiff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h\nindex f501531bd1b3..0e66446a5883 100644\n--- a/drivers/ata/ahci.h\n+++ b/drivers/ata/ahci.h\n@@ -327,7 +327,6 @@ struct ahci_port_priv {\n struct ahci_host_priv {\n \t/* Input fields */\n \tunsigned int\t\tflags;\t\t/* AHCI_HFLAG_* */\n-\tu32\t\t\tforce_port_map;\t/* force port map */\n \tu32\t\t\tmask_port_map;\t/* mask out particular bits */\n \n \tvoid __iomem *\t\tmmio;\t\t/* bus-independent mem map */\ndiff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c\nindex cf8c7fd59ada..000a7072614f 100644\n--- a/drivers/ata/libahci.c\n+++ b/drivers/ata/libahci.c\n@@ -453,7 +453,6 @@ void ahci_save_initial_config(struct device *dev, struct ahci_host_priv *hpriv)\n \t * reset.  Values without are used for driver operation.\n \t */\n \thpriv->saved_cap = cap = readl(mmio + HOST_CAP);\n-\thpriv->saved_port_map = port_map = readl(mmio + HOST_PORTS_IMPL);\n \n \t/* CAP2 register is only defined for AHCI 1.2 and later */\n \tvers = readl(mmio + HOST_VERSION);\n@@ -517,10 +516,13 @@ void ahci_save_initial_config(struct device *dev, struct ahci_host_priv *hpriv)\n \t\tcap &= ~HOST_CAP_SXS;\n \t}\n \n-\tif (hpriv->force_port_map && port_map != hpriv->force_port_map) {\n+\t/* Override the HBA ports mapping if the platform needs it */\n+\tport_map = readl(mmio + HOST_PORTS_IMPL);\n+\tif (hpriv->saved_port_map && port_map != hpriv->saved_port_map) {\n \t\tdev_info(dev, \"forcing port_map 0x%x -> 0x%x\\n\",\n-\t\t\t port_map, hpriv->force_port_map);\n-\t\tport_map = hpriv->force_port_map;\n+\t\t\t port_map, hpriv->saved_port_map);\n+\t\tport_map = hpriv->saved_port_map;\n+\t} else {\n \t\thpriv->saved_port_map = port_map;\n \t}\n \ndiff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c\nindex fcf00ffc7d12..efe640603f3f 100644\n--- a/drivers/ata/libahci_platform.c\n+++ b/drivers/ata/libahci_platform.c\n@@ -524,7 +524,7 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev,\n \t}\n \n \tof_property_read_u32(dev->of_node,\n-\t\t\t     \"ports-implemented\", &hpriv->force_port_map);\n+\t\t\t     \"ports-implemented\", &hpriv->saved_port_map);\n \n \tif (child_nodes) {\n \t\tfor_each_child_of_node(dev->of_node, child) {\n",
    "prefixes": [
        "v4",
        "13/23"
    ]
}