get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1821145,
    "url": "http://patchwork.ozlabs.org/api/patches/1821145/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20230814215457.4075025-9-bhupesh.sharma@linaro.org/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20230814215457.4075025-9-bhupesh.sharma@linaro.org>",
    "list_archive_url": null,
    "date": "2023-08-14T21:54:48",
    "name": "[08/17] ufs: Expose 'ufshcd_ops_dbg_register_dump' vops to allow dumping debug registers",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "5d19ce0117451bd2f8e36ee58a81e0fe10826f5c",
    "submitter": {
        "id": 81316,
        "url": "http://patchwork.ozlabs.org/api/people/81316/?format=api",
        "name": "Bhupesh Sharma",
        "email": "bhupesh.sharma@linaro.org"
    },
    "delegate": {
        "id": 3651,
        "url": "http://patchwork.ozlabs.org/api/users/3651/?format=api",
        "username": "trini",
        "first_name": "Tom",
        "last_name": "Rini",
        "email": "trini@ti.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20230814215457.4075025-9-bhupesh.sharma@linaro.org/mbox/",
    "series": [
        {
            "id": 368803,
            "url": "http://patchwork.ozlabs.org/api/series/368803/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=368803",
            "date": "2023-08-14T21:54:40",
            "name": "Enable UFS on DragonBoard845c",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/368803/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1821145/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1821145/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>)",
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=t4DCHBAW;\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.b=\"t4DCHBAW\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=bhupesh.sharma@linaro.org"
        ],
        "Received": [
            "from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature ECDSA (P-384))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4RPpBv11P0z1yfS\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 15 Aug 2023 07:56:39 +1000 (AEST)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 57861869A5;\n\tMon, 14 Aug 2023 23:55:49 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 3F6E8869A5; Mon, 14 Aug 2023 23:55:48 +0200 (CEST)",
            "from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com\n [IPv6:2607:f8b0:4864:20::62f])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 04DFB869B4\n for <u-boot@lists.denx.de>; Mon, 14 Aug 2023 23:55:46 +0200 (CEST)",
            "by mail-pl1-x62f.google.com with SMTP id\n d9443c01a7336-1bc5acc627dso32030055ad.1\n for <u-boot@lists.denx.de>; Mon, 14 Aug 2023 14:55:45 -0700 (PDT)",
            "from localhost.localdomain\n ([2401:4900:1f3b:3924:6581:8508:2ecb:b5dd])\n by smtp.gmail.com with ESMTPSA id\n n4-20020a170903110400b001bba373919bsm9872075plh.261.2023.08.14.14.55.40\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 14 Aug 2023 14:55:43 -0700 (PDT)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de",
        "X-Spam-Level": "",
        "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_NONE,SPF_PASS\n autolearn=ham autolearn_force=no version=3.4.2",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1692050144; x=1692654944;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=EQ0vp8PrPT7Qt9cmREurbyHikOAvTdgzhiZxZJi0znc=;\n b=t4DCHBAWVFcSNT/knqitxag/xC5FVh2hLILY6mNSmKtRMFqUmHXBMQezvdcjZOMeJu\n 1m/ZvnjyB7CWn+6bcV1F2b0v+1rU6ctZvcnvh6VGX2WFyMGKiVUIdZVxkVNPMFXcnFyT\n +JBQc/Py10WeGMY5HnLxfUrS/NuAQGO65PHyGvBGP4BpG6vtU1h69RO87mNgQ357NijI\n bTKzlu2805Noir3iFNxIGH+2D+w4qNL5XEwOqaIix0jh17P/7rIYZzAC1ki6bmkeYcDI\n pnSXiPvSAnS8PrWv7QVDupor79EuYJVG7rksimy+qx/twUrFpjySoxSZFZc5EGs1iH9h\n 3U6w==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20221208; t=1692050144; x=1692654944;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=EQ0vp8PrPT7Qt9cmREurbyHikOAvTdgzhiZxZJi0znc=;\n b=OHg7AHOO2qKrjb/4ff3xIMl6KomA0Cwj7VP8loJ/HJSZn1HBbGAyH3r7Q5u5zybpaC\n 2DHKU+pUz459NytRLdfc314v7P7MuzyLnyY3Vh5IYCmWtjSfzQcns0hbaYrqnXGVW2mF\n 9k/NJVqSsGr67FgiMzbBJtW1OX0uwrg5DLWE01aUhqr4X8GFPDp+d68aVhA1mpPChIgq\n e4l+vT8bIVjp7A+kPfhIaExMPZ37u+uP+jFCpFZR1l4hHVrU/m9vBPrhfHAx9b5a0VO1\n nl0Yl322RCDbOgax7+kSqjmPPGKy6GroBRvCd0bLM+D0kq+MidoWeQ0/8ug7ZzmXRdtI\n 4pEQ==",
        "X-Gm-Message-State": "AOJu0YyOKAQ4b5/hXtjbb41w2gzfjHRLZ3tYr5oM1lO2VigpOMX7Jjn1\n Jc3WiGh6N7jr6eucy3s4eQmGqVtM3zT5MrJKblw=",
        "X-Google-Smtp-Source": "\n AGHT+IFNsEvGZ5dt1Hvg1YOG1tAKqUwiKK7GGsRdb4BpiwUSq7uJMmCWuV04v5mbnb5eNahiEDUz/Q==",
        "X-Received": "by 2002:a17:903:1248:b0:1b3:9d13:34b3 with SMTP id\n u8-20020a170903124800b001b39d1334b3mr10842589plh.37.1692050144100;\n Mon, 14 Aug 2023 14:55:44 -0700 (PDT)",
        "From": "Bhupesh Sharma <bhupesh.sharma@linaro.org>",
        "To": "u-boot@lists.denx.de",
        "Cc": "sjg@chromium.org, trini@konsulko.com, bhupesh.sharma@linaro.org,\n bhupesh.linux@gmail.com, marek.vasut+renesas@mailbox.org,\n sumit.garg@linaro.org, rfried.dev@gmail.com, patrice.chotard@foss.st.com,\n jbx6244@gmail.com, kever.yang@rock-chips.com, eugen.hristev@collabora.com",
        "Subject": "[PATCH 08/17] ufs: Expose 'ufshcd_ops_dbg_register_dump' vops to\n allow dumping debug registers",
        "Date": "Tue, 15 Aug 2023 03:24:48 +0530",
        "Message-Id": "<20230814215457.4075025-9-bhupesh.sharma@linaro.org>",
        "X-Mailer": "git-send-email 2.38.1",
        "In-Reply-To": "<20230814215457.4075025-1-bhupesh.sharma@linaro.org>",
        "References": "<20230814215457.4075025-1-bhupesh.sharma@linaro.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.39",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>",
        "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de",
        "X-Virus-Status": "Clean"
    },
    "content": "Add more verbose debug capabilities and vops to allow dumping\nUFS debug registers / regions, similar to how the UFS Linux driver\ndoes it.\n\nSigned-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>\n---\n drivers/ufs/ufs.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++\n drivers/ufs/ufs.h |  9 ++++++\n 2 files changed, 80 insertions(+)",
    "diff": "diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c\nindex b2c3af429e..15fa3832b9 100644\n--- a/drivers/ufs/ufs.c\n+++ b/drivers/ufs/ufs.c\n@@ -59,10 +59,81 @@\n /* maximum bytes per request */\n #define UFS_MAX_BYTES\t(128 * 256 * 1024)\n \n+#define ufshcd_hex_dump(prefix_str, buf, len) do {                      \\\n+\tsize_t __len = (len);                                           \\\n+\tprint_hex_dump(prefix_str,                             \t\t\\\n+\t\t       DUMP_PREFIX_OFFSET,\t\t\t\t\\\n+\t\t       16, 4, buf, __len, false);                       \\\n+} while (0)\n+\n static inline bool ufshcd_is_hba_active(struct ufs_hba *hba);\n static inline void ufshcd_hba_stop(struct ufs_hba *hba);\n static int ufshcd_hba_enable(struct ufs_hba *hba);\n \n+int ufshcd_dump_regs(struct ufs_hba *hba, size_t offset, size_t len,\n+\t\t     const char *prefix)\n+{\n+\tu32 *regs;\n+\tsize_t pos;\n+\n+\tif (offset % 4 != 0 || len % 4 != 0) /* keep readl happy */\n+\t\treturn -EINVAL;\n+\n+\tregs = kzalloc(len, GFP_KERNEL);\n+\tif (!regs)\n+\t\treturn -ENOMEM;\n+\n+\tfor (pos = 0; pos < len; pos += 4) {\n+\t\tif (offset == 0 &&\n+\t\t    pos >= REG_UIC_ERROR_CODE_PHY_ADAPTER_LAYER &&\n+\t\t    pos <= REG_UIC_ERROR_CODE_DME)\n+\t\t\tcontinue;\n+\t\tregs[pos / 4] = ufshcd_readl(hba, offset + pos);\n+\t}\n+\n+\tufshcd_hex_dump(prefix, regs, len);\n+\tkfree(regs);\n+\n+\treturn 0;\n+}\n+\n+void ufshcd_print_tr(struct ufs_hba *hba, int tag, bool pr_prdt)\n+{\n+\tint prdt_length;\n+\tstruct utp_transfer_req_desc *req_desc = hba->utrdl;\n+\n+\tdev_info(hba->dev,\n+\t\t\"UPIU[%d] - Transfer Request Descriptor phys@0x%llx\\n\",\n+\t\ttag, (u64)hba->utrdl);\n+\n+\tufshcd_hex_dump(\"UPIU TRD: \", hba->utrdl,\n+\t\t\tsizeof(struct utp_transfer_req_desc));\n+\tdev_info(hba->dev, \"UPIU[%d] - Request UPIU phys@0x%llx\\n\", tag,\n+\t\t(u64)hba->ucd_req_ptr);\n+\tufshcd_hex_dump(\"UPIU REQ: \", hba->ucd_req_ptr,\n+\t\t\tsizeof(struct utp_upiu_req));\n+\tdev_info(hba->dev, \"UPIU[%d] - Response UPIU phys@0x%llx\\n\", tag,\n+\t\t(u64)hba->ucd_rsp_ptr);\n+\tufshcd_hex_dump(\"UPIU RSP: \", hba->ucd_rsp_ptr,\n+\t\t\tsizeof(struct utp_upiu_rsp));\n+\n+\tprdt_length = le16_to_cpu(req_desc->prd_table_length);\n+\n+\tdev_info(hba->dev,\n+\t\t\"UPIU[%d] - PRDT - %d entries  phys@0x%llx\\n\",\n+\t\ttag, prdt_length,\n+\t\t(u64)hba->ucd_prdt_ptr);\n+\n+\tif (pr_prdt)\n+\t\tufshcd_hex_dump(\"UPIU PRDT: \", hba->ucd_prdt_ptr,\n+\t\t\tsizeof(struct ufshcd_sg_entry) * prdt_length);\n+}\n+\n+void ufshcd_dbg_register_dump(struct ufs_hba *hba)\n+{\n+\tufshcd_ops_dbg_register_dump(hba);\n+}\n+\n /*\n  * ufshcd_wait_for_register - wait for register value to change\n  */\ndiff --git a/drivers/ufs/ufs.h b/drivers/ufs/ufs.h\nindex c9320a905e..b3d2bd0368 100644\n--- a/drivers/ufs/ufs.h\n+++ b/drivers/ufs/ufs.h\n@@ -695,6 +695,7 @@ struct ufs_dev_cmd {\n \n struct ufs_hba_ops {\n \tint (*init)(struct ufs_hba *hba);\n+\tvoid (*dbg_register_dump)(struct ufs_hba *hba);\n \tint (*hce_enable_notify)(struct ufs_hba *hba,\n \t\t\t\t enum ufs_notify_change_status);\n \tint (*link_startup_notify)(struct ufs_hba *hba,\n@@ -746,6 +747,12 @@ static inline int ufshcd_ops_init(struct ufs_hba *hba)\n \treturn 0;\n }\n \n+static inline void ufshcd_ops_dbg_register_dump(struct ufs_hba *hba)\n+{\n+\tif (hba->ops && hba->ops->dbg_register_dump)\n+\t\thba->ops->dbg_register_dump(hba);\n+}\n+\n static inline int ufshcd_ops_hce_enable_notify(struct ufs_hba *hba,\n \t\t\t\t\t\tbool status)\n {\n@@ -931,5 +938,7 @@ static inline void ufshcd_rmwl(struct ufs_hba *hba, u32 mask, u32 val, u32 reg)\n #define UTP_TASK_REQ_LIST_RUN_STOP_BIT\t\t0x1\n \n int ufshcd_probe(struct udevice *dev, struct ufs_hba_ops *hba_ops);\n+int ufshcd_dump_regs(struct ufs_hba *hba, size_t offset, size_t len,\n+\t\t     const char *prefix);\n \n #endif\n",
    "prefixes": [
        "08/17"
    ]
}