mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-21 23:16:50 +08:00
Merge tag 'soc-fixes-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
Pull SoC fixes from Arnd Bergmann:
"The firmware drivers for ARM SCMI, FF-A and the Tee subsystem, as
well as the reset controller and cache controller subsystem all see
small bugfixes for reference ounting errors, ABI correctness, and
NULL pointer dereferences.
Similarly, there are multiple reference counting fixes in drivers/soc/
for vendor specific drivers (rockchips, microchip), while the
freescale drivers get a fix for a race condition and error handling.
The devicetree fixes for Rockchips and NXP got held up, so for
the moment there is only Renesas fixing problesm with SD card
initialization, a boot hang on one board and incorrect descriptions
for interrupts and clock registers on some SoCs. The Microchip
polarfire gets a dts fix for a boot time warning.
A defconfig fix avoids a warning about a conflicting assignment"
* tag 'soc-fixes-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (21 commits)
ARM: multi_v7_defconfig: Drop duplicate CONFIG_TI_PRUSS=m
firmware: arm_scmi: Spelling s/mulit/multi/, s/currenly/currently/
firmware: arm_scmi: Fix NULL dereference on notify error path
firmware: arm_scpi: Fix device_node reference leak in probe path
firmware: arm_ffa: Remove vm_id argument in ffa_rxtx_unmap()
arm64: dts: renesas: r8a78000: Fix out-of-range SPI interrupt numbers
arm64: dts: renesas: rzg3s-smarc-som: Set bypass for Versa3 PLL2
arm64: dts: renesas: r9a09g087: Fix CPG register region sizes
arm64: dts: renesas: r9a09g077: Fix CPG register region sizes
arm64: dts: renesas: r9a09g057: Remove wdt{0,2,3} nodes
arm64: dts: renesas: rzv2-evk-cn15-sd: Add ramp delay for SD0 regulator
arm64: dts: renesas: rzt2h-n2h-evk: Add ramp delay for SD0 card regulator
tee: shm: Remove refcounting of kernel pages
reset: rzg2l-usbphy-ctrl: Check pwrrdy is valid before using it
soc: fsl: cpm1: qmc: Fix error check for devm_ioremap_resource() in qmc_qe_init_resources()
soc: fsl: qbman: fix race condition in qman_destroy_fq
soc: rockchip: grf: Add missing of_node_put() when returning
cache: ax45mp: Fix device node reference leak in ax45mp_cache_init()
cache: starfive: fix device node leak in starlink_cache_init()
riscv: dts: microchip: add can resets to mpfs
...
This commit is contained in:
@@ -279,7 +279,6 @@ CONFIG_TI_CPSW_SWITCHDEV=y
|
||||
CONFIG_TI_CPTS=y
|
||||
CONFIG_TI_KEYSTONE_NETCP=y
|
||||
CONFIG_TI_KEYSTONE_NETCP_ETHSS=y
|
||||
CONFIG_TI_PRUSS=m
|
||||
CONFIG_TI_PRUETH=m
|
||||
CONFIG_XILINX_EMACLITE=y
|
||||
CONFIG_SFP=m
|
||||
|
||||
@@ -698,7 +698,7 @@
|
||||
compatible = "renesas,scif-r8a78000",
|
||||
"renesas,rcar-gen5-scif", "renesas,scif";
|
||||
reg = <0 0xc0700000 0 0x40>;
|
||||
interrupts = <GIC_SPI 4074 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts = <GIC_ESPI 10 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&dummy_clk_sgasyncd16>, <&dummy_clk_sgasyncd16>, <&scif_clk>;
|
||||
clock-names = "fck", "brg_int", "scif_clk";
|
||||
status = "disabled";
|
||||
@@ -708,7 +708,7 @@
|
||||
compatible = "renesas,scif-r8a78000",
|
||||
"renesas,rcar-gen5-scif", "renesas,scif";
|
||||
reg = <0 0xc0704000 0 0x40>;
|
||||
interrupts = <GIC_SPI 4075 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts = <GIC_ESPI 11 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&dummy_clk_sgasyncd16>, <&dummy_clk_sgasyncd16>, <&scif_clk>;
|
||||
clock-names = "fck", "brg_int", "scif_clk";
|
||||
status = "disabled";
|
||||
@@ -718,7 +718,7 @@
|
||||
compatible = "renesas,scif-r8a78000",
|
||||
"renesas,rcar-gen5-scif", "renesas,scif";
|
||||
reg = <0 0xc0708000 0 0x40>;
|
||||
interrupts = <GIC_SPI 4076 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts = <GIC_ESPI 12 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&dummy_clk_sgasyncd16>, <&dummy_clk_sgasyncd16>, <&scif_clk>;
|
||||
clock-names = "fck", "brg_int", "scif_clk";
|
||||
status = "disabled";
|
||||
@@ -728,7 +728,7 @@
|
||||
compatible = "renesas,scif-r8a78000",
|
||||
"renesas,rcar-gen5-scif", "renesas,scif";
|
||||
reg = <0 0xc070c000 0 0x40>;
|
||||
interrupts = <GIC_SPI 4077 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts = <GIC_ESPI 13 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&dummy_clk_sgasyncd16>, <&dummy_clk_sgasyncd16>, <&scif_clk>;
|
||||
clock-names = "fck", "brg_int", "scif_clk";
|
||||
status = "disabled";
|
||||
@@ -738,7 +738,7 @@
|
||||
compatible = "renesas,hscif-r8a78000",
|
||||
"renesas,rcar-gen5-hscif", "renesas,hscif";
|
||||
reg = <0 0xc0710000 0 0x60>;
|
||||
interrupts = <GIC_SPI 4078 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts = <GIC_ESPI 14 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&dummy_clk_sgasyncd4>, <&dummy_clk_sgasyncd4>, <&scif_clk>;
|
||||
clock-names = "fck", "brg_int", "scif_clk";
|
||||
status = "disabled";
|
||||
@@ -748,7 +748,7 @@
|
||||
compatible = "renesas,hscif-r8a78000",
|
||||
"renesas,rcar-gen5-hscif", "renesas,hscif";
|
||||
reg = <0 0xc0714000 0 0x60>;
|
||||
interrupts = <GIC_SPI 4079 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts = <GIC_ESPI 15 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&dummy_clk_sgasyncd4>, <&dummy_clk_sgasyncd4>, <&scif_clk>;
|
||||
clock-names = "fck", "brg_int", "scif_clk";
|
||||
status = "disabled";
|
||||
@@ -758,7 +758,7 @@
|
||||
compatible = "renesas,hscif-r8a78000",
|
||||
"renesas,rcar-gen5-hscif", "renesas,hscif";
|
||||
reg = <0 0xc0718000 0 0x60>;
|
||||
interrupts = <GIC_SPI 4080 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts = <GIC_ESPI 16 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&dummy_clk_sgasyncd4>, <&dummy_clk_sgasyncd4>, <&scif_clk>;
|
||||
clock-names = "fck", "brg_int", "scif_clk";
|
||||
status = "disabled";
|
||||
@@ -768,7 +768,7 @@
|
||||
compatible = "renesas,hscif-r8a78000",
|
||||
"renesas,rcar-gen5-hscif", "renesas,hscif";
|
||||
reg = <0 0xc071c000 0 0x60>;
|
||||
interrupts = <GIC_SPI 4081 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts = <GIC_ESPI 17 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&dummy_clk_sgasyncd4>, <&dummy_clk_sgasyncd4>, <&scif_clk>;
|
||||
clock-names = "fck", "brg_int", "scif_clk";
|
||||
status = "disabled";
|
||||
|
||||
@@ -581,16 +581,6 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
wdt0: watchdog@11c00400 {
|
||||
compatible = "renesas,r9a09g057-wdt";
|
||||
reg = <0 0x11c00400 0 0x400>;
|
||||
clocks = <&cpg CPG_MOD 0x4b>, <&cpg CPG_MOD 0x4c>;
|
||||
clock-names = "pclk", "oscclk";
|
||||
resets = <&cpg 0x75>;
|
||||
power-domains = <&cpg>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
wdt1: watchdog@14400000 {
|
||||
compatible = "renesas,r9a09g057-wdt";
|
||||
reg = <0 0x14400000 0 0x400>;
|
||||
@@ -601,26 +591,6 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
wdt2: watchdog@13000000 {
|
||||
compatible = "renesas,r9a09g057-wdt";
|
||||
reg = <0 0x13000000 0 0x400>;
|
||||
clocks = <&cpg CPG_MOD 0x4f>, <&cpg CPG_MOD 0x50>;
|
||||
clock-names = "pclk", "oscclk";
|
||||
resets = <&cpg 0x77>;
|
||||
power-domains = <&cpg>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
wdt3: watchdog@13000400 {
|
||||
compatible = "renesas,r9a09g057-wdt";
|
||||
reg = <0 0x13000400 0 0x400>;
|
||||
clocks = <&cpg CPG_MOD 0x51>, <&cpg CPG_MOD 0x52>;
|
||||
clock-names = "pclk", "oscclk";
|
||||
resets = <&cpg 0x78>;
|
||||
power-domains = <&cpg>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
rtc: rtc@11c00800 {
|
||||
compatible = "renesas,r9a09g057-rtca3", "renesas,rz-rtca3";
|
||||
reg = <0 0x11c00800 0 0x400>;
|
||||
|
||||
@@ -974,8 +974,8 @@
|
||||
|
||||
cpg: clock-controller@80280000 {
|
||||
compatible = "renesas,r9a09g077-cpg-mssr";
|
||||
reg = <0 0x80280000 0 0x1000>,
|
||||
<0 0x81280000 0 0x9000>;
|
||||
reg = <0 0x80280000 0 0x10000>,
|
||||
<0 0x81280000 0 0x10000>;
|
||||
clocks = <&extal_clk>;
|
||||
clock-names = "extal";
|
||||
#clock-cells = <2>;
|
||||
|
||||
@@ -977,8 +977,8 @@
|
||||
|
||||
cpg: clock-controller@80280000 {
|
||||
compatible = "renesas,r9a09g087-cpg-mssr";
|
||||
reg = <0 0x80280000 0 0x1000>,
|
||||
<0 0x81280000 0 0x9000>;
|
||||
reg = <0 0x80280000 0 0x10000>,
|
||||
<0 0x81280000 0 0x10000>;
|
||||
clocks = <&extal_clk>;
|
||||
clock-names = "extal";
|
||||
#clock-cells = <2>;
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
<100000000>;
|
||||
renesas,settings = [
|
||||
80 00 11 19 4c 42 dc 2f 06 7d 20 1a 5f 1e f2 27
|
||||
00 40 00 00 00 00 00 00 06 0c 19 02 3f f0 90 86
|
||||
00 40 00 00 00 00 00 00 06 0c 19 02 3b f0 90 86
|
||||
a0 80 30 30 9c
|
||||
];
|
||||
};
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
regulator-max-microvolt = <3300000>;
|
||||
gpios-states = <0>;
|
||||
states = <3300000 0>, <1800000 1>;
|
||||
regulator-ramp-delay = <60>;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
regulator-max-microvolt = <3300000>;
|
||||
gpios-states = <0>;
|
||||
states = <3300000 0>, <1800000 1>;
|
||||
regulator-ramp-delay = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -428,6 +428,7 @@
|
||||
clocks = <&clkcfg CLK_CAN0>, <&clkcfg CLK_MSSPLL3>;
|
||||
interrupt-parent = <&plic>;
|
||||
interrupts = <56>;
|
||||
resets = <&mss_top_sysreg CLK_CAN0>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -437,6 +438,7 @@
|
||||
clocks = <&clkcfg CLK_CAN1>, <&clkcfg CLK_MSSPLL3>;
|
||||
interrupt-parent = <&plic>;
|
||||
interrupts = <57>;
|
||||
resets = <&mss_top_sysreg CLK_CAN1>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
|
||||
4
drivers/cache/ax45mp_cache.c
vendored
4
drivers/cache/ax45mp_cache.c
vendored
@@ -178,11 +178,11 @@ static const struct of_device_id ax45mp_cache_ids[] = {
|
||||
|
||||
static int __init ax45mp_cache_init(void)
|
||||
{
|
||||
struct device_node *np;
|
||||
struct resource res;
|
||||
int ret;
|
||||
|
||||
np = of_find_matching_node(NULL, ax45mp_cache_ids);
|
||||
struct device_node *np __free(device_node) =
|
||||
of_find_matching_node(NULL, ax45mp_cache_ids);
|
||||
if (!of_device_is_available(np))
|
||||
return -ENODEV;
|
||||
|
||||
|
||||
4
drivers/cache/starfive_starlink_cache.c
vendored
4
drivers/cache/starfive_starlink_cache.c
vendored
@@ -102,11 +102,11 @@ static const struct of_device_id starlink_cache_ids[] = {
|
||||
|
||||
static int __init starlink_cache_init(void)
|
||||
{
|
||||
struct device_node *np;
|
||||
u32 block_size;
|
||||
int ret;
|
||||
|
||||
np = of_find_matching_node(NULL, starlink_cache_ids);
|
||||
struct device_node *np __free(device_node) =
|
||||
of_find_matching_node(NULL, starlink_cache_ids);
|
||||
if (!of_device_is_available(np))
|
||||
return -ENODEV;
|
||||
|
||||
|
||||
@@ -205,12 +205,12 @@ static int ffa_rxtx_map(phys_addr_t tx_buf, phys_addr_t rx_buf, u32 pg_cnt)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ffa_rxtx_unmap(u16 vm_id)
|
||||
static int ffa_rxtx_unmap(void)
|
||||
{
|
||||
ffa_value_t ret;
|
||||
|
||||
invoke_ffa_fn((ffa_value_t){
|
||||
.a0 = FFA_RXTX_UNMAP, .a1 = PACK_TARGET_INFO(vm_id, 0),
|
||||
.a0 = FFA_RXTX_UNMAP,
|
||||
}, &ret);
|
||||
|
||||
if (ret.a0 == FFA_ERROR)
|
||||
@@ -2097,7 +2097,7 @@ static int __init ffa_init(void)
|
||||
|
||||
pr_err("failed to setup partitions\n");
|
||||
ffa_notifications_cleanup();
|
||||
ffa_rxtx_unmap(drv_info->vm_id);
|
||||
ffa_rxtx_unmap();
|
||||
free_pages:
|
||||
if (drv_info->tx_buffer)
|
||||
free_pages_exact(drv_info->tx_buffer, rxtx_bufsz);
|
||||
@@ -2112,7 +2112,7 @@ static void __exit ffa_exit(void)
|
||||
{
|
||||
ffa_notifications_cleanup();
|
||||
ffa_partitions_cleanup();
|
||||
ffa_rxtx_unmap(drv_info->vm_id);
|
||||
ffa_rxtx_unmap();
|
||||
free_pages_exact(drv_info->tx_buffer, drv_info->rxtx_bufsz);
|
||||
free_pages_exact(drv_info->rx_buffer, drv_info->rxtx_bufsz);
|
||||
kfree(drv_info);
|
||||
|
||||
@@ -1066,7 +1066,7 @@ static int scmi_register_event_handler(struct scmi_notify_instance *ni,
|
||||
* since at creation time we usually want to have all setup and ready before
|
||||
* events really start flowing.
|
||||
*
|
||||
* Return: A properly refcounted handler on Success, NULL on Failure
|
||||
* Return: A properly refcounted handler on Success, ERR_PTR on Failure
|
||||
*/
|
||||
static inline struct scmi_event_handler *
|
||||
__scmi_event_handler_get_ops(struct scmi_notify_instance *ni,
|
||||
@@ -1113,7 +1113,7 @@ __scmi_event_handler_get_ops(struct scmi_notify_instance *ni,
|
||||
}
|
||||
mutex_unlock(&ni->pending_mtx);
|
||||
|
||||
return hndl;
|
||||
return hndl ?: ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
static struct scmi_event_handler *
|
||||
|
||||
@@ -189,13 +189,13 @@ struct scmi_protocol_handle {
|
||||
|
||||
/**
|
||||
* struct scmi_iterator_state - Iterator current state descriptor
|
||||
* @desc_index: Starting index for the current mulit-part request.
|
||||
* @desc_index: Starting index for the current multi-part request.
|
||||
* @num_returned: Number of returned items in the last multi-part reply.
|
||||
* @num_remaining: Number of remaining items in the multi-part message.
|
||||
* @max_resources: Maximum acceptable number of items, configured by the caller
|
||||
* depending on the underlying resources that it is querying.
|
||||
* @loop_idx: The iterator loop index in the current multi-part reply.
|
||||
* @rx_len: Size in bytes of the currenly processed message; it can be used by
|
||||
* @rx_len: Size in bytes of the currently processed message; it can be used by
|
||||
* the user of the iterator to verify a reply size.
|
||||
* @priv: Optional pointer to some additional state-related private data setup
|
||||
* by the caller during the iterations.
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <linux/bitmap.h>
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/cleanup.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/export.h>
|
||||
@@ -940,13 +941,13 @@ static int scpi_probe(struct platform_device *pdev)
|
||||
int idx = scpi_drvinfo->num_chans;
|
||||
struct scpi_chan *pchan = scpi_drvinfo->channels + idx;
|
||||
struct mbox_client *cl = &pchan->cl;
|
||||
struct device_node *shmem = of_parse_phandle(np, "shmem", idx);
|
||||
struct device_node *shmem __free(device_node) =
|
||||
of_parse_phandle(np, "shmem", idx);
|
||||
|
||||
if (!of_match_node(shmem_of_match, shmem))
|
||||
return -ENXIO;
|
||||
|
||||
ret = of_address_to_resource(shmem, 0, &res);
|
||||
of_node_put(shmem);
|
||||
if (ret) {
|
||||
dev_err(dev, "failed to get SCPI payload mem resource\n");
|
||||
return ret;
|
||||
|
||||
@@ -136,6 +136,9 @@ static int rzg2l_usbphy_ctrl_set_pwrrdy(struct regmap_field *pwrrdy,
|
||||
{
|
||||
u32 val = power_on ? 0 : 1;
|
||||
|
||||
if (!pwrrdy)
|
||||
return 0;
|
||||
|
||||
/* The initialization path guarantees that the mask is 1 bit long. */
|
||||
return regmap_field_update_bits(pwrrdy, 1, val);
|
||||
}
|
||||
|
||||
@@ -1827,6 +1827,8 @@ EXPORT_SYMBOL(qman_create_fq);
|
||||
|
||||
void qman_destroy_fq(struct qman_fq *fq)
|
||||
{
|
||||
int leaked;
|
||||
|
||||
/*
|
||||
* We don't need to lock the FQ as it is a pre-condition that the FQ be
|
||||
* quiesced. Instead, run some checks.
|
||||
@@ -1834,11 +1836,29 @@ void qman_destroy_fq(struct qman_fq *fq)
|
||||
switch (fq->state) {
|
||||
case qman_fq_state_parked:
|
||||
case qman_fq_state_oos:
|
||||
if (fq_isset(fq, QMAN_FQ_FLAG_DYNAMIC_FQID))
|
||||
qman_release_fqid(fq->fqid);
|
||||
/*
|
||||
* There's a race condition here on releasing the fqid,
|
||||
* setting the fq_table to NULL, and freeing the fqid.
|
||||
* To prevent it, this order should be respected:
|
||||
*/
|
||||
if (fq_isset(fq, QMAN_FQ_FLAG_DYNAMIC_FQID)) {
|
||||
leaked = qman_shutdown_fq(fq->fqid);
|
||||
if (leaked)
|
||||
pr_debug("FQID %d leaked\n", fq->fqid);
|
||||
}
|
||||
|
||||
DPAA_ASSERT(fq_table[fq->idx]);
|
||||
fq_table[fq->idx] = NULL;
|
||||
|
||||
if (fq_isset(fq, QMAN_FQ_FLAG_DYNAMIC_FQID) && !leaked) {
|
||||
/*
|
||||
* fq_table[fq->idx] should be set to null before
|
||||
* freeing fq->fqid otherwise it could by allocated by
|
||||
* qman_alloc_fqid() while still being !NULL
|
||||
*/
|
||||
smp_wmb();
|
||||
gen_pool_free(qm_fqalloc, fq->fqid | DPAA_GENALLOC_OFF, 1);
|
||||
}
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -1790,8 +1790,8 @@ static int qmc_qe_init_resources(struct qmc *qmc, struct platform_device *pdev)
|
||||
return -EINVAL;
|
||||
qmc->dpram_offset = res->start - qe_muram_dma(qe_muram_addr(0));
|
||||
qmc->dpram = devm_ioremap_resource(qmc->dev, res);
|
||||
if (IS_ERR(qmc->scc_pram))
|
||||
return PTR_ERR(qmc->scc_pram);
|
||||
if (IS_ERR(qmc->dpram))
|
||||
return PTR_ERR(qmc->dpram);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -142,8 +142,10 @@ static int mpfs_sys_controller_probe(struct platform_device *pdev)
|
||||
|
||||
sys_controller->flash = of_get_mtd_device_by_node(np);
|
||||
of_node_put(np);
|
||||
if (IS_ERR(sys_controller->flash))
|
||||
return dev_err_probe(dev, PTR_ERR(sys_controller->flash), "Failed to get flash\n");
|
||||
if (IS_ERR(sys_controller->flash)) {
|
||||
ret = dev_err_probe(dev, PTR_ERR(sys_controller->flash), "Failed to get flash\n");
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
no_flash:
|
||||
sys_controller->client.dev = dev;
|
||||
@@ -155,8 +157,7 @@ no_flash:
|
||||
if (IS_ERR(sys_controller->chan)) {
|
||||
ret = dev_err_probe(dev, PTR_ERR(sys_controller->chan),
|
||||
"Failed to get mbox channel\n");
|
||||
kfree(sys_controller);
|
||||
return ret;
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
init_completion(&sys_controller->c);
|
||||
@@ -174,6 +175,10 @@ no_flash:
|
||||
dev_info(&pdev->dev, "Registered MPFS system controller\n");
|
||||
|
||||
return 0;
|
||||
|
||||
out_free:
|
||||
kfree(sys_controller);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void mpfs_sys_controller_remove(struct platform_device *pdev)
|
||||
|
||||
@@ -231,6 +231,7 @@ static int __init rockchip_grf_init(void)
|
||||
grf = syscon_node_to_regmap(np);
|
||||
if (IS_ERR(grf)) {
|
||||
pr_err("%s: could not get grf syscon\n", __func__);
|
||||
of_node_put(np);
|
||||
return PTR_ERR(grf);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,29 +23,11 @@ struct tee_shm_dma_mem {
|
||||
struct page *page;
|
||||
};
|
||||
|
||||
static void shm_put_kernel_pages(struct page **pages, size_t page_count)
|
||||
{
|
||||
size_t n;
|
||||
|
||||
for (n = 0; n < page_count; n++)
|
||||
put_page(pages[n]);
|
||||
}
|
||||
|
||||
static void shm_get_kernel_pages(struct page **pages, size_t page_count)
|
||||
{
|
||||
size_t n;
|
||||
|
||||
for (n = 0; n < page_count; n++)
|
||||
get_page(pages[n]);
|
||||
}
|
||||
|
||||
static void release_registered_pages(struct tee_shm *shm)
|
||||
{
|
||||
if (shm->pages) {
|
||||
if (shm->flags & TEE_SHM_USER_MAPPED)
|
||||
unpin_user_pages(shm->pages, shm->num_pages);
|
||||
else
|
||||
shm_put_kernel_pages(shm->pages, shm->num_pages);
|
||||
|
||||
kfree(shm->pages);
|
||||
}
|
||||
@@ -477,13 +459,6 @@ register_shm_helper(struct tee_context *ctx, struct iov_iter *iter, u32 flags,
|
||||
goto err_put_shm_pages;
|
||||
}
|
||||
|
||||
/*
|
||||
* iov_iter_extract_kvec_pages does not get reference on the pages,
|
||||
* get a reference on them.
|
||||
*/
|
||||
if (iov_iter_is_kvec(iter))
|
||||
shm_get_kernel_pages(shm->pages, num_pages);
|
||||
|
||||
shm->offset = off;
|
||||
shm->size = len;
|
||||
shm->num_pages = num_pages;
|
||||
@@ -499,8 +474,6 @@ register_shm_helper(struct tee_context *ctx, struct iov_iter *iter, u32 flags,
|
||||
err_put_shm_pages:
|
||||
if (!iov_iter_is_kvec(iter))
|
||||
unpin_user_pages(shm->pages, shm->num_pages);
|
||||
else
|
||||
shm_put_kernel_pages(shm->pages, shm->num_pages);
|
||||
err_free_shm_pages:
|
||||
kfree(shm->pages);
|
||||
err_free_shm:
|
||||
|
||||
Reference in New Issue
Block a user