Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752206AbbKKJyc (ORCPT ); Wed, 11 Nov 2015 04:54:32 -0500 Received: from mail-lb0-f173.google.com ([209.85.217.173]:33648 "EHLO mail-lb0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751265AbbKKJy2 convert rfc822-to-8bit (ORCPT ); Wed, 11 Nov 2015 04:54:28 -0500 MIME-Version: 1.0 In-Reply-To: <5642F6A5.5070301@pengutronix.de> References: <1447163974-24514-1-git-send-email-mirza.krak@hostmobility.com> <5642F6A5.5070301@pengutronix.de> Date: Wed, 11 Nov 2015 10:54:26 +0100 Message-ID: Subject: Re: [PATCH 1/1] can: sja1000: clear interrupts on start From: Mirza Krak To: Marc Kleine-Budde Cc: wg@grandegger.com, andri.yngvason@marel.com, "linux-can@vger.kernel.org" , netdev@vger.kernel.org, linux-kernel Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2315 Lines: 57 2015-11-11 9:04 GMT+01:00 Marc Kleine-Budde : > This problem occurs only an hardware, where the SJA1000 is powered > during system suspend? Correct, and the controller is in UP state. > Doesn't the SJA1000 trigger an interrupt that is detected after > resuming? You add the fix to the open() function, which is triggered > during $(ifconfig up), how is related to suspend/resume? Does the > network layer call $(ifconfig down) during shutdown? It does not trigger another interrupt. In our tests we have seen that IE and EPI flags are set in the IR registered when we resume the system. If we do not clear these two flags it does not produce any other interrupts. Setting the controller in to reset mode does not clear the IE and EPI flags, I can understand that IE flag is not cleared as this is stated in the data-sheet, can not explain why EPI flag is not cleared though as data-sheet states 0 (reset) for both hardware reset and SETTING MOD.0 BY SOFTWARE (which is the reset-mode) Reason I put it in open() is so at least a DOWN/UP procedure returns the controller to an operating state. Also if we do an UP we should clear any earlier states that might exist in the registers like we do with error counters and error code capture. Network layer does not call $(ifconfig down) during shutdown. > There isn't any suspend/resume code in the sja1000 driver, for me it > seems that we should add resume code that handles this problem. Yes, resume code should be implemented to handle this and other problems (receive data). But still a DOWN/UP procedure should clear any previous state that could exist in the controller registers. -- Med Vänliga Hälsningar / Best Regards ******************************************************************* Mirza Krak Host Mobility AB mirza.krak@hostmobility.com Anders Personsgatan 12, 416 64 Göteborg Sweden http://www.hostmobility.com Direct: +46 31 31 32 704 Phone: +46 31 31 32 700 Fax: +46 31 80 67 51 Mobile: +46 730 28 06 22 ******************************************************************* -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/