blob: 8019288bc6dee0a730f79b6a4ed86228a3a052f3 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * drivers/s390/cio/css.c
3 * driver for channel subsystem
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 *
Cornelia Huck7e9db9e2008-07-14 09:58:44 +02005 * Copyright IBM Corp. 2002,2008
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 * Author(s): Arnd Bergmann (arndb@de.ibm.com)
Cornelia Huck4ce3b302006-01-14 13:21:04 -08007 * Cornelia Huck (cornelia.huck@de.ibm.com)
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 */
Michael Ernste6d5a422008-12-25 13:39:36 +01009
10#define KMSG_COMPONENT "cio"
11#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
12
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <linux/module.h>
14#include <linux/init.h>
15#include <linux/device.h>
16#include <linux/slab.h>
17#include <linux/errno.h>
18#include <linux/list.h>
Cornelia Hucka55360d2007-10-12 16:11:20 +020019#include <linux/reboot.h>
Cornelia Huck3a3fc292008-07-14 09:58:58 +020020#include <asm/isc.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
Cornelia Huckc1156182008-07-14 09:58:46 +020022#include "../s390mach.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070023#include "css.h"
24#include "cio.h"
25#include "cio_debug.h"
26#include "ioasm.h"
27#include "chsc.h"
Peter Oberparleiter40154b82006-06-29 14:57:03 +020028#include "device.h"
Peter Oberparleiter83b33702007-04-27 16:01:34 +020029#include "idset.h"
Peter Oberparleiter7ad6a242007-04-27 16:01:35 +020030#include "chp.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070031
Linus Torvalds1da177e2005-04-16 15:20:36 -070032int css_init_done = 0;
Peter Oberparleiter40154b82006-06-29 14:57:03 +020033static int need_reprobe = 0;
Cornelia Huckfb6958a2006-01-06 00:19:25 -080034static int max_ssid = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Cornelia Huck7c9f4e32007-10-12 16:11:13 +020036struct channel_subsystem *channel_subsystems[__MAX_CSSID + 1];
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
Heiko Carstens4d284ca2007-02-05 21:18:53 +010038int
Cornelia Huckf97a56f2006-01-06 00:19:22 -080039for_each_subchannel(int(*fn)(struct subchannel_id, void *), void *data)
40{
41 struct subchannel_id schid;
42 int ret;
43
44 init_subchannel_id(&schid);
45 ret = -ENODEV;
46 do {
Cornelia Huckfb6958a2006-01-06 00:19:25 -080047 do {
48 ret = fn(schid, data);
49 if (ret)
50 break;
51 } while (schid.sch_no++ < __MAX_SUBCHANNEL);
52 schid.sch_no = 0;
53 } while (schid.ssid++ < max_ssid);
Cornelia Huckf97a56f2006-01-06 00:19:22 -080054 return ret;
55}
56
Peter Oberparleitere82a1562008-01-26 14:10:48 +010057struct cb_data {
58 void *data;
59 struct idset *set;
60 int (*fn_known_sch)(struct subchannel *, void *);
61 int (*fn_unknown_sch)(struct subchannel_id, void *);
62};
63
64static int call_fn_known_sch(struct device *dev, void *data)
65{
66 struct subchannel *sch = to_subchannel(dev);
67 struct cb_data *cb = data;
68 int rc = 0;
69
70 idset_sch_del(cb->set, sch->schid);
71 if (cb->fn_known_sch)
72 rc = cb->fn_known_sch(sch, cb->data);
73 return rc;
74}
75
76static int call_fn_unknown_sch(struct subchannel_id schid, void *data)
77{
78 struct cb_data *cb = data;
79 int rc = 0;
80
81 if (idset_sch_contains(cb->set, schid))
82 rc = cb->fn_unknown_sch(schid, cb->data);
83 return rc;
84}
85
86int for_each_subchannel_staged(int (*fn_known)(struct subchannel *, void *),
87 int (*fn_unknown)(struct subchannel_id,
88 void *), void *data)
89{
90 struct cb_data cb;
91 int rc;
92
93 cb.set = idset_sch_new();
94 if (!cb.set)
95 return -ENOMEM;
96 idset_fill(cb.set);
97 cb.data = data;
98 cb.fn_known_sch = fn_known;
99 cb.fn_unknown_sch = fn_unknown;
100 /* Process registered subchannels. */
101 rc = bus_for_each_dev(&css_bus_type, NULL, &cb, call_fn_known_sch);
102 if (rc)
103 goto out;
104 /* Process unregistered subchannels. */
105 if (fn_unknown)
106 rc = for_each_subchannel(call_fn_unknown_sch, &cb);
107out:
108 idset_free(cb.set);
109
110 return rc;
111}
112
Linus Torvalds1da177e2005-04-16 15:20:36 -0700113static struct subchannel *
Cornelia Hucka8237fc2006-01-06 00:19:21 -0800114css_alloc_subchannel(struct subchannel_id schid)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115{
116 struct subchannel *sch;
117 int ret;
118
119 sch = kmalloc (sizeof (*sch), GFP_KERNEL | GFP_DMA);
120 if (sch == NULL)
121 return ERR_PTR(-ENOMEM);
Cornelia Hucka8237fc2006-01-06 00:19:21 -0800122 ret = cio_validate_subchannel (sch, schid);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123 if (ret < 0) {
124 kfree(sch);
125 return ERR_PTR(ret);
126 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127 return sch;
128}
129
130static void
131css_free_subchannel(struct subchannel *sch)
132{
133 if (sch) {
134 /* Reset intparm to zeroes. */
Sebastian Ott13952ec2008-12-25 13:39:13 +0100135 sch->config.intparm = 0;
136 cio_commit_config(sch);
Cornelia Huck2ec22982006-12-08 15:54:26 +0100137 kfree(sch->lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138 kfree(sch);
139 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140}
141
142static void
143css_subchannel_release(struct device *dev)
144{
145 struct subchannel *sch;
146
147 sch = to_subchannel(dev);
Cornelia Huck2ec22982006-12-08 15:54:26 +0100148 if (!cio_is_console(sch->schid)) {
149 kfree(sch->lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700150 kfree(sch);
Cornelia Huck2ec22982006-12-08 15:54:26 +0100151 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152}
153
Cornelia Huck07c6a332007-07-27 12:29:10 +0200154static int css_sch_device_register(struct subchannel *sch)
Cornelia Huck6ab48792006-07-12 16:39:50 +0200155{
156 int ret;
157
158 mutex_lock(&sch->reg_mutex);
159 ret = device_register(&sch->dev);
160 mutex_unlock(&sch->reg_mutex);
161 return ret;
162}
163
Cornelia Huck44a1c192008-07-14 09:58:47 +0200164/**
165 * css_sch_device_unregister - unregister a subchannel
166 * @sch: subchannel to be unregistered
167 */
Cornelia Huck6ab48792006-07-12 16:39:50 +0200168void css_sch_device_unregister(struct subchannel *sch)
169{
170 mutex_lock(&sch->reg_mutex);
Sebastian Ottef60cd12008-07-14 09:59:20 +0200171 if (device_is_registered(&sch->dev))
172 device_unregister(&sch->dev);
Cornelia Huck6ab48792006-07-12 16:39:50 +0200173 mutex_unlock(&sch->reg_mutex);
174}
Cornelia Huck44a1c192008-07-14 09:58:47 +0200175EXPORT_SYMBOL_GPL(css_sch_device_unregister);
Cornelia Huck6ab48792006-07-12 16:39:50 +0200176
Peter Oberparleiter7ad6a242007-04-27 16:01:35 +0200177static void ssd_from_pmcw(struct chsc_ssd_info *ssd, struct pmcw *pmcw)
178{
179 int i;
180 int mask;
181
182 memset(ssd, 0, sizeof(struct chsc_ssd_info));
183 ssd->path_mask = pmcw->pim;
184 for (i = 0; i < 8; i++) {
185 mask = 0x80 >> i;
186 if (pmcw->pim & mask) {
187 chp_id_init(&ssd->chpid[i]);
188 ssd->chpid[i].id = pmcw->chpid[i];
189 }
190 }
191}
192
193static void ssd_register_chpids(struct chsc_ssd_info *ssd)
194{
195 int i;
196 int mask;
197
198 for (i = 0; i < 8; i++) {
199 mask = 0x80 >> i;
200 if (ssd->path_mask & mask)
201 if (!chp_is_registered(ssd->chpid[i]))
202 chp_new(ssd->chpid[i]);
203 }
204}
205
206void css_update_ssd_info(struct subchannel *sch)
207{
208 int ret;
209
210 if (cio_is_console(sch->schid)) {
211 /* Console is initialized too early for functions requiring
212 * memory allocation. */
213 ssd_from_pmcw(&sch->ssd_info, &sch->schib.pmcw);
214 } else {
215 ret = chsc_get_ssd_info(sch->schid, &sch->ssd_info);
216 if (ret)
217 ssd_from_pmcw(&sch->ssd_info, &sch->schib.pmcw);
218 ssd_register_chpids(&sch->ssd_info);
219 }
220}
221
Cornelia Huck7e9db9e2008-07-14 09:58:44 +0200222static ssize_t type_show(struct device *dev, struct device_attribute *attr,
223 char *buf)
224{
225 struct subchannel *sch = to_subchannel(dev);
226
227 return sprintf(buf, "%01x\n", sch->st);
228}
229
230static DEVICE_ATTR(type, 0444, type_show, NULL);
231
232static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
233 char *buf)
234{
235 struct subchannel *sch = to_subchannel(dev);
236
237 return sprintf(buf, "css:t%01X\n", sch->st);
238}
239
240static DEVICE_ATTR(modalias, 0444, modalias_show, NULL);
241
242static struct attribute *subch_attrs[] = {
243 &dev_attr_type.attr,
244 &dev_attr_modalias.attr,
245 NULL,
246};
247
248static struct attribute_group subch_attr_group = {
249 .attrs = subch_attrs,
250};
251
252static struct attribute_group *default_subch_attr_groups[] = {
253 &subch_attr_group,
254 NULL,
255};
256
Peter Oberparleiter7ad6a242007-04-27 16:01:35 +0200257static int css_register_subchannel(struct subchannel *sch)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700258{
259 int ret;
260
261 /* Initialize the subchannel structure */
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200262 sch->dev.parent = &channel_subsystems[0]->device;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700263 sch->dev.bus = &css_bus_type;
264 sch->dev.release = &css_subchannel_release;
Cornelia Huck7e9db9e2008-07-14 09:58:44 +0200265 sch->dev.groups = default_subch_attr_groups;
Cornelia Huck5bf04b22007-10-22 12:52:41 +0200266 /*
267 * We don't want to generate uevents for I/O subchannels that don't
268 * have a working ccw device behind them since they will be
269 * unregistered before they can be used anyway, so we delay the add
270 * uevent until after device recognition was successful.
Cornelia Huck7e9db9e2008-07-14 09:58:44 +0200271 * Note that we suppress the uevent for all subchannel types;
272 * the subchannel driver can decide itself when it wants to inform
273 * userspace of its existence.
Cornelia Huck5bf04b22007-10-22 12:52:41 +0200274 */
Cornelia Huck7e9db9e2008-07-14 09:58:44 +0200275 sch->dev.uevent_suppress = 1;
Peter Oberparleiter7ad6a242007-04-27 16:01:35 +0200276 css_update_ssd_info(sch);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700277 /* make it known to the system */
Cornelia Huck6ab48792006-07-12 16:39:50 +0200278 ret = css_sch_device_register(sch);
Cornelia Huck7674da72006-12-08 15:54:21 +0100279 if (ret) {
Cornelia Hucke556bbb2007-07-27 12:29:19 +0200280 CIO_MSG_EVENT(0, "Could not register sch 0.%x.%04x: %d\n",
281 sch->schid.ssid, sch->schid.sch_no, ret);
Cornelia Huck7674da72006-12-08 15:54:21 +0100282 return ret;
283 }
Cornelia Huck7e9db9e2008-07-14 09:58:44 +0200284 if (!sch->driver) {
285 /*
286 * No driver matched. Generate the uevent now so that
287 * a fitting driver module may be loaded based on the
288 * modalias.
289 */
290 sch->dev.uevent_suppress = 0;
291 kobject_uevent(&sch->dev.kobj, KOBJ_ADD);
292 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700293 return ret;
294}
295
Cornelia Huckc820de32008-07-14 09:58:45 +0200296int css_probe_device(struct subchannel_id schid)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700297{
298 int ret;
299 struct subchannel *sch;
300
Cornelia Hucka8237fc2006-01-06 00:19:21 -0800301 sch = css_alloc_subchannel(schid);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302 if (IS_ERR(sch))
303 return PTR_ERR(sch);
304 ret = css_register_subchannel(sch);
305 if (ret)
306 css_free_subchannel(sch);
307 return ret;
308}
309
Cornelia Huckb0744bd2005-06-25 14:55:27 -0700310static int
311check_subchannel(struct device * dev, void * data)
312{
313 struct subchannel *sch;
Cornelia Hucka8237fc2006-01-06 00:19:21 -0800314 struct subchannel_id *schid = data;
Cornelia Huckb0744bd2005-06-25 14:55:27 -0700315
316 sch = to_subchannel(dev);
Cornelia Hucka8237fc2006-01-06 00:19:21 -0800317 return schid_equal(&sch->schid, schid);
Cornelia Huckb0744bd2005-06-25 14:55:27 -0700318}
319
Linus Torvalds1da177e2005-04-16 15:20:36 -0700320struct subchannel *
Cornelia Hucka8237fc2006-01-06 00:19:21 -0800321get_subchannel_by_schid(struct subchannel_id schid)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700322{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700323 struct device *dev;
324
Cornelia Huckb0744bd2005-06-25 14:55:27 -0700325 dev = bus_find_device(&css_bus_type, NULL,
Cornelia Huck12975ae2006-10-11 15:31:47 +0200326 &schid, check_subchannel);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700327
Cornelia Huckb0744bd2005-06-25 14:55:27 -0700328 return dev ? to_subchannel(dev) : NULL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700329}
330
Cornelia Huckb279a4f2008-01-26 14:10:45 +0100331/**
332 * css_sch_is_valid() - check if a subchannel is valid
333 * @schib: subchannel information block for the subchannel
334 */
335int css_sch_is_valid(struct schib *schib)
336{
337 if ((schib->pmcw.st == SUBCHANNEL_TYPE_IO) && !schib->pmcw.dnv)
338 return 0;
Cornelia Huckb3a686f2008-07-14 09:58:48 +0200339 if ((schib->pmcw.st == SUBCHANNEL_TYPE_MSG) && !schib->pmcw.w)
340 return 0;
Cornelia Huckb279a4f2008-01-26 14:10:45 +0100341 return 1;
342}
343EXPORT_SYMBOL_GPL(css_sch_is_valid);
344
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200345static int css_evaluate_new_subchannel(struct subchannel_id schid, int slow)
346{
347 struct schib schib;
348
349 if (!slow) {
350 /* Will be done on the slow path. */
351 return -EAGAIN;
352 }
Cornelia Huckb279a4f2008-01-26 14:10:45 +0100353 if (stsch_err(schid, &schib) || !css_sch_is_valid(&schib)) {
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200354 /* Unusable - ignore. */
355 return 0;
356 }
357 CIO_MSG_EVENT(4, "Evaluating schid 0.%x.%04x, event %d, unknown, "
358 "slow path.\n", schid.ssid, schid.sch_no, CIO_OPER);
359
360 return css_probe_device(schid);
361}
362
Cornelia Huckc820de32008-07-14 09:58:45 +0200363static int css_evaluate_known_subchannel(struct subchannel *sch, int slow)
364{
365 int ret = 0;
366
367 if (sch->driver) {
368 if (sch->driver->sch_event)
369 ret = sch->driver->sch_event(sch, slow);
370 else
371 dev_dbg(&sch->dev,
372 "Got subchannel machine check but "
373 "no sch_event handler provided.\n");
374 }
375 return ret;
376}
377
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200378static void css_evaluate_subchannel(struct subchannel_id schid, int slow)
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200379{
380 struct subchannel *sch;
381 int ret;
382
383 sch = get_subchannel_by_schid(schid);
384 if (sch) {
385 ret = css_evaluate_known_subchannel(sch, slow);
386 put_device(&sch->dev);
387 } else
388 ret = css_evaluate_new_subchannel(schid, slow);
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200389 if (ret == -EAGAIN)
390 css_schedule_eval(schid);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700391}
392
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200393static struct idset *slow_subchannel_set;
394static spinlock_t slow_subchannel_lock;
395
396static int __init slow_subchannel_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700397{
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200398 spin_lock_init(&slow_subchannel_lock);
399 slow_subchannel_set = idset_sch_new();
400 if (!slow_subchannel_set) {
Cornelia Hucke556bbb2007-07-27 12:29:19 +0200401 CIO_MSG_EVENT(0, "could not allocate slow subchannel set\n");
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200402 return -ENOMEM;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700403 }
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200404 return 0;
405}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700406
Peter Oberparleitere82a1562008-01-26 14:10:48 +0100407static int slow_eval_known_fn(struct subchannel *sch, void *data)
408{
409 int eval;
410 int rc;
411
412 spin_lock_irq(&slow_subchannel_lock);
413 eval = idset_sch_contains(slow_subchannel_set, sch->schid);
414 idset_sch_del(slow_subchannel_set, sch->schid);
415 spin_unlock_irq(&slow_subchannel_lock);
416 if (eval) {
417 rc = css_evaluate_known_subchannel(sch, 1);
418 if (rc == -EAGAIN)
419 css_schedule_eval(sch->schid);
420 }
421 return 0;
422}
423
424static int slow_eval_unknown_fn(struct subchannel_id schid, void *data)
425{
426 int eval;
427 int rc = 0;
428
429 spin_lock_irq(&slow_subchannel_lock);
430 eval = idset_sch_contains(slow_subchannel_set, schid);
431 idset_sch_del(slow_subchannel_set, schid);
432 spin_unlock_irq(&slow_subchannel_lock);
433 if (eval) {
434 rc = css_evaluate_new_subchannel(schid, 1);
435 switch (rc) {
436 case -EAGAIN:
437 css_schedule_eval(schid);
438 rc = 0;
439 break;
440 case -ENXIO:
441 case -ENOMEM:
442 case -EIO:
443 /* These should abort looping */
444 break;
445 default:
446 rc = 0;
447 }
448 }
449 return rc;
450}
451
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200452static void css_slow_path_func(struct work_struct *unused)
453{
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200454 CIO_TRACE_EVENT(4, "slowpath");
Peter Oberparleitere82a1562008-01-26 14:10:48 +0100455 for_each_subchannel_staged(slow_eval_known_fn, slow_eval_unknown_fn,
456 NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700457}
458
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200459static DECLARE_WORK(slow_path_work, css_slow_path_func);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700460struct workqueue_struct *slow_path_wq;
461
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200462void css_schedule_eval(struct subchannel_id schid)
463{
464 unsigned long flags;
465
466 spin_lock_irqsave(&slow_subchannel_lock, flags);
467 idset_sch_add(slow_subchannel_set, schid);
468 queue_work(slow_path_wq, &slow_path_work);
469 spin_unlock_irqrestore(&slow_subchannel_lock, flags);
470}
471
472void css_schedule_eval_all(void)
473{
474 unsigned long flags;
475
476 spin_lock_irqsave(&slow_subchannel_lock, flags);
477 idset_fill(slow_subchannel_set);
478 queue_work(slow_path_wq, &slow_path_work);
479 spin_unlock_irqrestore(&slow_subchannel_lock, flags);
480}
481
Cornelia Huck22806dc2008-04-17 07:45:59 +0200482void css_wait_for_slow_path(void)
483{
Cornelia Huck22806dc2008-04-17 07:45:59 +0200484 flush_workqueue(slow_path_wq);
485}
486
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200487/* Reprobe subchannel if unregistered. */
488static int reprobe_subchannel(struct subchannel_id schid, void *data)
489{
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200490 int ret;
491
Cornelia Hucke556bbb2007-07-27 12:29:19 +0200492 CIO_MSG_EVENT(6, "cio: reprobe 0.%x.%04x\n",
493 schid.ssid, schid.sch_no);
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200494 if (need_reprobe)
495 return -EAGAIN;
496
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200497 ret = css_probe_device(schid);
498 switch (ret) {
499 case 0:
500 break;
501 case -ENXIO:
502 case -ENOMEM:
Peter Oberparleiter671756162007-12-04 16:09:02 +0100503 case -EIO:
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200504 /* These should abort looping */
505 break;
506 default:
507 ret = 0;
508 }
509
510 return ret;
511}
512
513/* Work function used to reprobe all unregistered subchannels. */
Al Viro4927b3f2006-12-06 19:18:20 +0000514static void reprobe_all(struct work_struct *unused)
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200515{
516 int ret;
517
Michael Ernst139b83d2008-05-07 09:22:54 +0200518 CIO_MSG_EVENT(4, "reprobe start\n");
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200519
520 need_reprobe = 0;
521 /* Make sure initial subchannel scan is done. */
522 wait_event(ccw_device_init_wq,
523 atomic_read(&ccw_device_init_count) == 0);
Peter Oberparleitere82a1562008-01-26 14:10:48 +0100524 ret = for_each_subchannel_staged(NULL, reprobe_subchannel, NULL);
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200525
Michael Ernst139b83d2008-05-07 09:22:54 +0200526 CIO_MSG_EVENT(4, "reprobe done (rc=%d, need_reprobe=%d)\n", ret,
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200527 need_reprobe);
528}
529
Heiko Carstens2b67fc42007-02-05 21:16:47 +0100530static DECLARE_WORK(css_reprobe_work, reprobe_all);
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200531
532/* Schedule reprobing of all unregistered subchannels. */
533void css_schedule_reprobe(void)
534{
535 need_reprobe = 1;
Cornelia Huckc5d4a992007-11-20 11:13:41 +0100536 queue_work(slow_path_wq, &css_reprobe_work);
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200537}
538
539EXPORT_SYMBOL_GPL(css_schedule_reprobe);
540
Linus Torvalds1da177e2005-04-16 15:20:36 -0700541/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700542 * Called from the machine check handler for subchannel report words.
543 */
Cornelia Huckc1156182008-07-14 09:58:46 +0200544static void css_process_crw(struct crw *crw0, struct crw *crw1, int overflow)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700545{
Cornelia Hucka8237fc2006-01-06 00:19:21 -0800546 struct subchannel_id mchk_schid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700547
Cornelia Huckc1156182008-07-14 09:58:46 +0200548 if (overflow) {
549 css_schedule_eval_all();
550 return;
551 }
552 CIO_CRW_EVENT(2, "CRW0 reports slct=%d, oflw=%d, "
553 "chn=%d, rsc=%X, anc=%d, erc=%X, rsid=%X\n",
554 crw0->slct, crw0->oflw, crw0->chn, crw0->rsc, crw0->anc,
555 crw0->erc, crw0->rsid);
556 if (crw1)
557 CIO_CRW_EVENT(2, "CRW1 reports slct=%d, oflw=%d, "
558 "chn=%d, rsc=%X, anc=%d, erc=%X, rsid=%X\n",
559 crw1->slct, crw1->oflw, crw1->chn, crw1->rsc,
560 crw1->anc, crw1->erc, crw1->rsid);
Cornelia Hucka8237fc2006-01-06 00:19:21 -0800561 init_subchannel_id(&mchk_schid);
Cornelia Huckc1156182008-07-14 09:58:46 +0200562 mchk_schid.sch_no = crw0->rsid;
563 if (crw1)
564 mchk_schid.ssid = (crw1->rsid >> 8) & 3;
Cornelia Huckfb6958a2006-01-06 00:19:25 -0800565
Cornelia Huckc1156182008-07-14 09:58:46 +0200566 /*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700567 * Since we are always presented with IPI in the CRW, we have to
568 * use stsch() to find out if the subchannel in question has come
569 * or gone.
570 */
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200571 css_evaluate_subchannel(mchk_schid, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700572}
573
Cornelia Huckf97a56f2006-01-06 00:19:22 -0800574static int __init
575__init_channel_subsystem(struct subchannel_id schid, void *data)
576{
577 struct subchannel *sch;
578 int ret;
579
580 if (cio_is_console(schid))
581 sch = cio_get_console_subchannel();
582 else {
583 sch = css_alloc_subchannel(schid);
584 if (IS_ERR(sch))
585 ret = PTR_ERR(sch);
586 else
587 ret = 0;
588 switch (ret) {
589 case 0:
590 break;
591 case -ENOMEM:
592 panic("Out of memory in init_channel_subsystem\n");
593 /* -ENXIO: no more subchannels. */
594 case -ENXIO:
595 return ret;
Greg Smithe843e282006-03-14 19:50:17 -0800596 /* -EIO: this subchannel set not supported. */
597 case -EIO:
598 return ret;
Cornelia Huckf97a56f2006-01-06 00:19:22 -0800599 default:
600 return 0;
601 }
602 }
603 /*
604 * We register ALL valid subchannels in ioinfo, even those
605 * that have been present before init_channel_subsystem.
606 * These subchannels can't have been registered yet (kmalloc
607 * not working) so we do it now. This is true e.g. for the
608 * console subchannel.
609 */
610 css_register_subchannel(sch);
611 return 0;
612}
613
Linus Torvalds1da177e2005-04-16 15:20:36 -0700614static void __init
Cornelia Hucka28c6942006-01-06 00:19:23 -0800615css_generate_pgid(struct channel_subsystem *css, u32 tod_high)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700616{
Cornelia Huck75784c02008-07-14 09:58:57 +0200617 if (css_general_characteristics.mcss) {
Cornelia Hucka28c6942006-01-06 00:19:23 -0800618 css->global_pgid.pgid_high.ext_cssid.version = 0x80;
619 css->global_pgid.pgid_high.ext_cssid.cssid = css->cssid;
620 } else {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700621#ifdef CONFIG_SMP
Cornelia Hucka28c6942006-01-06 00:19:23 -0800622 css->global_pgid.pgid_high.cpu_addr = hard_smp_processor_id();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700623#else
Cornelia Hucka28c6942006-01-06 00:19:23 -0800624 css->global_pgid.pgid_high.cpu_addr = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700625#endif
626 }
Cornelia Hucka28c6942006-01-06 00:19:23 -0800627 css->global_pgid.cpu_id = ((cpuid_t *) __LC_CPUID)->ident;
628 css->global_pgid.cpu_model = ((cpuid_t *) __LC_CPUID)->machine;
629 css->global_pgid.tod_high = tod_high;
630
631}
632
Cornelia Huck3b793062006-01-06 00:19:26 -0800633static void
634channel_subsystem_release(struct device *dev)
635{
636 struct channel_subsystem *css;
637
638 css = to_css(dev);
Cornelia Huck495a5b42006-03-24 03:15:14 -0800639 mutex_destroy(&css->mutex);
Cornelia Hucka2164b82008-09-09 12:38:57 +0200640 if (css->pseudo_subchannel) {
641 /* Implies that it has been generated but never registered. */
642 css_subchannel_release(&css->pseudo_subchannel->dev);
643 css->pseudo_subchannel = NULL;
644 }
Cornelia Huck3b793062006-01-06 00:19:26 -0800645 kfree(css);
646}
647
Cornelia Huck495a5b42006-03-24 03:15:14 -0800648static ssize_t
649css_cm_enable_show(struct device *dev, struct device_attribute *attr,
650 char *buf)
651{
652 struct channel_subsystem *css = to_css(dev);
Michael Ernst8284fb192008-04-17 07:46:01 +0200653 int ret;
Cornelia Huck495a5b42006-03-24 03:15:14 -0800654
655 if (!css)
656 return 0;
Michael Ernst8284fb192008-04-17 07:46:01 +0200657 mutex_lock(&css->mutex);
658 ret = sprintf(buf, "%x\n", css->cm_enabled);
659 mutex_unlock(&css->mutex);
660 return ret;
Cornelia Huck495a5b42006-03-24 03:15:14 -0800661}
662
663static ssize_t
664css_cm_enable_store(struct device *dev, struct device_attribute *attr,
665 const char *buf, size_t count)
666{
667 struct channel_subsystem *css = to_css(dev);
668 int ret;
Cornelia Huck2f972202008-04-30 13:38:33 +0200669 unsigned long val;
Cornelia Huck495a5b42006-03-24 03:15:14 -0800670
Cornelia Huck2f972202008-04-30 13:38:33 +0200671 ret = strict_strtoul(buf, 16, &val);
672 if (ret)
673 return ret;
Michael Ernst8284fb192008-04-17 07:46:01 +0200674 mutex_lock(&css->mutex);
Cornelia Huck2f972202008-04-30 13:38:33 +0200675 switch (val) {
676 case 0:
Cornelia Huck495a5b42006-03-24 03:15:14 -0800677 ret = css->cm_enabled ? chsc_secm(css, 0) : 0;
678 break;
Cornelia Huck2f972202008-04-30 13:38:33 +0200679 case 1:
Cornelia Huck495a5b42006-03-24 03:15:14 -0800680 ret = css->cm_enabled ? 0 : chsc_secm(css, 1);
681 break;
682 default:
683 ret = -EINVAL;
684 }
Michael Ernst8284fb192008-04-17 07:46:01 +0200685 mutex_unlock(&css->mutex);
Cornelia Huck495a5b42006-03-24 03:15:14 -0800686 return ret < 0 ? ret : count;
687}
688
689static DEVICE_ATTR(cm_enable, 0644, css_cm_enable_show, css_cm_enable_store);
690
Heiko Carstens4d284ca2007-02-05 21:18:53 +0100691static int __init setup_css(int nr)
Cornelia Hucka28c6942006-01-06 00:19:23 -0800692{
693 u32 tod_high;
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100694 int ret;
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200695 struct channel_subsystem *css;
Cornelia Hucka28c6942006-01-06 00:19:23 -0800696
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200697 css = channel_subsystems[nr];
698 memset(css, 0, sizeof(struct channel_subsystem));
699 css->pseudo_subchannel =
700 kzalloc(sizeof(*css->pseudo_subchannel), GFP_KERNEL);
701 if (!css->pseudo_subchannel)
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100702 return -ENOMEM;
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200703 css->pseudo_subchannel->dev.parent = &css->device;
704 css->pseudo_subchannel->dev.release = css_subchannel_release;
Cornelia Huck1bf5b282008-10-10 21:33:10 +0200705 dev_set_name(&css->pseudo_subchannel->dev, "defunct");
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200706 ret = cio_create_sch_lock(css->pseudo_subchannel);
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100707 if (ret) {
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200708 kfree(css->pseudo_subchannel);
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100709 return ret;
710 }
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200711 mutex_init(&css->mutex);
712 css->valid = 1;
713 css->cssid = nr;
Cornelia Huck1bf5b282008-10-10 21:33:10 +0200714 dev_set_name(&css->device, "css%x", nr);
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200715 css->device.release = channel_subsystem_release;
Cornelia Hucka28c6942006-01-06 00:19:23 -0800716 tod_high = (u32) (get_clock() >> 32);
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200717 css_generate_pgid(css, tod_high);
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100718 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700719}
720
Cornelia Hucka55360d2007-10-12 16:11:20 +0200721static int css_reboot_event(struct notifier_block *this,
722 unsigned long event,
723 void *ptr)
724{
725 int ret, i;
726
727 ret = NOTIFY_DONE;
728 for (i = 0; i <= __MAX_CSSID; i++) {
729 struct channel_subsystem *css;
730
731 css = channel_subsystems[i];
Michael Ernst8284fb192008-04-17 07:46:01 +0200732 mutex_lock(&css->mutex);
Cornelia Hucka55360d2007-10-12 16:11:20 +0200733 if (css->cm_enabled)
734 if (chsc_secm(css, 0))
735 ret = NOTIFY_BAD;
Michael Ernst8284fb192008-04-17 07:46:01 +0200736 mutex_unlock(&css->mutex);
Cornelia Hucka55360d2007-10-12 16:11:20 +0200737 }
738
739 return ret;
740}
741
742static struct notifier_block css_reboot_notifier = {
743 .notifier_call = css_reboot_event,
744};
745
Linus Torvalds1da177e2005-04-16 15:20:36 -0700746/*
747 * Now that the driver core is running, we can setup our channel subsystem.
748 * The struct subchannel's are created during probing (except for the
749 * static console subchannel).
750 */
751static int __init
752init_channel_subsystem (void)
753{
Cornelia Hucka28c6942006-01-06 00:19:23 -0800754 int ret, i;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700755
Cornelia Huck4434a382007-07-27 12:29:21 +0200756 ret = chsc_determine_css_characteristics();
757 if (ret == -ENOMEM)
758 goto out; /* No need to continue. */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700759
Cornelia Huck4434a382007-07-27 12:29:21 +0200760 ret = chsc_alloc_sei_area();
761 if (ret)
762 goto out;
763
764 ret = slow_subchannel_init();
765 if (ret)
766 goto out;
767
Cornelia Huckc1156182008-07-14 09:58:46 +0200768 ret = s390_register_crw_handler(CRW_RSC_SCH, css_process_crw);
769 if (ret)
770 goto out;
771
Linus Torvalds1da177e2005-04-16 15:20:36 -0700772 if ((ret = bus_register(&css_bus_type)))
773 goto out;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700774
Cornelia Huckfb6958a2006-01-06 00:19:25 -0800775 /* Try to enable MSS. */
776 ret = chsc_enable_facility(CHSC_SDA_OC_MSS);
777 switch (ret) {
778 case 0: /* Success. */
779 max_ssid = __MAX_SSID;
780 break;
781 case -ENOMEM:
782 goto out_bus;
783 default:
784 max_ssid = 0;
785 }
Cornelia Hucka28c6942006-01-06 00:19:23 -0800786 /* Setup css structure. */
787 for (i = 0; i <= __MAX_CSSID; i++) {
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200788 struct channel_subsystem *css;
789
790 css = kmalloc(sizeof(struct channel_subsystem), GFP_KERNEL);
791 if (!css) {
Cornelia Hucka28c6942006-01-06 00:19:23 -0800792 ret = -ENOMEM;
Cornelia Huckfb6958a2006-01-06 00:19:25 -0800793 goto out_unregister;
Cornelia Hucka28c6942006-01-06 00:19:23 -0800794 }
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200795 channel_subsystems[i] = css;
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100796 ret = setup_css(i);
Cornelia Hucka2164b82008-09-09 12:38:57 +0200797 if (ret) {
798 kfree(channel_subsystems[i]);
799 goto out_unregister;
800 }
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200801 ret = device_register(&css->device);
Cornelia Hucka2164b82008-09-09 12:38:57 +0200802 if (ret) {
803 put_device(&css->device);
804 goto out_unregister;
805 }
Cornelia Huck75784c02008-07-14 09:58:57 +0200806 if (css_chsc_characteristics.secm) {
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200807 ret = device_create_file(&css->device,
Cornelia Huck7e560812006-07-12 16:40:19 +0200808 &dev_attr_cm_enable);
809 if (ret)
810 goto out_device;
811 }
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200812 ret = device_register(&css->pseudo_subchannel->dev);
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100813 if (ret)
814 goto out_file;
Cornelia Hucka28c6942006-01-06 00:19:23 -0800815 }
Cornelia Hucka55360d2007-10-12 16:11:20 +0200816 ret = register_reboot_notifier(&css_reboot_notifier);
817 if (ret)
Cornelia Hucka2164b82008-09-09 12:38:57 +0200818 goto out_unregister;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700819 css_init_done = 1;
820
Cornelia Huck3a3fc292008-07-14 09:58:58 +0200821 /* Enable default isc for I/O subchannels. */
Cornelia Huck6ef556cc2008-07-14 09:59:01 +0200822 isc_register(IO_SCH_ISC);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700823
Cornelia Huckf97a56f2006-01-06 00:19:22 -0800824 for_each_subchannel(__init_channel_subsystem, NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700825 return 0;
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100826out_file:
Cornelia Hucka2164b82008-09-09 12:38:57 +0200827 if (css_chsc_characteristics.secm)
828 device_remove_file(&channel_subsystems[i]->device,
829 &dev_attr_cm_enable);
Cornelia Huck7e560812006-07-12 16:40:19 +0200830out_device:
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200831 device_unregister(&channel_subsystems[i]->device);
Cornelia Huckfb6958a2006-01-06 00:19:25 -0800832out_unregister:
Cornelia Hucka28c6942006-01-06 00:19:23 -0800833 while (i > 0) {
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200834 struct channel_subsystem *css;
835
Cornelia Hucka28c6942006-01-06 00:19:23 -0800836 i--;
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200837 css = channel_subsystems[i];
838 device_unregister(&css->pseudo_subchannel->dev);
Cornelia Hucka2164b82008-09-09 12:38:57 +0200839 css->pseudo_subchannel = NULL;
Cornelia Huck75784c02008-07-14 09:58:57 +0200840 if (css_chsc_characteristics.secm)
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200841 device_remove_file(&css->device,
Cornelia Huck495a5b42006-03-24 03:15:14 -0800842 &dev_attr_cm_enable);
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200843 device_unregister(&css->device);
Cornelia Hucka28c6942006-01-06 00:19:23 -0800844 }
Cornelia Huckfb6958a2006-01-06 00:19:25 -0800845out_bus:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700846 bus_unregister(&css_bus_type);
847out:
Cornelia Huckc1156182008-07-14 09:58:46 +0200848 s390_unregister_crw_handler(CRW_RSC_CSS);
Cornelia Huck4434a382007-07-27 12:29:21 +0200849 chsc_free_sei_area();
850 kfree(slow_subchannel_set);
Michael Ernste6d5a422008-12-25 13:39:36 +0100851 pr_alert("The CSS device driver initialization failed with "
852 "errno=%d\n", ret);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700853 return ret;
854}
855
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100856int sch_is_pseudo_sch(struct subchannel *sch)
857{
858 return sch == to_css(sch->dev.parent)->pseudo_subchannel;
859}
860
Cornelia Huckf08adc02008-07-14 09:59:03 +0200861static int css_bus_match(struct device *dev, struct device_driver *drv)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700862{
Cornelia Huck084325d2008-01-26 14:10:38 +0100863 struct subchannel *sch = to_subchannel(dev);
864 struct css_driver *driver = to_cssdriver(drv);
Cornelia Huckf08adc02008-07-14 09:59:03 +0200865 struct css_device_id *id;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700866
Cornelia Huckf08adc02008-07-14 09:59:03 +0200867 for (id = driver->subchannel_type; id->match_flags; id++) {
868 if (sch->st == id->type)
869 return 1;
870 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700871
872 return 0;
873}
874
Cornelia Huck98c13c22008-01-26 14:10:40 +0100875static int css_probe(struct device *dev)
Cornelia Huck8bbace72006-01-11 10:56:22 +0100876{
877 struct subchannel *sch;
Cornelia Huck98c13c22008-01-26 14:10:40 +0100878 int ret;
Cornelia Huck8bbace72006-01-11 10:56:22 +0100879
880 sch = to_subchannel(dev);
Cornelia Huck084325d2008-01-26 14:10:38 +0100881 sch->driver = to_cssdriver(dev->driver);
Cornelia Huck98c13c22008-01-26 14:10:40 +0100882 ret = sch->driver->probe ? sch->driver->probe(sch) : 0;
883 if (ret)
884 sch->driver = NULL;
885 return ret;
Cornelia Huck8bbace72006-01-11 10:56:22 +0100886}
887
Cornelia Huck98c13c22008-01-26 14:10:40 +0100888static int css_remove(struct device *dev)
889{
890 struct subchannel *sch;
891 int ret;
892
893 sch = to_subchannel(dev);
894 ret = sch->driver->remove ? sch->driver->remove(sch) : 0;
895 sch->driver = NULL;
896 return ret;
897}
898
899static void css_shutdown(struct device *dev)
Cornelia Huck8bbace72006-01-11 10:56:22 +0100900{
901 struct subchannel *sch;
902
903 sch = to_subchannel(dev);
Cornelia Huck98c13c22008-01-26 14:10:40 +0100904 if (sch->driver && sch->driver->shutdown)
Cornelia Huck8bbace72006-01-11 10:56:22 +0100905 sch->driver->shutdown(sch);
906}
907
Cornelia Huck7e9db9e2008-07-14 09:58:44 +0200908static int css_uevent(struct device *dev, struct kobj_uevent_env *env)
909{
910 struct subchannel *sch = to_subchannel(dev);
911 int ret;
912
913 ret = add_uevent_var(env, "ST=%01X", sch->st);
914 if (ret)
915 return ret;
916 ret = add_uevent_var(env, "MODALIAS=css:t%01X", sch->st);
917 return ret;
918}
919
Linus Torvalds1da177e2005-04-16 15:20:36 -0700920struct bus_type css_bus_type = {
Cornelia Huck8bbace72006-01-11 10:56:22 +0100921 .name = "css",
922 .match = css_bus_match,
923 .probe = css_probe,
924 .remove = css_remove,
925 .shutdown = css_shutdown,
Cornelia Huck7e9db9e2008-07-14 09:58:44 +0200926 .uevent = css_uevent,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700927};
928
Cornelia Huck25b7bb52008-01-26 14:10:41 +0100929/**
930 * css_driver_register - register a css driver
931 * @cdrv: css driver to register
932 *
933 * This is mainly a wrapper around driver_register that sets name
934 * and bus_type in the embedded struct device_driver correctly.
935 */
936int css_driver_register(struct css_driver *cdrv)
937{
938 cdrv->drv.name = cdrv->name;
939 cdrv->drv.bus = &css_bus_type;
Cornelia Huck4beee642008-01-26 14:10:47 +0100940 cdrv->drv.owner = cdrv->owner;
Cornelia Huck25b7bb52008-01-26 14:10:41 +0100941 return driver_register(&cdrv->drv);
942}
943EXPORT_SYMBOL_GPL(css_driver_register);
944
945/**
946 * css_driver_unregister - unregister a css driver
947 * @cdrv: css driver to unregister
948 *
949 * This is a wrapper around driver_unregister.
950 */
951void css_driver_unregister(struct css_driver *cdrv)
952{
953 driver_unregister(&cdrv->drv);
954}
955EXPORT_SYMBOL_GPL(css_driver_unregister);
956
Linus Torvalds1da177e2005-04-16 15:20:36 -0700957subsys_initcall(init_channel_subsystem);
958
Linus Torvalds1da177e2005-04-16 15:20:36 -0700959MODULE_LICENSE("GPL");
960EXPORT_SYMBOL(css_bus_type);