Show a patch.

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

{
    "id": 3225,
    "url": "https://patchwork.libcamera.org/api/patches/3225/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/3225/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20200320210435.8876-2-laurent.pinchart@ideasonboard.com>",
    "date": "2020-03-20T21:04:35",
    "name": "[libcamera-devel,2/2] libcamera: device_enumerator_udev: Don't add media device twice",
    "commit_ref": "3f97be923c11df4324f20a94591dc5562a05c7ba",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "4f9836f42e0619509b6808260093a0efb2e4cc7c",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/3225/mbox/",
    "series": [
        {
            "id": 751,
            "url": "https://patchwork.libcamera.org/api/series/751/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=751",
            "date": "2020-03-20T21:04:34",
            "name": "[libcamera-devel,1/2] Revert \"libcamera: controls: Don't over-optimize ControlValue layout\"",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/751/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/3225/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/3225/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<laurent.pinchart@ideasonboard.com>",
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A564460416\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Mar 2020 22:04:45 +0100 (CET)",
            "from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 21C4A9C0;\n\tFri, 20 Mar 2020 22:04:45 +0100 (CET)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1584738285;\n\tbh=hsM48vFdA9+aFQoGhP5/1fQekIzfhNEKVhLzCRvm7Is=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=UcP5Bx/tVz9EXdvdD1dyo24yNuyRpATxMN528gmk4GEJ3pOH8+/EEZLGfBpASe92L\n\tqw5HPhUVaIHy5dIZAAynQl2xIehgiFjXIpgenBMN7+AfwKkH9hyRqc7B6lO1QSna2Y\n\tEFJ34gvDU1mWuj/1J/xthVzCdiJeaneX7TYjGb4M=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 20 Mar 2020 23:04:35 +0200",
        "Message-Id": "<20200320210435.8876-2-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.24.1",
        "In-Reply-To": "<20200320210435.8876-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20200320210435.8876-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 2/2] libcamera: device_enumerator_udev:\n\tDon't add media device twice",
        "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>",
        "X-List-Received-Date": "Fri, 20 Mar 2020 21:04:45 -0000"
    },
    "content": "Commit 68daa9302f90 (\"libcamera: device_enumerator: Don't stop if one\ndevice fails\") introduced a bug in device enumeration. Previously, a\nmedia device would only be added when all its dependencies were present,\nas indicated by populateMediaDevice() returning 0. The commit changed\nthe logic to propagate the populateMediaDevice() return code up, but\nmistakenly added the media device to the enumerator even when\ndependencies were missing. This causes media devices enumerated with\nmissing dependencies to be added twice, once when enumerating the media\ndevice itself, and a second time when all the dependencies are found.\n\nFix it by deferring addition of the media device when dependencies are\nmissing, and add debug messages to track this process.\n\nFixes: 68daa9302f90 (\"libcamera: device_enumerator: Don't stop if one device fails\")\nReported-by: Andrey Konovalov <andrey.konovalov@linaro.org>\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/device_enumerator_udev.cpp | 10 ++++++++++\n 1 file changed, 10 insertions(+)",
    "diff": "diff --git a/src/libcamera/device_enumerator_udev.cpp b/src/libcamera/device_enumerator_udev.cpp\nindex 87638c59761c..e55350544feb 100644\n--- a/src/libcamera/device_enumerator_udev.cpp\n+++ b/src/libcamera/device_enumerator_udev.cpp\n@@ -90,6 +90,13 @@ int DeviceEnumeratorUdev::addUdevDevice(struct udev_device *dev)\n \t\t\treturn ret;\n \t\t}\n \n+\t\tif (ret) {\n+\t\t\tLOG(DeviceEnumerator, Debug)\n+\t\t\t\t<< \"Defer media device \" << media->deviceNode()\n+\t\t\t\t<< \" due to \" << ret << \" missing dependencies\";\n+\t\t\treturn 0;\n+\t\t}\n+\n \t\taddDevice(media);\n \t\treturn 0;\n \t}\n@@ -313,6 +320,9 @@ int DeviceEnumeratorUdev::addV4L2Device(dev_t devnum)\n \tdeps->deps_.erase(devnum);\n \n \tif (deps->deps_.empty()) {\n+\t\tLOG(DeviceEnumerator, Debug)\n+\t\t\t<< \"All dependencies for media device \"\n+\t\t\t<< deps->media_->deviceNode() << \" found\";\n \t\taddDevice(deps->media_);\n \t\tpending_.remove(*deps);\n \t}\n",
    "prefixes": [
        "libcamera-devel",
        "2/2"
    ]
}