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: <3036653.SbY9jG7XMU@wuerfel>
Date:	Thu, 04 Aug 2016 11:21:43 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Timur Tabi <timur@...eaurora.org>
Cc:	netdev@...r.kernel.org, devicetree@...r.kernel.org,
	linux-arm-msm@...r.kernel.org, sdharia@...eaurora.org,
	shankerd@...eaurora.org, vikrams@...eaurora.org,
	cov@...eaurora.org, gavidov@...eaurora.org, robh+dt@...nel.org,
	andrew@...n.ch, bjorn.andersson@...aro.org, mlangsdo@...hat.com,
	jcm@...hat.com, agross@...eaurora.org, davem@...emloft.net,
	f.fainelli@...il.com, catalin.marinas@....com
Subject: Re: [PATCH] [v6] net: emac: emac gigabit ethernet controller driver

On Wednesday, August 3, 2016 4:24:22 PM CEST Timur Tabi wrote:
> Arnd Bergmann wrote:
> > As I said, this is inherently driver specific. If setting the 64-bit
> > mask fails, the driver itself needs to fall back to the 32-bit mask
> > so it can allocate buffers from ZONE_DMA instead of ZONE_NORMAL.
> 
> I just posted a v7 of my patch, but I forgot to fix the dma_set_mask 
> call.  I'll post a v8 soon, but before I do, what do you think of this:
> 
> /* The EMAC itself is capable of 64-bit DMA, so try that first. */
> ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
> if (ret) {
>          /* Some platforms may restrict the EMAC's address bus to less
>           * then the size of DDR. In this case, we need to try a
>           * smaller mask.  We could try every possible smaller mask,
>           * but that's overkill.  Instead, just fall to 32-bit, which
>           * should always work.
>           */
>          ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
>          if (ret) {
>                  dev_err(&pdev->dev, "could not set DMA mask\n");
>                  return ret;
>          }
> }

This is basically ok, but then I think you should pass GFP_DMA
or GFP_DMA32 to all allocations that the driver does after
the 64-bit mask fails, otherwise you get a significant overhead
in the bounce buffers.

For data that comes from the network stack, we have no choice
and always use bounce buffers for data that is beyond the mask.

	Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ