lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VfxyyqaAOTsXQfEaiQm8tPetG2JZUm-XrezzdL01qoYiA@mail.gmail.com>
Date:	Fri, 14 Dec 2012 09:06:03 +0200
From:	Andy Shevchenko <andy.shevchenko@...il.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	linux-kernel@...r.kernel.org,
	Viresh Kumar <viresh.kumar@...aro.org>,
	Vinod Koul <vinod.koul@...el.com>
Subject: Re: [PATCH 2/2] dmatest: check for dma mapping error

On Fri, Dec 14, 2012 at 1:34 AM, Andrew Morton
<akpm@...ux-foundation.org> wrote:
> On Mon, 10 Dec 2012 13:37:44 +0200
> Andy Shevchenko <andriy.shevchenko@...ux.intel.com> wrote:
>
>> We get a warning if CONFIG_DMA_API_DEBUG=y
>>
>> [   28.150631] WARNING: at lib/dma-debug.c:933 check_unmap+0x5d6/0x6ac()
>> [   28.157058] dw_dmac dw_dmac.0: DMA-API: device driver failed to check map error[device address=0x0000000035698305] [size=14365 bytes] [mapped as single]

>> --- a/drivers/dma/dmatest.c
>> +++ b/drivers/dma/dmatest.c
>> @@ -378,15 +378,35 @@ static int dmatest_func(void *data)
>>
>>                       dma_srcs[i] = dma_map_single(dev->dev, buf, len,
>>                                                    DMA_TO_DEVICE);
>> +                     ret = dma_mapping_error(dev->dev, dma_srcs[i]);
>> +                     if (ret) {
>> +                             unmap_src(dev->dev, dma_srcs, len, i);
>> +                             pr_warn("%s: #%u: mapping error %d with "
>> +                                     "src_off=0x%x len=0x%x\n",
>> +                                     thread_name, total_tests - 1, ret,
>> +                                     src_off, len);
>> +                             failed_tests++;
>> +                             continue;
>> +                     }
>
> The changelog and the code don't match.  Which one is out of date?

I'm afraid I didn't get what is wrong.

dmatest maps memory via dma_map_single() call. And it asks dmaengine
(at the end the DMA controller driver) to unmap them after usage.
Exactly at that time user gets a warning. And this warning is
independent of DMA controller in use.

-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ