aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorPeter Oberparleiter <peter.oberparleiter@de.ibm.com>2006-08-16 07:49:33 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2006-08-16 07:49:33 -0400
commitb18a60e7c2a7f2a17dbd57885621a42d546e2f7d (patch)
treeca41788f01ae5d6c268a1b7992682ea9de0ea563 /drivers/s390
parent2f6c55fc3109bcfa1bb1a112c825e07212c20f37 (diff)
[S390] inaccessible PAV alias devices on LPAR.
In some situations PAV alias devices on LPAR are not accessible. The initialization procedure required to enable access to PAV alias devices has to be performed per storage server subsystem and not only once per storage server. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/block/dasd_devmap.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index 29e48b2ab712..9d0c6e1a0e66 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -48,18 +48,20 @@ struct dasd_devmap {
48}; 48};
49 49
50/* 50/*
51 * dasd_servermap is used to store the server_id of all storage servers 51 * dasd_server_ssid_map contains a globally unique storage server subsystem ID.
52 * accessed by DASD device driver. 52 * dasd_server_ssid_list contains the list of all subsystem IDs accessed by
53 * the DASD device driver.
53 */ 54 */
54struct dasd_servermap { 55struct dasd_server_ssid_map {
55 struct list_head list; 56 struct list_head list;
56 struct server_id { 57 struct server_id {
57 char vendor[4]; 58 char vendor[4];
58 char serial[15]; 59 char serial[15];
59 } sid; 60 } sid;
61 __u16 ssid;
60}; 62};
61 63
62static struct list_head dasd_serverlist; 64static struct list_head dasd_server_ssid_list;
63 65
64/* 66/*
65 * Parameter parsing functions for dasd= parameter. The syntax is: 67 * Parameter parsing functions for dasd= parameter. The syntax is:
@@ -878,8 +880,9 @@ dasd_get_uid(struct ccw_device *cdev, struct dasd_uid *uid)
878 880
879/* 881/*
880 * Register the given device unique identifier into devmap struct. 882 * Register the given device unique identifier into devmap struct.
881 * In addition check if the related storage server is already contained in the 883 * In addition check if the related storage server subsystem ID is already
882 * dasd_serverlist. If server is not contained, create new entry. 884 * contained in the dasd_server_ssid_list. If subsystem ID is not contained,
885 * create new entry.
883 * Return 0 if server was already in serverlist, 886 * Return 0 if server was already in serverlist,
884 * 1 if the server was added successful 887 * 1 if the server was added successful
885 * <0 in case of error. 888 * <0 in case of error.
@@ -888,26 +891,27 @@ int
888dasd_set_uid(struct ccw_device *cdev, struct dasd_uid *uid) 891dasd_set_uid(struct ccw_device *cdev, struct dasd_uid *uid)
889{ 892{
890 struct dasd_devmap *devmap; 893 struct dasd_devmap *devmap;
891 struct dasd_servermap *srv, *tmp; 894 struct dasd_server_ssid_map *srv, *tmp;
892 895
893 devmap = dasd_find_busid(cdev->dev.bus_id); 896 devmap = dasd_find_busid(cdev->dev.bus_id);
894 if (IS_ERR(devmap)) 897 if (IS_ERR(devmap))
895 return PTR_ERR(devmap); 898 return PTR_ERR(devmap);
896 899
897 /* generate entry for servermap */ 900 /* generate entry for server_ssid_map */
898 srv = (struct dasd_servermap *) 901 srv = (struct dasd_server_ssid_map *)
899 kzalloc(sizeof(struct dasd_servermap), GFP_KERNEL); 902 kzalloc(sizeof(struct dasd_server_ssid_map), GFP_KERNEL);
900 if (!srv) 903 if (!srv)
901 return -ENOMEM; 904 return -ENOMEM;
902 strncpy(srv->sid.vendor, uid->vendor, sizeof(srv->sid.vendor) - 1); 905 strncpy(srv->sid.vendor, uid->vendor, sizeof(srv->sid.vendor) - 1);
903 strncpy(srv->sid.serial, uid->serial, sizeof(srv->sid.serial) - 1); 906 strncpy(srv->sid.serial, uid->serial, sizeof(srv->sid.serial) - 1);
907 srv->ssid = uid->ssid;
904 908
905 /* server is already contained ? */ 909 /* server is already contained ? */
906 spin_lock(&dasd_devmap_lock); 910 spin_lock(&dasd_devmap_lock);
907 devmap->uid = *uid; 911 devmap->uid = *uid;
908 list_for_each_entry(tmp, &dasd_serverlist, list) { 912 list_for_each_entry(tmp, &dasd_server_ssid_list, list) {
909 if (!memcmp(&srv->sid, &tmp->sid, 913 if (!memcmp(&srv->sid, &tmp->sid,
910 sizeof(struct dasd_servermap))) { 914 sizeof(struct dasd_server_ssid_map))) {
911 kfree(srv); 915 kfree(srv);
912 srv = NULL; 916 srv = NULL;
913 break; 917 break;
@@ -916,7 +920,7 @@ dasd_set_uid(struct ccw_device *cdev, struct dasd_uid *uid)
916 920
917 /* add servermap to serverlist */ 921 /* add servermap to serverlist */
918 if (srv) 922 if (srv)
919 list_add(&srv->list, &dasd_serverlist); 923 list_add(&srv->list, &dasd_server_ssid_list);
920 spin_unlock(&dasd_devmap_lock); 924 spin_unlock(&dasd_devmap_lock);
921 925
922 return (srv ? 1 : 0); 926 return (srv ? 1 : 0);
@@ -987,7 +991,7 @@ dasd_devmap_init(void)
987 INIT_LIST_HEAD(&dasd_hashlists[i]); 991 INIT_LIST_HEAD(&dasd_hashlists[i]);
988 992
989 /* Initialize servermap structure. */ 993 /* Initialize servermap structure. */
990 INIT_LIST_HEAD(&dasd_serverlist); 994 INIT_LIST_HEAD(&dasd_server_ssid_list);
991 return 0; 995 return 0;
992} 996}
993 997