aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishal Verma <vishal.l.verma@intel.com>2016-12-05 19:00:37 -0500
committerDan Williams <dan.j.williams@intel.com>2016-12-06 19:08:10 -0500
commit9a901f5495e26e691c7d0ea7b6057a2f3e6330ed (patch)
treef923c2732e3cdbe9fe49fc25234d185c27bf8e1e
parent3e5de27e940d00d8d504dfb96625fb654f641509 (diff)
acpi, nfit: fix extended status translations for ACPI DSMs
ACPI DSMs can have an 'extended' status which can be non-zero to convey additional information about the command. In the xlat_status routine, where we translate the command statuses, we were returning an error for a non-zero extended status, even if the primary status indicated success. Return from each command's 'case' once we have verified both its status and extend status are good. Cc: <stable@vger.kernel.org> Fixes: 11294d63ac91 ("nfit: fail DSMs that return non-zero status by default") Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r--drivers/acpi/nfit/core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 71a7d07c28c9..60acbb1d159c 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -113,7 +113,7 @@ static int xlat_status(void *buf, unsigned int cmd, u32 status)
113 flags = ND_ARS_PERSISTENT | ND_ARS_VOLATILE; 113 flags = ND_ARS_PERSISTENT | ND_ARS_VOLATILE;
114 if ((status >> 16 & flags) == 0) 114 if ((status >> 16 & flags) == 0)
115 return -ENOTTY; 115 return -ENOTTY;
116 break; 116 return 0;
117 case ND_CMD_ARS_START: 117 case ND_CMD_ARS_START:
118 /* ARS is in progress */ 118 /* ARS is in progress */
119 if ((status & 0xffff) == NFIT_ARS_START_BUSY) 119 if ((status & 0xffff) == NFIT_ARS_START_BUSY)
@@ -122,7 +122,7 @@ static int xlat_status(void *buf, unsigned int cmd, u32 status)
122 /* Command failed */ 122 /* Command failed */
123 if (status & 0xffff) 123 if (status & 0xffff)
124 return -EIO; 124 return -EIO;
125 break; 125 return 0;
126 case ND_CMD_ARS_STATUS: 126 case ND_CMD_ARS_STATUS:
127 ars_status = buf; 127 ars_status = buf;
128 /* Command failed */ 128 /* Command failed */
@@ -154,7 +154,7 @@ static int xlat_status(void *buf, unsigned int cmd, u32 status)
154 /* Unknown status */ 154 /* Unknown status */
155 if (status >> 16) 155 if (status >> 16)
156 return -EIO; 156 return -EIO;
157 break; 157 return 0;
158 case ND_CMD_CLEAR_ERROR: 158 case ND_CMD_CLEAR_ERROR:
159 clear_err = buf; 159 clear_err = buf;
160 if (status & 0xffff) 160 if (status & 0xffff)
@@ -163,7 +163,7 @@ static int xlat_status(void *buf, unsigned int cmd, u32 status)
163 return -EIO; 163 return -EIO;
164 if (clear_err->length > clear_err->cleared) 164 if (clear_err->length > clear_err->cleared)
165 return clear_err->cleared; 165 return clear_err->cleared;
166 break; 166 return 0;
167 default: 167 default:
168 break; 168 break;
169 } 169 }