[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1420558682.62574.2.camel@djiang5-desk2.amr.corp.intel.com>
Date: Tue, 6 Jan 2015 15:38:02 +0000
From: "Jiang, Dave" <dave.jiang@...el.com>
To: "der.herr@...r.at" <der.herr@...r.at>
CC: "Williams, Dan J" <dan.j.williams@...el.com>,
"dmaengine@...r.kernel.org" <dmaengine@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"rashika.kheria@...il.com" <rashika.kheria@...il.com>,
"Koul, Vinod" <vinod.koul@...el.com>,
"prarit@...hat.com" <prarit@...hat.com>,
"josh@...htriplett.org" <josh@...htriplett.org>
Subject: Re: [PATCH] ioat: fail self-test if wait_for_completion times out
On Tue, 2015-01-06 at 00:42 +0000, Nicholas Mc Guire wrote:
> On Mon, 05 Jan 2015, Jiang, Dave wrote:
>
> >
> >
> >
> > On Sun, 2014-12-28 at 10:37 +0000, Nicholas Mc Guire wrote:
> > > wait_for_completion_timeout reaching timeout was being ignored,
> > > fail the self-test if timeout condition occurs.
> > >
> > > Not sure about the indentations used (CodingStyle:Chapter 2)
> > >
> > > this was only compile tested with
> > > x86_64_defconfig + CONFIG_DMA_ENGINE=y + CONFIG_INTEL_IOATDMA=y
> > >
> > > patch is against linux-next 3.19.0-rc1 -next-20141226
> > >
> > > Signed-off-by: Nicholas Mc Guire <der.herr@...r.at>
> > > ---
> > > drivers/dma/ioat/dma_v3.c | 9 ++++++---
> > > 1 file changed, 6 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c
> > > index be307182..0659215 100644
> > > --- a/drivers/dma/ioat/dma_v3.c
> > > +++ b/drivers/dma/ioat/dma_v3.c
> > > @@ -1311,7 +1311,8 @@ static int ioat_xor_val_self_test(struct ioatdma_device *device)
> > >
> > > tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000));
> > >
> > > - if (dma->device_tx_status(dma_chan, cookie, NULL) != DMA_COMPLETE) {
> > > + if (tmo == 0 || dma->device_tx_status(dma_chan, cookie, NULL)
> > > + != DMA_COMPLETE) {
> > > dev_err(dev, "Self-test xor timed out\n");
> > > err = -ENODEV;
> > > goto dma_unmap;
> > > @@ -1377,7 +1378,8 @@ static int ioat_xor_val_self_test(struct ioatdma_device *device)
> > >
> > > tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000));
> > >
> > > - if (dma->device_tx_status(dma_chan, cookie, NULL) != DMA_COMPLETE) {
> > > + if (tmo == 0 || dma->device_tx_status(dma_chan, cookie, NULL)
> > > + != DMA_COMPLETE) {
> >
> > Can you please do:
> > + if (tmo == 0 ||
> > + dma->device_tx_status(dma_chan, cookie, NULL) != DMA_COMPLETE) {
>
> Documentation/CodingStyle:Chapter 2
>
> "Statements longer than 80 columns will be broken into sensible chunks, unless
> exceeding 80 columns significantly increases readability and does not hide
> information. Descendants are always substantially shorter than the parent and
> are placed substantially to the right. The same applies to function headers..."
>
> am I misreading the CodingStyle here ?
I'm not sure what the issue is here.... What I proposed is still the
same length as the original code. And what I suggested complies with the
existing coding style that's already there.
>
> >
> > Otherwise it looks good. Although I've never hit that error condition either.
> >
> > > dev_err(dev, "Self-test validate timed out\n");
> > > err = -ENODEV;
> > > goto dma_unmap;
> > > @@ -1429,7 +1431,8 @@ static int ioat_xor_val_self_test(struct ioatdma_device *device)
> > >
> > > tmo = wait_for_completion_timeout(&cmp, msecs_to_jiffies(3000));
> > >
> > > - if (dma->device_tx_status(dma_chan, cookie, NULL) != DMA_COMPLETE) {
> > > + if (tmo == 0 || dma->device_tx_status(dma_chan, cookie, NULL)
> > > + != DMA_COMPLETE) {
> > > dev_err(dev, "Self-test 2nd validate timed out\n");
> > > err = -ENODEV;
> > > goto dma_unmap;
> > > --
> > > 1.7.10.4
> > >
>
> thx!
> hofrat
> --
> To unsubscribe from this list: send the line "unsubscribe dmaengine" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists