get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1169,
    "url": "http://patchwork.ozlabs.org/api/patches/1169/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1222201756-21374-1-git-send-email-timur@freescale.com/",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api",
        "name": "Linux PPC development",
        "link_name": "linuxppc-dev",
        "list_id": "linuxppc-dev.lists.ozlabs.org",
        "list_email": "linuxppc-dev@lists.ozlabs.org",
        "web_url": "https://github.com/linuxppc/wiki/wiki",
        "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git",
        "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/",
        "list_archive_url": "https://lore.kernel.org/linuxppc-dev/",
        "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/",
        "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"
    },
    "msgid": "<1222201756-21374-1-git-send-email-timur@freescale.com>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/1222201756-21374-1-git-send-email-timur@freescale.com/",
    "date": "2008-09-23T20:29:16",
    "name": "fsldma: remove internal self-test from Freescale Elo DMA driver",
    "commit_ref": "59f647c25a4f27c1e5c84710e0608b36303089f9",
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "e126885b8106234303fc48f7135189cec007e49e",
    "submitter": {
        "id": 124,
        "url": "http://patchwork.ozlabs.org/api/people/124/?format=api",
        "name": "Timur Tabi",
        "email": "timur@freescale.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1222201756-21374-1-git-send-email-timur@freescale.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/1169/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1169/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org>",
        "X-Original-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@ozlabs.org"
        ],
        "Received": [
            "from ozlabs.org (localhost [127.0.0.1])\n\tby ozlabs.org (Postfix) with ESMTP id E9B8FDE58C\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 24 Sep 2008 06:29:44 +1000 (EST)",
            "from de01egw01.freescale.net (de01egw01.freescale.net\n\t[192.88.165.102])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(Client did not present a certificate)\n\tby ozlabs.org (Postfix) with ESMTPS id 0E845DE273\n\tfor <linuxppc-dev@ozlabs.org>; Wed, 24 Sep 2008 06:29:31 +1000 (EST)",
            "from de01smr01.freescale.net (de01smr01.freescale.net\n\t[10.208.0.31])\n\tby de01egw01.freescale.net (8.12.11/az33egw01) with ESMTP id\n\tm8NKTI7k010443; Tue, 23 Sep 2008 13:29:18 -0700 (MST)",
            "from localhost.localdomain (ld0169-tx32.am.freescale.net\n\t[10.82.19.119])\n\tby de01smr01.freescale.net (8.13.1/8.13.0) with ESMTP id\n\tm8NKTGJw007499; Tue, 23 Sep 2008 15:29:16 -0500 (CDT)"
        ],
        "From": "Timur Tabi <timur@freescale.com>",
        "To": "linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org,\n\tdan.j.williams@intel.com, scottwood@freescale.com,\n\tgalak@kernel.crashing.org, leoli@freescale.com",
        "Subject": "[PATCH] fsldma: remove internal self-test from Freescale Elo DMA\n\tdriver",
        "Date": "Tue, 23 Sep 2008 15:29:16 -0500",
        "Message-Id": "<1222201756-21374-1-git-send-email-timur@freescale.com>",
        "X-Mailer": "git-send-email 1.5.5",
        "X-BeenThere": "linuxppc-dev@ozlabs.org",
        "X-Mailman-Version": "2.1.11",
        "Precedence": "list",
        "List-Id": "Linux on PowerPC Developers Mail List <linuxppc-dev.ozlabs.org>",
        "List-Unsubscribe": "<https://ozlabs.org/mailman/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://ozlabs.org/pipermail/linuxppc-dev>",
        "List-Post": "<mailto:linuxppc-dev@ozlabs.org>",
        "List-Help": "<mailto:linuxppc-dev-request@ozlabs.org?subject=help>",
        "List-Subscribe": "<https://ozlabs.org/mailman/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@ozlabs.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org",
        "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org"
    },
    "content": "The Freescale Elo DMA driver runs an internal self-test before registering\nthe channels with the DMA engine.  This self-test has a fundemental flaw in\nthat it calls the DMA engine's callback functions directly before the\nregistration.  However, the registration initializes some variables that the\ncallback functions uses, namely the device struct.\n\nThe code works today because there are two device structs: the one created\nby the DMA engine, and one created by the Open Firmware (OF) subsystem.  The\nself-test currently uses the device struct created by OF.  However, in the\nfuture, some of the device structs created by OF will be eliminated.\nThis means that the self-test will only have access to the device struct\ncreated by the DMA engine.  But this device struct isn't initialized when\nthe self-test runs, and this causes a kernel panic.\n\nSince there is already a DMA test module (dmatest), the internal self-test\ncode is not useful anyway.  It is extremely unlikely that the test will fail\nin normal usage.  It may have been helpful during development, but not any more.\n\nSigned-off-by: Timur Tabi <timur@freescale.com>\n---\n\nThis patch is for 2.6.28.\n\n drivers/dma/fsldma.c |  132 --------------------------------------------------\n 1 files changed, 0 insertions(+), 132 deletions(-)",
    "diff": "diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c\nindex c0059ca..e9b2638 100644\n--- a/drivers/dma/fsldma.c\n+++ b/drivers/dma/fsldma.c\n@@ -786,132 +786,6 @@ static void dma_do_tasklet(unsigned long data)\n \tfsl_chan_ld_cleanup(fsl_chan);\n }\n \n-static void fsl_dma_callback_test(void *param)\n-{\n-\tstruct fsl_dma_chan *fsl_chan = param;\n-\tif (fsl_chan)\n-\t\tdev_dbg(fsl_chan->dev, \"selftest: callback is ok!\\n\");\n-}\n-\n-static int fsl_dma_self_test(struct fsl_dma_chan *fsl_chan)\n-{\n-\tstruct dma_chan *chan;\n-\tint err = 0;\n-\tdma_addr_t dma_dest, dma_src;\n-\tdma_cookie_t cookie;\n-\tu8 *src, *dest;\n-\tint i;\n-\tsize_t test_size;\n-\tstruct dma_async_tx_descriptor *tx1, *tx2, *tx3;\n-\n-\ttest_size = 4096;\n-\n-\tsrc = kmalloc(test_size * 2, GFP_KERNEL);\n-\tif (!src) {\n-\t\tdev_err(fsl_chan->dev,\n-\t\t\t\t\"selftest: Cannot alloc memory for test!\\n\");\n-\t\treturn -ENOMEM;\n-\t}\n-\n-\tdest = src + test_size;\n-\n-\tfor (i = 0; i < test_size; i++)\n-\t\tsrc[i] = (u8) i;\n-\n-\tchan = &fsl_chan->common;\n-\n-\tif (fsl_dma_alloc_chan_resources(chan, NULL) < 1) {\n-\t\tdev_err(fsl_chan->dev,\n-\t\t\t\t\"selftest: Cannot alloc resources for DMA\\n\");\n-\t\terr = -ENODEV;\n-\t\tgoto out;\n-\t}\n-\n-\t/* TX 1 */\n-\tdma_src = dma_map_single(fsl_chan->dev, src, test_size / 2,\n-\t\t\t\t DMA_TO_DEVICE);\n-\tdma_dest = dma_map_single(fsl_chan->dev, dest, test_size / 2,\n-\t\t\t\t  DMA_FROM_DEVICE);\n-\ttx1 = fsl_dma_prep_memcpy(chan, dma_dest, dma_src, test_size / 2, 0);\n-\tasync_tx_ack(tx1);\n-\n-\tcookie = fsl_dma_tx_submit(tx1);\n-\tfsl_dma_memcpy_issue_pending(chan);\n-\tmsleep(2);\n-\n-\tif (fsl_dma_is_complete(chan, cookie, NULL, NULL) != DMA_SUCCESS) {\n-\t\tdev_err(fsl_chan->dev, \"selftest: Time out!\\n\");\n-\t\terr = -ENODEV;\n-\t\tgoto free_resources;\n-\t}\n-\n-\t/* Test free and re-alloc channel resources */\n-\tfsl_dma_free_chan_resources(chan);\n-\n-\tif (fsl_dma_alloc_chan_resources(chan, NULL) < 1) {\n-\t\tdev_err(fsl_chan->dev,\n-\t\t\t\t\"selftest: Cannot alloc resources for DMA\\n\");\n-\t\terr = -ENODEV;\n-\t\tgoto free_resources;\n-\t}\n-\n-\t/* Continue to test\n-\t * TX 2\n-\t */\n-\tdma_src = dma_map_single(fsl_chan->dev, src + test_size / 2,\n-\t\t\t\t\ttest_size / 4, DMA_TO_DEVICE);\n-\tdma_dest = dma_map_single(fsl_chan->dev, dest + test_size / 2,\n-\t\t\t\t\ttest_size / 4, DMA_FROM_DEVICE);\n-\ttx2 = fsl_dma_prep_memcpy(chan, dma_dest, dma_src, test_size / 4, 0);\n-\tasync_tx_ack(tx2);\n-\n-\t/* TX 3 */\n-\tdma_src = dma_map_single(fsl_chan->dev, src + test_size * 3 / 4,\n-\t\t\t\t\ttest_size / 4, DMA_TO_DEVICE);\n-\tdma_dest = dma_map_single(fsl_chan->dev, dest + test_size * 3 / 4,\n-\t\t\t\t\ttest_size / 4, DMA_FROM_DEVICE);\n-\ttx3 = fsl_dma_prep_memcpy(chan, dma_dest, dma_src, test_size / 4, 0);\n-\tasync_tx_ack(tx3);\n-\n-\t/* Interrupt tx test */\n-\ttx1 = fsl_dma_prep_interrupt(chan, 0);\n-\tasync_tx_ack(tx1);\n-\tcookie = fsl_dma_tx_submit(tx1);\n-\n-\t/* Test exchanging the prepared tx sort */\n-\tcookie = fsl_dma_tx_submit(tx3);\n-\tcookie = fsl_dma_tx_submit(tx2);\n-\n-\tif (dma_has_cap(DMA_INTERRUPT, ((struct fsl_dma_device *)\n-\t    dev_get_drvdata(fsl_chan->dev->parent))->common.cap_mask)) {\n-\t\ttx3->callback = fsl_dma_callback_test;\n-\t\ttx3->callback_param = fsl_chan;\n-\t}\n-\tfsl_dma_memcpy_issue_pending(chan);\n-\tmsleep(2);\n-\n-\tif (fsl_dma_is_complete(chan, cookie, NULL, NULL) != DMA_SUCCESS) {\n-\t\tdev_err(fsl_chan->dev, \"selftest: Time out!\\n\");\n-\t\terr = -ENODEV;\n-\t\tgoto free_resources;\n-\t}\n-\n-\terr = memcmp(src, dest, test_size);\n-\tif (err) {\n-\t\tfor (i = 0; (*(src + i) == *(dest + i)) && (i < test_size);\n-\t\t\t\ti++);\n-\t\tdev_err(fsl_chan->dev, \"selftest: Test failed, data %d/%ld is \"\n-\t\t\t\t\"error! src 0x%x, dest 0x%x\\n\",\n-\t\t\t\ti, (long)test_size, *(src + i), *(dest + i));\n-\t}\n-\n-free_resources:\n-\tfsl_dma_free_chan_resources(chan);\n-out:\n-\tkfree(src);\n-\treturn err;\n-}\n-\n static int __devinit of_fsl_dma_chan_probe(struct of_device *dev,\n \t\t\tconst struct of_device_id *match)\n {\n@@ -1000,17 +874,11 @@ static int __devinit of_fsl_dma_chan_probe(struct of_device *dev,\n \t\t}\n \t}\n \n-\terr = fsl_dma_self_test(new_fsl_chan);\n-\tif (err)\n-\t\tgoto err_self_test;\n-\n \tdev_info(&dev->dev, \"#%d (%s), irq %d\\n\", new_fsl_chan->id,\n \t\t\t\tmatch->compatible, new_fsl_chan->irq);\n \n \treturn 0;\n \n-err_self_test:\n-\tfree_irq(new_fsl_chan->irq, new_fsl_chan);\n err_no_irq:\n \tlist_del(&new_fsl_chan->common.device_node);\n err_no_chan:\n",
    "prefixes": []
}