From patchwork Fri Jul 12 09:56:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13731558 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE77FC2BD09 for ; Fri, 12 Jul 2024 09:57:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=D/bIWHweZseYmKh11oTyydP08zCUd2gjebeBMQ6AUW8=; b=1KdJPuvjiqiBhhf4J7SF8e1PF4 3zDD3YCVX1GiDo7zcBrPL0Acad0ccT+kt3h7c5Mm4BDxgBQ2wnQ2tc2/2/hvSJ2AvKxAkgY7lUQqa pNvKjrLk/K2hMC2z2P33TZIo2sIQ25KwCyIgKo6EB+l7gFw11LuR6eejngcJJwnKDx3YwvDizPTmE +sm0AtfZ1bN9KpIgk3TgWMHrvpMWIs2ZAOsBOlRXIFt+2px0mcyI32WT0CtG9N1O4c66uRxAhgXfS UtHneXSxb4vcRMVII7vy/gSGK2sOoGmO+FgKK4KxShZlwD9iZaeFD6W/RzK7MnnEc+nXSYst314N2 BCAACZ4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSD27-0000000HCxy-2gs3; Fri, 12 Jul 2024 09:57:43 +0000 Received: from mail-northeuropeazlp170130004.outbound.protection.outlook.com ([2a01:111:f403:c200::4] helo=DUZPR83CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSD1p-0000000HCrp-3Aae for linux-arm-kernel@lists.infradead.org; Fri, 12 Jul 2024 09:57:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jwm4XMe5WiZ7xl4FV5oWdNFSEHIOEzrg3mZC9RQxXq6hYcPcVxXbZFzGJBeqTweCo9QCOJkke/eYQa+F5+0TajvNwAafClVirzdxVOVTYyxuugUmxF+n7Bnglk6SeEMkb0OAtsUKEs/+MBKPos5DUtGBpoLdToc+K65CbMaAM1uGr3kuHji3+QPpdejKZloV5iCApPzev5WPPecAlXHcVJLMaVC7qy9T3VXyegezQzsth22Fs2dD3CCYUpDyleyPfr/yaQr8szGvE3B8BwoAEEa5a4Vnr0XtNrvH30UoEYRfj3qQ8GXFFpFju6PY+4yGApkGbuUMhdsAdUuHLSMPyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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; bh=D/bIWHweZseYmKh11oTyydP08zCUd2gjebeBMQ6AUW8=; b=CoFJUlfo5fjuvem1lDcLgz0sq6c4Cpy9euYlAXFqCobx/uiatFE6dJMdPQlMZNWFdUQ+VdSadvVLV2M3ecOygw+nf4fIVGgZogv7G9Psn7QzRCBHxZZeSnlXgpkErbjCvaMy3ab9/vB2HLl2NGHOQyRkZGtXhPa9kpvxe3cICBWJ8USYQsEfB2M53NRDtBbNnTxs0A3j1p2588vxsVk5yiwP+8+08ES8i0KsCInvF3UooOBIj4IQ+9/HNFW1N0HXJJVGe5dn8zhR+h9QiwsNuhYjhKJatcLson3oY4lF8/EHjWsj+Xy1OsRhccUlZoduZEObscTM0aVhW9fwrUBc3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D/bIWHweZseYmKh11oTyydP08zCUd2gjebeBMQ6AUW8=; b=XHI3vHKq6W9Zsr7TT8GaCAtjwSSF+8JWO7ukjswd1sZAfhc8TGM+AYuLLp/ngkvcn1RIklreITCB8gKShSuq0ZU48EkwGTaRuiDn7YDqu+FDFOxQQi0il/8UgyEUH7z1Y8V4sG3Uphwgq6FQYL2bpoRHcKW30StCaN9/sh+QGCU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB7PR04MB4555.eurprd04.prod.outlook.com (2603:10a6:5:33::26) by AM9PR04MB8340.eurprd04.prod.outlook.com (2603:10a6:20b:3e0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.22; Fri, 12 Jul 2024 09:57:13 +0000 Received: from DB7PR04MB4555.eurprd04.prod.outlook.com ([fe80::86ff:def:c14a:a72a]) by DB7PR04MB4555.eurprd04.prod.outlook.com ([fe80::86ff:def:c14a:a72a%4]) with mapi id 15.20.7741.017; Fri, 12 Jul 2024 09:57:12 +0000 From: Vladimir Oltean To: linux-arm-kernel@lists.infradead.org Cc: Rob Herring , Herbert Xu , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 1/2] soc: fsl: qbman: delete bogus device tree fixup in qbman_init_private_mem() Date: Fri, 12 Jul 2024 12:56:57 +0300 Message-Id: <20240712095658.577186-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: VI1P195CA0050.EURP195.PROD.OUTLOOK.COM (2603:10a6:802:5a::39) To DB7PR04MB4555.eurprd04.prod.outlook.com (2603:10a6:5:33::26) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR04MB4555:EE_|AM9PR04MB8340:EE_ X-MS-Office365-Filtering-Correlation-Id: 081dc07b-45e5-46c9-80d6-08dca25900be X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|366016|376014|38350700014; X-Microsoft-Antispam-Message-Info: isW492uIfzAXF4VpacXsTEy07KafXD2E+9qFZ8eytrzCQEPQ+jQy8b/jRioZ7pzowf/7EDpFyOJ6WxCF8bWCfZ5Q0ji4kf5YeL2okzOLOL7yvYA7vuDjUAk2jRPeLBi4pVI1qOS3MTtc7L0eK0uMbby21S7UUdeSOvpTE3WVrEXITeZolbEqM8WOk2biDfBdX5dUUlk9QK4x0Raju/XXQvd+O9/BdspQKPdi35l1s8FZcLfHFh40uVD8HXnVXf7W73/wOOJixmTbcA1XulB4nNsBo0woW71aiom3akO6Uw63eMIZHhBsG+zPvV+NoZFuTNRYEfCYXY7fIKHBrACST5SaN8nlZ00VZYExDfSvNd1Lxer8luNKrD52vxRcIZH2ygvEKT0MbLOU37OitLMTDzKQ2uHTMHi5VD6lwL5epDswQ9jo04bJc7pE+6MPtaiV5HT6/qOecBeV4KwJk6/ppi3PrPtUzyYIjFLCiW6HAll+6yyAdS3VSYY133+2E7OAuPohh3860dpQaCztTuTrDPzEL2ITfDyQgvFOSZb0w5kO3JeAUTu6Tx4WUF7gUabxMOFXHft8MN0I6COK7pb+d/uYYqBrgRR+hyoxLdRdC79l6eb6+ZVZ6naR9vdQcvcPk3VLHpK2aW52LOQmozwzrqKYav++PA1BgdPTjnwjKC1KpSYeuIHO3PyXl0Sh7Ua0UrDuOXuONuqEYaPLCcG2RMHTvNJT2WX7hUshVOu5arIPyHJf0+sWYL6DklsE4GDCX8dlLmmjtxZDDnwn3EXkgicrY+lQ2E/kumAw8mh2BDAqX2Nu/ssdCsaBLh44f/nCQeLgLvFjiFZCiTmkwDPPS9lXFrW3l6Iw+gnIOWvzYC0FdiBIdqi7qt91LTy4AXs1vWvEULoCbjnjTuV3d907mrCjTt6ZpZcYuXupJFCYLYIjgwAzfyED9OX5cX0NGzOlnBCX8ljOpqz2YInsGUYNVIPFx6qQE7kB9gTi8401EkQFs8Xc7bhIjL2t/9/yu60fiAuVZoPjFyYec5fazvH+waRuoSFf/ACWXOFEZzjB0H7hPy3nuYi3cXxzcRtz5TkaTvxKryQ2AHGrOO8tEUWAnTMtxNXba7aLWzivy8yanvygkGMuMK3cCvP6hwOPQy78RMhRh2bFXhkWP6HtkPx7x1sMBNKLo4ty9akrxxIC9lh5wyrg1ujZxrDjrhCNcQpQCSdcXG2xZXOtQMFR89LNmX5f2JNd93qYgUqODGcA4TcS6I0EErfTlTxllNzATtvct63TRLdw/zh6IrzFTQCx3U4J5AKoITSyTqOHXYTJtERGxrax35UIjaHRJkpACNlaarHWwJbGYBI3ykhD7yvm4k6/RjtGr2Qz6t1EAA0JKuS0Ne/1jL/nJIURRP0X9ntpoaP2eUByTkwZdt5bYJqTVQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR04MB4555.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(1800799024)(366016)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: J2BNNdDdDV/a5w+b0JDHFpfsj3Ss/AL56lQaUB0HJqOiiKIjgwjnthGKuEDRBKFJRvIG+eBiBd4GY+twjQd5VLSLjn0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8YcECSz+u6f60co4uqE01PaFgT7068RPTyyeqxobrX+BtpvBxkea8oK043gL4G7wwa4C1bpHHVqgNYxBAm4n7GZWC2s6BwNdKJlZtCWf7XsceIMGddE9osvst61wzokruUtiLg4rT8qPvYWnlqNLCtvwk9Zad+robx3VkSsP5cJrKx/OztI5VeQMQj0He26AgoXZT0Ms+2HC+omrrBkyNtZAgw3Rbb23GagZdYR5a/+5N40ogd+8SQhmjlI2b2dAjpggEcMiGbYHBaskWA03YTPXN9I2tiQx9fr7CoNoFI+K/sQNdtyi5xTvg9I1Z6FNW0IJvS/2C09G2D6gKiBKH33gkxJG1ORCMK3Z74yrNAJVnq3N/Zo8t6tTvzwu4r2qF0DWDprfpmQorUwFzCH4j/F3+mL11EB8ZqZRWS0zrAD9HA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 081dc07b-45e5-46c9-80d6-08dca25900be X-MS-Exchange-CrossTenant-AuthSource: DB7PR04MB4555.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2024 09:57:12.9473 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eJq0T69ZqtLe8AhrvWEcYezkZvgKOpfEgaNEo2tBd69fNox5ZwTYlAY/uuIn94FoZGY+bP3eMXSFq4pWzs7tkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8340 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240712_025725_821010_49B4420F X-CRM114-Status: GOOD ( 15.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is effectively a revert of commit 6ea4c0fe4570 ("soc/fsl/qbman: Update device tree with reserved memory"). What that commit intended to do: Fix up the device tree that is passed to a subsequent kexec-loaded kernel, so that the reserved-memory nodes have the same base addresses as the currently running kernel. What that commit actually does: Fix up the running device tree, which has no effect whatsoever upon the device tree passed to the next kernel. I would have refrained from making this kind of non-bugfix change in stable kernels, but qbman_init_private_mem() grossly misrepresents what this function does, and for an actual upcoming bug fix, it needs to be refactored. There is no place for the bogus code afterwards, so it needs to go as part of that, sadly. Cc: Signed-off-by: Vladimir Oltean --- drivers/soc/fsl/qbman/dpaa_sys.c | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/drivers/soc/fsl/qbman/dpaa_sys.c b/drivers/soc/fsl/qbman/dpaa_sys.c index e1d7b79cc450..b1cee145cbd7 100644 --- a/drivers/soc/fsl/qbman/dpaa_sys.c +++ b/drivers/soc/fsl/qbman/dpaa_sys.c @@ -39,8 +39,6 @@ int qbman_init_private_mem(struct device *dev, int idx, const char *compat, { struct device_node *mem_node; struct reserved_mem *rmem; - int err; - __be32 *res_array; mem_node = of_parse_phandle(dev->of_node, "memory-region", idx); if (!mem_node) { @@ -60,34 +58,5 @@ int qbman_init_private_mem(struct device *dev, int idx, const char *compat, *addr = rmem->base; *size = rmem->size; - /* - * Check if the reg property exists - if not insert the node - * so upon kexec() the same memory region address will be preserved. - * This is needed because QBMan HW does not allow the base address/ - * size to be modified once set. - */ - if (!of_property_present(mem_node, "reg")) { - struct property *prop; - - prop = devm_kzalloc(dev, sizeof(*prop), GFP_KERNEL); - if (!prop) - return -ENOMEM; - prop->value = res_array = devm_kzalloc(dev, sizeof(__be32) * 4, - GFP_KERNEL); - if (!prop->value) - return -ENOMEM; - res_array[0] = cpu_to_be32(upper_32_bits(*addr)); - res_array[1] = cpu_to_be32(lower_32_bits(*addr)); - res_array[2] = cpu_to_be32(upper_32_bits(*size)); - res_array[3] = cpu_to_be32(lower_32_bits(*size)); - prop->length = sizeof(__be32) * 4; - prop->name = devm_kstrdup(dev, "reg", GFP_KERNEL); - if (!prop->name) - return -ENOMEM; - err = of_add_property(mem_node, prop); - if (err) - return err; - } - return 0; }