Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4957006imm; Tue, 19 Jun 2018 02:39:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKgSFZ/YstKw6pvJS/SlxS7lM+MDG54+RyOJyV8kP/zfvpN0scnEikf+n2D8FInVFVTQOZD X-Received: by 2002:a63:a513:: with SMTP id n19-v6mr14033292pgf.381.1529401195615; Tue, 19 Jun 2018 02:39:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529401195; cv=none; d=google.com; s=arc-20160816; b=nNPgnyn0q7eaRvfGil5N65yDqqV/buBhVjcsct9tvcBo604Gp1+4gSecvM9luq0zJ5 roXVhun08ZLVPwsc0zFkJ8EbgIRWb7W+YiiEuR7Tm3FchTfZFmZpggDaOus8h8DBM1wk WQfDvD6sjdY/UAWaG7EJEMRdXp7fuDpf//0Z8COMjZwuovAo/MBZPcOuXxtd5k6gcPir epMC0J8FnTldFR/+4HFhgtKsZPpHEouUyi8PfuJwXik/tj/hamD7WPHy7d2tc0P6W5Kd p5XUFy8ik4IVr87us8Qh4/V2TUUiSMIaKa1rU2fvfH1MC4NbD7QmF+U1uMb1cW1nsiWP eqxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:arc-authentication-results; bh=Q8tzm87oX5CkqlSWsmHAaUNYH/W88299vOM/F792cz4=; b=wxJIJWnnCbyyoGTmK5k2DXcrWl46n4WO/YLjHqKDbPqNv6w9CwEVPKekXTZZAmZS3U iNabZsAuv04y1ZWTO0DdjhjQ6mdQ74Lc1IowHL6dThih5dc+KizBKTX5ehi29YRJQYT9 5SDuECZQf8zX2uPy0+cQqkQqKxFbSi3GlcIedNtiW8+oHZylR9maF1UilPsXTTpV9KVX De8iZf2fStnLMmTPf69CFyhyaojKNKRsVlP5j6+NSG9kv5Yd6BPEEDj87b3KzR5A0Xdt bGuSt6mH+jr4dIZ2PMjgapoOssbiJ9QOmo4omrV62Eq9UvUzISEzCt5AqVU1PI2fb69c G3PQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j6-v6si14266334pgs.615.2018.06.19.02.39.41; Tue, 19 Jun 2018 02:39:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937392AbeFSJjC (ORCPT + 99 others); Tue, 19 Jun 2018 05:39:02 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:44257 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755946AbeFSJjB (ORCPT ); Tue, 19 Jun 2018 05:39:01 -0400 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVD6I-00041h-VH; Tue, 19 Jun 2018 11:38:58 +0200 Received: from ukl by dude.hi.pengutronix.de with local (Exim 4.91) (envelope-from ) id 1fVD6I-0006O6-CP; Tue, 19 Jun 2018 11:38:58 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Gavin Schenk , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH] siox: treat type errors as status errors Date: Tue, 19 Jun 2018 11:38:54 +0200 Message-Id: <20180619093854.24232-1-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/siox/siox-core.c | 20 ++++++++++---------- 1 file 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) 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; -- 2.17.1