]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Pull test into release branch
authorLen Brown <len.brown@intel.com>
Tue, 6 Feb 2007 20:31:00 +0000 (15:31 -0500)
committerLen Brown <len.brown@intel.com>
Tue, 6 Feb 2007 20:31:00 +0000 (15:31 -0500)
23 files changed:
Makefile
arch/i386/kernel/efi.c
arch/ia64/kernel/acpi.c
arch/ia64/kernel/irq.c
drivers/net/smc911x.c
drivers/scsi/qla4xxx/ql4_def.h
drivers/scsi/qla4xxx/ql4_glbl.h
drivers/scsi/qla4xxx/ql4_init.c
drivers/scsi/qla4xxx/ql4_isr.c
drivers/scsi/qla4xxx/ql4_mbx.c
drivers/scsi/qla4xxx/ql4_os.c
drivers/scsi/qla4xxx/ql4_version.h
drivers/scsi/scsi_scan.c
drivers/scsi/sd.c
drivers/scsi/st.c
drivers/usb/net/rtl8150.c
fs/aio.c
fs/block_dev.c
include/asm-alpha/unistd.h
include/asm-x86_64/dma-mapping.h
net/ipv4/netfilter/ip_conntrack_netlink.c
net/netfilter/Kconfig
net/netfilter/nf_conntrack_netlink.c

index 75adfb539977d42a35ee77913cbb102304b0f81f..7e2750f4ca707a8f009987810d6756a869128f6a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 20
-EXTRAVERSION =-rc7
+EXTRAVERSION =
 NAME = Homicidal Dwarf Hamster
 
 # *DOCUMENTATION*
index b92c7f0a358aa79836a2ccbc56cd7bf386555a80..8f9c624ace6fb46d2094485b8c8c051f6f7d72ee 100644 (file)
@@ -472,6 +472,70 @@ static inline void __init check_range_for_systab(efi_memory_desc_t *md)
        }
 }
 
+/*
+ * Wrap all the virtual calls in a way that forces the parameters on the stack.
+ */
+
+#define efi_call_virt(f, args...) \
+     ((efi_##f##_t __attribute__((regparm(0)))*)efi.systab->runtime->f)(args)
+
+static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc)
+{
+       return efi_call_virt(get_time, tm, tc);
+}
+
+static efi_status_t virt_efi_set_time (efi_time_t *tm)
+{
+       return efi_call_virt(set_time, tm);
+}
+
+static efi_status_t virt_efi_get_wakeup_time (efi_bool_t *enabled,
+                                             efi_bool_t *pending,
+                                             efi_time_t *tm)
+{
+       return efi_call_virt(get_wakeup_time, enabled, pending, tm);
+}
+
+static efi_status_t virt_efi_set_wakeup_time (efi_bool_t enabled,
+                                             efi_time_t *tm)
+{
+       return efi_call_virt(set_wakeup_time, enabled, tm);
+}
+
+static efi_status_t virt_efi_get_variable (efi_char16_t *name,
+                                          efi_guid_t *vendor, u32 *attr,
+                                          unsigned long *data_size, void *data)
+{
+       return efi_call_virt(get_variable, name, vendor, attr, data_size, data);
+}
+
+static efi_status_t virt_efi_get_next_variable (unsigned long *name_size,
+                                               efi_char16_t *name,
+                                               efi_guid_t *vendor)
+{
+       return efi_call_virt(get_next_variable, name_size, name, vendor);
+}
+
+static efi_status_t virt_efi_set_variable (efi_char16_t *name,
+                                          efi_guid_t *vendor,
+                                          unsigned long attr,
+                                          unsigned long data_size, void *data)
+{
+       return efi_call_virt(set_variable, name, vendor, attr, data_size, data);
+}
+
+static efi_status_t virt_efi_get_next_high_mono_count (u32 *count)
+{
+       return efi_call_virt(get_next_high_mono_count, count);
+}
+
+static void virt_efi_reset_system (int reset_type, efi_status_t status,
+                                  unsigned long data_size,
+                                  efi_char16_t *data)
+{
+       efi_call_virt(reset_system, reset_type, status, data_size, data);
+}
+
 /*
  * This function will switch the EFI runtime services to virtual mode.
  * Essentially, look through the EFI memmap and map every region that
@@ -525,22 +589,15 @@ void __init efi_enter_virtual_mode(void)
         * pointers in the runtime service table to the new virtual addresses.
         */
 
-       efi.get_time = (efi_get_time_t *) efi.systab->runtime->get_time;
-       efi.set_time = (efi_set_time_t *) efi.systab->runtime->set_time;
-       efi.get_wakeup_time = (efi_get_wakeup_time_t *)
-                                       efi.systab->runtime->get_wakeup_time;
-       efi.set_wakeup_time = (efi_set_wakeup_time_t *)
-                                       efi.systab->runtime->set_wakeup_time;
-       efi.get_variable = (efi_get_variable_t *)
-                                       efi.systab->runtime->get_variable;
-       efi.get_next_variable = (efi_get_next_variable_t *)
-                                       efi.systab->runtime->get_next_variable;
-       efi.set_variable = (efi_set_variable_t *)
-                                       efi.systab->runtime->set_variable;
-       efi.get_next_high_mono_count = (efi_get_next_high_mono_count_t *)
-                                       efi.systab->runtime->get_next_high_mono_count;
-       efi.reset_system = (efi_reset_system_t *)
-                                       efi.systab->runtime->reset_system;
+       efi.get_time = virt_efi_get_time;
+       efi.set_time = virt_efi_set_time;
+       efi.get_wakeup_time = virt_efi_get_wakeup_time;
+       efi.set_wakeup_time = virt_efi_set_wakeup_time;
+       efi.get_variable = virt_efi_get_variable;
+       efi.get_next_variable = virt_efi_get_next_variable;
+       efi.set_variable = virt_efi_set_variable;
+       efi.get_next_high_mono_count = virt_efi_get_next_high_mono_count;
+       efi.reset_system = virt_efi_reset_system;
 }
 
 void __init
index a99b0cc92881919a976fabdb02ca3274e8e449e7..9197d7b361b33da914744bff7a2a393a799c9ba9 100644 (file)
@@ -602,6 +602,9 @@ EXPORT_SYMBOL(acpi_register_gsi);
 
 void acpi_unregister_gsi(u32 gsi)
 {
+       if (acpi_irq_model == ACPI_IRQ_MODEL_PLATFORM)
+               return;
+
        iosapic_unregister_intr(gsi);
 }
 
index 54d55e4d64f7e1e70aa30d8d2c853a35bafe5f0a..ce49c85c928f5fe44f52501c86211b11926c89d8 100644 (file)
@@ -122,6 +122,9 @@ static void migrate_irqs(void)
        for (irq=0; irq < NR_IRQS; irq++) {
                desc = irq_desc + irq;
 
+               if (desc->status == IRQ_DISABLED)
+                       continue;
+
                /*
                 * No handling for now.
                 * TBD: Implement a disable function so we can now
index 880d9fdd7c670b6a31ff2e8d3282ba65b7cb40ab..43af61438449c86c90c3dcf189a035932be1ba81 100644 (file)
@@ -968,11 +968,11 @@ static void smc911x_phy_configure(struct work_struct *work)
         * We should not be called if phy_type is zero.
         */
        if (lp->phy_type == 0)
-                goto smc911x_phy_configure_exit;
+                goto smc911x_phy_configure_exit_nolock;
 
        if (smc911x_phy_reset(dev, phyaddr)) {
                printk("%s: PHY reset timed out\n", dev->name);
-               goto smc911x_phy_configure_exit;
+               goto smc911x_phy_configure_exit_nolock;
        }
        spin_lock_irqsave(&lp->lock, flags);
 
@@ -1041,6 +1041,7 @@ static void smc911x_phy_configure(struct work_struct *work)
 
 smc911x_phy_configure_exit:
        spin_unlock_irqrestore(&lp->lock, flags);
+smc911x_phy_configure_exit_nolock:
        lp->work_pending = 0;
 }
 
index 4249e52a559290a7713dc22af921933ef7b4d5f3..6f4cf2dd2f4a45a2cdf258471db05090bd2fb01a 100644 (file)
@@ -418,7 +418,6 @@ struct scsi_qla_host {
         * concurrently.
         */
        struct mutex  mbox_sem;
-       wait_queue_head_t mailbox_wait_queue;
 
        /* temporary mailbox status registers */
        volatile uint8_t mbox_status_count;
index 2122967bbf0b1a56d9bd28819745bb99aea4882a..e021eb5db2b2c6c7eb858c2092ce7c56903a47fb 100644 (file)
@@ -76,4 +76,5 @@ int qla4xxx_process_ddb_changed(struct scsi_qla_host * ha,
 extern int ql4xextended_error_logging;
 extern int ql4xdiscoverywait;
 extern int ql4xdontresethba;
+extern int ql4_mod_unload;
 #endif /* _QLA4x_GBL_H */
index cc210f297a78a22e6bf3269ab275964051d48b38..b907b06d72ab4b30bd8541fa6fc1a4955b251284 100644 (file)
@@ -958,25 +958,25 @@ static int qla4xxx_start_firmware_from_flash(struct scsi_qla_host *ha)
        return status;
 }
 
-int ql4xxx_lock_drvr_wait(struct scsi_qla_host *a)
+int ql4xxx_lock_drvr_wait(struct scsi_qla_host *ha)
 {
-#define QL4_LOCK_DRVR_WAIT     300
-#define QL4_LOCK_DRVR_SLEEP    100
+#define QL4_LOCK_DRVR_WAIT     30
+#define QL4_LOCK_DRVR_SLEEP    1
 
        int drvr_wait = QL4_LOCK_DRVR_WAIT;
        while (drvr_wait) {
-               if (ql4xxx_lock_drvr(a) == 0) {
-                       msleep(QL4_LOCK_DRVR_SLEEP);
+               if (ql4xxx_lock_drvr(ha) == 0) {
+                       ssleep(QL4_LOCK_DRVR_SLEEP);
                        if (drvr_wait) {
                                DEBUG2(printk("scsi%ld: %s: Waiting for "
-                                             "Global Init Semaphore...n",
-                                             a->host_no,
-                                             __func__));
+                                             "Global Init Semaphore(%d)...n",
+                                             ha->host_no,
+                                             __func__, drvr_wait));
                        }
                        drvr_wait -= QL4_LOCK_DRVR_SLEEP;
                } else {
                        DEBUG2(printk("scsi%ld: %s: Global Init Semaphore "
-                                     "acquired.n", a->host_no, __func__));
+                                     "acquired.n", ha->host_no, __func__));
                        return QLA_SUCCESS;
                }
        }
index ef975e0dc87fb9a5eef9082dbece9fab735710fa..35b9e36a0e8dbaa924a7391ae33c98765120ddef 100644 (file)
@@ -433,7 +433,6 @@ static void qla4xxx_isr_decode_mailbox(struct scsi_qla_host * ha,
                                        readl(&ha->reg->mailbox[i]);
 
                        set_bit(AF_MBOX_COMMAND_DONE, &ha->flags);
-                       wake_up(&ha->mailbox_wait_queue);
                }
        } else if (mbox_status >> 12 == MBOX_ASYNC_EVENT_STATUS) {
                /* Immediately process the AENs that don't require much work.
@@ -686,7 +685,8 @@ irqreturn_t qla4xxx_intr_handler(int irq, void *dev_id)
                               &ha->reg->ctrl_status);
                        readl(&ha->reg->ctrl_status);
 
-                       set_bit(DPC_RESET_HA_INTR, &ha->dpc_flags);
+                       if (!ql4_mod_unload)
+                               set_bit(DPC_RESET_HA_INTR, &ha->dpc_flags);
 
                        break;
                } else if (intr_status & INTR_PENDING) {
index b721dc5dd7112add3a815d358b97c6fe6e30ecc0..7f28657eef3f1d60e74827d7084408299042eea3 100644 (file)
@@ -29,18 +29,30 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount,
        u_long wait_count;
        uint32_t intr_status;
        unsigned long flags = 0;
-       DECLARE_WAITQUEUE(wait, current);
-
-       mutex_lock(&ha->mbox_sem);
-
-       /* Mailbox code active */
-       set_bit(AF_MBOX_COMMAND, &ha->flags);
 
        /* Make sure that pointers are valid */
        if (!mbx_cmd || !mbx_sts) {
                DEBUG2(printk("scsi%ld: %s: Invalid mbx_cmd or mbx_sts "
                              "pointer\n", ha->host_no, __func__));
-               goto mbox_exit;
+               return status;
+       }
+       /* Mailbox code active */
+       wait_count = MBOX_TOV * 100;
+
+       while (wait_count--) {
+               mutex_lock(&ha->mbox_sem);
+               if (!test_bit(AF_MBOX_COMMAND, &ha->flags)) {
+                       set_bit(AF_MBOX_COMMAND, &ha->flags);
+                       mutex_unlock(&ha->mbox_sem);
+                       break;
+               }
+               mutex_unlock(&ha->mbox_sem);
+               if (!wait_count) {
+                       DEBUG2(printk("scsi%ld: %s: mbox_sem failed\n",
+                               ha->host_no, __func__));
+                       return status;
+               }
+               msleep(10);
        }
 
        /* To prevent overwriting mailbox registers for a command that has
@@ -73,8 +85,6 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount,
        spin_unlock_irqrestore(&ha->hardware_lock, flags);
 
        /* Wait for completion */
-       set_current_state(TASK_UNINTERRUPTIBLE);
-       add_wait_queue(&ha->mailbox_wait_queue, &wait);
 
        /*
         * If we don't want status, don't wait for the mailbox command to
@@ -83,8 +93,6 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount,
         */
        if (outCount == 0) {
                status = QLA_SUCCESS;
-               set_current_state(TASK_RUNNING);
-               remove_wait_queue(&ha->mailbox_wait_queue, &wait);
                goto mbox_exit;
        }
        /* Wait for command to complete */
@@ -108,8 +116,6 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount,
                spin_unlock_irqrestore(&ha->hardware_lock, flags);
                msleep(10);
        }
-       set_current_state(TASK_RUNNING);
-       remove_wait_queue(&ha->mailbox_wait_queue, &wait);
 
        /* Check for mailbox timeout. */
        if (!test_bit(AF_MBOX_COMMAND_DONE, &ha->flags)) {
@@ -155,9 +161,10 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount,
        spin_unlock_irqrestore(&ha->hardware_lock, flags);
 
 mbox_exit:
+       mutex_lock(&ha->mbox_sem);
        clear_bit(AF_MBOX_COMMAND, &ha->flags);
-       clear_bit(AF_MBOX_COMMAND_DONE, &ha->flags);
        mutex_unlock(&ha->mbox_sem);
+       clear_bit(AF_MBOX_COMMAND_DONE, &ha->flags);
 
        return status;
 }
index 9ef693c8809aac59ef2d823798fd5592664c042c..81fb7bd44f0167131a9eb7cc8f21a0d00172d91e 100644 (file)
@@ -40,6 +40,8 @@ MODULE_PARM_DESC(ql4xextended_error_logging,
                 "Option to enable extended error logging, "
                 "Default is 0 - no logging, 1 - debug logging");
 
+int ql4_mod_unload = 0;
+
 /*
  * SCSI host template entry points
  */
@@ -422,6 +424,9 @@ static int qla4xxx_queuecommand(struct scsi_cmnd *cmd,
                goto qc_host_busy;
        }
 
+       if (test_bit(DPC_RESET_HA_INTR, &ha->dpc_flags))
+               goto qc_host_busy;
+
        spin_unlock_irq(ha->host->host_lock);
 
        srb = qla4xxx_get_new_srb(ha, ddb_entry, cmd, done);
@@ -707,16 +712,12 @@ static int qla4xxx_cmd_wait(struct scsi_qla_host *ha)
        return stat;
 }
 
-/**
- * qla4xxx_soft_reset - performs soft reset.
- * @ha: Pointer to host adapter structure.
- **/
-int qla4xxx_soft_reset(struct scsi_qla_host *ha)
+static void qla4xxx_hw_reset(struct scsi_qla_host *ha)
 {
-       uint32_t max_wait_time;
-       unsigned long flags = 0;
-       int status = QLA_ERROR;
        uint32_t ctrl_status;
+       unsigned long flags = 0;
+
+       DEBUG2(printk(KERN_ERR "scsi%ld: %s\n", ha->host_no, __func__));
 
        spin_lock_irqsave(&ha->hardware_lock, flags);
 
@@ -733,6 +734,20 @@ int qla4xxx_soft_reset(struct scsi_qla_host *ha)
        readl(&ha->reg->ctrl_status);
 
        spin_unlock_irqrestore(&ha->hardware_lock, flags);
+}
+
+/**
+ * qla4xxx_soft_reset - performs soft reset.
+ * @ha: Pointer to host adapter structure.
+ **/
+int qla4xxx_soft_reset(struct scsi_qla_host *ha)
+{
+       uint32_t max_wait_time;
+       unsigned long flags = 0;
+       int status = QLA_ERROR;
+       uint32_t ctrl_status;
+
+       qla4xxx_hw_reset(ha);
 
        /* Wait until the Network Reset Intr bit is cleared */
        max_wait_time = RESET_INTR_TOV;
@@ -966,10 +981,12 @@ static void qla4xxx_do_dpc(struct work_struct *work)
        struct scsi_qla_host *ha =
                container_of(work, struct scsi_qla_host, dpc_work);
        struct ddb_entry *ddb_entry, *dtemp;
+       int status = QLA_ERROR;
 
        DEBUG2(printk("scsi%ld: %s: DPC handler waking up."
-               "flags = 0x%08lx, dpc_flags = 0x%08lx\n",
-               ha->host_no, __func__, ha->flags, ha->dpc_flags));
+               "flags = 0x%08lx, dpc_flags = 0x%08lx ctrl_stat = 0x%08x\n",
+               ha->host_no, __func__, ha->flags, ha->dpc_flags,
+               readw(&ha->reg->ctrl_status)));
 
        /* Initialization not yet finished. Don't do anything yet. */
        if (!test_bit(AF_INIT_DONE, &ha->flags))
@@ -983,31 +1000,28 @@ static void qla4xxx_do_dpc(struct work_struct *work)
                        test_bit(DPC_RESET_HA, &ha->dpc_flags))
                        qla4xxx_recover_adapter(ha, PRESERVE_DDB_LIST);
 
-               if (test_and_clear_bit(DPC_RESET_HA_INTR, &ha->dpc_flags)) {
+               if (test_bit(DPC_RESET_HA_INTR, &ha->dpc_flags)) {
                        uint8_t wait_time = RESET_INTR_TOV;
-                       unsigned long flags = 0;
-
-                       qla4xxx_flush_active_srbs(ha);
 
-                       spin_lock_irqsave(&ha->hardware_lock, flags);
                        while ((readw(&ha->reg->ctrl_status) &
                                (CSR_SOFT_RESET | CSR_FORCE_SOFT_RESET)) != 0) {
                                if (--wait_time == 0)
                                        break;
-
-                               spin_unlock_irqrestore(&ha->hardware_lock,
-                                                      flags);
-
                                msleep(1000);
-
-                               spin_lock_irqsave(&ha->hardware_lock, flags);
                        }
-                       spin_unlock_irqrestore(&ha->hardware_lock, flags);
-
                        if (wait_time == 0)
                                DEBUG2(printk("scsi%ld: %s: SR|FSR "
                                              "bit not cleared-- resetting\n",
                                              ha->host_no, __func__));
+                       qla4xxx_flush_active_srbs(ha);
+                       if (ql4xxx_lock_drvr_wait(ha) == QLA_SUCCESS) {
+                               qla4xxx_process_aen(ha, FLUSH_DDB_CHANGED_AENS);
+                               status = qla4xxx_initialize_adapter(ha,
+                                               PRESERVE_DDB_LIST);
+                       }
+                       clear_bit(DPC_RESET_HA_INTR, &ha->dpc_flags);
+                       if (status == QLA_SUCCESS)
+                               qla4xxx_enable_intrs(ha);
                }
        }
 
@@ -1062,7 +1076,7 @@ static void qla4xxx_free_adapter(struct scsi_qla_host *ha)
 
        /* Issue Soft Reset to put firmware in unknown state */
        if (ql4xxx_lock_drvr_wait(ha) == QLA_SUCCESS)
-               qla4xxx_soft_reset(ha);
+               qla4xxx_hw_reset(ha);
 
        /* Remove timer thread, if present */
        if (ha->timer_active)
@@ -1198,7 +1212,6 @@ static int __devinit qla4xxx_probe_adapter(struct pci_dev *pdev,
        INIT_LIST_HEAD(&ha->free_srb_q);
 
        mutex_init(&ha->mbox_sem);
-       init_waitqueue_head(&ha->mailbox_wait_queue);
 
        spin_lock_init(&ha->hardware_lock);
 
@@ -1665,6 +1678,7 @@ no_srp_cache:
 
 static void __exit qla4xxx_module_exit(void)
 {
+       ql4_mod_unload = 1;
        pci_unregister_driver(&qla4xxx_pci_driver);
        iscsi_unregister_transport(&qla4xxx_iscsi_transport);
        kmem_cache_destroy(srb_cachep);
index 454e19c8ad685f1e7d44543c2f0f419d75b1f5be..e5183a697d1f20a4c236aa8cd20d4ef933d27e40 100644 (file)
@@ -5,4 +5,4 @@
  * See LICENSE.qla4xxx for copyright and licensing details.
  */
 
-#define QLA4XXX_DRIVER_VERSION "5.00.07-k"
+#define QLA4XXX_DRIVER_VERSION "5.00.07-k1"
index b83d03c4deef1934e051358082805b93627aa4e0..96b7cbd746a84ac323d92bf6c72d0333515b3fd3 100644 (file)
@@ -1453,6 +1453,12 @@ struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel,
        struct device *parent = &shost->shost_gendev;
        struct scsi_target *starget;
 
+       if (strncmp(scsi_scan_type, "none", 4) == 0)
+               return ERR_PTR(-ENODEV);
+
+       if (!shost->async_scan)
+               scsi_complete_async_scans();
+
        starget = scsi_alloc_target(parent, channel, id);
        if (!starget)
                return ERR_PTR(-ENOMEM);
index 978bfc1e0c6a37c5edf91c916b783837a6ad4440..b781a90d6699038f4f2a0e819ca6d2a93dd619bb 100644 (file)
@@ -1647,16 +1647,6 @@ static int sd_probe(struct device *dev)
        if (error)
                goto out_put;
 
-       class_device_initialize(&sdkp->cdev);
-       sdkp->cdev.dev = &sdp->sdev_gendev;
-       sdkp->cdev.class = &sd_disk_class;
-       strncpy(sdkp->cdev.class_id, sdp->sdev_gendev.bus_id, BUS_ID_SIZE);
-
-       if (class_device_add(&sdkp->cdev))
-               goto out_put;
-
-       get_device(&sdp->sdev_gendev);
-
        sdkp->device = sdp;
        sdkp->driver = &sd_template;
        sdkp->disk = gd;
@@ -1670,6 +1660,16 @@ static int sd_probe(struct device *dev)
                        sdp->timeout = SD_MOD_TIMEOUT;
        }
 
+       class_device_initialize(&sdkp->cdev);
+       sdkp->cdev.dev = &sdp->sdev_gendev;
+       sdkp->cdev.class = &sd_disk_class;
+       strncpy(sdkp->cdev.class_id, sdp->sdev_gendev.bus_id, BUS_ID_SIZE);
+
+       if (class_device_add(&sdkp->cdev))
+               goto out_put;
+
+       get_device(&sdp->sdev_gendev);
+
        gd->major = sd_major((index & 0xf0) >> 4);
        gd->first_minor = ((index & 0xf) << 4) | (index & 0xfff00);
        gd->minors = 16;
index e016e0906e1a99aa2a26728e3b9238213aafd97b..488ec7948a570766856436970a40aa2fd3813528 100644 (file)
@@ -2816,15 +2816,18 @@ static int st_int_ioctl(struct scsi_tape *STp, unsigned int cmd_in, unsigned lon
 
                if (cmd_in == MTWEOF &&
                    cmdstatp->have_sense &&
-                   (cmdstatp->flags & SENSE_EOM) &&
-                   (cmdstatp->sense_hdr.sense_key == NO_SENSE ||
-                    cmdstatp->sense_hdr.sense_key == RECOVERED_ERROR) &&
-                   undone == 0) {
-                       ioctl_result = 0;       /* EOF written successfully at EOM */
-                       if (fileno >= 0)
-                               fileno++;
+                   (cmdstatp->flags & SENSE_EOM)) {
+                       if (cmdstatp->sense_hdr.sense_key == NO_SENSE ||
+                           cmdstatp->sense_hdr.sense_key == RECOVERED_ERROR) {
+                               ioctl_result = 0;       /* EOF(s) written successfully at EOM */
+                               STps->eof = ST_NOEOF;
+                       } else {  /* Writing EOF(s) failed */
+                               if (fileno >= 0)
+                                       fileno -= undone;
+                               if (undone < arg)
+                                       STps->eof = ST_NOEOF;
+                       }
                        STps->drv_file = fileno;
-                       STps->eof = ST_NOEOF;
                } else if ((cmd_in == MTFSF) || (cmd_in == MTFSFM)) {
                        if (fileno >= 0)
                                STps->drv_file = fileno - undone;
index e0eecda78ec12cac845fac5831742643db94688f..670262a38a0f25e8471ad9073ac970901f1c981f 100644 (file)
@@ -284,7 +284,8 @@ static int write_mii_word(rtl8150_t * dev, u8 phy, __u8 indx, u16 reg)
        u8 data[3], tmp;
 
        data[0] = phy;
-       *(data + 1) = cpu_to_le16p(&reg);
+       data[1] = reg & 0xff;
+       data[2] = (reg >> 8) & 0xff;
        tmp = indx | PHY_WRITE | PHY_GO;
        i = 0;
 
index ee20fc4240e0684bdb84485139ada96cb3925c09..55991e4132a7f30f778a7f86862b8992c59bafca 100644 (file)
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -298,17 +298,23 @@ static void wait_for_all_aios(struct kioctx *ctx)
        struct task_struct *tsk = current;
        DECLARE_WAITQUEUE(wait, tsk);
 
+       spin_lock_irq(&ctx->ctx_lock);
        if (!ctx->reqs_active)
-               return;
+               goto out;
 
        add_wait_queue(&ctx->wait, &wait);
        set_task_state(tsk, TASK_UNINTERRUPTIBLE);
        while (ctx->reqs_active) {
+               spin_unlock_irq(&ctx->ctx_lock);
                schedule();
                set_task_state(tsk, TASK_UNINTERRUPTIBLE);
+               spin_lock_irq(&ctx->ctx_lock);
        }
        __set_task_state(tsk, TASK_RUNNING);
        remove_wait_queue(&ctx->wait, &wait);
+
+out:
+       spin_unlock_irq(&ctx->ctx_lock);
 }
 
 /* wait_on_sync_kiocb:
@@ -424,7 +430,6 @@ static struct kiocb fastcall *__aio_get_req(struct kioctx *ctx)
        ring = kmap_atomic(ctx->ring_info.ring_pages[0], KM_USER0);
        if (ctx->reqs_active < aio_ring_avail(&ctx->ring_info, ring)) {
                list_add(&req->ki_list, &ctx->active_reqs);
-               get_ioctx(ctx);
                ctx->reqs_active++;
                okay = 1;
        }
@@ -536,8 +541,6 @@ int fastcall aio_put_req(struct kiocb *req)
        spin_lock_irq(&ctx->ctx_lock);
        ret = __aio_put_req(ctx, req);
        spin_unlock_irq(&ctx->ctx_lock);
-       if (ret)
-               put_ioctx(ctx);
        return ret;
 }
 
@@ -779,8 +782,7 @@ static int __aio_run_iocbs(struct kioctx *ctx)
                 */
                iocb->ki_users++;       /* grab extra reference */
                aio_run_iocb(iocb);
-               if (__aio_put_req(ctx, iocb))  /* drop extra ref */
-                       put_ioctx(ctx);
+               __aio_put_req(ctx, iocb);
        }
        if (!list_empty(&ctx->run_list))
                return 1;
@@ -997,14 +999,10 @@ put_rq:
        /* everything turned out well, dispose of the aiocb. */
        ret = __aio_put_req(ctx, iocb);
 
-       spin_unlock_irqrestore(&ctx->ctx_lock, flags);
-
        if (waitqueue_active(&ctx->wait))
                wake_up(&ctx->wait);
 
-       if (ret)
-               put_ioctx(ctx);
-
+       spin_unlock_irqrestore(&ctx->ctx_lock, flags);
        return ret;
 }
 
index d9bdf2b3ade2922a0564a4630f3b3ce461d1c176..fc7028b685f29ab94d5db4ef26dbb897573c6af5 100644 (file)
@@ -129,6 +129,46 @@ blkdev_get_block(struct inode *inode, sector_t iblock,
        return 0;
 }
 
+static int
+blkdev_get_blocks(struct inode *inode, sector_t iblock,
+               struct buffer_head *bh, int create)
+{
+       sector_t end_block = max_block(I_BDEV(inode));
+       unsigned long max_blocks = bh->b_size >> inode->i_blkbits;
+
+       if ((iblock + max_blocks) > end_block) {
+               max_blocks = end_block - iblock;
+               if ((long)max_blocks <= 0) {
+                       if (create)
+                               return -EIO;    /* write fully beyond EOF */
+                       /*
+                        * It is a read which is fully beyond EOF.  We return
+                        * a !buffer_mapped buffer
+                        */
+                       max_blocks = 0;
+               }
+       }
+
+       bh->b_bdev = I_BDEV(inode);
+       bh->b_blocknr = iblock;
+       bh->b_size = max_blocks << inode->i_blkbits;
+       if (max_blocks)
+               set_buffer_mapped(bh);
+       return 0;
+}
+
+static ssize_t
+blkdev_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
+                       loff_t offset, unsigned long nr_segs)
+{
+       struct file *file = iocb->ki_filp;
+       struct inode *inode = file->f_mapping->host;
+
+       return blockdev_direct_IO_no_locking(rw, iocb, inode, I_BDEV(inode),
+                               iov, offset, nr_segs, blkdev_get_blocks, NULL);
+}
+
+#if 0
 static int blk_end_aio(struct bio *bio, unsigned int bytes_done, int error)
 {
        struct kiocb *iocb = bio->bi_private;
@@ -323,6 +363,7 @@ backout:
                return PTR_ERR(page);
        goto completion;
 }
+#endif
 
 static int blkdev_writepage(struct page *page, struct writeback_control *wbc)
 {
index 84313d14e78065284ea619bb9b20a90f0377bf76..e58a427012dd3c762eb9a233756d32835babe43f 100644 (file)
 #define __NR_io_cancel                 402
 #define __NR_exit_group                        405
 #define __NR_lookup_dcookie            406
-#define __NR_sys_epoll_create          407
-#define __NR_sys_epoll_ctl             408
-#define __NR_sys_epoll_wait            409
+#define __NR_epoll_create              407
+#define __NR_epoll_ctl                 408
+#define __NR_epoll_wait                        409
+/* Feb 2007: These three sys_epoll defines shouldn't be here but culling
+ * them would break userspace apps ... we'll kill them off in 2010 :) */
+#define __NR_sys_epoll_create          __NR_epoll_create
+#define __NR_sys_epoll_ctl             __NR_epoll_ctl
+#define __NR_sys_epoll_wait            __NR_epoll_wait
 #define __NR_remap_file_pages          410
 #define __NR_set_tid_address           411
 #define __NR_restart_syscall           412
index be9ec68907237f4690101216d0b5f93c5616ed95..49dbab09ef2b05ac113aebd464631be17a572ea4 100644 (file)
@@ -63,6 +63,9 @@ static inline int dma_mapping_error(dma_addr_t dma_addr)
        return (dma_addr == bad_dma_address);
 }
 
+#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
+#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
+
 extern void *dma_alloc_coherent(struct device *dev, size_t size,
                                dma_addr_t *dma_handle, gfp_t gfp);
 extern void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
index 6f31fad9be13854731486737b30311c4b4f2e1a2..7f70b0886b83d4deaa97ed588f904d275d4b7be1 100644 (file)
@@ -374,9 +374,11 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
                    && ctnetlink_dump_helpinfo(skb, ct) < 0)
                        goto nfattr_failure;
 
+#ifdef CONFIG_IP_NF_CONNTRACK_MARK
                if ((events & IPCT_MARK || ct->mark)
                    && ctnetlink_dump_mark(skb, ct) < 0)
                        goto nfattr_failure;
+#endif
 
                if (events & IPCT_COUNTER_FILLING &&
                    (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 ||
index 2a2bcb303bfa623025cbb7593b2473e7cef3ea09..80107d4909c5b88fb69c519ea7f4301b93bb63c0 100644 (file)
@@ -165,7 +165,7 @@ config NF_CONNTRACK_FTP
 
 config NF_CONNTRACK_H323
        tristate "H.323 protocol support (EXPERIMENTAL)"
-       depends on EXPERIMENTAL && NF_CONNTRACK
+       depends on EXPERIMENTAL && NF_CONNTRACK && (IPV6 || IPV6=n)
        help
          H.323 is a VoIP signalling protocol from ITU-T. As one of the most
          important VoIP protocols, it is widely used by voice hardware and
index 811e3e782f0f2f36c4257ed778e1301172579a7c..c64f029f7052a3eadd5831d348c4ea1602a88850 100644 (file)
@@ -389,9 +389,11 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
                    && ctnetlink_dump_helpinfo(skb, ct) < 0)
                        goto nfattr_failure;
 
+#ifdef CONFIG_NF_CONNTRACK_MARK
                if ((events & IPCT_MARK || ct->mark)
                    && ctnetlink_dump_mark(skb, ct) < 0)
                        goto nfattr_failure;
+#endif
 
                if (events & IPCT_COUNTER_FILLING &&
                    (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 ||