Skip to content

Commit

Permalink
siox: treat type errors as status errors
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Uwe Kleine-König authored and Greg Kroah-Hartman committed Jul 7, 2018
1 parent bcde98f commit 7e6f7d2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions drivers/siox/siox-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,26 +215,26 @@ static void siox_poll(struct siox_master *smaster)
siox_status_clean(status,
sdevice->status_written_lastcycle);

/* Check counter bits */
if (siox_device_counter_error(sdevice, status_clean)) {
bool prev_counter_error;
/* Check counter and type bits */
if (siox_device_counter_error(sdevice, status_clean) ||
siox_device_type_error(sdevice, status_clean)) {
bool prev_error;

synced = false;

/* only report a new error if the last cycle was ok */
prev_counter_error =
prev_error =
siox_device_counter_error(sdevice,
prev_status_clean);
if (!prev_counter_error) {
prev_status_clean) ||
siox_device_type_error(sdevice,
prev_status_clean);

if (!prev_error) {
sdevice->status_errors++;
sysfs_notify_dirent(sdevice->status_errors_kn);
}
}

/* Check type bits */
if (siox_device_type_error(sdevice, status_clean))
synced = false;

/* If the device is unsynced report the watchdog as active */
if (!synced) {
status &= ~SIOX_STATUS_WDG;
Expand Down

0 comments on commit 7e6f7d2

Please sign in to comment.