Skip to content

Commit c5a3788

Browse files
committed
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 <[email protected]>: 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
2 parents 5dfe5b2 + 247e75d commit c5a3788

File tree

19 files changed

+24
-42
lines changed

19 files changed

+24
-42
lines changed

drivers/gpu/drm/nouveau/nouveau_ttm.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,7 @@ nouveau_ttm_init(struct nouveau_drm *drm)
353353

354354
bits = nvxx_mmu(&drm->device)->dma_bits;
355355
if (nvxx_device(&drm->device)->func->pci) {
356-
if (drm->agp.bridge ||
357-
!dma_supported(dev->dev, DMA_BIT_MASK(bits)))
356+
if (drm->agp.bridge)
358357
bits = 32;
359358
} else if (device->func->tegra) {
360359
struct nvkm_device_tegra *tegra = device->func->tegra(device);
@@ -369,6 +368,10 @@ nouveau_ttm_init(struct nouveau_drm *drm)
369368
}
370369

371370
ret = dma_set_mask(dev->dev, DMA_BIT_MASK(bits));
371+
if (ret && bits != 32) {
372+
bits = 32;
373+
ret = dma_set_mask(dev->dev, DMA_BIT_MASK(bits));
374+
}
372375
if (ret)
373376
return ret;
374377

drivers/media/pci/cx23885/cx23885-core.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1992,7 +1992,7 @@ static int cx23885_initdev(struct pci_dev *pci_dev,
19921992
(unsigned long long)pci_resource_start(pci_dev, 0));
19931993

19941994
pci_set_master(pci_dev);
1995-
if (!pci_dma_supported(pci_dev, 0xffffffff)) {
1995+
if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
19961996
printk("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
19971997
err = -EIO;
19981998
goto fail_context;

drivers/media/pci/cx25821/cx25821-core.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ static int cx25821_initdev(struct pci_dev *pci_dev,
13191319
dev->pci_lat, (unsigned long long)dev->base_io_addr);
13201320

13211321
pci_set_master(pci_dev);
1322-
if (!pci_dma_supported(pci_dev, 0xffffffff)) {
1322+
if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
13231323
pr_err("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
13241324
err = -EIO;
13251325
goto fail_irq;

drivers/media/pci/cx88/cx88-alsa.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci,
890890
return err;
891891
}
892892

893-
if (!pci_dma_supported(pci,DMA_BIT_MASK(32))) {
893+
if (!pci_set_dma_mask(pci,DMA_BIT_MASK(32))) {
894894
dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name);
895895
err = -EIO;
896896
cx88_core_put(core, pci);

drivers/media/pci/cx88/cx88-mpeg.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ static int cx8802_init_common(struct cx8802_dev *dev)
393393
if (pci_enable_device(dev->pci))
394394
return -EIO;
395395
pci_set_master(dev->pci);
396-
if (!pci_dma_supported(dev->pci,DMA_BIT_MASK(32))) {
396+
if (!pci_set_dma_mask(dev->pci,DMA_BIT_MASK(32))) {
397397
printk("%s/2: Oops: no 32bit PCI DMA ???\n",dev->core->name);
398398
return -EIO;
399399
}

drivers/media/pci/cx88/cx88-video.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
13141314
dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
13151315

13161316
pci_set_master(pci_dev);
1317-
if (!pci_dma_supported(pci_dev,DMA_BIT_MASK(32))) {
1317+
if (!pci_set_dma_mask(pci_dev,DMA_BIT_MASK(32))) {
13181318
printk("%s/0: Oops: no 32bit PCI DMA ???\n",core->name);
13191319
err = -EIO;
13201320
goto fail_core;

drivers/media/pci/netup_unidvb/netup_unidvb_core.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev,
810810
"%s(): board vendor 0x%x, revision 0x%x\n",
811811
__func__, board_vendor, board_revision);
812812
pci_set_master(pci_dev);
813-
if (!pci_dma_supported(pci_dev, 0xffffffff)) {
813+
if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
814814
dev_err(&pci_dev->dev,
815815
"%s(): 32bit PCI DMA is not supported\n", __func__);
816816
goto pci_detect_err;

drivers/media/pci/saa7134/saa7134-core.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ static int saa7134_initdev(struct pci_dev *pci_dev,
951951
pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
952952
dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
953953
pci_set_master(pci_dev);
954-
if (!pci_dma_supported(pci_dev, DMA_BIT_MASK(32))) {
954+
if (!pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32))) {
955955
pr_warn("%s: Oops: no 32bit PCI DMA ???\n", dev->name);
956956
err = -EIO;
957957
goto fail1;

drivers/media/pci/saa7164/saa7164-core.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ static int saa7164_initdev(struct pci_dev *pci_dev,
12641264

12651265
pci_set_master(pci_dev);
12661266
/* TODO */
1267-
if (!pci_dma_supported(pci_dev, 0xffffffff)) {
1267+
if (!pci_set_dma_mask(pci_dev, 0xffffffff)) {
12681268
printk("%s/0: Oops: no 32bit PCI DMA ???\n", dev->name);
12691269
err = -EIO;
12701270
goto fail_irq;

drivers/media/pci/tw68/tw68-core.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static int tw68_initdev(struct pci_dev *pci_dev,
257257
dev->name, pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
258258
dev->pci_lat, (u64)pci_resource_start(pci_dev, 0));
259259
pci_set_master(pci_dev);
260-
if (!pci_dma_supported(pci_dev, DMA_BIT_MASK(32))) {
260+
if (!pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32))) {
261261
pr_info("%s: Oops: no 32bit PCI DMA ???\n", dev->name);
262262
err = -EIO;
263263
goto fail1;

drivers/net/ethernet/amd/pcnet32.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
15001500
return -ENODEV;
15011501
}
15021502

1503-
if (!pci_dma_supported(pdev, PCNET32_DMA_MASK)) {
1503+
if (!pci_set_dma_mask(pdev, PCNET32_DMA_MASK)) {
15041504
if (pcnet32_debug & NETIF_MSG_PROBE)
15051505
pr_err("architecture does not support 32bit PCI busmaster DMA\n");
15061506
return -ENODEV;

drivers/net/ethernet/sfc/efx.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -1247,11 +1247,9 @@ static int efx_init_io(struct efx_nic *efx)
12471247
* masks event though they reject 46 bit masks.
12481248
*/
12491249
while (dma_mask > 0x7fffffffUL) {
1250-
if (dma_supported(&pci_dev->dev, dma_mask)) {
1251-
rc = dma_set_mask_and_coherent(&pci_dev->dev, dma_mask);
1252-
if (rc == 0)
1253-
break;
1254-
}
1250+
rc = dma_set_mask_and_coherent(&pci_dev->dev, dma_mask);
1251+
if (rc == 0)
1252+
break;
12551253
dma_mask >>= 1;
12561254
}
12571255
if (rc) {

drivers/net/usb/kaweth.c

-6
Original file line numberDiff line numberDiff line change
@@ -1177,12 +1177,6 @@ static int kaweth_probe(
11771177
INIT_DELAYED_WORK(&kaweth->lowmem_work, kaweth_resubmit_tl);
11781178
usb_set_intfdata(intf, kaweth);
11791179

1180-
#if 0
1181-
// dma_supported() is deeply broken on almost all architectures
1182-
if (dma_supported (dev, 0xffffffffffffffffULL))
1183-
kaweth->net->features |= NETIF_F_HIGHDMA;
1184-
#endif
1185-
11861180
SET_NETDEV_DEV(netdev, dev);
11871181
if (register_netdev(netdev) != 0) {
11881182
dev_err(dev, "Error registering netdev.\n");

drivers/net/usb/usbnet.c

-6
Original file line numberDiff line numberDiff line change
@@ -1662,12 +1662,6 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
16621662
* bind() should set rx_urb_size in that case.
16631663
*/
16641664
dev->hard_mtu = net->mtu + net->hard_header_len;
1665-
#if 0
1666-
// dma_supported() is deeply broken on almost all architectures
1667-
// possible with some EHCI controllers
1668-
if (dma_supported (&udev->dev, DMA_BIT_MASK(64)))
1669-
net->features |= NETIF_F_HIGHDMA;
1670-
#endif
16711665

16721666
net->netdev_ops = &usbnet_netdev_ops;
16731667
net->watchdog_timeo = TX_TIMEOUT_JIFFIES;

drivers/parisc/ccio-dma.c

-2
Original file line numberDiff line numberDiff line change
@@ -704,8 +704,6 @@ ccio_mark_invalid(struct ioc *ioc, dma_addr_t iova, size_t byte_cnt)
704704
* ccio_dma_supported - Verify the IOMMU supports the DMA address range.
705705
* @dev: The PCI device.
706706
* @mask: A bit mask describing the DMA address range of the device.
707-
*
708-
* This function implements the pci_dma_supported function.
709707
*/
710708
static int
711709
ccio_dma_supported(struct device *dev, u64 mask)

include/asm-generic/pci-dma-compat.h

-6
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66

77
#include <linux/dma-mapping.h>
88

9-
static inline int
10-
pci_dma_supported(struct pci_dev *hwdev, u64 mask)
11-
{
12-
return dma_supported(hwdev == NULL ? NULL : &hwdev->dev, mask);
13-
}
14-
159
static inline void *
1610
pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
1711
dma_addr_t *dma_handle)

lib/string.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ void *memchr_inv(const void *start, int c, size_t bytes)
904904

905905
value64 = value;
906906
#if defined(CONFIG_ARCH_HAS_FAST_MULTIPLIER) && BITS_PER_LONG == 64
907-
value64 *= 0x0101010101010101;
907+
value64 *= 0x0101010101010101ULL;
908908
#elif defined(CONFIG_ARCH_HAS_FAST_MULTIPLIER)
909909
value64 *= 0x01010101;
910910
value64 |= value64 << 32;

mm/hugetlb.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -2138,7 +2138,7 @@ static unsigned long set_max_huge_pages(struct hstate *h, unsigned long count,
21382138
* First take pages out of surplus state. Then make up the
21392139
* remaining difference by allocating fresh huge pages.
21402140
*
2141-
* We might race with alloc_buddy_huge_page() here and be unable
2141+
* We might race with __alloc_buddy_huge_page() here and be unable
21422142
* to convert a surplus huge page to a normal huge page. That is
21432143
* not critical, though, it just means the overall size of the
21442144
* 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,
21802180
* By placing pages into the surplus state independent of the
21812181
* overcommit value, we are allowing the surplus pool size to
21822182
* exceed overcommit. There are few sane options here. Since
2183-
* alloc_buddy_huge_page() is checking the global counter,
2183+
* __alloc_buddy_huge_page() is checking the global counter,
21842184
* though, we'll note that we're not allowed to exceed surplus
21852185
* and won't grow the pool anywhere else. Not until one of the
21862186
* sysctls are changed, or the surplus pages go out of use.

tools/testing/selftests/vm/mlock2-tests.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#define _GNU_SOURCE
12
#include <sys/mman.h>
23
#include <stdint.h>
34
#include <stdio.h>
@@ -276,8 +277,8 @@ static bool is_vma_lock_on_fault(unsigned long addr)
276277
return ret;
277278
}
278279

279-
#define PRESENT_BIT 0x8000000000000000
280-
#define PFN_MASK 0x007FFFFFFFFFFFFF
280+
#define PRESENT_BIT 0x8000000000000000ULL
281+
#define PFN_MASK 0x007FFFFFFFFFFFFFULL
281282
#define UNEVICTABLE_BIT (1UL << 18)
282283

283284
static int lock_check(char *map)

0 commit comments

Comments
 (0)