Commit c5a37883 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'akpm' (patches from Andrew)

Merge final patch-bomb from Andrew Morton:
 "Various leftovers, mainly Christoph's pci_dma_supported() removals"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  pci: remove pci_dma_supported
  usbnet: remove ifdefed out call to dma_supported
  kaweth: remove ifdefed out call to dma_supported
  sfc: don't call dma_supported
  nouveau: don't call pci_dma_supported
  netup_unidvb: use pci_set_dma_mask insted of pci_dma_supported
  cx23885: use pci_set_dma_mask insted of pci_dma_supported
  cx25821: use pci_set_dma_mask insted of pci_dma_supported
  cx88: use pci_set_dma_mask insted of pci_dma_supported
  saa7134: use pci_set_dma_mask insted of pci_dma_supported
  saa7164: use pci_set_dma_mask insted of pci_dma_supported
  tw68-core: use pci_set_dma_mask insted of pci_dma_supported
  pcnet32: use pci_set_dma_mask insted of pci_dma_supported
  lib/string.c: add ULL suffix to the constant definition
  hugetlb: trivial comment fix
  selftests/mlock2: add ULL suffix to 64-bit constants
  selftests/mlock2: add missing #define _GNU_SOURCE
parents 5dfe5b2c 247e75db
...@@ -353,8 +353,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) ...@@ -353,8 +353,7 @@ nouveau_ttm_init(struct nouveau_drm *drm)
bits = nvxx_mmu(&drm->device)->dma_bits; bits = nvxx_mmu(&drm->device)->dma_bits;
if (nvxx_device(&drm->device)->func->pci) { if (nvxx_device(&drm->device)->func->pci) {
if (drm->agp.bridge || if (drm->agp.bridge)
!dma_supported(dev->dev, DMA_BIT_MASK(bits)))
bits = 32; bits = 32;
} else if (device->func->tegra) { } else if (device->func->tegra) {
struct nvkm_device_tegra *tegra = device->func->tegra(device); struct nvkm_device_tegra *tegra = device->func->tegra(device);
...@@ -369,6 +368,10 @@ nouveau_ttm_init(struct nouveau_drm *drm) ...@@ -369,6 +368,10 @@ nouveau_ttm_init(struct nouveau_drm *drm)
} }
ret = dma_set_mask(dev->dev, DMA_BIT_MASK(bits)); ret = dma_set_mask(dev->dev, DMA_BIT_MASK(bits));
if (ret && bits != 32) {
bits = 32;
ret = dma_set_mask(dev->dev, DMA_BIT_MASK(bits));
}
if (ret) if (ret)
return ret; return ret;
......
...@@ -1992,7 +1992,7 @@ static int cx23885_initdev(struct pci_dev *pci_dev, ...@@ -1992,7 +1992,7 @@ static int cx23885_initdev(struct pci_dev *pci_dev,
(unsigned long long)pci_resource_start(pci_dev, 0)); (unsigned long long)pci_resource_start(pci_dev, 0));
pci_set_master(pci_dev); pci_set_master(pci_dev);
if (!pci_dma_supported(pci_dev, 0xffffffff)) { if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
printk("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name); printk("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
err = -EIO; err = -EIO;
goto fail_context; goto fail_context;
......
...@@ -1319,7 +1319,7 @@ static int cx25821_initdev(struct pci_dev *pci_dev, ...@@ -1319,7 +1319,7 @@ static int cx25821_initdev(struct pci_dev *pci_dev,
dev->pci_lat, (unsigned long long)dev->base_io_addr); dev->pci_lat, (unsigned long long)dev->base_io_addr);
pci_set_master(pci_dev); pci_set_master(pci_dev);
if (!pci_dma_supported(pci_dev, 0xffffffff)) { if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
pr_err("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name); pr_err("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
err = -EIO; err = -EIO;
goto fail_irq; goto fail_irq;
......
...@@ -890,7 +890,7 @@ static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci, ...@@ -890,7 +890,7 @@ static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci,
return err; return err;
} }
if (!pci_dma_supported(pci,DMA_BIT_MASK(32))) { if (!pci_set_dma_mask(pci,DMA_BIT_MASK(32))) {
dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name); dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name);
err = -EIO; err = -EIO;
cx88_core_put(core, pci); cx88_core_put(core, pci);
......
...@@ -393,7 +393,7 @@ static int cx8802_init_common(struct cx8802_dev *dev) ...@@ -393,7 +393,7 @@ static int cx8802_init_common(struct cx8802_dev *dev)
if (pci_enable_device(dev->pci)) if (pci_enable_device(dev->pci))
return -EIO; return -EIO;
pci_set_master(dev->pci); pci_set_master(dev->pci);
if (!pci_dma_supported(dev->pci,DMA_BIT_MASK(32))) { if (!pci_set_dma_mask(dev->pci,DMA_BIT_MASK(32))) {
printk("%s/2: Oops: no 32bit PCI DMA ???\n",dev->core->name); printk("%s/2: Oops: no 32bit PCI DMA ???\n",dev->core->name);
return -EIO; return -EIO;
} }
......
...@@ -1314,7 +1314,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev, ...@@ -1314,7 +1314,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0)); dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
pci_set_master(pci_dev); pci_set_master(pci_dev);
if (!pci_dma_supported(pci_dev,DMA_BIT_MASK(32))) { if (!pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32))) {
printk("%s/0: Oops: no 32bit PCI DMA ???\n",core->name); printk("%s/0: Oops: no 32bit PCI DMA ???\n",core->name);
err = -EIO; err = -EIO;
goto fail_core; goto fail_core;
......
...@@ -810,7 +810,7 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev, ...@@ -810,7 +810,7 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev,
"%s(): board vendor 0x%x, revision 0x%x\n", "%s(): board vendor 0x%x, revision 0x%x\n",
__func__, board_vendor, board_revision); __func__, board_vendor, board_revision);
pci_set_master(pci_dev); pci_set_master(pci_dev);
if (!pci_dma_supported(pci_dev, 0xffffffff)) { if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
dev_err(&pci_dev->dev, dev_err(&pci_dev->dev,
"%s(): 32bit PCI DMA is not supported\n", __func__); "%s(): 32bit PCI DMA is not supported\n", __func__);
goto pci_detect_err; goto pci_detect_err;
......
...@@ -951,7 +951,7 @@ static int saa7134_initdev(struct pci_dev *pci_dev, ...@@ -951,7 +951,7 @@ static int saa7134_initdev(struct pci_dev *pci_dev,
pci_name(pci_dev), dev->pci_rev, pci_dev->irq, pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0)); dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
pci_set_master(pci_dev); pci_set_master(pci_dev);
if (!pci_dma_supported(pci_dev, DMA_BIT_MASK(32))) { if (!pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32))) {
pr_warn("%s: Oops: no 32bit PCI DMA ???\n", dev->name); pr_warn("%s: Oops: no 32bit PCI DMA ???\n", dev->name);
err = -EIO; err = -EIO;
goto fail1; goto fail1;
......
...@@ -1264,7 +1264,7 @@ static int saa7164_initdev(struct pci_dev *pci_dev, ...@@ -1264,7 +1264,7 @@ static int saa7164_initdev(struct pci_dev *pci_dev,
pci_set_master(pci_dev); pci_set_master(pci_dev);
/* TODO */ /* TODO */
if (!pci_dma_supported(pci_dev, 0xffffffff)) { if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
printk("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name); printk("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
err = -EIO; err = -EIO;
goto fail_irq; goto fail_irq;
......
...@@ -257,7 +257,7 @@ static int tw68_initdev(struct pci_dev *pci_dev, ...@@ -257,7 +257,7 @@ static int tw68_initdev(struct pci_dev *pci_dev,
dev->name, pci_name(pci_dev), dev->pci_rev, pci_dev->irq, dev->name, pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
dev->pci_lat, (u64)pci_resource_start(pci_dev, 0)); dev->pci_lat, (u64)pci_resource_start(pci_dev, 0));
pci_set_master(pci_dev); pci_set_master(pci_dev);
if (!pci_dma_supported(pci_dev, DMA_BIT_MASK(32))) { if (!pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32))) {
pr_info("%s: Oops: no 32bit PCI DMA ???\n", dev->name); pr_info("%s: Oops: no 32bit PCI DMA ???\n", dev->name);
err = -EIO; err = -EIO;
goto fail1; goto fail1;
......
...@@ -1500,7 +1500,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1500,7 +1500,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
return -ENODEV; return -ENODEV;
} }
if (!pci_dma_supported(pdev, PCNET32_DMA_MASK)) { if (!pci_set_dma_mask(pdev, PCNET32_DMA_MASK)) {
if (pcnet32_debug & NETIF_MSG_PROBE) if (pcnet32_debug & NETIF_MSG_PROBE)
pr_err("architecture does not support 32bit PCI busmaster DMA\n"); pr_err("architecture does not support 32bit PCI busmaster DMA\n");
return -ENODEV; return -ENODEV;
......
...@@ -1247,11 +1247,9 @@ static int efx_init_io(struct efx_nic *efx) ...@@ -1247,11 +1247,9 @@ static int efx_init_io(struct efx_nic *efx)
* masks event though they reject 46 bit masks. * masks event though they reject 46 bit masks.
*/ */
while (dma_mask > 0x7fffffffUL) { while (dma_mask > 0x7fffffffUL) {
if (dma_supported(&pci_dev->dev, dma_mask)) { rc = dma_set_mask_and_coherent(&pci_dev->dev, dma_mask);
rc = dma_set_mask_and_coherent(&pci_dev->dev, dma_mask); if (rc == 0)
if (rc == 0) break;
break;
}
dma_mask >>= 1; dma_mask >>= 1;
} }
if (rc) { if (rc) {
......
...@@ -1177,12 +1177,6 @@ static int kaweth_probe( ...@@ -1177,12 +1177,6 @@ static int kaweth_probe(
INIT_DELAYED_WORK(&kaweth->lowmem_work, kaweth_resubmit_tl); INIT_DELAYED_WORK(&kaweth->lowmem_work, kaweth_resubmit_tl);
usb_set_intfdata(intf, kaweth); usb_set_intfdata(intf, kaweth);
#if 0
// dma_supported() is deeply broken on almost all architectures
if (dma_supported (dev, 0xffffffffffffffffULL))
kaweth->net->features |= NETIF_F_HIGHDMA;
#endif
SET_NETDEV_DEV(netdev, dev); SET_NETDEV_DEV(netdev, dev);
if (register_netdev(netdev) != 0) { if (register_netdev(netdev) != 0) {
dev_err(dev, "Error registering netdev.\n"); dev_err(dev, "Error registering netdev.\n");
......
...@@ -1662,12 +1662,6 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) ...@@ -1662,12 +1662,6 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
* bind() should set rx_urb_size in that case. * bind() should set rx_urb_size in that case.
*/ */
dev->hard_mtu = net->mtu + net->hard_header_len; dev->hard_mtu = net->mtu + net->hard_header_len;
#if 0
// dma_supported() is deeply broken on almost all architectures
// possible with some EHCI controllers
if (dma_supported (&udev->dev, DMA_BIT_MASK(64)))
net->features |= NETIF_F_HIGHDMA;
#endif
net->netdev_ops = &usbnet_netdev_ops; net->netdev_ops = &usbnet_netdev_ops;
net->watchdog_timeo = TX_TIMEOUT_JIFFIES; net->watchdog_timeo = TX_TIMEOUT_JIFFIES;
......
...@@ -704,8 +704,6 @@ ccio_mark_invalid(struct ioc *ioc, dma_addr_t iova, size_t byte_cnt) ...@@ -704,8 +704,6 @@ ccio_mark_invalid(struct ioc *ioc, dma_addr_t iova, size_t byte_cnt)
* ccio_dma_supported - Verify the IOMMU supports the DMA address range. * ccio_dma_supported - Verify the IOMMU supports the DMA address range.
* @dev: The PCI device. * @dev: The PCI device.
* @mask: A bit mask describing the DMA address range of the device. * @mask: A bit mask describing the DMA address range of the device.
*
* This function implements the pci_dma_supported function.
*/ */
static int static int
ccio_dma_supported(struct device *dev, u64 mask) ccio_dma_supported(struct device *dev, u64 mask)
......
...@@ -6,12 +6,6 @@ ...@@ -6,12 +6,6 @@
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
static inline int
pci_dma_supported(struct pci_dev *hwdev, u64 mask)
{
return dma_supported(hwdev == NULL ? NULL : &hwdev->dev, mask);
}
static inline void * static inline void *
pci_alloc_consistent(struct pci_dev *hwdev, size_t size, pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
dma_addr_t *dma_handle) dma_addr_t *dma_handle)
......
...@@ -904,7 +904,7 @@ void *memchr_inv(const void *start, int c, size_t bytes) ...@@ -904,7 +904,7 @@ void *memchr_inv(const void *start, int c, size_t bytes)
value64 = value; value64 = value;
#if defined(CONFIG_ARCH_HAS_FAST_MULTIPLIER) && BITS_PER_LONG == 64 #if defined(CONFIG_ARCH_HAS_FAST_MULTIPLIER) && BITS_PER_LONG == 64
value64 *= 0x0101010101010101; value64 *= 0x0101010101010101ULL;
#elif defined(CONFIG_ARCH_HAS_FAST_MULTIPLIER) #elif defined(CONFIG_ARCH_HAS_FAST_MULTIPLIER)
value64 *= 0x01010101; value64 *= 0x01010101;
value64 |= value64 << 32; value64 |= value64 << 32;
......
...@@ -2138,7 +2138,7 @@ static unsigned long set_max_huge_pages(struct hstate *h, unsigned long count, ...@@ -2138,7 +2138,7 @@ static unsigned long set_max_huge_pages(struct hstate *h, unsigned long count,
* First take pages out of surplus state. Then make up the * First take pages out of surplus state. Then make up the
* remaining difference by allocating fresh huge pages. * remaining difference by allocating fresh huge pages.
* *
* We might race with alloc_buddy_huge_page() here and be unable * We might race with __alloc_buddy_huge_page() here and be unable
* to convert a surplus huge page to a normal huge page. That is * to convert a surplus huge page to a normal huge page. That is
* not critical, though, it just means the overall size of the * not critical, though, it just means the overall size of the
* pool might be one hugepage larger than it needs to be, but * pool might be one hugepage larger than it needs to be, but
...@@ -2180,7 +2180,7 @@ static unsigned long set_max_huge_pages(struct hstate *h, unsigned long count, ...@@ -2180,7 +2180,7 @@ static unsigned long set_max_huge_pages(struct hstate *h, unsigned long count,
* By placing pages into the surplus state independent of the * By placing pages into the surplus state independent of the
* overcommit value, we are allowing the surplus pool size to * overcommit value, we are allowing the surplus pool size to
* exceed overcommit. There are few sane options here. Since * exceed overcommit. There are few sane options here. Since
* alloc_buddy_huge_page() is checking the global counter, * __alloc_buddy_huge_page() is checking the global counter,
* though, we'll note that we're not allowed to exceed surplus * though, we'll note that we're not allowed to exceed surplus
* and won't grow the pool anywhere else. Not until one of the * and won't grow the pool anywhere else. Not until one of the
* sysctls are changed, or the surplus pages go out of use. * sysctls are changed, or the surplus pages go out of use.
......
#define _GNU_SOURCE
#include <sys/mman.h> #include <sys/mman.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
...@@ -276,8 +277,8 @@ static bool is_vma_lock_on_fault(unsigned long addr) ...@@ -276,8 +277,8 @@ static bool is_vma_lock_on_fault(unsigned long addr)
return ret; return ret;
} }
#define PRESENT_BIT 0x8000000000000000 #define PRESENT_BIT 0x8000000000000000ULL
#define PFN_MASK 0x007FFFFFFFFFFFFF #define PFN_MASK 0x007FFFFFFFFFFFFFULL
#define UNEVICTABLE_BIT (1UL << 18) #define UNEVICTABLE_BIT (1UL << 18)
static int lock_check(char *map) static int lock_check(char *map)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment