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
...@@ -95,8 +95,6 @@ static inline int do_siga_output(unsigned long schid, unsigned long mask, ...@@ -95,8 +95,6 @@ static inline int do_siga_output(unsigned long schid, unsigned long mask,
static inline int qdio_check_ccq(struct qdio_q *q, unsigned int ccq) static inline int qdio_check_ccq(struct qdio_q *q, unsigned int ccq)
{ {
char dbf_text[15];
/* all done or next buffer state different */ /* all done or next buffer state different */
if (ccq == 0 || ccq == 32) if (ccq == 0 || ccq == 32)
return 0; return 0;
...@@ -104,8 +102,7 @@ static inline int qdio_check_ccq(struct qdio_q *q, unsigned int ccq) ...@@ -104,8 +102,7 @@ static inline int qdio_check_ccq(struct qdio_q *q, unsigned int ccq)
if (ccq == 96 || ccq == 97) if (ccq == 96 || ccq == 97)
return 1; return 1;
/* notify devices immediately */ /* notify devices immediately */
sprintf(dbf_text, "%d", ccq); DBF_ERROR("%4x ccq:%3d", SCH_NO(q), ccq);
QDIO_DBF_TEXT2(1, trace, dbf_text);
return -EIO; return -EIO;
} }
...@@ -126,7 +123,6 @@ static int qdio_do_eqbs(struct qdio_q *q, unsigned char *state, ...@@ -126,7 +123,6 @@ static int qdio_do_eqbs(struct qdio_q *q, unsigned char *state,
int tmp_count = count, tmp_start = start; int tmp_count = count, tmp_start = start;
int nr = q->nr; int nr = q->nr;
int rc; int rc;
char dbf_text[15];
BUG_ON(!q->irq_ptr->sch_token); BUG_ON(!q->irq_ptr->sch_token);
qdio_perf_stat_inc(&perf_stats.debug_eqbs_all); qdio_perf_stat_inc(&perf_stats.debug_eqbs_all);
...@@ -144,15 +140,15 @@ static int qdio_do_eqbs(struct qdio_q *q, unsigned char *state, ...@@ -144,15 +140,15 @@ static int qdio_do_eqbs(struct qdio_q *q, unsigned char *state,
qdio_perf_stat_inc(&perf_stats.debug_eqbs_incomplete); qdio_perf_stat_inc(&perf_stats.debug_eqbs_incomplete);
return (count - tmp_count); return (count - tmp_count);
} }
if (rc == 1) { if (rc == 1) {
QDIO_DBF_TEXT5(1, trace, "eqAGAIN"); DBF_DEV_EVENT(DBF_WARN, q->irq_ptr, "EQBS again:%2d", ccq);
goto again; goto again;
} }
if (rc < 0) { if (rc < 0) {
QDIO_DBF_TEXT2(1, trace, "eqberr"); DBF_ERROR("%4x EQBS ERROR", SCH_NO(q));
sprintf(dbf_text, "%2x,%2x,%d,%d", count, tmp_count, ccq, nr); DBF_ERROR("%3d%3d%2d", count, tmp_count, nr);
QDIO_DBF_TEXT2(1, trace, dbf_text);
q->handler(q->irq_ptr->cdev, q->handler(q->irq_ptr->cdev,
QDIO_ERROR_ACTIVATE_CHECK_CONDITION, QDIO_ERROR_ACTIVATE_CHECK_CONDITION,
0, -1, -1, q->irq_ptr->int_parm); 0, -1, -1, q->irq_ptr->int_parm);
...@@ -179,7 +175,6 @@ static int qdio_do_sqbs(struct qdio_q *q, unsigned char state, int start, ...@@ -179,7 +175,6 @@ static int qdio_do_sqbs(struct qdio_q *q, unsigned char state, int start,
int tmp_count = count, tmp_start = start; int tmp_count = count, tmp_start = start;
int nr = q->nr; int nr = q->nr;
int rc; int rc;
char dbf_text[15];
BUG_ON(!q->irq_ptr->sch_token); BUG_ON(!q->irq_ptr->sch_token);
qdio_perf_stat_inc(&perf_stats.debug_sqbs_all); qdio_perf_stat_inc(&perf_stats.debug_sqbs_all);
...@@ -190,17 +185,13 @@ static int qdio_do_sqbs(struct qdio_q *q, unsigned char state, int start, ...@@ -190,17 +185,13 @@ static int qdio_do_sqbs(struct qdio_q *q, unsigned char state, int start,
ccq = do_sqbs(q->irq_ptr->sch_token, state, nr, &tmp_start, &tmp_count); ccq = do_sqbs(q->irq_ptr->sch_token, state, nr, &tmp_start, &tmp_count);
rc = qdio_check_ccq(q, ccq); rc = qdio_check_ccq(q, ccq);
if (rc == 1) { if (rc == 1) {
QDIO_DBF_TEXT5(1, trace, "sqAGAIN"); DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "SQBS again:%2d", ccq);
qdio_perf_stat_inc(&perf_stats.debug_sqbs_incomplete); qdio_perf_stat_inc(&perf_stats.debug_sqbs_incomplete);
goto again; goto again;
} }
if (rc < 0) { if (rc < 0) {
QDIO_DBF_TEXT3(1, trace, "sqberr"); DBF_ERROR("%4x SQBS ERROR", SCH_NO(q));
sprintf(dbf_text, "%2x,%2x", count, tmp_count); DBF_ERROR("%3d%3d%2d", count, tmp_count, nr);
QDIO_DBF_TEXT3(1, trace, dbf_text);
sprintf(dbf_text, "%d,%d", ccq, nr);
QDIO_DBF_TEXT3(1, trace, dbf_text);
q->handler(q->irq_ptr->cdev, q->handler(q->irq_ptr->cdev,
QDIO_ERROR_ACTIVATE_CHECK_CONDITION, QDIO_ERROR_ACTIVATE_CHECK_CONDITION,
0, -1, -1, q->irq_ptr->int_parm); 0, -1, -1, q->irq_ptr->int_parm);
...@@ -287,14 +278,13 @@ static int qdio_siga_sync(struct qdio_q *q, unsigned int output, ...@@ -287,14 +278,13 @@ static int qdio_siga_sync(struct qdio_q *q, unsigned int output,
if (!need_siga_sync(q)) if (!need_siga_sync(q))
return 0; return 0;
DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "siga-s:");
DBF_DEV_HEX(DBF_INFO, q->irq_ptr, q, sizeof(void *));
qdio_perf_stat_inc(&perf_stats.siga_sync); qdio_perf_stat_inc(&perf_stats.siga_sync);
cc = do_siga_sync(q->irq_ptr->schid, output, input); cc = do_siga_sync(q->irq_ptr->schid, output, input);
if (cc) { if (cc)
QDIO_DBF_TEXT4(0, trace, "sigasync"); DBF_ERROR("%4x SIGA-S:%2d", SCH_NO(q), cc);
QDIO_DBF_HEX4(0, trace, &q, sizeof(void *));
QDIO_DBF_HEX3(0, trace, &cc, sizeof(int *));
}
return cc; return cc;
} }
...@@ -338,17 +328,13 @@ static int qdio_siga_output(struct qdio_q *q) ...@@ -338,17 +328,13 @@ static int qdio_siga_output(struct qdio_q *q)
int cc; int cc;
u32 busy_bit; u32 busy_bit;
u64 start_time = 0; u64 start_time = 0;
char dbf_text[15];
QDIO_DBF_TEXT5(0, trace, "sigaout");
QDIO_DBF_HEX5(0, trace, &q, sizeof(void *));
DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "siga-w:%1d", q->nr);
qdio_perf_stat_inc(&perf_stats.siga_out); qdio_perf_stat_inc(&perf_stats.siga_out);
again: again:
cc = qdio_do_siga_output(q, &busy_bit); cc = qdio_do_siga_output(q, &busy_bit);
if (queue_type(q) == QDIO_IQDIO_QFMT && cc == 2 && busy_bit) { if (queue_type(q) == QDIO_IQDIO_QFMT && cc == 2 && busy_bit) {
sprintf(dbf_text, "bb%4x%2x", q->irq_ptr->schid.sch_no, q->nr); DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "siga-w bb:%2d", q->nr);
QDIO_DBF_TEXT3(0, trace, dbf_text);
if (!start_time) if (!start_time)
start_time = get_usecs(); start_time = get_usecs();
...@@ -359,7 +345,7 @@ static int qdio_siga_output(struct qdio_q *q) ...@@ -359,7 +345,7 @@ static int qdio_siga_output(struct qdio_q *q)
if (cc == 2 && busy_bit) if (cc == 2 && busy_bit)
cc |= QDIO_ERROR_SIGA_BUSY; cc |= QDIO_ERROR_SIGA_BUSY;
if (cc) if (cc)
QDIO_DBF_HEX3(0, trace, &cc, sizeof(int *)); DBF_ERROR("%4x SIGA-W:%2d", SCH_NO(q), cc);
return cc; return cc;
} }
...@@ -367,14 +353,12 @@ static inline int qdio_siga_input(struct qdio_q *q) ...@@ -367,14 +353,12 @@ static inline int qdio_siga_input(struct qdio_q *q)
{ {
int cc; int cc;
QDIO_DBF_TEXT4(0, trace, "sigain"); DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "siga-r:%1d", q->nr);
QDIO_DBF_HEX4(0, trace, &q, sizeof(void *));
qdio_perf_stat_inc(&perf_stats.siga_in); qdio_perf_stat_inc(&perf_stats.siga_in);
cc = do_siga_input(q->irq_ptr->schid, q->mask); cc = do_siga_input(q->irq_ptr->schid, q->mask);
if (cc) if (cc)
QDIO_DBF_HEX3(0, trace, &cc, sizeof(int *)); DBF_ERROR("%4x SIGA-R:%2d", SCH_NO(q), cc);
return cc; return cc;
} }
...@@ -407,18 +391,12 @@ inline void qdio_stop_polling(struct qdio_q *q) ...@@ -407,18 +391,12 @@ inline void qdio_stop_polling(struct qdio_q *q)
static void announce_buffer_error(struct qdio_q *q) static void announce_buffer_error(struct qdio_q *q)
{ {
char dbf_text[15]; DBF_ERROR("%4x BUF ERROR", SCH_NO(q));
DBF_ERROR((q->is_input_q) ? "IN:%2d" : "OUT:%2d", q->nr);
if (q->is_input_q) DBF_ERROR("FTC:%3d", q->first_to_check);
QDIO_DBF_TEXT3(1, trace, "inperr"); DBF_ERROR("F14:%2x F15:%2x",
else q->sbal[q->first_to_check]->element[14].flags & 0xff,
QDIO_DBF_TEXT3(0, trace, "outperr"); q->sbal[q->first_to_check]->element[15].flags & 0xff);
sprintf(dbf_text, "%x-%x-%x", q->first_to_check,
q->sbal[q->first_to_check]->element[14].flags,
q->sbal[q->first_to_check]->element[15].flags);
QDIO_DBF_TEXT3(1, trace, dbf_text);
QDIO_DBF_HEX2(1, trace, q->sbal[q->first_to_check], 256);
q->qdio_error = QDIO_ERROR_SLSB_STATE; q->qdio_error = QDIO_ERROR_SLSB_STATE;
} }
...@@ -461,7 +439,7 @@ static int get_inbound_buffer_frontier(struct qdio_q *q) ...@@ -461,7 +439,7 @@ static int get_inbound_buffer_frontier(struct qdio_q *q)
switch (state) { switch (state) {
case SLSB_P_INPUT_PRIMED: case SLSB_P_INPUT_PRIMED:
QDIO_DBF_TEXT5(0, trace, "inptprim"); DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in prim: %3d", count);
/* /*
* Only ACK the first buffer. The ACK will be removed in * Only ACK the first buffer. The ACK will be removed in
...@@ -500,13 +478,12 @@ static int get_inbound_buffer_frontier(struct qdio_q *q) ...@@ -500,13 +478,12 @@ static int get_inbound_buffer_frontier(struct qdio_q *q)
case SLSB_CU_INPUT_EMPTY: case SLSB_CU_INPUT_EMPTY:
case SLSB_P_INPUT_NOT_INIT: case SLSB_P_INPUT_NOT_INIT:
case SLSB_P_INPUT_ACK: case SLSB_P_INPUT_ACK:
QDIO_DBF_TEXT5(0, trace, "inpnipro"); DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in nop");
break; break;
default: default:
BUG(); BUG();
} }
out: out:
QDIO_DBF_HEX4(0, trace, &q->first_to_check, sizeof(int));
return q->first_to_check; return q->first_to_check;
} }
...@@ -520,8 +497,7 @@ int qdio_inbound_q_moved(struct qdio_q *q) ...@@ -520,8 +497,7 @@ int qdio_inbound_q_moved(struct qdio_q *q)
if (!need_siga_sync(q) && !pci_out_supported(q)) if (!need_siga_sync(q) && !pci_out_supported(q))
q->u.in.timestamp = get_usecs(); q->u.in.timestamp = get_usecs();
QDIO_DBF_TEXT4(0, trace, "inhasmvd"); DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in moved");
QDIO_DBF_HEX4(0, trace, &q, sizeof(void *));
return 1; return 1;
} else } else
return 0; return 0;
...@@ -530,9 +506,6 @@ int qdio_inbound_q_moved(struct qdio_q *q) ...@@ -530,9 +506,6 @@ int qdio_inbound_q_moved(struct qdio_q *q)
static int qdio_inbound_q_done(struct qdio_q *q) static int qdio_inbound_q_done(struct qdio_q *q)
{ {
unsigned char state = 0; unsigned char state = 0;
#ifdef CONFIG_QDIO_DEBUG
char dbf_text[15];
#endif
if (!atomic_read(&q->nr_buf_used)) if (!atomic_read(&q->nr_buf_used))
return 1; return 1;
...@@ -557,20 +530,12 @@ static int qdio_inbound_q_done(struct qdio_q *q) ...@@ -557,20 +530,12 @@ static int qdio_inbound_q_done(struct qdio_q *q)
* has (probably) not moved (see qdio_inbound_processing). * has (probably) not moved (see qdio_inbound_processing).
*/ */
if (get_usecs() > q->u.in.timestamp + QDIO_INPUT_THRESHOLD) { if (get_usecs() > q->u.in.timestamp + QDIO_INPUT_THRESHOLD) {
#ifdef CONFIG_QDIO_DEBUG DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in done:%3d",
QDIO_DBF_TEXT4(0, trace, "inqisdon"); q->first_to_check);
QDIO_DBF_HEX4(0, trace, &q, sizeof(void *));
sprintf(dbf_text, "pf%02x", q->first_to_check);
QDIO_DBF_TEXT4(0, trace, dbf_text);
#endif /* CONFIG_QDIO_DEBUG */
return 1; return 1;
} else { } else {
#ifdef CONFIG_QDIO_DEBUG DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in notd:%3d",
QDIO_DBF_TEXT4(0, trace, "inqisntd"); q->first_to_check);
QDIO_DBF_HEX4(0, trace, &q, sizeof(void *));
sprintf(dbf_text, "pf%02x", q->first_to_check);
QDIO_DBF_TEXT4(0, trace, dbf_text);
#endif /* CONFIG_QDIO_DEBUG */
return 0; return 0;
} }
} }
...@@ -578,9 +543,6 @@ static int qdio_inbound_q_done(struct qdio_q *q) ...@@ -578,9 +543,6 @@ static int qdio_inbound_q_done(struct qdio_q *q)
void qdio_kick_inbound_handler(struct qdio_q *q) void qdio_kick_inbound_handler(struct qdio_q *q)
{ {
int count, start, end; int count, start, end;
#ifdef CONFIG_QDIO_DEBUG
char dbf_text[15];
#endif
qdio_perf_stat_inc(&perf_stats.inbound_handler); qdio_perf_stat_inc(&perf_stats.inbound_handler);
...@@ -591,10 +553,7 @@ void qdio_kick_inbound_handler(struct qdio_q *q) ...@@ -591,10 +553,7 @@ void qdio_kick_inbound_handler(struct qdio_q *q)
else else
count = end + QDIO_MAX_BUFFERS_PER_Q - start; count = end + QDIO_MAX_BUFFERS_PER_Q - start;
#ifdef CONFIG_QDIO_DEBUG DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "kih s:%3d c:%3d", start, count);
sprintf(dbf_text, "s=%2xc=%2x", start, count);
QDIO_DBF_TEXT4(0, trace, dbf_text);
#endif /* CONFIG_QDIO_DEBUG */
if (unlikely(q->irq_ptr->state != QDIO_IRQ_STATE_ACTIVE)) if (unlikely(q->irq_ptr->state != QDIO_IRQ_STATE_ACTIVE))
return; return;
...@@ -667,7 +626,7 @@ static int get_outbound_buffer_frontier(struct qdio_q *q) ...@@ -667,7 +626,7 @@ static int get_outbound_buffer_frontier(struct qdio_q *q)
switch (state) { switch (state) {
case SLSB_P_OUTPUT_EMPTY: case SLSB_P_OUTPUT_EMPTY:
/* the adapter got it */ /* the adapter got it */
QDIO_DBF_TEXT5(0, trace, "outpempt"); DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "out empty:%1d %3d", q->nr, count);
atomic_sub(count, &q->nr_buf_used); atomic_sub(count, &q->nr_buf_used);
q->first_to_check = add_buf(q->first_to_check, count); q->first_to_check = add_buf(q->first_to_check, count);
...@@ -686,7 +645,7 @@ static int get_outbound_buffer_frontier(struct qdio_q *q) ...@@ -686,7 +645,7 @@ static int get_outbound_buffer_frontier(struct qdio_q *q)
break; break;
case SLSB_CU_OUTPUT_PRIMED: case SLSB_CU_OUTPUT_PRIMED:
/* the adapter has not fetched the output yet */ /* the adapter has not fetched the output yet */
QDIO_DBF_TEXT5(0, trace, "outpprim"); DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "out primed:%1d", q->nr);
break; break;
case SLSB_P_OUTPUT_NOT_INIT: case SLSB_P_OUTPUT_NOT_INIT:
case SLSB_P_OUTPUT_HALTED: case SLSB_P_OUTPUT_HALTED:
...@@ -711,8 +670,7 @@ static inline int qdio_outbound_q_moved(struct qdio_q *q) ...@@ -711,8 +670,7 @@ static inline int qdio_outbound_q_moved(struct qdio_q *q)
if ((bufnr != q->last_move_ftc) || q->qdio_error) { if ((bufnr != q->last_move_ftc) || q->qdio_error) {
q->last_move_ftc = bufnr; q->last_move_ftc = bufnr;
QDIO_DBF_TEXT4(0, trace, "oqhasmvd"); DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "out moved:%1d", q->nr);
QDIO_DBF_HEX4(0, trace, &q, sizeof(void *));
return 1; return 1;
} else } else
return 0; return 0;
...@@ -747,12 +705,8 @@ static inline int qdio_outbound_q_moved(struct qdio_q *q) ...@@ -747,12 +705,8 @@ static inline int qdio_outbound_q_moved(struct qdio_q *q)
static void qdio_kick_outbound_q(struct qdio_q *q) static void qdio_kick_outbound_q(struct qdio_q *q)
{ {
int rc; int rc;
#ifdef CONFIG_QDIO_DEBUG
char dbf_text[15];
QDIO_DBF_TEXT5(0, trace, "kickoutq"); DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "kickoutq:%1d", q->nr);
QDIO_DBF_HEX5(0, trace, &q, sizeof(void *));
#endif /* CONFIG_QDIO_DEBUG */
if (!need_siga_out(q)) if (!need_siga_out(q))
return; return;
...@@ -761,15 +715,9 @@ static void qdio_kick_outbound_q(struct qdio_q *q) ...@@ -761,15 +715,9 @@ static void qdio_kick_outbound_q(struct qdio_q *q)
switch (rc) { switch (rc) {
case 0: case 0:
/* TODO: improve error handling for CC=0 case */ /* TODO: improve error handling for CC=0 case */
#ifdef CONFIG_QDIO_DEBUG if (q->u.out.timestamp)
if (q->u.out.timestamp) { DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "cc2 rslv:%4x",
QDIO_DBF_TEXT3(0, trace, "cc2reslv");
sprintf(dbf_text, "%4x%2x%2x", q->irq_ptr->schid.sch_no,
q->nr,
atomic_read(&q->u.out.busy_siga_counter)); atomic_read(&q->u.out.busy_siga_counter));
QDIO_DBF_TEXT3(0, trace, dbf_text);
}
#endif /* CONFIG_QDIO_DEBUG */
/* went smooth this time, reset timestamp */ /* went smooth this time, reset timestamp */
q->u.out.timestamp = 0; q->u.out.timestamp = 0;
break; break;
...@@ -786,12 +734,7 @@ static void qdio_kick_outbound_q(struct qdio_q *q) ...@@ -786,12 +734,7 @@ static void qdio_kick_outbound_q(struct qdio_q *q)
tasklet_schedule(&q->tasklet); tasklet_schedule(&q->tasklet);
break; break;
} }
QDIO_DBF_TEXT2(0, trace, "cc2REPRT"); DBF_ERROR("%4x cc2 REP:%1d", SCH_NO(q), q->nr);
#ifdef CONFIG_QDIO_DEBUG
sprintf(dbf_text, "%4x%2x%2x", q->irq_ptr->schid.sch_no, q->nr,
atomic_read(&q->u.out.busy_siga_counter));
QDIO_DBF_TEXT3(0, trace, dbf_text);
#endif /* CONFIG_QDIO_DEBUG */
default: default:
/* for plain cc=1, 2 or 3 */ /* for plain cc=1, 2 or 3 */
q->qdio_error = rc; q->qdio_error = rc;
...@@ -801,9 +744,6 @@ static void qdio_kick_outbound_q(struct qdio_q *q) ...@@ -801,9 +744,6 @@ static void qdio_kick_outbound_q(struct qdio_q *q)
static void qdio_kick_outbound_handler(struct qdio_q *q) static void qdio_kick_outbound_handler(struct qdio_q *q)
{ {
int start, end, count; int start, end, count;
#ifdef CONFIG_QDIO_DEBUG
char dbf_text[15];
#endif
start = q->first_to_kick; start = q->first_to_kick;
end = q->last_move_ftc; end = q->last_move_ftc;
...@@ -812,13 +752,8 @@ static void qdio_kick_outbound_handler(struct qdio_q *q) ...@@ -812,13 +752,8 @@ static void qdio_kick_outbound_handler(struct qdio_q *q)
else else
count = end + QDIO_MAX_BUFFERS_PER_Q - start; count = end + QDIO_MAX_BUFFERS_PER_Q - start;
#ifdef CONFIG_QDIO_DEBUG DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "kickouth: %1d", q->nr);
QDIO_DBF_TEXT4(0, trace, "kickouth"); DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "s:%3d c:%3d", start, count);
QDIO_DBF_HEX4(0, trace, &q, sizeof(void *));
sprintf(dbf_text, "s=%2xc=%2x", start, count);
QDIO_DBF_TEXT4(0, trace, dbf_text);
#endif /* CONFIG_QDIO_DEBUG */
if (unlikely(q->irq_ptr->state != QDIO_IRQ_STATE_ACTIVE)) if (unlikely(q->irq_ptr->state != QDIO_IRQ_STATE_ACTIVE))
return; return;
...@@ -913,27 +848,18 @@ void qdio_check_outbound_after_thinint(struct qdio_q *q) ...@@ -913,27 +848,18 @@ void qdio_check_outbound_after_thinint(struct qdio_q *q)
static inline void qdio_set_state(struct qdio_irq *irq_ptr, static inline void qdio_set_state(struct qdio_irq *irq_ptr,
enum qdio_irq_states state) enum qdio_irq_states state)
{ {
#ifdef CONFIG_QDIO_DEBUG DBF_DEV_EVENT(DBF_INFO, irq_ptr, "newstate: %1d", state);
char dbf_text[15];
QDIO_DBF_TEXT5(0, trace, "newstate");
sprintf(dbf_text, "%4x%4x", irq_ptr->schid.sch_no, state);
QDIO_DBF_TEXT5(0, trace, dbf_text);
#endif /* CONFIG_QDIO_DEBUG */
irq_ptr->state = state; irq_ptr->state = state;
mb(); mb();
} }
static void qdio_irq_check_sense(struct subchannel_id schid, struct irb *irb) static void qdio_irq_check_sense(struct qdio_irq *irq_ptr, struct irb *irb)
{ {
char dbf_text[15];
if (irb->esw.esw0.erw.cons) { if (irb->esw.esw0.erw.cons) {
sprintf(dbf_text, "sens%4x", schid.sch_no); DBF_ERROR("%4x sense:", irq_ptr->schid.sch_no);
QDIO_DBF_TEXT2(1, trace, dbf_text); DBF_ERROR_HEX(irb, 64);
QDIO_DBF_HEX0(0, trace, irb, 64); DBF_ERROR_HEX(irb->ecw, 64);
QDIO_DBF_HEX0(0, trace, irb->ecw, 64);
} }
} }
...@@ -967,14 +893,10 @@ static void qdio_handle_activate_check(struct ccw_device *cdev, ...@@ -967,14 +893,10 @@ static void qdio_handle_activate_check(struct ccw_device *cdev,
{ {
struct qdio_irq *irq_ptr = cdev->private->qdio_data; struct qdio_irq *irq_ptr = cdev->private->qdio_data;
struct qdio_q *q; struct qdio_q *q;
char dbf_text[15];
QDIO_DBF_TEXT2(1, trace, "ick2"); DBF_ERROR("%4x ACT CHECK", irq_ptr->schid.sch_no);
sprintf(dbf_text, "%s", dev_name(&cdev->dev)); DBF_ERROR("intp :%lx", intparm);
QDIO_DBF_TEXT2(1, trace, dbf_text); DBF_ERROR("ds: %2x cs:%2x", dstat, cstat);
QDIO_DBF_HEX2(0, trace, &intparm, sizeof(int));
QDIO_DBF_HEX2(0, trace, &dstat, sizeof(int));
QDIO_DBF_HEX2(0, trace, &cstat, sizeof(int));
if (irq_ptr->nr_input_qs) { if (irq_ptr->nr_input_qs) {
q = irq_ptr->input_qs[0]; q = irq_ptr->input_qs[0];
...@@ -1032,23 +954,24 @@ static int qdio_establish_check_errors(struct ccw_device *cdev, int cstat, ...@@ -1032,23 +954,24 @@ static int qdio_establish_check_errors(struct ccw_device *cdev, int cstat,
struct qdio_irq *irq_ptr = cdev->private->qdio_data; struct qdio_irq *irq_ptr = cdev->private->qdio_data;
if (cstat || (dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END))) { if (cstat || (dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END))) {
QDIO_DBF_TEXT2(1, setup, "eq:ckcon"); DBF_ERROR("EQ:ck con");
goto error; goto error;
} }
if (!(dstat & DEV_STAT_DEV_END)) { if (!(dstat & DEV_STAT_DEV_END)) {
QDIO_DBF_TEXT2(1, setup, "eq:no de"); DBF_ERROR("EQ:no dev");
goto error; goto error;
} }
if (dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) { if (dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) {
QDIO_DBF_TEXT2(1, setup, "eq:badio"); DBF_ERROR("EQ: bad io");
goto error; goto error;
} }
return 0; return 0;
error: error:
QDIO_DBF_HEX2(0, trace, &cstat, sizeof(int)); DBF_ERROR("%4x EQ:error", irq_ptr->schid.sch_no);
QDIO_DBF_HEX2(0, trace, &dstat, sizeof(int)); DBF_ERROR("ds: %2x cs:%2x", dstat, cstat);
qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ERR); qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ERR);
return 1; return 1;
} }
...@@ -1057,12 +980,8 @@ static void qdio_establish_handle_irq(struct ccw_device *cdev, int cstat, ...@@ -1057,12 +980,8 @@ static void qdio_establish_handle_irq(struct ccw_device *cdev, int cstat,
int dstat) int dstat)
{ {
struct qdio_irq *irq_ptr = cdev->private->qdio_data; struct qdio_irq *irq_ptr = cdev->private->qdio_data;
char dbf_text[15];
sprintf(dbf_text, "qehi%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
QDIO_DBF_TEXT0(0, trace, dbf_text);
DBF_DEV_EVENT(DBF_INFO, irq_ptr, "qest irq");
if (!qdio_establish_check_errors(cdev, cstat, dstat)) if (!qdio_establish_check_errors(cdev, cstat, dstat))
qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ESTABLISHED); qdio_set_state(irq_ptr, QDIO_IRQ_STATE_ESTABLISHED);
} }
...@@ -1073,25 +992,21 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1073,25 +992,21 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm,
{ {
struct qdio_irq *irq_ptr = cdev->private->qdio_data; struct qdio_irq *irq_ptr = cdev->private->qdio_data;
int cstat, dstat; int cstat, dstat;
char dbf_text[15];
qdio_perf_stat_inc(&perf_stats.qdio_int); qdio_perf_stat_inc(&perf_stats.qdio_int);
if (!intparm || !irq_ptr) { if (!intparm || !irq_ptr) {
sprintf(dbf_text, "qihd%4x", cdev->private->schid.sch_no); DBF_ERROR("qint:%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT2(1, setup, dbf_text);
return; return;
} }
if (IS_ERR(irb)) { if (IS_ERR(irb)) {
switch (PTR_ERR(irb)) { switch (PTR_ERR(irb)) {
case -EIO: case -EIO:
sprintf(dbf_text, "ierr%4x", irq_ptr->schid.sch_no); DBF_ERROR("%4x IO error", irq_ptr->schid.sch_no);
QDIO_DBF_TEXT2(1, setup, dbf_text);
return; return;
case -ETIMEDOUT: case -ETIMEDOUT:
sprintf(dbf_text, "qtoh%4x", irq_ptr->schid.sch_no); DBF_ERROR("%4x IO timeout", irq_ptr->schid.sch_no);
QDIO_DBF_TEXT2(1, setup, dbf_text);
qdio_int_error(cdev); qdio_int_error(cdev);
return; return;
default: default:
...@@ -1099,7 +1014,7 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1099,7 +1014,7 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm,
return; return;
} }
} }
qdio_irq_check_sense(irq_ptr->schid, irb); qdio_irq_check_sense(irq_ptr, irb);
cstat = irb->scsw.cmd.cstat; cstat = irb->scsw.cmd.cstat;
dstat = irb->scsw.cmd.dstat; dstat = irb->scsw.cmd.dstat;
...@@ -1142,14 +1057,11 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1142,14 +1057,11 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm,
int qdio_get_ssqd_desc(struct ccw_device *cdev, int qdio_get_ssqd_desc(struct ccw_device *cdev,
struct qdio_ssqd_desc *data) struct qdio_ssqd_desc *data)
{ {
char dbf_text[15];
if (!cdev || !cdev->private) if (!cdev || !cdev->private)
return -EINVAL; return -EINVAL;
sprintf(dbf_text, "qssq%4x", cdev->private->schid.sch_no); DBF_EVENT("get ssqd:%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
return qdio_setup_get_ssqd(NULL, &cdev->private->schid, data); return qdio_setup_get_ssqd(NULL, &cdev->private->schid, data);
} }
EXPORT_SYMBOL_GPL(qdio_get_ssqd_desc); EXPORT_SYMBOL_GPL(qdio_get_ssqd_desc);
...@@ -1164,14 +1076,9 @@ EXPORT_SYMBOL_GPL(qdio_get_ssqd_desc); ...@@ -1164,14 +1076,9 @@ EXPORT_SYMBOL_GPL(qdio_get_ssqd_desc);
*/ */
int qdio_cleanup(struct ccw_device *cdev, int how) int qdio_cleanup(struct ccw_device *cdev, int how)
{ {
struct qdio_irq *irq_ptr; struct qdio_irq *irq_ptr = cdev->private->qdio_data;
char dbf_text[15];
int rc; int rc;
sprintf(dbf_text, "qcln%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
irq_ptr = cdev->private->qdio_data;
if (!irq_ptr) if (!irq_ptr)
return -ENODEV; return -ENODEV;
...@@ -1204,18 +1111,15 @@ static void qdio_shutdown_queues(struct ccw_device *cdev) ...@@ -1204,18 +1111,15 @@ static void qdio_shutdown_queues(struct ccw_device *cdev)
*/ */
int qdio_shutdown(struct ccw_device *cdev, int how) int qdio_shutdown(struct ccw_device *cdev, int how)
{ {
struct qdio_irq *irq_ptr; struct qdio_irq *irq_ptr = cdev->private->qdio_data;
int rc; int rc;
unsigned long flags; unsigned long flags;
char dbf_text[15];
sprintf(dbf_text, "qshu%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
irq_ptr = cdev->private->qdio_data;
if (!irq_ptr) if (!irq_ptr)
return -ENODEV; return -ENODEV;
DBF_EVENT("qshutdown:%4x", cdev->private->schid.sch_no);
mutex_lock(&irq_ptr->setup_mutex); mutex_lock(&irq_ptr->setup_mutex);
/* /*
* Subchannel was already shot down. We cannot prevent being called * Subchannel was already shot down. We cannot prevent being called
...@@ -1239,10 +1143,8 @@ int qdio_shutdown(struct ccw_device *cdev, int how) ...@@ -1239,10 +1143,8 @@ int qdio_shutdown(struct ccw_device *cdev, int how)
/* default behaviour is halt */ /* default behaviour is halt */
rc = ccw_device_halt(cdev, QDIO_DOING_CLEANUP); rc = ccw_device_halt(cdev, QDIO_DOING_CLEANUP);
if (rc) { if (rc) {
sprintf(dbf_text, "sher%4x", irq_ptr->schid.sch_no); DBF_ERROR("%4x SHUTD ERR", irq_ptr->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text); DBF_ERROR("rc:%4d", rc);
sprintf(dbf_text, "rc=%d", rc);
QDIO_DBF_TEXT0(0, setup, dbf_text);
goto no_cleanup; goto no_cleanup;
} }
...@@ -1276,17 +1178,18 @@ EXPORT_SYMBOL_GPL(qdio_shutdown); ...@@ -1276,17 +1178,18 @@ EXPORT_SYMBOL_GPL(qdio_shutdown);
*/ */
int qdio_free(struct ccw_device *cdev) int qdio_free(struct ccw_device *cdev)
{ {
struct qdio_irq *irq_ptr; struct qdio_irq *irq_ptr = cdev->private->qdio_data;
char dbf_text[15];
sprintf(dbf_text, "qfre%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
irq_ptr = cdev->private->qdio_data;
if (!irq_ptr) if (!irq_ptr)
return -ENODEV; return -ENODEV;
DBF_EVENT("qfree:%4x", cdev->private->schid.sch_no);
mutex_lock(&irq_ptr->setup_mutex); mutex_lock(&irq_ptr->setup_mutex);
if (irq_ptr->debug_area != NULL) {
debug_unregister(irq_ptr->debug_area);
irq_ptr->debug_area = NULL;
}
cdev->private->qdio_data = NULL; cdev->private->qdio_data = NULL;
mutex_unlock(&irq_ptr->setup_mutex); mutex_unlock(&irq_ptr->setup_mutex);
...@@ -1305,10 +1208,6 @@ EXPORT_SYMBOL_GPL(qdio_free); ...@@ -1305,10 +1208,6 @@ EXPORT_SYMBOL_GPL(qdio_free);
int qdio_initialize(struct qdio_initialize *init_data) int qdio_initialize(struct qdio_initialize *init_data)
{ {
int rc; int rc;
char dbf_text[15];
sprintf(dbf_text, "qini%4x", init_data->cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
rc = qdio_allocate(init_data); rc = qdio_allocate(init_data);
if (rc) if (rc)
...@@ -1328,10 +1227,8 @@ EXPORT_SYMBOL_GPL(qdio_initialize); ...@@ -1328,10 +1227,8 @@ EXPORT_SYMBOL_GPL(qdio_initialize);
int qdio_allocate(struct qdio_initialize *init_data) int qdio_allocate(struct qdio_initialize *init_data)
{ {
struct qdio_irq *irq_ptr; struct qdio_irq *irq_ptr;
char dbf_text[15];
sprintf(dbf_text, "qalc%4x", init_data->cdev->private->schid.sch_no); DBF_EVENT("qallocate:%4x", init_data->cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
if ((init_data->no_input_qs && !init_data->input_handler) || if ((init_data->no_input_qs && !init_data->input_handler) ||
(init_data->no_output_qs && !init_data->output_handler)) (init_data->no_output_qs && !init_data->output_handler))
...@@ -1345,16 +1242,13 @@ int qdio_allocate(struct qdio_initialize *init_data) ...@@ -1345,16 +1242,13 @@ int qdio_allocate(struct qdio_initialize *init_data)
(!init_data->output_sbal_addr_array)) (!init_data->output_sbal_addr_array))
return -EINVAL; return -EINVAL;
qdio_allocate_do_dbf(init_data);
/* irq_ptr must be in GFP_DMA since it contains ccw1.cda */ /* irq_ptr must be in GFP_DMA since it contains ccw1.cda */
irq_ptr = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA); irq_ptr = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
if (!irq_ptr) if (!irq_ptr)
goto out_err; goto out_err;
QDIO_DBF_TEXT0(0, setup, "irq_ptr:");
QDIO_DBF_HEX0(0, setup, &irq_ptr, sizeof(void *));
mutex_init(&irq_ptr->setup_mutex); mutex_init(&irq_ptr->setup_mutex);
qdio_allocate_dbf(init_data, irq_ptr);
/* /*
* Allocate a page for the chsc calls in qdio_establish. * Allocate a page for the chsc calls in qdio_establish.
...@@ -1372,9 +1266,6 @@ int qdio_allocate(struct qdio_initialize *init_data) ...@@ -1372,9 +1266,6 @@ int qdio_allocate(struct qdio_initialize *init_data)
goto out_rel; goto out_rel;
WARN_ON((unsigned long)irq_ptr->qdr & 0xfff); WARN_ON((unsigned long)irq_ptr->qdr & 0xfff);
QDIO_DBF_TEXT0(0, setup, "qdr:");
QDIO_DBF_HEX0(0, setup, &irq_ptr->qdr, sizeof(void *));
if (qdio_allocate_qs(irq_ptr, init_data->no_input_qs, if (qdio_allocate_qs(irq_ptr, init_data->no_input_qs,
init_data->no_output_qs)) init_data->no_output_qs))
goto out_rel; goto out_rel;
...@@ -1395,14 +1286,12 @@ EXPORT_SYMBOL_GPL(qdio_allocate); ...@@ -1395,14 +1286,12 @@ EXPORT_SYMBOL_GPL(qdio_allocate);
*/ */
int qdio_establish(struct qdio_initialize *init_data) int qdio_establish(struct qdio_initialize *init_data)
{ {
char dbf_text[20];
struct qdio_irq *irq_ptr; struct qdio_irq *irq_ptr;
struct ccw_device *cdev = init_data->cdev; struct ccw_device *cdev = init_data->cdev;
unsigned long saveflags; unsigned long saveflags;
int rc; int rc;
sprintf(dbf_text, "qest%4x", cdev->private->schid.sch_no); DBF_EVENT("qestablish:%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
irq_ptr = cdev->private->qdio_data; irq_ptr = cdev->private->qdio_data;
if (!irq_ptr) if (!irq_ptr)
...@@ -1432,10 +1321,8 @@ int qdio_establish(struct qdio_initialize *init_data) ...@@ -1432,10 +1321,8 @@ int qdio_establish(struct qdio_initialize *init_data)
rc = ccw_device_start(cdev, &irq_ptr->ccw, QDIO_DOING_ESTABLISH, 0, 0); rc = ccw_device_start(cdev, &irq_ptr->ccw, QDIO_DOING_ESTABLISH, 0, 0);
if (rc) { if (rc) {
sprintf(dbf_text, "eq:io%4x", irq_ptr->schid.sch_no); DBF_ERROR("%4x est IO ERR", irq_ptr->schid.sch_no);
QDIO_DBF_TEXT2(1, setup, dbf_text); DBF_ERROR("rc:%4x", rc);
sprintf(dbf_text, "eq:rc%4x", rc);
QDIO_DBF_TEXT2(1, setup, dbf_text);
} }
spin_unlock_irqrestore(get_ccwdev_lock(cdev), saveflags); spin_unlock_irqrestore(get_ccwdev_lock(cdev), saveflags);
...@@ -1456,10 +1343,8 @@ int qdio_establish(struct qdio_initialize *init_data) ...@@ -1456,10 +1343,8 @@ int qdio_establish(struct qdio_initialize *init_data)
} }
qdio_setup_ssqd_info(irq_ptr); qdio_setup_ssqd_info(irq_ptr);
sprintf(dbf_text, "qDmmwc%2x", irq_ptr->ssqd_desc.mmwc); DBF_EVENT("qDmmwc:%2x", irq_ptr->ssqd_desc.mmwc);
QDIO_DBF_TEXT2(0, setup, dbf_text); DBF_EVENT("qib ac:%4x", irq_ptr->qib.ac);
sprintf(dbf_text, "qib ac%2x", irq_ptr->qib.ac);
QDIO_DBF_TEXT2(0, setup, dbf_text);
/* qebsm is now setup if available, initialize buffer states */ /* qebsm is now setup if available, initialize buffer states */
qdio_init_buf_states(irq_ptr); qdio_init_buf_states(irq_ptr);
...@@ -1480,10 +1365,8 @@ int qdio_activate(struct ccw_device *cdev) ...@@ -1480,10 +1365,8 @@ int qdio_activate(struct ccw_device *cdev)
struct qdio_irq *irq_ptr; struct qdio_irq *irq_ptr;
int rc; int rc;
unsigned long saveflags; unsigned long saveflags;
char dbf_text[20];
sprintf(dbf_text, "qact%4x", cdev->private->schid.sch_no); DBF_EVENT("qactivate:%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT0(0, setup, dbf_text);
irq_ptr = cdev->private->qdio_data; irq_ptr = cdev->private->qdio_data;
if (!irq_ptr) if (!irq_ptr)
...@@ -1509,10 +1392,8 @@ int qdio_activate(struct ccw_device *cdev) ...@@ -1509,10 +1392,8 @@ int qdio_activate(struct ccw_device *cdev)
rc = ccw_device_start(cdev, &irq_ptr->ccw, QDIO_DOING_ACTIVATE, rc = ccw_device_start(cdev, &irq_ptr->ccw, QDIO_DOING_ACTIVATE,
0, DOIO_DENY_PREFETCH); 0, DOIO_DENY_PREFETCH);
if (rc) { if (rc) {
sprintf(dbf_text, "aq:io%4x", irq_ptr->schid.sch_no); DBF_ERROR("%4x act IO ERR", irq_ptr->schid.sch_no);
QDIO_DBF_TEXT2(1, setup, dbf_text); DBF_ERROR("rc:%4x", rc);
sprintf(dbf_text, "aq:rc%4x", rc);
QDIO_DBF_TEXT2(1, setup, dbf_text);
} }
spin_unlock_irqrestore(get_ccwdev_lock(cdev), saveflags); spin_unlock_irqrestore(get_ccwdev_lock(cdev), saveflags);
...@@ -1658,7 +1539,7 @@ static void handle_outbound(struct qdio_q *q, unsigned int callflags, ...@@ -1658,7 +1539,7 @@ static void handle_outbound(struct qdio_q *q, unsigned int callflags,
if (state != SLSB_CU_OUTPUT_PRIMED) if (state != SLSB_CU_OUTPUT_PRIMED)
qdio_kick_outbound_q(q); qdio_kick_outbound_q(q);
else { else {
QDIO_DBF_TEXT5(0, trace, "fast-req"); DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "fast-req");
qdio_perf_stat_inc(&perf_stats.fast_requeue); qdio_perf_stat_inc(&perf_stats.fast_requeue);
} }
out: out:
...@@ -1678,12 +1559,6 @@ int do_QDIO(struct ccw_device *cdev, unsigned int callflags, ...@@ -1678,12 +1559,6 @@ int do_QDIO(struct ccw_device *cdev, unsigned int callflags,
int q_nr, int bufnr, int count) int q_nr, int bufnr, int count)
{ {
struct qdio_irq *irq_ptr; struct qdio_irq *irq_ptr;
#ifdef CONFIG_QDIO_DEBUG
char dbf_text[20];
sprintf(dbf_text, "doQD%4x", cdev->private->schid.sch_no);
QDIO_DBF_TEXT3(0, trace, dbf_text);
#endif /* CONFIG_QDIO_DEBUG */
if ((bufnr > QDIO_MAX_BUFFERS_PER_Q) || if ((bufnr > QDIO_MAX_BUFFERS_PER_Q) ||
(count > QDIO_MAX_BUFFERS_PER_Q) || (count > QDIO_MAX_BUFFERS_PER_Q) ||
...@@ -1697,33 +1572,24 @@ int do_QDIO(struct ccw_device *cdev, unsigned int callflags, ...@@ -1697,33 +1572,24 @@ int do_QDIO(struct ccw_device *cdev, unsigned int callflags,
if (!irq_ptr) if (!irq_ptr)
return -ENODEV; return -ENODEV;
#ifdef CONFIG_QDIO_DEBUG
if (callflags & QDIO_FLAG_SYNC_INPUT) if (callflags & QDIO_FLAG_SYNC_INPUT)
QDIO_DBF_HEX3(0, trace, &irq_ptr->input_qs[q_nr], DBF_DEV_EVENT(DBF_INFO, irq_ptr, "doQDIO input");
sizeof(void *));
else else
QDIO_DBF_HEX3(0, trace, &irq_ptr->output_qs[q_nr], DBF_DEV_EVENT(DBF_INFO, irq_ptr, "doQDIO output");
sizeof(void *)); DBF_DEV_EVENT(DBF_INFO, irq_ptr, "q:%1d flag:%4x", q_nr, callflags);
DBF_DEV_EVENT(DBF_INFO, irq_ptr, "buf:%2d cnt:%3d", bufnr, count);
sprintf(dbf_text, "flag%04x", callflags);
QDIO_DBF_TEXT3(0, trace, dbf_text);
sprintf(dbf_text, "qi%02xct%02x", bufnr, count);
QDIO_DBF_TEXT3(0, trace, dbf_text);
#endif /* CONFIG_QDIO_DEBUG */
if (irq_ptr->state != QDIO_IRQ_STATE_ACTIVE) if (irq_ptr->state != QDIO_IRQ_STATE_ACTIVE)
return -EBUSY; return -EBUSY;
if (callflags & QDIO_FLAG_SYNC_INPUT) if (callflags & QDIO_FLAG_SYNC_INPUT)
handle_inbound(irq_ptr->input_qs[q_nr], handle_inbound(irq_ptr->input_qs[q_nr], callflags, bufnr,
callflags, bufnr, count); count);
else if (callflags & QDIO_FLAG_SYNC_OUTPUT) else if (callflags & QDIO_FLAG_SYNC_OUTPUT)
handle_outbound(irq_ptr->output_qs[q_nr], handle_outbound(irq_ptr->output_qs[q_nr], callflags, bufnr,
callflags, bufnr, count); count);
else { else
QDIO_DBF_TEXT3(1, trace, "doQD:inv");
return -EINVAL; return -EINVAL;
}
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(do_QDIO); EXPORT_SYMBOL_GPL(do_QDIO);
......
...@@ -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