From 3a90b50a32b6b8a2d66dc10c19e3c15d5bd1a092 Mon Sep 17 00:00:00 2001 From: Adam Ford Date: Tue, 7 May 2019 06:57:39 -0500 Subject: usb: ohci: ohci-da8xx: Cleanup Error handling and fix flags Per feedback from Marek, he suggested better handling and to enable DM_FLAG_OS_PREPARE, this patch re-orders some of the error checking, and errors returns the error code right away and also sets DM_FLAG_OS_PREPARE. Signed-off-by: Adam Ford --- drivers/usb/host/ohci-da8xx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index e8a495f..233df57 100644 --- a/drivers/usb/host/ohci-da8xx.c +++ b/drivers/usb/host/ohci-da8xx.c @@ -93,6 +93,10 @@ static int ohci_da8xx_probe(struct udevice *dev) err = 0; priv->clock_count = 0; clock_nb = dev_count_phandle_with_args(dev, "clocks", "#clock-cells"); + + if (clock_nb < 0) + return clock_nb; + if (clock_nb > 0) { priv->clocks = devm_kcalloc(dev, clock_nb, sizeof(struct clk), GFP_KERNEL); @@ -112,9 +116,6 @@ static int ohci_da8xx_probe(struct udevice *dev) } priv->clock_count++; } - } else if (clock_nb != -ENOENT) { - dev_err(dev, "failed to get clock phandle(%d)\n", clock_nb); - return clock_nb; } err = usb_cpu_init(); @@ -170,6 +171,6 @@ U_BOOT_DRIVER(ohci_generic) = { .remove = ohci_da8xx_remove, .ops = &ohci_usb_ops, .priv_auto_alloc_size = sizeof(struct da8xx_ohci), - .flags = DM_FLAG_ALLOC_PRIV_DMA, + .flags = DM_FLAG_ALLOC_PRIV_DMA | DM_FLAG_OS_PREPARE, }; #endif -- cgit v1.1 From 28b4ba94811122d7a91924f62d63d8b25bfa979c Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Mon, 6 May 2019 15:18:54 +0200 Subject: ata: ahci: fix memory leak malloc(..) and memalign(..) are both allocating memory and as a result we leak the memory allocated with malloc(..). Signed-off-by: Christian Gmeiner Reviewed-by: Simon Glass --- drivers/ata/ahci.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 5fafb63..188d843 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -571,15 +571,12 @@ static int ahci_port_start(struct ahci_uc_priv *uc_priv, u8 port) return -1; } - mem = malloc(AHCI_PORT_PRIV_DMA_SZ + 2048); + mem = memalign(2048, AHCI_PORT_PRIV_DMA_SZ); if (!mem) { free(pp); printf("%s: No mem for table!\n", __func__); return -ENOMEM; } - - /* Aligned to 2048-bytes */ - mem = memalign(2048, AHCI_PORT_PRIV_DMA_SZ); memset(mem, 0, AHCI_PORT_PRIV_DMA_SZ); /* -- cgit v1.1 From 34501d6713d2ba9d6a8e8c7a1f2942cc16ef9043 Mon Sep 17 00:00:00 2001 From: Igor Opaniuk Date: Mon, 6 May 2019 12:07:31 +0300 Subject: test/py: avb: fix test_avb_persistent_values fail Fix test_avb_persistent_values() pytest, which was failing because of wrong size value provided from tee sandbox driver. Reported-by: Heinrich Schuchardt Signed-off-by: Igor Opaniuk --- drivers/tee/sandbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/tee/sandbox.c b/drivers/tee/sandbox.c index a136bc9..2f3355c 100644 --- a/drivers/tee/sandbox.c +++ b/drivers/tee/sandbox.c @@ -178,7 +178,7 @@ static u32 ta_avb_invoke_func(struct udevice *dev, u32 func, uint num_params, if (!ep) return TEE_ERROR_ITEM_NOT_FOUND; - value_sz = strlen(ep->data); + value_sz = strlen(ep->data) + 1; memcpy(value, ep->data, value_sz); return TEE_SUCCESS; -- cgit v1.1 From 0d7b6cffa532eecfdc7cb87c2c65cd311344981f Mon Sep 17 00:00:00 2001 From: Lokesh Vutla Date: Thu, 2 May 2019 15:35:52 +0530 Subject: remoteproc: k3_system_controller: Increase rx timeout There is one case where 400ms is not sufficient for loading the system firmware: - System firmware is not signed with rsa degenerate key. - ROM loading the sysfw directly from SPI flash which is in memory mapped mode. The above scenario is definitely not desired in production use cases as it effects boot time. But still keeping this support as this is a valid boot scenario. Signed-off-by: Lokesh Vutla --- drivers/remoteproc/k3_system_controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/remoteproc/k3_system_controller.c b/drivers/remoteproc/k3_system_controller.c index 214ea18..44e56c7 100644 --- a/drivers/remoteproc/k3_system_controller.c +++ b/drivers/remoteproc/k3_system_controller.c @@ -301,7 +301,7 @@ static int k3_sysctrler_probe(struct udevice *dev) static const struct k3_sysctrler_desc k3_sysctrler_am654_desc = { .host_id = 4, /* HOST_ID_R5_1 */ - .max_rx_timeout_us = 400000, + .max_rx_timeout_us = 800000, .max_msg_size = 60, }; -- cgit v1.1