* [U-Boot] [PATCH] firmware: ti_sci: Parse all resource ranges even if some is not available
@ 2019-08-05 17:26 Andreas Dannenberg
2019-08-05 17:42 ` Lokesh Vutla
2019-08-13 16:52 ` Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Andreas Dannenberg @ 2019-08-05 17:26 UTC (permalink / raw)
To: u-boot
From: Vignesh Raghavendra <vigneshr@ti.com>
Do not fail if any of the requested subtypes are not available, but set the
number of resources to 0 and continue parsing the resource ranges.
Based on Linux kernel patch by Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
drivers/firmware/ti_sci.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
index 1fd29f2cdf..62b1dc2006 100644
--- a/drivers/firmware/ti_sci.c
+++ b/drivers/firmware/ti_sci.c
@@ -3170,6 +3170,7 @@ devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle,
u32 resource_subtype;
u16 resource_type;
struct ti_sci_resource *res;
+ bool valid_set = false;
int sets, i, ret;
u32 *temp;
@@ -3209,12 +3210,15 @@ devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle,
&res->desc[i].start,
&res->desc[i].num);
if (ret) {
- dev_err(dev, "type %d subtype %d not allocated for host %d\n",
+ dev_dbg(dev, "type %d subtype %d not allocated for host %d\n",
resource_type, resource_subtype,
handle_to_ti_sci_info(handle)->host_id);
- return ERR_PTR(ret);
+ res->desc[i].start = 0;
+ res->desc[i].num = 0;
+ continue;
}
+ valid_set = true;
dev_dbg(dev, "res type = %d, subtype = %d, start = %d, num = %d\n",
resource_type, resource_subtype, res->desc[i].start,
res->desc[i].num);
@@ -3226,7 +3230,10 @@ devm_ti_sci_get_of_resource(const struct ti_sci_handle *handle,
return ERR_PTR(-ENOMEM);
}
- return res;
+ if (valid_set)
+ return res;
+
+ return ERR_PTR(-EINVAL);
}
/* Description for K2G */
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] firmware: ti_sci: Parse all resource ranges even if some is not available
2019-08-05 17:26 [U-Boot] [PATCH] firmware: ti_sci: Parse all resource ranges even if some is not available Andreas Dannenberg
@ 2019-08-05 17:42 ` Lokesh Vutla
2019-08-13 16:52 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Lokesh Vutla @ 2019-08-05 17:42 UTC (permalink / raw)
To: u-boot
On 05/08/19 10:56 PM, Andreas Dannenberg wrote:
> From: Vignesh Raghavendra <vigneshr@ti.com>
>
> Do not fail if any of the requested subtypes are not available, but set the
> number of resources to 0 and continue parsing the resource ranges.
>
> Based on Linux kernel patch by Peter Ujfalusi <peter.ujfalusi@ti.com>
>
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Thanks and regards,
Lokesh
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] firmware: ti_sci: Parse all resource ranges even if some is not available
2019-08-05 17:26 [U-Boot] [PATCH] firmware: ti_sci: Parse all resource ranges even if some is not available Andreas Dannenberg
2019-08-05 17:42 ` Lokesh Vutla
@ 2019-08-13 16:52 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2019-08-13 16:52 UTC (permalink / raw)
To: u-boot
On Mon, Aug 05, 2019 at 12:26:44PM -0500, Andreas Dannenberg wrote:
> From: Vignesh Raghavendra <vigneshr@ti.com>
>
> Do not fail if any of the requested subtypes are not available, but set the
> number of resources to 0 and continue parsing the resource ranges.
>
> Based on Linux kernel patch by Peter Ujfalusi <peter.ujfalusi@ti.com>
>
> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190813/d7e52076/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-13 16:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-05 17:26 [U-Boot] [PATCH] firmware: ti_sci: Parse all resource ranges even if some is not available Andreas Dannenberg
2019-08-05 17:42 ` Lokesh Vutla
2019-08-13 16:52 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.