forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[S390] cio: Introduce modalias for css bus.
Add modalias and subchannel type attributes for all subchannels. I/O subchannel specific attributes are now created in io_subchannel_probe(). modalias and subchannel type are also added to the uevent for the css bus. Also make the css modalias known. Signed-off-by: Cornelia Huck <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
- Loading branch information
Showing
7 changed files
with
151 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
What: /sys/bus/css/devices/.../type | ||
Date: March 2008 | ||
Contact: Cornelia Huck <[email protected]> | ||
[email protected] | ||
Description: Contains the subchannel type, as reported by the hardware. | ||
This attribute is present for all subchannel types. | ||
|
||
What: /sys/bus/css/devices/.../modalias | ||
Date: March 2008 | ||
Contact: Cornelia Huck <[email protected]> | ||
[email protected] | ||
Description: Contains the module alias as reported with uevents. | ||
It is of the format css:t<type> and present for all | ||
subchannel types. | ||
|
||
What: /sys/bus/css/drivers/io_subchannel/.../chpids | ||
Date: December 2002 | ||
Contact: Cornelia Huck <[email protected]> | ||
[email protected] | ||
Description: Contains the ids of the channel paths used by this | ||
subchannel, as reported by the channel subsystem | ||
during subchannel recognition. | ||
Note: This is an I/O-subchannel specific attribute. | ||
Users: s390-tools, HAL | ||
|
||
What: /sys/bus/css/drivers/io_subchannel/.../pimpampom | ||
Date: December 2002 | ||
Contact: Cornelia Huck <[email protected]> | ||
[email protected] | ||
Description: Contains the PIM/PAM/POM values, as reported by the | ||
channel subsystem when last queried by the common I/O | ||
layer (this implies that this attribute is not neccessarily | ||
in sync with the values current in the channel subsystem). | ||
Note: This is an I/O-subchannel specific attribute. | ||
Users: s390-tools, HAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,7 @@ | |
* drivers/s390/cio/css.c | ||
* driver for channel subsystem | ||
* | ||
* Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, | ||
* IBM Corporation | ||
* Copyright IBM Corp. 2002,2008 | ||
* Author(s): Arnd Bergmann ([email protected]) | ||
* Cornelia Huck ([email protected]) | ||
*/ | ||
|
@@ -210,6 +209,41 @@ void css_update_ssd_info(struct subchannel *sch) | |
} | ||
} | ||
|
||
static ssize_t type_show(struct device *dev, struct device_attribute *attr, | ||
char *buf) | ||
{ | ||
struct subchannel *sch = to_subchannel(dev); | ||
|
||
return sprintf(buf, "%01x\n", sch->st); | ||
} | ||
|
||
static DEVICE_ATTR(type, 0444, type_show, NULL); | ||
|
||
static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, | ||
char *buf) | ||
{ | ||
struct subchannel *sch = to_subchannel(dev); | ||
|
||
return sprintf(buf, "css:t%01X\n", sch->st); | ||
} | ||
|
||
static DEVICE_ATTR(modalias, 0444, modalias_show, NULL); | ||
|
||
static struct attribute *subch_attrs[] = { | ||
&dev_attr_type.attr, | ||
&dev_attr_modalias.attr, | ||
NULL, | ||
}; | ||
|
||
static struct attribute_group subch_attr_group = { | ||
.attrs = subch_attrs, | ||
}; | ||
|
||
static struct attribute_group *default_subch_attr_groups[] = { | ||
&subch_attr_group, | ||
NULL, | ||
}; | ||
|
||
static int css_register_subchannel(struct subchannel *sch) | ||
{ | ||
int ret; | ||
|
@@ -218,16 +252,17 @@ static int css_register_subchannel(struct subchannel *sch) | |
sch->dev.parent = &channel_subsystems[0]->device; | ||
sch->dev.bus = &css_bus_type; | ||
sch->dev.release = &css_subchannel_release; | ||
sch->dev.groups = subch_attr_groups; | ||
sch->dev.groups = default_subch_attr_groups; | ||
/* | ||
* We don't want to generate uevents for I/O subchannels that don't | ||
* have a working ccw device behind them since they will be | ||
* unregistered before they can be used anyway, so we delay the add | ||
* uevent until after device recognition was successful. | ||
* Note that we suppress the uevent for all subchannel types; | ||
* the subchannel driver can decide itself when it wants to inform | ||
* userspace of its existence. | ||
*/ | ||
if (!cio_is_console(sch->schid)) | ||
/* Console is special, no need to suppress. */ | ||
sch->dev.uevent_suppress = 1; | ||
sch->dev.uevent_suppress = 1; | ||
css_update_ssd_info(sch); | ||
/* make it known to the system */ | ||
ret = css_sch_device_register(sch); | ||
|
@@ -236,6 +271,15 @@ static int css_register_subchannel(struct subchannel *sch) | |
sch->schid.ssid, sch->schid.sch_no, ret); | ||
return ret; | ||
} | ||
if (!sch->driver) { | ||
/* | ||
* No driver matched. Generate the uevent now so that | ||
* a fitting driver module may be loaded based on the | ||
* modalias. | ||
*/ | ||
sch->dev.uevent_suppress = 0; | ||
kobject_uevent(&sch->dev.kobj, KOBJ_ADD); | ||
} | ||
return ret; | ||
} | ||
|
||
|
@@ -926,12 +970,25 @@ static void css_shutdown(struct device *dev) | |
sch->driver->shutdown(sch); | ||
} | ||
|
||
static int css_uevent(struct device *dev, struct kobj_uevent_env *env) | ||
{ | ||
struct subchannel *sch = to_subchannel(dev); | ||
int ret; | ||
|
||
ret = add_uevent_var(env, "ST=%01X", sch->st); | ||
if (ret) | ||
return ret; | ||
ret = add_uevent_var(env, "MODALIAS=css:t%01X", sch->st); | ||
return ret; | ||
} | ||
|
||
struct bus_type css_bus_type = { | ||
.name = "css", | ||
.match = css_bus_match, | ||
.probe = css_probe, | ||
.remove = css_remove, | ||
.shutdown = css_shutdown, | ||
.uevent = css_uevent, | ||
}; | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters