Commit 22f99347 authored by Jan Glauber's avatar Jan Glauber Committed by Martin Schwidefsky

[S390] qdio: rework debug feature logging

- make qdio_trace a per device view
- remove s390dbf exceptions
- remove CONFIG_QDIO_DEBUG, not needed anymore if we check for the level
  before calling sprintf
- use snprintf for dbf entries
- add start markers to see if the dbf view wrapped
- add a global error view for all queues
Signed-off-by: default avatarJan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 9a1ce28a
...@@ -347,16 +347,6 @@ config QDIO ...@@ -347,16 +347,6 @@ config QDIO
If unsure, say Y. If unsure, say Y.
config QDIO_DEBUG
bool "Extended debugging information"
depends on QDIO
help
Say Y here to get extended debugging output in
/sys/kernel/debug/s390dbf/qdio...
Warning: this option reduces the performance of the QDIO module.
If unsure, say N.
config CHSC_SCH config CHSC_SCH
tristate "Support for CHSC subchannels" tristate "Support for CHSC subchannels"
help help
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <asm/page.h> #include <asm/page.h>
#include <asm/schid.h> #include <asm/schid.h>
#include <asm/debug.h>
#include "chsc.h" #include "chsc.h"
#define QDIO_BUSY_BIT_PATIENCE 100 /* 100 microseconds */ #define QDIO_BUSY_BIT_PATIENCE 100 /* 100 microseconds */
...@@ -300,11 +301,13 @@ struct qdio_irq { ...@@ -300,11 +301,13 @@ struct qdio_irq {
struct qdio_q *input_qs[QDIO_MAX_QUEUES_PER_IRQ]; struct qdio_q *input_qs[QDIO_MAX_QUEUES_PER_IRQ];
struct qdio_q *output_qs[QDIO_MAX_QUEUES_PER_IRQ]; struct qdio_q *output_qs[QDIO_MAX_QUEUES_PER_IRQ];
debug_info_t *debug_area;
struct mutex setup_mutex; struct mutex setup_mutex;
}; };
/* helper functions */ /* helper functions */
#define queue_type(q) q->irq_ptr->qib.qfmt #define queue_type(q) q->irq_ptr->qib.qfmt
#define SCH_NO(q) (q->irq_ptr->schid.sch_no)
#define is_thinint_irq(irq) \ #define is_thinint_irq(irq) \
(irq->qib.qfmt == QDIO_IQDIO_QFMT || \ (irq->qib.qfmt == QDIO_IQDIO_QFMT || \
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "qdio.h" #include "qdio.h"
debug_info_t *qdio_dbf_setup; debug_info_t *qdio_dbf_setup;
debug_info_t *qdio_dbf_trace; debug_info_t *qdio_dbf_error;
static struct dentry *debugfs_root; static struct dentry *debugfs_root;
#define MAX_DEBUGFS_QUEUES 32 #define MAX_DEBUGFS_QUEUES 32
...@@ -22,59 +22,33 @@ static struct dentry *debugfs_queues[MAX_DEBUGFS_QUEUES] = { NULL }; ...@@ -22,59 +22,33 @@ static struct dentry *debugfs_queues[MAX_DEBUGFS_QUEUES] = { NULL };
static DEFINE_MUTEX(debugfs_mutex); static DEFINE_MUTEX(debugfs_mutex);
#define QDIO_DEBUGFS_NAME_LEN 40 #define QDIO_DEBUGFS_NAME_LEN 40
void qdio_allocate_do_dbf(struct qdio_initialize *init_data) void qdio_allocate_dbf(struct qdio_initialize *init_data,
struct qdio_irq *irq_ptr)
{ {
char dbf_text[20]; char text[20];
sprintf(dbf_text, "qfmt:%x", init_data->q_format); DBF_EVENT("qfmt:%1d", init_data->q_format);
QDIO_DBF_TEXT0(0, setup, dbf_text); DBF_HEX(init_data->adapter_name, 8);
QDIO_DBF_HEX0(0, setup, init_data->adapter_name, 8); DBF_EVENT("qpff%4x", init_data->qib_param_field_format);
sprintf(dbf_text, "qpff%4x", init_data->qib_param_field_format); DBF_HEX(&init_data->qib_param_field, sizeof(void *));
QDIO_DBF_TEXT0(0, setup, dbf_text); DBF_HEX(&init_data->input_slib_elements, sizeof(void *));
QDIO_DBF_HEX0(0, setup, &init_data->qib_param_field, sizeof(void *)); DBF_HEX(&init_data->output_slib_elements, sizeof(void *));
QDIO_DBF_HEX0(0, setup, &init_data->input_slib_elements, sizeof(void *)); DBF_EVENT("niq:%1d noq:%1d", init_data->no_input_qs,
QDIO_DBF_HEX0(0, setup, &init_data->output_slib_elements, sizeof(void *)); init_data->no_output_qs);
sprintf(dbf_text, "niq:%4x", init_data->no_input_qs); DBF_HEX(&init_data->input_handler, sizeof(void *));
QDIO_DBF_TEXT0(0, setup, dbf_text); DBF_HEX(&init_data->output_handler, sizeof(void *));
sprintf(dbf_text, "noq:%4x", init_data->no_output_qs); DBF_HEX(&init_data->int_parm, sizeof(long));
QDIO_DBF_TEXT0(0, setup, dbf_text); DBF_HEX(&init_data->flags, sizeof(long));
QDIO_DBF_HEX0(0, setup, &init_data->input_handler, sizeof(void *)); DBF_HEX(&init_data->input_sbal_addr_array, sizeof(void *));
QDIO_DBF_HEX0(0, setup, &init_data->output_handler, sizeof(void *)); DBF_HEX(&init_data->output_sbal_addr_array, sizeof(void *));
QDIO_DBF_HEX0(0, setup, &init_data->int_parm, sizeof(long)); DBF_EVENT("irq:%8lx", (unsigned long)irq_ptr);
QDIO_DBF_HEX0(0, setup, &init_data->flags, sizeof(long));
QDIO_DBF_HEX0(0, setup, &init_data->input_sbal_addr_array, sizeof(void *)); /* allocate trace view for the interface */
QDIO_DBF_HEX0(0, setup, &init_data->output_sbal_addr_array, sizeof(void *)); snprintf(text, 20, "qdio_%s", dev_name(&init_data->cdev->dev));
} irq_ptr->debug_area = debug_register(text, 2, 1, 16);
debug_register_view(irq_ptr->debug_area, &debug_hex_ascii_view);
static void qdio_unregister_dbf_views(void) debug_set_level(irq_ptr->debug_area, DBF_WARN);
{ DBF_DEV_EVENT(DBF_ERR, irq_ptr, "dbf created");
if (qdio_dbf_setup)
debug_unregister(qdio_dbf_setup);
if (qdio_dbf_trace)
debug_unregister(qdio_dbf_trace);
}
static int qdio_register_dbf_views(void)
{
qdio_dbf_setup = debug_register("qdio_setup", QDIO_DBF_SETUP_PAGES,
QDIO_DBF_SETUP_NR_AREAS,
QDIO_DBF_SETUP_LEN);
if (!qdio_dbf_setup)
goto oom;
debug_register_view(qdio_dbf_setup, &debug_hex_ascii_view);
debug_set_level(qdio_dbf_setup, QDIO_DBF_SETUP_LEVEL);
qdio_dbf_trace = debug_register("qdio_trace", QDIO_DBF_TRACE_PAGES,
QDIO_DBF_TRACE_NR_AREAS,
QDIO_DBF_TRACE_LEN);
if (!qdio_dbf_trace)
goto oom;
debug_register_view(qdio_dbf_trace, &debug_hex_ascii_view);
debug_set_level(qdio_dbf_trace, QDIO_DBF_TRACE_LEVEL);
return 0;
oom:
qdio_unregister_dbf_views();
return -ENOMEM;
} }
static int qstat_show(struct seq_file *m, void *v) static int qstat_show(struct seq_file *m, void *v)
...@@ -223,11 +197,24 @@ void qdio_shutdown_debug_entries(struct qdio_irq *irq_ptr, struct ccw_device *cd ...@@ -223,11 +197,24 @@ void qdio_shutdown_debug_entries(struct qdio_irq *irq_ptr, struct ccw_device *cd
int __init qdio_debug_init(void) int __init qdio_debug_init(void)
{ {
debugfs_root = debugfs_create_dir("qdio_queues", NULL); debugfs_root = debugfs_create_dir("qdio_queues", NULL);
return qdio_register_dbf_views();
qdio_dbf_setup = debug_register("qdio_setup", 16, 1, 16);
debug_register_view(qdio_dbf_setup, &debug_hex_ascii_view);
debug_set_level(qdio_dbf_setup, DBF_INFO);
DBF_EVENT("dbf created\n");
qdio_dbf_error = debug_register("qdio_error", 4, 1, 16);
debug_register_view(qdio_dbf_error, &debug_hex_ascii_view);
debug_set_level(qdio_dbf_error, DBF_INFO);
DBF_ERROR("dbf created\n");
return 0;
} }
void qdio_debug_exit(void) void qdio_debug_exit(void)
{ {
debugfs_remove(debugfs_root); debugfs_remove(debugfs_root);
qdio_unregister_dbf_views(); if (qdio_dbf_setup)
debug_unregister(qdio_dbf_setup);
if (qdio_dbf_error)
debug_unregister(qdio_dbf_error);
} }
...@@ -12,80 +12,72 @@ ...@@ -12,80 +12,72 @@
#include <asm/qdio.h> #include <asm/qdio.h>
#include "qdio.h" #include "qdio.h"
#define QDIO_DBF_HEX(ex, name, level, addr, len) \ /* that gives us 15 characters in the text event views */
#define QDIO_DBF_LEN 16
extern debug_info_t *qdio_dbf_setup;
extern debug_info_t *qdio_dbf_error;
/* sort out low debug levels early to avoid wasted sprints */
static inline int qdio_dbf_passes(debug_info_t *dbf_grp, int level)
{
return (level <= dbf_grp->level);
}
#define DBF_ERR 3 /* error conditions */
#define DBF_WARN 4 /* warning conditions */
#define DBF_INFO 6 /* informational */
#undef DBF_EVENT
#undef DBF_ERROR
#undef DBF_DEV_EVENT
#define DBF_EVENT(text...) \
do { \ do { \
if (ex) \ char debug_buffer[QDIO_DBF_LEN]; \
debug_exception(qdio_dbf_##name, level, (void *)(addr), len); \ snprintf(debug_buffer, QDIO_DBF_LEN, text); \
else \ debug_text_event(qdio_dbf_setup, DBF_ERR, debug_buffer); \
debug_event(qdio_dbf_##name, level, (void *)(addr), len); \
} while (0) } while (0)
#define QDIO_DBF_TEXT(ex, name, level, text) \
#define DBF_HEX(addr, len) \
do { \ do { \
if (ex) \ debug_event(qdio_dbf_setup, DBF_ERR, (void*)(addr), len); \
debug_text_exception(qdio_dbf_##name, level, text); \
else \
debug_text_event(qdio_dbf_##name, level, text); \
} while (0) } while (0)
#define QDIO_DBF_HEX0(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 0, addr, len) #define DBF_ERROR(text...) \
#define QDIO_DBF_HEX1(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 1, addr, len) do { \
#define QDIO_DBF_HEX2(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 2, addr, len) char debug_buffer[QDIO_DBF_LEN]; \
snprintf(debug_buffer, QDIO_DBF_LEN, text); \
#ifdef CONFIG_QDIO_DEBUG debug_text_event(qdio_dbf_error, DBF_ERR, debug_buffer); \
#define QDIO_DBF_HEX3(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 3, addr, len) } while (0)
#define QDIO_DBF_HEX4(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 4, addr, len)
#define QDIO_DBF_HEX5(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 5, addr, len)
#define QDIO_DBF_HEX6(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 6, addr, len)
#else
#define QDIO_DBF_HEX3(ex, name, addr, len) do {} while (0)
#define QDIO_DBF_HEX4(ex, name, addr, len) do {} while (0)
#define QDIO_DBF_HEX5(ex, name, addr, len) do {} while (0)
#define QDIO_DBF_HEX6(ex, name, addr, len) do {} while (0)
#endif /* CONFIG_QDIO_DEBUG */
#define QDIO_DBF_TEXT0(ex, name, text) QDIO_DBF_TEXT(ex, name, 0, text)
#define QDIO_DBF_TEXT1(ex, name, text) QDIO_DBF_TEXT(ex, name, 1, text)
#define QDIO_DBF_TEXT2(ex, name, text) QDIO_DBF_TEXT(ex, name, 2, text)
#ifdef CONFIG_QDIO_DEBUG
#define QDIO_DBF_TEXT3(ex, name, text) QDIO_DBF_TEXT(ex, name, 3, text)
#define QDIO_DBF_TEXT4(ex, name, text) QDIO_DBF_TEXT(ex, name, 4, text)
#define QDIO_DBF_TEXT5(ex, name, text) QDIO_DBF_TEXT(ex, name, 5, text)
#define QDIO_DBF_TEXT6(ex, name, text) QDIO_DBF_TEXT(ex, name, 6, text)
#else
#define QDIO_DBF_TEXT3(ex, name, text) do {} while (0)
#define QDIO_DBF_TEXT4(ex, name, text) do {} while (0)
#define QDIO_DBF_TEXT5(ex, name, text) do {} while (0)
#define QDIO_DBF_TEXT6(ex, name, text) do {} while (0)
#endif /* CONFIG_QDIO_DEBUG */
/* s390dbf views */ #define DBF_ERROR_HEX(addr, len) \
#define QDIO_DBF_SETUP_LEN 8 do { \
#define QDIO_DBF_SETUP_PAGES 8 debug_event(qdio_dbf_error, DBF_ERR, (void*)(addr), len); \
#define QDIO_DBF_SETUP_NR_AREAS 1 } while (0)
#define QDIO_DBF_TRACE_LEN 8
#define QDIO_DBF_TRACE_NR_AREAS 2
#ifdef CONFIG_QDIO_DEBUG #define DBF_DEV_EVENT(level, device, text...) \
#define QDIO_DBF_TRACE_PAGES 32 do { \
#define QDIO_DBF_SETUP_LEVEL 6 char debug_buffer[QDIO_DBF_LEN]; \
#define QDIO_DBF_TRACE_LEVEL 4 if (qdio_dbf_passes(device->debug_area, level)) { \
#else /* !CONFIG_QDIO_DEBUG */ snprintf(debug_buffer, QDIO_DBF_LEN, text); \
#define QDIO_DBF_TRACE_PAGES 8 debug_text_event(device->debug_area, level, debug_buffer); \
#define QDIO_DBF_SETUP_LEVEL 2 } \
#define QDIO_DBF_TRACE_LEVEL 2 } while (0)
#endif /* CONFIG_QDIO_DEBUG */
extern debug_info_t *qdio_dbf_setup; #define DBF_DEV_HEX(level, device, addr, len) \
extern debug_info_t *qdio_dbf_trace; do { \
debug_event(device->debug_area, level, (void*)(addr), len); \
} while (0)
void qdio_allocate_do_dbf(struct qdio_initialize *init_data); void qdio_allocate_dbf(struct qdio_initialize *init_data,
void debug_print_bstat(struct qdio_q *q); struct qdio_irq *irq_ptr);
void qdio_setup_debug_entries(struct qdio_irq *irq_ptr, void qdio_setup_debug_entries(struct qdio_irq *irq_ptr,
struct ccw_device *cdev); struct ccw_device *cdev);
void qdio_shutdown_debug_entries(struct qdio_irq *irq_ptr, void qdio_shutdown_debug_entries(struct qdio_irq *irq_ptr,
struct ccw_device *cdev); struct ccw_device *cdev);
int qdio_debug_init(void); int qdio_debug_init(void);
void qdio_debug_exit(void); void qdio_debug_exit(void);
#endif #endif
This diff is collapsed.
...@@ -120,14 +120,12 @@ static void setup_queues_misc(struct qdio_q *q, struct qdio_irq *irq_ptr, ...@@ -120,14 +120,12 @@ static void setup_queues_misc(struct qdio_q *q, struct qdio_irq *irq_ptr,
} }
static void setup_storage_lists(struct qdio_q *q, struct qdio_irq *irq_ptr, static void setup_storage_lists(struct qdio_q *q, struct qdio_irq *irq_ptr,
void **sbals_array, char *dbf_text, int i) void **sbals_array, int i)
{ {
struct qdio_q *prev; struct qdio_q *prev;
int j; int j;
QDIO_DBF_TEXT0(0, setup, dbf_text); DBF_HEX(&q, sizeof(void *));
QDIO_DBF_HEX0(0, setup, &q, sizeof(void *));
q->sl = (struct sl *)((char *)q->slib + PAGE_SIZE / 2); q->sl = (struct sl *)((char *)q->slib + PAGE_SIZE / 2);
/* fill in sbal */ /* fill in sbal */
...@@ -150,31 +148,27 @@ static void setup_storage_lists(struct qdio_q *q, struct qdio_irq *irq_ptr, ...@@ -150,31 +148,27 @@ static void setup_storage_lists(struct qdio_q *q, struct qdio_irq *irq_ptr,
for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; j++) for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; j++)
q->sl->element[j].sbal = (unsigned long)q->sbal[j]; q->sl->element[j].sbal = (unsigned long)q->sbal[j];
QDIO_DBF_TEXT2(0, setup, "sl-sb-b0"); DBF_EVENT("sl-slsb-sbal");
QDIO_DBF_HEX2(0, setup, q->sl, sizeof(void *)); DBF_HEX(q->sl, sizeof(void *));
QDIO_DBF_HEX2(0, setup, &q->slsb, sizeof(void *)); DBF_HEX(&q->slsb, sizeof(void *));
QDIO_DBF_HEX2(0, setup, q->sbal, sizeof(void *)); DBF_HEX(q->sbal, sizeof(void *));
} }
static void setup_queues(struct qdio_irq *irq_ptr, static void setup_queues(struct qdio_irq *irq_ptr,
struct qdio_initialize *qdio_init) struct qdio_initialize *qdio_init)
{ {
char dbf_text[20];
struct qdio_q *q; struct qdio_q *q;
void **input_sbal_array = qdio_init->input_sbal_addr_array; void **input_sbal_array = qdio_init->input_sbal_addr_array;
void **output_sbal_array = qdio_init->output_sbal_addr_array; void **output_sbal_array = qdio_init->output_sbal_addr_array;
int i; int i;
sprintf(dbf_text, "qset%4x", qdio_init->cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
for_each_input_queue(irq_ptr, q, i) { for_each_input_queue(irq_ptr, q, i) {
sprintf(dbf_text, "in-q%4x", i); DBF_EVENT("in-q:%1d", i);
setup_queues_misc(q, irq_ptr, qdio_init->input_handler, i); setup_queues_misc(q, irq_ptr, qdio_init->input_handler, i);
q->is_input_q = 1; q->is_input_q = 1;
spin_lock_init(&q->u.in.lock); spin_lock_init(&q->u.in.lock);
setup_storage_lists(q, irq_ptr, input_sbal_array, dbf_text, i); setup_storage_lists(q, irq_ptr, input_sbal_array, i);
input_sbal_array += QDIO_MAX_BUFFERS_PER_Q; input_sbal_array += QDIO_MAX_BUFFERS_PER_Q;
if (is_thinint_irq(irq_ptr)) if (is_thinint_irq(irq_ptr))
...@@ -186,12 +180,11 @@ static void setup_queues(struct qdio_irq *irq_ptr, ...@@ -186,12 +180,11 @@ static void setup_queues(struct qdio_irq *irq_ptr,
} }
for_each_output_queue(irq_ptr, q, i) { for_each_output_queue(irq_ptr, q, i) {
sprintf(dbf_text, "outq%4x", i); DBF_EVENT("outq:%1d", i);
setup_queues_misc(q, irq_ptr, qdio_init->output_handler, i); setup_queues_misc(q, irq_ptr, qdio_init->output_handler, i);
q->is_input_q = 0; q->is_input_q = 0;
setup_storage_lists(q, irq_ptr, output_sbal_array, setup_storage_lists(q, irq_ptr, output_sbal_array, i);
dbf_text, i);
output_sbal_array += QDIO_MAX_BUFFERS_PER_Q; output_sbal_array += QDIO_MAX_BUFFERS_PER_Q;
tasklet_init(&q->tasklet, qdio_outbound_processing, tasklet_init(&q->tasklet, qdio_outbound_processing,
...@@ -222,8 +215,6 @@ static void process_ac_flags(struct qdio_irq *irq_ptr, unsigned char qdioac) ...@@ -222,8 +215,6 @@ static void process_ac_flags(struct qdio_irq *irq_ptr, unsigned char qdioac)
static void check_and_setup_qebsm(struct qdio_irq *irq_ptr, static void check_and_setup_qebsm(struct qdio_irq *irq_ptr,
unsigned char qdioac, unsigned long token) unsigned char qdioac, unsigned long token)
{ {
char dbf_text[15];
if (!(irq_ptr->qib.rflags & QIB_RFLAGS_ENABLE_QEBSM)) if (!(irq_ptr->qib.rflags & QIB_RFLAGS_ENABLE_QEBSM))
goto no_qebsm; goto no_qebsm;
if (!(qdioac & AC1_SC_QEBSM_AVAILABLE) || if (!(qdioac & AC1_SC_QEBSM_AVAILABLE) ||
...@@ -232,15 +223,14 @@ static void check_and_setup_qebsm(struct qdio_irq *irq_ptr, ...@@ -232,15 +223,14 @@ static void check_and_setup_qebsm(struct qdio_irq *irq_ptr,
irq_ptr->sch_token = token; irq_ptr->sch_token = token;
QDIO_DBF_TEXT0(0, setup, "V=V:1"); DBF_EVENT("V=V:1");
sprintf(dbf_text, "%8lx", irq_ptr->sch_token); DBF_EVENT("%8lx", irq_ptr->sch_token);
QDIO_DBF_TEXT0(0, setup, dbf_text);
return; return;
no_qebsm: no_qebsm:
irq_ptr->sch_token = 0; irq_ptr->sch_token = 0;
irq_ptr->qib.rflags &= ~QIB_RFLAGS_ENABLE_QEBSM; irq_ptr->qib.rflags &= ~QIB_RFLAGS_ENABLE_QEBSM;
QDIO_DBF_TEXT0(0, setup, "noV=V"); DBF_EVENT("noV=V");
} }
/* /*
...@@ -254,7 +244,7 @@ int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr, ...@@ -254,7 +244,7 @@ int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr,
struct chsc_ssqd_area *ssqd; struct chsc_ssqd_area *ssqd;
int rc; int rc;
QDIO_DBF_TEXT0(0, setup, "getssqd"); DBF_EVENT("getssqd:%4x", schid->sch_no);
if (irq_ptr != NULL) if (irq_ptr != NULL)
ssqd = (struct chsc_ssqd_area *)irq_ptr->chsc_page; ssqd = (struct chsc_ssqd_area *)irq_ptr->chsc_page;
else else
...@@ -294,16 +284,12 @@ int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr, ...@@ -294,16 +284,12 @@ int qdio_setup_get_ssqd(struct qdio_irq *irq_ptr,
void qdio_setup_ssqd_info(struct qdio_irq *irq_ptr) void qdio_setup_ssqd_info(struct qdio_irq *irq_ptr)
{ {
unsigned char qdioac; unsigned char qdioac;
char dbf_text[15];
int rc; int rc;
rc = qdio_setup_get_ssqd(irq_ptr, &irq_ptr->schid, NULL); rc = qdio_setup_get_ssqd(irq_ptr, &irq_ptr->schid, NULL);
if (rc) { if (rc) {
QDIO_DBF_TEXT2(0, setup, "ssqdasig"); DBF_ERROR("%4x ssqd ERR", irq_ptr->schid.sch_no);
sprintf(dbf_text, "schn%4x", irq_ptr->schid.sch_no); DBF_ERROR("rc:%x", rc);
QDIO_DBF_TEXT2(0, setup, dbf_text);
sprintf(dbf_text, "rc:%d", rc);
QDIO_DBF_TEXT2(0, setup, dbf_text);
/* all flags set, worst case */ /* all flags set, worst case */
qdioac = AC1_SIGA_INPUT_NEEDED | AC1_SIGA_OUTPUT_NEEDED | qdioac = AC1_SIGA_INPUT_NEEDED | AC1_SIGA_OUTPUT_NEEDED |
AC1_SIGA_SYNC_NEEDED; AC1_SIGA_SYNC_NEEDED;
...@@ -312,9 +298,7 @@ void qdio_setup_ssqd_info(struct qdio_irq *irq_ptr) ...@@ -312,9 +298,7 @@ void qdio_setup_ssqd_info(struct qdio_irq *irq_ptr)
check_and_setup_qebsm(irq_ptr, qdioac, irq_ptr->ssqd_desc.sch_token); check_and_setup_qebsm(irq_ptr, qdioac, irq_ptr->ssqd_desc.sch_token);
process_ac_flags(irq_ptr, qdioac); process_ac_flags(irq_ptr, qdioac);
DBF_EVENT("qdioac:%4x", qdioac);
sprintf(dbf_text, "qdioac%2x", qdioac);
QDIO_DBF_TEXT2(0, setup, dbf_text);
} }
void qdio_release_memory(struct qdio_irq *irq_ptr) void qdio_release_memory(struct qdio_irq *irq_ptr)
...@@ -434,7 +418,7 @@ int qdio_setup_irq(struct qdio_initialize *init_data) ...@@ -434,7 +418,7 @@ int qdio_setup_irq(struct qdio_initialize *init_data)
/* get qdio commands */ /* get qdio commands */
ciw = ccw_device_get_ciw(init_data->cdev, CIW_TYPE_EQUEUE); ciw = ccw_device_get_ciw(init_data->cdev, CIW_TYPE_EQUEUE);
if (!ciw) { if (!ciw) {
QDIO_DBF_TEXT2(1, setup, "no eq"); DBF_ERROR("%4x NO EQ", irq_ptr->schid.sch_no);
rc = -EINVAL; rc = -EINVAL;
goto out_err; goto out_err;
} }
...@@ -442,7 +426,7 @@ int qdio_setup_irq(struct qdio_initialize *init_data) ...@@ -442,7 +426,7 @@ int qdio_setup_irq(struct qdio_initialize *init_data)
ciw = ccw_device_get_ciw(init_data->cdev, CIW_TYPE_AQUEUE); ciw = ccw_device_get_ciw(init_data->cdev, CIW_TYPE_AQUEUE);
if (!ciw) { if (!ciw) {
QDIO_DBF_TEXT2(1, setup, "no aq"); DBF_ERROR("%4x NO AQ", irq_ptr->schid.sch_no);
rc = -EINVAL; rc = -EINVAL;
goto out_err; goto out_err;
} }
...@@ -462,56 +446,38 @@ void qdio_print_subchannel_info(struct qdio_irq *irq_ptr, ...@@ -462,56 +446,38 @@ void qdio_print_subchannel_info(struct qdio_irq *irq_ptr,
{ {
char s[80]; char s[80];
sprintf(s, "qdio: %s ", dev_name(&cdev->dev)); snprintf(s, 80, "qdio: %s %s on SC %x using "
switch (irq_ptr->qib.qfmt) { "AI:%d QEBSM:%d PCI:%d TDD:%d SIGA:%s%s%s%s%s%s\n",
case QDIO_QETH_QFMT: dev_name(&cdev->dev),
sprintf(s + strlen(s), "OSA "); (irq_ptr->qib.qfmt == QDIO_QETH_QFMT) ? "OSA" :
break; ((irq_ptr->qib.qfmt == QDIO_ZFCP_QFMT) ? "ZFCP" : "HS"),
case QDIO_ZFCP_QFMT: irq_ptr->schid.sch_no,
sprintf(s + strlen(s), "ZFCP "); is_thinint_irq(irq_ptr),
break; (irq_ptr->sch_token) ? 1 : 0,
case QDIO_IQDIO_QFMT: (irq_ptr->qib.ac & QIB_AC_OUTBOUND_PCI_SUPPORTED) ? 1 : 0,
sprintf(s + strlen(s), "HS "); css_general_characteristics.aif_tdd,
break; (irq_ptr->siga_flag.input) ? "R" : " ",
} (irq_ptr->siga_flag.output) ? "W" : " ",
sprintf(s + strlen(s), "on SC %x using ", irq_ptr->schid.sch_no); (irq_ptr->siga_flag.sync) ? "S" : " ",
sprintf(s + strlen(s), "AI:%d ", is_thinint_irq(irq_ptr)); (!irq_ptr->siga_flag.no_sync_ti) ? "A" : " ",
sprintf(s + strlen(s), "QEBSM:%d ", (irq_ptr->sch_token) ? 1 : 0); (!irq_ptr->siga_flag.no_sync_out_ti) ? "O" : " ",
sprintf(s + strlen(s), "PCI:%d ",
(irq_ptr->qib.ac & QIB_AC_OUTBOUND_PCI_SUPPORTED) ? 1 : 0);
sprintf(s + strlen(s), "TDD:%d ", css_general_characteristics.aif_tdd);
sprintf(s + strlen(s), "SIGA:");
sprintf(s + strlen(s), "%s", (irq_ptr->siga_flag.input) ? "R" : " ");
sprintf(s + strlen(s), "%s", (irq_ptr->siga_flag.output) ? "W" : " ");
sprintf(s + strlen(s), "%s", (irq_ptr->siga_flag.sync) ? "S" : " ");
sprintf(s + strlen(s), "%s",
(!irq_ptr->siga_flag.no_sync_ti) ? "A" : " ");
sprintf(s + strlen(s), "%s",
(!irq_ptr->siga_flag.no_sync_out_ti) ? "O" : " ");
sprintf(s + strlen(s), "%s",
(!irq_ptr->siga_flag.no_sync_out_pci) ? "P" : " "); (!irq_ptr->siga_flag.no_sync_out_pci) ? "P" : " ");
sprintf(s + strlen(s), "\n");
printk(KERN_INFO "%s", s); printk(KERN_INFO "%s", s);
} }
int __init qdio_setup_init(void) int __init qdio_setup_init(void)
{ {
char dbf_text[15];
qdio_q_cache = kmem_cache_create("qdio_q", sizeof(struct qdio_q), qdio_q_cache = kmem_cache_create("qdio_q", sizeof(struct qdio_q),
256, 0, NULL); 256, 0, NULL);
if (!qdio_q_cache) if (!qdio_q_cache)
return -ENOMEM; return -ENOMEM;
/* Check for OSA/FCP thin interrupts (bit 67). */ /* Check for OSA/FCP thin interrupts (bit 67). */
sprintf(dbf_text, "thini%1x", DBF_EVENT("thinint:%1d",
(css_general_characteristics.aif_osa) ? 1 : 0); (css_general_characteristics.aif_osa) ? 1 : 0);
QDIO_DBF_TEXT0(0, setup, dbf_text);
/* Check for QEBSM support in general (bit 58). */ /* Check for QEBSM support in general (bit 58). */
sprintf(dbf_text, "cssQBS:%1x", DBF_EVENT("cssQEBSM:%1d", (qebsm_possible()) ? 1 : 0);
(qebsm_possible()) ? 1 : 0);
QDIO_DBF_TEXT0(0, setup, dbf_text);
return 0; return 0;
} }
......
...@@ -258,8 +258,6 @@ static void tiqdio_thinint_handler(void *ind, void *drv_data) ...@@ -258,8 +258,6 @@ static void tiqdio_thinint_handler(void *ind, void *drv_data)
static int set_subchannel_ind(struct qdio_irq *irq_ptr, int reset) static int set_subchannel_ind(struct qdio_irq *irq_ptr, int reset)
{ {
struct scssc_area *scssc_area; struct scssc_area *scssc_area;
char dbf_text[15];
void *ptr;
int rc; int rc;
scssc_area = (struct scssc_area *)irq_ptr->chsc_page; scssc_area = (struct scssc_area *)irq_ptr->chsc_page;
...@@ -294,19 +292,15 @@ static int set_subchannel_ind(struct qdio_irq *irq_ptr, int reset) ...@@ -294,19 +292,15 @@ static int set_subchannel_ind(struct qdio_irq *irq_ptr, int reset)
rc = chsc_error_from_response(scssc_area->response.code); rc = chsc_error_from_response(scssc_area->response.code);
if (rc) { if (rc) {
sprintf(dbf_text, "sidR%4x", scssc_area->response.code); DBF_ERROR("%4x SSI r:%4x", irq_ptr->schid.sch_no,
QDIO_DBF_TEXT1(0, trace, dbf_text); scssc_area->response.code);
QDIO_DBF_TEXT1(0, setup, dbf_text); DBF_ERROR_HEX(&scssc_area->response, sizeof(void *));
ptr = &scssc_area->response;
QDIO_DBF_HEX2(1, setup, &ptr, QDIO_DBF_SETUP_LEN);
return rc; return rc;
} }
QDIO_DBF_TEXT2(0, setup, "setscind"); DBF_EVENT("setscind");
QDIO_DBF_HEX2(0, setup, &scssc_area->summary_indicator_addr, DBF_HEX(&scssc_area->summary_indicator_addr, sizeof(unsigned long));
sizeof(unsigned long)); DBF_HEX(&scssc_area->subchannel_indicator_addr, sizeof(unsigned long));
QDIO_DBF_HEX2(0, setup, &scssc_area->subchannel_indicator_addr,
sizeof(unsigned long));
return 0; return 0;
} }
...@@ -327,14 +321,11 @@ void tiqdio_free_memory(void) ...@@ -327,14 +321,11 @@ void tiqdio_free_memory(void)
int __init tiqdio_register_thinints(void) int __init tiqdio_register_thinints(void)
{ {
char dbf_text[20];
isc_register(QDIO_AIRQ_ISC); isc_register(QDIO_AIRQ_ISC);
tiqdio_alsi = s390_register_adapter_interrupt(&tiqdio_thinint_handler, tiqdio_alsi = s390_register_adapter_interrupt(&tiqdio_thinint_handler,
NULL, QDIO_AIRQ_ISC); NULL, QDIO_AIRQ_ISC);
if (IS_ERR(tiqdio_alsi)) { if (IS_ERR(tiqdio_alsi)) {
sprintf(dbf_text, "regthn%lx", PTR_ERR(tiqdio_alsi)); DBF_EVENT("RTI:%lx", PTR_ERR(tiqdio_alsi));
QDIO_DBF_TEXT0(0, setup, dbf_text);
tiqdio_alsi = NULL; tiqdio_alsi = NULL;
isc_unregister(QDIO_AIRQ_ISC); isc_unregister(QDIO_AIRQ_ISC);
return -ENOMEM; return -ENOMEM;
...@@ -360,7 +351,7 @@ void qdio_setup_thinint(struct qdio_irq *irq_ptr) ...@@ -360,7 +351,7 @@ void qdio_setup_thinint(struct qdio_irq *irq_ptr)
if (!is_thinint_irq(irq_ptr)) if (!is_thinint_irq(irq_ptr))
return; return;
irq_ptr->dsci = get_indicator(); irq_ptr->dsci = get_indicator();
QDIO_DBF_HEX1(0, setup, &irq_ptr->dsci, sizeof(void *)); DBF_HEX(&irq_ptr->dsci, sizeof(void *));
} }
void qdio_shutdown_thinint(struct qdio_irq *irq_ptr) void qdio_shutdown_thinint(struct qdio_irq *irq_ptr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment