forked from luck/tmp_suning_uos_patched
s390/cio: use cssid for pgid generation
Obtain the real channel subsystem id and use that for the generation of a unique path group id. Note that this change does not affect the channel subsystem id as used in the user-visible naming of subchannels and friends. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Reviewed-by: Dong Jia Shi <bjsdjshik@linux.vnet.ibm.com> Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
parent
98cc43ab6b
commit
e2e0de9b57
|
@ -1131,6 +1131,52 @@ int chsc_enable_facility(int operation_code)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int __init chsc_get_cssid(int idx)
|
||||
{
|
||||
struct {
|
||||
struct chsc_header request;
|
||||
u8 atype;
|
||||
u32 : 24;
|
||||
u32 reserved1[6];
|
||||
struct chsc_header response;
|
||||
u32 reserved2[3];
|
||||
struct {
|
||||
u8 cssid;
|
||||
u32 : 24;
|
||||
} list[0];
|
||||
} __packed *sdcal_area;
|
||||
int ret;
|
||||
|
||||
spin_lock_irq(&chsc_page_lock);
|
||||
memset(chsc_page, 0, PAGE_SIZE);
|
||||
sdcal_area = chsc_page;
|
||||
sdcal_area->request.length = 0x0020;
|
||||
sdcal_area->request.code = 0x0034;
|
||||
sdcal_area->atype = 4;
|
||||
|
||||
ret = chsc(sdcal_area);
|
||||
if (ret) {
|
||||
ret = (ret == 3) ? -ENODEV : -EBUSY;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ret = chsc_error_from_response(sdcal_area->response.code);
|
||||
if (ret) {
|
||||
CIO_CRW_EVENT(2, "chsc: sdcal failed (rc=%04x)\n",
|
||||
sdcal_area->response.code);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if ((addr_t) &sdcal_area->list[idx] <
|
||||
(addr_t) &sdcal_area->response + sdcal_area->response.length)
|
||||
ret = sdcal_area->list[idx].cssid;
|
||||
else
|
||||
ret = -ENODEV;
|
||||
exit:
|
||||
spin_unlock_irq(&chsc_page_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct css_general_char css_general_characteristics;
|
||||
struct css_chsc_char css_chsc_characteristics;
|
||||
|
||||
|
|
|
@ -242,6 +242,8 @@ int chsc_pnso_brinfo(struct subchannel_id schid,
|
|||
struct chsc_brinfo_resume_token resume_token,
|
||||
int cnc);
|
||||
|
||||
int __init chsc_get_cssid(int idx);
|
||||
|
||||
#ifdef CONFIG_SCM_BUS
|
||||
int scm_update_information(void);
|
||||
int scm_process_availability_information(void);
|
||||
|
|
|
@ -703,7 +703,8 @@ css_generate_pgid(struct channel_subsystem *css, u32 tod_high)
|
|||
|
||||
if (css_general_characteristics.mcss) {
|
||||
css->global_pgid.pgid_high.ext_cssid.version = 0x80;
|
||||
css->global_pgid.pgid_high.ext_cssid.cssid = css->cssid;
|
||||
css->global_pgid.pgid_high.ext_cssid.cssid =
|
||||
(css->cssid < 0) ? 0 : css->cssid;
|
||||
} else {
|
||||
css->global_pgid.pgid_high.cpu_addr = stap();
|
||||
}
|
||||
|
@ -794,7 +795,8 @@ static int __init setup_css(int nr)
|
|||
}
|
||||
mutex_init(&css->mutex);
|
||||
css->valid = 1;
|
||||
css->cssid = nr;
|
||||
css->cssid = chsc_get_cssid(nr);
|
||||
|
||||
dev_set_name(&css->device, "css%x", nr);
|
||||
css->device.release = channel_subsystem_release;
|
||||
tod_high = (u32) (get_tod_clock() >> 32);
|
||||
|
|
|
@ -113,7 +113,7 @@ extern int for_each_subchannel(int(*fn)(struct subchannel_id, void *), void *);
|
|||
void css_update_ssd_info(struct subchannel *sch);
|
||||
|
||||
struct channel_subsystem {
|
||||
u8 cssid;
|
||||
int cssid;
|
||||
int valid;
|
||||
struct channel_path *chps[__MAX_CHPID + 1];
|
||||
struct device device;
|
||||
|
|
Loading…
Reference in New Issue
Block a user