aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MAINTAINERS2
-rw-r--r--arch/x86/kernel/quirks.c9
-rw-r--r--arch/x86/mm/pageattr-test.c7
-rw-r--r--drivers/ata/libata-core.c48
-rw-r--r--drivers/ata/pata_amd.c2
-rw-r--r--drivers/ata/pata_legacy.c2
-rw-r--r--drivers/ata/pata_ninja32.c9
-rw-r--r--drivers/ata/pata_via.c6
-rw-r--r--drivers/ata/sata_mv.c50
-rw-r--r--drivers/ide/Kconfig26
-rw-r--r--drivers/ide/arm/bast-ide.c12
-rw-r--r--drivers/ide/arm/palm_bk3710.c74
-rw-r--r--drivers/ide/ide-cd.c2
-rw-r--r--drivers/ide/ide-disk.c18
-rw-r--r--drivers/ide/ide-dma.c14
-rw-r--r--drivers/ide/ide-io.c19
-rw-r--r--drivers/ide/ide-iops.c10
-rw-r--r--drivers/ide/ide-lib.c9
-rw-r--r--drivers/ide/ide-probe.c4
-rw-r--r--drivers/ide/ide-tape.c34
-rw-r--r--drivers/ide/ide.c4
-rw-r--r--drivers/ide/legacy/gayle.c2
-rw-r--r--drivers/ide/pci/cs5520.c5
-rw-r--r--drivers/ide/pci/pdc202xx_old.c22
-rw-r--r--drivers/net/mlx4/alloc.c1
-rw-r--r--fs/lockd/host.c10
-rw-r--r--fs/lockd/svclock.c28
-rw-r--r--include/asm-generic/topology.h10
-rw-r--r--include/linux/ide.h13
-rw-r--r--include/linux/sunrpc/svc.h13
-rw-r--r--init/Makefile1
-rw-r--r--mm/memory.c2
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_sendto.c3
-rw-r--r--scripts/Kbuild.include3
-rw-r--r--security/selinux/hooks.c21
-rw-r--r--security/selinux/include/av_perm_to_string.h3
-rw-r--r--security/selinux/include/av_permissions.h3
-rw-r--r--security/selinux/include/class_to_string.h1
-rw-r--r--security/selinux/include/flask.h1
39 files changed, 270 insertions, 233 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index c40f0ae96552..6680ec44779e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3561,6 +3561,8 @@ P: Christoph Lameter
3561M: clameter@sgi.com 3561M: clameter@sgi.com
3562P: Pekka Enberg 3562P: Pekka Enberg
3563M: penberg@cs.helsinki.fi 3563M: penberg@cs.helsinki.fi
3564P: Matt Mackall
3565M: mpm@selenic.com
3564L: linux-mm@kvack.org 3566L: linux-mm@kvack.org
3565S: Maintained 3567S: Maintained
3566 3568
diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
index 1941482d4ca3..c47208fc5932 100644
--- a/arch/x86/kernel/quirks.c
+++ b/arch/x86/kernel/quirks.c
@@ -11,7 +11,7 @@
11static void __devinit quirk_intel_irqbalance(struct pci_dev *dev) 11static void __devinit quirk_intel_irqbalance(struct pci_dev *dev)
12{ 12{
13 u8 config, rev; 13 u8 config, rev;
14 u32 word; 14 u16 word;
15 15
16 /* BIOS may enable hardware IRQ balancing for 16 /* BIOS may enable hardware IRQ balancing for
17 * E7520/E7320/E7525(revision ID 0x9 and below) 17 * E7520/E7320/E7525(revision ID 0x9 and below)
@@ -26,8 +26,11 @@ static void __devinit quirk_intel_irqbalance(struct pci_dev *dev)
26 pci_read_config_byte(dev, 0xf4, &config); 26 pci_read_config_byte(dev, 0xf4, &config);
27 pci_write_config_byte(dev, 0xf4, config|0x2); 27 pci_write_config_byte(dev, 0xf4, config|0x2);
28 28
29 /* read xTPR register */ 29 /*
30 raw_pci_read(0, 0, 0x40, 0x4c, 2, &word); 30 * read xTPR register. We may not have a pci_dev for device 8
31 * because it might be hidden until the above write.
32 */
33 pci_bus_read_config_word(dev->bus, PCI_DEVFN(8, 0), 0x4c, &word);
31 34
32 if (!(word & (1 << 13))) { 35 if (!(word & (1 << 13))) {
33 dev_info(&dev->dev, "Intel E7520/7320/7525 detected; " 36 dev_info(&dev->dev, "Intel E7520/7320/7525 detected; "
diff --git a/arch/x86/mm/pageattr-test.c b/arch/x86/mm/pageattr-test.c
index ed8201600354..75f1b109aae8 100644
--- a/arch/x86/mm/pageattr-test.c
+++ b/arch/x86/mm/pageattr-test.c
@@ -40,7 +40,6 @@ struct split_state {
40static int print_split(struct split_state *s) 40static int print_split(struct split_state *s)
41{ 41{
42 long i, expected, missed = 0; 42 long i, expected, missed = 0;
43 int printed = 0;
44 int err = 0; 43 int err = 0;
45 44
46 s->lpg = s->gpg = s->spg = s->exec = 0; 45 s->lpg = s->gpg = s->spg = s->exec = 0;
@@ -53,12 +52,6 @@ static int print_split(struct split_state *s)
53 52
54 pte = lookup_address(addr, &level); 53 pte = lookup_address(addr, &level);
55 if (!pte) { 54 if (!pte) {
56 if (!printed) {
57 dump_pagetable(addr);
58 printk(KERN_INFO "CPA %lx no pte level %d\n",
59 addr, level);
60 printed = 1;
61 }
62 missed++; 55 missed++;
63 i++; 56 i++;
64 continue; 57 continue;
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 3011919f3ec8..004dae4ea5bc 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3048,6 +3048,8 @@ int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel)
3048static int ata_dev_set_mode(struct ata_device *dev) 3048static int ata_dev_set_mode(struct ata_device *dev)
3049{ 3049{
3050 struct ata_eh_context *ehc = &dev->link->eh_context; 3050 struct ata_eh_context *ehc = &dev->link->eh_context;
3051 const char *dev_err_whine = "";
3052 int ign_dev_err = 0;
3051 unsigned int err_mask; 3053 unsigned int err_mask;
3052 int rc; 3054 int rc;
3053 3055
@@ -3057,41 +3059,57 @@ static int ata_dev_set_mode(struct ata_device *dev)
3057 3059
3058 err_mask = ata_dev_set_xfermode(dev); 3060 err_mask = ata_dev_set_xfermode(dev);
3059 3061
3062 if (err_mask & ~AC_ERR_DEV)
3063 goto fail;
3064
3065 /* revalidate */
3066 ehc->i.flags |= ATA_EHI_POST_SETMODE;
3067 rc = ata_dev_revalidate(dev, ATA_DEV_UNKNOWN, 0);
3068 ehc->i.flags &= ~ATA_EHI_POST_SETMODE;
3069 if (rc)
3070 return rc;
3071
3060 /* Old CFA may refuse this command, which is just fine */ 3072 /* Old CFA may refuse this command, which is just fine */
3061 if (dev->xfer_shift == ATA_SHIFT_PIO && ata_id_is_cfa(dev->id)) 3073 if (dev->xfer_shift == ATA_SHIFT_PIO && ata_id_is_cfa(dev->id))
3062 err_mask &= ~AC_ERR_DEV; 3074 ign_dev_err = 1;
3063 3075
3064 /* Some very old devices and some bad newer ones fail any kind of 3076 /* Some very old devices and some bad newer ones fail any kind of
3065 SET_XFERMODE request but support PIO0-2 timings and no IORDY */ 3077 SET_XFERMODE request but support PIO0-2 timings and no IORDY */
3066 if (dev->xfer_shift == ATA_SHIFT_PIO && !ata_id_has_iordy(dev->id) && 3078 if (dev->xfer_shift == ATA_SHIFT_PIO && !ata_id_has_iordy(dev->id) &&
3067 dev->pio_mode <= XFER_PIO_2) 3079 dev->pio_mode <= XFER_PIO_2)
3068 err_mask &= ~AC_ERR_DEV; 3080 ign_dev_err = 1;
3069 3081
3070 /* Early MWDMA devices do DMA but don't allow DMA mode setting. 3082 /* Early MWDMA devices do DMA but don't allow DMA mode setting.
3071 Don't fail an MWDMA0 set IFF the device indicates it is in MWDMA0 */ 3083 Don't fail an MWDMA0 set IFF the device indicates it is in MWDMA0 */
3072 if (dev->xfer_shift == ATA_SHIFT_MWDMA && 3084 if (dev->xfer_shift == ATA_SHIFT_MWDMA &&
3073 dev->dma_mode == XFER_MW_DMA_0 && 3085 dev->dma_mode == XFER_MW_DMA_0 &&
3074 (dev->id[63] >> 8) & 1) 3086 (dev->id[63] >> 8) & 1)
3075 err_mask &= ~AC_ERR_DEV; 3087 ign_dev_err = 1;
3076 3088
3077 if (err_mask) { 3089 /* if the device is actually configured correctly, ignore dev err */
3078 ata_dev_printk(dev, KERN_ERR, "failed to set xfermode " 3090 if (dev->xfer_mode == ata_xfer_mask2mode(ata_id_xfermask(dev->id)))
3079 "(err_mask=0x%x)\n", err_mask); 3091 ign_dev_err = 1;
3080 return -EIO;
3081 }
3082 3092
3083 ehc->i.flags |= ATA_EHI_POST_SETMODE; 3093 if (err_mask & AC_ERR_DEV) {
3084 rc = ata_dev_revalidate(dev, ATA_DEV_UNKNOWN, 0); 3094 if (!ign_dev_err)
3085 ehc->i.flags &= ~ATA_EHI_POST_SETMODE; 3095 goto fail;
3086 if (rc) 3096 else
3087 return rc; 3097 dev_err_whine = " (device error ignored)";
3098 }
3088 3099
3089 DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n", 3100 DPRINTK("xfer_shift=%u, xfer_mode=0x%x\n",
3090 dev->xfer_shift, (int)dev->xfer_mode); 3101 dev->xfer_shift, (int)dev->xfer_mode);
3091 3102
3092 ata_dev_printk(dev, KERN_INFO, "configured for %s\n", 3103 ata_dev_printk(dev, KERN_INFO, "configured for %s%s\n",
3093 ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode))); 3104 ata_mode_string(ata_xfer_mode2mask(dev->xfer_mode)),
3105 dev_err_whine);
3106
3094 return 0; 3107 return 0;
3108
3109 fail:
3110 ata_dev_printk(dev, KERN_ERR, "failed to set xfermode "
3111 "(err_mask=0x%x)\n", err_mask);
3112 return -EIO;
3095} 3113}
3096 3114
3097/** 3115/**
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index 761a66608d7b..ea567e2b1703 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -772,7 +772,7 @@ static void __exit amd_exit(void)
772} 772}
773 773
774MODULE_AUTHOR("Alan Cox"); 774MODULE_AUTHOR("Alan Cox");
775MODULE_DESCRIPTION("low-level driver for AMD PATA IDE"); 775MODULE_DESCRIPTION("low-level driver for AMD and Nvidia PATA IDE");
776MODULE_LICENSE("GPL"); 776MODULE_LICENSE("GPL");
777MODULE_DEVICE_TABLE(pci, amd); 777MODULE_DEVICE_TABLE(pci, amd);
778MODULE_VERSION(DRV_VERSION); 778MODULE_VERSION(DRV_VERSION);
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index 333dc15f8ccf..6c59969fd50b 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -127,7 +127,7 @@ static int opti82c611a; /* Opti82c611A on primary 1, sec 2, both 3 */
127static int opti82c46x; /* Opti 82c465MV present(pri/sec autodetect) */ 127static int opti82c46x; /* Opti 82c465MV present(pri/sec autodetect) */
128static int qdi; /* Set to probe QDI controllers */ 128static int qdi; /* Set to probe QDI controllers */
129static int winbond; /* Set to probe Winbond controllers, 129static int winbond; /* Set to probe Winbond controllers,
130 give I/O port if non stdanard */ 130 give I/O port if non standard */
131static int autospeed; /* Chip present which snoops speed changes */ 131static int autospeed; /* Chip present which snoops speed changes */
132static int pio_mask = 0x1F; /* PIO range for autospeed devices */ 132static int pio_mask = 0x1F; /* PIO range for autospeed devices */
133static int iordy_mask = 0xFFFFFFFF; /* Use iordy if available */ 133static int iordy_mask = 0xFFFFFFFF; /* Use iordy if available */
diff --git a/drivers/ata/pata_ninja32.c b/drivers/ata/pata_ninja32.c
index 1c1b83541d13..15dd649f89ee 100644
--- a/drivers/ata/pata_ninja32.c
+++ b/drivers/ata/pata_ninja32.c
@@ -17,6 +17,7 @@
17 * Base + 0x00 IRQ Status 17 * Base + 0x00 IRQ Status
18 * Base + 0x01 IRQ control 18 * Base + 0x01 IRQ control
19 * Base + 0x02 Chipset control 19 * Base + 0x02 Chipset control
20 * Base + 0x03 Unknown
20 * Base + 0x04 VDMA and reset control + wait bits 21 * Base + 0x04 VDMA and reset control + wait bits
21 * Base + 0x08 BMIMBA 22 * Base + 0x08 BMIMBA
22 * Base + 0x0C DMA Length 23 * Base + 0x0C DMA Length
@@ -174,8 +175,12 @@ static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id)
174 ata_std_ports(&ap->ioaddr); 175 ata_std_ports(&ap->ioaddr);
175 176
176 iowrite8(0x05, base + 0x01); /* Enable interrupt lines */ 177 iowrite8(0x05, base + 0x01); /* Enable interrupt lines */
177 iowrite8(0xB3, base + 0x02); /* Burst, ?? setup */ 178 iowrite8(0xBE, base + 0x02); /* Burst, ?? setup */
178 iowrite8(0x00, base + 0x04); /* WAIT0 ? */ 179 iowrite8(0x01, base + 0x03); /* Unknown */
180 iowrite8(0x20, base + 0x04); /* WAIT0 */
181 iowrite8(0x8f, base + 0x05); /* Unknown */
182 iowrite8(0xa4, base + 0x1c); /* Unknown */
183 iowrite8(0x83, base + 0x1d); /* BMDMA control: WAIT0 */
179 /* FIXME: Should we disable them at remove ? */ 184 /* FIXME: Should we disable them at remove ? */
180 return ata_host_activate(host, dev->irq, ata_interrupt, 185 return ata_host_activate(host, dev->irq, ata_interrupt,
181 IRQF_SHARED, &ninja32_sht); 186 IRQF_SHARED, &ninja32_sht);
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index 39627ab684bf..d119a68c388f 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -84,6 +84,7 @@ enum {
84 VIA_BAD_ID = 0x100, /* Has wrong vendor ID (0x1107) */ 84 VIA_BAD_ID = 0x100, /* Has wrong vendor ID (0x1107) */
85 VIA_BAD_AST = 0x200, /* Don't touch Address Setup Timing */ 85 VIA_BAD_AST = 0x200, /* Don't touch Address Setup Timing */
86 VIA_NO_ENABLES = 0x400, /* Has no enablebits */ 86 VIA_NO_ENABLES = 0x400, /* Has no enablebits */
87 VIA_SATA_PATA = 0x800, /* SATA/PATA combined configuration */
87}; 88};
88 89
89/* 90/*
@@ -100,7 +101,7 @@ static const struct via_isa_bridge {
100 { "vx800", PCI_DEVICE_ID_VIA_VX800, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 101 { "vx800", PCI_DEVICE_ID_VIA_VX800, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
101 { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 102 { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
102 { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 103 { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
103 { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 104 { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA },
104 { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES}, 105 { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_NO_ENABLES},
105 { "vt8237a", PCI_DEVICE_ID_VIA_8237A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 106 { "vt8237a", PCI_DEVICE_ID_VIA_8237A, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
106 { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 107 { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
@@ -172,6 +173,9 @@ static int via_cable_detect(struct ata_port *ap) {
172 if (via_cable_override(pdev)) 173 if (via_cable_override(pdev))
173 return ATA_CBL_PATA40_SHORT; 174 return ATA_CBL_PATA40_SHORT;
174 175
176 if ((config->flags & VIA_SATA_PATA) && ap->port_no == 0)
177 return ATA_CBL_SATA;
178
175 /* Early chips are 40 wire */ 179 /* Early chips are 40 wire */
176 if ((config->flags & VIA_UDMA) < VIA_UDMA_66) 180 if ((config->flags & VIA_UDMA) < VIA_UDMA_66)
177 return ATA_CBL_PATA40; 181 return ATA_CBL_PATA40;
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 080b8362f8d6..04b571764aff 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -1716,14 +1716,16 @@ static void mv_host_intr(struct ata_host *host, u32 relevant, unsigned int hc)
1716 VPRINTK("ENTER, hc%u relevant=0x%08x HC IRQ cause=0x%08x\n", 1716 VPRINTK("ENTER, hc%u relevant=0x%08x HC IRQ cause=0x%08x\n",
1717 hc, relevant, hc_irq_cause); 1717 hc, relevant, hc_irq_cause);
1718 1718
1719 for (port = port0; port < port0 + last_port; port++) { 1719 for (port = port0; port < last_port; port++) {
1720 struct ata_port *ap = host->ports[port]; 1720 struct ata_port *ap = host->ports[port];
1721 struct mv_port_priv *pp = ap->private_data; 1721 struct mv_port_priv *pp;
1722 int have_err_bits, hard_port, shift; 1722 int have_err_bits, hard_port, shift;
1723 1723
1724 if ((!ap) || (ap->flags & ATA_FLAG_DISABLED)) 1724 if ((!ap) || (ap->flags & ATA_FLAG_DISABLED))
1725 continue; 1725 continue;
1726 1726
1727 pp = ap->private_data;
1728
1727 shift = port << 1; /* (port * 2) */ 1729 shift = port << 1; /* (port * 2) */
1728 if (port >= MV_PORTS_PER_HC) { 1730 if (port >= MV_PORTS_PER_HC) {
1729 shift++; /* skip bit 8 in the HC Main IRQ reg */ 1731 shift++; /* skip bit 8 in the HC Main IRQ reg */
@@ -2879,6 +2881,26 @@ done:
2879 return rc; 2881 return rc;
2880} 2882}
2881 2883
2884static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev)
2885{
2886 hpriv->crqb_pool = dmam_pool_create("crqb_q", dev, MV_CRQB_Q_SZ,
2887 MV_CRQB_Q_SZ, 0);
2888 if (!hpriv->crqb_pool)
2889 return -ENOMEM;
2890
2891 hpriv->crpb_pool = dmam_pool_create("crpb_q", dev, MV_CRPB_Q_SZ,
2892 MV_CRPB_Q_SZ, 0);
2893 if (!hpriv->crpb_pool)
2894 return -ENOMEM;
2895
2896 hpriv->sg_tbl_pool = dmam_pool_create("sg_tbl", dev, MV_SG_TBL_SZ,
2897 MV_SG_TBL_SZ, 0);
2898 if (!hpriv->sg_tbl_pool)
2899 return -ENOMEM;
2900
2901 return 0;
2902}
2903
2882/** 2904/**
2883 * mv_platform_probe - handle a positive probe of an soc Marvell 2905 * mv_platform_probe - handle a positive probe of an soc Marvell
2884 * host 2906 * host
@@ -2932,6 +2954,10 @@ static int mv_platform_probe(struct platform_device *pdev)
2932 hpriv->base = ioremap(res->start, res->end - res->start + 1); 2954 hpriv->base = ioremap(res->start, res->end - res->start + 1);
2933 hpriv->base -= MV_SATAHC0_REG_BASE; 2955 hpriv->base -= MV_SATAHC0_REG_BASE;
2934 2956
2957 rc = mv_create_dma_pools(hpriv, &pdev->dev);
2958 if (rc)
2959 return rc;
2960
2935 /* initialize adapter */ 2961 /* initialize adapter */
2936 rc = mv_init_host(host, chip_soc); 2962 rc = mv_init_host(host, chip_soc);
2937 if (rc) 2963 if (rc)
@@ -3068,26 +3094,6 @@ static void mv_print_info(struct ata_host *host)
3068 scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx"); 3094 scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx");
3069} 3095}
3070 3096
3071static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev)
3072{
3073 hpriv->crqb_pool = dmam_pool_create("crqb_q", dev, MV_CRQB_Q_SZ,
3074 MV_CRQB_Q_SZ, 0);
3075 if (!hpriv->crqb_pool)
3076 return -ENOMEM;
3077
3078 hpriv->crpb_pool = dmam_pool_create("crpb_q", dev, MV_CRPB_Q_SZ,
3079 MV_CRPB_Q_SZ, 0);
3080 if (!hpriv->crpb_pool)
3081 return -ENOMEM;
3082
3083 hpriv->sg_tbl_pool = dmam_pool_create("sg_tbl", dev, MV_SG_TBL_SZ,
3084 MV_SG_TBL_SZ, 0);
3085 if (!hpriv->sg_tbl_pool)
3086 return -ENOMEM;
3087
3088 return 0;
3089}
3090
3091/** 3097/**
3092 * mv_pci_init_one - handle a positive probe of a PCI Marvell host 3098 * mv_pci_init_one - handle a positive probe of a PCI Marvell host
3093 * @pdev: PCI device found 3099 * @pdev: PCI device found
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 043c34ad0a05..df752e690e47 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -378,6 +378,9 @@ config BLK_DEV_IDEPNP
378 would like the kernel to automatically detect and activate 378 would like the kernel to automatically detect and activate
379 it, say Y here. 379 it, say Y here.
380 380
381config BLK_DEV_IDEDMA_SFF
382 bool
383
381if PCI 384if PCI
382 385
383comment "PCI IDE chipsets support" 386comment "PCI IDE chipsets support"
@@ -459,6 +462,7 @@ config BLK_DEV_RZ1000
459config BLK_DEV_IDEDMA_PCI 462config BLK_DEV_IDEDMA_PCI
460 bool 463 bool
461 select BLK_DEV_IDEPCI 464 select BLK_DEV_IDEPCI
465 select BLK_DEV_IDEDMA_SFF
462 466
463config BLK_DEV_AEC62XX 467config BLK_DEV_AEC62XX
464 tristate "AEC62XX chipset support" 468 tristate "AEC62XX chipset support"
@@ -688,23 +692,6 @@ config BLK_DEV_PDC202XX_OLD
688 692
689 If unsure, say N. 693 If unsure, say N.
690 694
691config PDC202XX_BURST
692 bool "Special UDMA Feature"
693 depends on BLK_DEV_PDC202XX_OLD
694 help
695 This option causes the pdc202xx driver to enable UDMA modes on the
696 PDC202xx even when the PDC202xx BIOS has not done so.
697
698 It was originally designed for the PDC20246/Ultra33, whose BIOS will
699 only setup UDMA on the first two PDC20246 cards. It has also been
700 used successfully on a PDC20265/Ultra100, allowing use of UDMA modes
701 when the PDC20265 BIOS has been disabled (for faster boot up).
702
703 Please read the comments at the top of
704 <file:drivers/ide/pci/pdc202xx_old.c>.
705
706 If unsure, say N.
707
708config BLK_DEV_PDC202XX_NEW 695config BLK_DEV_PDC202XX_NEW
709 tristate "PROMISE PDC202{68|69|70|71|75|76|77} support" 696 tristate "PROMISE PDC202{68|69|70|71|75|76|77} support"
710 select BLK_DEV_IDEDMA_PCI 697 select BLK_DEV_IDEDMA_PCI
@@ -1016,7 +1003,7 @@ config BLK_DEV_Q40IDE
1016config BLK_DEV_PALMCHIP_BK3710 1003config BLK_DEV_PALMCHIP_BK3710
1017 tristate "Palmchip bk3710 IDE controller support" 1004 tristate "Palmchip bk3710 IDE controller support"
1018 depends on ARCH_DAVINCI 1005 depends on ARCH_DAVINCI
1019 select BLK_DEV_IDEDMA_PCI 1006 select BLK_DEV_IDEDMA_SFF
1020 help 1007 help
1021 Say Y here if you want to support the onchip IDE controller on the 1008 Say Y here if you want to support the onchip IDE controller on the
1022 TI DaVinci SoC 1009 TI DaVinci SoC
@@ -1124,7 +1111,8 @@ config BLK_DEV_UMC8672
1124endif 1111endif
1125 1112
1126config BLK_DEV_IDEDMA 1113config BLK_DEV_IDEDMA
1127 def_bool BLK_DEV_IDEDMA_PCI || BLK_DEV_IDEDMA_PMAC || BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA 1114 def_bool BLK_DEV_IDEDMA_SFF || BLK_DEV_IDEDMA_PMAC || \
1115 BLK_DEV_IDEDMA_ICS || BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
1128 1116
1129config IDE_ARCH_OBSOLETE_INIT 1117config IDE_ARCH_OBSOLETE_INIT
1130 def_bool ALPHA || (ARM && !ARCH_L7200) || BLACKFIN || X86 || IA64 || M32R || MIPS || PARISC || PPC || (SUPERH64 && BLK_DEV_IDEPCI) || SPARC 1118 def_bool ALPHA || (ARM && !ARCH_L7200) || BLACKFIN || X86 || IA64 || M32R || MIPS || PARISC || PPC || (SUPERH64 && BLK_DEV_IDEPCI) || SPARC
diff --git a/drivers/ide/arm/bast-ide.c b/drivers/ide/arm/bast-ide.c
index 0e7574c0ee60..161d30c8481e 100644
--- a/drivers/ide/arm/bast-ide.c
+++ b/drivers/ide/arm/bast-ide.c
@@ -21,12 +21,7 @@
21#include <asm/arch/bast-map.h> 21#include <asm/arch/bast-map.h>
22#include <asm/arch/bast-irq.h> 22#include <asm/arch/bast-irq.h>
23 23
24/* list of registered interfaces */ 24static int __init bastide_register(unsigned int base, unsigned int aux, int irq)
25static ide_hwif_t *ifs[2];
26
27static int __init
28bastide_register(unsigned int base, unsigned int aux, int irq,
29 ide_hwif_t **hwif)
30{ 25{
31 ide_hwif_t *hwif; 26 ide_hwif_t *hwif;
32 hw_regs_t hw; 27 hw_regs_t hw;
@@ -76,8 +71,9 @@ static int __init bastide_init(void)
76 71
77 printk("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n"); 72 printk("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n");
78 73
79 bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0, &ifs[0]); 74 bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0);
80 bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1, &ifs[1]); 75 bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1);
76
81 return 0; 77 return 0;
82} 78}
83 79
diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c
index c3069970a012..8e1f6bd33887 100644
--- a/drivers/ide/arm/palm_bk3710.c
+++ b/drivers/ide/arm/palm_bk3710.c
@@ -311,15 +311,37 @@ static void __devinit palm_bk3710_chipinit(void __iomem *base)
311 palm_bk3710_setpiomode(base, NULL, 0, 600, 0); 311 palm_bk3710_setpiomode(base, NULL, 0, 600, 0);
312 palm_bk3710_setpiomode(base, NULL, 1, 600, 0); 312 palm_bk3710_setpiomode(base, NULL, 1, 600, 0);
313} 313}
314
315static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif)
316{
317 return ATA_CBL_PATA80;
318}
319
320static void __devinit palm_bk3710_init_hwif(ide_hwif_t *hwif)
321{
322 hwif->set_pio_mode = palm_bk3710_set_pio_mode;
323 hwif->set_dma_mode = palm_bk3710_set_dma_mode;
324
325 hwif->cable_detect = palm_bk3710_cable_detect;
326}
327
328static const struct ide_port_info __devinitdata palm_bk3710_port_info = {
329 .init_hwif = palm_bk3710_init_hwif,
330 .host_flags = IDE_HFLAG_NO_DMA, /* hack (no PCI) */
331 .pio_mask = ATA_PIO4,
332 .udma_mask = ATA_UDMA4, /* (input clk 99MHz) */
333 .mwdma_mask = ATA_MWDMA2,
334};
335
314static int __devinit palm_bk3710_probe(struct platform_device *pdev) 336static int __devinit palm_bk3710_probe(struct platform_device *pdev)
315{ 337{
316 hw_regs_t ide_ctlr_info;
317 int index = 0;
318 int pribase;
319 struct clk *clkp; 338 struct clk *clkp;
320 struct resource *mem, *irq; 339 struct resource *mem, *irq;
321 ide_hwif_t *hwif; 340 ide_hwif_t *hwif;
322 void __iomem *base; 341 void __iomem *base;
342 int pribase, i;
343 hw_regs_t hw;
344 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
323 345
324 clkp = clk_get(NULL, "IDECLK"); 346 clkp = clk_get(NULL, "IDECLK");
325 if (IS_ERR(clkp)) 347 if (IS_ERR(clkp))
@@ -330,7 +352,7 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
330 ide_palm_clk = clk_get_rate(ideclkp)/100000; 352 ide_palm_clk = clk_get_rate(ideclkp)/100000;
331 ide_palm_clk = (10000/ide_palm_clk) + 1; 353 ide_palm_clk = (10000/ide_palm_clk) + 1;
332 /* Register the IDE interface with Linux ATA Interface */ 354 /* Register the IDE interface with Linux ATA Interface */
333 memset(&ide_ctlr_info, 0, sizeof(ide_ctlr_info)); 355 memset(&hw, 0, sizeof(hw));
334 356
335 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 357 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
336 if (mem == NULL) { 358 if (mem == NULL) {
@@ -349,32 +371,42 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
349 palm_bk3710_chipinit(base); 371 palm_bk3710_chipinit(base);
350 372
351 pribase = mem->start + IDE_PALM_ATA_PRI_REG_OFFSET; 373 pribase = mem->start + IDE_PALM_ATA_PRI_REG_OFFSET;
352 for (index = 0; index < IDE_NR_PORTS - 2; index++) 374 for (i = 0; i < IDE_NR_PORTS - 2; i++)
353 ide_ctlr_info.io_ports[index] = pribase + index; 375 hw.io_ports[i] = pribase + i;
354 ide_ctlr_info.io_ports[IDE_CONTROL_OFFSET] = mem->start + 376 hw.io_ports[IDE_CONTROL_OFFSET] = mem->start +
355 IDE_PALM_ATA_PRI_CTL_OFFSET; 377 IDE_PALM_ATA_PRI_CTL_OFFSET;
356 ide_ctlr_info.irq = irq->start; 378 hw.irq = irq->start;
357 ide_ctlr_info.chipset = ide_palm3710; 379 hw.chipset = ide_palm3710;
358 380
359 if (ide_register_hw(&ide_ctlr_info, NULL, &hwif) < 0) { 381 hwif = ide_deprecated_find_port(hw.io_ports[IDE_DATA_OFFSET]);
360 printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n"); 382 if (hwif == NULL)
361 return -ENODEV; 383 goto out;
362 } 384
385 i = hwif->index;
386
387 if (hwif->present)
388 ide_unregister(i, 0, 0);
389 else if (!hwif->hold)
390 ide_init_port_data(hwif, i);
391
392 ide_init_port_hw(hwif, &hw);
363 393
364 hwif->set_pio_mode = &palm_bk3710_set_pio_mode;
365 hwif->set_dma_mode = &palm_bk3710_set_dma_mode;
366 hwif->mmio = 1; 394 hwif->mmio = 1;
367 default_hwif_mmiops(hwif); 395 default_hwif_mmiops(hwif);
368 hwif->cbl = ATA_CBL_PATA80;
369 hwif->ultra_mask = 0x1f; /* Ultra DMA Mode 4 Max
370 (input clk 99MHz) */
371 hwif->mwdma_mask = 0x7;
372 hwif->drives[0].autotune = 1;
373 hwif->drives[1].autotune = 1;
374 396
375 ide_setup_dma(hwif, mem->start); 397 ide_setup_dma(hwif, mem->start);
376 398
399 idx[0] = i;
400
401 ide_device_add(idx, &palm_bk3710_port_info);
402
403 if (!hwif->present)
404 goto out;
405
377 return 0; 406 return 0;
407out:
408 printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");
409 return -ENODEV;
378} 410}
379 411
380static struct platform_driver platform_bk_driver = { 412static struct platform_driver platform_bk_driver = {
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 5e42c19a03e3..354c91d06a6d 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1555,7 +1555,7 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense)
1555 if (stat) 1555 if (stat)
1556 return stat; 1556 return stat;
1557 1557
1558 toc->hdr.toc_length = ntohs (toc->hdr.toc_length); 1558 toc->hdr.toc_length = be16_to_cpu(toc->hdr.toc_length);
1559 1559
1560 if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) { 1560 if (info->cd_flags & IDE_CD_FLAG_TOCTRACKS_AS_BCD) {
1561 toc->hdr.first_track = BCD2BIN(toc->hdr.first_track); 1561 toc->hdr.first_track = BCD2BIN(toc->hdr.first_track);
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 3c69822507e2..aed8b31ca561 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -590,20 +590,24 @@ static ide_proc_entry_t idedisk_proc[] = {
590static void idedisk_prepare_flush(struct request_queue *q, struct request *rq) 590static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
591{ 591{
592 ide_drive_t *drive = q->queuedata; 592 ide_drive_t *drive = q->queuedata;
593 ide_task_t task; 593 ide_task_t *task = kmalloc(sizeof(*task), GFP_ATOMIC);
594 594
595 memset(&task, 0, sizeof(task)); 595 /* FIXME: map struct ide_taskfile on rq->cmd[] */
596 BUG_ON(task == NULL);
597
598 memset(task, 0, sizeof(*task));
596 if (ide_id_has_flush_cache_ext(drive->id) && 599 if (ide_id_has_flush_cache_ext(drive->id) &&
597 (drive->capacity64 >= (1UL << 28))) 600 (drive->capacity64 >= (1UL << 28)))
598 task.tf.command = WIN_FLUSH_CACHE_EXT; 601 task->tf.command = WIN_FLUSH_CACHE_EXT;
599 else 602 else
600 task.tf.command = WIN_FLUSH_CACHE; 603 task->tf.command = WIN_FLUSH_CACHE;
601 task.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; 604 task->tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE |
602 task.data_phase = TASKFILE_NO_DATA; 605 IDE_TFLAG_DYN;
606 task->data_phase = TASKFILE_NO_DATA;
603 607
604 rq->cmd_type = REQ_TYPE_ATA_TASKFILE; 608 rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
605 rq->cmd_flags |= REQ_SOFTBARRIER; 609 rq->cmd_flags |= REQ_SOFTBARRIER;
606 rq->special = &task; 610 rq->special = task;
607} 611}
608 612
609/* 613/*
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index a4bb32883c6b..d0e7b537353e 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -198,7 +198,7 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq)
198 198
199EXPORT_SYMBOL_GPL(ide_build_sglist); 199EXPORT_SYMBOL_GPL(ide_build_sglist);
200 200
201#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 201#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
202/** 202/**
203 * ide_build_dmatable - build IDE DMA table 203 * ide_build_dmatable - build IDE DMA table
204 * 204 *
@@ -316,7 +316,7 @@ void ide_destroy_dmatable (ide_drive_t *drive)
316 316
317EXPORT_SYMBOL_GPL(ide_destroy_dmatable); 317EXPORT_SYMBOL_GPL(ide_destroy_dmatable);
318 318
319#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 319#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
320/** 320/**
321 * config_drive_for_dma - attempt to activate IDE DMA 321 * config_drive_for_dma - attempt to activate IDE DMA
322 * @drive: the drive to place in DMA mode 322 * @drive: the drive to place in DMA mode
@@ -424,7 +424,7 @@ void ide_dma_host_set(ide_drive_t *drive, int on)
424} 424}
425 425
426EXPORT_SYMBOL_GPL(ide_dma_host_set); 426EXPORT_SYMBOL_GPL(ide_dma_host_set);
427#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 427#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
428 428
429/** 429/**
430 * ide_dma_off_quietly - Generic DMA kill 430 * ide_dma_off_quietly - Generic DMA kill
@@ -474,7 +474,7 @@ void ide_dma_on(ide_drive_t *drive)
474 drive->hwif->dma_host_set(drive, 1); 474 drive->hwif->dma_host_set(drive, 1);
475} 475}
476 476
477#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 477#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
478/** 478/**
479 * ide_dma_setup - begin a DMA phase 479 * ide_dma_setup - begin a DMA phase
480 * @drive: target device 480 * @drive: target device
@@ -591,7 +591,7 @@ static int __ide_dma_test_irq(ide_drive_t *drive)
591} 591}
592#else 592#else
593static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; } 593static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; }
594#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 594#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
595 595
596int __ide_dma_bad_drive (ide_drive_t *drive) 596int __ide_dma_bad_drive (ide_drive_t *drive)
597{ 597{
@@ -840,7 +840,7 @@ void ide_check_dma_crc(ide_drive_t *drive)
840 ide_dma_on(drive); 840 ide_dma_on(drive);
841} 841}
842 842
843#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 843#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
844void ide_dma_lost_irq (ide_drive_t *drive) 844void ide_dma_lost_irq (ide_drive_t *drive)
845{ 845{
846 printk("%s: DMA interrupt recovery\n", drive->name); 846 printk("%s: DMA interrupt recovery\n", drive->name);
@@ -1002,4 +1002,4 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base)
1002} 1002}
1003 1003
1004EXPORT_SYMBOL_GPL(ide_setup_dma); 1004EXPORT_SYMBOL_GPL(ide_setup_dma);
1005#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 1005#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 3addbe478d26..715379605a7b 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -361,17 +361,21 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
361 spin_unlock_irqrestore(&ide_lock, flags); 361 spin_unlock_irqrestore(&ide_lock, flags);
362 362
363 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { 363 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
364 ide_task_t *args = (ide_task_t *) rq->special; 364 ide_task_t *task = (ide_task_t *)rq->special;
365
365 if (rq->errors == 0) 366 if (rq->errors == 0)
366 rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); 367 rq->errors = !OK_STAT(stat, READY_STAT, BAD_STAT);
367 368
368 if (args) { 369 if (task) {
369 struct ide_taskfile *tf = &args->tf; 370 struct ide_taskfile *tf = &task->tf;
370 371
371 tf->error = err; 372 tf->error = err;
372 tf->status = stat; 373 tf->status = stat;
373 374
374 ide_tf_read(drive, args); 375 ide_tf_read(drive, task);
376
377 if (task->tf_flags & IDE_TFLAG_DYN)
378 kfree(task);
375 } 379 }
376 } else if (blk_pm_request(rq)) { 380 } else if (blk_pm_request(rq)) {
377 struct request_pm_state *pm = rq->data; 381 struct request_pm_state *pm = rq->data;
@@ -388,7 +392,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
388 spin_lock_irqsave(&ide_lock, flags); 392 spin_lock_irqsave(&ide_lock, flags);
389 HWGROUP(drive)->rq = NULL; 393 HWGROUP(drive)->rq = NULL;
390 rq->errors = err; 394 rq->errors = err;
391 if (__blk_end_request(rq, (rq->errors ? -EIO : 0), 0)) 395 if (unlikely(__blk_end_request(rq, (rq->errors ? -EIO : 0),
396 blk_rq_bytes(rq))))
392 BUG(); 397 BUG();
393 spin_unlock_irqrestore(&ide_lock, flags); 398 spin_unlock_irqrestore(&ide_lock, flags);
394} 399}
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index c32e759df208..c419266234a7 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -786,15 +786,11 @@ static void __ide_set_handler (ide_drive_t *drive, ide_handler_t *handler,
786{ 786{
787 ide_hwgroup_t *hwgroup = HWGROUP(drive); 787 ide_hwgroup_t *hwgroup = HWGROUP(drive);
788 788
789 if (hwgroup->handler != NULL) { 789 BUG_ON(hwgroup->handler);
790 printk(KERN_CRIT "%s: ide_set_handler: handler not null; "
791 "old=%p, new=%p\n",
792 drive->name, hwgroup->handler, handler);
793 }
794 hwgroup->handler = handler; 790 hwgroup->handler = handler;
795 hwgroup->expiry = expiry; 791 hwgroup->expiry = expiry;
796 hwgroup->timer.expires = jiffies + timeout; 792 hwgroup->timer.expires = jiffies + timeout;
797 hwgroup->req_gen_timer = hwgroup->req_gen; 793 hwgroup->req_gen_timer = hwgroup->req_gen;
798 add_timer(&hwgroup->timer); 794 add_timer(&hwgroup->timer);
799} 795}
800 796
@@ -827,11 +823,9 @@ void ide_execute_command(ide_drive_t *drive, u8 cmd, ide_handler_t *handler,
827 unsigned timeout, ide_expiry_t *expiry) 823 unsigned timeout, ide_expiry_t *expiry)
828{ 824{
829 unsigned long flags; 825 unsigned long flags;
830 ide_hwgroup_t *hwgroup = HWGROUP(drive);
831 ide_hwif_t *hwif = HWIF(drive); 826 ide_hwif_t *hwif = HWIF(drive);
832 827
833 spin_lock_irqsave(&ide_lock, flags); 828 spin_lock_irqsave(&ide_lock, flags);
834 BUG_ON(hwgroup->handler);
835 __ide_set_handler(drive, handler, timeout, expiry); 829 __ide_set_handler(drive, handler, timeout, expiry);
836 hwif->OUTBSYNC(drive, cmd, IDE_COMMAND_REG); 830 hwif->OUTBSYNC(drive, cmd, IDE_COMMAND_REG);
837 /* 831 /*
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index 1ff676cc6473..29e2c9719c30 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -21,15 +21,6 @@
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/io.h> 22#include <asm/io.h>
23 23
24/*
25 * IDE library routines. These are plug in code that most
26 * drivers can use but occasionally may be weird enough
27 * to want to do their own thing with
28 *
29 * Add common non I/O op stuff here. Make sure it has proper
30 * kernel-doc function headers or your patch will be rejected
31 */
32
33static const char *udma_str[] = 24static const char *udma_str[] =
34 { "UDMA/16", "UDMA/25", "UDMA/33", "UDMA/44", 25 { "UDMA/16", "UDMA/25", "UDMA/33", "UDMA/44",
35 "UDMA/66", "UDMA/100", "UDMA/133", "UDMA7" }; 26 "UDMA/66", "UDMA/100", "UDMA/133", "UDMA7" };
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 6daea896c5db..4a2cb2868226 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1051,7 +1051,7 @@ static int init_irq (ide_hwif_t *hwif)
1051 int sa = 0; 1051 int sa = 0;
1052#if defined(__mc68000__) 1052#if defined(__mc68000__)
1053 sa = IRQF_SHARED; 1053 sa = IRQF_SHARED;
1054#endif /* __mc68000__ || CONFIG_APUS */ 1054#endif /* __mc68000__ */
1055 1055
1056 if (IDE_CHIPSET_IS_PCI(hwif->chipset)) 1056 if (IDE_CHIPSET_IS_PCI(hwif->chipset))
1057 sa = IRQF_SHARED; 1057 sa = IRQF_SHARED;
@@ -1355,7 +1355,7 @@ static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
1355 hwif->ultra_mask = d->udma_mask; 1355 hwif->ultra_mask = d->udma_mask;
1356 1356
1357 /* reset DMA masks only for SFF-style DMA controllers */ 1357 /* reset DMA masks only for SFF-style DMA controllers */
1358 if ((d->host_flags && IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0) 1358 if ((d->host_flags & IDE_HFLAG_NO_DMA) == 0 && hwif->dma_base == 0)
1359 hwif->swdma_mask = hwif->mwdma_mask = hwif->ultra_mask = 0; 1359 hwif->swdma_mask = hwif->mwdma_mask = hwif->ultra_mask = 0;
1360 1360
1361 if (d->host_flags & IDE_HFLAG_RQSIZE_256) 1361 if (d->host_flags & IDE_HFLAG_RQSIZE_256)
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 49dd2e7bae7a..0598ecfd5f37 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -466,9 +466,6 @@ static void ide_tape_put(struct ide_tape_obj *tape)
466/* 0 = no tape is loaded, so we don't rewind after ejecting */ 466/* 0 = no tape is loaded, so we don't rewind after ejecting */
467#define IDETAPE_MEDIUM_PRESENT 9 467#define IDETAPE_MEDIUM_PRESENT 9
468 468
469/* A define for the READ BUFFER command */
470#define IDETAPE_RETRIEVE_FAULTY_BLOCK 6
471
472/* Some defines for the SPACE command */ 469/* Some defines for the SPACE command */
473#define IDETAPE_SPACE_OVER_FILEMARK 1 470#define IDETAPE_SPACE_OVER_FILEMARK 1
474#define IDETAPE_SPACE_TO_EOD 3 471#define IDETAPE_SPACE_TO_EOD 3
@@ -490,7 +487,6 @@ enum {
490 REQ_IDETAPE_PC2 = (1 << 1), /* packet command (second stage) */ 487 REQ_IDETAPE_PC2 = (1 << 1), /* packet command (second stage) */
491 REQ_IDETAPE_READ = (1 << 2), 488 REQ_IDETAPE_READ = (1 << 2),
492 REQ_IDETAPE_WRITE = (1 << 3), 489 REQ_IDETAPE_WRITE = (1 << 3),
493 REQ_IDETAPE_READ_BUFFER = (1 << 4),
494}; 490};
495 491
496/* Error codes returned in rq->errors to the higher part of the driver. */ 492/* Error codes returned in rq->errors to the higher part of the driver. */
@@ -1523,29 +1519,6 @@ static void idetape_create_read_cmd(idetape_tape_t *tape, idetape_pc_t *pc,
1523 set_bit(PC_DMA_RECOMMENDED, &pc->flags); 1519 set_bit(PC_DMA_RECOMMENDED, &pc->flags);
1524} 1520}
1525 1521
1526static void idetape_create_read_buffer_cmd(idetape_tape_t *tape,
1527 idetape_pc_t *pc, struct idetape_bh *bh)
1528{
1529 int size = 32768;
1530 struct idetape_bh *p = bh;
1531
1532 idetape_init_pc(pc);
1533 pc->c[0] = READ_BUFFER;
1534 pc->c[1] = IDETAPE_RETRIEVE_FAULTY_BLOCK;
1535 pc->c[7] = size >> 8;
1536 pc->c[8] = size & 0xff;
1537 pc->callback = &idetape_pc_callback;
1538 pc->bh = bh;
1539 atomic_set(&bh->b_count, 0);
1540 pc->buffer = NULL;
1541 while (p) {
1542 atomic_set(&p->b_count, 0);
1543 p = p->b_reqnext;
1544 }
1545 pc->request_transfer = size;
1546 pc->buffer_size = size;
1547}
1548
1549static void idetape_create_write_cmd(idetape_tape_t *tape, idetape_pc_t *pc, 1522static void idetape_create_write_cmd(idetape_tape_t *tape, idetape_pc_t *pc,
1550 unsigned int length, struct idetape_bh *bh) 1523 unsigned int length, struct idetape_bh *bh)
1551{ 1524{
@@ -1655,13 +1628,6 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
1655 (struct idetape_bh *)rq->special); 1628 (struct idetape_bh *)rq->special);
1656 goto out; 1629 goto out;
1657 } 1630 }
1658 if (rq->cmd[0] & REQ_IDETAPE_READ_BUFFER) {
1659 tape->postpone_cnt = 0;
1660 pc = idetape_next_pc_storage(drive);
1661 idetape_create_read_buffer_cmd(tape, pc,
1662 (struct idetape_bh *)rq->special);
1663 goto out;
1664 }
1665 if (rq->cmd[0] & REQ_IDETAPE_PC1) { 1631 if (rq->cmd[0] & REQ_IDETAPE_PC1) {
1666 pc = (idetape_pc_t *) rq->buffer; 1632 pc = (idetape_pc_t *) rq->buffer;
1667 rq->cmd[0] &= ~(REQ_IDETAPE_PC1); 1633 rq->cmd[0] &= ~(REQ_IDETAPE_PC1);
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index ad0e9955f73c..4a8952a6c3da 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -44,8 +44,6 @@
44 * inspiration from lots of linux users, esp. hamish@zot.apana.org.au 44 * inspiration from lots of linux users, esp. hamish@zot.apana.org.au
45 */ 45 */
46 46
47#define REVISION "Revision: 7.00alpha2"
48
49#define _IDE_C /* Tell ide.h it's really us */ 47#define _IDE_C /* Tell ide.h it's really us */
50 48
51#include <linux/module.h> 49#include <linux/module.h>
@@ -1618,7 +1616,7 @@ static int __init ide_init(void)
1618{ 1616{
1619 int ret; 1617 int ret;
1620 1618
1621 printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n"); 1619 printk(KERN_INFO "Uniform Multi-Platform E-IDE driver\n");
1622 system_bus_speed = ide_system_bus_speed(); 1620 system_bus_speed = ide_system_bus_speed();
1623 1621
1624 printk(KERN_INFO "ide: Assuming %dMHz system bus speed " 1622 printk(KERN_INFO "ide: Assuming %dMHz system bus speed "
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c
index 9d3851d27677..b7d81090d5da 100644
--- a/drivers/ide/legacy/gayle.c
+++ b/drivers/ide/legacy/gayle.c
@@ -94,7 +94,7 @@ static int gayle_ack_intr_a1200(ide_hwif_t *hwif)
94 94
95static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base, 95static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base,
96 unsigned long ctl, unsigned long irq_port, 96 unsigned long ctl, unsigned long irq_port,
97 ide_ack_intr_t *ack_intr); 97 ide_ack_intr_t *ack_intr)
98{ 98{
99 int i; 99 int i;
100 100
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c
index 0be1a824102b..1c163e4ef03f 100644
--- a/drivers/ide/pci/cs5520.c
+++ b/drivers/ide/pci/cs5520.c
@@ -147,11 +147,6 @@ static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_devic
147 147
148 /* We must not grab the entire device, it has 'ISA' space in its 148 /* We must not grab the entire device, it has 'ISA' space in its
149 * BARS too and we will freak out other bits of the kernel 149 * BARS too and we will freak out other bits of the kernel
150 *
151 * pci_enable_device_bars() is going away. I replaced it with
152 * IO only enable for now but I'll need confirmation this is
153 * allright for that device. If not, it will need some kind of
154 * quirk. --BenH.
155 */ 150 */
156 if (pci_enable_device_io(dev)) { 151 if (pci_enable_device_io(dev)) {
157 printk(KERN_WARNING "%s: Unable to enable 55x0.\n", d->name); 152 printk(KERN_WARNING "%s: Unable to enable 55x0.\n", d->name);
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index da4329790387..150422ec3cfa 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -3,26 +3,6 @@
3 * Copyright (C) 2006-2007 MontaVista Software, Inc. 3 * Copyright (C) 2006-2007 MontaVista Software, Inc.
4 * Copyright (C) 2007 Bartlomiej Zolnierkiewicz 4 * Copyright (C) 2007 Bartlomiej Zolnierkiewicz
5 * 5 *
6 * Promise Ultra33 cards with BIOS v1.20 through 1.28 will need this
7 * compiled into the kernel if you have more than one card installed.
8 * Note that BIOS v1.29 is reported to fix the problem. Since this is
9 * safe chipset tuning, including this support is harmless
10 *
11 * Promise Ultra66 cards with BIOS v1.11 this
12 * compiled into the kernel if you have more than one card installed.
13 *
14 * Promise Ultra100 cards.
15 *
16 * The latest chipset code will support the following ::
17 * Three Ultra33 controllers and 12 drives.
18 * 8 are UDMA supported and 4 are limited to DMA mode 2 multi-word.
19 * The 8/4 ratio is a BIOS code limit by promise.
20 *
21 * UNLESS you enable "CONFIG_PDC202XX_BURST"
22 *
23 */
24
25/*
26 * Portions Copyright (C) 1999 Promise Technology, Inc. 6 * Portions Copyright (C) 1999 Promise Technology, Inc.
27 * Author: Frank Tiernan (frankt@promise.com) 7 * Author: Frank Tiernan (frankt@promise.com)
28 * Released under terms of General Public License 8 * Released under terms of General Public License
@@ -344,7 +324,6 @@ static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase)
344 (primary_mode & 1) ? "MASTER" : "PCI", 324 (primary_mode & 1) ? "MASTER" : "PCI",
345 (secondary_mode & 1) ? "MASTER" : "PCI" ); 325 (secondary_mode & 1) ? "MASTER" : "PCI" );
346 326
347#ifdef CONFIG_PDC202XX_BURST
348 if (!(udma_speed_flag & 1)) { 327 if (!(udma_speed_flag & 1)) {
349 printk(KERN_INFO "%s: FORCING BURST BIT 0x%02x->0x%02x ", 328 printk(KERN_INFO "%s: FORCING BURST BIT 0x%02x->0x%02x ",
350 hwif->cds->name, udma_speed_flag, 329 hwif->cds->name, udma_speed_flag,
@@ -352,7 +331,6 @@ static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase)
352 outb(udma_speed_flag | 1, dmabase | 0x1f); 331 outb(udma_speed_flag | 1, dmabase | 0x1f);
353 printk("%sACTIVE\n", (inb(dmabase | 0x1f) & 1) ? "" : "IN"); 332 printk("%sACTIVE\n", (inb(dmabase | 0x1f) & 1) ? "" : "IN");
354 } 333 }
355#endif /* CONFIG_PDC202XX_BURST */
356 334
357 ide_setup_dma(hwif, dmabase); 335 ide_setup_dma(hwif, dmabase);
358} 336}
diff --git a/drivers/net/mlx4/alloc.c b/drivers/net/mlx4/alloc.c
index 521dc0322ee4..75ef9d0d974d 100644
--- a/drivers/net/mlx4/alloc.c
+++ b/drivers/net/mlx4/alloc.c
@@ -34,6 +34,7 @@
34#include <linux/slab.h> 34#include <linux/slab.h>
35#include <linux/bitmap.h> 35#include <linux/bitmap.h>
36#include <linux/dma-mapping.h> 36#include <linux/dma-mapping.h>
37#include <linux/vmalloc.h>
37 38
38#include "mlx4.h" 39#include "mlx4.h"
39 40
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index ca6b16fc3101..f1ef49fff118 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -243,10 +243,18 @@ nlm_bind_host(struct nlm_host *host)
243 .program = &nlm_program, 243 .program = &nlm_program,
244 .version = host->h_version, 244 .version = host->h_version,
245 .authflavor = RPC_AUTH_UNIX, 245 .authflavor = RPC_AUTH_UNIX,
246 .flags = (RPC_CLNT_CREATE_HARDRTRY | 246 .flags = (RPC_CLNT_CREATE_NOPING |
247 RPC_CLNT_CREATE_AUTOBIND), 247 RPC_CLNT_CREATE_AUTOBIND),
248 }; 248 };
249 249
250 /*
251 * lockd retries server side blocks automatically so we want
252 * those to be soft RPC calls. Client side calls need to be
253 * hard RPC tasks.
254 */
255 if (!host->h_server)
256 args.flags |= RPC_CLNT_CREATE_HARDRTRY;
257
250 clnt = rpc_create(&args); 258 clnt = rpc_create(&args);
251 if (!IS_ERR(clnt)) 259 if (!IS_ERR(clnt))
252 host->h_rpcclnt = clnt; 260 host->h_rpcclnt = clnt;
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 2f4d8fa66689..fe9bdb4a220c 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -763,11 +763,20 @@ callback:
763 dprintk("lockd: GRANTing blocked lock.\n"); 763 dprintk("lockd: GRANTing blocked lock.\n");
764 block->b_granted = 1; 764 block->b_granted = 1;
765 765
766 /* Schedule next grant callback in 30 seconds */ 766 /* keep block on the list, but don't reattempt until the RPC
767 nlmsvc_insert_block(block, 30 * HZ); 767 * completes or the submission fails
768 */
769 nlmsvc_insert_block(block, NLM_NEVER);
770
771 /* Call the client -- use a soft RPC task since nlmsvc_retry_blocked
772 * will queue up a new one if this one times out
773 */
774 error = nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG,
775 &nlmsvc_grant_ops);
768 776
769 /* Call the client */ 777 /* RPC submission failed, wait a bit and retry */
770 nlm_async_call(block->b_call, NLMPROC_GRANTED_MSG, &nlmsvc_grant_ops); 778 if (error < 0)
779 nlmsvc_insert_block(block, 10 * HZ);
771} 780}
772 781
773/* 782/*
@@ -786,6 +795,17 @@ static void nlmsvc_grant_callback(struct rpc_task *task, void *data)
786 795
787 dprintk("lockd: GRANT_MSG RPC callback\n"); 796 dprintk("lockd: GRANT_MSG RPC callback\n");
788 797
798 /* if the block is not on a list at this point then it has
799 * been invalidated. Don't try to requeue it.
800 *
801 * FIXME: it's possible that the block is removed from the list
802 * after this check but before the nlmsvc_insert_block. In that
803 * case it will be added back. Perhaps we need better locking
804 * for nlm_blocked?
805 */
806 if (list_empty(&block->b_list))
807 return;
808
789 /* Technically, we should down the file semaphore here. Since we 809 /* Technically, we should down the file semaphore here. Since we
790 * move the block towards the head of the queue only, no harm 810 * move the block towards the head of the queue only, no harm
791 * can be done, though. */ 811 * can be done, though. */
diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h
index 5d9d70cd17fc..342a2a0105c4 100644
--- a/include/asm-generic/topology.h
+++ b/include/asm-generic/topology.h
@@ -30,19 +30,19 @@
30/* Other architectures wishing to use this simple topology API should fill 30/* Other architectures wishing to use this simple topology API should fill
31 in the below functions as appropriate in their own <asm/topology.h> file. */ 31 in the below functions as appropriate in their own <asm/topology.h> file. */
32#ifndef cpu_to_node 32#ifndef cpu_to_node
33#define cpu_to_node(cpu) (0) 33#define cpu_to_node(cpu) ((void)(cpu),0)
34#endif 34#endif
35#ifndef parent_node 35#ifndef parent_node
36#define parent_node(node) (0) 36#define parent_node(node) ((void)(node),0)
37#endif 37#endif
38#ifndef node_to_cpumask 38#ifndef node_to_cpumask
39#define node_to_cpumask(node) (cpu_online_map) 39#define node_to_cpumask(node) ((void)node, cpu_online_map)
40#endif 40#endif
41#ifndef node_to_first_cpu 41#ifndef node_to_first_cpu
42#define node_to_first_cpu(node) (0) 42#define node_to_first_cpu(node) ((void)(node),0)
43#endif 43#endif
44#ifndef pcibus_to_node 44#ifndef pcibus_to_node
45#define pcibus_to_node(node) (-1) 45#define pcibus_to_node(bus) ((void)(bus), -1)
46#endif 46#endif
47 47
48#ifndef pcibus_to_cpumask 48#ifndef pcibus_to_cpumask
diff --git a/include/linux/ide.h b/include/linux/ide.h
index acec99da832d..a3b69c10d667 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -906,6 +906,8 @@ enum {
906 IDE_TFLAG_IN_DEVICE, 906 IDE_TFLAG_IN_DEVICE,
907 /* force 16-bit I/O operations */ 907 /* force 16-bit I/O operations */
908 IDE_TFLAG_IO_16BIT = (1 << 30), 908 IDE_TFLAG_IO_16BIT = (1 << 30),
909 /* ide_task_t was allocated using kmalloc() */
910 IDE_TFLAG_DYN = (1 << 31),
909}; 911};
910 912
911struct ide_taskfile { 913struct ide_taskfile {
@@ -998,8 +1000,7 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o
998void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *); 1000void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *);
999void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); 1001void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *);
1000 1002
1001/* FIXME: palm_bk3710 uses BLK_DEV_IDEDMA_PCI without BLK_DEV_IDEPCI! */ 1003#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
1002#if defined(CONFIG_BLK_DEV_IDEPCI) && defined(CONFIG_BLK_DEV_IDEDMA_PCI)
1003void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); 1004void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *);
1004#else 1005#else
1005static inline void ide_hwif_setup_dma(ide_hwif_t *hwif, 1006static inline void ide_hwif_setup_dma(ide_hwif_t *hwif,
@@ -1146,7 +1147,7 @@ ide_startstop_t ide_dma_intr(ide_drive_t *);
1146int ide_build_sglist(ide_drive_t *, struct request *); 1147int ide_build_sglist(ide_drive_t *, struct request *);
1147void ide_destroy_dmatable(ide_drive_t *); 1148void ide_destroy_dmatable(ide_drive_t *);
1148 1149
1149#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 1150#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
1150extern int ide_build_dmatable(ide_drive_t *, struct request *); 1151extern int ide_build_dmatable(ide_drive_t *, struct request *);
1151extern int ide_release_dma(ide_hwif_t *); 1152extern int ide_release_dma(ide_hwif_t *);
1152extern void ide_setup_dma(ide_hwif_t *, unsigned long); 1153extern void ide_setup_dma(ide_hwif_t *, unsigned long);
@@ -1157,7 +1158,7 @@ extern void ide_dma_start(ide_drive_t *);
1157extern int __ide_dma_end(ide_drive_t *); 1158extern int __ide_dma_end(ide_drive_t *);
1158extern void ide_dma_lost_irq(ide_drive_t *); 1159extern void ide_dma_lost_irq(ide_drive_t *);
1159extern void ide_dma_timeout(ide_drive_t *); 1160extern void ide_dma_timeout(ide_drive_t *);
1160#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 1161#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
1161 1162
1162#else 1163#else
1163static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; } 1164static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; }
@@ -1171,7 +1172,7 @@ static inline int ide_set_dma(ide_drive_t *drive) { return 1; }
1171static inline void ide_check_dma_crc(ide_drive_t *drive) { ; } 1172static inline void ide_check_dma_crc(ide_drive_t *drive) { ; }
1172#endif /* CONFIG_BLK_DEV_IDEDMA */ 1173#endif /* CONFIG_BLK_DEV_IDEDMA */
1173 1174
1174#ifndef CONFIG_BLK_DEV_IDEDMA_PCI 1175#ifndef CONFIG_BLK_DEV_IDEDMA_SFF
1175static inline void ide_release_dma(ide_hwif_t *drive) {;} 1176static inline void ide_release_dma(ide_hwif_t *drive) {;}
1176#endif 1177#endif
1177 1178
@@ -1294,7 +1295,7 @@ static inline void ide_dump_identify(u8 *id)
1294static inline int hwif_to_node(ide_hwif_t *hwif) 1295static inline int hwif_to_node(ide_hwif_t *hwif)
1295{ 1296{
1296 struct pci_dev *dev = to_pci_dev(hwif->dev); 1297 struct pci_dev *dev = to_pci_dev(hwif->dev);
1297 return dev ? pcibus_to_node(dev->bus) : -1; 1298 return hwif->dev ? pcibus_to_node(dev->bus) : -1;
1298} 1299}
1299 1300
1300static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive) 1301static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive)
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 64c771056187..64c97552964a 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -409,16 +409,13 @@ char * svc_print_addr(struct svc_rqst *, char *, size_t);
409 * for all cases without actually generating the checksum, so we just use a 409 * for all cases without actually generating the checksum, so we just use a
410 * static value. 410 * static value.
411 */ 411 */
412static inline void 412static inline void svc_reserve_auth(struct svc_rqst *rqstp, int space)
413svc_reserve_auth(struct svc_rqst *rqstp, int space)
414{ 413{
415 int added_space = 0; 414 int added_space = 0;
416 415
417 switch(rqstp->rq_authop->flavour) { 416 if (rqstp->rq_authop->flavour)
418 case RPC_AUTH_GSS: 417 added_space = RPC_MAX_AUTH_SIZE;
419 added_space = RPC_MAX_AUTH_SIZE; 418 svc_reserve(rqstp, space + added_space);
420 }
421 return svc_reserve(rqstp, space + added_space);
422} 419}
423 420
424#endif /* SUNRPC_SVC_H */ 421#endif /* SUNRPC_SVC_H */
diff --git a/init/Makefile b/init/Makefile
index c5f157ce293e..4a243df426f7 100644
--- a/init/Makefile
+++ b/init/Makefile
@@ -27,6 +27,7 @@ $(obj)/version.o: include/linux/compile.h
27# mkcompile_h will make sure to only update the 27# mkcompile_h will make sure to only update the
28# actual file if its content has changed. 28# actual file if its content has changed.
29 29
30 chk_compile.h = :
30 quiet_chk_compile.h = echo ' CHK $@' 31 quiet_chk_compile.h = echo ' CHK $@'
31silent_chk_compile.h = : 32silent_chk_compile.h = :
32include/linux/compile.h: FORCE 33include/linux/compile.h: FORCE
diff --git a/mm/memory.c b/mm/memory.c
index e5628a5fd678..717aa0e3be2d 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -989,6 +989,8 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
989 int i; 989 int i;
990 unsigned int vm_flags; 990 unsigned int vm_flags;
991 991
992 if (len <= 0)
993 return 0;
992 /* 994 /*
993 * Require read or write permissions. 995 * Require read or write permissions.
994 * If 'force' is set, we only require the "MAY" flags. 996 * If 'force' is set, we only require the "MAY" flags.
diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
index 3e321949e1dc..0598b229c11d 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
@@ -159,7 +159,8 @@ static int send_write(struct svcxprt_rdma *xprt, struct svc_rqst *rqstp,
159 BUG_ON(sge_count >= 32); 159 BUG_ON(sge_count >= 32);
160 dprintk("svcrdma: RDMA_WRITE rmr=%x, to=%llx, xdr_off=%d, " 160 dprintk("svcrdma: RDMA_WRITE rmr=%x, to=%llx, xdr_off=%d, "
161 "write_len=%d, xdr_sge=%p, sge_count=%d\n", 161 "write_len=%d, xdr_sge=%p, sge_count=%d\n",
162 rmr, to, xdr_off, write_len, xdr_sge, sge_count); 162 rmr, (unsigned long long)to, xdr_off,
163 write_len, xdr_sge, sge_count);
163 164
164 ctxt = svc_rdma_get_context(xprt); 165 ctxt = svc_rdma_get_context(xprt);
165 ctxt->count = 0; 166 ctxt->count = 0;
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index da3559ea92e0..d64e6badc942 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -39,10 +39,13 @@ escsq = $(subst $(squote),'\$(squote)',$1)
39# - If they are equal no change, and no timestamp update 39# - If they are equal no change, and no timestamp update
40# - stdin is piped in from the first prerequisite ($<) so one has 40# - stdin is piped in from the first prerequisite ($<) so one has
41# to specify a valid file as first prerequisite (often the kbuild file) 41# to specify a valid file as first prerequisite (often the kbuild file)
42 chk_filechk = :
42 quiet_chk_filechk = echo ' CHK $@' 43 quiet_chk_filechk = echo ' CHK $@'
43silent_chk_filechk = : 44silent_chk_filechk = :
45 upd_filechk = :
44 quiet_upd_filechk = echo ' UPD $@' 46 quiet_upd_filechk = echo ' UPD $@'
45silent_upd_filechk = : 47silent_upd_filechk = :
48
46define filechk 49define filechk
47 $(Q)set -e; \ 50 $(Q)set -e; \
48 $($(quiet)chk_filechk); \ 51 $($(quiet)chk_filechk); \
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index e5ed07510309..44f16d9041e3 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1272,12 +1272,18 @@ static int task_has_perm(struct task_struct *tsk1,
1272 SECCLASS_PROCESS, perms, NULL); 1272 SECCLASS_PROCESS, perms, NULL);
1273} 1273}
1274 1274
1275#if CAP_LAST_CAP > 63
1276#error Fix SELinux to handle capabilities > 63.
1277#endif
1278
1275/* Check whether a task is allowed to use a capability. */ 1279/* Check whether a task is allowed to use a capability. */
1276static int task_has_capability(struct task_struct *tsk, 1280static int task_has_capability(struct task_struct *tsk,
1277 int cap) 1281 int cap)
1278{ 1282{
1279 struct task_security_struct *tsec; 1283 struct task_security_struct *tsec;
1280 struct avc_audit_data ad; 1284 struct avc_audit_data ad;
1285 u16 sclass;
1286 u32 av = CAP_TO_MASK(cap);
1281 1287
1282 tsec = tsk->security; 1288 tsec = tsk->security;
1283 1289
@@ -1285,8 +1291,19 @@ static int task_has_capability(struct task_struct *tsk,
1285 ad.tsk = tsk; 1291 ad.tsk = tsk;
1286 ad.u.cap = cap; 1292 ad.u.cap = cap;
1287 1293
1288 return avc_has_perm(tsec->sid, tsec->sid, 1294 switch (CAP_TO_INDEX(cap)) {
1289 SECCLASS_CAPABILITY, CAP_TO_MASK(cap), &ad); 1295 case 0:
1296 sclass = SECCLASS_CAPABILITY;
1297 break;
1298 case 1:
1299 sclass = SECCLASS_CAPABILITY2;
1300 break;
1301 default:
1302 printk(KERN_ERR
1303 "SELinux: out of range capability %d\n", cap);
1304 BUG();
1305 }
1306 return avc_has_perm(tsec->sid, tsec->sid, sclass, av, &ad);
1290} 1307}
1291 1308
1292/* Check whether a task is allowed to use a system operation. */ 1309/* Check whether a task is allowed to use a system operation. */
diff --git a/security/selinux/include/av_perm_to_string.h b/security/selinux/include/av_perm_to_string.h
index 399f868c5c8f..d5696690d3a2 100644
--- a/security/selinux/include/av_perm_to_string.h
+++ b/security/selinux/include/av_perm_to_string.h
@@ -132,6 +132,9 @@
132 S_(SECCLASS_CAPABILITY, CAPABILITY__LEASE, "lease") 132 S_(SECCLASS_CAPABILITY, CAPABILITY__LEASE, "lease")
133 S_(SECCLASS_CAPABILITY, CAPABILITY__AUDIT_WRITE, "audit_write") 133 S_(SECCLASS_CAPABILITY, CAPABILITY__AUDIT_WRITE, "audit_write")
134 S_(SECCLASS_CAPABILITY, CAPABILITY__AUDIT_CONTROL, "audit_control") 134 S_(SECCLASS_CAPABILITY, CAPABILITY__AUDIT_CONTROL, "audit_control")
135 S_(SECCLASS_CAPABILITY, CAPABILITY__SETFCAP, "setfcap")
136 S_(SECCLASS_CAPABILITY2, CAPABILITY2__MAC_OVERRIDE, "mac_override")
137 S_(SECCLASS_CAPABILITY2, CAPABILITY2__MAC_ADMIN, "mac_admin")
135 S_(SECCLASS_NETLINK_ROUTE_SOCKET, NETLINK_ROUTE_SOCKET__NLMSG_READ, "nlmsg_read") 138 S_(SECCLASS_NETLINK_ROUTE_SOCKET, NETLINK_ROUTE_SOCKET__NLMSG_READ, "nlmsg_read")
136 S_(SECCLASS_NETLINK_ROUTE_SOCKET, NETLINK_ROUTE_SOCKET__NLMSG_WRITE, "nlmsg_write") 139 S_(SECCLASS_NETLINK_ROUTE_SOCKET, NETLINK_ROUTE_SOCKET__NLMSG_WRITE, "nlmsg_write")
137 S_(SECCLASS_NETLINK_FIREWALL_SOCKET, NETLINK_FIREWALL_SOCKET__NLMSG_READ, "nlmsg_read") 140 S_(SECCLASS_NETLINK_FIREWALL_SOCKET, NETLINK_FIREWALL_SOCKET__NLMSG_READ, "nlmsg_read")
diff --git a/security/selinux/include/av_permissions.h b/security/selinux/include/av_permissions.h
index 84c9abc80978..75b41311ab86 100644
--- a/security/selinux/include/av_permissions.h
+++ b/security/selinux/include/av_permissions.h
@@ -533,6 +533,9 @@
533#define CAPABILITY__LEASE 0x10000000UL 533#define CAPABILITY__LEASE 0x10000000UL
534#define CAPABILITY__AUDIT_WRITE 0x20000000UL 534#define CAPABILITY__AUDIT_WRITE 0x20000000UL
535#define CAPABILITY__AUDIT_CONTROL 0x40000000UL 535#define CAPABILITY__AUDIT_CONTROL 0x40000000UL
536#define CAPABILITY__SETFCAP 0x80000000UL
537#define CAPABILITY2__MAC_OVERRIDE 0x00000001UL
538#define CAPABILITY2__MAC_ADMIN 0x00000002UL
536#define NETLINK_ROUTE_SOCKET__IOCTL 0x00000001UL 539#define NETLINK_ROUTE_SOCKET__IOCTL 0x00000001UL
537#define NETLINK_ROUTE_SOCKET__READ 0x00000002UL 540#define NETLINK_ROUTE_SOCKET__READ 0x00000002UL
538#define NETLINK_ROUTE_SOCKET__WRITE 0x00000004UL 541#define NETLINK_ROUTE_SOCKET__WRITE 0x00000004UL
diff --git a/security/selinux/include/class_to_string.h b/security/selinux/include/class_to_string.h
index b1b0d1d8f950..bd813c366e34 100644
--- a/security/selinux/include/class_to_string.h
+++ b/security/selinux/include/class_to_string.h
@@ -71,3 +71,4 @@
71 S_(NULL) 71 S_(NULL)
72 S_(NULL) 72 S_(NULL)
73 S_("peer") 73 S_("peer")
74 S_("capability2")
diff --git a/security/selinux/include/flask.h b/security/selinux/include/flask.h
index 09e9dd23ee1a..febf8868e852 100644
--- a/security/selinux/include/flask.h
+++ b/security/selinux/include/flask.h
@@ -51,6 +51,7 @@
51#define SECCLASS_DCCP_SOCKET 60 51#define SECCLASS_DCCP_SOCKET 60
52#define SECCLASS_MEMPROTECT 61 52#define SECCLASS_MEMPROTECT 61
53#define SECCLASS_PEER 68 53#define SECCLASS_PEER 68
54#define SECCLASS_CAPABILITY2 69
54 55
55/* 56/*
56 * Security identifier indices for initial entities 57 * Security identifier indices for initial entities