From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Grandegger Subject: Re: [RFC 0/6] pch_can/c_can: fix races and add PCH support to c_can Date: Mon, 26 Nov 2012 10:20:33 +0100 Message-ID: <50B33461.4020404@grandegger.com> References: <1353918186-4234-1-git-send-email-wg@grandegger.com> <50B32CAC.4050501@pengutronix.de> <50B32D40.1040507@grandegger.com> <50B32F62.9090507@pengutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Return-path: Received: from ngcobalt02.manitu.net ([217.11.48.102]:42119 "EHLO ngcobalt02.manitu.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753996Ab2KZJUl (ORCPT ); Mon, 26 Nov 2012 04:20:41 -0500 In-Reply-To: <50B32F62.9090507@pengutronix.de> Sender: linux-can-owner@vger.kernel.org List-ID: To: Marc Kleine-Budde Cc: linux-can@vger.kernel.org, bhupesh.sharma@st.com, tomoya.rohm@gmail.com On 11/26/2012 09:59 AM, Marc Kleine-Budde wrote: > On 11/26/2012 09:50 AM, Wolfgang Grandegger wrote: >> On 11/26/2012 09:47 AM, Marc Kleine-Budde wrote: >>> On 11/26/2012 09:23 AM, Wolfgang Grandegger wrote: >>>> Hello, >>>> >>>> as you might have already realized, Michael has reported problems with >>>> the PCH_CAN driver. With his help we try to fix these issues and add >>>> PCH PCI support to the C_CAN driver replacing the PCH_CAN driver sooner >>>> than later. Here follows my current patch stack for the records. When >>>> Michael's tests are successful, I'm going to post final patches. >>>> >>>> For Michael I have prepared out-of-tree driver sources allowing to >>>> easily build the drivers also for older 3.x kernel versions. More >>>> tester are welcome. >>>> >>>> As also pointed out by Casper, the problems are obvisouly due to races >>>> with stop and wakeup of the netif tx queue, managing tx_next and >>>> concurrent register accesses. For the moment I have fixed the races by >>>> adding "spin[un]lock_irqsave/restore" but, thinking more about it, >>>> "spinlock_bh" should be enough to protect against softirq context. >>>> >>>> With the C_CAN driver I realized some other minor issues: >>>> >>>> - The C/D_CAN type handling is common code and could go to >>>> alloc_c_can_dev() or register_c_can_dev(). >>>> >>>> Comments are welcome. >>> >>> Please make the patches based on linux-can-next/for-davem >> >> OK, will do for the next round. For the moment these are just RFC patches. > > AnilKumar Ch has added added a init callback, maybe you can make use of > it, too. And give it a more general name then. Ah, right, missed that. As it's called at open/close the same name would make sense. Wolfgang. > > Marc >