All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	mikey@neuling.org, hbabu@us.ibm.com, nicholas.piggin@gmail.com,
	linuxppc-dev@ozlabs.org, <linux-kernel@vger.kernel.org>
Subject: [PATCH v2 03/18] powerpc/vas: Cleanup some debug code
Date: Fri,  6 Oct 2017 19:28:03 -0700	[thread overview]
Message-ID: <1507343298-27496-4-git-send-email-sukadev@linux.vnet.ibm.com> (raw)
In-Reply-To: <1507343298-27496-1-git-send-email-sukadev@linux.vnet.ibm.com>

Clean up vas.h and the debug code around ifdef vas_debug.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/powernv/vas-window.c |  8 +++--
 arch/powerpc/platforms/powernv/vas.h        | 56 +++++++----------------------
 2 files changed, 18 insertions(+), 46 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/vas-window.c b/arch/powerpc/platforms/powernv/vas-window.c
index a2fe120..67ffc5d 100644
--- a/arch/powerpc/platforms/powernv/vas-window.c
+++ b/arch/powerpc/platforms/powernv/vas-window.c
@@ -726,7 +726,10 @@ static void init_winctx_for_rxwin(struct vas_window *rxwin,
 static bool rx_win_args_valid(enum vas_cop_type cop,
 			struct vas_rx_win_attr *attr)
 {
-	dump_rx_win_attr(attr);
+	pr_debug("Rxattr: fault %d, notify %d, intr %d, early %d, fifo %d\n",
+			attr->fault_win, attr->notify_disable,
+			attr->intr_disable, attr->notify_early,
+			attr->rx_fifo_size);
 
 	if (cop >= VAS_COP_TYPE_MAX)
 		return false;
@@ -1050,7 +1053,8 @@ int vas_paste_crb(struct vas_window *txwin, int offset, bool re)
 	else
 		rc = -EINVAL;
 
-	print_fifo_msg_count(txwin);
+	pr_debug("Txwin #%d: Msg count %llu\n", txwin->winid,
+			read_hvwc_reg(txwin, VREG(LRFIFO_PUSH)));
 
 	return rc;
 }
diff --git a/arch/powerpc/platforms/powernv/vas.h b/arch/powerpc/platforms/powernv/vas.h
index fea0de4..15d2dfa 100644
--- a/arch/powerpc/platforms/powernv/vas.h
+++ b/arch/powerpc/platforms/powernv/vas.h
@@ -259,6 +259,16 @@
 #define VAS_NX_UTIL_ADDER		PPC_BITMASK(32, 63)
 
 /*
+ * VREG(x):
+ * Expand a register's short name (eg: LPID) into two parameters:
+ *	- the register's short name in string form ("LPID"), and
+ *	- the name of the macro (eg: VAS_LPID_OFFSET), defining the
+ *	  register's offset in the window context
+ */
+#define VREG_SFX(n, s)	__stringify(n), VAS_##n##s
+#define VREG(r)		VREG_SFX(r, _OFFSET)
+
+/*
  * Local Notify Scope Control Register. (Receive windows only).
  */
 enum vas_notify_scope {
@@ -385,43 +395,15 @@ struct vas_winctx {
 
 extern struct vas_instance *find_vas_instance(int vasid);
 
-/*
- * VREG(x):
- * Expand a register's short name (eg: LPID) into two parameters:
- *	- the register's short name in string form ("LPID"), and
- *	- the name of the macro (eg: VAS_LPID_OFFSET), defining the
- *	  register's offset in the window context
- */
-#define VREG_SFX(n, s)	__stringify(n), VAS_##n##s
-#define VREG(r)		VREG_SFX(r, _OFFSET)
-
-#ifdef vas_debug
-static inline void dump_rx_win_attr(struct vas_rx_win_attr *attr)
-{
-	pr_err("fault %d, notify %d, intr %d early %d\n",
-			attr->fault_win, attr->notify_disable,
-			attr->intr_disable, attr->notify_early);
-
-	pr_err("rx_fifo_size %d, max value %d\n",
-				attr->rx_fifo_size, VAS_RX_FIFO_SIZE_MAX);
-}
-
 static inline void vas_log_write(struct vas_window *win, char *name,
 			void *regptr, u64 val)
 {
-	if (val)
-		pr_err("%swin #%d: %s reg %p, val 0x%016llx\n",
+	if (!val)
+		pr_debug("%swin #%d: %s reg %p, val 0x%016llx\n",
 				win->tx_win ? "Tx" : "Rx", win->winid, name,
 				regptr, val);
 }
 
-#else	/* vas_debug */
-
-#define vas_log_write(win, name, reg, val)
-#define dump_rx_win_attr(attr)
-
-#endif	/* vas_debug */
-
 static inline void write_uwc_reg(struct vas_window *win, char *name,
 			s32 reg, u64 val)
 {
@@ -450,18 +432,4 @@ static inline u64 read_hvwc_reg(struct vas_window *win,
 	return in_be64(win->hvwc_map+reg);
 }
 
-#ifdef vas_debug
-
-static void print_fifo_msg_count(struct vas_window *txwin)
-{
-	uint64_t read_hvwc_reg(struct vas_window *w, char *n, uint64_t o);
-	pr_devel("Winid %d, Msg count %llu\n", txwin->winid,
-			(uint64_t)read_hvwc_reg(txwin, VREG(LRFIFO_PUSH)));
-}
-#else	/* vas_debug */
-
-#define print_fifo_msg_count(window)
-
-#endif	/* vas_debug */
-
 #endif /* _VAS_H */
-- 
2.7.4

  parent reply	other threads:[~2017-10-07  2:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-07  2:28 [PATCH v2 00/18] powerpc/vas: Add support for FTW Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 01/18] powerpc/vas: init missing fields from [rt]xattr Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 02/18] powerpc/vas: Validate window credits Sukadev Bhattiprolu
2017-10-07  2:28 ` Sukadev Bhattiprolu [this message]
2017-10-07  2:28 ` [PATCH v2 04/18] powerpc/vas: Drop poll_window_cast_out() Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 05/18] powerpc/vas: Use helper to unpin/close window Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 06/18] powerpc/vas: Reduce polling interval for busy state Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 07/18] powerpc/vas: Save configured window credits Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 08/18] powerpc/vas: poll for return of " Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 09/18] powerpc/vas: Create cpu to vas id mapping Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 10/18] powerpc/vas, nx-842: Define and use chip_to_vas_id() Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 11/18] powerpc/vas: Export HVWC to debugfs Sukadev Bhattiprolu
2017-11-07 12:19   ` Michael Ellerman
2017-10-07  2:28 ` [PATCH v2 12/18] powerpc: have copy depend on CONFIG_BOOK3S_64 Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 13/18] powerpc: Add support for setting SPRN_TIDR Sukadev Bhattiprolu
2017-10-20 11:03   ` Frederic Barrat
2017-10-07  2:28 ` [PATCH v2 14/18] powerpc: Define set_thread_used_vas() Sukadev Bhattiprolu
2017-11-07  0:49   ` Nicholas Piggin
2017-11-09 11:01   ` Michael Ellerman
2017-10-07  2:28 ` [PATCH v2 15/18] powerpc: Emulate paste instruction Sukadev Bhattiprolu
2017-10-09 10:00   ` Michael Neuling
2017-10-09 10:00     ` Michael Neuling
2017-10-10  5:54     ` Michael Ellerman
2017-10-10  5:54       ` Michael Ellerman
2017-10-07  2:28 ` [PATCH v2 16/18] powerpc/vas: Define vas_win_paste_addr() Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 17/18] powerpc/vas: Define vas_win_id() Sukadev Bhattiprolu
2017-10-07  2:28 ` [PATCH v2 18/18] powerpc/vas: Add support for user receive window Sukadev Bhattiprolu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1507343298-27496-4-git-send-email-sukadev@linux.vnet.ibm.com \
    --to=sukadev@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=hbabu@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=mpe@ellerman.id.au \
    --cc=nicholas.piggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.