Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72d8a0d2 authored by Alexandre Bounine's avatar Alexandre Bounine Committed by Linus Torvalds
Browse files

rapidio/tsi721: add filtered debug output



Replace "all-or-nothing" debug output with controlled debug output using
functional block masks.  This allows run time control of debug messages
through 'dbg_level' module parameter.

Signed-off-by: default avatarAlexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
Cc: Andre van Herk <andre.van.herk@prodrive-technologies.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1679e8da
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,15 @@ For inbound messages this driver uses destination ID matching to forward message
into the corresponding message queue. Messaging callbacks are implemented to be
into the corresponding message queue. Messaging callbacks are implemented to be
fully compatible with RIONET driver (Ethernet over RapidIO messaging services).
fully compatible with RIONET driver (Ethernet over RapidIO messaging services).


1. Module parameters:
- 'dbg_level' - This parameter allows to control amount of debug information
        generated by this device driver. This parameter is formed by set of
        This parameter can be changed bit masks that correspond to the specific
        functional block.
        For mask definitions see 'drivers/rapidio/devices/tsi721.h'
        This parameter can be changed dynamically.
        Use CONFIG_RAPIDIO_DEBUG=y to enable debug output at the top level.

II. Known problems
II. Known problems


  None.
  None.
+122 −120

File changed.

Preview size limit exceeded, changes collapsed.

+40 −0
Original line number Original line Diff line number Diff line
@@ -21,6 +21,46 @@
#ifndef __TSI721_H
#ifndef __TSI721_H
#define __TSI721_H
#define __TSI721_H


/* Debug output filtering masks */
enum {
	DBG_NONE	= 0,
	DBG_INIT	= BIT(0), /* driver init */
	DBG_EXIT	= BIT(1), /* driver exit */
	DBG_MPORT	= BIT(2), /* mport add/remove */
	DBG_MAINT	= BIT(3), /* maintenance ops messages */
	DBG_DMA		= BIT(4), /* DMA transfer messages */
	DBG_DMAV	= BIT(5), /* verbose DMA transfer messages */
	DBG_IBW		= BIT(6), /* inbound window */
	DBG_EVENT	= BIT(7), /* event handling messages */
	DBG_OBW		= BIT(8), /* outbound window messages */
	DBG_DBELL	= BIT(9), /* doorbell messages */
	DBG_OMSG	= BIT(10), /* doorbell messages */
	DBG_IMSG	= BIT(11), /* doorbell messages */
	DBG_ALL		= ~0,
};

#ifdef DEBUG
extern u32 dbg_level;

#define tsi_debug(level, dev, fmt, arg...)				\
	do {								\
		if (DBG_##level & dbg_level)				\
			dev_dbg(dev, "%s: " fmt "\n", __func__, ##arg);	\
	} while (0)
#else
#define tsi_debug(level, dev, fmt, arg...) \
		no_printk(KERN_DEBUG "%s: " fmt "\n", __func__, ##arg)
#endif

#define tsi_info(dev, fmt, arg...) \
	dev_info(dev, "%s: " fmt "\n", __func__, ##arg)

#define tsi_warn(dev, fmt, arg...) \
	dev_warn(dev, "%s: WARNING " fmt "\n", __func__, ##arg)

#define tsi_err(dev, fmt, arg...) \
	dev_err(dev, "%s: ERROR " fmt "\n", __func__, ##arg)

#define DRV_NAME	"tsi721"
#define DRV_NAME	"tsi721"


#define DEFAULT_HOPCOUNT	0xff
#define DEFAULT_HOPCOUNT	0xff
+78 −69

File changed.

Preview size limit exceeded, changes collapsed.