From 71f01d002b12a3c627799735ea9756eebfe20210 Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Sun, 2 Apr 2006 14:39:20 -0700 Subject: [PATCH] --- yaml --- r: 25695 b: refs/heads/master c: 227c939b00cf786b5e2e95fc904518206f478421 h: refs/heads/master i: 25693: 25c46e7294b805865e6f959cc5dbd6690eb0d879 25691: f611464b21bf085949d1b9e99691322cff0de38a 25687: 3b1735fba3aa3e2c0da1a59ed8636b37240d8635 25679: 8904daae6daa72dfbe3fea3284fe5afddc2ced65 25663: 82f9aecc2f8887d02f8e44231a61f8fcad190395 v: v3 --- [refs] | 2 +- trunk/drivers/infiniband/hw/mthca/Kconfig | 11 ++++++----- trunk/drivers/infiniband/hw/mthca/Makefile | 4 ---- trunk/drivers/infiniband/hw/mthca/mthca_dev.h | 17 +++++++++++++++-- trunk/drivers/infiniband/hw/mthca/mthca_main.c | 8 ++++++++ 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index 293689186c3c..eb7250df3796 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f5545d24b8aa9fccd8071203e83bc9f4b26e17a6 +refs/heads/master: 227c939b00cf786b5e2e95fc904518206f478421 diff --git a/trunk/drivers/infiniband/hw/mthca/Kconfig b/trunk/drivers/infiniband/hw/mthca/Kconfig index e88be85b3d5c..9aa5a4468a75 100644 --- a/trunk/drivers/infiniband/hw/mthca/Kconfig +++ b/trunk/drivers/infiniband/hw/mthca/Kconfig @@ -7,10 +7,11 @@ config INFINIBAND_MTHCA ("Tavor") and the MT25208 PCI Express HCA ("Arbel"). config INFINIBAND_MTHCA_DEBUG - bool "Verbose debugging output" + bool "Verbose debugging output" if EMBEDDED depends on INFINIBAND_MTHCA - default n + default y ---help--- - This option causes the mthca driver produce a bunch of debug - messages. Select this is you are developing the driver or - trying to diagnose a problem. + This option causes debugging code to be compiled into the + mthca driver. The output can be turned on via the + debug_level module parameter (which can also be set after + the driver is loaded through sysfs). diff --git a/trunk/drivers/infiniband/hw/mthca/Makefile b/trunk/drivers/infiniband/hw/mthca/Makefile index 47ec5a7cba0b..e388d95d0cf1 100644 --- a/trunk/drivers/infiniband/hw/mthca/Makefile +++ b/trunk/drivers/infiniband/hw/mthca/Makefile @@ -1,7 +1,3 @@ -ifdef CONFIG_INFINIBAND_MTHCA_DEBUG -EXTRA_CFLAGS += -DDEBUG -endif - obj-$(CONFIG_INFINIBAND_MTHCA) += ib_mthca.o ib_mthca-y := mthca_main.o mthca_cmd.o mthca_profile.o mthca_reset.o \ diff --git a/trunk/drivers/infiniband/hw/mthca/mthca_dev.h b/trunk/drivers/infiniband/hw/mthca/mthca_dev.h index ad52edbefe98..bb2a9d628d7d 100644 --- a/trunk/drivers/infiniband/hw/mthca/mthca_dev.h +++ b/trunk/drivers/infiniband/hw/mthca/mthca_dev.h @@ -355,8 +355,21 @@ struct mthca_dev { spinlock_t sm_lock; }; -#define mthca_dbg(mdev, format, arg...) \ - dev_dbg(&mdev->pdev->dev, format, ## arg) +#ifdef CONFIG_INFINIBAND_MTHCA_DEBUG +extern int mthca_debug_level; + +#define mthca_dbg(mdev, format, arg...) \ + do { \ + if (mthca_debug_level) \ + dev_printk(KERN_DEBUG, &mdev->pdev->dev, format, ## arg); \ + } while (0) + +#else /* CONFIG_INFINIBAND_MTHCA_DEBUG */ + +#define mthca_dbg(mdev, format, arg...) do { (void) mdev; } while (0) + +#endif /* CONFIG_INFINIBAND_MTHCA_DEBUG */ + #define mthca_err(mdev, format, arg...) \ dev_err(&mdev->pdev->dev, format, ## arg) #define mthca_info(mdev, format, arg...) \ diff --git a/trunk/drivers/infiniband/hw/mthca/mthca_main.c b/trunk/drivers/infiniband/hw/mthca/mthca_main.c index 266f347c6707..597d7dc7088e 100644 --- a/trunk/drivers/infiniband/hw/mthca/mthca_main.c +++ b/trunk/drivers/infiniband/hw/mthca/mthca_main.c @@ -52,6 +52,14 @@ MODULE_DESCRIPTION("Mellanox InfiniBand HCA low-level driver"); MODULE_LICENSE("Dual BSD/GPL"); MODULE_VERSION(DRV_VERSION); +#ifdef CONFIG_INFINIBAND_MTHCA_DEBUG + +int mthca_debug_level = 0; +module_param_named(debug_level, mthca_debug_level, int, 0644); +MODULE_PARM_DESC(debug_level, "Enable debug tracing if > 0"); + +#endif /* CONFIG_INFINIBAND_MTHCA_DEBUG */ + #ifdef CONFIG_PCI_MSI static int msi_x = 0;