From patchwork Mon Mar 13 18:28:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 13173087 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 5CC94C74A4B for ; Mon, 13 Mar 2023 18:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=6Jy0j7YXr3TCChxGTVGArhNC7ZG9GGO771WLeTF5pQ8=; b=pUTYYWRxFWzmnn pbjQb5xJgTtX8KSOsldI+XDl0+mPjnqh90rEg/Wwze3obQimYDL3HVlNHfjGu4Ac/Lkqd8Ky0u43u Llo9LAzpsDB2Q+hvhatDe+ZOzOJ6q83jMoIo53k58LKJQNOy7AcOp/0KspNOPUC8YiWiZshA8/rOR wK9bp/zGjYyG6/4/qbfPBJzXZ4ctoBw0psR0Azni3i+Es0DyPjRJvnH1ygMGc0ST3qvDHPsR6fKJO Sg5LDrunKxX3Eg0wvpY8+air1J+V66SVv82Cw4m2Gj8Vge1i52+y1e06CRPsZvZA+Mtz+P/SaMO3I nOfg8qc9OlhLYBLZvnbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pbmvQ-007InL-Hf; Mon, 13 Mar 2023 18:29:36 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pbmvO-007Ile-0w for linux-arm-kernel@lists.infradead.org; Mon, 13 Mar 2023 18:29:35 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8192F6147D; Mon, 13 Mar 2023 18:29:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69E3BC433D2; Mon, 13 Mar 2023 18:29:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678732169; bh=6cc07Yo5EzSV1mVa+Tl9FGlm0vk+66ho84vi9KwFE6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cl050OeaHk/70eeZ/qIp465gBRu3j6q4XWi/RKOII5FNGcK9sW6PVPyiaKVHUA2x9 sqFlBHzI74e2NGa2mEbFPpewoyL2BeOghUGuV0FUvRaj6dnmsIXevM2ry27KVFwlYL B9n2DQn+FaQm2DNAh+jHjIvQZHpk1s+NdcvRTElk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: rafael@kernel.org, Greg Kroah-Hartman , Catalin Marinas , Will Deacon , Mark Brown , James Morse , Kristina Martsenko , Marc Zyngier , Ard Biesheuvel , Vladimir Murzin , Mark Rutland , linux-arm-kernel@lists.infradead.org Subject: [PATCH 11/36] arm64: cpufeature: move to use bus_get_dev_root() Date: Mon, 13 Mar 2023 19:28:53 +0100 Message-Id: <20230313182918.1312597-11-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230313182918.1312597-1-gregkh@linuxfoundation.org> References: <20230313182918.1312597-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1838; i=gregkh@linuxfoundation.org; h=from:subject; bh=6cc07Yo5EzSV1mVa+Tl9FGlm0vk+66ho84vi9KwFE6E=; b=owGbwMvMwCRo6H6F97bub03G02pJDCn82eVJlo+P744yWWQfVb0uYdL9DexKNz8uL84pzHhdw D/50fRXHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRy+0MCy7cr0iM0fhy7f9c WZ+rF3LNVzUV5TDMr9702NJpvrjn2rzr69Z+sXWe482VCwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230313_112934_121691_192F9599 X-CRM114-Status: GOOD ( 18.17 ) 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 Direct access to the struct bus_type dev_root pointer is going away soon so replace that with a call to bus_get_dev_root() instead, which is what it is there for. Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Brown Cc: James Morse Cc: Kristina Martsenko Cc: Marc Zyngier Cc: Ard Biesheuvel Cc: Vladimir Murzin Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Greg Kroah-Hartman --- Note, this is a patch that is a prepatory cleanup as part of a larger series of patches that is working on resolving some old driver core design mistakes. It will build and apply cleanly on top of 6.3-rc2 on its own, but I'd prefer if I could take it through my driver-core tree so that the driver core changes can be taken through there for 6.4-rc1. arch/arm64/kernel/cpufeature.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 2e3e55139777..f3bab4bd0917 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -1490,10 +1490,18 @@ static const DEVICE_ATTR_RO(aarch32_el0); static int __init aarch32_el0_sysfs_init(void) { + struct device *dev_root; + int ret = 0; + if (!allow_mismatched_32bit_el0) return 0; - return device_create_file(cpu_subsys.dev_root, &dev_attr_aarch32_el0); + dev_root = bus_get_dev_root(&cpu_subsys); + if (dev_root) { + ret = device_create_file(dev_root, &dev_attr_aarch32_el0); + put_device(dev_root); + } + return ret; } device_initcall(aarch32_el0_sysfs_init); From patchwork Mon Mar 13 18:29:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 13173088 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 ADD4EC6FD19 for ; Mon, 13 Mar 2023 18:31:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: 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: List-Owner; bh=MaLHzJ3QR+mxg9xDAVaIWPC+s2+yHHyeGyiUsuTh5yw=; b=yRzKAy+h4crUae qdUEi1/Y9Bg2zweaI1iWFDci3pVjofh0oU/f3DC5dXQkp+OHW05zRjxqMMNWj8t0hjnjyI73l0fan F+XnoeGV8ANkNKislei5lsKGOaVcp8Jb4P0SwK+ogLfmiJZAUHaOtddD40VyTlLpXmfW/uMgCNt7j bqJBDtav9iCYE2D6yuZ5gz632h/oNomyy0vYcMMZDOorKSYWTve2NMoj+paGE4mtov3F8WpxW9RGk B6iJjKBzXBi6Eox3t4DOhvBgZpwKIyvjk4M1rcj8n9v/hUEkTdcMvpg81VUJGxi6puCaQozzUiNzJ PfLN7QiqJBaAo/RxHzjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pbmwL-007J0a-Ap; Mon, 13 Mar 2023 18:30:33 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pbmwH-007Iz0-LV for linux-arm-kernel@lists.infradead.org; Mon, 13 Mar 2023 18:30:31 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5B50EB811F0; Mon, 13 Mar 2023 18:30:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87D2DC433D2; Mon, 13 Mar 2023 18:30:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678732228; bh=W+fW+GaLv1eYNbTlx2ySkmSxwEEfYBzIfMGA/H1zPac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rH/MCVbKSXu9ot3ZQ0Qy8B3weUd+cMfiNd0Tmf9+3da7IYDJNklPKProJ1v1Hp6WB oTJ+yPGFMqYDf25wAci03yskwsNdoU12pXS+OtmycZlMddHniV/OAqY8K5m1R2sbcp chEJjO9zT56BA6c5+okDz5S8DIBXllCgBtYpNxoM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: rafael@kernel.org, Greg Kroah-Hartman , Russell King , "Russell King (Oracle)" , Arnd Bergmann , Robin Murphy , Kees Cook , Lukas Bulwahn , Ben Dooks , Linus Walleij , linux-arm-kernel@lists.infradead.org Subject: [PATCH 33/36] ARM/dma-mapping: const a pointer to bus_type in arm_iommu_create_mapping() Date: Mon, 13 Mar 2023 19:29:15 +0100 Message-Id: <20230313182918.1312597-33-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230313182918.1312597-1-gregkh@linuxfoundation.org> References: <20230313182918.1312597-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2362; i=gregkh@linuxfoundation.org; h=from:subject; bh=W+fW+GaLv1eYNbTlx2ySkmSxwEEfYBzIfMGA/H1zPac=; b=owGbwMvMwCRo6H6F97bub03G02pJDCn82TU3trW/t7ZIa3j9d6Ou1M5F3ae72GSnzUrU3HmRK 3GXUfe+jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiI1x2GuXI1bIVf36jYLPaR Ll9VPzW5lZH5C8Ncif69Fy9pTj3HEPb9xfo4wS2hf/ijAQ== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230313_113030_006084_D33DEA33 X-CRM114-Status: GOOD ( 21.65 ) 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 Change the function arm_iommu_create_mapping() to take a pointer to a const bus_type as the function does not modify the variable the pointer points to at all, and the driver core bus functions it calls all expect a const * type. Cc: Russell King Cc: Greg Kroah-Hartman Cc: "Russell King (Oracle)" Cc: Arnd Bergmann Cc: Robin Murphy Cc: Kees Cook Cc: Lukas Bulwahn Cc: Ben Dooks Cc: Linus Walleij Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Greg Kroah-Hartman --- Note, this is a patch that is a prepatory cleanup as part of a larger series of patches that is working on resolving some old driver core design mistakes. It will build and apply cleanly on top of 6.3-rc2 on its own, but I'd prefer if I could take it through my driver-core tree so that the driver core changes can be taken through there for 6.4-rc1. arch/arm/include/asm/dma-iommu.h | 2 +- arch/arm/mm/dma-mapping.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/dma-iommu.h b/arch/arm/include/asm/dma-iommu.h index fe9ef6f79e9c..82ec1ccf1fee 100644 --- a/arch/arm/include/asm/dma-iommu.h +++ b/arch/arm/include/asm/dma-iommu.h @@ -24,7 +24,7 @@ struct dma_iommu_mapping { }; struct dma_iommu_mapping * -arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, u64 size); +arm_iommu_create_mapping(const struct bus_type *bus, dma_addr_t base, u64 size); void arm_iommu_release_mapping(struct dma_iommu_mapping *mapping); diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 8bc01071474a..b4a33358d2e9 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -1543,7 +1543,7 @@ static const struct dma_map_ops iommu_ops = { * arm_iommu_attach_device function. */ struct dma_iommu_mapping * -arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, u64 size) +arm_iommu_create_mapping(const struct bus_type *bus, dma_addr_t base, u64 size) { unsigned int bits = size >> PAGE_SHIFT; unsigned int bitmap_size = BITS_TO_LONGS(bits) * sizeof(long);