Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755824Ab2FYS4U (ORCPT ); Mon, 25 Jun 2012 14:56:20 -0400 Received: from mail-qc0-f170.google.com ([209.85.216.170]:56489 "EHLO mail-qc0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753172Ab2FYS4S convert rfc822-to-8bit (ORCPT ); Mon, 25 Jun 2012 14:56:18 -0400 MIME-Version: 1.0 In-Reply-To: References: <1340409205-23606-1-git-send-email-bfreed@chromium.org> Date: Tue, 26 Jun 2012 02:56:17 +0800 Message-ID: Subject: Re: [PATCH] spi: Unlock a spinlock before calling into the controller driver. From: Linus Walleij To: Doug Anderson Cc: Olof Johansson , Bryan Freed , spi-devel-general@lists.sourceforge.net, grant.likely@secretlab.ca, linux-kernel@vger.kernel.org, Mark Brown Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1171 Lines: 27 On Tue, Jun 26, 2012 at 1:07 AM, Doug Anderson wrote: > Specifically there should be only one instance of spi_pump_messages() > running at a time per master. ?That's because it's a kthread work > function. ?...so we can't possibly get a prepare in the middle of the > unprepare when prepare is called because the only caller to > prepare/unprepare is spi_pump_messages(). Yes that's how the message pump is designed. > I can't comment on whether it's better to do something like add?a > workqueue (which might be more obvious / less fragile) or just to add > a comment. ?I will let others comment on that. ?:) The message pump initially used a workqueue, but was converted to a kthread because we needed to push the queue to run as realtime for some important low-latency workloads across SPI. The code is basically a tweaked workqueue if you dive down in the implementation. Yours, Linus Walleij -- 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/