ehci-dbg.c 28.0 KB
Newer Older
L
Linus Torvalds 已提交
1 2
/*
 * Copyright (c) 2001-2002 by David Brownell
3
 *
L
Linus Torvalds 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 *
 */

/* this file is part of ehci-hcd.c */

O
Oliver Neukum 已提交
18
#ifdef CONFIG_DYNAMIC_DEBUG
L
Linus Torvalds 已提交
19

20 21
/*
 * check the values in the HCSPARAMS register
L
Linus Torvalds 已提交
22 23 24
 * (host controller _Structural_ parameters)
 * see EHCI spec, Table 2-4 for each value
 */
25
static void dbg_hcs_params(struct ehci_hcd *ehci, char *label)
L
Linus Torvalds 已提交
26
{
27
	u32	params = ehci_readl(ehci, &ehci->caps->hcs_params);
L
Linus Torvalds 已提交
28

29
	ehci_dbg(ehci,
L
Linus Torvalds 已提交
30 31
		"%s hcs_params 0x%x dbg=%d%s cc=%d pcc=%d%s%s ports=%d\n",
		label, params,
32 33 34 35 36 37
		HCS_DEBUG_PORT(params),
		HCS_INDICATOR(params) ? " ind" : "",
		HCS_N_CC(params),
		HCS_N_PCC(params),
		HCS_PORTROUTED(params) ? "" : " ordered",
		HCS_PPC(params) ? "" : " !ppc",
38
		HCS_N_PORTS(params));
L
Linus Torvalds 已提交
39
	/* Port routing, per EHCI 0.95 Spec, Section 2.2.5 */
40
	if (HCS_PORTROUTED(params)) {
L
Linus Torvalds 已提交
41
		int i;
42
		char buf[46], tmp[7], byte;
L
Linus Torvalds 已提交
43 44

		buf[0] = 0;
45
		for (i = 0; i < HCS_N_PORTS(params); i++) {
46
			/* FIXME MIPS won't readb() ... */
47
			byte = readb(&ehci->caps->portroute[(i >> 1)]);
48
			sprintf(tmp, "%d ",
49
				(i & 0x1) ? byte & 0xf : (byte >> 4) & 0xf);
L
Linus Torvalds 已提交
50 51
			strcat(buf, tmp);
		}
52
		ehci_dbg(ehci, "%s portroute %s\n", label, buf);
L
Linus Torvalds 已提交
53 54 55 56
	}
}
#else

57
static inline void dbg_hcs_params(struct ehci_hcd *ehci, char *label) {}
L
Linus Torvalds 已提交
58 59 60

#endif

O
Oliver Neukum 已提交
61
#ifdef CONFIG_DYNAMIC_DEBUG
L
Linus Torvalds 已提交
62

63 64
/*
 * check the values in the HCCPARAMS register
L
Linus Torvalds 已提交
65 66
 * (host controller _Capability_ parameters)
 * see EHCI Spec, Table 2-5 for each value
67
 */
68
static void dbg_hcc_params(struct ehci_hcd *ehci, char *label)
L
Linus Torvalds 已提交
69
{
70
	u32	params = ehci_readl(ehci, &ehci->caps->hcc_params);
L
Linus Torvalds 已提交
71

72 73
	if (HCC_ISOC_CACHE(params)) {
		ehci_dbg(ehci,
74 75 76 77 78
			"%s hcc_params %04x caching frame %s%s%s\n",
			label, params,
			HCC_PGM_FRAMELISTLEN(params) ? "256/512/1024" : "1024",
			HCC_CANPARK(params) ? " park" : "",
			HCC_64BIT_ADDR(params) ? " 64 bit addr" : "");
L
Linus Torvalds 已提交
79
	} else {
80
		ehci_dbg(ehci,
81
			"%s hcc_params %04x thresh %d uframes %s%s%s%s%s%s%s\n",
82 83 84 85 86
			label,
			params,
			HCC_ISOC_THRES(params),
			HCC_PGM_FRAMELISTLEN(params) ? "256/512/1024" : "1024",
			HCC_CANPARK(params) ? " park" : "",
87 88 89 90 91
			HCC_64BIT_ADDR(params) ? " 64 bit addr" : "",
			HCC_LPM(params) ? " LPM" : "",
			HCC_PER_PORT_CHANGE_EVENT(params) ? " ppce" : "",
			HCC_HW_PREFETCH(params) ? " hw prefetch" : "",
			HCC_32FRAME_PERIODIC_LIST(params) ?
M
Masanari Iida 已提交
92
				" 32 periodic list" : "");
L
Linus Torvalds 已提交
93 94 95 96
	}
}
#else

97
static inline void dbg_hcc_params(struct ehci_hcd *ehci, char *label) {}
L
Linus Torvalds 已提交
98 99 100

#endif

O
Oliver Neukum 已提交
101
#ifdef CONFIG_DYNAMIC_DEBUG
L
Linus Torvalds 已提交
102

103
static void __maybe_unused
104
dbg_qtd(const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)
L
Linus Torvalds 已提交
105
{
106 107 108 109
	ehci_dbg(ehci, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd,
		hc32_to_cpup(ehci, &qtd->hw_next),
		hc32_to_cpup(ehci, &qtd->hw_alt_next),
		hc32_to_cpup(ehci, &qtd->hw_token),
110 111
		hc32_to_cpup(ehci, &qtd->hw_buf[0]));
	if (qtd->hw_buf[1])
112 113 114 115 116
		ehci_dbg(ehci, "  p1=%08x p2=%08x p3=%08x p4=%08x\n",
			hc32_to_cpup(ehci, &qtd->hw_buf[1]),
			hc32_to_cpup(ehci, &qtd->hw_buf[2]),
			hc32_to_cpup(ehci, &qtd->hw_buf[3]),
			hc32_to_cpup(ehci, &qtd->hw_buf[4]));
L
Linus Torvalds 已提交
117 118
}

119
static void __maybe_unused
120
dbg_qh(const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
L
Linus Torvalds 已提交
121
{
122 123
	struct ehci_qh_hw *hw = qh->hw;

124
	ehci_dbg(ehci, "%s qh %p n%08x info %x %x qtd %x\n", label,
125 126
		qh, hw->hw_next, hw->hw_info1, hw->hw_info2, hw->hw_current);
	dbg_qtd("overlay", ehci, (struct ehci_qtd *) &hw->hw_qtd_next);
L
Linus Torvalds 已提交
127 128
}

129
static void __maybe_unused
130
dbg_itd(const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd)
L
Linus Torvalds 已提交
131
{
132
	ehci_dbg(ehci, "%s [%d] itd %p, next %08x, urb %p\n",
133 134
		label, itd->frame, itd, hc32_to_cpu(ehci, itd->hw_next),
		itd->urb);
135
	ehci_dbg(ehci,
136
		"  trans: %08x %08x %08x %08x %08x %08x %08x %08x\n",
137 138 139 140 141 142 143 144
		hc32_to_cpu(ehci, itd->hw_transaction[0]),
		hc32_to_cpu(ehci, itd->hw_transaction[1]),
		hc32_to_cpu(ehci, itd->hw_transaction[2]),
		hc32_to_cpu(ehci, itd->hw_transaction[3]),
		hc32_to_cpu(ehci, itd->hw_transaction[4]),
		hc32_to_cpu(ehci, itd->hw_transaction[5]),
		hc32_to_cpu(ehci, itd->hw_transaction[6]),
		hc32_to_cpu(ehci, itd->hw_transaction[7]));
145
	ehci_dbg(ehci,
146
		"  buf:   %08x %08x %08x %08x %08x %08x %08x\n",
147 148 149 150 151 152 153
		hc32_to_cpu(ehci, itd->hw_bufp[0]),
		hc32_to_cpu(ehci, itd->hw_bufp[1]),
		hc32_to_cpu(ehci, itd->hw_bufp[2]),
		hc32_to_cpu(ehci, itd->hw_bufp[3]),
		hc32_to_cpu(ehci, itd->hw_bufp[4]),
		hc32_to_cpu(ehci, itd->hw_bufp[5]),
		hc32_to_cpu(ehci, itd->hw_bufp[6]));
154
	ehci_dbg(ehci, "  index: %d %d %d %d %d %d %d %d\n",
L
Linus Torvalds 已提交
155 156 157 158 159
		itd->index[0], itd->index[1], itd->index[2],
		itd->index[3], itd->index[4], itd->index[5],
		itd->index[6], itd->index[7]);
}

160
static void __maybe_unused
161
dbg_sitd(const char *label, struct ehci_hcd *ehci, struct ehci_sitd *sitd)
L
Linus Torvalds 已提交
162
{
163
	ehci_dbg(ehci, "%s [%d] sitd %p, next %08x, urb %p\n",
164 165
		label, sitd->frame, sitd, hc32_to_cpu(ehci, sitd->hw_next),
		sitd->urb);
166
	ehci_dbg(ehci,
167
		"  addr %08x sched %04x result %08x buf %08x %08x\n",
168 169 170 171 172
		hc32_to_cpu(ehci, sitd->hw_fullspeed_ep),
		hc32_to_cpu(ehci, sitd->hw_uframe),
		hc32_to_cpu(ehci, sitd->hw_results),
		hc32_to_cpu(ehci, sitd->hw_buf[0]),
		hc32_to_cpu(ehci, sitd->hw_buf[1]));
L
Linus Torvalds 已提交
173 174
}

175
static int __maybe_unused
176
dbg_status_buf(char *buf, unsigned len, const char *label, u32 status)
L
Linus Torvalds 已提交
177
{
178
	return scnprintf(buf, len,
179
		"%s%sstatus %04x%s%s%s%s%s%s%s%s%s%s%s",
180
		label, label[0] ? " " : "", status,
181
		(status & STS_PPCE_MASK) ? " PPCE" : "",
L
Linus Torvalds 已提交
182 183 184 185 186 187 188 189 190
		(status & STS_ASS) ? " Async" : "",
		(status & STS_PSS) ? " Periodic" : "",
		(status & STS_RECL) ? " Recl" : "",
		(status & STS_HALT) ? " Halt" : "",
		(status & STS_IAA) ? " IAA" : "",
		(status & STS_FATAL) ? " FATAL" : "",
		(status & STS_FLR) ? " FLR" : "",
		(status & STS_PCD) ? " PCD" : "",
		(status & STS_ERR) ? " ERR" : "",
191
		(status & STS_INT) ? " INT" : "");
L
Linus Torvalds 已提交
192 193
}

194
static int __maybe_unused
195
dbg_intr_buf(char *buf, unsigned len, const char *label, u32 enable)
L
Linus Torvalds 已提交
196
{
197
	return scnprintf(buf, len,
198
		"%s%sintrenable %02x%s%s%s%s%s%s%s",
199
		label, label[0] ? " " : "", enable,
200
		(enable & STS_PPCE_MASK) ? " PPCE" : "",
L
Linus Torvalds 已提交
201 202 203 204 205
		(enable & STS_IAA) ? " IAA" : "",
		(enable & STS_FATAL) ? " FATAL" : "",
		(enable & STS_FLR) ? " FLR" : "",
		(enable & STS_PCD) ? " PCD" : "",
		(enable & STS_ERR) ? " ERR" : "",
206
		(enable & STS_INT) ? " INT" : "");
L
Linus Torvalds 已提交
207 208
}

209
static const char *const fls_strings[] = { "1024", "512", "256", "??" };
L
Linus Torvalds 已提交
210 211

static int
212
dbg_command_buf(char *buf, unsigned len, const char *label, u32 command)
L
Linus Torvalds 已提交
213
{
214
	return scnprintf(buf, len,
215 216
		"%s%scommand %07x %s%s%s%s%s%s=%d ithresh=%d%s%s%s%s "
		"period=%s%s %s",
217
		label, label[0] ? " " : "", command,
218 219 220 221 222 223
		(command & CMD_HIRD) ? " HIRD" : "",
		(command & CMD_PPCEE) ? " PPCEE" : "",
		(command & CMD_FSP) ? " FSP" : "",
		(command & CMD_ASPE) ? " ASPE" : "",
		(command & CMD_PSPE) ? " PSPE" : "",
		(command & CMD_PARK) ? " park" : "(park)",
224
		CMD_PARK_CNT(command),
L
Linus Torvalds 已提交
225 226 227 228 229
		(command >> 16) & 0x3f,
		(command & CMD_LRESET) ? " LReset" : "",
		(command & CMD_IAAD) ? " IAAD" : "",
		(command & CMD_ASE) ? " Async" : "",
		(command & CMD_PSE) ? " Periodic" : "",
230
		fls_strings[(command >> 2) & 0x3],
L
Linus Torvalds 已提交
231
		(command & CMD_RESET) ? " Reset" : "",
232
		(command & CMD_RUN) ? "RUN" : "HALT");
L
Linus Torvalds 已提交
233 234 235
}

static int
236
dbg_port_buf(char *buf, unsigned len, const char *label, int port, u32 status)
L
Linus Torvalds 已提交
237 238 239 240 241
{
	char	*sig;

	/* signaling state */
	switch (status & (3 << 10)) {
242 243 244 245 246 247 248 249 250 251 252 253
	case 0 << 10:
		sig = "se0";
		break;
	case 1 << 10: /* low speed */
		sig = "k";
		break;
	case 2 << 10:
		sig = "j";
		break;
	default:
		sig = "?";
		break;
L
Linus Torvalds 已提交
254 255
	}

256
	return scnprintf(buf, len,
257 258
		"%s%sport:%d status %06x %d %s%s%s%s%s%s "
		"sig=%s%s%s%s%s%s%s%s%s%s%s",
259
		label, label[0] ? " " : "", port, status,
260 261
		status >> 25, /*device address */
		(status & PORT_SSTS) >> 23 == PORTSC_SUSPEND_STS_ACK ?
262
						" ACK" : "",
263
		(status & PORT_SSTS) >> 23 == PORTSC_SUSPEND_STS_NYET ?
264
						" NYET" : "",
265
		(status & PORT_SSTS) >> 23 == PORTSC_SUSPEND_STS_STALL ?
266
						" STALL" : "",
267
		(status & PORT_SSTS) >> 23 == PORTSC_SUSPEND_STS_ERR ?
268
						" ERR" : "",
L
Linus Torvalds 已提交
269 270 271
		(status & PORT_POWER) ? " POWER" : "",
		(status & PORT_OWNER) ? " OWNER" : "",
		sig,
272
		(status & PORT_LPM) ? " LPM" : "",
L
Linus Torvalds 已提交
273 274 275 276 277 278 279 280
		(status & PORT_RESET) ? " RESET" : "",
		(status & PORT_SUSPEND) ? " SUSPEND" : "",
		(status & PORT_RESUME) ? " RESUME" : "",
		(status & PORT_OCC) ? " OCC" : "",
		(status & PORT_OC) ? " OC" : "",
		(status & PORT_PEC) ? " PEC" : "",
		(status & PORT_PE) ? " PE" : "",
		(status & PORT_CSC) ? " CSC" : "",
281
		(status & PORT_CONNECT) ? " CONNECT" : "");
L
Linus Torvalds 已提交
282 283 284
}

#else
285
static inline void __maybe_unused
286
dbg_qh(char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
L
Linus Torvalds 已提交
287 288
{}

289
static inline int __maybe_unused
290
dbg_status_buf(char *buf, unsigned len, const char *label, u32 status)
L
Linus Torvalds 已提交
291 292
{ return 0; }

293
static inline int __maybe_unused
294
dbg_command_buf(char *buf, unsigned len, const char *label, u32 command)
L
Linus Torvalds 已提交
295 296
{ return 0; }

297
static inline int __maybe_unused
298
dbg_intr_buf(char *buf, unsigned len, const char *label, u32 enable)
L
Linus Torvalds 已提交
299 300
{ return 0; }

301
static inline int __maybe_unused
302
dbg_port_buf(char *buf, unsigned len, const char *label, int port, u32 status)
L
Linus Torvalds 已提交
303 304
{ return 0; }

O
Oliver Neukum 已提交
305
#endif	/* CONFIG_DYNAMIC_DEBUG */
L
Linus Torvalds 已提交
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329

/* functions have the "wrong" filename when they're output... */
#define dbg_status(ehci, label, status) { \
	char _buf [80]; \
	dbg_status_buf (_buf, sizeof _buf, label, status); \
	ehci_dbg (ehci, "%s\n", _buf); \
}

#define dbg_cmd(ehci, label, command) { \
	char _buf [80]; \
	dbg_command_buf (_buf, sizeof _buf, label, command); \
	ehci_dbg (ehci, "%s\n", _buf); \
}

#define dbg_port(ehci, label, port, status) { \
	char _buf [80]; \
	dbg_port_buf (_buf, sizeof _buf, label, port, status); \
	ehci_dbg (ehci, "%s\n", _buf); \
}

/*-------------------------------------------------------------------------*/

#ifdef STUB_DEBUG_FILES

330 331
static inline void create_debug_files(struct ehci_hcd *bus) { }
static inline void remove_debug_files(struct ehci_hcd *bus) { }
L
Linus Torvalds 已提交
332 333 334

#else

335 336 337
/* troubleshooting help: expose state in debugfs */

static int debug_async_open(struct inode *, struct file *);
338
static int debug_bandwidth_open(struct inode *, struct file *);
339 340
static int debug_periodic_open(struct inode *, struct file *);
static int debug_registers_open(struct inode *, struct file *);
341

342 343 344 345 346 347 348 349
static ssize_t debug_output(struct file*, char __user*, size_t, loff_t*);
static int debug_close(struct inode *, struct file *);

static const struct file_operations debug_async_fops = {
	.owner		= THIS_MODULE,
	.open		= debug_async_open,
	.read		= debug_output,
	.release	= debug_close,
350
	.llseek		= default_llseek,
351
};
352 353 354 355 356 357 358
static const struct file_operations debug_bandwidth_fops = {
	.owner		= THIS_MODULE,
	.open		= debug_bandwidth_open,
	.read		= debug_output,
	.release	= debug_close,
	.llseek		= default_llseek,
};
359 360 361 362 363
static const struct file_operations debug_periodic_fops = {
	.owner		= THIS_MODULE,
	.open		= debug_periodic_open,
	.read		= debug_output,
	.release	= debug_close,
364
	.llseek		= default_llseek,
365 366 367 368 369 370
};
static const struct file_operations debug_registers_fops = {
	.owner		= THIS_MODULE,
	.open		= debug_registers_open,
	.read		= debug_output,
	.release	= debug_close,
371
	.llseek		= default_llseek,
372 373 374 375 376 377 378 379 380
};

static struct dentry *ehci_debug_root;

struct debug_buffer {
	ssize_t (*fill_func)(struct debug_buffer *);	/* fill method */
	struct usb_bus *bus;
	struct mutex mutex;	/* protect filling of buffer */
	size_t count;		/* number of characters filled into buffer */
381 382
	char *output_buf;
	size_t alloc_size;
383
};
L
Linus Torvalds 已提交
384 385 386

#define speed_char(info1) ({ char tmp; \
		switch (info1 & (3 << 12)) { \
387 388 389
		case QH_FULL_SPEED: tmp = 'f'; break; \
		case QH_LOW_SPEED:  tmp = 'l'; break; \
		case QH_HIGH_SPEED: tmp = 'h'; break; \
L
Linus Torvalds 已提交
390
		default: tmp = '?'; break; \
J
Joe Perches 已提交
391
		} tmp; })
L
Linus Torvalds 已提交
392

393
static inline char token_mark(struct ehci_hcd *ehci, __hc32 token)
L
Linus Torvalds 已提交
394
{
395 396
	__u32 v = hc32_to_cpu(ehci, token);

L
Linus Torvalds 已提交
397 398 399 400
	if (v & QTD_STS_ACTIVE)
		return '*';
	if (v & QTD_STS_HALT)
		return '-';
401
	if (!IS_SHORT_READ(v))
L
Linus Torvalds 已提交
402 403 404 405 406
		return ' ';
	/* tries to advance through hw_alt_next */
	return '/';
}

407
static void qh_lines(
L
Linus Torvalds 已提交
408 409 410 411 412 413 414 415 416 417 418 419 420 421
	struct ehci_hcd *ehci,
	struct ehci_qh *qh,
	char **nextp,
	unsigned *sizep
)
{
	u32			scratch;
	u32			hw_curr;
	struct list_head	*entry;
	struct ehci_qtd		*td;
	unsigned		temp;
	unsigned		size = *sizep;
	char			*next = *nextp;
	char			mark;
A
Al Viro 已提交
422
	__le32			list_end = EHCI_LIST_END(ehci);
423
	struct ehci_qh_hw	*hw = qh->hw;
L
Linus Torvalds 已提交
424

425
	if (hw->hw_qtd_next == list_end)	/* NEC does this */
L
Linus Torvalds 已提交
426 427
		mark = '@';
	else
428
		mark = token_mark(ehci, hw->hw_token);
L
Linus Torvalds 已提交
429
	if (mark == '/') {	/* qh_alt_next controls qh advance? */
430 431
		if ((hw->hw_alt_next & QTD_MASK(ehci))
				== ehci->async->hw->hw_alt_next)
L
Linus Torvalds 已提交
432
			mark = '#';	/* blocked */
433
		else if (hw->hw_alt_next == list_end)
L
Linus Torvalds 已提交
434 435 436
			mark = '.';	/* use hw_qtd_next */
		/* else alt_next points to some other qtd */
	}
437 438
	scratch = hc32_to_cpup(ehci, &hw->hw_info1);
	hw_curr = (mark == '*') ? hc32_to_cpup(ehci, &hw->hw_current) : 0;
439
	temp = scnprintf(next, size,
440 441
			"qh/%p dev%d %cs ep%d %08x %08x (%08x%c %s nak%d)"
			" [cur %08x next %08x buf[0] %08x]",
L
Linus Torvalds 已提交
442 443 444
			qh, scratch & 0x007f,
			speed_char (scratch),
			(scratch >> 8) & 0x000f,
445 446 447
			scratch, hc32_to_cpup(ehci, &hw->hw_info2),
			hc32_to_cpup(ehci, &hw->hw_token), mark,
			(cpu_to_hc32(ehci, QTD_TOGGLE) & hw->hw_token)
L
Linus Torvalds 已提交
448
				? "data1" : "data0",
449 450 451 452
			(hc32_to_cpup(ehci, &hw->hw_alt_next) >> 1) & 0x0f,
			hc32_to_cpup(ehci, &hw->hw_current),
			hc32_to_cpup(ehci, &hw->hw_qtd_next),
			hc32_to_cpup(ehci, &hw->hw_buf[0]));
L
Linus Torvalds 已提交
453 454 455 456
	size -= temp;
	next += temp;

	/* hc may be modifying the list as we read it ... */
457
	list_for_each(entry, &qh->qtd_list) {
458 459
		char *type;

460
		td = list_entry(entry, struct ehci_qtd, qtd_list);
461
		scratch = hc32_to_cpup(ehci, &td->hw_token);
L
Linus Torvalds 已提交
462 463 464
		mark = ' ';
		if (hw_curr == td->qtd_dma)
			mark = '*';
465
		else if (hw->hw_qtd_next == cpu_to_hc32(ehci, td->qtd_dma))
L
Linus Torvalds 已提交
466
			mark = '+';
467
		else if (QTD_LENGTH(scratch)) {
468
			if (td->hw_alt_next == ehci->async->hw->hw_alt_next)
L
Linus Torvalds 已提交
469
				mark = '#';
470
			else if (td->hw_alt_next != list_end)
L
Linus Torvalds 已提交
471 472
				mark = '/';
		}
473 474 475 476 477 478 479 480 481 482 483 484 485 486
		switch ((scratch >> 8) & 0x03) {
		case 0:
			type = "out";
			break;
		case 1:
			type = "in";
			break;
		case 2:
			type = "setup";
			break;
		default:
			type = "?";
			break;
		}
487
		temp = scnprintf(next, size,
488 489
				"\n\t%p%c%s len=%d %08x urb %p"
				" [td %08x buf[0] %08x]",
490
				td, mark, type,
L
Linus Torvalds 已提交
491 492
				(scratch >> 16) & 0x7fff,
				scratch,
493 494 495
				td->urb,
				(u32) td->qtd_dma,
				hc32_to_cpup(ehci, &td->hw_buf[0]));
L
Linus Torvalds 已提交
496 497 498 499 500 501
		size -= temp;
		next += temp;
		if (temp == size)
			goto done;
	}

502
	temp = scnprintf(next, size, "\n");
L
Linus Torvalds 已提交
503 504 505 506 507 508 509 510
	size -= temp;
	next += temp;

done:
	*sizep = size;
	*nextp = next;
}

511
static ssize_t fill_async_buffer(struct debug_buffer *buf)
L
Linus Torvalds 已提交
512 513 514 515 516 517 518 519
{
	struct usb_hcd		*hcd;
	struct ehci_hcd		*ehci;
	unsigned long		flags;
	unsigned		temp, size;
	char			*next;
	struct ehci_qh		*qh;

520
	hcd = bus_to_hcd(buf->bus);
521
	ehci = hcd_to_ehci(hcd);
522 523
	next = buf->output_buf;
	size = buf->alloc_size;
L
Linus Torvalds 已提交
524

525 526
	*next = 0;

527 528
	/*
	 * dumps a snapshot of the async schedule.
L
Linus Torvalds 已提交
529 530 531
	 * usually empty except for long-term bulk reads, or head.
	 * one QH per line, and TDs we know about
	 */
532
	spin_lock_irqsave(&ehci->lock, flags);
L
Linus Torvalds 已提交
533
	for (qh = ehci->async->qh_next.qh; size > 0 && qh; qh = qh->qh_next.qh)
534
		qh_lines(ehci, qh, &next, &size);
535
	if (!list_empty(&ehci->async_unlink) && size > 0) {
A
Alan Stern 已提交
536
		temp = scnprintf(next, size, "\nunlink =\n");
L
Linus Torvalds 已提交
537 538 539
		size -= temp;
		next += temp;

540 541 542 543 544
		list_for_each_entry(qh, &ehci->async_unlink, unlink_node) {
			if (size <= 0)
				break;
			qh_lines(ehci, qh, &next, &size);
		}
L
Linus Torvalds 已提交
545
	}
546
	spin_unlock_irqrestore(&ehci->lock, flags);
L
Linus Torvalds 已提交
547

548
	return strlen(buf->output_buf);
L
Linus Torvalds 已提交
549 550
}

551 552 553
static ssize_t fill_bandwidth_buffer(struct debug_buffer *buf)
{
	struct ehci_hcd		*ehci;
554 555
	struct ehci_tt		*tt;
	struct ehci_per_sched	*ps;
556 557 558 559
	unsigned		temp, size;
	char			*next;
	unsigned		i;
	u8			*bw;
560 561
	u16			*bf;
	u8			budget[EHCI_BANDWIDTH_SIZE];
562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584

	ehci = hcd_to_ehci(bus_to_hcd(buf->bus));
	next = buf->output_buf;
	size = buf->alloc_size;

	*next = 0;

	spin_lock_irq(&ehci->lock);

	/* Dump the HS bandwidth table */
	temp = scnprintf(next, size,
			"HS bandwidth allocation (us per microframe)\n");
	size -= temp;
	next += temp;
	for (i = 0; i < EHCI_BANDWIDTH_SIZE; i += 8) {
		bw = &ehci->bandwidth[i];
		temp = scnprintf(next, size,
				"%2u: %4u%4u%4u%4u%4u%4u%4u%4u\n",
				i, bw[0], bw[1], bw[2], bw[3],
					bw[4], bw[5], bw[6], bw[7]);
		size -= temp;
		next += temp;
	}
585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628

	/* Dump all the FS/LS tables */
	list_for_each_entry(tt, &ehci->tt_list, tt_list) {
		temp = scnprintf(next, size,
				"\nTT %s port %d  FS/LS bandwidth allocation (us per frame)\n",
				dev_name(&tt->usb_tt->hub->dev),
				tt->tt_port + !!tt->usb_tt->multi);
		size -= temp;
		next += temp;

		bf = tt->bandwidth;
		temp = scnprintf(next, size,
				"  %5u%5u%5u%5u%5u%5u%5u%5u\n",
				bf[0], bf[1], bf[2], bf[3],
					bf[4], bf[5], bf[6], bf[7]);
		size -= temp;
		next += temp;

		temp = scnprintf(next, size,
				"FS/LS budget (us per microframe)\n");
		size -= temp;
		next += temp;
		compute_tt_budget(budget, tt);
		for (i = 0; i < EHCI_BANDWIDTH_SIZE; i += 8) {
			bw = &budget[i];
			temp = scnprintf(next, size,
					"%2u: %4u%4u%4u%4u%4u%4u%4u%4u\n",
					i, bw[0], bw[1], bw[2], bw[3],
						bw[4], bw[5], bw[6], bw[7]);
			size -= temp;
			next += temp;
		}
		list_for_each_entry(ps, &tt->ps_list, ps_list) {
			temp = scnprintf(next, size,
					"%s ep %02x:  %4u @ %2u.%u+%u mask %04x\n",
					dev_name(&ps->udev->dev),
					ps->ep->desc.bEndpointAddress,
					ps->tt_usecs,
					ps->bw_phase, ps->phase_uf,
					ps->bw_period, ps->cs_mask);
			size -= temp;
			next += temp;
		}
	}
629 630 631 632 633
	spin_unlock_irq(&ehci->lock);

	return next - buf->output_buf;
}

L
Linus Torvalds 已提交
634
#define DBG_SCHED_LIMIT 64
635
static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
L
Linus Torvalds 已提交
636 637 638 639 640 641 642 643
{
	struct usb_hcd		*hcd;
	struct ehci_hcd		*ehci;
	unsigned long		flags;
	union ehci_shadow	p, *seen;
	unsigned		temp, size, seen_count;
	char			*next;
	unsigned		i;
644
	__hc32			tag;
L
Linus Torvalds 已提交
645

646 647
	seen = kmalloc(DBG_SCHED_LIMIT * sizeof *seen, GFP_ATOMIC);
	if (!seen)
L
Linus Torvalds 已提交
648 649 650
		return 0;
	seen_count = 0;

651
	hcd = bus_to_hcd(buf->bus);
652
	ehci = hcd_to_ehci(hcd);
653 654
	next = buf->output_buf;
	size = buf->alloc_size;
L
Linus Torvalds 已提交
655

656
	temp = scnprintf(next, size, "size = %d\n", ehci->periodic_size);
L
Linus Torvalds 已提交
657 658 659
	size -= temp;
	next += temp;

660 661
	/*
	 * dump a snapshot of the periodic schedule.
L
Linus Torvalds 已提交
662 663
	 * iso changes, interrupt usually doesn't.
	 */
664
	spin_lock_irqsave(&ehci->lock, flags);
L
Linus Torvalds 已提交
665
	for (i = 0; i < ehci->periodic_size; i++) {
666
		p = ehci->pshadow[i];
667
		if (likely(!p.ptr))
L
Linus Torvalds 已提交
668
			continue;
669
		tag = Q_NEXT_TYPE(ehci, ehci->periodic[i]);
L
Linus Torvalds 已提交
670

671
		temp = scnprintf(next, size, "%4d: ", i);
L
Linus Torvalds 已提交
672 673 674 675
		size -= temp;
		next += temp;

		do {
676 677
			struct ehci_qh_hw *hw;

678
			switch (hc32_to_cpu(ehci, tag)) {
L
Linus Torvalds 已提交
679
			case Q_TYPE_QH:
680
				hw = p.qh->hw;
681
				temp = scnprintf(next, size, " qh%d-%04x/%p",
682
						p.qh->ps.period,
683
						hc32_to_cpup(ehci,
684
							&hw->hw_info2)
L
Linus Torvalds 已提交
685
							/* uframe masks */
686
							& (QH_CMASK | QH_SMASK),
L
Linus Torvalds 已提交
687 688 689 690 691
						p.qh);
				size -= temp;
				next += temp;
				/* don't repeat what follows this qh */
				for (temp = 0; temp < seen_count; temp++) {
692
					if (seen[temp].ptr != p.ptr)
L
Linus Torvalds 已提交
693
						continue;
694
					if (p.qh->qh_next.ptr) {
695
						temp = scnprintf(next, size,
L
Linus Torvalds 已提交
696
							" ...");
697 698 699
						size -= temp;
						next += temp;
					}
L
Linus Torvalds 已提交
700 701 702
					break;
				}
				/* show more info the first time around */
703
				if (temp == seen_count) {
704
					u32	scratch = hc32_to_cpup(ehci,
705
							&hw->hw_info1);
L
Linus Torvalds 已提交
706 707 708 709 710
					struct ehci_qtd	*qtd;
					char		*type = "";

					/* count tds, get ep direction */
					temp = 0;
711
					list_for_each_entry(qtd,
L
Linus Torvalds 已提交
712 713 714
							&p.qh->qtd_list,
							qtd_list) {
						temp++;
715 716 717 718 719 720 721 722 723
						switch ((hc32_to_cpu(ehci,
							qtd->hw_token) >> 8)
								& 0x03) {
						case 0:
							type = "out";
							continue;
						case 1:
							type = "in";
							continue;
L
Linus Torvalds 已提交
724 725 726
						}
					}

727
					temp = scnprintf(next, size,
L
Linus Torvalds 已提交
728 729 730 731 732
						" (%c%d ep%d%s "
						"[%d/%d] q%d p%d)",
						speed_char (scratch),
						scratch & 0x007f,
						(scratch >> 8) & 0x000f, type,
733 734
						p.qh->ps.usecs,
						p.qh->ps.c_usecs,
L
Linus Torvalds 已提交
735 736 737 738
						temp,
						0x7ff & (scratch >> 16));

					if (seen_count < DBG_SCHED_LIMIT)
739
						seen[seen_count++].qh = p.qh;
L
Linus Torvalds 已提交
740 741
				} else
					temp = 0;
A
Alan Stern 已提交
742 743
				tag = Q_NEXT_TYPE(ehci, hw->hw_next);
				p = p.qh->qh_next;
L
Linus Torvalds 已提交
744 745
				break;
			case Q_TYPE_FSTN:
746
				temp = scnprintf(next, size,
L
Linus Torvalds 已提交
747 748
					" fstn-%8x/%p", p.fstn->hw_prev,
					p.fstn);
749
				tag = Q_NEXT_TYPE(ehci, p.fstn->hw_next);
L
Linus Torvalds 已提交
750 751 752
				p = p.fstn->fstn_next;
				break;
			case Q_TYPE_ITD:
753
				temp = scnprintf(next, size,
L
Linus Torvalds 已提交
754
					" itd/%p", p.itd);
755
				tag = Q_NEXT_TYPE(ehci, p.itd->hw_next);
L
Linus Torvalds 已提交
756 757 758
				p = p.itd->itd_next;
				break;
			case Q_TYPE_SITD:
759
				temp = scnprintf(next, size,
L
Linus Torvalds 已提交
760
					" sitd%d-%04x/%p",
761
					p.sitd->stream->ps.period,
762
					hc32_to_cpup(ehci, &p.sitd->hw_uframe)
L
Linus Torvalds 已提交
763 764
						& 0x0000ffff,
					p.sitd);
765
				tag = Q_NEXT_TYPE(ehci, p.sitd->hw_next);
L
Linus Torvalds 已提交
766 767 768 769 770 771 772
				p = p.sitd->sitd_next;
				break;
			}
			size -= temp;
			next += temp;
		} while (p.ptr);

773
		temp = scnprintf(next, size, "\n");
L
Linus Torvalds 已提交
774 775 776
		size -= temp;
		next += temp;
	}
777 778
	spin_unlock_irqrestore(&ehci->lock, flags);
	kfree(seen);
L
Linus Torvalds 已提交
779

780
	return buf->alloc_size - size;
L
Linus Torvalds 已提交
781 782 783
}
#undef DBG_SCHED_LIMIT

784 785 786 787 788 789 790 791 792
static const char *rh_state_string(struct ehci_hcd *ehci)
{
	switch (ehci->rh_state) {
	case EHCI_RH_HALTED:
		return "halted";
	case EHCI_RH_SUSPENDED:
		return "suspended";
	case EHCI_RH_RUNNING:
		return "running";
793 794
	case EHCI_RH_STOPPING:
		return "stopping";
795 796 797 798
	}
	return "?";
}

799
static ssize_t fill_registers_buffer(struct debug_buffer *buf)
L
Linus Torvalds 已提交
800 801 802 803 804
{
	struct usb_hcd		*hcd;
	struct ehci_hcd		*ehci;
	unsigned long		flags;
	unsigned		temp, size, i;
805 806 807
	char			*next, scratch[80];
	static char		fmt[] = "%*s\n";
	static char		label[] = "";
L
Linus Torvalds 已提交
808

809
	hcd = bus_to_hcd(buf->bus);
810
	ehci = hcd_to_ehci(hcd);
811 812
	next = buf->output_buf;
	size = buf->alloc_size;
L
Linus Torvalds 已提交
813

814
	spin_lock_irqsave(&ehci->lock, flags);
L
Linus Torvalds 已提交
815

816
	if (!HCD_HW_ACCESSIBLE(hcd)) {
817
		size = scnprintf(next, size,
818
			"bus %s, device %s\n"
D
David Brownell 已提交
819
			"%s\n"
L
Linus Torvalds 已提交
820 821
			"SUSPENDED (no register access)\n",
			hcd->self.controller->bus->name,
822
			dev_name(hcd->self.controller),
D
David Brownell 已提交
823
			hcd->product_desc);
L
Linus Torvalds 已提交
824 825 826 827
		goto done;
	}

	/* Capability Registers */
828
	i = HC_VERSION(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase));
829
	temp = scnprintf(next, size,
830
		"bus %s, device %s\n"
D
David Brownell 已提交
831
		"%s\n"
832
		"EHCI %x.%02x, rh state %s\n",
L
Linus Torvalds 已提交
833
		hcd->self.controller->bus->name,
834
		dev_name(hcd->self.controller),
D
David Brownell 已提交
835
		hcd->product_desc,
836
		i >> 8, i & 0x0ff, rh_state_string(ehci));
L
Linus Torvalds 已提交
837 838 839
	size -= temp;
	next += temp;

D
David Brownell 已提交
840 841
#ifdef	CONFIG_PCI
	/* EHCI 0.96 and later may have "extended capabilities" */
842
	if (dev_is_pci(hcd->self.controller)) {
D
David Brownell 已提交
843 844
		struct pci_dev	*pdev;
		u32		offset, cap, cap2;
845
		unsigned	count = 256 / 4;
D
David Brownell 已提交
846 847

		pdev = to_pci_dev(ehci_to_hcd(ehci)->self.controller);
848 849
		offset = HCC_EXT_CAPS(ehci_readl(ehci,
				&ehci->caps->hcc_params));
D
David Brownell 已提交
850
		while (offset && count--) {
851
			pci_read_config_dword(pdev, offset, &cap);
D
David Brownell 已提交
852 853
			switch (cap & 0xff) {
			case 1:
854
				temp = scnprintf(next, size,
D
David Brownell 已提交
855 856 857 858 859 860 861
					"ownership %08x%s%s\n", cap,
					(cap & (1 << 24)) ? " linux" : "",
					(cap & (1 << 16)) ? " firmware" : "");
				size -= temp;
				next += temp;

				offset += 4;
862 863
				pci_read_config_dword(pdev, offset, &cap2);
				temp = scnprintf(next, size,
D
David Brownell 已提交
864 865 866 867 868 869 870 871 872 873 874 875 876 877 878
					"SMI sts/enable 0x%08x\n", cap2);
				size -= temp;
				next += temp;
				break;
			case 0:		/* illegal reserved capability */
				cap = 0;
				/* FALLTHROUGH */
			default:		/* unknown */
				break;
			}
			temp = (cap >> 8) & 0xff;
		}
	}
#endif

879
	/* FIXME interpret both types of params */
880
	i = ehci_readl(ehci, &ehci->caps->hcs_params);
881
	temp = scnprintf(next, size, "structural params 0x%08x\n", i);
L
Linus Torvalds 已提交
882 883 884
	size -= temp;
	next += temp;

885
	i = ehci_readl(ehci, &ehci->caps->hcc_params);
886
	temp = scnprintf(next, size, "capability params 0x%08x\n", i);
L
Linus Torvalds 已提交
887 888 889 890
	size -= temp;
	next += temp;

	/* Operational Registers */
891
	temp = dbg_status_buf(scratch, sizeof(scratch), label,
892
			ehci_readl(ehci, &ehci->regs->status));
893
	temp = scnprintf(next, size, fmt, temp, scratch);
L
Linus Torvalds 已提交
894 895 896
	size -= temp;
	next += temp;

897
	temp = dbg_command_buf(scratch, sizeof(scratch), label,
898
			ehci_readl(ehci, &ehci->regs->command));
899
	temp = scnprintf(next, size, fmt, temp, scratch);
L
Linus Torvalds 已提交
900 901 902
	size -= temp;
	next += temp;

903
	temp = dbg_intr_buf(scratch, sizeof(scratch), label,
904
			ehci_readl(ehci, &ehci->regs->intr_enable));
905
	temp = scnprintf(next, size, fmt, temp, scratch);
L
Linus Torvalds 已提交
906 907 908
	size -= temp;
	next += temp;

909
	temp = scnprintf(next, size, "uframe %04x\n",
910
			ehci_read_frame_index(ehci));
L
Linus Torvalds 已提交
911 912 913
	size -= temp;
	next += temp;

914 915
	for (i = 1; i <= HCS_N_PORTS(ehci->hcs_params); i++) {
		temp = dbg_port_buf(scratch, sizeof(scratch), label, i,
916 917
				ehci_readl(ehci,
					&ehci->regs->port_status[i - 1]));
918
		temp = scnprintf(next, size, fmt, temp, scratch);
L
Linus Torvalds 已提交
919 920
		size -= temp;
		next += temp;
D
David Brownell 已提交
921
		if (i == HCS_DEBUG_PORT(ehci->hcs_params) && ehci->debug) {
922
			temp = scnprintf(next, size,
D
David Brownell 已提交
923
					"    debug control %08x\n",
924 925
					ehci_readl(ehci,
						&ehci->debug->control));
D
David Brownell 已提交
926 927 928
			size -= temp;
			next += temp;
		}
L
Linus Torvalds 已提交
929 930
	}

931
	if (!list_empty(&ehci->async_unlink)) {
A
Alan Stern 已提交
932
		temp = scnprintf(next, size, "async unlink qh %p\n",
933 934
				list_first_entry(&ehci->async_unlink,
						struct ehci_qh, unlink_node));
L
Linus Torvalds 已提交
935 936 937 938 939
		size -= temp;
		next += temp;
	}

#ifdef EHCI_STATS
940
	temp = scnprintf(next, size,
A
Alan Stern 已提交
941 942
		"irq normal %ld err %ld iaa %ld (lost %ld)\n",
		ehci->stats.normal, ehci->stats.error, ehci->stats.iaa,
L
Linus Torvalds 已提交
943 944 945 946
		ehci->stats.lost_iaa);
	size -= temp;
	next += temp;

947
	temp = scnprintf(next, size, "complete %ld unlink %ld\n",
L
Linus Torvalds 已提交
948 949 950 951 952 953
		ehci->stats.complete, ehci->stats.unlink);
	size -= temp;
	next += temp;
#endif

done:
954
	spin_unlock_irqrestore(&ehci->lock, flags);
L
Linus Torvalds 已提交
955

956
	return buf->alloc_size - size;
L
Linus Torvalds 已提交
957 958
}

959 960
static struct debug_buffer *alloc_buffer(struct usb_bus *bus,
				ssize_t (*fill_func)(struct debug_buffer *))
L
Linus Torvalds 已提交
961
{
962 963 964
	struct debug_buffer *buf;

	buf = kzalloc(sizeof(struct debug_buffer), GFP_KERNEL);
L
Linus Torvalds 已提交
965

966 967 968 969
	if (buf) {
		buf->bus = bus;
		buf->fill_func = fill_func;
		mutex_init(&buf->mutex);
970
		buf->alloc_size = PAGE_SIZE;
971 972 973
	}

	return buf;
L
Linus Torvalds 已提交
974 975
}

976
static int fill_buffer(struct debug_buffer *buf)
L
Linus Torvalds 已提交
977
{
978 979
	int ret = 0;

980
	if (!buf->output_buf)
981
		buf->output_buf = vmalloc(buf->alloc_size);
982

983
	if (!buf->output_buf) {
984 985 986 987 988
		ret = -ENOMEM;
		goto out;
	}

	ret = buf->fill_func(buf);
L
Linus Torvalds 已提交
989

990 991 992 993 994 995 996
	if (ret >= 0) {
		buf->count = ret;
		ret = 0;
	}

out:
	return ret;
L
Linus Torvalds 已提交
997 998
}

999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015
static ssize_t debug_output(struct file *file, char __user *user_buf,
			    size_t len, loff_t *offset)
{
	struct debug_buffer *buf = file->private_data;
	int ret = 0;

	mutex_lock(&buf->mutex);
	if (buf->count == 0) {
		ret = fill_buffer(buf);
		if (ret != 0) {
			mutex_unlock(&buf->mutex);
			goto out;
		}
	}
	mutex_unlock(&buf->mutex);

	ret = simple_read_from_buffer(user_buf, len, offset,
1016
				      buf->output_buf, buf->count);
1017 1018 1019 1020 1021 1022 1023 1024 1025

out:
	return ret;

}

static int debug_close(struct inode *inode, struct file *file)
{
	struct debug_buffer *buf = file->private_data;
L
Linus Torvalds 已提交
1026

1027
	if (buf) {
1028
		vfree(buf->output_buf);
1029 1030 1031 1032 1033
		kfree(buf);
	}

	return 0;
}
1034

1035 1036 1037 1038 1039 1040 1041
static int debug_async_open(struct inode *inode, struct file *file)
{
	file->private_data = alloc_buffer(inode->i_private, fill_async_buffer);

	return file->private_data ? 0 : -ENOMEM;
}

1042 1043 1044 1045 1046 1047 1048 1049
static int debug_bandwidth_open(struct inode *inode, struct file *file)
{
	file->private_data = alloc_buffer(inode->i_private,
			fill_bandwidth_buffer);

	return file->private_data ? 0 : -ENOMEM;
}

1050 1051
static int debug_periodic_open(struct inode *inode, struct file *file)
{
1052 1053 1054 1055
	struct debug_buffer *buf;
	buf = alloc_buffer(inode->i_private, fill_periodic_buffer);
	if (!buf)
		return -ENOMEM;
1056

1057
	buf->alloc_size = (sizeof(void *) == 4 ? 6 : 8) * PAGE_SIZE;
1058 1059
	file->private_data = buf;
	return 0;
1060 1061 1062 1063 1064 1065 1066 1067 1068 1069
}

static int debug_registers_open(struct inode *inode, struct file *file)
{
	file->private_data = alloc_buffer(inode->i_private,
					  fill_registers_buffer);

	return file->private_data ? 0 : -ENOMEM;
}

1070
static inline void create_debug_files(struct ehci_hcd *ehci)
1071 1072 1073 1074 1075
{
	struct usb_bus *bus = &ehci_to_hcd(ehci)->self;

	ehci->debug_dir = debugfs_create_dir(bus->bus_name, ehci_debug_root);
	if (!ehci->debug_dir)
1076 1077 1078 1079 1080 1081
		return;

	if (!debugfs_create_file("async", S_IRUGO, ehci->debug_dir, bus,
						&debug_async_fops))
		goto file_error;

1082 1083 1084 1085
	if (!debugfs_create_file("bandwidth", S_IRUGO, ehci->debug_dir, bus,
						&debug_bandwidth_fops))
		goto file_error;

1086 1087 1088 1089 1090 1091 1092 1093
	if (!debugfs_create_file("periodic", S_IRUGO, ehci->debug_dir, bus,
						&debug_periodic_fops))
		goto file_error;

	if (!debugfs_create_file("registers", S_IRUGO, ehci->debug_dir, bus,
						    &debug_registers_fops))
		goto file_error;

1094 1095
	return;

1096 1097
file_error:
	debugfs_remove_recursive(ehci->debug_dir);
1098 1099
}

1100
static inline void remove_debug_files(struct ehci_hcd *ehci)
1101
{
1102
	debugfs_remove_recursive(ehci->debug_dir);
1103 1104 1105
}

#endif /* STUB_DEBUG_FILES */