From patchwork Sun Aug 25 18:05:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13776860 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 EAA72C5320E for ; Sun, 25 Aug 2024 18:07:36 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VYpIfMLevBxY0BufVpZdLlZOu4ayBivVHqKaTZPujng=; b=bjHtzeo0cwy59AQRx0qUkDPRu3 0q7s50HQAjcUPXs3GJX9StXJ+LtICGavMTfSIblL5tEUlSssWve3fGbJoirbgj8WXrM64ZJ2wmnhS 0vxsqCDaJf1wVCORbWL7ikdaQsh383ETgk6iTjqtCeAg7X5AnNz+G0NOvBgXA6021T8QCptibXHAx gFz+X2XdPojJBVTyN33oWwH/D6/KfaTRTdVejvb2Z2O/FAPHPpg4/Fmtx0nzX0NVhkWX++P8Q+V4h uuTI/CHLqpq+3Lgd5N6xcoJNu/ACR7Dw+KFoAO7VbljVzva+9jaZKpXtJs/MjJCh73Ddweik4jFnu Rgqn8lvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siHeA-00000004m6C-4BHv; Sun, 25 Aug 2024 18:07:27 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siHcf-00000004lja-2chF for linux-arm-kernel@lists.infradead.org; Sun, 25 Aug 2024 18:05:55 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42808a69a93so5553855e9.3 for ; Sun, 25 Aug 2024 11:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724609151; x=1725213951; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=VYpIfMLevBxY0BufVpZdLlZOu4ayBivVHqKaTZPujng=; b=KjMdNtvMIYUlWfXtjh5RLxC/uwtP/TCNIJYjBP6htqs/vJTCqdjq8MFcAk/drA5G5J iIxUOtQ8V/TNCteJfpZe6bCjv4J6uFSiLn0NcSKX2z8DylNbR/FIrWM92TUmW5nr1tf+ NYMhkJFoc3fEwA/KJUPRq1EmUcX51KCP6uLKiecRPzod2eQPqHBjBYDTtC3Yr+YVS3JW TW7yiX1avsYV/xL3NhMPHUEG1NOExyZmkgs2CsbmJ4D5ZduwcqS6oI9wPsTzBMe9ylAk 1cjUHPbMnnvF3RdsDRmhpZSN6xoQcrDr2RMjjuZL/0gYaR2PhXmJHdzBDsnHmxF0NTAS 4WWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724609151; x=1725213951; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VYpIfMLevBxY0BufVpZdLlZOu4ayBivVHqKaTZPujng=; b=ep6tCVLm8CoG7QZv9btOWw9TECuu3NXqeyGatFG0rFSQHIuyYP5RnIz+EmjsxfZtbg XOFkMErcAdDts7IXQFVdedRCYxahVOAJkkocUNtX1Th8hlVUNu6jeCMIRxKboxtVf85I RIDGIkfQvg6dJxiivnfHn5AwmoTKZJlWqxwOCpHw1GH//MbXLkspfN2PQi1vmehgMqHS KVFKJEESbl9K+n4hP4AyS2VZawub1m2bobos7Ev05pnqmxR3kgK0gAAaHfyH5W+xoLtR 277kOY3QgBg5npFJ4guYIYMxcGQCF/MfDtKxGT5vsM7sla1GrAU8xehcljSs2U7TyrG+ ew+g== X-Gm-Message-State: AOJu0YxT1NCwiG1KBNhroF5rqR5/wwI4mv/nELFdY2UdnZLdqv5FvmyB 9UEpEgWIrX5vQKMC+9vgzVz0C/xFNmS078hq//nfMjlH3020l+9na2Z/KGMRGMs= X-Google-Smtp-Source: AGHT+IGoA/Rn3FHpEkZNqq0MHOX/MSoH9qsr9KuvzwqRF1RAbel/snzk7XWVAhvi01a5m+hc/xV1Qg== X-Received: by 2002:a5d:59a9:0:b0:36b:36aa:a14e with SMTP id ffacd0b85a97d-373118d1d2fmr3488407f8f.8.1724609151554; Sun, 25 Aug 2024 11:05:51 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37311dca113sm6438736f8f.16.2024.08.25.11.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 11:05:50 -0700 (PDT) From: Krzysztof Kozlowski Date: Sun, 25 Aug 2024 20:05:22 +0200 Subject: [PATCH 1/4] soc: versatile: integrator: fix OF node leak in probe() error path MIME-Version: 1.0 Message-Id: <20240825-soc-dev-fixes-v1-1-ff4b35abed83@linaro.org> References: <20240825-soc-dev-fixes-v1-0-ff4b35abed83@linaro.org> In-Reply-To: <20240825-soc-dev-fixes-v1-0-ff4b35abed83@linaro.org> To: Linus Walleij , Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=798; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=LIZtMc9nHoVSkfFptUxs0Y+Ob0r38B/hMi0Yhl8M4mY=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmy3J3NpIXoshBZUGa2xvTz937PSCt1g8bClII7 Gypds9E0ceJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZstydwAKCRDBN2bmhouD 15J4D/sFI2Pwlgu5DaqVgnr27xueYqFfMd5lL4vwH2xoYNLT2//yN0INBwq03sGZAYd816ZG9Nb +3VPV2x03TUVQOYCPU1iMGpnepzP5ReVw/e+zT3lOpcZVN6sM4FUfgSbdUiPhLxYKdBnJVNfbOv aZcCWbTtKWefPVwHsV9hxmIPRBmV1RAjJxylzEDl7jcDju1moiDueV3LZie18q+A6GvjYPMzoGV BAgxnBi7mHkLQuF2rKnP5/xUgGFY5h+79ahsMQHiiCJspOTU2GQQZv0hHuWsEy+yqsuPJTwzNG/ HlPTz0ulAkdSyLCV7DwNVUnv7/rrt53x0wFzL1vNhRE1YfLazkPQCVS0nguJrr76GAcaOOQzSe9 ynF7BeTtJehayCDlUG4LEJWuAMT+v+UO9oE2rTqzIKlpDqdxXZQjHaPy116AMZAeTQmrh4NBsli kxJ5HqW+BHH22T8OOv1q3wE8N/9RMPdCEegGKkPbyu+6xe00WPM4/bXOQXasfrUcwF478KRbuIJ Q9XstIkj7EiqAA+JdxELQ+oYjhyAiiEnt43LHJUH5Td0uE9WYdxJqV8oEBsBFCROzNVesb7Rv3T n+5kJj6eNtVY/Lgi/Wx/7S1ZomQYAYtNsUTmpTeDZv5r1ko3dR8I6Y0dG4bREtpgIydIvvkNCkn 50OkEyWy90ezCMg== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240825_110553_767569_944440DE X-CRM114-Status: GOOD ( 10.87 ) 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 Driver is leaking OF node reference obtained from of_find_matching_node(). Fixes: f956a785a282 ("soc: move SoC driver for the ARM Integrator") Cc: Signed-off-by: Krzysztof Kozlowski --- drivers/soc/versatile/soc-integrator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/versatile/soc-integrator.c b/drivers/soc/versatile/soc-integrator.c index bab4ad87aa75..d5099a3386b4 100644 --- a/drivers/soc/versatile/soc-integrator.c +++ b/drivers/soc/versatile/soc-integrator.c @@ -113,6 +113,7 @@ static int __init integrator_soc_init(void) return -ENODEV; syscon_regmap = syscon_node_to_regmap(np); + of_node_put(np); if (IS_ERR(syscon_regmap)) return PTR_ERR(syscon_regmap); From patchwork Sun Aug 25 18:05:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13776864 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 9B906C5320E for ; Sun, 25 Aug 2024 18:08:24 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Px08219UxWUPNfHVakRaFgAR3n14DqjgVtECE2v++7A=; b=cnoNJ9R9wTqNtCBnVcxke5xps+ 2qC9dTDS8+pQ6YUxzKaSUO4zu+/iti0Vttpr27b/5GS9sjo8aMWBIKJyFGrAdNoV6eqxx+MtdwFyU MHiW1O02MV6JwPJCDvA5MrvQ2T3xU/nMyOd6zbXIuv/nJ/cJEYwfmePVlmqCDr/ZNs5j0VVShW9O+ F/wE7pTounR2RiS4Lb3GFIKWwClkHDK3TIa+uMMQd4PC96TXeDsjtWtZCjQHhk/GpnBTEBS8HHYoy AXX9/F43Pyvd19gOxDJaJ0NogSCaooeeSfVY85XU6Ou27FCw0BDde9/GlglmdncYA7cfZPIr2wEzX 7bv98sOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siHet-00000004mED-3NMd; Sun, 25 Aug 2024 18:08:12 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siHch-00000004ljd-06CT for linux-arm-kernel@lists.infradead.org; Sun, 25 Aug 2024 18:05:56 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-42808a69a93so5553905e9.3 for ; Sun, 25 Aug 2024 11:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724609153; x=1725213953; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Px08219UxWUPNfHVakRaFgAR3n14DqjgVtECE2v++7A=; b=NKYV/Ix0ypqXXY9rasmj73kl4JkACdUxe+s2tZEN/QLR6sOn0jtujAVYqE9I0nZQ37 3/OLjFOX8d6ZTAKOq2ire5j6S2Hctey8drHp2YWBjnjlr57Off9i3ezwbIazTXy+V9Ml 0I7k/XaGrxBolQ0dejuBUdxzW4KKzHc++oCWToZU0GkrufpA9GYAMmcFbpJesR/IUPHH 6GORt5eI2+zjNXn7EX9cIwU/Hua8JuJipLLJkcWgDwBIGGkSzHquCxmqUrvvyHNZU3L3 Vmo7IiXzFnw/jiBJm7sY0RqsTvSffcYwxkjRuuDO4LpRvtBRIaA8Z8J/ta6CkcXN/SKr Ktlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724609153; x=1725213953; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Px08219UxWUPNfHVakRaFgAR3n14DqjgVtECE2v++7A=; b=ezQhOFtXOrinULg1psktYFyciLi38VggqrII6Yr9JkMuh1Fr9u4GxsjidRo3HaTc+D 8Qvp2mLUyaLmZIblTfpfSFPHIUqn1I1slSYJNM7no2t02eaRyK93Vgyq3sb8Py0lGIn2 YsE9S27lZ5ZWrTeCpo513mCFpVmIhSUFNutdJ2mo1EcSGvA/ND0a47TKV8NByjfpcifD iwgA7yU4bSYi2qvhcQ4/kfXEhnoGX+wSvVXjhG8hrjifl28jUwRMVa5OkC2sJKr5GWMz k952TCOX52E0SrHXi7Mf4JCLYq72WT3iAkrDM1UEUkBu2eUn0J6RiybnRLAF5dDEFRY2 iOtw== X-Gm-Message-State: AOJu0YylrKoFfWmN5sVW/O+BnjJsLsB36ydrSIYZ1itmxoUSSOfx/Q1+ aQ7vyEsRJdOtUiwYjJYVzHUpIR/lYrGXqjk93uO21qSiylxixpLzPhKqYuuBuDc= X-Google-Smtp-Source: AGHT+IEOT5xXGWdNvfDQNreEbDE2fIXiA0ElOhNl5gFlct2Dn9/6HfSzNT2X0our2pg7Lo1zqVH7UQ== X-Received: by 2002:a05:600c:1c0a:b0:427:9f6c:e4bc with SMTP id 5b1f17b1804b1-42acca11e53mr35783945e9.5.1724609153076; Sun, 25 Aug 2024 11:05:53 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37311dca113sm6438736f8f.16.2024.08.25.11.05.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 11:05:52 -0700 (PDT) From: Krzysztof Kozlowski Date: Sun, 25 Aug 2024 20:05:23 +0200 Subject: [PATCH 2/4] soc: versatile: realview: fix memory leak during device remove MIME-Version: 1.0 Message-Id: <20240825-soc-dev-fixes-v1-2-ff4b35abed83@linaro.org> References: <20240825-soc-dev-fixes-v1-0-ff4b35abed83@linaro.org> In-Reply-To: <20240825-soc-dev-fixes-v1-0-ff4b35abed83@linaro.org> To: Linus Walleij , Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1269; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=gLo2MRTXsFeq02SUdCwpMzugi/rrrP2OWGn4eDr68Nw=; b=kA0DAAoBwTdm5oaLg9cByyZiAGbLcnij66rKNDQtIYEA/f6SQA3a3xsRiZyOLMcWfi9UNQw/9 IkCMwQAAQoAHRYhBN3SYig9ERsjO264qME3ZuaGi4PXBQJmy3J4AAoJEME3ZuaGi4PXiaQP/36v XoZ+079iF8+XR3eHzzetL+GsXUMs7VVe8Z7VjIbpeWaqoiaCGLFlFjDWVQjJu9/wxPW5Fpi5qZb 93SXGFvnX4nL8n3TyKzCWnLRN0zV0LUQmo87Wf27T/JpSD9FJ37vChPQKdxPrXL7ZlgwVgyKHNM i2CG6bt17mvx8xux1a+QBTmlHFzpYVBkRwHtwQLyp3S88q/QPseosKB841/9b0bSrO6gRwVp0j6 gDd4xYZyEY2yCKRvJ/9ROQhXsrwMTcYPRC6VhLh1UwG5Uyk35e4+KE0dzO72fL7/F4vfN6m/Z7L VtenMv7B6zRR5beMseJKW/GlWMQiNfj+oSASbrZCd0qGOng0uPPnf1wiUXFrU/QuN68Bab4N5uM PLNkSTRj+E+C431Ol6ymM0NyZ9DdrctHOeWzSn6F0PVj5uAeBycy2wHLC1e8pquVOkui/mD7xc5 vgu3dTsKu0OmPjuwmwM7kGph8hUO8UwDd/DvkQbcg8WOvloa0j7vBdlipbvf2WAliJKDb8vFTq6 +9fwT554fce37h+MT0+6JtNUIY6u8pOU1kQ7nDfmPrSsW2zVOTO2aznPzkpOnXjnHR4LqqiJuWZ qM/caLV1KxpuT5QT9Nmff3YG8NAwvcoGjsWgkV4IwoJd4TCEOyDJ+PlEn5iGemw1xx0WMCwf4LC 4sdAw X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240825_110555_102503_9E831D1B X-CRM114-Status: GOOD ( 12.21 ) 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 If device is unbound, the memory allocated for soc_dev_attr should be freed to prevent leaks. Signed-off-by: Krzysztof Kozlowski --- drivers/soc/versatile/soc-realview.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/soc/versatile/soc-realview.c b/drivers/soc/versatile/soc-realview.c index c6876d232d8f..d304ee69287a 100644 --- a/drivers/soc/versatile/soc-realview.c +++ b/drivers/soc/versatile/soc-realview.c @@ -93,7 +93,7 @@ static int realview_soc_probe(struct platform_device *pdev) if (IS_ERR(syscon_regmap)) return PTR_ERR(syscon_regmap); - soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); + soc_dev_attr = devm_kzalloc(&pdev->dev, sizeof(*soc_dev_attr), GFP_KERNEL); if (!soc_dev_attr) return -ENOMEM; @@ -106,10 +106,9 @@ static int realview_soc_probe(struct platform_device *pdev) soc_dev_attr->family = "Versatile"; soc_dev_attr->custom_attr_group = realview_groups[0]; soc_dev = soc_device_register(soc_dev_attr); - if (IS_ERR(soc_dev)) { - kfree(soc_dev_attr); + if (IS_ERR(soc_dev)) return -ENODEV; - } + ret = regmap_read(syscon_regmap, REALVIEW_SYS_ID_OFFSET, &realview_coreid); if (ret) From patchwork Sun Aug 25 18:05:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13776865 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 6205DC5321E for ; Sun, 25 Aug 2024 18:09:05 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=raI+n19QFN29zfHeug6+Nnj8oFJHmaYrdY3f2jmORFs=; b=IbHsJ8uO37vs0N/A7ZL94lDIRZ 9HB1jJhmt3tofFeOYOImlxufw1TYGvSFbdnImBz+TBDfS6vT8sP8Sf4BbiHccJHvvAjlp9/pI+8bz fU4TMya4Uk+dzMAZh2txbqtjExFvtIMYjSU1cV1eQGIYlZH9haz80v2A5/cqBaqex78M9xm8w3/Z9 Q6Rz00VOK6r9r6UHvQqInJw5Wrq3qXQGWSWNeh0V2IkDMgskcq5p6B5GqYc2cvsxp+dTj2nFTJca3 lI2ya1j84+s977+edmQCB0EYrir+L8+7ScvOepNnmmwYtc1LuhuYJMgd1t/A4wKjYNAibZ+t1XzlT mL0DLG3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siHfc-00000004mJt-3hPf; Sun, 25 Aug 2024 18:08:56 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siHci-00000004lkD-1nsn for linux-arm-kernel@lists.infradead.org; Sun, 25 Aug 2024 18:05:58 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-4280692835dso5571565e9.1 for ; Sun, 25 Aug 2024 11:05:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724609155; x=1725213955; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=raI+n19QFN29zfHeug6+Nnj8oFJHmaYrdY3f2jmORFs=; b=hOCNeHxqfg3k1V5gO5J3WxMLZp/ArTPc0QMIqI0DOp5a/wFjTB3BO9t2xPgwGSdB/p sCxIShQE/PqG/uT1+gsLBnGZ9QyZTvoFmZgWkgwe+k9iiRUz0cMdPQJTjtg0uIAUCWbT z7TMiGRsQczLHJziNzq4dXRKb4mIVVms+2hpG/NjUu2SlA7OikeZB+Ef0Ac+gdAN2Rn/ pP1jO19iKdmKRy3lLW/ruApmHusZwT1LLvLIVKAYpE3vhvxVp3B4LTehNRyl/wnpW1Zi 5K9yH7NAx1I2XK0EQENEXo2Yiq9v9WsPmeIKqsmqdF675zm1soPSlnNv1QHINNl9TDjG cOww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724609155; x=1725213955; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=raI+n19QFN29zfHeug6+Nnj8oFJHmaYrdY3f2jmORFs=; b=oO3RawkXfySy78wXcPNeLkjnfFfNDvx1zpIQEvryqQ6QYIQHyKubzg7sNgqK9CRb3X 2zI7kIKLXS7nZM8iDAoeOodkw4Qda0kJ3HedU9qg1IQf4vrLq5O7HHC3wE3HpnEfMUzl 50pzMzHCBZPYcJGyHf0qwsNpQbQRCMRr6JEliNitbjLN4YN6eVj1LyZKZoqjOGIXT8RU DgC5SzlwFYwthseZhnt5wf6f6zmZG+96ehpw76HY3lcDWavr+9swqatUqa5TQoCayuBf 5itidbvSR3AT+s+EqrC4b2T69S+j4sVRnQWHQP4venigINSzKvV9enY1iUxJ+MgLvwPs ACfw== X-Gm-Message-State: AOJu0YwrtCaefqM29SNmg+d6KAGCkelkW/wSdHSGcik+VvPbWzG2baDi yFeeWAQTZPXVD/qfwqdxjMByH6caqp1WuCiILdGKHXngqU4PevZTq3iTwiyqD7w= X-Google-Smtp-Source: AGHT+IHovd9hBkcFA5+INtvXNRkDasxTeWwT194C24emqMwQsIKUln2/CHtoq+dBH9VjU22j1a5wgA== X-Received: by 2002:a05:6000:18a4:b0:367:811f:814c with SMTP id ffacd0b85a97d-37311852228mr2891104f8f.4.1724609154471; Sun, 25 Aug 2024 11:05:54 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37311dca113sm6438736f8f.16.2024.08.25.11.05.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 11:05:53 -0700 (PDT) From: Krzysztof Kozlowski Date: Sun, 25 Aug 2024 20:05:24 +0200 Subject: [PATCH 3/4] soc: versatile: realview: fix soc_dev leak during device remove MIME-Version: 1.0 Message-Id: <20240825-soc-dev-fixes-v1-3-ff4b35abed83@linaro.org> References: <20240825-soc-dev-fixes-v1-0-ff4b35abed83@linaro.org> In-Reply-To: <20240825-soc-dev-fixes-v1-0-ff4b35abed83@linaro.org> To: Linus Walleij , Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1464; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=djfTpzgwI9VayrirIxvL2d17DNLj3Y9kYYllCM4F/9I=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmy3J5hVAjigtLPRzXJclE2hY3l9wqGiPuN90+6 VH3b32MKzKJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZstyeQAKCRDBN2bmhouD 1z6YD/4gu3mtH9IEh3ZQSvcoj0sIV5F5wo+z0K9BmcsSZ8OvhLEiUikWAeTcuLAhbgrn5gzoTq6 UNEzpe0Yo0SWsrpyYm5izi/pKTuvMt+RZtGft0HXS+P8EP0L1A4kFAQ4OJcyUPiN9wqkMqsCYKH LdyWHVivtTiQc/iirLNAAqEi6hlPgzGfxveGpcqqGnN+Wb6jk1OMB14UTc19pUbRO//gV8zlRaB 9HUtRYAB9LySEgj/dgH+Iip/I3nUyn8wW15yC9ZWFBl+KnENa1k/5jHLRqslK5TdSxHeLZmrrzW Zw/fgTZUKKt3Uq1hwZGbpqIT1RHsojTQ1uYH72sJXC+v62+B/1kaUrNrO7Ckhi6KCtSvY/u7QfL 6cn8UtXArp0XU/uHpfKCsFov/Gm6pKy5vQOT3KrOcY/K+LtrKxjbT6SQf8J4oYBSRuTJNIKfw4k v3XkaOxOhKZd0auFGwodSa6Dm/GCoV3Tr6Yx7+mqEiHduB3dTeJ30fsHjWllbBI1gdFEs/Fu6cj enC33MxBkGrsuD298hQViVZbeMOnK5huRM/M62eW3PuYAs+cE+MAZcztvReOZ7WWhsYST95kg4k O2Bk0sCgt26/4NpMbpPjYsc4KN6d8lm8NOhbMOxYoEvJF1q4RhmPsfAQ9qsSpH6YI3zEwBsXKHO 6FLUwK897TPmYQA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240825_110556_531471_6A5F6CC4 X-CRM114-Status: GOOD ( 14.79 ) 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 If device is unbound, the soc_dev should be unregistered to prevent memory leak. Fixes: a2974c9c1f83 ("soc: add driver for the ARM RealView") Cc: Signed-off-by: Krzysztof Kozlowski --- drivers/soc/versatile/soc-realview.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/soc/versatile/soc-realview.c b/drivers/soc/versatile/soc-realview.c index d304ee69287a..cf91abe07d38 100644 --- a/drivers/soc/versatile/soc-realview.c +++ b/drivers/soc/versatile/soc-realview.c @@ -4,6 +4,7 @@ * * Author: Linus Walleij */ +#include #include #include #include @@ -81,6 +82,13 @@ static struct attribute *realview_attrs[] = { ATTRIBUTE_GROUPS(realview); +static void realview_soc_socdev_release(void *data) +{ + struct soc_device *soc_dev = data; + + soc_device_unregister(soc_dev); +} + static int realview_soc_probe(struct platform_device *pdev) { struct regmap *syscon_regmap; @@ -109,6 +117,11 @@ static int realview_soc_probe(struct platform_device *pdev) if (IS_ERR(soc_dev)) return -ENODEV; + ret = devm_add_action_or_reset(&pdev->dev, realview_soc_socdev_release, + soc_dev); + if (ret) + return ret; + ret = regmap_read(syscon_regmap, REALVIEW_SYS_ID_OFFSET, &realview_coreid); if (ret) From patchwork Sun Aug 25 18:05:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13776866 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 BC607C5321E for ; Sun, 25 Aug 2024 18:09:54 +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:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2fDrWsY1iZgM+nyCAHabCHTNPvbQeS69ZzWK0rFucpI=; b=c66+nKtMuQjoNqMFj54R2bMkC6 K2YIxawZdoDqqcY4IB1c2HnqgxwqSkjbhQjARqeqH3U/2uf9UUmbFVjVsXehfFwleAsZ+Y8mxx6Si myOd/e0kUQ1/HMKPKWzx4GybgjjhzmKQNeBw0sH/3INVzbmIFa+cch/sFX6WIe/o6XpbYcYENnePW SeV0U0pYp32MbNwUy+PkYBSguzIAsUS+raLnTF7Q5NjfdZTQckgMPQX6I18a8roYjGG7k61jt05F0 Xz1cEpG/7L8Y0wDtREIuTQhe1O8DSUAqDWITm6Ch0YVko8ZwWkL13PZ5ApfefV8QpJhuHOyZhB6rm 9Tbq/rfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siHgM-00000004mPo-32qn; Sun, 25 Aug 2024 18:09:42 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siHcj-00000004lkc-3nin for linux-arm-kernel@lists.infradead.org; Sun, 25 Aug 2024 18:05:59 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4280ef642fbso4497035e9.1 for ; Sun, 25 Aug 2024 11:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724609156; x=1725213956; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2fDrWsY1iZgM+nyCAHabCHTNPvbQeS69ZzWK0rFucpI=; b=qAcyDn/7dbgxKEicEF7/hRtoI3Tfp/ockMU1ZD/WyhYsYkS0K/3YwJge6himrVri8B hPpvvRF8bbL/QCIGRJYLMek9YOgguLkeOzAARtPTY2+rrUkHbxkVR9Wn1VaszGSPiJDW Xr6+KYWhq/wUSklUsxq7U77dO5wrHyl9iexD06TLvkC/m28DbWzdF1T4xLzOssL8kWgB Hewv1TYTAaFIlmeYCkyv6gzKXyZCT7usKQlMxzmSexc7ye7ppXhIayYOg6SjpEDA3lvz OCt93xK3sAbI8yFO+yq+rRrf9KuW/smHlM5MncQRBi/eq7lwH6nU1hxjZmv/mpHhdXmy tNTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724609156; x=1725213956; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2fDrWsY1iZgM+nyCAHabCHTNPvbQeS69ZzWK0rFucpI=; b=TJtZyLyV5xGNU/7QbGOnNbjZdgxlYkMIA4YghdN8gZdl/lJqI5MY6zVBPDs1QlhV51 ZAMwDY5Z3EhjtwXHgceU4VnQpVFDMDffw9P4CEgfKNgiveQJr3ZpnorYAxNz2yNIgz1m TLG+8VCoi+k5JJytEyJP/iwcrhTap7qPukMenuPKW4Lni3S5xBLbObiE67ChDyXngHDA 0ogoiuDTXZQCkGCiTW4H6FPLRPEaly87REoIKoGcNYr8Wo2D7MzPMLThiQGOXHeqeJdp +m59k/ciAEyGeeKDWmNQCT2JZRsaUf8hLAHi4cIwhXWcoYjTTQZvZe7akGHTUAEA1WR4 7tNQ== X-Gm-Message-State: AOJu0YzBetsOcPHs5Lv4UXNdr0s5j+iQoRaB90TVggl57A0ZGPNLRQia iC9jlAsn/3KmB840+UP9SrSkwCKyiwGv8jaAlDPis42lt2fk/FbF9vZZ7vGDVu8= X-Google-Smtp-Source: AGHT+IEDYNS7iJF8sbKwxKBJ35bmHiraIvVb0X9+WzzxjqXzAuTu70MfBmpEuyUqMcMxv7uaH6fBeQ== X-Received: by 2002:a05:600c:4445:b0:425:65b1:abb4 with SMTP id 5b1f17b1804b1-42acc8a7756mr33568245e9.0.1724609156014; Sun, 25 Aug 2024 11:05:56 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37311dca113sm6438736f8f.16.2024.08.25.11.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 11:05:55 -0700 (PDT) From: Krzysztof Kozlowski Date: Sun, 25 Aug 2024 20:05:25 +0200 Subject: [PATCH 4/4] soc: versatile: enable compile testing MIME-Version: 1.0 Message-Id: <20240825-soc-dev-fixes-v1-4-ff4b35abed83@linaro.org> References: <20240825-soc-dev-fixes-v1-0-ff4b35abed83@linaro.org> In-Reply-To: <20240825-soc-dev-fixes-v1-0-ff4b35abed83@linaro.org> To: Linus Walleij , Arnd Bergmann Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1712; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=/iX2lwrQe9MmqSKr9pDmH8EVTSENP3ZuL4P3UVBcTPw=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmy3J6dz7Weq/ta3ekEdu3b9XYUa4uI5fiye4RS 6JUBZJSWqeJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZstyegAKCRDBN2bmhouD 13hBD/wLP4PBvPVVbcABSQEE4DtJV2kF7Kk0LFiYeTx8O4xZb9nDIt/oQzKGYrwwIRBHmlvdSDv 9ZMctbNkN+ArrhA39bSQ1nNjIjymsEaZaSe0tLnWn0GKu/MDdtbQOzYhSl/a15/33JUJxdSB+b4 SIQNahan0N3O703qOJ5soQYAS5GCXop3nYfj1qniBwgllv9Le9dNRlTjjyWTltfWMxmqTncYvDI Xzgw8DkNi/q7SAqMm+HkcVVdxWl737M/XHsrFe1XSCqhmhf/RFf9dT2Pk7xj1lNZ6xig/f2YsIy nqb8yGZ0gseB07NjchxINBWOinC5WCJgp4vfnGwmaljn+y/JzUdcN6ELkgQR52Dp31uRDMkJ5rD fG3vT7pumB+Izu9zj5WVmZ301FrupehIXCRCg09ESXfXXjmov5VmBdO72RIUMznVxjgklW/keKd 8AT+yYJT1BSP15gK8eBGi0Lnu4LKcv1G37O89eAa+OkPJsno0ups0XFZtunmHolYf/JzzhHkVr4 oh+HqIZDDfWEV6Od2XXH0TMVzCh4b7/f745Epol8BsXbbq9y67hhX4Q02Il/oZJ7YibLtMWZVo6 mB/pFRaMA68NiqoNhDPVNgXPv8A/kqQnSMu9ApU73jEe3RVeop0Rgi79oTRn/kelkcjYdk+9nwk hgaYGzoyd2i6K3Q== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240825_110558_049575_20E5E270 X-CRM114-Status: GOOD ( 14.66 ) 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 Enable compile testing for broader build coverage. None of the drivers use anything from "asm", so code should build everywhere. CONFIG_PLAT_VERSATILE is being selected by driver dependencies (CONFIG_ARCH_INTEGRATOR and CONFIG_ARCH_REALVIEW), so directory can be always added to Makefile targets without impacting other configurations. Signed-off-by: Krzysztof Kozlowski --- drivers/soc/Makefile | 2 +- drivers/soc/versatile/Kconfig | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile index fb2bd31387d0..56f476a12847 100644 --- a/drivers/soc/Makefile +++ b/drivers/soc/Makefile @@ -32,5 +32,5 @@ obj-y += sunxi/ obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-y += ti/ obj-$(CONFIG_ARCH_U8500) += ux500/ -obj-$(CONFIG_PLAT_VERSATILE) += versatile/ +obj-y += versatile/ obj-y += xilinx/ diff --git a/drivers/soc/versatile/Kconfig b/drivers/soc/versatile/Kconfig index c3792c0a84ac..7bbf54a8d879 100644 --- a/drivers/soc/versatile/Kconfig +++ b/drivers/soc/versatile/Kconfig @@ -4,7 +4,7 @@ # config SOC_INTEGRATOR_CM bool "SoC bus device for the ARM Integrator platform core modules" - depends on ARCH_INTEGRATOR + depends on ARCH_INTEGRATOR || COMPILE_TEST select SOC_BUS help Include support for the SoC bus on the ARM Integrator platform @@ -13,7 +13,7 @@ config SOC_INTEGRATOR_CM config SOC_REALVIEW bool "SoC bus device for the ARM RealView platforms" - depends on ARCH_REALVIEW + depends on ARCH_REALVIEW || COMPILE_TEST select SOC_BUS help Include support for the SoC bus on the ARM RealView platforms