diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2018-06-19 05:38:54 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-07 11:38:57 -0400 |
commit | 7e6f7d24535b7c1edec3605d85c7684f7388d122 (patch) | |
tree | 54c264b7d94dcc461d39ad89ec455a52517a4cc3 /drivers/siox | |
parent | bcde98fcf9cf084f6ed6c1751d2ef68877a87c20 (diff) |
siox: treat type errors as status errors
The type bits are part of the per-device status word. So it's natural to
consider an error in the type bits as a status error instead of only
resulting in an unsynced state.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Gavin Schenk <g.schenk@eckelmann.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/siox')
-rw-r--r-- | drivers/siox/siox-core.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/siox/siox-core.c b/drivers/siox/siox-core.c index 16590dfaafa4..3115f930fa83 100644 --- a/drivers/siox/siox-core.c +++ b/drivers/siox/siox-core.c | |||
@@ -215,26 +215,26 @@ static void siox_poll(struct siox_master *smaster) | |||
215 | siox_status_clean(status, | 215 | siox_status_clean(status, |
216 | sdevice->status_written_lastcycle); | 216 | sdevice->status_written_lastcycle); |
217 | 217 | ||
218 | /* Check counter bits */ | 218 | /* Check counter and type bits */ |
219 | if (siox_device_counter_error(sdevice, status_clean)) { | 219 | if (siox_device_counter_error(sdevice, status_clean) || |
220 | bool prev_counter_error; | 220 | siox_device_type_error(sdevice, status_clean)) { |
221 | bool prev_error; | ||
221 | 222 | ||
222 | synced = false; | 223 | synced = false; |
223 | 224 | ||
224 | /* only report a new error if the last cycle was ok */ | 225 | /* only report a new error if the last cycle was ok */ |
225 | prev_counter_error = | 226 | prev_error = |
226 | siox_device_counter_error(sdevice, | 227 | siox_device_counter_error(sdevice, |
227 | prev_status_clean); | 228 | prev_status_clean) || |
228 | if (!prev_counter_error) { | 229 | siox_device_type_error(sdevice, |
230 | prev_status_clean); | ||
231 | |||
232 | if (!prev_error) { | ||
229 | sdevice->status_errors++; | 233 | sdevice->status_errors++; |
230 | sysfs_notify_dirent(sdevice->status_errors_kn); | 234 | sysfs_notify_dirent(sdevice->status_errors_kn); |
231 | } | 235 | } |
232 | } | 236 | } |
233 | 237 | ||
234 | /* Check type bits */ | ||
235 | if (siox_device_type_error(sdevice, status_clean)) | ||
236 | synced = false; | ||
237 | |||
238 | /* If the device is unsynced report the watchdog as active */ | 238 | /* If the device is unsynced report the watchdog as active */ |
239 | if (!synced) { | 239 | if (!synced) { |
240 | status &= ~SIOX_STATUS_WDG; | 240 | status &= ~SIOX_STATUS_WDG; |