]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: phy: Reloc next and prev pointers inside phy_drivers
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Tue, 26 Feb 2019 11:47:00 +0000 (17:17 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 27 Feb 2019 07:53:11 +0000 (08:53 +0100)
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 <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/phy/phy.c

index 25656ca08c9866fed4d5fff73beac1b562fa1c44..0b3388eaa543ee2ba7e9d232faa88ee030a9eaa2 100644 (file)
@@ -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