aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/resources/rsio.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2008-04-10 11:06:43 -0400
committerLen Brown <len.brown@intel.com>2008-04-22 14:29:31 -0400
commit1d5b285da1893b90507b081664ac27f1a8a3dc5b (patch)
treedebc9adbd1471bc86bc12d1bc0ff9875c86e30a0 /drivers/acpi/resources/rsio.c
parent3fa347770a8a9cb3568600380ce4b5c041b3ac0b (diff)
ACPICA: Fix for resource descriptor optimization issues for _CRS/_SRC
Fixed a problem where resource descriptor size optimization could cause a problem when a _CRS resource template is passed to a _SRS method. The _SRS resource template must use the same descriptors (with the same size) as returned from _CRS. This change affects the following resource descriptors: IRQ/IRQNoFlags and StartDependendentFn/StartDependentFnNoPri. http://bugzilla.kernel.org/show_bug.cgi?id=9487 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/resources/rsio.c')
-rw-r--r--drivers/acpi/resources/rsio.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/drivers/acpi/resources/rsio.c b/drivers/acpi/resources/rsio.c
index b297bc3e441..50f3acdd9c8 100644
--- a/drivers/acpi/resources/rsio.c
+++ b/drivers/acpi/resources/rsio.c
@@ -185,7 +185,7 @@ struct acpi_rsconvert_info acpi_rs_convert_end_tag[2] = {
185 * 185 *
186 ******************************************************************************/ 186 ******************************************************************************/
187 187
188struct acpi_rsconvert_info acpi_rs_get_start_dpf[5] = { 188struct acpi_rsconvert_info acpi_rs_get_start_dpf[6] = {
189 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_START_DEPENDENT, 189 {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_START_DEPENDENT,
190 ACPI_RS_SIZE(struct acpi_resource_start_dependent), 190 ACPI_RS_SIZE(struct acpi_resource_start_dependent),
191 ACPI_RSC_TABLE_SIZE(acpi_rs_get_start_dpf)}, 191 ACPI_RSC_TABLE_SIZE(acpi_rs_get_start_dpf)},
@@ -196,6 +196,12 @@ struct acpi_rsconvert_info acpi_rs_get_start_dpf[5] = {
196 ACPI_ACCEPTABLE_CONFIGURATION, 196 ACPI_ACCEPTABLE_CONFIGURATION,
197 2}, 197 2},
198 198
199 /* Get the descriptor length (0 or 1 for Start Dpf descriptor) */
200
201 {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.start_dpf.descriptor_length),
202 AML_OFFSET(start_dpf.descriptor_type),
203 0},
204
199 /* All done if there is no flag byte present in the descriptor */ 205 /* All done if there is no flag byte present in the descriptor */
200 206
201 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 1}, 207 {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 1},
@@ -219,7 +225,9 @@ struct acpi_rsconvert_info acpi_rs_get_start_dpf[5] = {
219 * 225 *
220 ******************************************************************************/ 226 ******************************************************************************/
221 227
222struct acpi_rsconvert_info acpi_rs_set_start_dpf[6] = { 228struct acpi_rsconvert_info acpi_rs_set_start_dpf[10] = {
229 /* Start with a default descriptor of length 1 */
230
223 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_START_DEPENDENT, 231 {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_START_DEPENDENT,
224 sizeof(struct aml_resource_start_dependent), 232 sizeof(struct aml_resource_start_dependent),
225 ACPI_RSC_TABLE_SIZE(acpi_rs_set_start_dpf)}, 233 ACPI_RSC_TABLE_SIZE(acpi_rs_set_start_dpf)},
@@ -236,6 +244,33 @@ struct acpi_rsconvert_info acpi_rs_set_start_dpf[6] = {
236 AML_OFFSET(start_dpf.flags), 244 AML_OFFSET(start_dpf.flags),
237 2}, 245 2},
238 /* 246 /*
247 * All done if the output descriptor length is required to be 1
248 * (i.e., optimization to 0 bytes cannot be attempted)
249 */
250 {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE,
251 ACPI_RS_OFFSET(data.start_dpf.descriptor_length),
252 1},
253
254 /* Set length to 0 bytes (no flags byte) */
255
256 {ACPI_RSC_LENGTH, 0, 0,
257 sizeof(struct aml_resource_start_dependent_noprio)},
258
259 /*
260 * All done if the output descriptor length is required to be 0.
261 *
262 * TBD: Perhaps we should check for error if input flags are not
263 * compatible with a 0-byte descriptor.
264 */
265 {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE,
266 ACPI_RS_OFFSET(data.start_dpf.descriptor_length),
267 0},
268
269 /* Reset length to 1 byte (descriptor with flags byte) */
270
271 {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq)},
272
273 /*
239 * All done if flags byte is necessary -- if either priority value 274 * All done if flags byte is necessary -- if either priority value
240 * is not ACPI_ACCEPTABLE_CONFIGURATION 275 * is not ACPI_ACCEPTABLE_CONFIGURATION
241 */ 276 */