Skip to content

Commit

Permalink
net: phy: Reloc next and prev pointers inside phy_drivers
Browse files Browse the repository at this point in the history
This patch relocates the pointers inside phy_drivers incase
of manual reloc. Without this reloc, these points to invalid
pre relocation address and hence causes exception or hang.

Signed-off-by: Siva Durga Prasad Paladugu <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
Acked-by: Joe Hershberger <[email protected]>
  • Loading branch information
Siva Durga Prasad Paladugu authored and jhershbe committed May 8, 2019
1 parent 89bf9f1 commit c689c48
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/net/phy/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,18 @@ static LIST_HEAD(phy_drivers);

int phy_init(void)
{
#ifdef CONFIG_NEEDS_MANUAL_RELOC
/*
* The pointers inside phy_drivers also needs to be updated incase of
* manual reloc, without which these points to some invalid
* pre reloc address and leads to invalid accesses, hangs.
*/
struct list_head *head = &phy_drivers;

head->next = (void *)head->next + gd->reloc_off;
head->prev = (void *)head->prev + gd->reloc_off;
#endif

#ifdef CONFIG_B53_SWITCH
phy_b53_init();
#endif
Expand Down

0 comments on commit c689c48

Please sign in to comment.