blob: 3b45bbe6cce0c80a10b9450d06b590d70b4f06cc [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 *
5 * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH,
6 * IBM Corporation
7 * Author(s): Arnd Bergmann (arndb@de.ibm.com)
Cornelia Huck4ce3b302006-01-14 13:21:04 -08008 * Cornelia Huck (cornelia.huck@de.ibm.com)
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 */
10#include <linux/module.h>
11#include <linux/init.h>
12#include <linux/device.h>
13#include <linux/slab.h>
14#include <linux/errno.h>
15#include <linux/list.h>
Cornelia Hucka55360d2007-10-12 16:11:20 +020016#include <linux/reboot.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070017
18#include "css.h"
19#include "cio.h"
20#include "cio_debug.h"
21#include "ioasm.h"
22#include "chsc.h"
Peter Oberparleiter40154b82006-06-29 14:57:03 +020023#include "device.h"
Peter Oberparleiter83b33702007-04-27 16:01:34 +020024#include "idset.h"
Peter Oberparleiter7ad6a242007-04-27 16:01:35 +020025#include "chp.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
Linus Torvalds1da177e2005-04-16 15:20:36 -070027int css_init_done = 0;
Peter Oberparleiter40154b82006-06-29 14:57:03 +020028static int need_reprobe = 0;
Cornelia Huckfb6958a2006-01-06 00:19:25 -080029static int max_ssid = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
Cornelia Huck7c9f4e32007-10-12 16:11:13 +020031struct channel_subsystem *channel_subsystems[__MAX_CSSID + 1];
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
Cornelia Hucka28c6942006-01-06 00:19:23 -080033int css_characteristics_avail = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
Heiko Carstens4d284ca2007-02-05 21:18:53 +010035int
Cornelia Huckf97a56f2006-01-06 00:19:22 -080036for_each_subchannel(int(*fn)(struct subchannel_id, void *), void *data)
37{
38 struct subchannel_id schid;
39 int ret;
40
41 init_subchannel_id(&schid);
42 ret = -ENODEV;
43 do {
Cornelia Huckfb6958a2006-01-06 00:19:25 -080044 do {
45 ret = fn(schid, data);
46 if (ret)
47 break;
48 } while (schid.sch_no++ < __MAX_SUBCHANNEL);
49 schid.sch_no = 0;
50 } while (schid.ssid++ < max_ssid);
Cornelia Huckf97a56f2006-01-06 00:19:22 -080051 return ret;
52}
53
Peter Oberparleitere82a1562008-01-26 14:10:48 +010054struct cb_data {
55 void *data;
56 struct idset *set;
57 int (*fn_known_sch)(struct subchannel *, void *);
58 int (*fn_unknown_sch)(struct subchannel_id, void *);
59};
60
61static int call_fn_known_sch(struct device *dev, void *data)
62{
63 struct subchannel *sch = to_subchannel(dev);
64 struct cb_data *cb = data;
65 int rc = 0;
66
67 idset_sch_del(cb->set, sch->schid);
68 if (cb->fn_known_sch)
69 rc = cb->fn_known_sch(sch, cb->data);
70 return rc;
71}
72
73static int call_fn_unknown_sch(struct subchannel_id schid, void *data)
74{
75 struct cb_data *cb = data;
76 int rc = 0;
77
78 if (idset_sch_contains(cb->set, schid))
79 rc = cb->fn_unknown_sch(schid, cb->data);
80 return rc;
81}
82
83int for_each_subchannel_staged(int (*fn_known)(struct subchannel *, void *),
84 int (*fn_unknown)(struct subchannel_id,
85 void *), void *data)
86{
87 struct cb_data cb;
88 int rc;
89
90 cb.set = idset_sch_new();
91 if (!cb.set)
92 return -ENOMEM;
93 idset_fill(cb.set);
94 cb.data = data;
95 cb.fn_known_sch = fn_known;
96 cb.fn_unknown_sch = fn_unknown;
97 /* Process registered subchannels. */
98 rc = bus_for_each_dev(&css_bus_type, NULL, &cb, call_fn_known_sch);
99 if (rc)
100 goto out;
101 /* Process unregistered subchannels. */
102 if (fn_unknown)
103 rc = for_each_subchannel(call_fn_unknown_sch, &cb);
104out:
105 idset_free(cb.set);
106
107 return rc;
108}
109
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110static struct subchannel *
Cornelia Hucka8237fc2006-01-06 00:19:21 -0800111css_alloc_subchannel(struct subchannel_id schid)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112{
113 struct subchannel *sch;
114 int ret;
115
116 sch = kmalloc (sizeof (*sch), GFP_KERNEL | GFP_DMA);
117 if (sch == NULL)
118 return ERR_PTR(-ENOMEM);
Cornelia Hucka8237fc2006-01-06 00:19:21 -0800119 ret = cio_validate_subchannel (sch, schid);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120 if (ret < 0) {
121 kfree(sch);
122 return ERR_PTR(ret);
123 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124
125 if (sch->st != SUBCHANNEL_TYPE_IO) {
126 /* For now we ignore all non-io subchannels. */
127 kfree(sch);
128 return ERR_PTR(-EINVAL);
129 }
130
131 /*
132 * Set intparm to subchannel address.
133 * This is fine even on 64bit since the subchannel is always located
134 * under 2G.
135 */
Cornelia Huckcd6b4f22008-01-26 14:10:43 +0100136 sch->schib.pmcw.intparm = (u32)(addr_t)sch;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700137 ret = cio_modify(sch);
138 if (ret) {
Cornelia Huck5693ce62007-08-10 14:32:26 +0200139 kfree(sch->lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140 kfree(sch);
141 return ERR_PTR(ret);
142 }
143 return sch;
144}
145
146static void
147css_free_subchannel(struct subchannel *sch)
148{
149 if (sch) {
150 /* Reset intparm to zeroes. */
151 sch->schib.pmcw.intparm = 0;
152 cio_modify(sch);
Cornelia Huck2ec22982006-12-08 15:54:26 +0100153 kfree(sch->lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700154 kfree(sch);
155 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700156}
157
158static void
159css_subchannel_release(struct device *dev)
160{
161 struct subchannel *sch;
162
163 sch = to_subchannel(dev);
Cornelia Huck2ec22982006-12-08 15:54:26 +0100164 if (!cio_is_console(sch->schid)) {
165 kfree(sch->lock);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166 kfree(sch);
Cornelia Huck2ec22982006-12-08 15:54:26 +0100167 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700168}
169
Cornelia Huck07c6a332007-07-27 12:29:10 +0200170static int css_sch_device_register(struct subchannel *sch)
Cornelia Huck6ab48792006-07-12 16:39:50 +0200171{
172 int ret;
173
174 mutex_lock(&sch->reg_mutex);
175 ret = device_register(&sch->dev);
176 mutex_unlock(&sch->reg_mutex);
177 return ret;
178}
179
180void css_sch_device_unregister(struct subchannel *sch)
181{
182 mutex_lock(&sch->reg_mutex);
183 device_unregister(&sch->dev);
184 mutex_unlock(&sch->reg_mutex);
185}
186
Peter Oberparleiter7ad6a242007-04-27 16:01:35 +0200187static void ssd_from_pmcw(struct chsc_ssd_info *ssd, struct pmcw *pmcw)
188{
189 int i;
190 int mask;
191
192 memset(ssd, 0, sizeof(struct chsc_ssd_info));
193 ssd->path_mask = pmcw->pim;
194 for (i = 0; i < 8; i++) {
195 mask = 0x80 >> i;
196 if (pmcw->pim & mask) {
197 chp_id_init(&ssd->chpid[i]);
198 ssd->chpid[i].id = pmcw->chpid[i];
199 }
200 }
201}
202
203static void ssd_register_chpids(struct chsc_ssd_info *ssd)
204{
205 int i;
206 int mask;
207
208 for (i = 0; i < 8; i++) {
209 mask = 0x80 >> i;
210 if (ssd->path_mask & mask)
211 if (!chp_is_registered(ssd->chpid[i]))
212 chp_new(ssd->chpid[i]);
213 }
214}
215
216void css_update_ssd_info(struct subchannel *sch)
217{
218 int ret;
219
220 if (cio_is_console(sch->schid)) {
221 /* Console is initialized too early for functions requiring
222 * memory allocation. */
223 ssd_from_pmcw(&sch->ssd_info, &sch->schib.pmcw);
224 } else {
225 ret = chsc_get_ssd_info(sch->schid, &sch->ssd_info);
226 if (ret)
227 ssd_from_pmcw(&sch->ssd_info, &sch->schib.pmcw);
228 ssd_register_chpids(&sch->ssd_info);
229 }
230}
231
232static int css_register_subchannel(struct subchannel *sch)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233{
234 int ret;
235
236 /* Initialize the subchannel structure */
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200237 sch->dev.parent = &channel_subsystems[0]->device;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238 sch->dev.bus = &css_bus_type;
239 sch->dev.release = &css_subchannel_release;
Cornelia Huck529192f2006-12-08 15:55:57 +0100240 sch->dev.groups = subch_attr_groups;
Cornelia Huck5bf04b22007-10-22 12:52:41 +0200241 /*
242 * We don't want to generate uevents for I/O subchannels that don't
243 * have a working ccw device behind them since they will be
244 * unregistered before they can be used anyway, so we delay the add
245 * uevent until after device recognition was successful.
246 */
247 if (!cio_is_console(sch->schid))
248 /* Console is special, no need to suppress. */
249 sch->dev.uevent_suppress = 1;
Peter Oberparleiter7ad6a242007-04-27 16:01:35 +0200250 css_update_ssd_info(sch);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251 /* make it known to the system */
Cornelia Huck6ab48792006-07-12 16:39:50 +0200252 ret = css_sch_device_register(sch);
Cornelia Huck7674da72006-12-08 15:54:21 +0100253 if (ret) {
Cornelia Hucke556bbb2007-07-27 12:29:19 +0200254 CIO_MSG_EVENT(0, "Could not register sch 0.%x.%04x: %d\n",
255 sch->schid.ssid, sch->schid.sch_no, ret);
Cornelia Huck7674da72006-12-08 15:54:21 +0100256 return ret;
257 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700258 return ret;
259}
260
Cornelia Huckf7e5d672007-05-10 15:45:43 +0200261static int css_probe_device(struct subchannel_id schid)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262{
263 int ret;
264 struct subchannel *sch;
265
Cornelia Hucka8237fc2006-01-06 00:19:21 -0800266 sch = css_alloc_subchannel(schid);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700267 if (IS_ERR(sch))
268 return PTR_ERR(sch);
269 ret = css_register_subchannel(sch);
270 if (ret)
271 css_free_subchannel(sch);
272 return ret;
273}
274
Cornelia Huckb0744bd2005-06-25 14:55:27 -0700275static int
276check_subchannel(struct device * dev, void * data)
277{
278 struct subchannel *sch;
Cornelia Hucka8237fc2006-01-06 00:19:21 -0800279 struct subchannel_id *schid = data;
Cornelia Huckb0744bd2005-06-25 14:55:27 -0700280
281 sch = to_subchannel(dev);
Cornelia Hucka8237fc2006-01-06 00:19:21 -0800282 return schid_equal(&sch->schid, schid);
Cornelia Huckb0744bd2005-06-25 14:55:27 -0700283}
284
Linus Torvalds1da177e2005-04-16 15:20:36 -0700285struct subchannel *
Cornelia Hucka8237fc2006-01-06 00:19:21 -0800286get_subchannel_by_schid(struct subchannel_id schid)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700287{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700288 struct device *dev;
289
Cornelia Huckb0744bd2005-06-25 14:55:27 -0700290 dev = bus_find_device(&css_bus_type, NULL,
Cornelia Huck12975ae2006-10-11 15:31:47 +0200291 &schid, check_subchannel);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700292
Cornelia Huckb0744bd2005-06-25 14:55:27 -0700293 return dev ? to_subchannel(dev) : NULL;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700294}
295
Cornelia Huckb279a4f2008-01-26 14:10:45 +0100296/**
297 * css_sch_is_valid() - check if a subchannel is valid
298 * @schib: subchannel information block for the subchannel
299 */
300int css_sch_is_valid(struct schib *schib)
301{
302 if ((schib->pmcw.st == SUBCHANNEL_TYPE_IO) && !schib->pmcw.dnv)
303 return 0;
304 return 1;
305}
306EXPORT_SYMBOL_GPL(css_sch_is_valid);
307
Heiko Carstens4d284ca2007-02-05 21:18:53 +0100308static int css_get_subchannel_status(struct subchannel *sch)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700309{
310 struct schib schib;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700311
Cornelia Huckb279a4f2008-01-26 14:10:45 +0100312 if (stsch(sch->schid, &schib))
313 return CIO_GONE;
314 if (!css_sch_is_valid(&schib))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700315 return CIO_GONE;
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200316 if (sch->schib.pmcw.dnv && (schib.pmcw.dev != sch->schib.pmcw.dev))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317 return CIO_REVALIDATE;
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200318 if (!sch->lpm)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319 return CIO_NO_PATH;
320 return CIO_OPER;
321}
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200322
323static int css_evaluate_known_subchannel(struct subchannel *sch, int slow)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700324{
325 int event, ret, disc;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326 unsigned long flags;
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200327 enum { NONE, UNREGISTER, UNREGISTER_PROBE, REPROBE } action;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700328
Cornelia Huck2ec22982006-12-08 15:54:26 +0100329 spin_lock_irqsave(sch->lock, flags);
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200330 disc = device_is_disconnected(sch);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700331 if (disc && slow) {
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200332 /* Disconnected devices are evaluated directly only.*/
Cornelia Huck2ec22982006-12-08 15:54:26 +0100333 spin_unlock_irqrestore(sch->lock, flags);
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200334 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700335 }
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200336 /* No interrupt after machine check - kill pending timers. */
337 device_kill_pending_timer(sch);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700338 if (!disc && !slow) {
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200339 /* Non-disconnected devices are evaluated on the slow path. */
Cornelia Huck2ec22982006-12-08 15:54:26 +0100340 spin_unlock_irqrestore(sch->lock, flags);
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200341 return -EAGAIN;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700342 }
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200343 event = css_get_subchannel_status(sch);
Cornelia Huckfb6958a2006-01-06 00:19:25 -0800344 CIO_MSG_EVENT(4, "Evaluating schid 0.%x.%04x, event %d, %s, %s path.\n",
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200345 sch->schid.ssid, sch->schid.sch_no, event,
346 disc ? "disconnected" : "normal",
347 slow ? "slow" : "fast");
348 /* Analyze subchannel status. */
349 action = NONE;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700350 switch (event) {
351 case CIO_NO_PATH:
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200352 if (disc) {
353 /* Check if paths have become available. */
354 action = REPROBE;
355 break;
356 }
357 /* fall through */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700358 case CIO_GONE:
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200359 /* Prevent unwanted effects when opening lock. */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700360 cio_disable_subchannel(sch);
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200361 device_set_disconnected(sch);
362 /* Ask driver what to do with device. */
363 action = UNREGISTER;
364 if (sch->driver && sch->driver->notify) {
Cornelia Huck2ec22982006-12-08 15:54:26 +0100365 spin_unlock_irqrestore(sch->lock, flags);
Cornelia Huck602b20f2008-01-26 14:10:39 +0100366 ret = sch->driver->notify(sch, event);
Cornelia Huck2ec22982006-12-08 15:54:26 +0100367 spin_lock_irqsave(sch->lock, flags);
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200368 if (ret)
369 action = NONE;
370 }
371 break;
372 case CIO_REVALIDATE:
373 /* Device will be removed, so no notify necessary. */
374 if (disc)
375 /* Reprobe because immediate unregister might block. */
376 action = REPROBE;
377 else
378 action = UNREGISTER_PROBE;
379 break;
380 case CIO_OPER:
381 if (disc)
382 /* Get device operational again. */
383 action = REPROBE;
384 break;
385 }
386 /* Perform action. */
387 ret = 0;
388 switch (action) {
389 case UNREGISTER:
390 case UNREGISTER_PROBE:
391 /* Unregister device (will use subchannel lock). */
Cornelia Huck2ec22982006-12-08 15:54:26 +0100392 spin_unlock_irqrestore(sch->lock, flags);
Cornelia Huck6ab48792006-07-12 16:39:50 +0200393 css_sch_device_unregister(sch);
Cornelia Huck2ec22982006-12-08 15:54:26 +0100394 spin_lock_irqsave(sch->lock, flags);
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200395
Linus Torvalds1da177e2005-04-16 15:20:36 -0700396 /* Reset intparm to zeroes. */
397 sch->schib.pmcw.intparm = 0;
398 cio_modify(sch);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700399 break;
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200400 case REPROBE:
401 device_trigger_reprobe(sch);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700402 break;
403 default:
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200404 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700405 }
Cornelia Huck2ec22982006-12-08 15:54:26 +0100406 spin_unlock_irqrestore(sch->lock, flags);
Cornelia Huckc2b14492006-10-27 12:39:17 +0200407 /* Probe if necessary. */
408 if (action == UNREGISTER_PROBE)
409 ret = css_probe_device(sch->schid);
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200410
411 return ret;
412}
413
414static int css_evaluate_new_subchannel(struct subchannel_id schid, int slow)
415{
416 struct schib schib;
417
418 if (!slow) {
419 /* Will be done on the slow path. */
420 return -EAGAIN;
421 }
Cornelia Huckb279a4f2008-01-26 14:10:45 +0100422 if (stsch_err(schid, &schib) || !css_sch_is_valid(&schib)) {
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200423 /* Unusable - ignore. */
424 return 0;
425 }
426 CIO_MSG_EVENT(4, "Evaluating schid 0.%x.%04x, event %d, unknown, "
427 "slow path.\n", schid.ssid, schid.sch_no, CIO_OPER);
428
429 return css_probe_device(schid);
430}
431
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200432static void css_evaluate_subchannel(struct subchannel_id schid, int slow)
Peter Oberparleiter564337f2006-09-20 16:00:01 +0200433{
434 struct subchannel *sch;
435 int ret;
436
437 sch = get_subchannel_by_schid(schid);
438 if (sch) {
439 ret = css_evaluate_known_subchannel(sch, slow);
440 put_device(&sch->dev);
441 } else
442 ret = css_evaluate_new_subchannel(schid, slow);
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200443 if (ret == -EAGAIN)
444 css_schedule_eval(schid);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700445}
446
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200447static struct idset *slow_subchannel_set;
448static spinlock_t slow_subchannel_lock;
449
450static int __init slow_subchannel_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700451{
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200452 spin_lock_init(&slow_subchannel_lock);
453 slow_subchannel_set = idset_sch_new();
454 if (!slow_subchannel_set) {
Cornelia Hucke556bbb2007-07-27 12:29:19 +0200455 CIO_MSG_EVENT(0, "could not allocate slow subchannel set\n");
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200456 return -ENOMEM;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700457 }
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200458 return 0;
459}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700460
Peter Oberparleitere82a1562008-01-26 14:10:48 +0100461static int slow_eval_known_fn(struct subchannel *sch, void *data)
462{
463 int eval;
464 int rc;
465
466 spin_lock_irq(&slow_subchannel_lock);
467 eval = idset_sch_contains(slow_subchannel_set, sch->schid);
468 idset_sch_del(slow_subchannel_set, sch->schid);
469 spin_unlock_irq(&slow_subchannel_lock);
470 if (eval) {
471 rc = css_evaluate_known_subchannel(sch, 1);
472 if (rc == -EAGAIN)
473 css_schedule_eval(sch->schid);
474 }
475 return 0;
476}
477
478static int slow_eval_unknown_fn(struct subchannel_id schid, void *data)
479{
480 int eval;
481 int rc = 0;
482
483 spin_lock_irq(&slow_subchannel_lock);
484 eval = idset_sch_contains(slow_subchannel_set, schid);
485 idset_sch_del(slow_subchannel_set, schid);
486 spin_unlock_irq(&slow_subchannel_lock);
487 if (eval) {
488 rc = css_evaluate_new_subchannel(schid, 1);
489 switch (rc) {
490 case -EAGAIN:
491 css_schedule_eval(schid);
492 rc = 0;
493 break;
494 case -ENXIO:
495 case -ENOMEM:
496 case -EIO:
497 /* These should abort looping */
498 break;
499 default:
500 rc = 0;
501 }
502 }
503 return rc;
504}
505
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200506static void css_slow_path_func(struct work_struct *unused)
507{
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200508 CIO_TRACE_EVENT(4, "slowpath");
Peter Oberparleitere82a1562008-01-26 14:10:48 +0100509 for_each_subchannel_staged(slow_eval_known_fn, slow_eval_unknown_fn,
510 NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700511}
512
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200513static DECLARE_WORK(slow_path_work, css_slow_path_func);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700514struct workqueue_struct *slow_path_wq;
515
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200516void css_schedule_eval(struct subchannel_id schid)
517{
518 unsigned long flags;
519
520 spin_lock_irqsave(&slow_subchannel_lock, flags);
521 idset_sch_add(slow_subchannel_set, schid);
522 queue_work(slow_path_wq, &slow_path_work);
523 spin_unlock_irqrestore(&slow_subchannel_lock, flags);
524}
525
526void css_schedule_eval_all(void)
527{
528 unsigned long flags;
529
530 spin_lock_irqsave(&slow_subchannel_lock, flags);
531 idset_fill(slow_subchannel_set);
532 queue_work(slow_path_wq, &slow_path_work);
533 spin_unlock_irqrestore(&slow_subchannel_lock, flags);
534}
535
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200536/* Reprobe subchannel if unregistered. */
537static int reprobe_subchannel(struct subchannel_id schid, void *data)
538{
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200539 int ret;
540
Cornelia Hucke556bbb2007-07-27 12:29:19 +0200541 CIO_MSG_EVENT(6, "cio: reprobe 0.%x.%04x\n",
542 schid.ssid, schid.sch_no);
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200543 if (need_reprobe)
544 return -EAGAIN;
545
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200546 ret = css_probe_device(schid);
547 switch (ret) {
548 case 0:
549 break;
550 case -ENXIO:
551 case -ENOMEM:
Peter Oberparleiter671756162007-12-04 16:09:02 +0100552 case -EIO:
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200553 /* These should abort looping */
554 break;
555 default:
556 ret = 0;
557 }
558
559 return ret;
560}
561
562/* Work function used to reprobe all unregistered subchannels. */
Al Viro4927b3f2006-12-06 19:18:20 +0000563static void reprobe_all(struct work_struct *unused)
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200564{
565 int ret;
566
567 CIO_MSG_EVENT(2, "reprobe start\n");
568
569 need_reprobe = 0;
570 /* Make sure initial subchannel scan is done. */
571 wait_event(ccw_device_init_wq,
572 atomic_read(&ccw_device_init_count) == 0);
Peter Oberparleitere82a1562008-01-26 14:10:48 +0100573 ret = for_each_subchannel_staged(NULL, reprobe_subchannel, NULL);
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200574
575 CIO_MSG_EVENT(2, "reprobe done (rc=%d, need_reprobe=%d)\n", ret,
576 need_reprobe);
577}
578
Heiko Carstens2b67fc42007-02-05 21:16:47 +0100579static DECLARE_WORK(css_reprobe_work, reprobe_all);
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200580
581/* Schedule reprobing of all unregistered subchannels. */
582void css_schedule_reprobe(void)
583{
584 need_reprobe = 1;
Cornelia Huckc5d4a992007-11-20 11:13:41 +0100585 queue_work(slow_path_wq, &css_reprobe_work);
Peter Oberparleiter40154b82006-06-29 14:57:03 +0200586}
587
588EXPORT_SYMBOL_GPL(css_schedule_reprobe);
589
Linus Torvalds1da177e2005-04-16 15:20:36 -0700590/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700591 * Called from the machine check handler for subchannel report words.
592 */
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200593void css_process_crw(int rsid1, int rsid2)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700594{
Cornelia Hucka8237fc2006-01-06 00:19:21 -0800595 struct subchannel_id mchk_schid;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700596
Cornelia Huckfb6958a2006-01-06 00:19:25 -0800597 CIO_CRW_EVENT(2, "source is subchannel %04X, subsystem id %x\n",
598 rsid1, rsid2);
Cornelia Hucka8237fc2006-01-06 00:19:21 -0800599 init_subchannel_id(&mchk_schid);
Cornelia Huckfb6958a2006-01-06 00:19:25 -0800600 mchk_schid.sch_no = rsid1;
601 if (rsid2 != 0)
602 mchk_schid.ssid = (rsid2 >> 8) & 3;
603
Linus Torvalds1da177e2005-04-16 15:20:36 -0700604 /*
605 * Since we are always presented with IPI in the CRW, we have to
606 * use stsch() to find out if the subchannel in question has come
607 * or gone.
608 */
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200609 css_evaluate_subchannel(mchk_schid, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700610}
611
Cornelia Huckf97a56f2006-01-06 00:19:22 -0800612static int __init
613__init_channel_subsystem(struct subchannel_id schid, void *data)
614{
615 struct subchannel *sch;
616 int ret;
617
618 if (cio_is_console(schid))
619 sch = cio_get_console_subchannel();
620 else {
621 sch = css_alloc_subchannel(schid);
622 if (IS_ERR(sch))
623 ret = PTR_ERR(sch);
624 else
625 ret = 0;
626 switch (ret) {
627 case 0:
628 break;
629 case -ENOMEM:
630 panic("Out of memory in init_channel_subsystem\n");
631 /* -ENXIO: no more subchannels. */
632 case -ENXIO:
633 return ret;
Greg Smithe843e282006-03-14 19:50:17 -0800634 /* -EIO: this subchannel set not supported. */
635 case -EIO:
636 return ret;
Cornelia Huckf97a56f2006-01-06 00:19:22 -0800637 default:
638 return 0;
639 }
640 }
641 /*
642 * We register ALL valid subchannels in ioinfo, even those
643 * that have been present before init_channel_subsystem.
644 * These subchannels can't have been registered yet (kmalloc
645 * not working) so we do it now. This is true e.g. for the
646 * console subchannel.
647 */
648 css_register_subchannel(sch);
649 return 0;
650}
651
Linus Torvalds1da177e2005-04-16 15:20:36 -0700652static void __init
Cornelia Hucka28c6942006-01-06 00:19:23 -0800653css_generate_pgid(struct channel_subsystem *css, u32 tod_high)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700654{
Cornelia Hucka28c6942006-01-06 00:19:23 -0800655 if (css_characteristics_avail && css_general_characteristics.mcss) {
656 css->global_pgid.pgid_high.ext_cssid.version = 0x80;
657 css->global_pgid.pgid_high.ext_cssid.cssid = css->cssid;
658 } else {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700659#ifdef CONFIG_SMP
Cornelia Hucka28c6942006-01-06 00:19:23 -0800660 css->global_pgid.pgid_high.cpu_addr = hard_smp_processor_id();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700661#else
Cornelia Hucka28c6942006-01-06 00:19:23 -0800662 css->global_pgid.pgid_high.cpu_addr = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700663#endif
664 }
Cornelia Hucka28c6942006-01-06 00:19:23 -0800665 css->global_pgid.cpu_id = ((cpuid_t *) __LC_CPUID)->ident;
666 css->global_pgid.cpu_model = ((cpuid_t *) __LC_CPUID)->machine;
667 css->global_pgid.tod_high = tod_high;
668
669}
670
Cornelia Huck3b793062006-01-06 00:19:26 -0800671static void
672channel_subsystem_release(struct device *dev)
673{
674 struct channel_subsystem *css;
675
676 css = to_css(dev);
Cornelia Huck495a5b42006-03-24 03:15:14 -0800677 mutex_destroy(&css->mutex);
Cornelia Huck3b793062006-01-06 00:19:26 -0800678 kfree(css);
679}
680
Cornelia Huck495a5b42006-03-24 03:15:14 -0800681static ssize_t
682css_cm_enable_show(struct device *dev, struct device_attribute *attr,
683 char *buf)
684{
685 struct channel_subsystem *css = to_css(dev);
686
687 if (!css)
688 return 0;
689 return sprintf(buf, "%x\n", css->cm_enabled);
690}
691
692static ssize_t
693css_cm_enable_store(struct device *dev, struct device_attribute *attr,
694 const char *buf, size_t count)
695{
696 struct channel_subsystem *css = to_css(dev);
697 int ret;
698
699 switch (buf[0]) {
700 case '0':
701 ret = css->cm_enabled ? chsc_secm(css, 0) : 0;
702 break;
703 case '1':
704 ret = css->cm_enabled ? 0 : chsc_secm(css, 1);
705 break;
706 default:
707 ret = -EINVAL;
708 }
709 return ret < 0 ? ret : count;
710}
711
712static DEVICE_ATTR(cm_enable, 0644, css_cm_enable_show, css_cm_enable_store);
713
Heiko Carstens4d284ca2007-02-05 21:18:53 +0100714static int __init setup_css(int nr)
Cornelia Hucka28c6942006-01-06 00:19:23 -0800715{
716 u32 tod_high;
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100717 int ret;
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200718 struct channel_subsystem *css;
Cornelia Hucka28c6942006-01-06 00:19:23 -0800719
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200720 css = channel_subsystems[nr];
721 memset(css, 0, sizeof(struct channel_subsystem));
722 css->pseudo_subchannel =
723 kzalloc(sizeof(*css->pseudo_subchannel), GFP_KERNEL);
724 if (!css->pseudo_subchannel)
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100725 return -ENOMEM;
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200726 css->pseudo_subchannel->dev.parent = &css->device;
727 css->pseudo_subchannel->dev.release = css_subchannel_release;
728 sprintf(css->pseudo_subchannel->dev.bus_id, "defunct");
729 ret = cio_create_sch_lock(css->pseudo_subchannel);
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100730 if (ret) {
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200731 kfree(css->pseudo_subchannel);
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100732 return ret;
733 }
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200734 mutex_init(&css->mutex);
735 css->valid = 1;
736 css->cssid = nr;
737 sprintf(css->device.bus_id, "css%x", nr);
738 css->device.release = channel_subsystem_release;
Cornelia Hucka28c6942006-01-06 00:19:23 -0800739 tod_high = (u32) (get_clock() >> 32);
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200740 css_generate_pgid(css, tod_high);
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100741 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700742}
743
Cornelia Hucka55360d2007-10-12 16:11:20 +0200744static int css_reboot_event(struct notifier_block *this,
745 unsigned long event,
746 void *ptr)
747{
748 int ret, i;
749
750 ret = NOTIFY_DONE;
751 for (i = 0; i <= __MAX_CSSID; i++) {
752 struct channel_subsystem *css;
753
754 css = channel_subsystems[i];
755 if (css->cm_enabled)
756 if (chsc_secm(css, 0))
757 ret = NOTIFY_BAD;
758 }
759
760 return ret;
761}
762
763static struct notifier_block css_reboot_notifier = {
764 .notifier_call = css_reboot_event,
765};
766
Linus Torvalds1da177e2005-04-16 15:20:36 -0700767/*
768 * Now that the driver core is running, we can setup our channel subsystem.
769 * The struct subchannel's are created during probing (except for the
770 * static console subchannel).
771 */
772static int __init
773init_channel_subsystem (void)
774{
Cornelia Hucka28c6942006-01-06 00:19:23 -0800775 int ret, i;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700776
Cornelia Huck4434a382007-07-27 12:29:21 +0200777 ret = chsc_determine_css_characteristics();
778 if (ret == -ENOMEM)
779 goto out; /* No need to continue. */
780 if (ret == 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700781 css_characteristics_avail = 1;
782
Cornelia Huck4434a382007-07-27 12:29:21 +0200783 ret = chsc_alloc_sei_area();
784 if (ret)
785 goto out;
786
787 ret = slow_subchannel_init();
788 if (ret)
789 goto out;
790
Linus Torvalds1da177e2005-04-16 15:20:36 -0700791 if ((ret = bus_register(&css_bus_type)))
792 goto out;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700793
Cornelia Huckfb6958a2006-01-06 00:19:25 -0800794 /* Try to enable MSS. */
795 ret = chsc_enable_facility(CHSC_SDA_OC_MSS);
796 switch (ret) {
797 case 0: /* Success. */
798 max_ssid = __MAX_SSID;
799 break;
800 case -ENOMEM:
801 goto out_bus;
802 default:
803 max_ssid = 0;
804 }
Cornelia Hucka28c6942006-01-06 00:19:23 -0800805 /* Setup css structure. */
806 for (i = 0; i <= __MAX_CSSID; i++) {
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200807 struct channel_subsystem *css;
808
809 css = kmalloc(sizeof(struct channel_subsystem), GFP_KERNEL);
810 if (!css) {
Cornelia Hucka28c6942006-01-06 00:19:23 -0800811 ret = -ENOMEM;
Cornelia Huckfb6958a2006-01-06 00:19:25 -0800812 goto out_unregister;
Cornelia Hucka28c6942006-01-06 00:19:23 -0800813 }
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200814 channel_subsystems[i] = css;
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100815 ret = setup_css(i);
Cornelia Hucka28c6942006-01-06 00:19:23 -0800816 if (ret)
817 goto out_free;
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200818 ret = device_register(&css->device);
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100819 if (ret)
820 goto out_free_all;
Cornelia Huck7e560812006-07-12 16:40:19 +0200821 if (css_characteristics_avail &&
822 css_chsc_characteristics.secm) {
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200823 ret = device_create_file(&css->device,
Cornelia Huck7e560812006-07-12 16:40:19 +0200824 &dev_attr_cm_enable);
825 if (ret)
826 goto out_device;
827 }
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200828 ret = device_register(&css->pseudo_subchannel->dev);
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100829 if (ret)
830 goto out_file;
Cornelia Hucka28c6942006-01-06 00:19:23 -0800831 }
Cornelia Hucka55360d2007-10-12 16:11:20 +0200832 ret = register_reboot_notifier(&css_reboot_notifier);
833 if (ret)
834 goto out_pseudo;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700835 css_init_done = 1;
836
837 ctl_set_bit(6, 28);
838
Cornelia Huckf97a56f2006-01-06 00:19:22 -0800839 for_each_subchannel(__init_channel_subsystem, NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700840 return 0;
Cornelia Hucka55360d2007-10-12 16:11:20 +0200841out_pseudo:
842 device_unregister(&channel_subsystems[i]->pseudo_subchannel->dev);
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100843out_file:
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200844 device_remove_file(&channel_subsystems[i]->device,
845 &dev_attr_cm_enable);
Cornelia Huck7e560812006-07-12 16:40:19 +0200846out_device:
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200847 device_unregister(&channel_subsystems[i]->device);
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100848out_free_all:
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200849 kfree(channel_subsystems[i]->pseudo_subchannel->lock);
850 kfree(channel_subsystems[i]->pseudo_subchannel);
Cornelia Hucka28c6942006-01-06 00:19:23 -0800851out_free:
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200852 kfree(channel_subsystems[i]);
Cornelia Huckfb6958a2006-01-06 00:19:25 -0800853out_unregister:
Cornelia Hucka28c6942006-01-06 00:19:23 -0800854 while (i > 0) {
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200855 struct channel_subsystem *css;
856
Cornelia Hucka28c6942006-01-06 00:19:23 -0800857 i--;
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200858 css = channel_subsystems[i];
859 device_unregister(&css->pseudo_subchannel->dev);
Cornelia Huck495a5b42006-03-24 03:15:14 -0800860 if (css_characteristics_avail && css_chsc_characteristics.secm)
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200861 device_remove_file(&css->device,
Cornelia Huck495a5b42006-03-24 03:15:14 -0800862 &dev_attr_cm_enable);
Cornelia Huck7c9f4e32007-10-12 16:11:13 +0200863 device_unregister(&css->device);
Cornelia Hucka28c6942006-01-06 00:19:23 -0800864 }
Cornelia Huckfb6958a2006-01-06 00:19:25 -0800865out_bus:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700866 bus_unregister(&css_bus_type);
867out:
Cornelia Huck4434a382007-07-27 12:29:21 +0200868 chsc_free_sei_area();
869 kfree(slow_subchannel_set);
870 printk(KERN_WARNING"cio: failed to initialize css driver (%d)!\n",
871 ret);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700872 return ret;
873}
874
Cornelia Huckd7b5a4c92006-12-08 15:54:28 +0100875int sch_is_pseudo_sch(struct subchannel *sch)
876{
877 return sch == to_css(sch->dev.parent)->pseudo_subchannel;
878}
879
Linus Torvalds1da177e2005-04-16 15:20:36 -0700880/*
881 * find a driver for a subchannel. They identify by the subchannel
882 * type with the exception that the console subchannel driver has its own
883 * subchannel type although the device is an i/o subchannel
884 */
885static int
886css_bus_match (struct device *dev, struct device_driver *drv)
887{
Cornelia Huck084325d2008-01-26 14:10:38 +0100888 struct subchannel *sch = to_subchannel(dev);
889 struct css_driver *driver = to_cssdriver(drv);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700890
891 if (sch->st == driver->subchannel_type)
892 return 1;
893
894 return 0;
895}
896
Cornelia Huck98c13c22008-01-26 14:10:40 +0100897static int css_probe(struct device *dev)
Cornelia Huck8bbace72006-01-11 10:56:22 +0100898{
899 struct subchannel *sch;
Cornelia Huck98c13c22008-01-26 14:10:40 +0100900 int ret;
Cornelia Huck8bbace72006-01-11 10:56:22 +0100901
902 sch = to_subchannel(dev);
Cornelia Huck084325d2008-01-26 14:10:38 +0100903 sch->driver = to_cssdriver(dev->driver);
Cornelia Huck98c13c22008-01-26 14:10:40 +0100904 ret = sch->driver->probe ? sch->driver->probe(sch) : 0;
905 if (ret)
906 sch->driver = NULL;
907 return ret;
Cornelia Huck8bbace72006-01-11 10:56:22 +0100908}
909
Cornelia Huck98c13c22008-01-26 14:10:40 +0100910static int css_remove(struct device *dev)
911{
912 struct subchannel *sch;
913 int ret;
914
915 sch = to_subchannel(dev);
916 ret = sch->driver->remove ? sch->driver->remove(sch) : 0;
917 sch->driver = NULL;
918 return ret;
919}
920
921static void css_shutdown(struct device *dev)
Cornelia Huck8bbace72006-01-11 10:56:22 +0100922{
923 struct subchannel *sch;
924
925 sch = to_subchannel(dev);
Cornelia Huck98c13c22008-01-26 14:10:40 +0100926 if (sch->driver && sch->driver->shutdown)
Cornelia Huck8bbace72006-01-11 10:56:22 +0100927 sch->driver->shutdown(sch);
928}
929
Linus Torvalds1da177e2005-04-16 15:20:36 -0700930struct bus_type css_bus_type = {
Cornelia Huck8bbace72006-01-11 10:56:22 +0100931 .name = "css",
932 .match = css_bus_match,
933 .probe = css_probe,
934 .remove = css_remove,
935 .shutdown = css_shutdown,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700936};
937
Cornelia Huck25b7bb52008-01-26 14:10:41 +0100938/**
939 * css_driver_register - register a css driver
940 * @cdrv: css driver to register
941 *
942 * This is mainly a wrapper around driver_register that sets name
943 * and bus_type in the embedded struct device_driver correctly.
944 */
945int css_driver_register(struct css_driver *cdrv)
946{
947 cdrv->drv.name = cdrv->name;
948 cdrv->drv.bus = &css_bus_type;
Cornelia Huck4beee642008-01-26 14:10:47 +0100949 cdrv->drv.owner = cdrv->owner;
Cornelia Huck25b7bb52008-01-26 14:10:41 +0100950 return driver_register(&cdrv->drv);
951}
952EXPORT_SYMBOL_GPL(css_driver_register);
953
954/**
955 * css_driver_unregister - unregister a css driver
956 * @cdrv: css driver to unregister
957 *
958 * This is a wrapper around driver_unregister.
959 */
960void css_driver_unregister(struct css_driver *cdrv)
961{
962 driver_unregister(&cdrv->drv);
963}
964EXPORT_SYMBOL_GPL(css_driver_unregister);
965
Linus Torvalds1da177e2005-04-16 15:20:36 -0700966subsys_initcall(init_channel_subsystem);
967
Linus Torvalds1da177e2005-04-16 15:20:36 -0700968MODULE_LICENSE("GPL");
969EXPORT_SYMBOL(css_bus_type);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700970EXPORT_SYMBOL_GPL(css_characteristics_avail);