{"id":2222835,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2222835/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260413203555.1990337-5-rs@ti.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.1/projects/18/?format=json","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},"msgid":"<20260413203555.1990337-5-rs@ti.com>","date":"2026-04-13T20:35:53","name":"[PATCHv3,4/6] efi_selftest_memory: check for duplicates first","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"da0f9363d32d580d85e2574334ebbd352fbde8ac","submitter":{"id":88727,"url":"http://patchwork.ozlabs.org/api/1.1/people/88727/?format=json","name":"Randolph Sapp","email":"rs@ti.com"},"delegate":{"id":68728,"url":"http://patchwork.ozlabs.org/api/1.1/users/68728/?format=json","username":"xypron","first_name":"Heinrich","last_name":"Schuchardt","email":"xypron.glpk@gmx.de"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260413203555.1990337-5-rs@ti.com/mbox/","series":[{"id":499752,"url":"http://patchwork.ozlabs.org/api/1.1/series/499752/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=499752","date":"2026-04-13T20:35:52","name":"various memory related fixups","version":1,"mbox":"http://patchwork.ozlabs.org/series/499752/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2222835/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2222835/checks/","tags":{},"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\tdkim=pass (1024-bit key;\n unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256\n header.s=selector1 header.b=t1E3pUY1;\n\tdkim-atps=neutral","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=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=ti.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=ti.com header.i=@ti.com header.b=\"t1E3pUY1\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=ti.com","phobos.denx.de; spf=pass smtp.mailfrom=rs@ti.com"],"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)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvfN45pVqz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 06:37:08 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id ADFA884222;\n\tMon, 13 Apr 2026 22:36:32 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 87C6884242; Mon, 13 Apr 2026 22:36:31 +0200 (CEST)","from DM5PR21CU001.outbound.protection.outlook.com\n (mail-centralusazlp170110009.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c111::9])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 8137184228\n for <u-boot@lists.denx.de>; Mon, 13 Apr 2026 22:36:29 +0200 (CEST)","from SJ0PR13CA0041.namprd13.prod.outlook.com (2603:10b6:a03:2c2::16)\n by CH0PR10MB5129.namprd10.prod.outlook.com (2603:10b6:610:d8::12)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.48; Mon, 13 Apr\n 2026 20:36:25 +0000","from SJ5PEPF000001F2.namprd05.prod.outlook.com\n (2603:10b6:a03:2c2:cafe::be) by SJ0PR13CA0041.outlook.office365.com\n (2603:10b6:a03:2c2::16) with Microsoft SMTP Server (version=TLS1_3,\n cipher=TLS_AES_256_GCM_SHA384) id 15.20.9769.47 via Frontend Transport; Mon,\n 13 Apr 2026 20:36:24 +0000","from flwvzet201.ext.ti.com (198.47.21.195) by\n SJ5PEPF000001F2.mail.protection.outlook.com (10.167.242.70) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.9769.17 via Frontend Transport; Mon, 13 Apr 2026 20:36:23 +0000","from DFLE211.ent.ti.com (10.64.6.69) by flwvzet201.ext.ti.com\n (10.248.192.32) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Mon, 13 Apr\n 2026 15:36:12 -0500","from DFLE210.ent.ti.com (10.64.6.68) by DFLE211.ent.ti.com\n (10.64.6.69) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Mon, 13 Apr\n 2026 15:36:12 -0500","from lelvem-mr06.itg.ti.com (10.180.75.8) by DFLE210.ent.ti.com\n (10.64.6.68) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend\n Transport; Mon, 13 Apr 2026 15:36:12 -0500","from rs-desk.dhcp.ti.com (rs-desk.dhcp.ti.com [128.247.81.39])\n by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 63DKaBse2729634;\n Mon, 13 Apr 2026 15:36:12 -0500"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,T_SPF_PERMERROR autolearn=no\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=T/j7O+E5t+mfuD3zpCnghXPln54ADoC4gh9/FdKSlpbuMwCXPkYP2CcIMA7nnL+54jt8z7r4R8dkiu/k8R2aAvysf80yJwQwKSu70df2kWPwxqkYkcyDzhzgU5eSwL6JsPgQwWQZRU1yhB8/CAiRFnKKg2MBRN5CPWk0QOWh2TaLUZWngkW1C6IPBAzOGvVsKx1+2gu9uB/JAtr9UHEj6jwMqNZC2aJyGldr4jSUmWYzy/vFAWzEnUersKYfbyJU2pqE2qY7il958eVcZxuBBtLPq86bjpDIYLJVaTmpzY9EIr4iba6cGNmILL+3KCcJh0Z0IzAVetGTevn4XejuIg==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=Eq+tB3bgbR8TKICMNQRm6vnQICrwF0l75XD9ToSuq+o=;\n b=rIgJ3s4zD9Ts1xV11AgHkEOEgffoFsx9oMRnEOnxxV5NblQvwxmtWIw0Bx1ug8eEZ7Z47d44iJZcHFDx1zzyRpZgEqG/seIR5yd2H/EQEivWia5kthMzUX+NEpWHJju9XmKE70MJ/Z/Eeq/qXCZIyoxiAu3XRYxuFlTG9MxkPBKQNiYS1HvNB4RLGduCkH3NBLahs1KiOsFgZRHcT9YyOtruDe/B490WXkhJlFPC/Exns0JL3B+Wk6aZg8/ZAU/tZO0WP8hCpVOHEnF/ymYfdZwbnu0HmscVXOJCPwi/gaJNCEIvzbPGx97wJAUta9cCcrlqaP3uRobDwn8EbRi6qA==","ARC-Authentication-Results":"i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 198.47.21.195) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=ti.com;\n dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com;\n dkim=none (message not signed); arc=none (0)","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=Eq+tB3bgbR8TKICMNQRm6vnQICrwF0l75XD9ToSuq+o=;\n b=t1E3pUY1y66nkER7buZ3bg31yKsjPydIwNstfBO38Sr0hrNA4PpfnvapKBpHH0W4z3zBTXSHEL9uTM3TdV+uWjW98Y+4FP4vt/1PeoKXaQEyY10aRUtJmYbwALcrReV7dVR8ahIi2n7Hjh8RPIf0La1cUsTXhC2r398tRqH7rws=","X-MS-Exchange-Authentication-Results":"spf=pass (sender IP is 198.47.21.195)\n smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;\n dmarc=pass\n action=none header.from=ti.com;","Received-SPF":"Pass (protection.outlook.com: domain of ti.com designates\n 198.47.21.195 as permitted sender) receiver=protection.outlook.com;\n client-ip=198.47.21.195; helo=flwvzet201.ext.ti.com; pr=C","From":"<rs@ti.com>","To":"<robertcnelson@gmail.com>, <ayush@beagleboard.org>,\n <Erik.Welsh@octavosystems.com>, <anshuld@ti.com>, <bb@ti.com>,\n <trini@konsulko.com>, <afd@ti.com>, <xypron.glpk@gmx.de>,\n <ilias.apalodimas@linaro.org>","CC":"<u-boot@lists.denx.de>","Subject":"[PATCHv3 4/6] efi_selftest_memory: check for duplicates first","Date":"Mon, 13 Apr 2026 15:35:53 -0500","Message-ID":"<20260413203555.1990337-5-rs@ti.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260413203555.1990337-1-rs@ti.com>","References":"<20260413203555.1990337-1-rs@ti.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Content-Type":"text/plain","X-C2ProcessedOrg":"333ef613-75bf-4e12-a4b1-8e3623f5dcea","X-EOPAttributedMessage":"0","X-MS-PublicTrafficType":"Email","X-MS-TrafficTypeDiagnostic":"SJ5PEPF000001F2:EE_|CH0PR10MB5129:EE_","X-MS-Office365-Filtering-Correlation-Id":"66e10ed5-4dd3-4d50-f62e-08de999c541e","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"BCL:0;\n ARA:13230040|82310400026|1800799024|376014|36860700016|18002099003|56012099003|22082099003;","X-Microsoft-Antispam-Message-Info":"\n 0R0Wa1vZ5Cle/BdNrcFGKNK6EYdMsh/TNyQNT+rItc/9hFSRCRnybmEnFW8UvBW7Z9oUCDFMHrhjOE4bgQZSUgniKMxwVrsY21xzIBpseO8zSn/Ph7eeC9HQjuT7zBZAMHU3q2kz/YgyiC8FPIhPKoQ4ZYTkKyAqDhanixbLQZf1xtxqGnIak9jvOXuVJz8OpdZahZIKf+I+Sp+xooG2J/6Wjy6hiykTSAMHygrEnlqLe2Y0LJQoMOv8+JrjpjQkMb1tV7yMvlnHWJjDnALs+PnQxjYABGtRXBpF5343wehsWe6dJ/fMhUpLns7FKjDkTuLb2BWHXfOIj0Vy/z3yI3W1yD+cjUHvjgarNPSSEMYeL4zFpW6h5NLrOLtxs0byV1b2YKM6uX4JNk481hAy9NNT0ZLen3rjM0/iglxwY2tHGLndIsOzRA6ij06P1MwhyVryK+4YwVRFhZSnzwUqWS/Zy4CehypaKDAM7kWd7HOYtGM//DCBFuj4BQS/ZvjK8xUb4P5Ojtj1gIqIZIIMg8dLnKpOdHJysdiSBfwHt6U+mW0YaidGQuFvQXGER6b07om7UZfy6okDetFRYURgT0gkA2FrE6fTQStRLB3KaAc9w5Vlvd5dkF0bC1BHKjYIO0LX3PsivREvi/xkqewxdMma4KZ437uFHNEWDJShBUBUeSIOmwk7gdnrgYYvFEEuM/FmmpRJ5jvOlG+KW2S7Us6feVAGAHw7QZPkq0UXnDVXOQj7OTP+ifsMs0ik8tyMnl6MMmZltJ4YeQ+HLjAAbQ==","X-Forefront-Antispam-Report":"CIP:198.47.21.195; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:flwvzet201.ext.ti.com; PTR:ErrorRetry; CAT:NONE;\n SFS:(13230040)(82310400026)(1800799024)(376014)(36860700016)(18002099003)(56012099003)(22082099003);\n DIR:OUT; SFP:1101;","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"1","X-MS-Exchange-AntiSpam-MessageData-0":"\n glOJLQfCg5bg+8jkL8h9esAyKuNqWmcev5h1Rb62/PkLNi2pNuGx5pBqa2ECwQUCrQlsI/49d8RYEuYQQ/mzNMvfTWILPBIQypiZB7/21xzbeVM+Ne1u4w3XMVJbIYIpejXBb70RKeqJEnx669eEpM6i45gtR2h/B8uEb/n9HNMwXYMmTtyeBgzgtoMC9xjgzl/oBP1MV/UU+bWgKHb8DPq1pZGKs7umDdhuWBna7sNpAJSznG90C+JMJWqnVPfTQRCEY3wzVPV9vcbwYiWqcyIIwUdERnLLAvn/jdz7C0b/IwPi05BYi2olhbqwl0rWQkjisPbh0z0Hew0lc9vYWou4ggwcQmOSRCV+29kTtpKm0rMWoboa2FrBbu7TZPxK1rhEuQHEZvg5C+4LMc3MxPtUJqH1AjqzzV9lxCgJb+K+55X42TW0EIgoLJK2icep","X-OriginatorOrg":"ti.com","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"13 Apr 2026 20:36:23.7125 (UTC)","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n 66e10ed5-4dd3-4d50-f62e-08de999c541e","X-MS-Exchange-CrossTenant-Id":"e5b49634-450b-4709-8abb-1e2b19b982b7","X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp":"\n TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7; Ip=[198.47.21.195];\n Helo=[flwvzet201.ext.ti.com]","X-MS-Exchange-CrossTenant-AuthSource":"\n SJ5PEPF000001F2.namprd05.prod.outlook.com","X-MS-Exchange-CrossTenant-AuthAs":"Anonymous","X-MS-Exchange-CrossTenant-FromEntityHeader":"HybridOnPrem","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"CH0PR10MB5129","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":"From: Randolph Sapp <rs@ti.com>\n\nCheck for duplicate memory mappings before reporting any incorrect\nattributes. Could be that second allocation has the correct type while\nthe first doesn't. Knowing there is a duplicate in this scenario is\nmore helpful than just reporting the first mismatch.\n\nSigned-off-by: Randolph Sapp <rs@ti.com>\n---\n lib/efi_selftest/efi_selftest_memory.c | 21 ++++++++++-----------\n 1 file changed, 10 insertions(+), 11 deletions(-)","diff":"diff --git a/lib/efi_selftest/efi_selftest_memory.c b/lib/efi_selftest/efi_selftest_memory.c\nindex 4d32a280061..7320964c129 100644\n--- a/lib/efi_selftest/efi_selftest_memory.c\n+++ b/lib/efi_selftest/efi_selftest_memory.c\n@@ -60,7 +60,7 @@ static int find_in_memory_map(efi_uintn_t map_size,\n \t\t\t      u64 addr, int memory_type)\n {\n \tefi_uintn_t i;\n-\tbool found = false;\n+\tstruct efi_mem_desc *match = NULL;\n \n \tfor (i = 0; map_size; ++i, map_size -= desc_size) {\n \t\tstruct efi_mem_desc *entry = &memory_map[i];\n@@ -72,24 +72,23 @@ static int find_in_memory_map(efi_uintn_t map_size,\n \n \t\tif (addr >= entry->physical_start &&\n \t\t    addr < entry->physical_start +\n-\t\t\t    (entry->num_pages << EFI_PAGE_SHIFT)) {\n-\t\t\tif (found) {\n+\t\t\t\t    (entry->num_pages << EFI_PAGE_SHIFT)) {\n+\t\t\tif (match) {\n \t\t\t\tefi_st_error(\"Duplicate memory map entry\\n\");\n \t\t\t\treturn EFI_ST_FAILURE;\n \t\t\t}\n-\t\t\tfound = true;\n-\t\t\tif (memory_type != entry->type) {\n-\t\t\t\tefi_st_error\n-\t\t\t\t\t(\"Wrong memory type %d, expected %d\\n\",\n-\t\t\t\t\t entry->type, memory_type);\n-\t\t\t\treturn EFI_ST_FAILURE;\n-\t\t\t}\n+\t\t\tmatch = entry;\n \t\t}\n \t}\n-\tif (!found) {\n+\tif (!match) {\n \t\tefi_st_error(\"Missing memory map entry\\n\");\n \t\treturn EFI_ST_FAILURE;\n \t}\n+\tif (memory_type != match->type) {\n+\t\tefi_st_error(\"Wrong memory type %d, expected %d\\n\", match->type,\n+\t\t\t     memory_type);\n+\t\treturn EFI_ST_FAILURE;\n+\t}\n \treturn EFI_ST_SUCCESS;\n }\n \n","prefixes":["PATCHv3","4/6"]}