diff options
Diffstat (limited to 'drivers/misc/sgi-xp/xpc_partition.c')
-rw-r--r-- | drivers/misc/sgi-xp/xpc_partition.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/misc/sgi-xp/xpc_partition.c b/drivers/misc/sgi-xp/xpc_partition.c index b5fb21641130..6722f6fe4dc7 100644 --- a/drivers/misc/sgi-xp/xpc_partition.c +++ b/drivers/misc/sgi-xp/xpc_partition.c | |||
@@ -73,6 +73,12 @@ xpc_get_rsvd_page_pa(int nasid) | |||
73 | 73 | ||
74 | while (1) { | 74 | while (1) { |
75 | 75 | ||
76 | /* !!! rp_pa will need to be _gpa on UV. | ||
77 | * ??? So do we save it into the architecture specific parts | ||
78 | * ??? of the xpc_partition structure? Do we rename this | ||
79 | * ??? function or have two versions? Rename rp_pa for UV to | ||
80 | * ??? rp_gpa? | ||
81 | */ | ||
76 | ret = xpc_get_partition_rsvd_page_pa(buf, &cookie, &rp_pa, | 82 | ret = xpc_get_partition_rsvd_page_pa(buf, &cookie, &rp_pa, |
77 | &len); | 83 | &len); |
78 | 84 | ||
@@ -118,9 +124,10 @@ xpc_get_rsvd_page_pa(int nasid) | |||
118 | * other partitions to discover we are alive and establish initial | 124 | * other partitions to discover we are alive and establish initial |
119 | * communications. | 125 | * communications. |
120 | */ | 126 | */ |
121 | struct xpc_rsvd_page * | 127 | int |
122 | xpc_setup_rsvd_page(void) | 128 | xpc_setup_rsvd_page(void) |
123 | { | 129 | { |
130 | int ret; | ||
124 | struct xpc_rsvd_page *rp; | 131 | struct xpc_rsvd_page *rp; |
125 | unsigned long rp_pa; | 132 | unsigned long rp_pa; |
126 | unsigned long new_ts_jiffies; | 133 | unsigned long new_ts_jiffies; |
@@ -132,7 +139,7 @@ xpc_setup_rsvd_page(void) | |||
132 | preempt_enable(); | 139 | preempt_enable(); |
133 | if (rp_pa == 0) { | 140 | if (rp_pa == 0) { |
134 | dev_err(xpc_part, "SAL failed to locate the reserved page\n"); | 141 | dev_err(xpc_part, "SAL failed to locate the reserved page\n"); |
135 | return NULL; | 142 | return -ESRCH; |
136 | } | 143 | } |
137 | rp = (struct xpc_rsvd_page *)__va(rp_pa); | 144 | rp = (struct xpc_rsvd_page *)__va(rp_pa); |
138 | 145 | ||
@@ -146,7 +153,7 @@ xpc_setup_rsvd_page(void) | |||
146 | dev_err(xpc_part, "the reserved page's partid of %d is outside " | 153 | dev_err(xpc_part, "the reserved page's partid of %d is outside " |
147 | "supported range (< 0 || >= %d)\n", rp->SAL_partid, | 154 | "supported range (< 0 || >= %d)\n", rp->SAL_partid, |
148 | xp_max_npartitions); | 155 | xp_max_npartitions); |
149 | return NULL; | 156 | return -EINVAL; |
150 | } | 157 | } |
151 | 158 | ||
152 | rp->version = XPC_RP_VERSION; | 159 | rp->version = XPC_RP_VERSION; |
@@ -165,8 +172,9 @@ xpc_setup_rsvd_page(void) | |||
165 | xpc_part_nasids = XPC_RP_PART_NASIDS(rp); | 172 | xpc_part_nasids = XPC_RP_PART_NASIDS(rp); |
166 | xpc_mach_nasids = XPC_RP_MACH_NASIDS(rp); | 173 | xpc_mach_nasids = XPC_RP_MACH_NASIDS(rp); |
167 | 174 | ||
168 | if (xpc_rsvd_page_init(rp) != xpSuccess) | 175 | ret = xpc_setup_rsvd_page_sn(rp); |
169 | return NULL; | 176 | if (ret != 0) |
177 | return ret; | ||
170 | 178 | ||
171 | /* | 179 | /* |
172 | * Set timestamp of when reserved page was setup by XPC. | 180 | * Set timestamp of when reserved page was setup by XPC. |
@@ -178,7 +186,15 @@ xpc_setup_rsvd_page(void) | |||
178 | new_ts_jiffies++; | 186 | new_ts_jiffies++; |
179 | rp->ts_jiffies = new_ts_jiffies; | 187 | rp->ts_jiffies = new_ts_jiffies; |
180 | 188 | ||
181 | return rp; | 189 | xpc_rsvd_page = rp; |
190 | return 0; | ||
191 | } | ||
192 | |||
193 | void | ||
194 | xpc_teardown_rsvd_page(void) | ||
195 | { | ||
196 | /* a zero timestamp indicates our rsvd page is not initialized */ | ||
197 | xpc_rsvd_page->ts_jiffies = 0; | ||
182 | } | 198 | } |
183 | 199 | ||
184 | /* | 200 | /* |