Merge git://git.kernel.org/pub/scm/linux/kernel/git/czankel/xtensa-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 14 May 2009 00:07:28 +0000 (17:07 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 14 May 2009 00:07:28 +0000 (17:07 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/czankel/xtensa-2.6:
  xtensa: Fix linker script to include .literal sections
  xtensa: update s6105_defconfig for ccount calibration
  xtensa: implement ccount calibration for s6000
  xtensa: fix wrong extern declaration renamed in code using it
  xtensa: register gpio chip before use
  xtensa: always use correct stack pointer for stack traces
  xtensa: Fix checksum header file
  xtensa: Fix architecture specific Kconfig

51 files changed:
arch/alpha/include/asm/percpu.h
arch/x86/kvm/svm.c
arch/x86/kvm/x86.c
drivers/dma/dmaengine.c
drivers/dma/dmatest.c
drivers/dma/ioat_dma.c
drivers/dma/ipu/ipu_idmac.c
drivers/gpu/drm/Kconfig
drivers/hid/hid-ids.h
drivers/hid/usbhid/hid-core.c
drivers/hid/usbhid/hid-quirks.c
drivers/i2c/busses/Kconfig
drivers/i2c/busses/i2c-cpm.c
drivers/i2c/busses/i2c-mpc.c
drivers/i2c/busses/i2c-pxa.c
drivers/infiniband/hw/cxgb3/cxio_hal.c
drivers/infiniband/hw/mlx4/mlx4_ib.h
drivers/infiniband/hw/mlx4/mr.c
drivers/infiniband/hw/mlx4/qp.c
drivers/input/ff-memless.c
drivers/input/joydev.c
drivers/input/keyboard/atkbd.c
drivers/input/touchscreen/tsc2007.c
drivers/net/mlx4/en_rx.c
drivers/rtc/rtc-twl4030.c
drivers/spi/pxa2xx_spi.c
drivers/video/Kconfig
drivers/video/via/viafbdev.c
fs/eventpoll.c
fs/fuse/inode.c
fs/hugetlbfs/inode.c
fs/lockd/svc.c
fs/nfsd/nfs4recover.c
fs/nfsd/nfs4state.c
fs/nfsd/nfs4xdr.c
fs/nilfs2/ioctl.c
fs/nilfs2/mdt.c
fs/nilfs2/nilfs.h
fs/nilfs2/page.c
fs/nilfs2/recovery.c
fs/nilfs2/segment.c
fs/nilfs2/segment.h
fs/squashfs/Makefile
fs/squashfs/cache.c
fs/squashfs/super.c
include/linux/dmaengine.h
include/linux/syscalls.h
mm/madvise.c
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
net/sunrpc/xprtrdma/svc_rdma_sendto.c
net/sunrpc/xprtrdma/svc_rdma_transport.c

index e9e0bb5..06c5c7a 100644 (file)
@@ -1,7 +1,9 @@
 #ifndef __ALPHA_PERCPU_H
 #define __ALPHA_PERCPU_H
+
 #include <linux/compiler.h>
 #include <linux/threads.h>
+#include <linux/percpu-defs.h>
 
 /*
  * Determine the real variable name from the name visible in the
@@ -73,6 +75,28 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
 
 #endif /* SMP */
 
-#include <asm-generic/percpu.h>
+#ifdef CONFIG_SMP
+#define PER_CPU_BASE_SECTION ".data.percpu"
+#else
+#define PER_CPU_BASE_SECTION ".data"
+#endif
+
+#ifdef CONFIG_SMP
+
+#ifdef MODULE
+#define PER_CPU_SHARED_ALIGNED_SECTION ""
+#else
+#define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned"
+#endif
+#define PER_CPU_FIRST_SECTION ".first"
+
+#else
+
+#define PER_CPU_SHARED_ALIGNED_SECTION ""
+#define PER_CPU_FIRST_SECTION ""
+
+#endif
+
+#define PER_CPU_ATTRIBUTES
 
 #endif /* __ALPHA_PERCPU_H */
index 1821c20..1f8510c 100644 (file)
@@ -411,7 +411,6 @@ static __init int svm_hardware_setup(void)
 
        iopm_va = page_address(iopm_pages);
        memset(iopm_va, 0xff, PAGE_SIZE * (1 << IOPM_ALLOC_ORDER));
-       clear_bit(0x80, iopm_va); /* allow direct access to PC debug port */
        iopm_base = page_to_pfn(iopm_pages) << PAGE_SHIFT;
 
        if (boot_cpu_has(X86_FEATURE_NX))
@@ -796,6 +795,11 @@ static void svm_get_segment(struct kvm_vcpu *vcpu,
        var->db = (s->attrib >> SVM_SELECTOR_DB_SHIFT) & 1;
        var->g = (s->attrib >> SVM_SELECTOR_G_SHIFT) & 1;
 
+       /* AMD's VMCB does not have an explicit unusable field, so emulate it
+        * for cross vendor migration purposes by "not present"
+        */
+       var->unusable = !var->present || (var->type == 0);
+
        switch (seg) {
        case VCPU_SREG_CS:
                /*
@@ -827,8 +831,6 @@ static void svm_get_segment(struct kvm_vcpu *vcpu,
                        var->type |= 0x1;
                break;
        }
-
-       var->unusable = !var->present;
 }
 
 static int svm_get_cpl(struct kvm_vcpu *vcpu)
index 7c1ce5a..49079a4 100644 (file)
@@ -1121,9 +1121,9 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
 
 static int is_efer_nx(void)
 {
-       u64 efer;
+       unsigned long long efer = 0;
 
-       rdmsrl(MSR_EFER, efer);
+       rdmsrl_safe(MSR_EFER, &efer);
        return efer & EFER_NX;
 }
 
@@ -1259,7 +1259,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
                bit(X86_FEATURE_CMOV) | bit(X86_FEATURE_PSE36) |
                bit(X86_FEATURE_MMX) | bit(X86_FEATURE_FXSR) |
                bit(X86_FEATURE_SYSCALL) |
-               (bit(X86_FEATURE_NX) && is_efer_nx()) |
+               (is_efer_nx() ? bit(X86_FEATURE_NX) : 0) |
 #ifdef CONFIG_X86_64
                bit(X86_FEATURE_LM) |
 #endif
index 92438e9..5a87384 100644 (file)
@@ -804,11 +804,14 @@ dma_async_memcpy_buf_to_buf(struct dma_chan *chan, void *dest,
        dma_addr_t dma_dest, dma_src;
        dma_cookie_t cookie;
        int cpu;
+       unsigned long flags;
 
        dma_src = dma_map_single(dev->dev, src, len, DMA_TO_DEVICE);
        dma_dest = dma_map_single(dev->dev, dest, len, DMA_FROM_DEVICE);
-       tx = dev->device_prep_dma_memcpy(chan, dma_dest, dma_src, len,
-                                        DMA_CTRL_ACK);
+       flags = DMA_CTRL_ACK |
+               DMA_COMPL_SRC_UNMAP_SINGLE |
+               DMA_COMPL_DEST_UNMAP_SINGLE;
+       tx = dev->device_prep_dma_memcpy(chan, dma_dest, dma_src, len, flags);
 
        if (!tx) {
                dma_unmap_single(dev->dev, dma_src, len, DMA_TO_DEVICE);
@@ -850,11 +853,12 @@ dma_async_memcpy_buf_to_pg(struct dma_chan *chan, struct page *page,
        dma_addr_t dma_dest, dma_src;
        dma_cookie_t cookie;
        int cpu;
+       unsigned long flags;
 
        dma_src = dma_map_single(dev->dev, kdata, len, DMA_TO_DEVICE);
        dma_dest = dma_map_page(dev->dev, page, offset, len, DMA_FROM_DEVICE);
-       tx = dev->device_prep_dma_memcpy(chan, dma_dest, dma_src, len,
-                                        DMA_CTRL_ACK);
+       flags = DMA_CTRL_ACK | DMA_COMPL_SRC_UNMAP_SINGLE;
+       tx = dev->device_prep_dma_memcpy(chan, dma_dest, dma_src, len, flags);
 
        if (!tx) {
                dma_unmap_single(dev->dev, dma_src, len, DMA_TO_DEVICE);
@@ -898,12 +902,13 @@ dma_async_memcpy_pg_to_pg(struct dma_chan *chan, struct page *dest_pg,
        dma_addr_t dma_dest, dma_src;
        dma_cookie_t cookie;
        int cpu;
+       unsigned long flags;
 
        dma_src = dma_map_page(dev->dev, src_pg, src_off, len, DMA_TO_DEVICE);
        dma_dest = dma_map_page(dev->dev, dest_pg, dest_off, len,
                                DMA_FROM_DEVICE);
-       tx = dev->device_prep_dma_memcpy(chan, dma_dest, dma_src, len,
-                                        DMA_CTRL_ACK);
+       flags = DMA_CTRL_ACK;
+       tx = dev->device_prep_dma_memcpy(chan, dma_dest, dma_src, len, flags);
 
        if (!tx) {
                dma_unmap_page(dev->dev, dma_src, len, DMA_TO_DEVICE);
index a27c0fb..fb7da51 100644 (file)
@@ -531,9 +531,7 @@ static int __init dmatest_init(void)
                chan = dma_request_channel(mask, filter, NULL);
                if (chan) {
                        err = dmatest_add_channel(chan);
-                       if (err == 0)
-                               continue;
-                       else {
+                       if (err) {
                                dma_release_channel(chan);
                                break; /* add_channel failed, punt */
                        }
index e4fc33c..1955ee8 100644 (file)
@@ -1063,22 +1063,31 @@ static void ioat_dma_cleanup_tasklet(unsigned long data)
 static void
 ioat_dma_unmap(struct ioat_dma_chan *ioat_chan, struct ioat_desc_sw *desc)
 {
-       /*
-        * yes we are unmapping both _page and _single
-        * alloc'd regions with unmap_page. Is this
-        * *really* that bad?
-        */
-       if (!(desc->async_tx.flags & DMA_COMPL_SKIP_DEST_UNMAP))
-               pci_unmap_page(ioat_chan->device->pdev,
-                               pci_unmap_addr(desc, dst),
-                               pci_unmap_len(desc, len),
-                               PCI_DMA_FROMDEVICE);
-
-       if (!(desc->async_tx.flags & DMA_COMPL_SKIP_SRC_UNMAP))
-               pci_unmap_page(ioat_chan->device->pdev,
-                               pci_unmap_addr(desc, src),
-                               pci_unmap_len(desc, len),
-                               PCI_DMA_TODEVICE);
+       if (!(desc->async_tx.flags & DMA_COMPL_SKIP_DEST_UNMAP)) {
+               if (desc->async_tx.flags & DMA_COMPL_DEST_UNMAP_SINGLE)
+                       pci_unmap_single(ioat_chan->device->pdev,
+                                        pci_unmap_addr(desc, dst),
+                                        pci_unmap_len(desc, len),
+                                        PCI_DMA_FROMDEVICE);
+               else
+                       pci_unmap_page(ioat_chan->device->pdev,
+                                      pci_unmap_addr(desc, dst),
+                                      pci_unmap_len(desc, len),
+                                      PCI_DMA_FROMDEVICE);
+       }
+
+       if (!(desc->async_tx.flags & DMA_COMPL_SKIP_SRC_UNMAP)) {
+               if (desc->async_tx.flags & DMA_COMPL_SRC_UNMAP_SINGLE)
+                       pci_unmap_single(ioat_chan->device->pdev,
+                                        pci_unmap_addr(desc, src),
+                                        pci_unmap_len(desc, len),
+                                        PCI_DMA_TODEVICE);
+               else
+                       pci_unmap_page(ioat_chan->device->pdev,
+                                      pci_unmap_addr(desc, src),
+                                      pci_unmap_len(desc, len),
+                                      PCI_DMA_TODEVICE);
+       }
 }
 
 /**
@@ -1363,6 +1372,7 @@ static int ioat_dma_self_test(struct ioatdma_device *device)
        int err = 0;
        struct completion cmp;
        unsigned long tmo;
+       unsigned long flags;
 
        src = kzalloc(sizeof(u8) * IOAT_TEST_SIZE, GFP_KERNEL);
        if (!src)
@@ -1392,8 +1402,9 @@ static int ioat_dma_self_test(struct ioatdma_device *device)
                                 DMA_TO_DEVICE);
        dma_dest = dma_map_single(dma_chan->device->dev, dest, IOAT_TEST_SIZE,
                                  DMA_FROM_DEVICE);
+       flags = DMA_COMPL_SRC_UNMAP_SINGLE | DMA_COMPL_DEST_UNMAP_SINGLE;
        tx = device->common.device_prep_dma_memcpy(dma_chan, dma_dest, dma_src,
-                                                  IOAT_TEST_SIZE, 0);
+                                                  IOAT_TEST_SIZE, flags);
        if (!tx) {
                dev_err(&device->pdev->dev,
                        "Self-test prep failed, disabling\n");
index e202a6c..9a5bc1a 100644 (file)
@@ -1272,7 +1272,8 @@ static irqreturn_t idmac_interrupt(int irq, void *dev_id)
        /* Other interrupts do not interfere with this channel */
        spin_lock(&ichan->lock);
        if (unlikely(chan_id != IDMAC_SDC_0 && chan_id != IDMAC_SDC_1 &&
-                    ((curbuf >> chan_id) & 1) == ichan->active_buffer)) {
+                    ((curbuf >> chan_id) & 1) == ichan->active_buffer &&
+                    !list_is_last(ichan->queue.next, &ichan->queue))) {
                int i = 100;
 
                /* This doesn't help. See comment in ipu_disable_channel() */
@@ -1547,7 +1548,7 @@ static irqreturn_t ic_sof_irq(int irq, void *dev_id)
        struct idmac_channel *ichan = dev_id;
        printk(KERN_DEBUG "Got SOF IRQ %d on Channel %d\n",
               irq, ichan->dma_chan.chan_id);
-       disable_irq(irq);
+       disable_irq_nosync(irq);
        return IRQ_HANDLED;
 }
 
@@ -1556,7 +1557,7 @@ static irqreturn_t ic_eof_irq(int irq, void *dev_id)
        struct idmac_channel *ichan = dev_id;
        printk(KERN_DEBUG "Got EOF IRQ %d on Channel %d\n",
               irq, ichan->dma_chan.chan_id);
-       disable_irq(irq);
+       disable_irq_nosync(irq);
        return IRQ_HANDLED;
 }
 
index 3a22eb9..17b24c5 100644 (file)
@@ -71,6 +71,7 @@ config DRM_I915
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
        select FB
+       select FRAMEBUFFER_CONSOLE if !EMBEDDED
        tristate "i915 driver"
        help
          Choose this option if you have a system that has Intel 830M, 845G,
index aa1b995..4d5ee2b 100644 (file)
 #define USB_VENDOR_ID_BERKSHIRE                0x0c98
 #define USB_DEVICE_ID_BERKSHIRE_PCWD   0x1140
 
+#define USB_VENDOR_ID_CH               0x068e
+#define USB_DEVICE_ID_CH_PRO_PEDALS    0x00f2
+#define USB_DEVICE_ID_CH_COMBATSTICK   0x00f4
+#define USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE       0x00ff
+
 #define USB_VENDOR_ID_CHERRY           0x046a
 #define USB_DEVICE_ID_CHERRY_CYMOTION  0x0023
 
index 900ce18..ac8049b 100644 (file)
@@ -898,7 +898,7 @@ static int usbhid_parse(struct hid_device *hid)
                goto err;
        }
 
-       hid->quirks = quirks;
+       hid->quirks |= quirks;
 
        return 0;
 err:
index 4391717..d8f7423 100644 (file)
@@ -50,6 +50,9 @@ static const struct hid_blacklist {
        { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET },
        { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET },
        { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET },
+       { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_COMBATSTICK, HID_QUIRK_NOGET },
+       { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE, HID_QUIRK_NOGET },
+       { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_PRO_PEDALS, HID_QUIRK_NOGET },
        { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET },
        { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
        { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET },
index a48c8ae..f1c6ca7 100644 (file)
@@ -467,7 +467,7 @@ config I2C_PXA_SLAVE
 
 config I2C_S3C2410
        tristate "S3C2410 I2C Driver"
-       depends on ARCH_S3C2410
+       depends on ARCH_S3C2410 || ARCH_S3C64XX
        help
          Say Y here to include support for I2C controller in the
          Samsung S3C2410 based System-on-Chip devices.
index 3fcf78e..b5db8b8 100644 (file)
@@ -531,16 +531,16 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm)
        rbdf = cpm->rbase;
 
        for (i = 0; i < CPM_MAXBD; i++) {
-               cpm->rxbuf[i] = dma_alloc_coherent(
-                       NULL, CPM_MAX_READ + 1, &cpm->rxdma[i], GFP_KERNEL);
+               cpm->rxbuf[i] = dma_alloc_coherent(&cpm->ofdev->dev,
+                                                  CPM_MAX_READ + 1,
+                                                  &cpm->rxdma[i], GFP_KERNEL);
                if (!cpm->rxbuf[i]) {
                        ret = -ENOMEM;
                        goto out_muram;
                }
                out_be32(&rbdf[i].cbd_bufaddr, ((cpm->rxdma[i] + 1) & ~1));
 
-               cpm->txbuf[i] = (unsigned char *)dma_alloc_coherent(
-                       NULL, CPM_MAX_READ + 1, &cpm->txdma[i], GFP_KERNEL);
+               cpm->txbuf[i] = (unsigned char *)dma_alloc_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, &cpm->txdma[i], GFP_KERNEL);
                if (!cpm->txbuf[i]) {
                        ret = -ENOMEM;
                        goto out_muram;
@@ -585,10 +585,10 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm)
 out_muram:
        for (i = 0; i < CPM_MAXBD; i++) {
                if (cpm->rxbuf[i])
-                       dma_free_coherent(NULL, CPM_MAX_READ + 1,
+                       dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1,
                                cpm->rxbuf[i], cpm->rxdma[i]);
                if (cpm->txbuf[i])
-                       dma_free_coherent(NULL, CPM_MAX_READ + 1,
+                       dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1,
                                cpm->txbuf[i], cpm->txdma[i]);
        }
        cpm_muram_free(cpm->dp_addr);
@@ -619,9 +619,9 @@ static void cpm_i2c_shutdown(struct cpm_i2c *cpm)
 
        /* Free all memory */
        for (i = 0; i < CPM_MAXBD; i++) {
-               dma_free_coherent(NULL, CPM_MAX_READ + 1,
+               dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1,
                        cpm->rxbuf[i], cpm->rxdma[i]);
-               dma_free_coherent(NULL, CPM_MAX_READ + 1,
+               dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1,
                        cpm->txbuf[i], cpm->txdma[i]);
        }
 
index 4af5c09..dd778d7 100644 (file)
@@ -164,7 +164,7 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
        return 0;
 }
 
-#ifdef CONFIG_PPC_52xx
+#ifdef CONFIG_PPC_MPC52xx
 static const struct mpc_i2c_divider mpc_i2c_dividers_52xx[] = {
        {20, 0x20}, {22, 0x21}, {24, 0x22}, {26, 0x23},
        {28, 0x24}, {30, 0x01}, {32, 0x25}, {34, 0x02},
@@ -188,7 +188,7 @@ static const struct mpc_i2c_divider mpc_i2c_dividers_52xx[] = {
 
 int mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock, int prescaler)
 {
-       const struct mpc52xx_i2c_divider *div = NULL;
+       const struct mpc_i2c_divider *div = NULL;
        unsigned int pvr = mfspr(SPRN_PVR);
        u32 divider;
        int i;
@@ -203,7 +203,7 @@ int mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock, int prescaler)
         * We want to choose an FDR/DFSR that generates an I2C bus speed that
         * is equal to or lower than the requested speed.
         */
-       for (i = 0; i < ARRAY_SIZE(mpc52xx_i2c_dividers); i++) {
+       for (i = 0; i < ARRAY_SIZE(mpc_i2c_dividers_52xx); i++) {
                div = &mpc_i2c_dividers_52xx[i];
                /* Old MPC5200 rev A CPUs do not support the high bits */
                if (div->fdr & 0xc0 && pvr == 0x80822011)
@@ -219,20 +219,23 @@ static void mpc_i2c_setclock_52xx(struct device_node *node,
                                  struct mpc_i2c *i2c,
                                  u32 clock, u32 prescaler)
 {
-       int fdr = mpc52xx_i2c_get_fdr(node, clock, prescaler);
+       int ret, fdr;
+
+       ret = mpc_i2c_get_fdr_52xx(node, clock, prescaler);
+       fdr = (ret >= 0) ? ret : 0x3f; /* backward compatibility */
 
-       if (fdr < 0)
-               fdr = 0x3f; /* backward compatibility */
        writeb(fdr & 0xff, i2c->base + MPC_I2C_FDR);
-       dev_info(i2c->dev, "clock %d Hz (fdr=%d)\n", clock, fdr);
+
+       if (ret >= 0)
+               dev_info(i2c->dev, "clock %d Hz (fdr=%d)\n", clock, fdr);
 }
-#else /* !CONFIG_PPC_52xx */
+#else /* !CONFIG_PPC_MPC52xx */
 static void mpc_i2c_setclock_52xx(struct device_node *node,
                                  struct mpc_i2c *i2c,
                                  u32 clock, u32 prescaler)
 {
 }
-#endif /* CONFIG_PPC_52xx*/
+#endif /* CONFIG_PPC_MPC52xx*/
 
 #ifdef CONFIG_FSL_SOC
 static const struct mpc_i2c_divider mpc_i2c_dividers_8xxx[] = {
@@ -321,14 +324,17 @@ static void mpc_i2c_setclock_8xxx(struct device_node *node,
                                  struct mpc_i2c *i2c,
                                  u32 clock, u32 prescaler)
 {
-       int fdr = mpc_i2c_get_fdr_8xxx(node, clock, prescaler);
+       int ret, fdr;
+
+       ret = mpc_i2c_get_fdr_8xxx(node, clock, prescaler);
+       fdr = (ret >= 0) ? ret : 0x1031; /* backward compatibility */
 
-       if (fdr < 0)
-               fdr = 0x1031; /* backward compatibility */
        writeb(fdr & 0xff, i2c->base + MPC_I2C_FDR);
        writeb((fdr >> 8) & 0xff, i2c->base + MPC_I2C_DFSRR);
-       dev_info(i2c->dev, "clock %d Hz (dfsrr=%d fdr=%d)\n",
-                clock, fdr >> 8, fdr & 0xff);
+
+       if (ret >= 0)
+               dev_info(i2c->dev, "clock %d Hz (dfsrr=%d fdr=%d)\n",
+                        clock, fdr >> 8, fdr & 0xff);
 }
 
 #else /* !CONFIG_FSL_SOC */
index c1405c8..acc7143 100644 (file)
@@ -265,10 +265,10 @@ static int i2c_pxa_wait_bus_not_busy(struct pxa_i2c *i2c)
                show_state(i2c);
        }
 
-       if (timeout <= 0)
+       if (timeout < 0)
                show_state(i2c);
 
-       return timeout <= 0 ? I2C_RETRY : 0;
+       return timeout < 0 ? I2C_RETRY : 0;
 }
 
 static int i2c_pxa_wait_master(struct pxa_i2c *i2c)
@@ -612,7 +612,7 @@ static int i2c_pxa_pio_set_master(struct pxa_i2c *i2c)
                show_state(i2c);
        }
 
-       if (timeout <= 0) {
+       if (timeout < 0) {
                show_state(i2c);
                dev_err(&i2c->adap.dev,
                        "i2c_pxa: timeout waiting for bus free\n");
index 8d71086..62f9cf2 100644 (file)
@@ -410,6 +410,7 @@ int cxio_flush_sq(struct t3_wq *wq, struct t3_cq *cq, int count)
        ptr = wq->sq_rptr + count;
        sqp = wq->sq + Q_PTR2IDX(ptr, wq->sq_size_log2);
        while (ptr != wq->sq_wptr) {
+               sqp->signaled = 0;
                insert_sq_cqe(wq, cq, sqp);
                ptr++;
                sqp = wq->sq + Q_PTR2IDX(ptr, wq->sq_size_log2);
index 9974e88..8a7dd67 100644 (file)
@@ -86,6 +86,7 @@ struct mlx4_ib_mr {
 
 struct mlx4_ib_fast_reg_page_list {
        struct ib_fast_reg_page_list    ibfrpl;
+       __be64                         *mapped_page_list;
        dma_addr_t                      map;
 };
 
index 8e4d26d..8f3666b 100644 (file)
@@ -231,7 +231,11 @@ struct ib_fast_reg_page_list *mlx4_ib_alloc_fast_reg_page_list(struct ib_device
        if (!mfrpl)
                return ERR_PTR(-ENOMEM);
 
-       mfrpl->ibfrpl.page_list = dma_alloc_coherent(&dev->dev->pdev->dev,
+       mfrpl->ibfrpl.page_list = kmalloc(size, GFP_KERNEL);
+       if (!mfrpl->ibfrpl.page_list)
+               goto err_free;
+
+       mfrpl->mapped_page_list = dma_alloc_coherent(&dev->dev->pdev->dev,
                                                     size, &mfrpl->map,
                                                     GFP_KERNEL);
        if (!mfrpl->ibfrpl.page_list)
@@ -242,6 +246,7 @@ struct ib_fast_reg_page_list *mlx4_ib_alloc_fast_reg_page_list(struct ib_device
        return &mfrpl->ibfrpl;
 
 err_free:
+       kfree(mfrpl->ibfrpl.page_list);
        kfree(mfrpl);
        return ERR_PTR(-ENOMEM);
 }
@@ -252,8 +257,9 @@ void mlx4_ib_free_fast_reg_page_list(struct ib_fast_reg_page_list *page_list)
        struct mlx4_ib_fast_reg_page_list *mfrpl = to_mfrpl(page_list);
        int size = page_list->max_page_list_len * sizeof (u64);
 
-       dma_free_coherent(&dev->dev->pdev->dev, size, page_list->page_list,
+       dma_free_coherent(&dev->dev->pdev->dev, size, mfrpl->mapped_page_list,
                          mfrpl->map);
+       kfree(mfrpl->ibfrpl.page_list);
        kfree(mfrpl);
 }
 
index f385a24..20724ae 100644 (file)
@@ -1365,7 +1365,7 @@ static void set_fmr_seg(struct mlx4_wqe_fmr_seg *fseg, struct ib_send_wr *wr)
        int i;
 
        for (i = 0; i < wr->wr.fast_reg.page_list_len; ++i)
-               wr->wr.fast_reg.page_list->page_list[i] =
+               mfrpl->mapped_page_list[i] =
                        cpu_to_be64(wr->wr.fast_reg.page_list->page_list[i] |
                                    MLX4_MTT_FLAG_PRESENT);
 
index bc4e40f..2d1415e 100644 (file)
@@ -226,7 +226,7 @@ static int get_compatible_type(struct ff_device *ff, int effect_type)
  */
 static void ml_combine_effects(struct ff_effect *effect,
                               struct ml_effect_state *state,
-                              int gain)
+                              unsigned int gain)
 {
        struct ff_effect *new = state->effect;
        unsigned int strong, weak, i;
index 4224f01..012a5e7 100644 (file)
@@ -843,7 +843,13 @@ static const struct input_device_id joydev_blacklist[] = {
                                INPUT_DEVICE_ID_MATCH_KEYBIT,
                .evbit = { BIT_MASK(EV_KEY) },
                .keybit = { [BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH) },
-       },      /* Avoid itouchpads, touchscreens and tablets */
+       },      /* Avoid itouchpads and touchscreens */
+       {
+               .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
+                               INPUT_DEVICE_ID_MATCH_KEYBIT,
+               .evbit = { BIT_MASK(EV_KEY) },
+               .keybit = { [BIT_WORD(BTN_DIGI)] = BIT_MASK(BTN_DIGI) },
+       },      /* Avoid tablets, digitisers and similar devices */
        { }     /* Terminating entry */
 };
 
index 444dec0..df3f8aa 100644 (file)
@@ -895,6 +895,13 @@ static unsigned int atkbd_amilo_pa1510_forced_release_keys[] = {
 };
 
 /*
+ * Amilo Xi 3650 key release for light touch bar not working
+ */
+static unsigned int atkbd_amilo_xi3650_forced_release_keys[] = {
+       0x67, 0xed, 0x90, 0xa2, 0x99, 0xa4, 0xae, 0xb0, -1U
+};
+
+/*
  * atkbd_set_keycode_table() initializes keyboard's keycode table
  * according to the selected scancode set
  */
@@ -1560,6 +1567,15 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = {
                .callback = atkbd_setup_forced_release,
                .driver_data = atkbd_amilo_pa1510_forced_release_keys,
        },
+       {
+               .ident = "Fujitsu Amilo Xi 3650",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xi 3650"),
+               },
+               .callback = atkbd_setup_forced_release,
+               .driver_data = atkbd_amilo_xi3650_forced_release_keys,
+       },
        { }
 };
 
index 536668f..948e167 100644 (file)
@@ -200,8 +200,9 @@ static int tsc2007_read_values(struct tsc2007 *tsc)
 static enum hrtimer_restart tsc2007_timer(struct hrtimer *handle)
 {
        struct tsc2007 *ts = container_of(handle, struct tsc2007, timer);
+       unsigned long flags;
 
-       spin_lock_irq(&ts->lock);
+       spin_lock_irqsave(&ts->lock, flags);
 
        if (unlikely(!ts->get_pendown_state() && ts->pendown)) {
                struct input_dev *input = ts->input;
@@ -222,7 +223,7 @@ static enum hrtimer_restart tsc2007_timer(struct hrtimer *handle)
                tsc2007_send_event(ts);
        }
 
-       spin_unlock_irq(&ts->lock);
+       spin_unlock_irqrestore(&ts->lock, flags);
 
        return HRTIMER_NORESTART;
 }
index 7942c4d..9ee873e 100644 (file)
@@ -951,7 +951,6 @@ static int mlx4_en_config_rss_qp(struct mlx4_en_priv *priv,
        if (err) {
                mlx4_err(mdev, "Failed to allocate qp #%d\n", qpn);
                goto out;
-               return err;
        }
        qp->event = mlx4_en_sqp_event;
 
index a6341e4..9c8c70c 100644 (file)
@@ -495,9 +495,7 @@ static int twl4030_rtc_suspend(struct platform_device *pdev, pm_message_t state)
 {
        irqstat = rtc_irq_bits;
 
-       /* REVISIT alarm may need to wake us from sleep */
-       mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M |
-                        BIT_RTC_INTERRUPTS_REG_IT_ALARM_M);
+       mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M);
        return 0;
 }
 
index 885194a..3f3c08c 100644 (file)
@@ -1373,6 +1373,9 @@ static void cleanup(struct spi_device *spi)
 {
        struct chip_data *chip = spi_get_ctldata(spi);
 
+       if (!chip)
+               return;
+
        if (gpio_is_valid(chip->gpio_cs))
                gpio_free(chip->gpio_cs);
 
index 7826bdc..0048f11 100644 (file)
@@ -1128,13 +1128,6 @@ config FB_INTEL
           830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM chipsets.
           Say Y if you have and plan to use such a board.
 
-         If you say Y here and want DDC/I2C support you must first say Y to
-         "I2C support" and "I2C bit-banging support" in the character devices
-         section.
-
-         If you say M here then "I2C support" and "I2C bit-banging support"
-         can be build either as modules or built-in.
-
          To compile this driver as a module, choose M here: the
          module will be called intelfb.
 
@@ -1207,11 +1200,10 @@ config FB_MATROX_G
          pixel and 32 bpp packed pixel. You can also use font widths
          different from 8.
 
-         If you need support for G400 secondary head, you must first say Y to
-         "I2C support" in the character devices section, and then to
-         "Matrox I2C support" and "G400 second head support" here in the
-         framebuffer section. G450/G550 secondary head and digital output
-         are supported without additional modules.
+         If you need support for G400 secondary head, you must say Y to
+         "Matrox I2C support" and "G400 second head support" right below.
+         G450/G550 secondary head and digital output are supported without
+         additional modules.
 
          The driver starts in monitor mode. You must use the matroxset tool 
          (available at <ftp://platan.vc.cvut.cz/pub/linux/matrox-latest/>) to 
@@ -1310,13 +1302,6 @@ config FB_RADEON
          a framebuffer device.  There are both PCI and AGP versions.  You
          don't need to choose this to run the Radeon in plain VGA mode.
 
-         If you say Y here and want DDC/I2C support you must first say Y to
-         "I2C support" and "I2C bit-banging support" in the character devices
-         section.
-
-         If you say M here then "I2C support" and "I2C bit-banging support" 
-         can be build either as modules or built-in.
-
          There is a product page at
          http://apps.ati.com/ATIcompare/
 
index e327b84..a0fec29 100644 (file)
@@ -2103,7 +2103,7 @@ static void viafb_remove_proc(struct proc_dir_entry *viafb_entry)
 
 static int __devinit via_pci_probe(void)
 {
-       unsigned int default_xres, default_yres;
+       unsigned long default_xres, default_yres;
        char *tmpc, *tmpm;
        char *tmpc_sec, *tmpm_sec;
        int vmode_index;
@@ -2196,8 +2196,8 @@ static int __devinit via_pci_probe(void)
        viafb_FB_MM = viaparinfo->fbmem_virt;
        tmpm = viafb_mode;
        tmpc = strsep(&tmpm, "x");
-       strict_strtoul(tmpc, 0, (unsigned long *)&default_xres);
-       strict_strtoul(tmpm, 0, (unsigned long *)&default_yres);
+       strict_strtoul(tmpc, 0, &default_xres);
+       strict_strtoul(tmpm, 0, &default_yres);
 
        vmode_index = viafb_get_mode_index(default_xres, default_yres, 0);
        DEBUG_MSG(KERN_INFO "0->index=%d\n", vmode_index);
index a89f370..5458e80 100644 (file)
@@ -1212,7 +1212,7 @@ SYSCALL_DEFINE1(epoll_create1, int, flags)
 
 SYSCALL_DEFINE1(epoll_create, int, size)
 {
-       if (size < 0)
+       if (size <= 0)
                return -EINVAL;
 
        return sys_epoll_create1(0);
index d1bc4d3..91f7c85 100644 (file)
@@ -911,6 +911,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
  err_put_root:
        dput(root_dentry);
  err_put_conn:
+       bdi_destroy(&fc->bdi);
        fuse_conn_put(fc);
  err_fput:
        fput(file);
index 153d968..c1462d4 100644 (file)
@@ -312,16 +312,6 @@ out:
        return retval;
 }
 
-/*
- * Read a page. Again trivial. If it didn't already exist
- * in the page cache, it is zero-filled.
- */
-static int hugetlbfs_readpage(struct file *file, struct page * page)
-{
-       unlock_page(page);
-       return -EINVAL;
-}
-
 static int hugetlbfs_write_begin(struct file *file,
                        struct address_space *mapping,
                        loff_t pos, unsigned len, unsigned flags,
@@ -701,7 +691,6 @@ static void hugetlbfs_destroy_inode(struct inode *inode)
 }
 
 static const struct address_space_operations hugetlbfs_aops = {
-       .readpage       = hugetlbfs_readpage,
        .write_begin    = hugetlbfs_write_begin,
        .write_end      = hugetlbfs_write_end,
        .set_page_dirty = hugetlbfs_set_page_dirty,
index abf8388..1a54ae1 100644 (file)
@@ -104,6 +104,16 @@ static void set_grace_period(void)
        schedule_delayed_work(&grace_period_end, grace_period);
 }
 
+static void restart_grace(void)
+{
+       if (nlmsvc_ops) {
+               cancel_delayed_work_sync(&grace_period_end);
+               locks_end_grace(&lockd_manager);
+               nlmsvc_invalidate_all();
+               set_grace_period();
+       }
+}
+
 /*
  * This is the lockd kernel thread
  */
@@ -149,10 +159,7 @@ lockd(void *vrqstp)
 
                if (signalled()) {
                        flush_signals(current);
-                       if (nlmsvc_ops) {
-                               nlmsvc_invalidate_all();
-                               set_grace_period();
-                       }
+                       restart_grace();
                        continue;
                }
 
index 5275097..b534840 100644 (file)
@@ -229,7 +229,7 @@ nfsd4_list_rec_dir(struct dentry *dir, recdir_func *f)
                goto out;
        status = vfs_readdir(filp, nfsd4_build_namelist, &names);
        fput(filp);
-       mutex_lock(&dir->d_inode->i_mutex);
+       mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
        while (!list_empty(&names)) {
                entry = list_entry(names.next, struct name_list, list);
 
@@ -264,7 +264,7 @@ nfsd4_unlink_clid_dir(char *name, int namlen)
 
        dprintk("NFSD: nfsd4_unlink_clid_dir. name %.*s\n", namlen, name);
 
-       mutex_lock(&rec_dir.dentry->d_inode->i_mutex);
+       mutex_lock_nested(&rec_dir.dentry->d_inode->i_mutex, I_MUTEX_PARENT);
        dentry = lookup_one_len(name, rec_dir.dentry, namlen);
        if (IS_ERR(dentry)) {
                status = PTR_ERR(dentry);
index c65a27b..3b711f5 100644 (file)
@@ -580,7 +580,6 @@ free_session(struct kref *kref)
                struct nfsd4_cache_entry *e = &ses->se_slots[i].sl_cache_entry;
                nfsd4_release_respages(e->ce_respages, e->ce_resused);
        }
-       kfree(ses->se_slots);
        kfree(ses);
 }
 
index b820c31..b73549d 100644 (file)
@@ -2214,6 +2214,15 @@ nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd,
        dentry = lookup_one_len(name, cd->rd_fhp->fh_dentry, namlen);
        if (IS_ERR(dentry))
                return nfserrno(PTR_ERR(dentry));
+       if (!dentry->d_inode) {
+               /*
+                * nfsd_buffered_readdir drops the i_mutex between
+                * readdir and calling this callback, leaving a window
+                * where this directory entry could have gone away.
+                */
+               dput(dentry);
+               return nfserr_noent;
+       }
 
        exp_get(exp);
        /*
@@ -2276,6 +2285,7 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen,
        struct nfsd4_readdir *cd = container_of(ccd, struct nfsd4_readdir, common);
        int buflen;
        __be32 *p = cd->buffer;
+       __be32 *cookiep;
        __be32 nfserr = nfserr_toosmall;
 
        /* In nfsv4, "." and ".." never make it onto the wire.. */
@@ -2292,7 +2302,7 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen,
                goto fail;
 
        *p++ = xdr_one;                             /* mark entry present */
-       cd->offset = p;                             /* remember pointer */
+       cookiep = p;
        p = xdr_encode_hyper(p, NFS_OFFSET_MAX);    /* offset of next entry */
        p = xdr_encode_array(p, name, namlen);      /* name length & name */
 
@@ -2306,6 +2316,8 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen,
                goto fail;
        case nfserr_dropit:
                goto fail;
+       case nfserr_noent:
+               goto skip_entry;
        default:
                /*
                 * If the client requested the RDATTR_ERROR attribute,
@@ -2324,6 +2336,8 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen,
        }
        cd->buflen -= (p - cd->buffer);
        cd->buffer = p;
+       cd->offset = cookiep;
+skip_entry:
        cd->common.err = nfs_ok;
        return 0;
 fail:
index 108d281..50ff3f2 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/smp_lock.h>    /* lock_kernel(), unlock_kernel() */
 #include <linux/capability.h>  /* capable() */
 #include <linux/uaccess.h>     /* copy_from_user(), copy_to_user() */
+#include <linux/vmalloc.h>
 #include <linux/nilfs2_fs.h>
 #include "nilfs.h"
 #include "segment.h"
@@ -147,29 +148,12 @@ static ssize_t
 nilfs_ioctl_do_get_cpinfo(struct the_nilfs *nilfs, __u64 *posp, int flags,
                          void *buf, size_t size, size_t nmembs)
 {
-       return nilfs_cpfile_get_cpinfo(nilfs->ns_cpfile, posp, flags, buf,
-                                      nmembs);
-}
-
-static int nilfs_ioctl_get_cpinfo(struct inode *inode, struct file *filp,
-                                 unsigned int cmd, void __user *argp)
-{
-       struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs;
-       struct nilfs_argv argv;
        int ret;
 
-       if (copy_from_user(&argv, argp, sizeof(argv)))
-               return -EFAULT;
-
        down_read(&nilfs->ns_segctor_sem);
-       ret = nilfs_ioctl_wrap_copy(nilfs, &argv, _IOC_DIR(cmd),
-                                   nilfs_ioctl_do_get_cpinfo);
+       ret = nilfs_cpfile_get_cpinfo(nilfs->ns_cpfile, posp, flags, buf,
+                                     nmembs);
        up_read(&nilfs->ns_segctor_sem);
-       if (ret < 0)
-               return ret;
-
-       if (copy_to_user(argp, &argv, sizeof(argv)))
-               ret = -EFAULT;
        return ret;
 }
 
@@ -195,28 +179,11 @@ static ssize_t
 nilfs_ioctl_do_get_suinfo(struct the_nilfs *nilfs, __u64 *posp, int flags,
                          void *buf, size_t size, size_t nmembs)
 {
-       return nilfs_sufile_get_suinfo(nilfs->ns_sufile, *posp, buf, nmembs);
-}
-
-static int nilfs_ioctl_get_suinfo(struct inode *inode, struct file *filp,
-                                 unsigned int cmd, void __user *argp)
-{
-       struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs;
-       struct nilfs_argv argv;
        int ret;
 
-       if (copy_from_user(&argv, argp, sizeof(argv)))
-               return -EFAULT;
-
        down_read(&nilfs->ns_segctor_sem);
-       ret = nilfs_ioctl_wrap_copy(nilfs, &argv, _IOC_DIR(cmd),
-                                   nilfs_ioctl_do_get_suinfo);
+       ret = nilfs_sufile_get_suinfo(nilfs->ns_sufile, *posp, buf, nmembs);
        up_read(&nilfs->ns_segctor_sem);
-       if (ret < 0)
-               return ret;
-
-       if (copy_to_user(argp, &argv, sizeof(argv)))
-               ret = -EFAULT;
        return ret;
 }
 
@@ -242,28 +209,11 @@ static ssize_t
 nilfs_ioctl_do_get_vinfo(struct the_nilfs *nilfs, __u64 *posp, int flags,
                         void *buf, size_t size, size_t nmembs)
 {
-       return nilfs_dat_get_vinfo(nilfs_dat_inode(nilfs), buf, nmembs);
-}
-
-static int nilfs_ioctl_get_vinfo(struct inode *inode, struct file *filp,
-                                unsigned int cmd, void __user *argp)
-{
-       struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs;
-       struct nilfs_argv argv;
        int ret;
 
-       if (copy_from_user(&argv, argp, sizeof(argv)))
-               return -EFAULT;
-
        down_read(&nilfs->ns_segctor_sem);
-       ret = nilfs_ioctl_wrap_copy(nilfs, &argv, _IOC_DIR(cmd),
-                                   nilfs_ioctl_do_get_vinfo);
+       ret = nilfs_dat_get_vinfo(nilfs_dat_inode(nilfs), buf, nmembs);
        up_read(&nilfs->ns_segctor_sem);
-       if (ret < 0)
-               return ret;
-
-       if (copy_to_user(argp, &argv, sizeof(argv)))
-               ret = -EFAULT;
        return ret;
 }
 
@@ -276,17 +226,21 @@ nilfs_ioctl_do_get_bdescs(struct the_nilfs *nilfs, __u64 *posp, int flags,
        struct nilfs_bdesc *bdescs = buf;
        int ret, i;
 
+       down_read(&nilfs->ns_segctor_sem);
        for (i = 0; i < nmembs; i++) {
                ret = nilfs_bmap_lookup_at_level(bmap,
                                                 bdescs[i].bd_offset,
                                                 bdescs[i].bd_level + 1,
                                                 &bdescs[i].bd_blocknr);
                if (ret < 0) {
-                       if (ret != -ENOENT)
+                       if (ret != -ENOENT) {
+                               up_read(&nilfs->ns_segctor_sem);
                                return ret;
+                       }
                        bdescs[i].bd_blocknr = 0;
                }
        }
+       up_read(&nilfs->ns_segctor_sem);
        return nmembs;
 }
 
@@ -300,10 +254,11 @@ static int nilfs_ioctl_get_bdescs(struct inode *inode, struct file *filp,
        if (copy_from_user(&argv, argp, sizeof(argv)))
                return -EFAULT;
 
-       down_read(&nilfs->ns_segctor_sem);
+       if (argv.v_size != sizeof(struct nilfs_bdesc))
+               return -EINVAL;
+
        ret = nilfs_ioctl_wrap_copy(nilfs, &argv, _IOC_DIR(cmd),
                                    nilfs_ioctl_do_get_bdescs);
-       up_read(&nilfs->ns_segctor_sem);
        if (ret < 0)
                return ret;
 
@@ -346,10 +301,10 @@ static int nilfs_ioctl_move_inode_block(struct inode *inode,
        return 0;
 }
 
-static ssize_t
-nilfs_ioctl_do_move_blocks(struct the_nilfs *nilfs, __u64 *posp, int flags,
-                          void *buf, size_t size, size_t nmembs)
+static int nilfs_ioctl_move_blocks(struct the_nilfs *nilfs,
+                                  struct nilfs_argv *argv, void *buf)
 {
+       size_t nmembs = argv->v_nmembs;
        struct inode *inode;
        struct nilfs_vdesc *vdesc;
        struct buffer_head *bh, *n;
@@ -410,19 +365,10 @@ nilfs_ioctl_do_move_blocks(struct the_nilfs *nilfs, __u64 *posp, int flags,
        return ret;
 }
 
-static inline int nilfs_ioctl_move_blocks(struct the_nilfs *nilfs,
-                                         struct nilfs_argv *argv,
-                                         int dir)
-{
-       return nilfs_ioctl_wrap_copy(nilfs, argv, dir,
-                                    nilfs_ioctl_do_move_blocks);
-}
-
-static ssize_t
-nilfs_ioctl_do_delete_checkpoints(struct the_nilfs *nilfs, __u64 *posp,
-                                 int flags, void *buf, size_t size,
-                                 size_t nmembs)
+static int nilfs_ioctl_delete_checkpoints(struct the_nilfs *nilfs,
+                                         struct nilfs_argv *argv, void *buf)
 {
+       size_t nmembs = argv->v_nmembs;
        struct inode *cpfile = nilfs->ns_cpfile;
        struct nilfs_period *periods = buf;
        int ret, i;
@@ -436,36 +382,21 @@ nilfs_ioctl_do_delete_checkpoints(struct the_nilfs *nilfs, __u64 *posp,
        return nmembs;
 }
 
-static inline int nilfs_ioctl_delete_checkpoints(struct the_nilfs *nilfs,
-                                                struct nilfs_argv *argv,
-                                                int dir)
+static int nilfs_ioctl_free_vblocknrs(struct the_nilfs *nilfs,
+                                     struct nilfs_argv *argv, void *buf)
 {
-       return nilfs_ioctl_wrap_copy(nilfs, argv, dir,
-                                    nilfs_ioctl_do_delete_checkpoints);
-}
+       size_t nmembs = argv->v_nmembs;
+       int ret;
 
-static ssize_t
-nilfs_ioctl_do_free_vblocknrs(struct the_nilfs *nilfs, __u64 *posp, int flags,
-                             void *buf, size_t size, size_t nmembs)
-{
-       int ret = nilfs_dat_freev(nilfs_dat_inode(nilfs), buf, nmembs);
+       ret = nilfs_dat_freev(nilfs_dat_inode(nilfs), buf, nmembs);
 
        return (ret < 0) ? ret : nmembs;
 }
 
-static inline int nilfs_ioctl_free_vblocknrs(struct the_nilfs *nilfs,
-                                            struct nilfs_argv *argv,
-                                            int dir)
-{
-       return nilfs_ioctl_wrap_copy(nilfs, argv, dir,
-                                    nilfs_ioctl_do_free_vblocknrs);
-}
-
-static ssize_t
-nilfs_ioctl_do_mark_blocks_dirty(struct the_nilfs *nilfs, __u64 *posp,
-                                int flags, void *buf, size_t size,
-                                size_t nmembs)
+static int nilfs_ioctl_mark_blocks_dirty(struct the_nilfs *nilfs,
+                                        struct nilfs_argv *argv, void *buf)
 {
+       size_t nmembs = argv->v_nmembs;
        struct inode *dat = nilfs_dat_inode(nilfs);
        struct nilfs_bmap *bmap = NILFS_I(dat)->i_bmap;
        struct nilfs_bdesc *bdescs = buf;
@@ -504,55 +435,37 @@ nilfs_ioctl_do_mark_blocks_dirty(struct the_nilfs *nilfs, __u64 *posp,
        return nmembs;
 }
 
-static inline int nilfs_ioctl_mark_blocks_dirty(struct the_nilfs *nilfs,
-                                               struct nilfs_argv *argv,
-                                               int dir)
+static int nilfs_ioctl_free_segments(struct the_nilfs *nilfs,
+                                    struct nilfs_argv *argv, void *buf)
 {
-       return nilfs_ioctl_wrap_copy(nilfs, argv, dir,
-                                    nilfs_ioctl_do_mark_blocks_dirty);
-}
-
-static ssize_t
-nilfs_ioctl_do_free_segments(struct the_nilfs *nilfs, __u64 *posp, int flags,
-                            void *buf, size_t size, size_t nmembs)
-{
-       struct nilfs_sb_info *sbi = nilfs_get_writer(nilfs);
+       size_t nmembs = argv->v_nmembs;
+       struct nilfs_sb_info *sbi = nilfs->ns_writer;
        int ret;
 
-       if (unlikely(!sbi))
+       if (unlikely(!sbi)) {
+               /* never happens because called for a writable mount */
+               WARN_ON(1);
                return -EROFS;
+       }
        ret = nilfs_segctor_add_segments_to_be_freed(
                NILFS_SC(sbi), buf, nmembs);
-       nilfs_put_writer(nilfs);
 
        return (ret < 0) ? ret : nmembs;
 }
 
-static inline int nilfs_ioctl_free_segments(struct the_nilfs *nilfs,
-                                            struct nilfs_argv *argv,
-                                            int dir)
-{
-       return nilfs_ioctl_wrap_copy(nilfs, argv, dir,
-                                    nilfs_ioctl_do_free_segments);
-}
-
 int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *nilfs,
-                                      void __user *argp)
+                                      struct nilfs_argv *argv, void **kbufs)
 {
-       struct nilfs_argv argv[5];
        const char *msg;
-       int dir, ret;
-
-       if (copy_from_user(argv, argp, sizeof(argv)))
-               return -EFAULT;
+       int ret;
 
-       dir = _IOC_WRITE;
-       ret = nilfs_ioctl_move_blocks(nilfs, &argv[0], dir);
+       ret = nilfs_ioctl_move_blocks(nilfs, &argv[0], kbufs[0]);
        if (ret < 0) {
                msg = "cannot read source blocks";
                goto failed;
        }
-       ret = nilfs_ioctl_delete_checkpoints(nilfs, &argv[1], dir);
+
+       ret = nilfs_ioctl_delete_checkpoints(nilfs, &argv[1], kbufs[1]);
        if (ret < 0) {
                /*
                 * can safely abort because checkpoints can be removed
@@ -561,7 +474,7 @@ int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *nilfs,
                msg = "cannot delete checkpoints";
                goto failed;
        }
-       ret = nilfs_ioctl_free_vblocknrs(nilfs, &argv[2], dir);
+       ret = nilfs_ioctl_free_vblocknrs(nilfs, &argv[2], kbufs[2]);
        if (ret < 0) {
                /*
                 * can safely abort because DAT file is updated atomically
@@ -570,7 +483,7 @@ int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *nilfs,
                msg = "cannot delete virtual blocks from DAT file";
                goto failed;
        }
-       ret = nilfs_ioctl_mark_blocks_dirty(nilfs, &argv[3], dir);
+       ret = nilfs_ioctl_mark_blocks_dirty(nilfs, &argv[3], kbufs[3]);
        if (ret < 0) {
                /*
                 * can safely abort because the operation is nondestructive.
@@ -578,7 +491,7 @@ int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *nilfs,
                msg = "cannot mark copying blocks dirty";
                goto failed;
        }
-       ret = nilfs_ioctl_free_segments(nilfs, &argv[4], dir);
+       ret = nilfs_ioctl_free_segments(nilfs, &argv[4], kbufs[4]);
        if (ret < 0) {
                /*
                 * can safely abort because this operation is atomic.
@@ -598,9 +511,75 @@ int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *nilfs,
 static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp,
                                      unsigned int cmd, void __user *argp)
 {
+       struct nilfs_argv argv[5];
+       const static size_t argsz[5] = {
+               sizeof(struct nilfs_vdesc),
+               sizeof(struct nilfs_period),
+               sizeof(__u64),
+               sizeof(struct nilfs_bdesc),
+               sizeof(__u64),
+       };
+       void __user *base;
+       void *kbufs[5];
+       struct the_nilfs *nilfs;
+       size_t len, nsegs;
+       int n, ret;
+
        if (!capable(CAP_SYS_ADMIN))
                return -EPERM;
-       return nilfs_clean_segments(inode->i_sb, argp);
+
+       if (copy_from_user(argv, argp, sizeof(argv)))
+               return -EFAULT;
+
+       nsegs = argv[4].v_nmembs;
+       if (argv[4].v_size != argsz[4])
+               return -EINVAL;
+       /*
+        * argv[4] points to segment numbers this ioctl cleans.  We
+        * use kmalloc() for its buffer because memory used for the
+        * segment numbers is enough small.
+        */
+       kbufs[4] = memdup_user((void __user *)(unsigned long)argv[4].v_base,
+                              nsegs * sizeof(__u64));
+       if (IS_ERR(kbufs[4]))
+               return PTR_ERR(kbufs[4]);
+
+       nilfs = NILFS_SB(inode->i_sb)->s_nilfs;
+
+       for (n = 0; n < 4; n++) {
+               ret = -EINVAL;
+               if (argv[n].v_size != argsz[n])
+                       goto out_free;
+
+               if (argv[n].v_nmembs > nsegs * nilfs->ns_blocks_per_segment)
+                       goto out_free;
+
+               len = argv[n].v_size * argv[n].v_nmembs;
+               base = (void __user *)(unsigned long)argv[n].v_base;
+               if (len == 0) {
+                       kbufs[n] = NULL;
+                       continue;
+               }
+
+               kbufs[n] = vmalloc(len);
+               if (!kbufs[n]) {
+                       ret = -ENOMEM;
+                       goto out_free;
+               }
+               if (copy_from_user(kbufs[n], base, len)) {
+                       ret = -EFAULT;
+                       vfree(kbufs[n]);
+                       goto out_free;
+               }
+       }
+
+       ret = nilfs_clean_segments(inode->i_sb, argv, kbufs);
+
+ out_free:
+       while (--n > 0)
+               vfree(kbufs[n]);
+       kfree(kbufs[4]);
+       return ret;
 }
 
 static int nilfs_ioctl_sync(struct inode *inode, struct file *filp,
@@ -621,6 +600,33 @@ static int nilfs_ioctl_sync(struct inode *inode, struct file *filp,
        return 0;
 }
 
+static int nilfs_ioctl_get_info(struct inode *inode, struct file *filp,
+                               unsigned int cmd, void __user *argp,
+                               size_t membsz,
+                               ssize_t (*dofunc)(struct the_nilfs *,
+                                                 __u64 *, int,
+                                                 void *, size_t, size_t))
+
+{
+       struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs;
+       struct nilfs_argv argv;
+       int ret;
+
+       if (copy_from_user(&argv, argp, sizeof(argv)))
+               return -EFAULT;
+
+       if (argv.v_size != membsz)
+               return -EINVAL;
+
+       ret = nilfs_ioctl_wrap_copy(nilfs, &argv, _IOC_DIR(cmd), dofunc);
+       if (ret < 0)
+               return ret;
+
+       if (copy_to_user(argp, &argv, sizeof(argv)))
+               ret = -EFAULT;
+       return ret;
+}
+
 long nilfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 {
        struct inode *inode = filp->f_dentry->d_inode;
@@ -632,16 +638,21 @@ long nilfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
        case NILFS_IOCTL_DELETE_CHECKPOINT:
                return nilfs_ioctl_delete_checkpoint(inode, filp, cmd, argp);
        case NILFS_IOCTL_GET_CPINFO:
-               return nilfs_ioctl_get_cpinfo(inode, filp, cmd, argp);
+               return nilfs_ioctl_get_info(inode, filp, cmd, argp,
+                                           sizeof(struct nilfs_cpinfo),
+                                           nilfs_ioctl_do_get_cpinfo);
        case NILFS_IOCTL_GET_CPSTAT:
                return nilfs_ioctl_get_cpstat(inode, filp, cmd, argp);
        case NILFS_IOCTL_GET_SUINFO:
-               return nilfs_ioctl_get_suinfo(inode, filp, cmd, argp);
+               return nilfs_ioctl_get_info(inode, filp, cmd, argp,
+                                           sizeof(struct nilfs_suinfo),
+                                           nilfs_ioctl_do_get_suinfo);
        case NILFS_IOCTL_GET_SUSTAT:
                return nilfs_ioctl_get_sustat(inode, filp, cmd, argp);
        case NILFS_IOCTL_GET_VINFO:
-               /* XXX: rename to ??? */
-               return nilfs_ioctl_get_vinfo(inode, filp, cmd, argp);
+               return nilfs_ioctl_get_info(inode, filp, cmd, argp,
+                                           sizeof(struct nilfs_vinfo),
+                                           nilfs_ioctl_do_get_vinfo);
        case NILFS_IOCTL_GET_BDESCS:
                return nilfs_ioctl_get_bdescs(inode, filp, cmd, argp);
        case NILFS_IOCTL_CLEAN_SEGMENTS:
index 47dd815..bb78745 100644 (file)
@@ -77,19 +77,22 @@ static int nilfs_mdt_create_block(struct inode *inode, unsigned long block,
                                                     void *))
 {
        struct the_nilfs *nilfs = NILFS_MDT(inode)->mi_nilfs;
-       struct nilfs_sb_info *writer = NULL;
        struct super_block *sb = inode->i_sb;
        struct nilfs_transaction_info ti;
        struct buffer_head *bh;
        int err;
 
        if (!sb) {
-               writer = nilfs_get_writer(nilfs);
-               if (!writer) {
+               /*
+                * Make sure this function is not called from any
+                * read-only context.
+                */
+               if (!nilfs->ns_writer) {
+                       WARN_ON(1);
                        err = -EROFS;
                        goto out;
                }
-               sb = writer->s_super;
+               sb = nilfs->ns_writer->s_super;
        }
 
        nilfs_transaction_begin(sb, &ti, 0);
@@ -127,8 +130,6 @@ static int nilfs_mdt_create_block(struct inode *inode, unsigned long block,
                err = nilfs_transaction_commit(sb);
        else
                nilfs_transaction_abort(sb);
-       if (writer)
-               nilfs_put_writer(nilfs);
  out:
        return err;
 }
@@ -299,7 +300,7 @@ int nilfs_mdt_delete_block(struct inode *inode, unsigned long block)
        int err;
 
        err = nilfs_bmap_delete(ii->i_bmap, block);
-       if (likely(!err)) {
+       if (!err || err == -ENOENT) {
                nilfs_mdt_mark_dirty(inode);
                nilfs_mdt_forget_block(inode, block);
        }
index 3d0c18a..da6fc0b 100644 (file)
@@ -236,7 +236,8 @@ extern int nilfs_sync_file(struct file *, struct dentry *, int);
 
 /* ioctl.c */
 long nilfs_ioctl(struct file *, unsigned int, unsigned long);
-int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *, void __user *);
+int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *, struct nilfs_argv *,
+                                      void **);
 
 /* inode.c */
 extern struct inode *nilfs_new_inode(struct inode *, int);
index 1bfbba9..a2692bb 100644 (file)
@@ -128,7 +128,8 @@ void nilfs_forget_buffer(struct buffer_head *bh)
 
        lock_buffer(bh);
        clear_buffer_nilfs_volatile(bh);
-       if (test_clear_buffer_dirty(bh) && nilfs_page_buffers_clean(page))
+       clear_buffer_dirty(bh);
+       if (nilfs_page_buffers_clean(page))
                __nilfs_clear_page_dirty(page);
 
        clear_buffer_uptodate(bh);
index 4fc081e..57afa9d 100644 (file)
@@ -407,6 +407,7 @@ void nilfs_dispose_segment_list(struct list_head *head)
 }
 
 static int nilfs_prepare_segment_for_recovery(struct the_nilfs *nilfs,
+                                             struct nilfs_sb_info *sbi,
                                              struct nilfs_recovery_info *ri)
 {
        struct list_head *head = &ri->ri_used_segments;
@@ -421,6 +422,7 @@ static int nilfs_prepare_segment_for_recovery(struct the_nilfs *nilfs,
        segnum[2] = ri->ri_segnum;
        segnum[3] = ri->ri_nextnum;
 
+       nilfs_attach_writer(nilfs, sbi);
        /*
         * Releasing the next segment of the latest super root.
         * The next segment is invalidated by this recovery.
@@ -459,10 +461,10 @@ static int nilfs_prepare_segment_for_recovery(struct the_nilfs *nilfs,
        nilfs->ns_pseg_offset = 0;
        nilfs->ns_seg_seq = ri->ri_seq + 2;
        nilfs->ns_nextnum = nilfs->ns_segnum = segnum[0];
-       return 0;
 
  failed:
        /* No need to recover sufile because it will be destroyed on error */
+       nilfs_detach_writer(nilfs, sbi);
        return err;
 }
 
@@ -728,7 +730,7 @@ int nilfs_recover_logical_segments(struct the_nilfs *nilfs,
                goto failed;
 
        if (ri->ri_need_recovery == NILFS_RECOVERY_ROLLFORWARD_DONE) {
-               err = nilfs_prepare_segment_for_recovery(nilfs, ri);
+               err = nilfs_prepare_segment_for_recovery(nilfs, sbi, ri);
                if (unlikely(err)) {
                        printk(KERN_ERR "NILFS: Error preparing segments for "
                               "recovery.\n");
index fb70ec3..22c7f65 100644 (file)
@@ -2589,7 +2589,8 @@ nilfs_remove_written_gcinodes(struct the_nilfs *nilfs, struct list_head *head)
        }
 }
 
-int nilfs_clean_segments(struct super_block *sb, void __user *argp)
+int nilfs_clean_segments(struct super_block *sb, struct nilfs_argv *argv,
+                        void **kbufs)
 {
        struct nilfs_sb_info *sbi = NILFS_SB(sb);
        struct nilfs_sc_info *sci = NILFS_SC(sbi);
@@ -2606,7 +2607,7 @@ int nilfs_clean_segments(struct super_block *sb, void __user *argp)
        err = nilfs_init_gcdat_inode(nilfs);
        if (unlikely(err))
                goto out_unlock;
-       err = nilfs_ioctl_prepare_clean_segments(nilfs, argp);
+       err = nilfs_ioctl_prepare_clean_segments(nilfs, argv, kbufs);
        if (unlikely(err))
                goto out_unlock;
 
index a98fc1e..476bdd5 100644 (file)
@@ -222,7 +222,8 @@ extern int nilfs_construct_segment(struct super_block *);
 extern int nilfs_construct_dsync_segment(struct super_block *, struct inode *,
                                         loff_t, loff_t);
 extern void nilfs_flush_segment(struct super_block *, ino_t);
-extern int nilfs_clean_segments(struct super_block *, void __user *);
+extern int nilfs_clean_segments(struct super_block *, struct nilfs_argv *,
+                               void **);
 
 extern int nilfs_segctor_add_segments_to_be_freed(struct nilfs_sc_info *,
                                                  __u64 *, size_t);
index 8258cf9..70e3244 100644 (file)
@@ -5,4 +5,3 @@
 obj-$(CONFIG_SQUASHFS) += squashfs.o
 squashfs-y += block.o cache.o dir.o export.o file.o fragment.o id.o inode.o
 squashfs-y += namei.o super.o symlink.o
-#squashfs-y += squashfs2_0.o
index 1c4739e..40c98fa 100644 (file)
@@ -252,6 +252,7 @@ struct squashfs_cache *squashfs_cache_init(char *name, int entries,
        cache->entries = entries;
        cache->block_size = block_size;
        cache->pages = block_size >> PAGE_CACHE_SHIFT;
+       cache->pages = cache->pages ? cache->pages : 1;
        cache->name = name;
        cache->num_waiters = 0;
        spin_lock_init(&cache->lock);
index ffa6edc..0adc624 100644 (file)
@@ -157,6 +157,16 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent)
        if (msblk->block_size > SQUASHFS_FILE_MAX_SIZE)
                goto failed_mount;
 
+       /*
+        * Check the system page size is not larger than the filesystem
+        * block size (by default 128K).  This is currently not supported.
+        */
+       if (PAGE_CACHE_SIZE > msblk->block_size) {
+               ERROR("Page size > filesystem block size (%d).  This is "
+                       "currently not supported!\n", msblk->block_size);
+               goto failed_mount;
+       }
+
        msblk->block_log = le16_to_cpu(sblk->block_log);
        if (msblk->block_log > SQUASHFS_FILE_MAX_LOG)
                goto failed_mount;
index 2e2aa3d..ffefba8 100644 (file)
@@ -78,12 +78,18 @@ enum dma_transaction_type {
  *     dependency chains
  * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s)
  * @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s)
+ * @DMA_COMPL_SRC_UNMAP_SINGLE - set to do the source dma-unmapping as single
+ *     (if not set, do the source dma-unmapping as page)
+ * @DMA_COMPL_DEST_UNMAP_SINGLE - set to do the destination dma-unmapping as single
+ *     (if not set, do the destination dma-unmapping as page)
  */
 enum dma_ctrl_flags {
        DMA_PREP_INTERRUPT = (1 << 0),
        DMA_CTRL_ACK = (1 << 1),
        DMA_COMPL_SKIP_SRC_UNMAP = (1 << 2),
        DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3),
+       DMA_COMPL_SRC_UNMAP_SINGLE = (1 << 4),
+       DMA_COMPL_DEST_UNMAP_SINGLE = (1 << 5),
 };
 
 /**
index 40617c1..3052084 100644 (file)
@@ -433,6 +433,7 @@ asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg);
 asmlinkage long sys_fcntl64(unsigned int fd,
                                unsigned int cmd, unsigned long arg);
 #endif
+asmlinkage long sys_pipe2(int __user *fildes, int flags);
 asmlinkage long sys_dup(unsigned int fildes);
 asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd);
 asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags);
index 36d6ea2..b9ce574 100644 (file)
@@ -112,14 +112,6 @@ static long madvise_willneed(struct vm_area_struct * vma,
        if (!file)
                return -EBADF;
 
-       /*
-        * Page cache readahead assumes page cache pages are order-0 which
-        * is not the case for hugetlbfs. Do not give a bad return value
-        * but ignore the advice.
-        */
-       if (vma->vm_flags & VM_HUGETLB)
-               return 0;
-
        if (file->f_mapping->a_ops->get_xip_mem) {
                /* no bad return value, but ignore advice */
                return 0;
index 629a287..42a6f9f 100644 (file)
@@ -265,7 +265,7 @@ static int fast_reg_read_chunks(struct svcxprt_rdma *xprt,
                frmr->page_list->page_list[page_no] =
                        ib_dma_map_single(xprt->sc_cm_id->device,
                                          page_address(rqstp->rq_arg.pages[page_no]),
-                                         PAGE_SIZE, DMA_TO_DEVICE);
+                                         PAGE_SIZE, DMA_FROM_DEVICE);
                if (ib_dma_mapping_error(xprt->sc_cm_id->device,
                                         frmr->page_list->page_list[page_no]))
                        goto fatal_err;
index 6c26a67..8b510c5 100644 (file)
@@ -183,6 +183,7 @@ static int fast_reg_xdr(struct svcxprt_rdma *xprt,
 
  fatal_err:
        printk("svcrdma: Error fast registering memory for xprt %p\n", xprt);
+       vec->frmr = NULL;
        svc_rdma_put_frmr(xprt, frmr);
        return -EIO;
 }
@@ -516,6 +517,7 @@ static int send_reply(struct svcxprt_rdma *rdma,
                       "svcrdma: could not post a receive buffer, err=%d."
                       "Closing transport %p.\n", ret, rdma);
                set_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags);
+               svc_rdma_put_frmr(rdma, vec->frmr);
                svc_rdma_put_context(ctxt, 0);
                return -ENOTCONN;
        }
@@ -606,6 +608,7 @@ static int send_reply(struct svcxprt_rdma *rdma,
        return 0;
 
  err:
+       svc_rdma_unmap_dma(ctxt);
        svc_rdma_put_frmr(rdma, vec->frmr);
        svc_rdma_put_context(ctxt, 1);
        return -EIO;
index 3d810e7..4b0c2fa 100644 (file)
@@ -520,8 +520,9 @@ int svc_rdma_post_recv(struct svcxprt_rdma *xprt)
        svc_xprt_get(&xprt->sc_xprt);
        ret = ib_post_recv(xprt->sc_qp, &recv_wr, &bad_recv_wr);
        if (ret) {
-               svc_xprt_put(&xprt->sc_xprt);
+               svc_rdma_unmap_dma(ctxt);
                svc_rdma_put_context(ctxt, 1);
+               svc_xprt_put(&xprt->sc_xprt);
        }
        return ret;