From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Grandegger Subject: Re: sja1000 interrupt problem Date: Wed, 13 Nov 2013 20:29:51 +0100 Message-ID: <5283D32F.3080808@grandegger.com> References: <52831FC7.3040509@hartkopp.net> <201311131008.55018.pisa@cmp.felk.cvut.cz> <5654b3a33cce286efc0ef2729ca33f03@grandegger.com> <5283C7F6.6000004@hartkopp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from ngcobalt02.manitu.net ([217.11.48.102]:56051 "EHLO ngcobalt02.manitu.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754473Ab3KMT3y (ORCPT ); Wed, 13 Nov 2013 14:29:54 -0500 In-Reply-To: <5283C7F6.6000004@hartkopp.net> Sender: linux-can-owner@vger.kernel.org List-ID: To: Oliver Hartkopp , Pavel Pisa , Kurt Van Dijck , Stephane Grosjean Cc: Austin Schuh , linux-can@vger.kernel.org Hi Oliver, On 11/13/2013 07:41 PM, Oliver Hartkopp wrote: > On 13.11.2013 10:52, Wolfgang Grandegger wrote: > >> >> In Linux-CAN we have something similar: >> >> http://lxr.linux.no/#linux/drivers/net/can/sja1000/ems_pcmcia.c#L90 >> > > Indeed. > > I think reworking the sja1000.c driver (as suggested by Kurt) won't make it. > It only touches the generic irq handling. > > The peak_pci driver creates (depending on the number of channels) e.g. > two/four AFAICS pretty *independent* sja1000 netdevices. > > Currently at the end of the generic sja1000 interrupt handling the according > irq bit in the PITA is cleared. This is not necessarily at the end of the > interrupt chain. > > What we would need to set up a similar handling as we have in EMS PCMCIA or > the EMS PCI (referenced by Pavel) is a "group of sja1000 netdevices" which is > placed on a single PEAK PCI adapter. Why? Normally we do not have such problems with level sensitive interrupts. Also so far it's pure speculation that this might be the cause of the problem. > Indeed there is already a chain of sja1000 netdevices: > > http://lxr.linux.no/#linux+v3.12/drivers/net/can/sja1000/peak_pci.c#L645 > > BUT this is only used to clean up all channels when the PCI device is removed > or some errors occur at creation time. > > IMO the existing chain of netdevices is not only needed for the device removal > but also for the interrupt handling. > > When ever the interrupt for the PCI adapter occurs all channels have to be > handled (in a private peak_pci_interrupt() function) and finally the PITA has > to be cleared there too. > > That change won't make use of the possibility to clear single IRQ bits in the > PITA anymore. And the PITA has to be checked first (e.g. to check if we have a > new interrupt somewhere later in the interrupt chain) to skip the irq handling > when it's obsolete. > > Any thoughts? See my comments above. If the PEAK PCI hardware is setting the levels correctly, there is no problem with the current interrupt handling. Wolfgang.