mirror of https://gitee.com/openkylin/linux.git
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
This commit is contained in:
commit
c5a37883f4
|
@ -353,8 +353,7 @@ nouveau_ttm_init(struct nouveau_drm *drm)
|
|||
|
||||
bits = nvxx_mmu(&drm->device)->dma_bits;
|
||||
if (nvxx_device(&drm->device)->func->pci) {
|
||||
if (drm->agp.bridge ||
|
||||
!dma_supported(dev->dev, DMA_BIT_MASK(bits)))
|
||||
if (drm->agp.bridge)
|
||||
bits = 32;
|
||||
} else if (device->func->tegra) {
|
||||
struct nvkm_device_tegra *tegra = device->func->tegra(device);
|
||||
|
@ -369,6 +368,10 @@ nouveau_ttm_init(struct nouveau_drm *drm)
|
|||
}
|
||||
|
||||
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)
|
||||
return ret;
|
||||
|
||||
|
|
|
@ -1992,7 +1992,7 @@ static int cx23885_initdev(struct pci_dev *pci_dev,
|
|||
(unsigned long long)pci_resource_start(pci_dev, 0));
|
||||
|
||||
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);
|
||||
err = -EIO;
|
||||
goto fail_context;
|
||||
|
|
|
@ -1319,7 +1319,7 @@ static int cx25821_initdev(struct pci_dev *pci_dev,
|
|||
dev->pci_lat, (unsigned long long)dev->base_io_addr);
|
||||
|
||||
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);
|
||||
err = -EIO;
|
||||
goto fail_irq;
|
||||
|
|
|
@ -890,7 +890,7 @@ static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci,
|
|||
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);
|
||||
err = -EIO;
|
||||
cx88_core_put(core, pci);
|
||||
|
|
|
@ -393,7 +393,7 @@ static int cx8802_init_common(struct cx8802_dev *dev)
|
|||
if (pci_enable_device(dev->pci))
|
||||
return -EIO;
|
||||
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);
|
||||
return -EIO;
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
||||
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);
|
||||
err = -EIO;
|
||||
goto fail_core;
|
||||
|
|
|
@ -810,7 +810,7 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev,
|
|||
"%s(): board vendor 0x%x, revision 0x%x\n",
|
||||
__func__, board_vendor, board_revision);
|
||||
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,
|
||||
"%s(): 32bit PCI DMA is not supported\n", __func__);
|
||||
goto pci_detect_err;
|
||||
|
|
|
@ -951,7 +951,7 @@ static int saa7134_initdev(struct pci_dev *pci_dev,
|
|||
pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
|
||||
dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
|
||||
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);
|
||||
err = -EIO;
|
||||
goto fail1;
|
||||
|
|
|
@ -1264,7 +1264,7 @@ static int saa7164_initdev(struct pci_dev *pci_dev,
|
|||
|
||||
pci_set_master(pci_dev);
|
||||
/* 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);
|
||||
err = -EIO;
|
||||
goto fail_irq;
|
||||
|
|
|
@ -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->pci_lat, (u64)pci_resource_start(pci_dev, 0));
|
||||
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);
|
||||
err = -EIO;
|
||||
goto fail1;
|
||||
|
|
|
@ -1500,7 +1500,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
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)
|
||||
pr_err("architecture does not support 32bit PCI busmaster DMA\n");
|
||||
return -ENODEV;
|
||||
|
|
|
@ -1247,11 +1247,9 @@ static int efx_init_io(struct efx_nic *efx)
|
|||
* masks event though they reject 46 bit masks.
|
||||
*/
|
||||
while (dma_mask > 0x7fffffffUL) {
|
||||
if (dma_supported(&pci_dev->dev, dma_mask)) {
|
||||
rc = dma_set_mask_and_coherent(&pci_dev->dev, dma_mask);
|
||||
if (rc == 0)
|
||||
break;
|
||||
}
|
||||
rc = dma_set_mask_and_coherent(&pci_dev->dev, dma_mask);
|
||||
if (rc == 0)
|
||||
break;
|
||||
dma_mask >>= 1;
|
||||
}
|
||||
if (rc) {
|
||||
|
|
|
@ -1177,12 +1177,6 @@ static int kaweth_probe(
|
|||
INIT_DELAYED_WORK(&kaweth->lowmem_work, kaweth_resubmit_tl);
|
||||
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);
|
||||
if (register_netdev(netdev) != 0) {
|
||||
dev_err(dev, "Error registering netdev.\n");
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
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->watchdog_timeo = TX_TIMEOUT_JIFFIES;
|
||||
|
|
|
@ -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.
|
||||
* @dev: The PCI device.
|
||||
* @mask: A bit mask describing the DMA address range of the device.
|
||||
*
|
||||
* This function implements the pci_dma_supported function.
|
||||
*/
|
||||
static int
|
||||
ccio_dma_supported(struct device *dev, u64 mask)
|
||||
|
|
|
@ -6,12 +6,6 @@
|
|||
|
||||
#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 *
|
||||
pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
|
||||
dma_addr_t *dma_handle)
|
||||
|
|
|
@ -904,7 +904,7 @@ void *memchr_inv(const void *start, int c, size_t bytes)
|
|||
|
||||
value64 = value;
|
||||
#if defined(CONFIG_ARCH_HAS_FAST_MULTIPLIER) && BITS_PER_LONG == 64
|
||||
value64 *= 0x0101010101010101;
|
||||
value64 *= 0x0101010101010101ULL;
|
||||
#elif defined(CONFIG_ARCH_HAS_FAST_MULTIPLIER)
|
||||
value64 *= 0x01010101;
|
||||
value64 |= value64 << 32;
|
||||
|
|
|
@ -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
|
||||
* 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
|
||||
* not critical, though, it just means the overall size of the
|
||||
* 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,
|
|||
* By placing pages into the surplus state independent of the
|
||||
* overcommit value, we are allowing the surplus pool size to
|
||||
* 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
|
||||
* and won't grow the pool anywhere else. Not until one of the
|
||||
* sysctls are changed, or the surplus pages go out of use.
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#define _GNU_SOURCE
|
||||
#include <sys/mman.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
@ -276,8 +277,8 @@ static bool is_vma_lock_on_fault(unsigned long addr)
|
|||
return ret;
|
||||
}
|
||||
|
||||
#define PRESENT_BIT 0x8000000000000000
|
||||
#define PFN_MASK 0x007FFFFFFFFFFFFF
|
||||
#define PRESENT_BIT 0x8000000000000000ULL
|
||||
#define PFN_MASK 0x007FFFFFFFFFFFFFULL
|
||||
#define UNEVICTABLE_BIT (1UL << 18)
|
||||
|
||||
static int lock_check(char *map)
|
||||
|
|
Loading…
Reference in New Issue