From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Walleij Subject: Re: [PATCH 1/2] spi/pl022: timeout on polled transfer v2 Date: Thu, 19 May 2011 20:06:32 +0200 Message-ID: References: <1305821134-26147-1-git-send-email-linus.walleij@stericsson.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Grant Likely , spi-devel-general@lists.sourceforge.net, Lee Jones , linux-arm-kernel@lists.infradead.org, Magnus Templing To: Vitaly Wool Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org List-Id: linux-spi.vger.kernel.org 2011/5/19 Vitaly Wool : > On Thu, May 19, 2011 at 7:36 PM, Linus Walleij wrote: >>> >>> just out of curiosity: is it a busy wait? Looks like it is... >> >> Yep that's the polling mode part. IRQ and DMA mode should >> be the norm I guess. >> >> Magnus: do you have a specific use case for this thing? > > Well, adding cpu_relax() somewhere in the loop might be not a bad idea... OK sent a patch for it, and Grant applied it within something like 30 seconds :-) I think on ARM that just boils down to a barrier() so it basically injects air in the pipeline when busywaiting, I never understood what that is good for, but it's a good marker anyway. Linus Walleij From mboxrd@z Thu Jan 1 00:00:00 1970 From: linus.walleij@linaro.org (Linus Walleij) Date: Thu, 19 May 2011 20:06:32 +0200 Subject: [PATCH 1/2] spi/pl022: timeout on polled transfer v2 In-Reply-To: References: <1305821134-26147-1-git-send-email-linus.walleij@stericsson.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 2011/5/19 Vitaly Wool : > On Thu, May 19, 2011 at 7:36 PM, Linus Walleij wrote: >>> >>> just out of curiosity: is it a busy wait? Looks like it is... >> >> Yep that's the polling mode part. IRQ and DMA mode should >> be the norm I guess. >> >> Magnus: do you have a specific use case for this thing? > > Well, adding cpu_relax() somewhere in the loop might be not a bad idea... OK sent a patch for it, and Grant applied it within something like 30 seconds :-) I think on ARM that just boils down to a barrier() so it basically injects air in the pipeline when busywaiting, I never understood what that is good for, but it's a good marker anyway. Linus Walleij