Skip to content

Commit

Permalink
Asynchronous LID/Resource loading for FSP systems
Browse files Browse the repository at this point in the history
This moves away from using fsp_sync_msg in fsp_fetch_data and instead
using the platform hooks for start_preload_resource() to actually queue
up a load and having the plumbing for checking if a resource is loaded yet.

This gets rid of the "pollers called with locks held" warning we got
heaps of previously. You can now boot some FSP systems without getting
this warning at all.

This also sets the stage for starting load of LIDs much earlier to when
they're needed, improving boot time.

Signed-off-by: Stewart Smith <[email protected]>
  • Loading branch information
stewartsmith committed Mar 24, 2015
1 parent c4730fb commit c789772
Show file tree
Hide file tree
Showing 12 changed files with 287 additions and 114 deletions.
2 changes: 1 addition & 1 deletion core/flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ static int flash_find_subpartition(struct flash_chip *chip, uint32_t subid,
* load a resource from FLASH
* buf and len shouldn't account for ECC even if partition is ECCed.
*/
int flash_start_preload_resource(enum resource_id id, uint32_t subid,
int flash_load_resource(enum resource_id id, uint32_t subid,
void *buf, size_t *len)
{
int i, rc, part_num, part_size, part_start, size;
Expand Down
2 changes: 1 addition & 1 deletion core/hostservices.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ static int __hservice_lid_load(uint32_t lid, void **buf, size_t *len)
*/
*buf = malloc(HBRT_LOAD_LID_SIZE);
*len = HBRT_LOAD_LID_SIZE;
rc = fsp_fetch_data(0, FSP_DATASET_NONSP_LID, lid, 0, *buf, len);
rc = fsp_load_lid(lid, *buf, len);
if (rc != 0)
/* Take advantage of realloc corner case here. */
*len = 0;
Expand Down
3 changes: 1 addition & 2 deletions core/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ int wait_for_resource_loaded(enum resource_id id, uint32_t idx)

while(r == OPAL_BUSY) {
opal_run_pollers();
time_wait_nopoll(msecs_to_tb(5));
cpu_relax();
time_wait_ms_nopoll(5);
r = resource_loaded(id, idx);
}

Expand Down
2 changes: 1 addition & 1 deletion core/vpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static void *vpd_lid_load(const uint8_t *lx, uint8_t lxrn, size_t *size)
*size = VPD_LID_MAX_SIZE;

/* Load it from the FSP */
rc = fsp_fetch_data(0, FSP_DATASET_NONSP_LID, lid_no, 0, data, size);
rc = fsp_load_lid(lid_no, data, size);
if (rc) {
prerror("VPD: Error %d loading VPD LID\n", rc);
goto fail;
Expand Down
2 changes: 1 addition & 1 deletion hdata/test/stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ STUB(dt_next);
STUB(dt_has_node_property);
STUB(dt_get_address);
STUB(op_display);
STUB(fsp_fetch_data);
STUB(fsp_load_lid);
STUB(get_ics_phandle);
STUB(get_psi_interrupt);
STUB(fsp_adjust_lid_side);
Loading

0 comments on commit c789772

Please sign in to comment.