Merge branch 'for-jeff' of git://electric-eye.fr.zoreil.com/home/romieu/linux-2.6
authorJeff Garzik <jeff@garzik.org>
Fri, 24 Feb 2006 02:16:07 +0000 (21:16 -0500)
committerJeff Garzik <jeff@garzik.org>
Fri, 24 Feb 2006 02:16:07 +0000 (21:16 -0500)
19 files changed:
arch/arm/common/rtctime.c
arch/arm/kernel/entry-armv.S
arch/arm/kernel/traps.c
arch/arm/mach-at91rm9200/devices.c
arch/arm/mach-at91rm9200/gpio.c
arch/arm/mach-ixp4xx/common.c
arch/arm/mach-ixp4xx/nslu2-power.c
arch/arm/mach-ixp4xx/nslu2-setup.c
arch/arm/mach-versatile/pci.c
arch/arm/mm/abort-ev6.S
arch/arm/tools/mach-types
drivers/ieee1394/sbp2.c
drivers/ieee1394/sbp2.h
drivers/scsi/esp.c
fs/cifs/cifssmb.c
fs/cifs/connect.c
include/asm-arm/arch-at91rm9200/gpio.h
include/asm-arm/arch-ixp4xx/nas100d.h
include/linux/mmc/mmc.h

index 48b1e19..e851d86 100644 (file)
@@ -128,19 +128,27 @@ EXPORT_SYMBOL(rtc_tm_to_time);
 /*
  * Calculate the next alarm time given the requested alarm time mask
  * and the current time.
- *
- * FIXME: for now, we just copy the alarm time because we're lazy (and
- * is therefore buggy - setting a 10am alarm at 8pm will not result in
- * the alarm triggering.)
  */
 void rtc_next_alarm_time(struct rtc_time *next, struct rtc_time *now, struct rtc_time *alrm)
 {
+       unsigned long next_time;
+       unsigned long now_time;
+
        next->tm_year = now->tm_year;
        next->tm_mon = now->tm_mon;
        next->tm_mday = now->tm_mday;
        next->tm_hour = alrm->tm_hour;
        next->tm_min = alrm->tm_min;
        next->tm_sec = alrm->tm_sec;
+
+       rtc_tm_to_time(now, &now_time);
+       rtc_tm_to_time(next, &next_time);
+
+       if (next_time < now_time) {
+               /* Advance one day */
+               next_time += 60 * 60 * 24;
+               rtc_time_to_tm(next_time, next);
+       }
 }
 
 static inline int rtc_read_time(struct rtc_ops *ops, struct rtc_time *tm)
index 964cd71..ec48d70 100644 (file)
@@ -566,7 +566,7 @@ ENTRY(__switch_to)
        ldr     r6, [r2, #TI_CPU_DOMAIN]!
 #endif
 #if __LINUX_ARM_ARCH__ >= 6
-#ifdef CONFIG_CPU_MPCORE
+#ifdef CONFIG_CPU_32v6K
        clrex
 #else
        strex   r5, r4, [ip]                    @ Clear exclusive monitor
index 10235b0..03924bc 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/personality.h>
 #include <linux/ptrace.h>
 #include <linux/kallsyms.h>
+#include <linux/delay.h>
 #include <linux/init.h>
 
 #include <asm/atomic.h>
@@ -231,6 +232,13 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
        __die(str, err, thread, regs);
        bust_spinlocks(0);
        spin_unlock_irq(&die_lock);
+
+       if (panic_on_oops) {
+               printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
+               ssleep(5);
+               panic("Fatal exception");
+       }
+
        do_exit(SIGSEGV);
 }
 
index 8df3e52..57eedd5 100644 (file)
@@ -100,8 +100,10 @@ void __init at91_add_device_udc(struct at91_udc_data *data)
                at91_set_gpio_input(data->vbus_pin, 0);
                at91_set_deglitch(data->vbus_pin, 1);
        }
-       if (data->pullup_pin)
+       if (data->pullup_pin) {
                at91_set_gpio_output(data->pullup_pin, 0);
+               at91_set_multi_drive(data->pullup_pin, 1);
+       }
 
        udc_data = *data;
        platform_device_register(&at91rm9200_udc_device);
index 2fd2ef5..a9f718b 100644 (file)
@@ -159,6 +159,23 @@ int __init_or_module at91_set_deglitch(unsigned pin, int is_on)
 }
 EXPORT_SYMBOL(at91_set_deglitch);
 
+/*
+ * enable/disable the multi-driver; This is only valid for output and
+ * allows the output pin to run as an open collector output.
+ */
+int __init_or_module at91_set_multi_drive(unsigned pin, int is_on)
+{
+       void __iomem    *pio = pin_to_controller(pin);
+       unsigned        mask = pin_to_mask(pin);
+
+       if (!pio)
+               return -EINVAL;
+
+       __raw_writel(mask, pio + (is_on ? PIO_MDER : PIO_MDDR));
+       return 0;
+}
+EXPORT_SYMBOL(at91_set_multi_drive);
+
 /*--------------------------------------------------------------------------*/
 
 
index 4bdc9d4..fbadf30 100644 (file)
@@ -111,24 +111,30 @@ static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type)
        if (line < 0)
                return -EINVAL;
 
-       if (type & IRQT_BOTHEDGE) {
+       switch (type){
+       case IRQT_BOTHEDGE:
                int_style = IXP4XX_GPIO_STYLE_TRANSITIONAL;
                irq_type = IXP4XX_IRQ_EDGE;
-       } else  if (type & IRQT_RISING) {
+               break;
+       case IRQT_RISING:
                int_style = IXP4XX_GPIO_STYLE_RISING_EDGE;
                irq_type = IXP4XX_IRQ_EDGE;
-       } else if (type & IRQT_FALLING) {
+               break;
+       case IRQT_FALLING:
                int_style = IXP4XX_GPIO_STYLE_FALLING_EDGE;
                irq_type = IXP4XX_IRQ_EDGE;
-       } else if (type & IRQT_HIGH) {
+               break;
+       case IRQT_HIGH:
                int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH;
                irq_type = IXP4XX_IRQ_LEVEL;
-       } else if (type & IRQT_LOW) {
+               break;
+       case IRQT_LOW:
                int_style = IXP4XX_GPIO_STYLE_ACTIVE_LOW;
                irq_type = IXP4XX_IRQ_LEVEL;
-       } else
+               break;
+       default:
                return -EINVAL;
-
+       }
        ixp4xx_config_irq(irq, irq_type);
 
        if (line >= 8) {        /* pins 8-15 */
index b0ad9e9..d80c362 100644 (file)
@@ -77,6 +77,9 @@ static int __init nslu2_power_init(void)
 
 static void __exit nslu2_power_exit(void)
 {
+       if (!(machine_is_nslu2()))
+               return;
+
        free_irq(NSLU2_RB_IRQ, NULL);
        free_irq(NSLU2_PB_IRQ, NULL);
 }
index f260a9d..55411f2 100644 (file)
@@ -50,6 +50,12 @@ static struct platform_device nslu2_i2c_controller = {
        .num_resources          = 0,
 };
 
+static struct platform_device nslu2_beeper = {
+       .name                   = "ixp4xx-beeper",
+       .id                     = NSLU2_GPIO_BUZZ,
+       .num_resources          = 0,
+};
+
 static struct resource nslu2_uart_resources[] = {
        {
                .start          = IXP4XX_UART1_BASE_PHYS,
@@ -97,6 +103,7 @@ static struct platform_device *nslu2_devices[] __initdata = {
        &nslu2_i2c_controller,
        &nslu2_flash,
        &nslu2_uart,
+       &nslu2_beeper,
 };
 
 static void nslu2_power_off(void)
index b80d57d..722fbab 100644 (file)
@@ -240,6 +240,14 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys)
         int i;
         int myslot = -1;
        unsigned long val;
+       void __iomem *local_pci_cfg_base;
+
+       val = __raw_readl(SYS_PCICTL);
+       if (!(val & 1)) {
+               printk("Not plugged into PCI backplane!\n");
+               ret = -EIO;
+               goto out;
+       }
 
        if (nr == 0) {
                sys->mem_offset = 0;
@@ -253,48 +261,45 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys)
                goto out;
        }
 
-       __raw_writel(VERSATILE_PCI_MEM_BASE0 >> 28,PCI_IMAP0);
-       __raw_writel(VERSATILE_PCI_MEM_BASE1 >> 28,PCI_IMAP1);
-       __raw_writel(VERSATILE_PCI_MEM_BASE2 >> 28,PCI_IMAP2);
-
-       __raw_writel(1, SYS_PCICTL);
-
-       val = __raw_readl(SYS_PCICTL);
-       if (!(val & 1)) {
-               printk("Not plugged into PCI backplane!\n");
-               ret = -EIO;
-               goto out;
-       }
-
        /*
         *  We need to discover the PCI core first to configure itself
         *  before the main PCI probing is performed
         */
-       for (i=0; i<32; i++) {
+       for (i=0; i<32; i++)
                if ((__raw_readl(VERSATILE_PCI_VIRT_BASE+(i<<11)+DEVICE_ID_OFFSET) == VP_PCI_DEVICE_ID) &&
                    (__raw_readl(VERSATILE_PCI_VIRT_BASE+(i<<11)+CLASS_ID_OFFSET) == VP_PCI_CLASS_ID)) {
                        myslot = i;
-
-                       __raw_writel(myslot, PCI_SELFID);
-                       val = __raw_readl(VERSATILE_PCI_CFG_VIRT_BASE+(myslot<<11)+CSR_OFFSET);
-                       val |= (1<<2);
-                       __raw_writel(val, VERSATILE_PCI_CFG_VIRT_BASE+(myslot<<11)+CSR_OFFSET);
                        break;
                }
-       }
 
        if (myslot == -1) {
                printk("Cannot find PCI core!\n");
                ret = -EIO;
-       } else {
-               printk("PCI core found (slot %d)\n",myslot);
-               /* Do not to map Versatile FPGA PCI device
-                  into memory space as we are short of
-                  mappable memory */
-               pci_slot_ignore |= (1 << myslot);
-               ret = 1;
+               goto out;
        }
 
+       printk("PCI core found (slot %d)\n",myslot);
+
+       __raw_writel(myslot, PCI_SELFID);
+       local_pci_cfg_base = (void *) VERSATILE_PCI_CFG_VIRT_BASE + (myslot << 11);
+
+       val = __raw_readl(local_pci_cfg_base + CSR_OFFSET);
+       val |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE;
+       __raw_writel(val, local_pci_cfg_base + CSR_OFFSET);
+
+       /*
+        * Configure the PCI inbound memory windows to be 1:1 mapped to SDRAM
+        */
+       __raw_writel(PHYS_OFFSET, local_pci_cfg_base + PCI_BASE_ADDRESS_0);
+       __raw_writel(PHYS_OFFSET, local_pci_cfg_base + PCI_BASE_ADDRESS_1);
+       __raw_writel(PHYS_OFFSET, local_pci_cfg_base + PCI_BASE_ADDRESS_2);
+
+       /*
+        * Do not to map Versatile FPGA PCI device into memory space
+        */
+       pci_slot_ignore |= (1 << myslot);
+       ret = 1;
+
  out:
        return ret;
 }
@@ -305,18 +310,18 @@ struct pci_bus *pci_versatile_scan_bus(int nr, struct pci_sys_data *sys)
        return pci_scan_bus(sys->busnr, &pci_versatile_ops, sys);
 }
 
-/*
- * V3_LB_BASE? - local bus address
- * V3_LB_MAP?  - pci bus address
- */
 void __init pci_versatile_preinit(void)
 {
-}
+       __raw_writel(VERSATILE_PCI_MEM_BASE0 >> 28, PCI_IMAP0);
+       __raw_writel(VERSATILE_PCI_MEM_BASE1 >> 28, PCI_IMAP1);
+       __raw_writel(VERSATILE_PCI_MEM_BASE2 >> 28, PCI_IMAP2);
 
-void __init pci_versatile_postinit(void)
-{
-}
+       __raw_writel(PHYS_OFFSET >> 28, PCI_SMAP0);
+       __raw_writel(PHYS_OFFSET >> 28, PCI_SMAP1);
+       __raw_writel(PHYS_OFFSET >> 28, PCI_SMAP2);
 
+       __raw_writel(1, SYS_PCICTL);
+}
 
 /*
  * map the specified device/slot/pin to an IRQ.   Different backplanes may need to modify this.
@@ -326,16 +331,15 @@ static int __init versatile_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
        int irq;
        int devslot = PCI_SLOT(dev->devfn);
 
-       /* slot,  pin,  irq
-           24    1     27
-           25    1     28      untested
-           26    1     29
-           27    1     30      untested
-       */
-
-       irq = 27 + ((slot + pin + 2) % 3);      /* Fudged */
+       /* slot,  pin,  irq
+        *  24     1     27
+        *  25     1     28
+        *  26     1     29
+        *  27     1     30
+        */
+       irq = 27 + ((slot + pin - 1) & 3);
 
-       printk("map irq: slot %d, pin %d, devslot %d, irq: %d\n",slot,pin,devslot,irq);
+       printk("PCI map irq: slot %d, pin %d, devslot %d, irq: %d\n",slot,pin,devslot,irq);
 
        return irq;
 }
@@ -347,7 +351,6 @@ static struct hw_pci versatile_pci __initdata = {
        .setup                  = pci_versatile_setup,
        .scan                   = pci_versatile_scan_bus,
        .preinit                = pci_versatile_preinit,
-       .postinit               = pci_versatile_postinit,
 };
 
 static int __init versatile_pci_init(void)
index dbd3460..8a7f65b 100644 (file)
@@ -20,7 +20,7 @@
  */
        .align  5
 ENTRY(v6_early_abort)
-#ifdef CONFIG_CPU_MPCORE
+#ifdef CONFIG_CPU_32v6K
        clrex
 #else
        strex   r0, r1, [sp]                    @ Clear the exclusive monitor
index d0f9bb5..8ab5300 100644 (file)
@@ -12,7 +12,7 @@
 #
 #   http://www.arm.linux.org.uk/developer/machines/?action=new
 #
-# Last update: Mon Jan 9 12:56:42 2006
+# Last update: Mon Feb 20 10:18:02 2006
 #
 # machine_is_xxx       CONFIG_xxxx             MACH_TYPE_xxx           number
 #
@@ -904,7 +904,7 @@ wg302v2                     MACH_WG302V2            WG302V2                 890
 eb42x                  MACH_EB42X              EB42X                   891
 iq331es                        MACH_IQ331ES            IQ331ES                 892
 cosydsp                        MACH_COSYDSP            COSYDSP                 893
-uplat7d                        MACH_UPLAT7D            UPLAT7D                 894
+uplat7d_proto          MACH_UPLAT7D            UPLAT7D                 894
 ptdavinci              MACH_PTDAVINCI          PTDAVINCI               895
 mbus                   MACH_MBUS               MBUS                    896
 nadia2vb               MACH_NADIA2VB           NADIA2VB                897
@@ -938,3 +938,34 @@ auckland           MACH_AUCKLAND           AUCKLAND                924
 ak3220m                        MACH_AK3320M            AK3320M                 925
 duramax                        MACH_DURAMAX            DURAMAX                 926
 n35                    MACH_N35                N35                     927
+pronghorn              MACH_PRONGHORN          PRONGHORN               928
+fundy                  MACH_FUNDY              FUNDY                   929
+logicpd_pxa270         MACH_LOGICPD_PXA270     LOGICPD_PXA270          930
+cpu777                 MACH_CPU777             CPU777                  931
+simicon9201            MACH_SIMICON9201        SIMICON9201             932
+leap2_hpm              MACH_LEAP2_HPM          LEAP2_HPM               933
+cm922txa10             MACH_CM922TXA10         CM922TXA10              934
+sandgate               MACH_PXA                PXA                     935
+sandgate2              MACH_SANDGATE2          SANDGATE2               936
+sandgate2g             MACH_SANDGATE2G         SANDGATE2G              937
+sandgate2p             MACH_SANDGATE2P         SANDGATE2P              938
+fred_jack              MACH_FRED_JACK          FRED_JACK               939
+ttg_color1             MACH_TTG_COLOR1         TTG_COLOR1              940
+nxeb500hmi             MACH_NXEB500HMI         NXEB500HMI              941
+netdcu8                        MACH_NETDCU8            NETDCU8                 942
+ml675050_cpu_boa       MACH_ML675050_CPU_BOA   ML675050_CPU_BOA        943
+ng_fvx538              MACH_NG_FVX538          NG_FVX538               944
+ng_fvs338              MACH_NG_FVS338          NG_FVS338               945
+pnx4103                        MACH_PNX4103            PNX4103                 946
+hesdb                  MACH_HESDB              HESDB                   947
+xsilo                  MACH_XSILO              XSILO                   948
+espresso               MACH_ESPRESSO           ESPRESSO                949
+emlc                   MACH_EMLC               EMLC                    950
+sisteron               MACH_SISTERON           SISTERON                951
+rx1950                 MACH_RX1950             RX1950                  952
+tsc_venus              MACH_TSC_VENUS          TSC_VENUS               953
+ds101j                 MACH_DS101J             DS101J                  954
+mxc300_30ads           MACH_MXC30030ADS        MXC30030ADS             955
+fujitsu_wimaxsoc       MACH_FUJITSU_WIMAXSOC   FUJITSU_WIMAXSOC        956
+dualpcmodem            MACH_DUALPCMODEM        DUALPCMODEM             957
+gesbc9312              MACH_GESBC9312          GESBC9312               958
index c2c776f..eca92eb 100644 (file)
@@ -137,15 +137,15 @@ MODULE_PARM_DESC(exclusive_login, "Exclusive login to sbp2 device (default = 1)"
 /*
  * SCSI inquiry hack for really badly behaved sbp2 devices. Turn this on
  * if your sbp2 device is not properly handling the SCSI inquiry command.
- * This hack makes the inquiry look more like a typical MS Windows
- * inquiry.
+ * This hack makes the inquiry look more like a typical MS Windows inquiry
+ * by enforcing 36 byte inquiry and avoiding access to mode_sense page 8.
  *
  * If force_inquiry_hack=1 is required for your device to work,
  * please submit the logged sbp2_firmware_revision value of this device to
  * the linux1394-devel mailing list.
  */
 static int force_inquiry_hack;
-module_param(force_inquiry_hack, int, 0444);
+module_param(force_inquiry_hack, int, 0644);
 MODULE_PARM_DESC(force_inquiry_hack, "Force SCSI inquiry hack (default = 0)");
 
 /*
@@ -264,18 +264,17 @@ static struct hpsb_protocol_driver sbp2_driver = {
        },
 };
 
-
-/* List of device firmware's that require a forced 36 byte inquiry.  */
+/*
+ * List of device firmwares that require the inquiry hack.
+ * Yields a few false positives but did not break other devices so far.
+ */
 static u32 sbp2_broken_inquiry_list[] = {
-       0x00002800,     /* Stefan Richter <richtest@bauwesen.tu-cottbus.de> */
+       0x00002800,     /* Stefan Richter <stefanr@s5r6.in-berlin.de> */
                        /* DViCO Momobay CX-1 */
        0x00000200      /* Andreas Plesch <plesch@fas.harvard.edu> */
                        /* QPS Fire DVDBurner */
 };
 
-#define NUM_BROKEN_INQUIRY_DEVS \
-       (sizeof(sbp2_broken_inquiry_list)/sizeof(*sbp2_broken_inquiry_list))
-
 /**************************************
  * General utility functions
  **************************************/
@@ -643,9 +642,15 @@ static int sbp2_remove(struct device *dev)
        if (!scsi_id)
                return 0;
 
-       /* Trigger shutdown functions in scsi's highlevel. */
-       if (scsi_id->scsi_host)
+       if (scsi_id->scsi_host) {
+               /* Get rid of enqueued commands if there is no chance to
+                * send them. */
+               if (!sbp2util_node_is_available(scsi_id))
+                       sbp2scsi_complete_all_commands(scsi_id, DID_NO_CONNECT);
+               /* scsi_remove_device() will trigger shutdown functions of SCSI
+                * highlevel drivers which would deadlock if blocked. */
                scsi_unblock_requests(scsi_id->scsi_host);
+       }
        sdev = scsi_id->sdev;
        if (sdev) {
                scsi_id->sdev = NULL;
@@ -742,11 +747,6 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud
                hi->host = ud->ne->host;
                INIT_LIST_HEAD(&hi->scsi_ids);
 
-               /* Register our sbp2 status address space... */
-               hpsb_register_addrspace(&sbp2_highlevel, ud->ne->host, &sbp2_ops,
-                                       SBP2_STATUS_FIFO_ADDRESS,
-                                       SBP2_STATUS_FIFO_ADDRESS +
-                                       SBP2_STATUS_FIFO_ENTRY_TO_OFFSET(SBP2_MAX_UDS_PER_NODE+1));
 #ifdef CONFIG_IEEE1394_SBP2_PHYS_DMA
                /* Handle data movement if physical dma is not
                 * enabled/supportedon host controller */
@@ -759,6 +759,18 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud
 
        list_add_tail(&scsi_id->scsi_list, &hi->scsi_ids);
 
+       /* Register the status FIFO address range. We could use the same FIFO
+        * for targets at different nodes. However we need different FIFOs per
+        * target in order to support multi-unit devices. */
+       scsi_id->status_fifo_addr = hpsb_allocate_and_register_addrspace(
+                       &sbp2_highlevel, ud->ne->host, &sbp2_ops,
+                       sizeof(struct sbp2_status_block), sizeof(quadlet_t),
+                       ~0ULL, ~0ULL);
+       if (!scsi_id->status_fifo_addr) {
+               SBP2_ERR("failed to allocate status FIFO address range");
+               goto failed_alloc;
+       }
+
        /* Register our host with the SCSI stack. */
        scsi_host = scsi_host_alloc(&scsi_driver_template,
                                    sizeof(unsigned long));
@@ -997,6 +1009,10 @@ static void sbp2_remove_device(struct scsi_id_instance_data *scsi_id)
                SBP2_DMA_FREE("single query logins data");
        }
 
+       if (scsi_id->status_fifo_addr)
+               hpsb_unregister_addrspace(&sbp2_highlevel, hi->host,
+                       scsi_id->status_fifo_addr);
+
        scsi_id->ud->device.driver_data = NULL;
 
        SBP2_DEBUG("SBP-2 device removed, SCSI ID = %d", scsi_id->ud->id);
@@ -1075,11 +1091,10 @@ static int sbp2_query_logins(struct scsi_id_instance_data *scsi_id)
                ORB_SET_QUERY_LOGINS_RESP_LENGTH(sizeof(struct sbp2_query_logins_response));
        SBP2_DEBUG("sbp2_query_logins: reserved_resp_length initialized");
 
-       scsi_id->query_logins_orb->status_FIFO_lo = SBP2_STATUS_FIFO_ADDRESS_LO +
-                                                   SBP2_STATUS_FIFO_ENTRY_TO_OFFSET(scsi_id->ud->id);
-       scsi_id->query_logins_orb->status_FIFO_hi = (ORB_SET_NODE_ID(hi->host->node_id) |
-                                                    SBP2_STATUS_FIFO_ADDRESS_HI);
-       SBP2_DEBUG("sbp2_query_logins: status FIFO initialized");
+       scsi_id->query_logins_orb->status_fifo_hi =
+               ORB_SET_STATUS_FIFO_HI(scsi_id->status_fifo_addr, hi->host->node_id);
+       scsi_id->query_logins_orb->status_fifo_lo =
+               ORB_SET_STATUS_FIFO_LO(scsi_id->status_fifo_addr);
 
        sbp2util_cpu_to_be32_buffer(scsi_id->query_logins_orb, sizeof(struct sbp2_query_logins_orb));
 
@@ -1184,11 +1199,10 @@ static int sbp2_login_device(struct scsi_id_instance_data *scsi_id)
                ORB_SET_LOGIN_RESP_LENGTH(sizeof(struct sbp2_login_response));
        SBP2_DEBUG("sbp2_login_device: passwd_resp_lengths initialized");
 
-       scsi_id->login_orb->status_FIFO_lo = SBP2_STATUS_FIFO_ADDRESS_LO +
-                                            SBP2_STATUS_FIFO_ENTRY_TO_OFFSET(scsi_id->ud->id);
-       scsi_id->login_orb->status_FIFO_hi = (ORB_SET_NODE_ID(hi->host->node_id) |
-                                             SBP2_STATUS_FIFO_ADDRESS_HI);
-       SBP2_DEBUG("sbp2_login_device: status FIFO initialized");
+       scsi_id->login_orb->status_fifo_hi =
+               ORB_SET_STATUS_FIFO_HI(scsi_id->status_fifo_addr, hi->host->node_id);
+       scsi_id->login_orb->status_fifo_lo =
+               ORB_SET_STATUS_FIFO_LO(scsi_id->status_fifo_addr);
 
        /*
         * Byte swap ORB if necessary
@@ -1301,10 +1315,10 @@ static int sbp2_logout_device(struct scsi_id_instance_data *scsi_id)
        scsi_id->logout_orb->login_ID_misc |= ORB_SET_NOTIFY(1);
 
        scsi_id->logout_orb->reserved5 = 0x0;
-       scsi_id->logout_orb->status_FIFO_lo = SBP2_STATUS_FIFO_ADDRESS_LO +
-                                             SBP2_STATUS_FIFO_ENTRY_TO_OFFSET(scsi_id->ud->id);
-       scsi_id->logout_orb->status_FIFO_hi = (ORB_SET_NODE_ID(hi->host->node_id) |
-                                              SBP2_STATUS_FIFO_ADDRESS_HI);
+       scsi_id->logout_orb->status_fifo_hi =
+               ORB_SET_STATUS_FIFO_HI(scsi_id->status_fifo_addr, hi->host->node_id);
+       scsi_id->logout_orb->status_fifo_lo =
+               ORB_SET_STATUS_FIFO_LO(scsi_id->status_fifo_addr);
 
        /*
         * Byte swap ORB if necessary
@@ -1366,10 +1380,10 @@ static int sbp2_reconnect_device(struct scsi_id_instance_data *scsi_id)
        scsi_id->reconnect_orb->login_ID_misc |= ORB_SET_NOTIFY(1);
 
        scsi_id->reconnect_orb->reserved5 = 0x0;
-       scsi_id->reconnect_orb->status_FIFO_lo = SBP2_STATUS_FIFO_ADDRESS_LO +
-                                                SBP2_STATUS_FIFO_ENTRY_TO_OFFSET(scsi_id->ud->id);
-       scsi_id->reconnect_orb->status_FIFO_hi =
-               (ORB_SET_NODE_ID(hi->host->node_id) | SBP2_STATUS_FIFO_ADDRESS_HI);
+       scsi_id->reconnect_orb->status_fifo_hi =
+               ORB_SET_STATUS_FIFO_HI(scsi_id->status_fifo_addr, hi->host->node_id);
+       scsi_id->reconnect_orb->status_fifo_lo =
+               ORB_SET_STATUS_FIFO_LO(scsi_id->status_fifo_addr);
 
        /*
         * Byte swap ORB if necessary
@@ -1560,7 +1574,7 @@ static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id,
        /* Check for a blacklisted set of devices that require us to force
         * a 36 byte host inquiry. This can be overriden as a module param
         * (to force all hosts).  */
-       for (i = 0; i < NUM_BROKEN_INQUIRY_DEVS; i++) {
+       for (i = 0; i < ARRAY_SIZE(sbp2_broken_inquiry_list); i++) {
                if ((firmware_revision & 0xffff00) ==
                                sbp2_broken_inquiry_list[i]) {
                        SBP2_WARN("Node " NODE_BUS_FMT ": Using 36byte inquiry workaround",
@@ -2006,18 +2020,6 @@ static int sbp2_send_command(struct scsi_id_instance_data *scsi_id,
                return -EIO;
        }
 
-       /*
-        * The scsi stack sends down a request_bufflen which does not match the
-        * length field in the scsi cdb. This causes some sbp2 devices to
-        * reject this inquiry command. Fix the request_bufflen.
-        */
-       if (*cmd == INQUIRY) {
-               if (force_inquiry_hack || scsi_id->workarounds & SBP2_BREAKAGE_INQUIRY_HACK)
-                       request_bufflen = cmd[4] = 0x24;
-               else
-                       request_bufflen = cmd[4];
-       }
-
        /*
         * Now actually fill in the comamnd orb and sbp2 s/g list
         */
@@ -2106,7 +2108,6 @@ static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid, int dest
 {
        struct sbp2scsi_host_info *hi;
        struct scsi_id_instance_data *scsi_id = NULL, *scsi_id_tmp;
-       u32 id;
        struct scsi_cmnd *SCpnt = NULL;
        u32 scsi_status = SBP2_SCSI_STATUS_GOOD;
        struct sbp2_command_info *command;
@@ -2129,12 +2130,12 @@ static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid, int dest
        }
 
        /*
-        * Find our scsi_id structure by looking at the status fifo address written to by
-        * the sbp2 device.
+        * Find our scsi_id structure by looking at the status fifo address
+        * written to by the sbp2 device.
         */
-       id = SBP2_STATUS_FIFO_OFFSET_TO_ENTRY((u32)(addr - SBP2_STATUS_FIFO_ADDRESS));
        list_for_each_entry(scsi_id_tmp, &hi->scsi_ids, scsi_list) {
-               if (scsi_id_tmp->ne->nodeid == nodeid && scsi_id_tmp->ud->id == id) {
+               if (scsi_id_tmp->ne->nodeid == nodeid &&
+                   scsi_id_tmp->status_fifo_addr == addr) {
                        scsi_id = scsi_id_tmp;
                        break;
                }
@@ -2475,7 +2476,16 @@ static void sbp2scsi_complete_command(struct scsi_id_instance_data *scsi_id,
 
 static int sbp2scsi_slave_alloc(struct scsi_device *sdev)
 {
-       ((struct scsi_id_instance_data *)sdev->host->hostdata[0])->sdev = sdev;
+       struct scsi_id_instance_data *scsi_id =
+               (struct scsi_id_instance_data *)sdev->host->hostdata[0];
+
+       scsi_id->sdev = sdev;
+
+       if (force_inquiry_hack ||
+           scsi_id->workarounds & SBP2_BREAKAGE_INQUIRY_HACK) {
+               sdev->inquiry_len = 36;
+               sdev->skip_ms_page_8 = 1;
+       }
        return 0;
 }
 
index 900ea1d..e2d357a 100644 (file)
 #define ORB_DIRECTION_NO_DATA_TRANSFER  0x2
 
 #define ORB_SET_NULL_PTR(value)                        ((value & 0x1) << 31)
-#define ORB_SET_NOTIFY(value)                   ((value & 0x1) << 31)
-#define ORB_SET_RQ_FMT(value)                   ((value & 0x3) << 29)  /* unused ? */
+#define ORB_SET_NOTIFY(value)                  ((value & 0x1) << 31)
+#define ORB_SET_RQ_FMT(value)                  ((value & 0x3) << 29)   /* unused ? */
 #define ORB_SET_NODE_ID(value)                 ((value & 0xffff) << 16)
-#define ORB_SET_DATA_SIZE(value)                (value & 0xffff)
-#define ORB_SET_PAGE_SIZE(value)                ((value & 0x7) << 16)
-#define ORB_SET_PAGE_TABLE_PRESENT(value)       ((value & 0x1) << 19)
-#define ORB_SET_MAX_PAYLOAD(value)              ((value & 0xf) << 20)
-#define ORB_SET_SPEED(value)                    ((value & 0x7) << 24)
-#define ORB_SET_DIRECTION(value)                ((value & 0x1) << 27)
+#define ORB_SET_STATUS_FIFO_HI(value, id)      (value >> 32 | ORB_SET_NODE_ID(id))
+#define ORB_SET_STATUS_FIFO_LO(value)          (value & 0xffffffff)
+#define ORB_SET_DATA_SIZE(value)               (value & 0xffff)
+#define ORB_SET_PAGE_SIZE(value)               ((value & 0x7) << 16)
+#define ORB_SET_PAGE_TABLE_PRESENT(value)      ((value & 0x1) << 19)
+#define ORB_SET_MAX_PAYLOAD(value)             ((value & 0xf) << 20)
+#define ORB_SET_SPEED(value)                   ((value & 0x7) << 24)
+#define ORB_SET_DIRECTION(value)               ((value & 0x1) << 27)
 
 struct sbp2_command_orb {
        volatile u32 next_ORB_hi;
@@ -76,8 +78,8 @@ struct sbp2_login_orb {
        u32 login_response_lo;
        u32 lun_misc;
        u32 passwd_resp_lengths;
-       u32 status_FIFO_hi;
-       u32 status_FIFO_lo;
+       u32 status_fifo_hi;
+       u32 status_fifo_lo;
 };
 
 #define RESPONSE_GET_LOGIN_ID(value)            (value & 0xffff)
@@ -102,8 +104,8 @@ struct sbp2_query_logins_orb {
        u32 query_response_lo;
        u32 lun_misc;
        u32 reserved_resp_length;
-       u32 status_FIFO_hi;
-       u32 status_FIFO_lo;
+       u32 status_fifo_hi;
+       u32 status_fifo_lo;
 };
 
 #define RESPONSE_GET_MAX_LOGINS(value)          (value & 0xffff)
@@ -123,8 +125,8 @@ struct sbp2_reconnect_orb {
        u32 reserved4;
        u32 login_ID_misc;
        u32 reserved5;
-       u32 status_FIFO_hi;
-       u32 status_FIFO_lo;
+       u32 status_fifo_hi;
+       u32 status_fifo_lo;
 };
 
 struct sbp2_logout_orb {
@@ -134,8 +136,8 @@ struct sbp2_logout_orb {
        u32 reserved4;
        u32 login_ID_misc;
        u32 reserved5;
-       u32 status_FIFO_hi;
-       u32 status_FIFO_lo;
+       u32 status_fifo_hi;
+       u32 status_fifo_lo;
 };
 
 #define PAGE_TABLE_SET_SEGMENT_BASE_HI(value)   (value & 0xffff)
@@ -195,30 +197,6 @@ struct sbp2_status_block {
  * Miscellaneous SBP2 related config rom defines
  */
 
-/* The status fifo address definition below is used as a base for each
- * node, which a chunk seperately assigned to each unit directory in the
- * node.  For example, 0xfffe00000000ULL is used for the first sbp2 device
- * detected on node 0, 0xfffe00000020ULL for the next sbp2 device on node
- * 0, and so on.
- *
- * Note: We could use a single status fifo address for all sbp2 devices,
- * and figure out which sbp2 device the status belongs to by looking at
- * the source node id of the status write... but, using separate addresses
- * for each sbp2 unit directory allows for better code and the ability to
- * support multiple luns within a single 1394 node.
- *
- * Also note that we choose the address range below as it is a region
- * specified for write posting, where the ohci controller will
- * automatically send an ack_complete when the status is written by the
- * sbp2 device... saving a split transaction.   =)
- */
-#define SBP2_STATUS_FIFO_ADDRESS                               0xfffe00000000ULL
-#define SBP2_STATUS_FIFO_ADDRESS_HI                             0xfffe
-#define SBP2_STATUS_FIFO_ADDRESS_LO                             0x0
-
-#define SBP2_STATUS_FIFO_ENTRY_TO_OFFSET(entry)                        ((entry) << 5)
-#define SBP2_STATUS_FIFO_OFFSET_TO_ENTRY(offset)               ((offset) >> 5)
-
 #define SBP2_UNIT_DIRECTORY_OFFSET_KEY                         0xd1
 #define SBP2_CSR_OFFSET_KEY                                    0x54
 #define SBP2_UNIT_SPEC_ID_KEY                                  0x12
@@ -258,7 +236,6 @@ struct sbp2_status_block {
  */
 
 #define SBP2_MAX_SG_ELEMENT_LENGTH     0xf000
-#define SBP2_MAX_UDS_PER_NODE          16      /* Maximum scsi devices per node */
 #define SBP2_MAX_SECTORS               255     /* Max sectors supported */
 #define SBP2_MAX_CMDS                  8       /* This should be safe */
 
@@ -337,6 +314,11 @@ struct scsi_id_instance_data {
        u32 sbp2_lun;
        u32 sbp2_firmware_revision;
 
+       /*
+        * Address for the device to write status blocks to
+        */
+       u64 status_fifo_addr;
+
        /*
         * Variable used for logins, reconnects, logouts, query logins
         */
index f690053..87a8c3d 100644 (file)
@@ -2068,14 +2068,12 @@ static int esp_reset(struct scsi_cmnd *SCptr)
 {
        struct esp *esp = (struct esp *) SCptr->device->host->hostdata;
 
+       spin_lock_irq(esp->ehost->host_lock);
        (void) esp_do_resetbus(esp);
-
        spin_unlock_irq(esp->ehost->host_lock);
 
        wait_event(esp->reset_queue, (esp->resetting_bus == 0));
 
-       spin_lock_irq(esp->ehost->host_lock);
-
        return SUCCESS;
 }
 
index 217323b..b41e8b3 100644 (file)
@@ -1048,13 +1048,14 @@ CIFSSMBRead(const int xid, struct cifsTconInfo *tcon,
                        cifs_small_buf_release(iov[0].iov_base);
                else if(resp_buf_type == CIFS_LARGE_BUFFER)
                        cifs_buf_release(iov[0].iov_base);
-       } else /* return buffer to caller to free */ /* BB FIXME how do we tell caller if it is not a large buffer */ {
-               *buf = iov[0].iov_base;
+       } else if(resp_buf_type != CIFS_NO_BUFFER) {
+               /* return buffer to caller to free */ 
+               *buf = iov[0].iov_base;         
                if(resp_buf_type == CIFS_SMALL_BUFFER)
                        *pbuf_type = CIFS_SMALL_BUFFER;
                else if(resp_buf_type == CIFS_LARGE_BUFFER)
                        *pbuf_type = CIFS_LARGE_BUFFER;
-       }
+       } /* else no valid buffer on return - leave as null */
 
        /* Note: On -EAGAIN error only caller can retry on handle based calls
                since file handle passed in no longer valid */
index e488603..ef5ae6f 100644 (file)
@@ -1795,10 +1795,10 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
                           conjunction with 52K kvec constraint on arch with 4K
                           page size  */
 
-               if(cifs_sb->rsize < PAGE_CACHE_SIZE) {
-                       cifs_sb->rsize = PAGE_CACHE_SIZE
-                       /* Windows ME does this */
-                       cFYI(1,("Attempt to set readsize for mount to less than one page (4096)"));
+               if(cifs_sb->rsize < 2048) {
+                       cifs_sb->rsize = 2048
+                       /* Windows ME may prefer this */
+                       cFYI(1,("readsize set to minimum 2048"));
                }
                cifs_sb->mnt_uid = volume_info.linux_uid;
                cifs_sb->mnt_gid = volume_info.linux_gid;
index 0f0a61e..6176ab2 100644 (file)
@@ -183,6 +183,7 @@ extern int at91_set_B_periph(unsigned pin, int use_pullup);
 extern int at91_set_gpio_input(unsigned pin, int use_pullup);
 extern int at91_set_gpio_output(unsigned pin, int value);
 extern int at91_set_deglitch(unsigned pin, int is_on);
+extern int at91_set_multi_drive(unsigned pin, int is_on);
 
 /* callable at any time */
 extern int at91_set_gpio_value(unsigned pin, int value);
index 51ac018..84467a5 100644 (file)
@@ -19,8 +19,8 @@
 #error "Do not include this directly, instead #include <asm/hardware.h>"
 #endif
 
-#define NAS100D_SDA_PIN                6
-#define NAS100D_SCL_PIN                5
+#define NAS100D_SDA_PIN                5
+#define NAS100D_SCL_PIN                6
 
 /*
  * NAS100D PCI IRQs
index f38872a..bdc556d 100644 (file)
@@ -49,7 +49,7 @@ struct mmc_command {
 /*
  * These are the command types.
  */
-#define mmc_cmd_type(cmd)      ((cmd)->flags & MMC_CMD_TYPE)
+#define mmc_cmd_type(cmd)      ((cmd)->flags & MMC_CMD_MASK)
 
        unsigned int            retries;        /* max number of retries */
        unsigned int            error;          /* command error */