[go: nahoru, domu]

CHROMIUM: irqchip/gic-v3-its: fixup error prints and sizeof()

Last notes on the upstream review suggest these changes because:
(a) printing the virtual address isn't usueful -- upstream reviewers
were expecting the physical address
(b) the porting from upstream to v4.4 (where we don't have quite the
same helpers) used '*' to dereference the array, whereas the array
operator ('[]') makes more sense

At the moment, it's not worth respinning the series, as there's still
bikeshedding going on over how to document the firmware/device-tree
contract.

BUG=b:62644399
TEST=suspend/resume on scarlet

Change-Id: I699c7ce5f2a41128a98814722e082a317d96d390
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/909990
Tested-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
(cherry picked from commit f56c09e2db090a4d09618925c105c0328684c038)
Reviewed-on: https://chromium-review.googlesource.com/914593
Reviewed-by: Derek Basehore <dbasehore@chromium.org>
Commit-Queue: Derek Basehore <dbasehore@chromium.org>
Trybot-Ready: Derek Basehore <dbasehore@chromium.org>
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 6205b01..a66a013 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -1487,14 +1487,15 @@
 		its->ctlr_save = readl_relaxed(base + GITS_CTLR);
 		err = its_force_quiescent(base);
 		if (err) {
-			pr_err("ITS failed to quiesce\n");
+			pr_err("ITS@%pa: failed to quiesce: %d\n",
+			       &its->phys_base, err);
 			writel_relaxed(its->ctlr_save, base + GITS_CTLR);
 			goto err;
 		}
 
 		for (i = 0; i < GITS_BASER_NR_REGS; i++)
 			its->baser_save[i] = readq_relaxed(base + GITS_BASER +
-					i * sizeof(*its->baser_save));
+					i * sizeof(its->baser_save[i]));
 
 		its->cbaser_save = readq_relaxed(base + GITS_CBASER);
 	}
@@ -1519,6 +1520,7 @@
 static void its_restore_enable(void)
 {
 	struct its_node *its;
+	int ret;
 
 	spin_lock(&its_lock);
 	list_for_each_entry(its, &its_nodes, entry) {
@@ -1536,8 +1538,10 @@
 		 * registers is undefined according to the GIC v3 ITS
 		 * Specification.
 		 */
-		if (its_force_quiescent(base)) {
-			pr_err("ITS(%p): failed to quiesce on resume\n", base);
+		ret = its_force_quiescent(base);
+		if (ret) {
+			pr_err("ITS@%pa: failed to quiesce on resume: %d\n",
+			       &its->phys_base, ret);
 			continue;
 		}
 
@@ -1557,7 +1561,7 @@
 
 			writeq_relaxed(its->baser_save[i],
 				       base + GITS_BASER +
-				       i * sizeof(*its->baser_save));
+				       i * sizeof(its->baser_save[i]));
 		}
 		writel_relaxed(its->ctlr_save, base + GITS_CTLR);