Show a patch.

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

{
    "id": 14134,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14134/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14134/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20211014103757.21161-1-jacopo@jmondi.org>",
    "date": "2021-10-14T10:37:57",
    "name": "[libcamera-devel] android: Re-order out-of-order completion path",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "54da7c3fb01f818a9539647145f5efd2da72919b",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/14134/mbox/",
    "series": [
        {
            "id": 2626,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2626/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2626",
            "date": "2021-10-14T10:37:57",
            "name": "[libcamera-devel] android: Re-order out-of-order completion path",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2626/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14134/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14134/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 83D67BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 14 Oct 2021 10:37:15 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 04CAA68F4F;\n\tThu, 14 Oct 2021 12:37:15 +0200 (CEST)",
            "from relay11.mail.gandi.net (relay11.mail.gandi.net\n\t[217.70.178.231])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3FAAC68541\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Oct 2021 12:37:13 +0200 (CEST)",
            "(Authenticated sender: jacopo@jmondi.org)\n\tby relay11.mail.gandi.net (Postfix) with ESMTPSA id 3BB6E100003;\n\tThu, 14 Oct 2021 10:37:12 +0000 (UTC)"
        ],
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 14 Oct 2021 12:37:57 +0200",
        "Message-Id": "<20211014103757.21161-1-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.33.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH] android: Re-order out-of-order completion\n\tpath",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "When the camera HAL detects an out-of-order completion of a request, it\nsends to the camera framework a CAMERA3_MSG_ERROR_DEVICE error.\n\nSuch error not only forces the service to close the camera as prescribed\nby the camera3 specification, but in some implementation (specifically\nthe ChromeOS one) it causes the camera service to abort and exit.\n\nThis prevents any error messages to be printed by libcamera, as the\nlibrary gets terminated before getting to that point, and also hides the\nprintout of error messages that lead to out-of-order completion, making\nit impossible to get from the output log what happened.\n\nMove the call to notifyError() at the end of the error path and demote\nthe error message to LogLevels::Error from Fatal to let the service\nimplementation decide how to handle CAMERA3_MSG_ERROR_DEVICE errors.\n\nBefore this patch, when waiting on a fence fails and the capture\nrequest is not queued to the Camera, we get an out-of-order completion\nbut no backtrace. With this patch applied the error path is visible:\n\nERROR HAL camera_worker.cpp:122 Failed waiting for fence: 82: Timer expired\nERROR HAL camera_device.cpp:1110 '\\_SB_.PCI0.I2C2.CAM0': Out-of-order completion for request 0x00007e6de4004c70\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/camera_device.cpp | 9 +++++----\n 1 file changed, 5 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 901867105085..f60297e13c8b 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -1104,16 +1104,17 @@ void CameraDevice::requestComplete(Request *request)\n \tif (descriptor->request_->cookie() != request->cookie()) {\n \t\t/*\n \t\t * \\todo Clarify if the Camera has to be closed on\n-\t\t * ERROR_DEVICE and possibly demote the Fatal to simple\n-\t\t * Error.\n+\t\t * ERROR_DEVICE.\n \t\t */\n-\t\tnotifyError(0, nullptr, CAMERA3_MSG_ERROR_DEVICE);\n-\t\tLOG(HAL, Fatal)\n+\t\tLOG(HAL, Error)\n \t\t\t<< \"Out-of-order completion for request \"\n \t\t\t<< utils::hex(request->cookie());\n \n \t\tMutexLocker descriptorsLock(descriptorsMutex_);\n \t\tdescriptors_.pop();\n+\n+\t\tnotifyError(0, nullptr, CAMERA3_MSG_ERROR_DEVICE);\n+\n \t\treturn;\n \t}\n \n",
    "prefixes": [
        "libcamera-devel"
    ]
}