Re: [PATCH 2/3] can: add support for Janz VMOD-ICAN3 Intelligent CAN module

Previous thread: Re: [PATCH 3/12] drivers/char/amiserial.c: Add missing local_irq_restore by Andrew Morton on Thursday, April 1, 2010 - 12:51 pm. (1 message)

Next thread: [PATCH] perf: timechart: handle pthreads correctly by Andrew Isaacson on Thursday, April 1, 2010 - 1:04 pm. (1 message)
From: Andrew Morton
Date: Thursday, April 1, 2010 - 1:03 pm

On Mon, 29 Mar 2010 09:58:51 -0700


It does this rather a lot.  it seems to be doing quite a lot of work
under that lock, too - quite a lot of memcpy_toio(), other stuff.

Is there potential here to disable interrupt for too long?  Not
possible to use spin_lock_bh() here?

--

From: Ira W. Snyder
Date: Thursday, April 1, 2010 - 5:43 pm

Like most similar cards, the host computer communicates to the
microcontroller through a dual ported memory (DPM) interface. In this
card, it is split into 256x 256 byte pages/windows.

The lock ensures that once code sets a window, it doesn't change while

The largest possible memcpy_(to|from)io() in the driver is 256 bytes.
Not too huge, but I understand the concern.

Looking at this again, I don't take the lock in the interrupt handler
(nor do I need to). What contexts do the network driver's xmit() and
napi() routines run in? hardirq and softirq respectively, right? In that
case, I think spin_lock_bh() is probably enough.

Ira
--

Previous thread: Re: [PATCH 3/12] drivers/char/amiserial.c: Add missing local_irq_restore by Andrew Morton on Thursday, April 1, 2010 - 12:51 pm. (1 message)

Next thread: [PATCH] perf: timechart: handle pthreads correctly by Andrew Isaacson on Thursday, April 1, 2010 - 1:04 pm. (1 message)