aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJan Glauber <jang@linux.vnet.ibm.com>2009-09-11 04:28:22 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-09-11 04:29:39 -0400
commit3f09bb8965cefe36f42a9ec09ebb821523eba530 (patch)
treeaa339abba1fad6f05e56c0fb9df141959a10e499 /drivers
parent217ee6c64a9589bc5ad4d1c88136fc359d17930b (diff)
[S390] qdio: remove limited number of debugfs entries
The number of qdio debugfs entries was limited. Remove this limit and group the queue files in a per device directory. Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/s390/cio/qdio.h4
-rw-r--r--drivers/s390/cio/qdio_debug.c55
2 files changed, 18 insertions, 41 deletions
diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h
index b1241f8fae88..ff7748a9199d 100644
--- a/drivers/s390/cio/qdio.h
+++ b/drivers/s390/cio/qdio.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/drivers/s390/cio/qdio.h 2 * linux/drivers/s390/cio/qdio.h
3 * 3 *
4 * Copyright 2000,2008 IBM Corp. 4 * Copyright 2000,2009 IBM Corp.
5 * Author(s): Utz Bacher <utz.bacher@de.ibm.com> 5 * Author(s): Utz Bacher <utz.bacher@de.ibm.com>
6 * Jan Glauber <jang@linux.vnet.ibm.com> 6 * Jan Glauber <jang@linux.vnet.ibm.com>
7 */ 7 */
@@ -246,6 +246,7 @@ struct qdio_q {
246 atomic_t nr_buf_used; 246 atomic_t nr_buf_used;
247 247
248 struct qdio_irq *irq_ptr; 248 struct qdio_irq *irq_ptr;
249 struct dentry *debugfs_q;
249 struct tasklet_struct tasklet; 250 struct tasklet_struct tasklet;
250 251
251 /* error condition during a data transfer */ 252 /* error condition during a data transfer */
@@ -267,6 +268,7 @@ struct qdio_irq {
267 struct qib qib; 268 struct qib qib;
268 u32 *dsci; /* address of device state change indicator */ 269 u32 *dsci; /* address of device state change indicator */
269 struct ccw_device *cdev; 270 struct ccw_device *cdev;
271 struct dentry *debugfs_dev;
270 272
271 unsigned long int_parm; 273 unsigned long int_parm;
272 struct subchannel_id schid; 274 struct subchannel_id schid;
diff --git a/drivers/s390/cio/qdio_debug.c b/drivers/s390/cio/qdio_debug.c
index b8626d4df116..1b78f639ead3 100644
--- a/drivers/s390/cio/qdio_debug.c
+++ b/drivers/s390/cio/qdio_debug.c
@@ -1,14 +1,12 @@
1/* 1/*
2 * drivers/s390/cio/qdio_debug.c 2 * drivers/s390/cio/qdio_debug.c
3 * 3 *
4 * Copyright IBM Corp. 2008 4 * Copyright IBM Corp. 2008,2009
5 * 5 *
6 * Author: Jan Glauber (jang@linux.vnet.ibm.com) 6 * Author: Jan Glauber (jang@linux.vnet.ibm.com)
7 */ 7 */
8#include <linux/proc_fs.h>
9#include <linux/seq_file.h> 8#include <linux/seq_file.h>
10#include <linux/debugfs.h> 9#include <linux/debugfs.h>
11#include <asm/qdio.h>
12#include <asm/debug.h> 10#include <asm/debug.h>
13#include "qdio_debug.h" 11#include "qdio_debug.h"
14#include "qdio.h" 12#include "qdio.h"
@@ -17,10 +15,7 @@ debug_info_t *qdio_dbf_setup;
17debug_info_t *qdio_dbf_error; 15debug_info_t *qdio_dbf_error;
18 16
19static struct dentry *debugfs_root; 17static struct dentry *debugfs_root;
20#define MAX_DEBUGFS_QUEUES 32 18#define QDIO_DEBUGFS_NAME_LEN 10
21static struct dentry *debugfs_queues[MAX_DEBUGFS_QUEUES] = { NULL };
22static DEFINE_MUTEX(debugfs_mutex);
23#define QDIO_DEBUGFS_NAME_LEN 40
24 19
25void qdio_allocate_dbf(struct qdio_initialize *init_data, 20void qdio_allocate_dbf(struct qdio_initialize *init_data,
26 struct qdio_irq *irq_ptr) 21 struct qdio_irq *irq_ptr)
@@ -130,20 +125,6 @@ static int qstat_seq_open(struct inode *inode, struct file *filp)
130 filp->f_path.dentry->d_inode->i_private); 125 filp->f_path.dentry->d_inode->i_private);
131} 126}
132 127
133static void remove_debugfs_entry(struct qdio_q *q)
134{
135 int i;
136
137 for (i = 0; i < MAX_DEBUGFS_QUEUES; i++) {
138 if (!debugfs_queues[i])
139 continue;
140 if (debugfs_queues[i]->d_inode->i_private == q) {
141 debugfs_remove(debugfs_queues[i]);
142 debugfs_queues[i] = NULL;
143 }
144 }
145}
146
147static struct file_operations debugfs_fops = { 128static struct file_operations debugfs_fops = {
148 .owner = THIS_MODULE, 129 .owner = THIS_MODULE,
149 .open = qstat_seq_open, 130 .open = qstat_seq_open,
@@ -155,22 +136,15 @@ static struct file_operations debugfs_fops = {
155 136
156static void setup_debugfs_entry(struct qdio_q *q, struct ccw_device *cdev) 137static void setup_debugfs_entry(struct qdio_q *q, struct ccw_device *cdev)
157{ 138{
158 int i = 0;
159 char name[QDIO_DEBUGFS_NAME_LEN]; 139 char name[QDIO_DEBUGFS_NAME_LEN];
160 140
161 while (debugfs_queues[i] != NULL) { 141 snprintf(name, QDIO_DEBUGFS_NAME_LEN, "%s_%d",
162 i++;
163 if (i >= MAX_DEBUGFS_QUEUES)
164 return;
165 }
166 snprintf(name, QDIO_DEBUGFS_NAME_LEN, "%s_%s_%d",
167 dev_name(&cdev->dev),
168 q->is_input_q ? "input" : "output", 142 q->is_input_q ? "input" : "output",
169 q->nr); 143 q->nr);
170 debugfs_queues[i] = debugfs_create_file(name, S_IFREG | S_IRUGO | S_IWUSR, 144 q->debugfs_q = debugfs_create_file(name, S_IFREG | S_IRUGO | S_IWUSR,
171 debugfs_root, q, &debugfs_fops); 145 q->irq_ptr->debugfs_dev, q, &debugfs_fops);
172 if (IS_ERR(debugfs_queues[i])) 146 if (IS_ERR(q->debugfs_q))
173 debugfs_queues[i] = NULL; 147 q->debugfs_q = NULL;
174} 148}
175 149
176void qdio_setup_debug_entries(struct qdio_irq *irq_ptr, struct ccw_device *cdev) 150void qdio_setup_debug_entries(struct qdio_irq *irq_ptr, struct ccw_device *cdev)
@@ -178,12 +152,14 @@ void qdio_setup_debug_entries(struct qdio_irq *irq_ptr, struct ccw_device *cdev)
178 struct qdio_q *q; 152 struct qdio_q *q;
179 int i; 153 int i;
180 154
181 mutex_lock(&debugfs_mutex); 155 irq_ptr->debugfs_dev = debugfs_create_dir(dev_name(&cdev->dev),
156 debugfs_root);
157 if (IS_ERR(irq_ptr->debugfs_dev))
158 irq_ptr->debugfs_dev = NULL;
182 for_each_input_queue(irq_ptr, q, i) 159 for_each_input_queue(irq_ptr, q, i)
183 setup_debugfs_entry(q, cdev); 160 setup_debugfs_entry(q, cdev);
184 for_each_output_queue(irq_ptr, q, i) 161 for_each_output_queue(irq_ptr, q, i)
185 setup_debugfs_entry(q, cdev); 162 setup_debugfs_entry(q, cdev);
186 mutex_unlock(&debugfs_mutex);
187} 163}
188 164
189void qdio_shutdown_debug_entries(struct qdio_irq *irq_ptr, struct ccw_device *cdev) 165void qdio_shutdown_debug_entries(struct qdio_irq *irq_ptr, struct ccw_device *cdev)
@@ -191,17 +167,16 @@ void qdio_shutdown_debug_entries(struct qdio_irq *irq_ptr, struct ccw_device *cd
191 struct qdio_q *q; 167 struct qdio_q *q;
192 int i; 168 int i;
193 169
194 mutex_lock(&debugfs_mutex);
195 for_each_input_queue(irq_ptr, q, i) 170 for_each_input_queue(irq_ptr, q, i)
196 remove_debugfs_entry(q); 171 debugfs_remove(q->debugfs_q);
197 for_each_output_queue(irq_ptr, q, i) 172 for_each_output_queue(irq_ptr, q, i)
198 remove_debugfs_entry(q); 173 debugfs_remove(q->debugfs_q);
199 mutex_unlock(&debugfs_mutex); 174 debugfs_remove(irq_ptr->debugfs_dev);
200} 175}
201 176
202int __init qdio_debug_init(void) 177int __init qdio_debug_init(void)
203{ 178{
204 debugfs_root = debugfs_create_dir("qdio_queues", NULL); 179 debugfs_root = debugfs_create_dir("qdio", NULL);
205 180
206 qdio_dbf_setup = debug_register("qdio_setup", 16, 1, 16); 181 qdio_dbf_setup = debug_register("qdio_setup", 16, 1, 16);
207 debug_register_view(qdio_dbf_setup, &debug_hex_ascii_view); 182 debug_register_view(qdio_dbf_setup, &debug_hex_ascii_view);