aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGuilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>2017-09-29 21:05:22 -0300
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-10-02 21:59:33 -0500
commit784da79b85537ded99e8d1890b46e3a804d93295 (patch)
tree39a0af6d68c2d0a5fd174f48bdcafa9430673645 /hw
parent68075c5176b93234e82a8123116f1c3f2284164b (diff)
downloadskiboot-784da79b85537ded99e8d1890b46e3a804d93295.zip
skiboot-784da79b85537ded99e8d1890b46e3a804d93295.tar.gz
skiboot-784da79b85537ded99e8d1890b46e3a804d93295.tar.bz2
phb4: Reassign link_retries counter in IODA purge
Recently, a link_retries counter was added in pci/phb4 in order Skiboot can retry to train a link some times - default number of attempts to retrain a link is 3. Happens that, if during a regular boot process we exhaust the link retries and fail to train a PHB, the variable link_retries is stuck in 0. If a kdump happens later, a PHB reset procedure is triggered by Linux and, since we have a decrement-and-test in this variable, we end up setting it to -1; it's unsigned, hence we get an overflow. This patch fixes the issue by reassigning the default value to link_retries in every IODA purge. Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/phb4.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/phb4.c b/hw/phb4.c
index 8b6a4d2..2b7c417 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -1099,6 +1099,8 @@ static int64_t phb4_ioda_reset(struct phb *phb, bool purge)
if (purge) {
PHBDBG(p, "Purging all IODA tables...\n");
+ if (phb->slot)
+ phb->slot->link_retries = PHB4_LINK_LINK_RETRIES;
phb4_init_ioda_cache(p);
}