Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759289AbZAMBcl (ORCPT ); Mon, 12 Jan 2009 20:32:41 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758156AbZAMB3F (ORCPT ); Mon, 12 Jan 2009 20:29:05 -0500 Received: from kroah.org ([198.145.64.141]:35985 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756538AbZAMB3B (ORCPT ); Mon, 12 Jan 2009 20:29:01 -0500 Date: Mon, 12 Jan 2009 17:27:07 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Maciej Sosnowski , Dan Williams Subject: [patch 09/21] ioat: wait for self-test completion Message-ID: <20090113012707.GJ4512@kroah.com> References: <20090113012006.063755472@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="ioat-wait-for-self-test-completion.patch" In-Reply-To: <20090113012633.GA4512@kroah.com> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1694 Lines: 52 2.6.27-stable review patch. If anyone has any objections, please let us know. ------------------ From: Dan Williams commit 532d3b1f86f41834a25373e3ded981d68e4ce17f upstream. As part of the ioat_dma self-test it performs a printk from a completion callback. Depending on the system console configuration this output can take longer than a millisecond causing the self-test to fail. Introduce a completion with a generous timeout to mitigate this failure. Acked-by: Maciej Sosnowski Signed-off-by: Dan Williams Signed-off-by: Greg Kroah-Hartman --- drivers/dma/ioat_dma.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/dma/ioat_dma.c +++ b/drivers/dma/ioat_dma.c @@ -1337,10 +1337,12 @@ static void ioat_dma_start_null_desc(str */ #define IOAT_TEST_SIZE 2000 +DECLARE_COMPLETION(test_completion); static void ioat_dma_test_callback(void *dma_async_param) { printk(KERN_ERR "ioatdma: ioat_dma_test_callback(%p)\n", dma_async_param); + complete(&test_completion); } /** @@ -1406,7 +1408,8 @@ static int ioat_dma_self_test(struct ioa goto free_resources; } device->common.device_issue_pending(dma_chan); - msleep(1); + + wait_for_completion_timeout(&test_completion, msecs_to_jiffies(3000)); if (device->common.device_is_tx_complete(dma_chan, cookie, NULL, NULL) != DMA_SUCCESS) { -- 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/