aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/cm_sbs.c4
-rw-r--r--drivers/ata/sata_promise.c2
-rw-r--r--drivers/ata/sata_sil.c2
-rw-r--r--drivers/ata/sata_svw.c4
-rw-r--r--drivers/block/loop.c8
-rw-r--r--drivers/cdrom/cdrom.c6
-rw-r--r--drivers/char/istallion.c58
-rw-r--r--drivers/char/qtronix.c605
-rw-r--r--drivers/char/rtc.c4
-rw-r--r--drivers/dma/ioatdma.c4
-rw-r--r--drivers/dma/ioatdma.h4
-rw-r--r--drivers/infiniband/core/cm.c84
-rw-r--r--drivers/infiniband/hw/amso1100/c2_ae.c2
-rw-r--r--drivers/infiniband/hw/amso1100/c2_qp.c16
-rw-r--r--drivers/infiniband/hw/mthca/mthca_provider.c2
-rw-r--r--drivers/infiniband/hw/mthca/mthca_srq.c6
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ib.c5
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c27
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.h2
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c2
-rw-r--r--drivers/mmc/sdhci.c2
-rw-r--r--drivers/mtd/maps/physmap.c2
-rw-r--r--drivers/mtd/nand/cs553x_nand.c2
-rw-r--r--drivers/net/chelsio/cpl5_cmd.h6
-rw-r--r--drivers/net/s2io.h322
-rw-r--r--drivers/s390/scsi/zfcp_erp.c2
-rw-r--r--drivers/sbus/char/openprom.c2
-rw-r--r--drivers/sbus/char/uctrl.c2
-rw-r--r--drivers/scsi/advansys.c6
-rw-r--r--drivers/scsi/dc395x.c2
-rw-r--r--drivers/scsi/scsi_error.c2
-rw-r--r--drivers/serial/sunzilog.c2
-rw-r--r--drivers/usb/core/devio.c6
33 files changed, 334 insertions, 871 deletions
diff --git a/drivers/acpi/cm_sbs.c b/drivers/acpi/cm_sbs.c
index a01ce6700bfe..4a9b7bf6f44e 100644
--- a/drivers/acpi/cm_sbs.c
+++ b/drivers/acpi/cm_sbs.c
@@ -67,7 +67,7 @@ void acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir_param)
67 lock_ac_dir_cnt--; 67 lock_ac_dir_cnt--;
68 if (lock_ac_dir_cnt == 0 && acpi_ac_dir_param && acpi_ac_dir) { 68 if (lock_ac_dir_cnt == 0 && acpi_ac_dir_param && acpi_ac_dir) {
69 remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); 69 remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
70 acpi_ac_dir = 0; 70 acpi_ac_dir = NULL;
71 } 71 }
72 mutex_unlock(&cm_sbs_mutex); 72 mutex_unlock(&cm_sbs_mutex);
73} 73}
@@ -99,7 +99,7 @@ void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir_param)
99 if (lock_battery_dir_cnt == 0 && acpi_battery_dir_param 99 if (lock_battery_dir_cnt == 0 && acpi_battery_dir_param
100 && acpi_battery_dir) { 100 && acpi_battery_dir) {
101 remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); 101 remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
102 acpi_battery_dir = 0; 102 acpi_battery_dir = NULL;
103 } 103 }
104 mutex_unlock(&cm_sbs_mutex); 104 mutex_unlock(&cm_sbs_mutex);
105 return; 105 return;
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
index d636ede064aa..8bcdfa64667c 100644
--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -360,7 +360,7 @@ static void pdc_sata_phy_reset(struct ata_port *ap)
360static void pdc_pata_cbl_detect(struct ata_port *ap) 360static void pdc_pata_cbl_detect(struct ata_port *ap)
361{ 361{
362 u8 tmp; 362 u8 tmp;
363 void __iomem *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03; 363 void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03;
364 364
365 tmp = readb(mmio); 365 tmp = readb(mmio);
366 366
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c
index ae5edb80ea9a..ca8d99312472 100644
--- a/drivers/ata/sata_sil.c
+++ b/drivers/ata/sata_sil.c
@@ -349,7 +349,7 @@ static u32 sil_scr_read (struct ata_port *ap, unsigned int sc_reg)
349 349
350static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) 350static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
351{ 351{
352 void *mmio = (void __iomem *) sil_scr_addr(ap, sc_reg); 352 void __iomem *mmio = (void __iomem *) sil_scr_addr(ap, sc_reg);
353 if (mmio) 353 if (mmio)
354 writel(val, mmio); 354 writel(val, mmio);
355} 355}
diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
index 84025a2fd5be..db32d15b7fa1 100644
--- a/drivers/ata/sata_svw.c
+++ b/drivers/ata/sata_svw.c
@@ -177,7 +177,7 @@ static void k2_bmdma_setup_mmio (struct ata_queued_cmd *qc)
177 struct ata_port *ap = qc->ap; 177 struct ata_port *ap = qc->ap;
178 unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE); 178 unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE);
179 u8 dmactl; 179 u8 dmactl;
180 void *mmio = (void *) ap->ioaddr.bmdma_addr; 180 void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr;
181 /* load PRD table addr. */ 181 /* load PRD table addr. */
182 mb(); /* make sure PRD table writes are visible to controller */ 182 mb(); /* make sure PRD table writes are visible to controller */
183 writel(ap->prd_dma, mmio + ATA_DMA_TABLE_OFS); 183 writel(ap->prd_dma, mmio + ATA_DMA_TABLE_OFS);
@@ -205,7 +205,7 @@ static void k2_bmdma_setup_mmio (struct ata_queued_cmd *qc)
205static void k2_bmdma_start_mmio (struct ata_queued_cmd *qc) 205static void k2_bmdma_start_mmio (struct ata_queued_cmd *qc)
206{ 206{
207 struct ata_port *ap = qc->ap; 207 struct ata_port *ap = qc->ap;
208 void *mmio = (void *) ap->ioaddr.bmdma_addr; 208 void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr;
209 u8 dmactl; 209 u8 dmactl;
210 210
211 /* start host DMA transaction */ 211 /* start host DMA transaction */
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index d6bb8da955a2..beab6d2643cb 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -295,7 +295,7 @@ fail:
295 * and do_lo_send_write(). 295 * and do_lo_send_write().
296 */ 296 */
297static int __do_lo_send_write(struct file *file, 297static int __do_lo_send_write(struct file *file,
298 u8 __user *buf, const int len, loff_t pos) 298 u8 *buf, const int len, loff_t pos)
299{ 299{
300 ssize_t bw; 300 ssize_t bw;
301 mm_segment_t old_fs = get_fs(); 301 mm_segment_t old_fs = get_fs();
@@ -324,7 +324,7 @@ static int do_lo_send_direct_write(struct loop_device *lo,
324 struct bio_vec *bvec, int bsize, loff_t pos, struct page *page) 324 struct bio_vec *bvec, int bsize, loff_t pos, struct page *page)
325{ 325{
326 ssize_t bw = __do_lo_send_write(lo->lo_backing_file, 326 ssize_t bw = __do_lo_send_write(lo->lo_backing_file,
327 (u8 __user *)kmap(bvec->bv_page) + bvec->bv_offset, 327 kmap(bvec->bv_page) + bvec->bv_offset,
328 bvec->bv_len, pos); 328 bvec->bv_len, pos);
329 kunmap(bvec->bv_page); 329 kunmap(bvec->bv_page);
330 cond_resched(); 330 cond_resched();
@@ -351,7 +351,7 @@ static int do_lo_send_write(struct loop_device *lo, struct bio_vec *bvec,
351 bvec->bv_offset, bvec->bv_len, pos >> 9); 351 bvec->bv_offset, bvec->bv_len, pos >> 9);
352 if (likely(!ret)) 352 if (likely(!ret))
353 return __do_lo_send_write(lo->lo_backing_file, 353 return __do_lo_send_write(lo->lo_backing_file,
354 (u8 __user *)page_address(page), bvec->bv_len, 354 page_address(page), bvec->bv_len,
355 pos); 355 pos);
356 printk(KERN_ERR "loop: Transfer error at byte offset %llu, " 356 printk(KERN_ERR "loop: Transfer error at byte offset %llu, "
357 "length %i.\n", (unsigned long long)pos, bvec->bv_len); 357 "length %i.\n", (unsigned long long)pos, bvec->bv_len);
@@ -1187,7 +1187,7 @@ struct compat_loop_info {
1187 * - noinlined to reduce stack space usage in main part of driver 1187 * - noinlined to reduce stack space usage in main part of driver
1188 */ 1188 */
1189static noinline int 1189static noinline int
1190loop_info64_from_compat(const struct compat_loop_info *arg, 1190loop_info64_from_compat(const struct compat_loop_info __user *arg,
1191 struct loop_info64 *info64) 1191 struct loop_info64 *info64)
1192{ 1192{
1193 struct compat_loop_info info; 1193 struct compat_loop_info info;
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 2a0c50d84fc5..7ea0f48f8fa6 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -703,7 +703,7 @@ static int cdrom_has_defect_mgt(struct cdrom_device_info *cdi)
703{ 703{
704 struct packet_command cgc; 704 struct packet_command cgc;
705 char buffer[16]; 705 char buffer[16];
706 __u16 *feature_code; 706 __be16 *feature_code;
707 int ret; 707 int ret;
708 708
709 init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ); 709 init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
@@ -716,7 +716,7 @@ static int cdrom_has_defect_mgt(struct cdrom_device_info *cdi)
716 if ((ret = cdi->ops->generic_packet(cdi, &cgc))) 716 if ((ret = cdi->ops->generic_packet(cdi, &cgc)))
717 return ret; 717 return ret;
718 718
719 feature_code = (__u16 *) &buffer[sizeof(struct feature_header)]; 719 feature_code = (__be16 *) &buffer[sizeof(struct feature_header)];
720 if (be16_to_cpu(*feature_code) == CDF_HWDM) 720 if (be16_to_cpu(*feature_code) == CDF_HWDM)
721 return 0; 721 return 0;
722 722
@@ -2963,7 +2963,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
2963 how much data is available for transfer. buffer[1] is 2963 how much data is available for transfer. buffer[1] is
2964 unfortunately ambigious and the only reliable way seem 2964 unfortunately ambigious and the only reliable way seem
2965 to be to simply skip over the block descriptor... */ 2965 to be to simply skip over the block descriptor... */
2966 offset = 8 + be16_to_cpu(*(unsigned short *)(buffer+6)); 2966 offset = 8 + be16_to_cpu(*(__be16 *)(buffer+6));
2967 2967
2968 if (offset + 16 > sizeof(buffer)) 2968 if (offset + 16 > sizeof(buffer))
2969 return -E2BIG; 2969 return -E2BIG;
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index d6e031542c6b..ffdf9df1a67a 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -686,37 +686,37 @@ static stlibrd_t *stli_allocbrd(void);
686static void stli_ecpinit(stlibrd_t *brdp); 686static void stli_ecpinit(stlibrd_t *brdp);
687static void stli_ecpenable(stlibrd_t *brdp); 687static void stli_ecpenable(stlibrd_t *brdp);
688static void stli_ecpdisable(stlibrd_t *brdp); 688static void stli_ecpdisable(stlibrd_t *brdp);
689static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); 689static void __iomem *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line);
690static void stli_ecpreset(stlibrd_t *brdp); 690static void stli_ecpreset(stlibrd_t *brdp);
691static void stli_ecpintr(stlibrd_t *brdp); 691static void stli_ecpintr(stlibrd_t *brdp);
692static void stli_ecpeiinit(stlibrd_t *brdp); 692static void stli_ecpeiinit(stlibrd_t *brdp);
693static void stli_ecpeienable(stlibrd_t *brdp); 693static void stli_ecpeienable(stlibrd_t *brdp);
694static void stli_ecpeidisable(stlibrd_t *brdp); 694static void stli_ecpeidisable(stlibrd_t *brdp);
695static char *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line); 695static void __iomem *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line);
696static void stli_ecpeireset(stlibrd_t *brdp); 696static void stli_ecpeireset(stlibrd_t *brdp);
697static void stli_ecpmcenable(stlibrd_t *brdp); 697static void stli_ecpmcenable(stlibrd_t *brdp);
698static void stli_ecpmcdisable(stlibrd_t *brdp); 698static void stli_ecpmcdisable(stlibrd_t *brdp);
699static char *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); 699static void __iomem *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line);
700static void stli_ecpmcreset(stlibrd_t *brdp); 700static void stli_ecpmcreset(stlibrd_t *brdp);
701static void stli_ecppciinit(stlibrd_t *brdp); 701static void stli_ecppciinit(stlibrd_t *brdp);
702static char *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int line); 702static void __iomem *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int line);
703static void stli_ecppcireset(stlibrd_t *brdp); 703static void stli_ecppcireset(stlibrd_t *brdp);
704 704
705static void stli_onbinit(stlibrd_t *brdp); 705static void stli_onbinit(stlibrd_t *brdp);
706static void stli_onbenable(stlibrd_t *brdp); 706static void stli_onbenable(stlibrd_t *brdp);
707static void stli_onbdisable(stlibrd_t *brdp); 707static void stli_onbdisable(stlibrd_t *brdp);
708static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); 708static void __iomem *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line);
709static void stli_onbreset(stlibrd_t *brdp); 709static void stli_onbreset(stlibrd_t *brdp);
710static void stli_onbeinit(stlibrd_t *brdp); 710static void stli_onbeinit(stlibrd_t *brdp);
711static void stli_onbeenable(stlibrd_t *brdp); 711static void stli_onbeenable(stlibrd_t *brdp);
712static void stli_onbedisable(stlibrd_t *brdp); 712static void stli_onbedisable(stlibrd_t *brdp);
713static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line); 713static void __iomem *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line);
714static void stli_onbereset(stlibrd_t *brdp); 714static void stli_onbereset(stlibrd_t *brdp);
715static void stli_bbyinit(stlibrd_t *brdp); 715static void stli_bbyinit(stlibrd_t *brdp);
716static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line); 716static void __iomem *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line);
717static void stli_bbyreset(stlibrd_t *brdp); 717static void stli_bbyreset(stlibrd_t *brdp);
718static void stli_stalinit(stlibrd_t *brdp); 718static void stli_stalinit(stlibrd_t *brdp);
719static char *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); 719static void __iomem *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line);
720static void stli_stalreset(stlibrd_t *brdp); 720static void stli_stalreset(stlibrd_t *brdp);
721 721
722static stliport_t *stli_getport(int brdnr, int panelnr, int portnr); 722static stliport_t *stli_getport(int brdnr, int panelnr, int portnr);
@@ -1566,7 +1566,7 @@ static void stli_flushchars(struct tty_struct *tty)
1566 1566
1567 len = MIN(len, cooksize); 1567 len = MIN(len, cooksize);
1568 count = 0; 1568 count = 0;
1569 shbuf = (char *) EBRDGETMEMPTR(brdp, portp->txoffset); 1569 shbuf = EBRDGETMEMPTR(brdp, portp->txoffset);
1570 buf = stli_txcookbuf; 1570 buf = stli_txcookbuf;
1571 1571
1572 while (len > 0) { 1572 while (len > 0) {
@@ -2948,9 +2948,9 @@ static void stli_ecpdisable(stlibrd_t *brdp)
2948 2948
2949/*****************************************************************************/ 2949/*****************************************************************************/
2950 2950
2951static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) 2951static void __iomem *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
2952{ 2952{
2953 void *ptr; 2953 void __iomem *ptr;
2954 unsigned char val; 2954 unsigned char val;
2955 2955
2956 if (offset > brdp->memsize) { 2956 if (offset > brdp->memsize) {
@@ -3022,9 +3022,9 @@ static void stli_ecpeidisable(stlibrd_t *brdp)
3022 3022
3023/*****************************************************************************/ 3023/*****************************************************************************/
3024 3024
3025static char *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line) 3025static void __iomem *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
3026{ 3026{
3027 void *ptr; 3027 void __iomem *ptr;
3028 unsigned char val; 3028 unsigned char val;
3029 3029
3030 if (offset > brdp->memsize) { 3030 if (offset > brdp->memsize) {
@@ -3074,9 +3074,9 @@ static void stli_ecpmcdisable(stlibrd_t *brdp)
3074 3074
3075/*****************************************************************************/ 3075/*****************************************************************************/
3076 3076
3077static char *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) 3077static void __iomem *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
3078{ 3078{
3079 void *ptr; 3079 void __iomem *ptr;
3080 unsigned char val; 3080 unsigned char val;
3081 3081
3082 if (offset > brdp->memsize) { 3082 if (offset > brdp->memsize) {
@@ -3119,9 +3119,9 @@ static void stli_ecppciinit(stlibrd_t *brdp)
3119 3119
3120/*****************************************************************************/ 3120/*****************************************************************************/
3121 3121
3122static char *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int line) 3122static void __iomem *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
3123{ 3123{
3124 void *ptr; 3124 void __iomem *ptr;
3125 unsigned char val; 3125 unsigned char val;
3126 3126
3127 if (offset > brdp->memsize) { 3127 if (offset > brdp->memsize) {
@@ -3185,9 +3185,9 @@ static void stli_onbdisable(stlibrd_t *brdp)
3185 3185
3186/*****************************************************************************/ 3186/*****************************************************************************/
3187 3187
3188static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) 3188static void __iomem *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
3189{ 3189{
3190 void *ptr; 3190 void __iomem *ptr;
3191 3191
3192 if (offset > brdp->memsize) { 3192 if (offset > brdp->memsize) {
3193 printk(KERN_ERR "STALLION: shared memory pointer=%x out of " 3193 printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
@@ -3250,9 +3250,9 @@ static void stli_onbedisable(stlibrd_t *brdp)
3250 3250
3251/*****************************************************************************/ 3251/*****************************************************************************/
3252 3252
3253static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line) 3253static void __iomem *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
3254{ 3254{
3255 void *ptr; 3255 void __iomem *ptr;
3256 unsigned char val; 3256 unsigned char val;
3257 3257
3258 if (offset > brdp->memsize) { 3258 if (offset > brdp->memsize) {
@@ -3300,9 +3300,9 @@ static void stli_bbyinit(stlibrd_t *brdp)
3300 3300
3301/*****************************************************************************/ 3301/*****************************************************************************/
3302 3302
3303static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line) 3303static void __iomem *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
3304{ 3304{
3305 void *ptr; 3305 void __iomem *ptr;
3306 unsigned char val; 3306 unsigned char val;
3307 3307
3308 BUG_ON(offset > brdp->memsize); 3308 BUG_ON(offset > brdp->memsize);
@@ -3337,7 +3337,7 @@ static void stli_stalinit(stlibrd_t *brdp)
3337 3337
3338/*****************************************************************************/ 3338/*****************************************************************************/
3339 3339
3340static char *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) 3340static void __iomem *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
3341{ 3341{
3342 BUG_ON(offset > brdp->memsize); 3342 BUG_ON(offset > brdp->memsize);
3343 return brdp->membase + (offset % STAL_PAGESIZE); 3343 return brdp->membase + (offset % STAL_PAGESIZE);
@@ -3876,7 +3876,7 @@ static int stli_eisamemprobe(stlibrd_t *brdp)
3876 continue; 3876 continue;
3877 3877
3878 if (brdp->brdtype == BRD_ECPE) { 3878 if (brdp->brdtype == BRD_ECPE) {
3879 ecpsigp = (cdkecpsig_t __iomem *) stli_ecpeigetmemptr(brdp, 3879 ecpsigp = stli_ecpeigetmemptr(brdp,
3880 CDK_SIGADDR, __LINE__); 3880 CDK_SIGADDR, __LINE__);
3881 memcpy_fromio(&ecpsig, ecpsigp, sizeof(cdkecpsig_t)); 3881 memcpy_fromio(&ecpsig, ecpsigp, sizeof(cdkecpsig_t));
3882 if (ecpsig.magic == cpu_to_le32(ECP_MAGIC)) 3882 if (ecpsig.magic == cpu_to_le32(ECP_MAGIC))
@@ -4184,7 +4184,7 @@ static int stli_initbrds(void)
4184static ssize_t stli_memread(struct file *fp, char __user *buf, size_t count, loff_t *offp) 4184static ssize_t stli_memread(struct file *fp, char __user *buf, size_t count, loff_t *offp)
4185{ 4185{
4186 unsigned long flags; 4186 unsigned long flags;
4187 void *memptr; 4187 void __iomem *memptr;
4188 stlibrd_t *brdp; 4188 stlibrd_t *brdp;
4189 int brdnr, size, n; 4189 int brdnr, size, n;
4190 void *p; 4190 void *p;
@@ -4214,7 +4214,7 @@ static ssize_t stli_memread(struct file *fp, char __user *buf, size_t count, lof
4214 while (size > 0) { 4214 while (size > 0) {
4215 spin_lock_irqsave(&brd_lock, flags); 4215 spin_lock_irqsave(&brd_lock, flags);
4216 EBRDENABLE(brdp); 4216 EBRDENABLE(brdp);
4217 memptr = (void *) EBRDGETMEMPTR(brdp, off); 4217 memptr = EBRDGETMEMPTR(brdp, off);
4218 n = MIN(size, (brdp->pagesize - (((unsigned long) off) % brdp->pagesize))); 4218 n = MIN(size, (brdp->pagesize - (((unsigned long) off) % brdp->pagesize)));
4219 n = MIN(n, PAGE_SIZE); 4219 n = MIN(n, PAGE_SIZE);
4220 memcpy_fromio(p, memptr, n); 4220 memcpy_fromio(p, memptr, n);
@@ -4247,7 +4247,7 @@ out:
4247static ssize_t stli_memwrite(struct file *fp, const char __user *buf, size_t count, loff_t *offp) 4247static ssize_t stli_memwrite(struct file *fp, const char __user *buf, size_t count, loff_t *offp)
4248{ 4248{
4249 unsigned long flags; 4249 unsigned long flags;
4250 void *memptr; 4250 void __iomem *memptr;
4251 stlibrd_t *brdp; 4251 stlibrd_t *brdp;
4252 char __user *chbuf; 4252 char __user *chbuf;
4253 int brdnr, size, n; 4253 int brdnr, size, n;
@@ -4287,7 +4287,7 @@ static ssize_t stli_memwrite(struct file *fp, const char __user *buf, size_t cou
4287 } 4287 }
4288 spin_lock_irqsave(&brd_lock, flags); 4288 spin_lock_irqsave(&brd_lock, flags);
4289 EBRDENABLE(brdp); 4289 EBRDENABLE(brdp);
4290 memptr = (void *) EBRDGETMEMPTR(brdp, off); 4290 memptr = EBRDGETMEMPTR(brdp, off);
4291 memcpy_toio(memptr, p, n); 4291 memcpy_toio(memptr, p, n);
4292 EBRDDISABLE(brdp); 4292 EBRDDISABLE(brdp);
4293 spin_unlock_irqrestore(&brd_lock, flags); 4293 spin_unlock_irqrestore(&brd_lock, flags);
diff --git a/drivers/char/qtronix.c b/drivers/char/qtronix.c
deleted file mode 100644
index 5c9477741a30..000000000000
--- a/drivers/char/qtronix.c
+++ /dev/null
@@ -1,605 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Qtronix 990P infrared keyboard driver.
5 *
6 *
7 * Copyright 2001 MontaVista Software Inc.
8 * Author: MontaVista Software, Inc.
9 * ppopov@mvista.com or source@mvista.com
10 *
11 *
12 * The bottom portion of this driver was take from
13 * pc_keyb.c Please see that file for copyrights.
14 *
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the
17 * Free Software Foundation; either version 2 of the License, or (at your
18 * option) any later version.
19 *
20 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
21 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
23 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * You should have received a copy of the GNU General Public License along
32 * with this program; if not, write to the Free Software Foundation, Inc.,
33 * 675 Mass Ave, Cambridge, MA 02139, USA.
34 */
35
36
37/*
38 * NOTE:
39 *
40 * This driver has only been tested with the Consumer IR
41 * port of the ITE 8172 system controller.
42 *
43 * You do not need this driver if you are using the ps/2 or
44 * USB adapter that the keyboard ships with. You only need
45 * this driver if your board has a IR port and the keyboard
46 * data is being sent directly to the IR. In that case,
47 * you also need some low-level IR support. See it8172_cir.c.
48 *
49 */
50
51#ifdef CONFIG_QTRONIX_KEYBOARD
52
53#include <linux/module.h>
54#include <linux/types.h>
55#include <linux/pci.h>
56#include <linux/kernel.h>
57
58#include <asm/it8172/it8172.h>
59#include <asm/it8172/it8172_int.h>
60#include <asm/it8172/it8172_cir.h>
61
62#include <linux/spinlock.h>
63#include <linux/sched.h>
64#include <linux/interrupt.h>
65#include <linux/tty.h>
66#include <linux/mm.h>
67#include <linux/signal.h>
68#include <linux/init.h>
69#include <linux/kbd_ll.h>
70#include <linux/delay.h>
71#include <linux/poll.h>
72#include <linux/miscdevice.h>
73#include <linux/slab.h>
74#include <linux/kbd_kern.h>
75#include <linux/smp_lock.h>
76#include <asm/io.h>
77#include <linux/pc_keyb.h>
78
79#include <asm/keyboard.h>
80#include <linux/bitops.h>
81#include <asm/uaccess.h>
82#include <asm/irq.h>
83#include <asm/system.h>
84
85#define leading1 0
86#define leading2 0xF
87
88#define KBD_CIR_PORT 0
89#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in */
90
91static int data_index;
92struct cir_port *cir;
93static unsigned char kbdbytes[5];
94static unsigned char cir_data[32]; /* we only need 16 chars */
95
96static void kbd_int_handler(int irq, void *dev_id);
97static int handle_data(unsigned char *p_data);
98static inline void handle_mouse_event(unsigned char scancode);
99static inline void handle_keyboard_event(unsigned char scancode, int down);
100static int __init psaux_init(void);
101
102static struct aux_queue *queue; /* Mouse data buffer. */
103static int aux_count = 0;
104
105/*
106 * Keys accessed through the 'Fn' key
107 * The Fn key does not produce a key-up sequence. So, the first
108 * time the user presses it, it will be key-down event. The key
109 * stays down until the user presses it again.
110 */
111#define NUM_FN_KEYS 56
112static unsigned char fn_keys[NUM_FN_KEYS] = {
113 0,0,0,0,0,0,0,0, /* 0 7 */
114 8,9,10,93,0,0,0,0, /* 8 15 */
115 0,0,0,0,0,0,0,5, /* 16 23 */
116 6,7,91,0,0,0,0,0, /* 24 31 */
117 0,0,0,0,0,2,3,4, /* 32 39 */
118 92,0,0,0,0,0,0,0, /* 40 47 */
119 0,0,0,0,11,0,94,95 /* 48 55 */
120
121};
122
123void __init init_qtronix_990P_kbd(void)
124{
125 int retval;
126
127 cir = (struct cir_port *)kmalloc(sizeof(struct cir_port), GFP_KERNEL);
128 if (!cir) {
129 printk("Unable to initialize Qtronix keyboard\n");
130 return;
131 }
132
133 /*
134 * revisit
135 * this should be programmable, somehow by the, by the user.
136 */
137 cir->port = KBD_CIR_PORT;
138 cir->baud_rate = 0x1d;
139 cir->rdwos = 0;
140 cir->rxdcr = 0x3;
141 cir->hcfs = 0;
142 cir->fifo_tl = 0;
143 cir->cfq = 0x1d;
144 cir_port_init(cir);
145
146 retval = request_irq(IT8172_CIR0_IRQ, kbd_int_handler,
147 (unsigned long )(IRQF_DISABLED|IRQF_SHARED),
148 (const char *)"Qtronix IR Keyboard", (void *)cir);
149
150 if (retval) {
151 printk("unable to allocate cir %d irq %d\n",
152 cir->port, IT8172_CIR0_IRQ);
153 }
154#ifdef CONFIG_PSMOUSE
155 psaux_init();
156#endif
157}
158
159static inline unsigned char BitReverse(unsigned short key)
160{
161 unsigned char rkey = 0;
162 rkey |= (key & 0x1) << 7;
163 rkey |= (key & 0x2) << 5;
164 rkey |= (key & 0x4) << 3;
165 rkey |= (key & 0x8) << 1;
166 rkey |= (key & 0x10) >> 1;
167 rkey |= (key & 0x20) >> 3;
168 rkey |= (key & 0x40) >> 5;
169 rkey |= (key & 0x80) >> 7;
170 return rkey;
171
172}
173
174
175static inline u_int8_t UpperByte(u_int8_t data)
176{
177 return (data >> 4);
178}
179
180
181static inline u_int8_t LowerByte(u_int8_t data)
182{
183 return (data & 0xF);
184}
185
186
187int CheckSumOk(u_int8_t byte1, u_int8_t byte2,
188 u_int8_t byte3, u_int8_t byte4, u_int8_t byte5)
189{
190 u_int8_t CheckSum;
191
192 CheckSum = (byte1 & 0x0F) + byte2 + byte3 + byte4 + byte5;
193 if ( LowerByte(UpperByte(CheckSum) + LowerByte(CheckSum)) != UpperByte(byte1) )
194 return 0;
195 else
196 return 1;
197}
198
199
200static void kbd_int_handler(int irq, void *dev_id)
201{
202 struct cir_port *cir;
203 int j;
204 unsigned char int_status;
205
206 cir = (struct cir_port *)dev_id;
207 int_status = get_int_status(cir);
208 if (int_status & 0x4) {
209 clear_fifo(cir);
210 return;
211 }
212
213 while (cir_get_rx_count(cir)) {
214
215 cir_data[data_index] = cir_read_data(cir);
216
217 if (data_index == 0) {/* expecting first byte */
218 if (cir_data[data_index] != leading1) {
219 //printk("!leading byte %x\n", cir_data[data_index]);
220 set_rx_active(cir);
221 clear_fifo(cir);
222 continue;
223 }
224 }
225 if (data_index == 1) {
226 if ((cir_data[data_index] & 0xf) != leading2) {
227 set_rx_active(cir);
228 data_index = 0; /* start over */
229 clear_fifo(cir);
230 continue;
231 }
232 }
233
234 if ( (cir_data[data_index] == 0xff)) { /* last byte */
235 //printk("data_index %d\n", data_index);
236 set_rx_active(cir);
237#if 0
238 for (j=0; j<=data_index; j++) {
239 printk("rx_data %d: %x\n", j, cir_data[j]);
240 }
241#endif
242 data_index = 0;
243 handle_data(cir_data);
244 return;
245 }
246 else if (data_index>16) {
247 set_rx_active(cir);
248#if 0
249 printk("warning: data_index %d\n", data_index);
250 for (j=0; j<=data_index; j++) {
251 printk("rx_data %d: %x\n", j, cir_data[j]);
252 }
253#endif
254 data_index = 0;
255 clear_fifo(cir);
256 return;
257 }
258 data_index++;
259 }
260}
261
262
263#define NUM_KBD_BYTES 5
264static int handle_data(unsigned char *p_data)
265{
266 u_int32_t bit_bucket;
267 u_int32_t i, j;
268 u_int32_t got_bits, next_byte;
269 int down = 0;
270
271 /* Reorganize the bit stream */
272 for (i=0; i<16; i++)
273 p_data[i] = BitReverse(~p_data[i]);
274
275 /*
276 * We've already previously checked that p_data[0]
277 * is equal to leading1 and that (p_data[1] & 0xf)
278 * is equal to leading2. These twelve bits are the
279 * leader code. We can now throw them away (the 12
280 * bits) and continue parsing the stream.
281 */
282 bit_bucket = p_data[1] << 12;
283 got_bits = 4;
284 next_byte = 2;
285
286 /*
287 * Process four bits at a time
288 */
289 for (i=0; i<NUM_KBD_BYTES; i++) {
290
291 kbdbytes[i]=0;
292
293 for (j=0; j<8; j++) /* 8 bits per byte */
294 {
295 if (got_bits < 4) {
296 bit_bucket |= (p_data[next_byte++] << (8 - got_bits));
297 got_bits += 8;
298 }
299
300 if ((bit_bucket & 0xF000) == 0x8000) {
301 /* Convert 1000b to 1 */
302 kbdbytes[i] = 0x80 | (kbdbytes[i] >> 1);
303 got_bits -= 4;
304 bit_bucket = bit_bucket << 4;
305 }
306 else if ((bit_bucket & 0xC000) == 0x8000) {
307 /* Convert 10b to 0 */
308 kbdbytes[i] = kbdbytes[i] >> 1;
309 got_bits -= 2;
310 bit_bucket = bit_bucket << 2;
311 }
312 else {
313 /* bad serial stream */
314 return 1;
315 }
316
317 if (next_byte > 16) {
318 //printk("error: too many bytes\n");
319 return 1;
320 }
321 }
322 }
323
324
325 if (!CheckSumOk(kbdbytes[0], kbdbytes[1],
326 kbdbytes[2], kbdbytes[3], kbdbytes[4])) {
327 //printk("checksum failed\n");
328 return 1;
329 }
330
331 if (kbdbytes[1] & 0x08) {
332 //printk("m: %x %x %x\n", kbdbytes[1], kbdbytes[2], kbdbytes[3]);
333 handle_mouse_event(kbdbytes[1]);
334 handle_mouse_event(kbdbytes[2]);
335 handle_mouse_event(kbdbytes[3]);
336 }
337 else {
338 if (kbdbytes[2] == 0) down = 1;
339#if 0
340 if (down)
341 printk("down %d\n", kbdbytes[3]);
342 else
343 printk("up %d\n", kbdbytes[3]);
344#endif
345 handle_keyboard_event(kbdbytes[3], down);
346 }
347 return 0;
348}
349
350
351DEFINE_SPINLOCK(kbd_controller_lock);
352static unsigned char handle_kbd_event(void);
353
354
355int kbd_setkeycode(unsigned int scancode, unsigned int keycode)
356{
357 printk("kbd_setkeycode scancode %x keycode %x\n", scancode, keycode);
358 return 0;
359}
360
361int kbd_getkeycode(unsigned int scancode)
362{
363 return scancode;
364}
365
366
367int kbd_translate(unsigned char scancode, unsigned char *keycode,
368 char raw_mode)
369{
370 static int prev_scancode = 0;
371
372 if (scancode == 0x00 || scancode == 0xff) {
373 prev_scancode = 0;
374 return 0;
375 }
376
377 /* todo */
378 if (!prev_scancode && scancode == 160) { /* Fn key down */
379 //printk("Fn key down\n");
380 prev_scancode = 160;
381 return 0;
382 }
383 else if (prev_scancode && scancode == 160) { /* Fn key up */
384 //printk("Fn key up\n");
385 prev_scancode = 0;
386 return 0;
387 }
388
389 /* todo */
390 if (prev_scancode == 160) {
391 if (scancode <= NUM_FN_KEYS) {
392 *keycode = fn_keys[scancode];
393 //printk("fn keycode %d\n", *keycode);
394 }
395 else
396 return 0;
397 }
398 else if (scancode <= 127) {
399 *keycode = scancode;
400 }
401 else
402 return 0;
403
404
405 return 1;
406}
407
408char kbd_unexpected_up(unsigned char keycode)
409{
410 //printk("kbd_unexpected_up\n");
411 return 0;
412}
413
414static unsigned char kbd_exists = 1;
415
416static inline void handle_keyboard_event(unsigned char scancode, int down)
417{
418 kbd_exists = 1;
419 handle_scancode(scancode, down);
420 tasklet_schedule(&keyboard_tasklet);
421}
422
423
424void kbd_leds(unsigned char leds)
425{
426}
427
428/* dummy */
429void kbd_init_hw(void)
430{
431}
432
433
434
435static inline void handle_mouse_event(unsigned char scancode)
436{
437 if(scancode == AUX_RECONNECT){
438 queue->head = queue->tail = 0; /* Flush input queue */
439 // __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */
440 return;
441 }
442
443 if (aux_count) {
444 int head = queue->head;
445
446 queue->buf[head] = scancode;
447 head = (head + 1) & (AUX_BUF_SIZE-1);
448 if (head != queue->tail) {
449 queue->head = head;
450 kill_fasync(&queue->fasync, SIGIO, POLL_IN);
451 wake_up_interruptible(&queue->proc_list);
452 }
453 }
454}
455
456static unsigned char get_from_queue(void)
457{
458 unsigned char result;
459 unsigned long flags;
460
461 spin_lock_irqsave(&kbd_controller_lock, flags);
462 result = queue->buf[queue->tail];
463 queue->tail = (queue->tail + 1) & (AUX_BUF_SIZE-1);
464 spin_unlock_irqrestore(&kbd_controller_lock, flags);
465 return result;
466}
467
468
469static inline int queue_empty(void)
470{
471 return queue->head == queue->tail;
472}
473
474static int fasync_aux(int fd, struct file *filp, int on)
475{
476 int retval;
477
478 //printk("fasync_aux\n");
479 retval = fasync_helper(fd, filp, on, &queue->fasync);
480 if (retval < 0)
481 return retval;
482 return 0;
483}
484
485
486/*
487 * Random magic cookie for the aux device
488 */
489#define AUX_DEV ((void *)queue)
490
491static int release_aux(struct inode * inode, struct file * file)
492{
493 fasync_aux(-1, file, 0);
494 aux_count--;
495 return 0;
496}
497
498static int open_aux(struct inode * inode, struct file * file)
499{
500 if (aux_count++) {
501 return 0;
502 }
503 queue->head = queue->tail = 0; /* Flush input queue */
504 return 0;
505}
506
507/*
508 * Put bytes from input queue to buffer.
509 */
510
511static ssize_t read_aux(struct file * file, char * buffer,
512 size_t count, loff_t *ppos)
513{
514 DECLARE_WAITQUEUE(wait, current);
515 ssize_t i = count;
516 unsigned char c;
517
518 if (queue_empty()) {
519 if (file->f_flags & O_NONBLOCK)
520 return -EAGAIN;
521 add_wait_queue(&queue->proc_list, &wait);
522repeat:
523 set_current_state(TASK_INTERRUPTIBLE);
524 if (queue_empty() && !signal_pending(current)) {
525 schedule();
526 goto repeat;
527 }
528 current->state = TASK_RUNNING;
529 remove_wait_queue(&queue->proc_list, &wait);
530 }
531 while (i > 0 && !queue_empty()) {
532 c = get_from_queue();
533 put_user(c, buffer++);
534 i--;
535 }
536 if (count-i) {
537 struct inode *inode = file->f_dentry->d_inode;
538 inode->i_atime = current_fs_time(inode->i_sb);
539 return count-i;
540 }
541 if (signal_pending(current))
542 return -ERESTARTSYS;
543 return 0;
544}
545
546/*
547 * Write to the aux device.
548 */
549
550static ssize_t write_aux(struct file * file, const char * buffer,
551 size_t count, loff_t *ppos)
552{
553 /*
554 * The ITE boards this was tested on did not have the
555 * transmit wires connected.
556 */
557 return count;
558}
559
560static unsigned int aux_poll(struct file *file, poll_table * wait)
561{
562 poll_wait(file, &queue->proc_list, wait);
563 if (!queue_empty())
564 return POLLIN | POLLRDNORM;
565 return 0;
566}
567
568struct file_operations psaux_fops = {
569 .read = read_aux,
570 .write = write_aux,
571 .poll = aux_poll,
572 .open = open_aux,
573 .release = release_aux,
574 .fasync = fasync_aux,
575};
576
577/*
578 * Initialize driver.
579 */
580static struct miscdevice psaux_mouse = {
581 PSMOUSE_MINOR, "psaux", &psaux_fops
582};
583
584static int __init psaux_init(void)
585{
586 int retval;
587
588 retval = misc_register(&psaux_mouse);
589 if(retval < 0)
590 return retval;
591
592 queue = (struct aux_queue *) kmalloc(sizeof(*queue), GFP_KERNEL);
593 if (!queue) {
594 misc_deregister(&psaux_mouse);
595 return -ENOMEM;
596 }
597
598 memset(queue, 0, sizeof(*queue));
599 queue->head = queue->tail = 0;
600 init_waitqueue_head(&queue->proc_list);
601
602 return 0;
603}
604module_init(init_qtronix_990P_kbd);
605#endif
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index abee7a339462..66a7385bc34a 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -35,13 +35,13 @@
35 * 1.09a Pete Zaitcev: Sun SPARC 35 * 1.09a Pete Zaitcev: Sun SPARC
36 * 1.09b Jeff Garzik: Modularize, init cleanup 36 * 1.09b Jeff Garzik: Modularize, init cleanup
37 * 1.09c Jeff Garzik: SMP cleanup 37 * 1.09c Jeff Garzik: SMP cleanup
38 * 1.10 Paul Barton-Davis: add support for async I/O 38 * 1.10 Paul Barton-Davis: add support for async I/O
39 * 1.10a Andrea Arcangeli: Alpha updates 39 * 1.10a Andrea Arcangeli: Alpha updates
40 * 1.10b Andrew Morton: SMP lock fix 40 * 1.10b Andrew Morton: SMP lock fix
41 * 1.10c Cesar Barros: SMP locking fixes and cleanup 41 * 1.10c Cesar Barros: SMP locking fixes and cleanup
42 * 1.10d Paul Gortmaker: delete paranoia check in rtc_exit 42 * 1.10d Paul Gortmaker: delete paranoia check in rtc_exit
43 * 1.10e Maciej W. Rozycki: Handle DECstation's year weirdness. 43 * 1.10e Maciej W. Rozycki: Handle DECstation's year weirdness.
44 * 1.11 Takashi Iwai: Kernel access functions 44 * 1.11 Takashi Iwai: Kernel access functions
45 * rtc_register/rtc_unregister/rtc_control 45 * rtc_register/rtc_unregister/rtc_control
46 * 1.11a Daniele Bellucci: Audit create_proc_read_entry in rtc_init 46 * 1.11a Daniele Bellucci: Audit create_proc_read_entry in rtc_init
47 * 1.12 Venkatesh Pallipadi: Hooks for emulating rtc on HPET base-timer 47 * 1.12 Venkatesh Pallipadi: Hooks for emulating rtc on HPET base-timer
diff --git a/drivers/dma/ioatdma.c b/drivers/dma/ioatdma.c
index f3bf1e230bca..0358419a0e48 100644
--- a/drivers/dma/ioatdma.c
+++ b/drivers/dma/ioatdma.c
@@ -80,7 +80,7 @@ static int enumerate_dma_channels(struct ioat_device *device)
80 80
81static struct ioat_desc_sw *ioat_dma_alloc_descriptor( 81static struct ioat_desc_sw *ioat_dma_alloc_descriptor(
82 struct ioat_dma_chan *ioat_chan, 82 struct ioat_dma_chan *ioat_chan,
83 int flags) 83 gfp_t flags)
84{ 84{
85 struct ioat_dma_descriptor *desc; 85 struct ioat_dma_descriptor *desc;
86 struct ioat_desc_sw *desc_sw; 86 struct ioat_desc_sw *desc_sw;
@@ -686,7 +686,7 @@ static int __devinit ioat_probe(struct pci_dev *pdev,
686{ 686{
687 int err; 687 int err;
688 unsigned long mmio_start, mmio_len; 688 unsigned long mmio_start, mmio_len;
689 void *reg_base; 689 void __iomem *reg_base;
690 struct ioat_device *device; 690 struct ioat_device *device;
691 691
692 err = pci_enable_device(pdev); 692 err = pci_enable_device(pdev);
diff --git a/drivers/dma/ioatdma.h b/drivers/dma/ioatdma.h
index a5d3b3644160..62b26a9be4c9 100644
--- a/drivers/dma/ioatdma.h
+++ b/drivers/dma/ioatdma.h
@@ -44,7 +44,7 @@ extern struct list_head dma_client_list;
44 44
45struct ioat_device { 45struct ioat_device {
46 struct pci_dev *pdev; 46 struct pci_dev *pdev;
47 void *reg_base; 47 void __iomem *reg_base;
48 struct pci_pool *dma_pool; 48 struct pci_pool *dma_pool;
49 struct pci_pool *completion_pool; 49 struct pci_pool *completion_pool;
50 50
@@ -73,7 +73,7 @@ struct ioat_device {
73 73
74struct ioat_dma_chan { 74struct ioat_dma_chan {
75 75
76 void *reg_base; 76 void __iomem *reg_base;
77 77
78 dma_cookie_t completed_cookie; 78 dma_cookie_t completed_cookie;
79 unsigned long last_completion; 79 unsigned long last_completion;
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index f35fcc4c0638..25b1018a476c 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -75,6 +75,7 @@ static struct ib_cm {
75 struct rb_root remote_sidr_table; 75 struct rb_root remote_sidr_table;
76 struct idr local_id_table; 76 struct idr local_id_table;
77 __be32 random_id_operand; 77 __be32 random_id_operand;
78 struct list_head timewait_list;
78 struct workqueue_struct *wq; 79 struct workqueue_struct *wq;
79} cm; 80} cm;
80 81
@@ -112,6 +113,7 @@ struct cm_work {
112 113
113struct cm_timewait_info { 114struct cm_timewait_info {
114 struct cm_work work; /* Must be first. */ 115 struct cm_work work; /* Must be first. */
116 struct list_head list;
115 struct rb_node remote_qp_node; 117 struct rb_node remote_qp_node;
116 struct rb_node remote_id_node; 118 struct rb_node remote_id_node;
117 __be64 remote_ca_guid; 119 __be64 remote_ca_guid;
@@ -647,13 +649,6 @@ static inline int cm_convert_to_ms(int iba_time)
647 649
648static void cm_cleanup_timewait(struct cm_timewait_info *timewait_info) 650static void cm_cleanup_timewait(struct cm_timewait_info *timewait_info)
649{ 651{
650 unsigned long flags;
651
652 if (!timewait_info->inserted_remote_id &&
653 !timewait_info->inserted_remote_qp)
654 return;
655
656 spin_lock_irqsave(&cm.lock, flags);
657 if (timewait_info->inserted_remote_id) { 652 if (timewait_info->inserted_remote_id) {
658 rb_erase(&timewait_info->remote_id_node, &cm.remote_id_table); 653 rb_erase(&timewait_info->remote_id_node, &cm.remote_id_table);
659 timewait_info->inserted_remote_id = 0; 654 timewait_info->inserted_remote_id = 0;
@@ -663,7 +658,6 @@ static void cm_cleanup_timewait(struct cm_timewait_info *timewait_info)
663 rb_erase(&timewait_info->remote_qp_node, &cm.remote_qp_table); 658 rb_erase(&timewait_info->remote_qp_node, &cm.remote_qp_table);
664 timewait_info->inserted_remote_qp = 0; 659 timewait_info->inserted_remote_qp = 0;
665 } 660 }
666 spin_unlock_irqrestore(&cm.lock, flags);
667} 661}
668 662
669static struct cm_timewait_info * cm_create_timewait_info(__be32 local_id) 663static struct cm_timewait_info * cm_create_timewait_info(__be32 local_id)
@@ -684,8 +678,12 @@ static struct cm_timewait_info * cm_create_timewait_info(__be32 local_id)
684static void cm_enter_timewait(struct cm_id_private *cm_id_priv) 678static void cm_enter_timewait(struct cm_id_private *cm_id_priv)
685{ 679{
686 int wait_time; 680 int wait_time;
681 unsigned long flags;
687 682
683 spin_lock_irqsave(&cm.lock, flags);
688 cm_cleanup_timewait(cm_id_priv->timewait_info); 684 cm_cleanup_timewait(cm_id_priv->timewait_info);
685 list_add_tail(&cm_id_priv->timewait_info->list, &cm.timewait_list);
686 spin_unlock_irqrestore(&cm.lock, flags);
689 687
690 /* 688 /*
691 * The cm_id could be destroyed by the user before we exit timewait. 689 * The cm_id could be destroyed by the user before we exit timewait.
@@ -701,9 +699,13 @@ static void cm_enter_timewait(struct cm_id_private *cm_id_priv)
701 699
702static void cm_reset_to_idle(struct cm_id_private *cm_id_priv) 700static void cm_reset_to_idle(struct cm_id_private *cm_id_priv)
703{ 701{
702 unsigned long flags;
703
704 cm_id_priv->id.state = IB_CM_IDLE; 704 cm_id_priv->id.state = IB_CM_IDLE;
705 if (cm_id_priv->timewait_info) { 705 if (cm_id_priv->timewait_info) {
706 spin_lock_irqsave(&cm.lock, flags);
706 cm_cleanup_timewait(cm_id_priv->timewait_info); 707 cm_cleanup_timewait(cm_id_priv->timewait_info);
708 spin_unlock_irqrestore(&cm.lock, flags);
707 kfree(cm_id_priv->timewait_info); 709 kfree(cm_id_priv->timewait_info);
708 cm_id_priv->timewait_info = NULL; 710 cm_id_priv->timewait_info = NULL;
709 } 711 }
@@ -1307,6 +1309,7 @@ static struct cm_id_private * cm_match_req(struct cm_work *work,
1307 if (timewait_info) { 1309 if (timewait_info) {
1308 cur_cm_id_priv = cm_get_id(timewait_info->work.local_id, 1310 cur_cm_id_priv = cm_get_id(timewait_info->work.local_id,
1309 timewait_info->work.remote_id); 1311 timewait_info->work.remote_id);
1312 cm_cleanup_timewait(cm_id_priv->timewait_info);
1310 spin_unlock_irqrestore(&cm.lock, flags); 1313 spin_unlock_irqrestore(&cm.lock, flags);
1311 if (cur_cm_id_priv) { 1314 if (cur_cm_id_priv) {
1312 cm_dup_req_handler(work, cur_cm_id_priv); 1315 cm_dup_req_handler(work, cur_cm_id_priv);
@@ -1315,7 +1318,8 @@ static struct cm_id_private * cm_match_req(struct cm_work *work,
1315 cm_issue_rej(work->port, work->mad_recv_wc, 1318 cm_issue_rej(work->port, work->mad_recv_wc,
1316 IB_CM_REJ_STALE_CONN, CM_MSG_RESPONSE_REQ, 1319 IB_CM_REJ_STALE_CONN, CM_MSG_RESPONSE_REQ,
1317 NULL, 0); 1320 NULL, 0);
1318 goto error; 1321 listen_cm_id_priv = NULL;
1322 goto out;
1319 } 1323 }
1320 1324
1321 /* Find matching listen request. */ 1325 /* Find matching listen request. */
@@ -1323,21 +1327,20 @@ static struct cm_id_private * cm_match_req(struct cm_work *work,
1323 req_msg->service_id, 1327 req_msg->service_id,
1324 req_msg->private_data); 1328 req_msg->private_data);
1325 if (!listen_cm_id_priv) { 1329 if (!listen_cm_id_priv) {
1330 cm_cleanup_timewait(cm_id_priv->timewait_info);
1326 spin_unlock_irqrestore(&cm.lock, flags); 1331 spin_unlock_irqrestore(&cm.lock, flags);
1327 cm_issue_rej(work->port, work->mad_recv_wc, 1332 cm_issue_rej(work->port, work->mad_recv_wc,
1328 IB_CM_REJ_INVALID_SERVICE_ID, CM_MSG_RESPONSE_REQ, 1333 IB_CM_REJ_INVALID_SERVICE_ID, CM_MSG_RESPONSE_REQ,
1329 NULL, 0); 1334 NULL, 0);
1330 goto error; 1335 goto out;
1331 } 1336 }
1332 atomic_inc(&listen_cm_id_priv->refcount); 1337 atomic_inc(&listen_cm_id_priv->refcount);
1333 atomic_inc(&cm_id_priv->refcount); 1338 atomic_inc(&cm_id_priv->refcount);
1334 cm_id_priv->id.state = IB_CM_REQ_RCVD; 1339 cm_id_priv->id.state = IB_CM_REQ_RCVD;
1335 atomic_inc(&cm_id_priv->work_count); 1340 atomic_inc(&cm_id_priv->work_count);
1336 spin_unlock_irqrestore(&cm.lock, flags); 1341 spin_unlock_irqrestore(&cm.lock, flags);
1342out:
1337 return listen_cm_id_priv; 1343 return listen_cm_id_priv;
1338
1339error: cm_cleanup_timewait(cm_id_priv->timewait_info);
1340 return NULL;
1341} 1344}
1342 1345
1343static int cm_req_handler(struct cm_work *work) 1346static int cm_req_handler(struct cm_work *work)
@@ -1899,6 +1902,32 @@ out: spin_unlock_irqrestore(&cm_id_priv->lock, flags);
1899} 1902}
1900EXPORT_SYMBOL(ib_send_cm_drep); 1903EXPORT_SYMBOL(ib_send_cm_drep);
1901 1904
1905static int cm_issue_drep(struct cm_port *port,
1906 struct ib_mad_recv_wc *mad_recv_wc)
1907{
1908 struct ib_mad_send_buf *msg = NULL;
1909 struct cm_dreq_msg *dreq_msg;
1910 struct cm_drep_msg *drep_msg;
1911 int ret;
1912
1913 ret = cm_alloc_response_msg(port, mad_recv_wc, &msg);
1914 if (ret)
1915 return ret;
1916
1917 dreq_msg = (struct cm_dreq_msg *) mad_recv_wc->recv_buf.mad;
1918 drep_msg = (struct cm_drep_msg *) msg->mad;
1919
1920 cm_format_mad_hdr(&drep_msg->hdr, CM_DREP_ATTR_ID, dreq_msg->hdr.tid);
1921 drep_msg->remote_comm_id = dreq_msg->local_comm_id;
1922 drep_msg->local_comm_id = dreq_msg->remote_comm_id;
1923
1924 ret = ib_post_send_mad(msg, NULL);
1925 if (ret)
1926 cm_free_msg(msg);
1927
1928 return ret;
1929}
1930
1902static int cm_dreq_handler(struct cm_work *work) 1931static int cm_dreq_handler(struct cm_work *work)
1903{ 1932{
1904 struct cm_id_private *cm_id_priv; 1933 struct cm_id_private *cm_id_priv;
@@ -1910,8 +1939,10 @@ static int cm_dreq_handler(struct cm_work *work)
1910 dreq_msg = (struct cm_dreq_msg *)work->mad_recv_wc->recv_buf.mad; 1939 dreq_msg = (struct cm_dreq_msg *)work->mad_recv_wc->recv_buf.mad;
1911 cm_id_priv = cm_acquire_id(dreq_msg->remote_comm_id, 1940 cm_id_priv = cm_acquire_id(dreq_msg->remote_comm_id,
1912 dreq_msg->local_comm_id); 1941 dreq_msg->local_comm_id);
1913 if (!cm_id_priv) 1942 if (!cm_id_priv) {
1943 cm_issue_drep(work->port, work->mad_recv_wc);
1914 return -EINVAL; 1944 return -EINVAL;
1945 }
1915 1946
1916 work->cm_event.private_data = &dreq_msg->private_data; 1947 work->cm_event.private_data = &dreq_msg->private_data;
1917 1948
@@ -2601,28 +2632,29 @@ static int cm_timewait_handler(struct cm_work *work)
2601{ 2632{
2602 struct cm_timewait_info *timewait_info; 2633 struct cm_timewait_info *timewait_info;
2603 struct cm_id_private *cm_id_priv; 2634 struct cm_id_private *cm_id_priv;
2604 unsigned long flags;
2605 int ret; 2635 int ret;
2606 2636
2607 timewait_info = (struct cm_timewait_info *)work; 2637 timewait_info = (struct cm_timewait_info *)work;
2608 cm_cleanup_timewait(timewait_info); 2638 spin_lock_irq(&cm.lock);
2639 list_del(&timewait_info->list);
2640 spin_unlock_irq(&cm.lock);
2609 2641
2610 cm_id_priv = cm_acquire_id(timewait_info->work.local_id, 2642 cm_id_priv = cm_acquire_id(timewait_info->work.local_id,
2611 timewait_info->work.remote_id); 2643 timewait_info->work.remote_id);
2612 if (!cm_id_priv) 2644 if (!cm_id_priv)
2613 return -EINVAL; 2645 return -EINVAL;
2614 2646
2615 spin_lock_irqsave(&cm_id_priv->lock, flags); 2647 spin_lock_irq(&cm_id_priv->lock);
2616 if (cm_id_priv->id.state != IB_CM_TIMEWAIT || 2648 if (cm_id_priv->id.state != IB_CM_TIMEWAIT ||
2617 cm_id_priv->remote_qpn != timewait_info->remote_qpn) { 2649 cm_id_priv->remote_qpn != timewait_info->remote_qpn) {
2618 spin_unlock_irqrestore(&cm_id_priv->lock, flags); 2650 spin_unlock_irq(&cm_id_priv->lock);
2619 goto out; 2651 goto out;
2620 } 2652 }
2621 cm_id_priv->id.state = IB_CM_IDLE; 2653 cm_id_priv->id.state = IB_CM_IDLE;
2622 ret = atomic_inc_and_test(&cm_id_priv->work_count); 2654 ret = atomic_inc_and_test(&cm_id_priv->work_count);
2623 if (!ret) 2655 if (!ret)
2624 list_add_tail(&work->list, &cm_id_priv->work_list); 2656 list_add_tail(&work->list, &cm_id_priv->work_list);
2625 spin_unlock_irqrestore(&cm_id_priv->lock, flags); 2657 spin_unlock_irq(&cm_id_priv->lock);
2626 2658
2627 if (ret) 2659 if (ret)
2628 cm_process_work(cm_id_priv, work); 2660 cm_process_work(cm_id_priv, work);
@@ -3374,6 +3406,7 @@ static int __init ib_cm_init(void)
3374 idr_init(&cm.local_id_table); 3406 idr_init(&cm.local_id_table);
3375 get_random_bytes(&cm.random_id_operand, sizeof cm.random_id_operand); 3407 get_random_bytes(&cm.random_id_operand, sizeof cm.random_id_operand);
3376 idr_pre_get(&cm.local_id_table, GFP_KERNEL); 3408 idr_pre_get(&cm.local_id_table, GFP_KERNEL);
3409 INIT_LIST_HEAD(&cm.timewait_list);
3377 3410
3378 cm.wq = create_workqueue("ib_cm"); 3411 cm.wq = create_workqueue("ib_cm");
3379 if (!cm.wq) 3412 if (!cm.wq)
@@ -3391,7 +3424,20 @@ error:
3391 3424
3392static void __exit ib_cm_cleanup(void) 3425static void __exit ib_cm_cleanup(void)
3393{ 3426{
3427 struct cm_timewait_info *timewait_info, *tmp;
3428
3429 spin_lock_irq(&cm.lock);
3430 list_for_each_entry(timewait_info, &cm.timewait_list, list)
3431 cancel_delayed_work(&timewait_info->work.work);
3432 spin_unlock_irq(&cm.lock);
3433
3394 destroy_workqueue(cm.wq); 3434 destroy_workqueue(cm.wq);
3435
3436 list_for_each_entry_safe(timewait_info, tmp, &cm.timewait_list, list) {
3437 list_del(&timewait_info->list);
3438 kfree(timewait_info);
3439 }
3440
3395 ib_unregister_client(&cm_client); 3441 ib_unregister_client(&cm_client);
3396 idr_destroy(&cm.local_id_table); 3442 idr_destroy(&cm.local_id_table);
3397} 3443}
diff --git a/drivers/infiniband/hw/amso1100/c2_ae.c b/drivers/infiniband/hw/amso1100/c2_ae.c
index 3aae4978e1cb..a31439bd3b67 100644
--- a/drivers/infiniband/hw/amso1100/c2_ae.c
+++ b/drivers/infiniband/hw/amso1100/c2_ae.c
@@ -66,7 +66,6 @@ static int c2_convert_cm_status(u32 c2_status)
66 } 66 }
67} 67}
68 68
69#ifdef DEBUG
70static const char* to_event_str(int event) 69static const char* to_event_str(int event)
71{ 70{
72 static const char* event_str[] = { 71 static const char* event_str[] = {
@@ -144,7 +143,6 @@ static const char *to_qp_state_str(int state)
144 return "<invalid QP state>"; 143 return "<invalid QP state>";
145 }; 144 };
146} 145}
147#endif
148 146
149void c2_ae_event(struct c2_dev *c2dev, u32 mq_index) 147void c2_ae_event(struct c2_dev *c2dev, u32 mq_index)
150{ 148{
diff --git a/drivers/infiniband/hw/amso1100/c2_qp.c b/drivers/infiniband/hw/amso1100/c2_qp.c
index 12261132b077..5bcf697aa335 100644
--- a/drivers/infiniband/hw/amso1100/c2_qp.c
+++ b/drivers/infiniband/hw/amso1100/c2_qp.c
@@ -35,6 +35,8 @@
35 * 35 *
36 */ 36 */
37 37
38#include <linux/delay.h>
39
38#include "c2.h" 40#include "c2.h"
39#include "c2_vq.h" 41#include "c2_vq.h"
40#include "c2_status.h" 42#include "c2_status.h"
@@ -705,10 +707,8 @@ static inline void c2_activity(struct c2_dev *c2dev, u32 mq_index, u16 shared)
705 * cannot get on the bus and the card and system hang in a 707 * cannot get on the bus and the card and system hang in a
706 * deadlock -- thus the need for this code. [TOT] 708 * deadlock -- thus the need for this code. [TOT]
707 */ 709 */
708 while (readl(c2dev->regs + PCI_BAR0_ADAPTER_HINT) & 0x80000000) { 710 while (readl(c2dev->regs + PCI_BAR0_ADAPTER_HINT) & 0x80000000)
709 set_current_state(TASK_UNINTERRUPTIBLE); 711 udelay(10);
710 schedule_timeout(0);
711 }
712 712
713 __raw_writel(C2_HINT_MAKE(mq_index, shared), 713 __raw_writel(C2_HINT_MAKE(mq_index, shared),
714 c2dev->regs + PCI_BAR0_ADAPTER_HINT); 714 c2dev->regs + PCI_BAR0_ADAPTER_HINT);
@@ -766,6 +766,7 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
766 struct c2_dev *c2dev = to_c2dev(ibqp->device); 766 struct c2_dev *c2dev = to_c2dev(ibqp->device);
767 struct c2_qp *qp = to_c2qp(ibqp); 767 struct c2_qp *qp = to_c2qp(ibqp);
768 union c2wr wr; 768 union c2wr wr;
769 unsigned long lock_flags;
769 int err = 0; 770 int err = 0;
770 771
771 u32 flags; 772 u32 flags;
@@ -881,8 +882,10 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
881 /* 882 /*
882 * Post the puppy! 883 * Post the puppy!
883 */ 884 */
885 spin_lock_irqsave(&qp->lock, lock_flags);
884 err = qp_wr_post(&qp->sq_mq, &wr, qp, msg_size); 886 err = qp_wr_post(&qp->sq_mq, &wr, qp, msg_size);
885 if (err) { 887 if (err) {
888 spin_unlock_irqrestore(&qp->lock, lock_flags);
886 break; 889 break;
887 } 890 }
888 891
@@ -890,6 +893,7 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
890 * Enqueue mq index to activity FIFO. 893 * Enqueue mq index to activity FIFO.
891 */ 894 */
892 c2_activity(c2dev, qp->sq_mq.index, qp->sq_mq.hint_count); 895 c2_activity(c2dev, qp->sq_mq.index, qp->sq_mq.hint_count);
896 spin_unlock_irqrestore(&qp->lock, lock_flags);
893 897
894 ib_wr = ib_wr->next; 898 ib_wr = ib_wr->next;
895 } 899 }
@@ -905,6 +909,7 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr,
905 struct c2_dev *c2dev = to_c2dev(ibqp->device); 909 struct c2_dev *c2dev = to_c2dev(ibqp->device);
906 struct c2_qp *qp = to_c2qp(ibqp); 910 struct c2_qp *qp = to_c2qp(ibqp);
907 union c2wr wr; 911 union c2wr wr;
912 unsigned long lock_flags;
908 int err = 0; 913 int err = 0;
909 914
910 if (qp->state > IB_QPS_RTS) 915 if (qp->state > IB_QPS_RTS)
@@ -945,8 +950,10 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr,
945 break; 950 break;
946 } 951 }
947 952
953 spin_lock_irqsave(&qp->lock, lock_flags);
948 err = qp_wr_post(&qp->rq_mq, &wr, qp, qp->rq_mq.msg_size); 954 err = qp_wr_post(&qp->rq_mq, &wr, qp, qp->rq_mq.msg_size);
949 if (err) { 955 if (err) {
956 spin_unlock_irqrestore(&qp->lock, lock_flags);
950 break; 957 break;
951 } 958 }
952 959
@@ -954,6 +961,7 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr,
954 * Enqueue mq index to activity FIFO 961 * Enqueue mq index to activity FIFO
955 */ 962 */
956 c2_activity(c2dev, qp->rq_mq.index, qp->rq_mq.hint_count); 963 c2_activity(c2dev, qp->rq_mq.index, qp->rq_mq.hint_count);
964 spin_unlock_irqrestore(&qp->lock, lock_flags);
957 965
958 ib_wr = ib_wr->next; 966 ib_wr = ib_wr->next;
959 } 967 }
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c
index 981fe2eebdfa..fc67f780581b 100644
--- a/drivers/infiniband/hw/mthca/mthca_provider.c
+++ b/drivers/infiniband/hw/mthca/mthca_provider.c
@@ -179,6 +179,8 @@ static int mthca_query_port(struct ib_device *ibdev,
179 props->max_mtu = out_mad->data[41] & 0xf; 179 props->max_mtu = out_mad->data[41] & 0xf;
180 props->active_mtu = out_mad->data[36] >> 4; 180 props->active_mtu = out_mad->data[36] >> 4;
181 props->subnet_timeout = out_mad->data[51] & 0x1f; 181 props->subnet_timeout = out_mad->data[51] & 0x1f;
182 props->max_vl_num = out_mad->data[37] >> 4;
183 props->init_type_reply = out_mad->data[41] >> 4;
182 184
183 out: 185 out:
184 kfree(in_mad); 186 kfree(in_mad);
diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c
index 0f316c87bf64..92a72f521528 100644
--- a/drivers/infiniband/hw/mthca/mthca_srq.c
+++ b/drivers/infiniband/hw/mthca/mthca_srq.c
@@ -201,6 +201,8 @@ int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd,
201 201
202 if (mthca_is_memfree(dev)) 202 if (mthca_is_memfree(dev))
203 srq->max = roundup_pow_of_two(srq->max + 1); 203 srq->max = roundup_pow_of_two(srq->max + 1);
204 else
205 srq->max = srq->max + 1;
204 206
205 ds = max(64UL, 207 ds = max(64UL,
206 roundup_pow_of_two(sizeof (struct mthca_next_seg) + 208 roundup_pow_of_two(sizeof (struct mthca_next_seg) +
@@ -277,7 +279,7 @@ int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd,
277 srq->first_free = 0; 279 srq->first_free = 0;
278 srq->last_free = srq->max - 1; 280 srq->last_free = srq->max - 1;
279 281
280 attr->max_wr = (mthca_is_memfree(dev)) ? srq->max - 1 : srq->max; 282 attr->max_wr = srq->max - 1;
281 attr->max_sge = srq->max_gs; 283 attr->max_sge = srq->max_gs;
282 284
283 return 0; 285 return 0;
@@ -413,7 +415,7 @@ int mthca_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr)
413 srq_attr->srq_limit = be16_to_cpu(tavor_ctx->limit_watermark); 415 srq_attr->srq_limit = be16_to_cpu(tavor_ctx->limit_watermark);
414 } 416 }
415 417
416 srq_attr->max_wr = (mthca_is_memfree(dev)) ? srq->max - 1 : srq->max; 418 srq_attr->max_wr = srq->max - 1;
417 srq_attr->max_sge = srq->max_gs; 419 srq_attr->max_sge = srq->max_gs;
418 420
419out: 421out:
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index f426a69d9a43..8bf5e9ec7c95 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -355,6 +355,11 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb,
355 tx_req->skb = skb; 355 tx_req->skb = skb;
356 addr = dma_map_single(priv->ca->dma_device, skb->data, skb->len, 356 addr = dma_map_single(priv->ca->dma_device, skb->data, skb->len,
357 DMA_TO_DEVICE); 357 DMA_TO_DEVICE);
358 if (unlikely(dma_mapping_error(addr))) {
359 ++priv->stats.tx_errors;
360 dev_kfree_skb_any(skb);
361 return;
362 }
358 pci_unmap_addr_set(tx_req, mapping, addr); 363 pci_unmap_addr_set(tx_req, mapping, addr);
359 364
360 if (unlikely(post_send(priv, priv->tx_head & (ipoib_sendq_size - 1), 365 if (unlikely(post_send(priv, priv->tx_head & (ipoib_sendq_size - 1),
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 44b9e5be6687..4b09147f438f 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -343,29 +343,32 @@ static int srp_send_req(struct srp_target_port *target)
343 */ 343 */
344 if (target->io_class == SRP_REV10_IB_IO_CLASS) { 344 if (target->io_class == SRP_REV10_IB_IO_CLASS) {
345 memcpy(req->priv.initiator_port_id, 345 memcpy(req->priv.initiator_port_id,
346 target->srp_host->initiator_port_id + 8, 8); 346 &target->path.sgid.global.interface_id, 8);
347 memcpy(req->priv.initiator_port_id + 8, 347 memcpy(req->priv.initiator_port_id + 8,
348 target->srp_host->initiator_port_id, 8); 348 &target->initiator_ext, 8);
349 memcpy(req->priv.target_port_id, &target->ioc_guid, 8); 349 memcpy(req->priv.target_port_id, &target->ioc_guid, 8);
350 memcpy(req->priv.target_port_id + 8, &target->id_ext, 8); 350 memcpy(req->priv.target_port_id + 8, &target->id_ext, 8);
351 } else { 351 } else {
352 memcpy(req->priv.initiator_port_id, 352 memcpy(req->priv.initiator_port_id,
353 target->srp_host->initiator_port_id, 16); 353 &target->initiator_ext, 8);
354 memcpy(req->priv.initiator_port_id + 8,
355 &target->path.sgid.global.interface_id, 8);
354 memcpy(req->priv.target_port_id, &target->id_ext, 8); 356 memcpy(req->priv.target_port_id, &target->id_ext, 8);
355 memcpy(req->priv.target_port_id + 8, &target->ioc_guid, 8); 357 memcpy(req->priv.target_port_id + 8, &target->ioc_guid, 8);
356 } 358 }
357 359
358 /* 360 /*
359 * Topspin/Cisco SRP targets will reject our login unless we 361 * Topspin/Cisco SRP targets will reject our login unless we
360 * zero out the first 8 bytes of our initiator port ID. The 362 * zero out the first 8 bytes of our initiator port ID and set
361 * second 8 bytes must be our local node GUID, but we always 363 * the second 8 bytes to the local node GUID.
362 * use that anyway.
363 */ 364 */
364 if (topspin_workarounds && !memcmp(&target->ioc_guid, topspin_oui, 3)) { 365 if (topspin_workarounds && !memcmp(&target->ioc_guid, topspin_oui, 3)) {
365 printk(KERN_DEBUG PFX "Topspin/Cisco initiator port ID workaround " 366 printk(KERN_DEBUG PFX "Topspin/Cisco initiator port ID workaround "
366 "activated for target GUID %016llx\n", 367 "activated for target GUID %016llx\n",
367 (unsigned long long) be64_to_cpu(target->ioc_guid)); 368 (unsigned long long) be64_to_cpu(target->ioc_guid));
368 memset(req->priv.initiator_port_id, 0, 8); 369 memset(req->priv.initiator_port_id, 0, 8);
370 memcpy(req->priv.initiator_port_id + 8,
371 &target->srp_host->dev->dev->node_guid, 8);
369 } 372 }
370 373
371 status = ib_send_cm_req(target->cm_id, &req->param); 374 status = ib_send_cm_req(target->cm_id, &req->param);
@@ -1553,6 +1556,7 @@ enum {
1553 SRP_OPT_MAX_SECT = 1 << 5, 1556 SRP_OPT_MAX_SECT = 1 << 5,
1554 SRP_OPT_MAX_CMD_PER_LUN = 1 << 6, 1557 SRP_OPT_MAX_CMD_PER_LUN = 1 << 6,
1555 SRP_OPT_IO_CLASS = 1 << 7, 1558 SRP_OPT_IO_CLASS = 1 << 7,
1559 SRP_OPT_INITIATOR_EXT = 1 << 8,
1556 SRP_OPT_ALL = (SRP_OPT_ID_EXT | 1560 SRP_OPT_ALL = (SRP_OPT_ID_EXT |
1557 SRP_OPT_IOC_GUID | 1561 SRP_OPT_IOC_GUID |
1558 SRP_OPT_DGID | 1562 SRP_OPT_DGID |
@@ -1569,6 +1573,7 @@ static match_table_t srp_opt_tokens = {
1569 { SRP_OPT_MAX_SECT, "max_sect=%d" }, 1573 { SRP_OPT_MAX_SECT, "max_sect=%d" },
1570 { SRP_OPT_MAX_CMD_PER_LUN, "max_cmd_per_lun=%d" }, 1574 { SRP_OPT_MAX_CMD_PER_LUN, "max_cmd_per_lun=%d" },
1571 { SRP_OPT_IO_CLASS, "io_class=%x" }, 1575 { SRP_OPT_IO_CLASS, "io_class=%x" },
1576 { SRP_OPT_INITIATOR_EXT, "initiator_ext=%s" },
1572 { SRP_OPT_ERR, NULL } 1577 { SRP_OPT_ERR, NULL }
1573}; 1578};
1574 1579
@@ -1668,6 +1673,12 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target)
1668 target->io_class = token; 1673 target->io_class = token;
1669 break; 1674 break;
1670 1675
1676 case SRP_OPT_INITIATOR_EXT:
1677 p = match_strdup(args);
1678 target->initiator_ext = cpu_to_be64(simple_strtoull(p, NULL, 16));
1679 kfree(p);
1680 break;
1681
1671 default: 1682 default:
1672 printk(KERN_WARNING PFX "unknown parameter or missing value " 1683 printk(KERN_WARNING PFX "unknown parameter or missing value "
1673 "'%s' in target creation request\n", p); 1684 "'%s' in target creation request\n", p);
@@ -1708,7 +1719,6 @@ static ssize_t srp_create_target(struct class_device *class_dev,
1708 target_host->max_lun = SRP_MAX_LUN; 1719 target_host->max_lun = SRP_MAX_LUN;
1709 1720
1710 target = host_to_target(target_host); 1721 target = host_to_target(target_host);
1711 memset(target, 0, sizeof *target);
1712 1722
1713 target->io_class = SRP_REV16A_IB_IO_CLASS; 1723 target->io_class = SRP_REV16A_IB_IO_CLASS;
1714 target->scsi_host = target_host; 1724 target->scsi_host = target_host;
@@ -1815,9 +1825,6 @@ static struct srp_host *srp_add_port(struct srp_device *device, u8 port)
1815 host->dev = device; 1825 host->dev = device;
1816 host->port = port; 1826 host->port = port;
1817 1827
1818 host->initiator_port_id[7] = port;
1819 memcpy(host->initiator_port_id + 8, &device->dev->node_guid, 8);
1820
1821 host->class_dev.class = &srp_class; 1828 host->class_dev.class = &srp_class;
1822 host->class_dev.dev = device->dev->dma_device; 1829 host->class_dev.dev = device->dev->dma_device;
1823 snprintf(host->class_dev.class_id, BUS_ID_SIZE, "srp-%s-%d", 1830 snprintf(host->class_dev.class_id, BUS_ID_SIZE, "srp-%s-%d",
diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h
index 5b581fb8eb0d..d4e35ef51374 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.h
+++ b/drivers/infiniband/ulp/srp/ib_srp.h
@@ -91,7 +91,6 @@ struct srp_device {
91}; 91};
92 92
93struct srp_host { 93struct srp_host {
94 u8 initiator_port_id[16];
95 struct srp_device *dev; 94 struct srp_device *dev;
96 u8 port; 95 u8 port;
97 struct class_device class_dev; 96 struct class_device class_dev;
@@ -122,6 +121,7 @@ struct srp_target_port {
122 __be64 id_ext; 121 __be64 id_ext;
123 __be64 ioc_guid; 122 __be64 ioc_guid;
124 __be64 service_id; 123 __be64 service_id;
124 __be64 initiator_ext;
125 u16 io_class; 125 u16 io_class;
126 struct srp_host *srp_host; 126 struct srp_host *srp_host;
127 struct Scsi_Host *scsi_host; 127 struct Scsi_Host *scsi_host;
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 20df657b70c8..2a461dde480c 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -174,7 +174,7 @@ static void em28xx_config_i2c(struct em28xx *dev)
174 174
175 route.input = INPUT(dev->ctl_input)->vmux; 175 route.input = INPUT(dev->ctl_input)->vmux;
176 route.output = 0; 176 route.output = 0;
177 em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, 0); 177 em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, NULL);
178 em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route); 178 em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route);
179 em28xx_i2c_call_clients(dev, VIDIOC_STREAMON, NULL); 179 em28xx_i2c_call_clients(dev, VIDIOC_STREAMON, NULL);
180 180
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 6d024342b2fd..9a7d39b7cdbf 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -1329,7 +1329,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
1329 tasklet_init(&host->finish_tasklet, 1329 tasklet_init(&host->finish_tasklet,
1330 sdhci_tasklet_finish, (unsigned long)host); 1330 sdhci_tasklet_finish, (unsigned long)host);
1331 1331
1332 setup_timer(&host->timer, sdhci_timeout_timer, (long)host); 1332 setup_timer(&host->timer, sdhci_timeout_timer, (unsigned long)host);
1333 1333
1334 ret = request_irq(host->irq, sdhci_irq, IRQF_SHARED, 1334 ret = request_irq(host->irq, sdhci_irq, IRQF_SHARED,
1335 host->slot_descr, host); 1335 host->slot_descr, host);
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index bc7cc71788bc..d1717763f719 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -62,7 +62,7 @@ static int physmap_flash_remove(struct platform_device *dev)
62 } 62 }
63 63
64 if (info->map.virt != NULL) 64 if (info->map.virt != NULL)
65 iounmap((void *)info->map.virt); 65 iounmap(info->map.virt);
66 66
67 if (info->res != NULL) { 67 if (info->res != NULL) {
68 release_resource(info->res); 68 release_resource(info->res);
diff --git a/drivers/mtd/nand/cs553x_nand.c b/drivers/mtd/nand/cs553x_nand.c
index e0a1d386e581..94924d52a9b9 100644
--- a/drivers/mtd/nand/cs553x_nand.c
+++ b/drivers/mtd/nand/cs553x_nand.c
@@ -249,7 +249,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr)
249 goto out; 249 goto out;
250 250
251out_ior: 251out_ior:
252 iounmap((void *)this->IO_ADDR_R); 252 iounmap(this->IO_ADDR_R);
253out_mtd: 253out_mtd:
254 kfree(new_mtd); 254 kfree(new_mtd);
255out: 255out:
diff --git a/drivers/net/chelsio/cpl5_cmd.h b/drivers/net/chelsio/cpl5_cmd.h
index 27925e487bcf..5b357d9e88d6 100644
--- a/drivers/net/chelsio/cpl5_cmd.h
+++ b/drivers/net/chelsio/cpl5_cmd.h
@@ -108,7 +108,7 @@ struct cpl_tx_pkt_lso {
108 u8 iff:4; 108 u8 iff:4;
109#endif 109#endif
110 u16 vlan; 110 u16 vlan;
111 u32 len; 111 __be32 len;
112 112
113 u32 rsvd2; 113 u32 rsvd2;
114 u8 rsvd3; 114 u8 rsvd3;
@@ -119,7 +119,7 @@ struct cpl_tx_pkt_lso {
119 u8 ip_hdr_words:4; 119 u8 ip_hdr_words:4;
120 u8 tcp_hdr_words:4; 120 u8 tcp_hdr_words:4;
121#endif 121#endif
122 u16 eth_type_mss; 122 __be16 eth_type_mss;
123}; 123};
124 124
125struct cpl_rx_pkt { 125struct cpl_rx_pkt {
@@ -138,7 +138,7 @@ struct cpl_rx_pkt {
138 u8 iff:4; 138 u8 iff:4;
139#endif 139#endif
140 u16 csum; 140 u16 csum;
141 u16 vlan; 141 __be16 vlan;
142 u16 len; 142 u16 len;
143}; 143};
144 144
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h
index 72f52dc98f53..12b719f4d00f 100644
--- a/drivers/net/s2io.h
+++ b/drivers/net/s2io.h
@@ -116,179 +116,179 @@ typedef struct {
116/* The statistics block of Xena */ 116/* The statistics block of Xena */
117typedef struct stat_block { 117typedef struct stat_block {
118/* Tx MAC statistics counters. */ 118/* Tx MAC statistics counters. */
119 u32 tmac_data_octets; 119 __le32 tmac_data_octets;
120 u32 tmac_frms; 120 __le32 tmac_frms;
121 u64 tmac_drop_frms; 121 __le64 tmac_drop_frms;
122 u32 tmac_bcst_frms; 122 __le32 tmac_bcst_frms;
123 u32 tmac_mcst_frms; 123 __le32 tmac_mcst_frms;
124 u64 tmac_pause_ctrl_frms; 124 __le64 tmac_pause_ctrl_frms;
125 u32 tmac_ucst_frms; 125 __le32 tmac_ucst_frms;
126 u32 tmac_ttl_octets; 126 __le32 tmac_ttl_octets;
127 u32 tmac_any_err_frms; 127 __le32 tmac_any_err_frms;
128 u32 tmac_nucst_frms; 128 __le32 tmac_nucst_frms;
129 u64 tmac_ttl_less_fb_octets; 129 __le64 tmac_ttl_less_fb_octets;
130 u64 tmac_vld_ip_octets; 130 __le64 tmac_vld_ip_octets;
131 u32 tmac_drop_ip; 131 __le32 tmac_drop_ip;
132 u32 tmac_vld_ip; 132 __le32 tmac_vld_ip;
133 u32 tmac_rst_tcp; 133 __le32 tmac_rst_tcp;
134 u32 tmac_icmp; 134 __le32 tmac_icmp;
135 u64 tmac_tcp; 135 __le64 tmac_tcp;
136 u32 reserved_0; 136 __le32 reserved_0;
137 u32 tmac_udp; 137 __le32 tmac_udp;
138 138
139/* Rx MAC Statistics counters. */ 139/* Rx MAC Statistics counters. */
140 u32 rmac_data_octets; 140 __le32 rmac_data_octets;
141 u32 rmac_vld_frms; 141 __le32 rmac_vld_frms;
142 u64 rmac_fcs_err_frms; 142 __le64 rmac_fcs_err_frms;
143 u64 rmac_drop_frms; 143 __le64 rmac_drop_frms;
144 u32 rmac_vld_bcst_frms; 144 __le32 rmac_vld_bcst_frms;
145 u32 rmac_vld_mcst_frms; 145 __le32 rmac_vld_mcst_frms;
146 u32 rmac_out_rng_len_err_frms; 146 __le32 rmac_out_rng_len_err_frms;
147 u32 rmac_in_rng_len_err_frms; 147 __le32 rmac_in_rng_len_err_frms;
148 u64 rmac_long_frms; 148 __le64 rmac_long_frms;
149 u64 rmac_pause_ctrl_frms; 149 __le64 rmac_pause_ctrl_frms;
150 u64 rmac_unsup_ctrl_frms; 150 __le64 rmac_unsup_ctrl_frms;
151 u32 rmac_accepted_ucst_frms; 151 __le32 rmac_accepted_ucst_frms;
152 u32 rmac_ttl_octets; 152 __le32 rmac_ttl_octets;
153 u32 rmac_discarded_frms; 153 __le32 rmac_discarded_frms;
154 u32 rmac_accepted_nucst_frms; 154 __le32 rmac_accepted_nucst_frms;
155 u32 reserved_1; 155 __le32 reserved_1;
156 u32 rmac_drop_events; 156 __le32 rmac_drop_events;
157 u64 rmac_ttl_less_fb_octets; 157 __le64 rmac_ttl_less_fb_octets;
158 u64 rmac_ttl_frms; 158 __le64 rmac_ttl_frms;
159 u64 reserved_2; 159 __le64 reserved_2;
160 u32 rmac_usized_frms; 160 __le32 rmac_usized_frms;
161 u32 reserved_3; 161 __le32 reserved_3;
162 u32 rmac_frag_frms; 162 __le32 rmac_frag_frms;
163 u32 rmac_osized_frms; 163 __le32 rmac_osized_frms;
164 u32 reserved_4; 164 __le32 reserved_4;
165 u32 rmac_jabber_frms; 165 __le32 rmac_jabber_frms;
166 u64 rmac_ttl_64_frms; 166 __le64 rmac_ttl_64_frms;
167 u64 rmac_ttl_65_127_frms; 167 __le64 rmac_ttl_65_127_frms;
168 u64 reserved_5; 168 __le64 reserved_5;
169 u64 rmac_ttl_128_255_frms; 169 __le64 rmac_ttl_128_255_frms;
170 u64 rmac_ttl_256_511_frms; 170 __le64 rmac_ttl_256_511_frms;
171 u64 reserved_6; 171 __le64 reserved_6;
172 u64 rmac_ttl_512_1023_frms; 172 __le64 rmac_ttl_512_1023_frms;
173 u64 rmac_ttl_1024_1518_frms; 173 __le64 rmac_ttl_1024_1518_frms;
174 u32 rmac_ip; 174 __le32 rmac_ip;
175 u32 reserved_7; 175 __le32 reserved_7;
176 u64 rmac_ip_octets; 176 __le64 rmac_ip_octets;
177 u32 rmac_drop_ip; 177 __le32 rmac_drop_ip;
178 u32 rmac_hdr_err_ip; 178 __le32 rmac_hdr_err_ip;
179 u32 reserved_8; 179 __le32 reserved_8;
180 u32 rmac_icmp; 180 __le32 rmac_icmp;
181 u64 rmac_tcp; 181 __le64 rmac_tcp;
182 u32 rmac_err_drp_udp; 182 __le32 rmac_err_drp_udp;
183 u32 rmac_udp; 183 __le32 rmac_udp;
184 u64 rmac_xgmii_err_sym; 184 __le64 rmac_xgmii_err_sym;
185 u64 rmac_frms_q0; 185 __le64 rmac_frms_q0;
186 u64 rmac_frms_q1; 186 __le64 rmac_frms_q1;
187 u64 rmac_frms_q2; 187 __le64 rmac_frms_q2;
188 u64 rmac_frms_q3; 188 __le64 rmac_frms_q3;
189 u64 rmac_frms_q4; 189 __le64 rmac_frms_q4;
190 u64 rmac_frms_q5; 190 __le64 rmac_frms_q5;
191 u64 rmac_frms_q6; 191 __le64 rmac_frms_q6;
192 u64 rmac_frms_q7; 192 __le64 rmac_frms_q7;
193 u16 rmac_full_q3; 193 __le16 rmac_full_q3;
194 u16 rmac_full_q2; 194 __le16 rmac_full_q2;
195 u16 rmac_full_q1; 195 __le16 rmac_full_q1;
196 u16 rmac_full_q0; 196 __le16 rmac_full_q0;
197 u16 rmac_full_q7; 197 __le16 rmac_full_q7;
198 u16 rmac_full_q6; 198 __le16 rmac_full_q6;
199 u16 rmac_full_q5; 199 __le16 rmac_full_q5;
200 u16 rmac_full_q4; 200 __le16 rmac_full_q4;
201 u32 reserved_9; 201 __le32 reserved_9;
202 u32 rmac_pause_cnt; 202 __le32 rmac_pause_cnt;
203 u64 rmac_xgmii_data_err_cnt; 203 __le64 rmac_xgmii_data_err_cnt;
204 u64 rmac_xgmii_ctrl_err_cnt; 204 __le64 rmac_xgmii_ctrl_err_cnt;
205 u32 rmac_err_tcp; 205 __le32 rmac_err_tcp;
206 u32 rmac_accepted_ip; 206 __le32 rmac_accepted_ip;
207 207
208/* PCI/PCI-X Read transaction statistics. */ 208/* PCI/PCI-X Read transaction statistics. */
209 u32 new_rd_req_cnt; 209 __le32 new_rd_req_cnt;
210 u32 rd_req_cnt; 210 __le32 rd_req_cnt;
211 u32 rd_rtry_cnt; 211 __le32 rd_rtry_cnt;
212 u32 new_rd_req_rtry_cnt; 212 __le32 new_rd_req_rtry_cnt;
213 213
214/* PCI/PCI-X Write/Read transaction statistics. */ 214/* PCI/PCI-X Write/Read transaction statistics. */
215 u32 wr_req_cnt; 215 __le32 wr_req_cnt;
216 u32 wr_rtry_rd_ack_cnt; 216 __le32 wr_rtry_rd_ack_cnt;
217 u32 new_wr_req_rtry_cnt; 217 __le32 new_wr_req_rtry_cnt;
218 u32 new_wr_req_cnt; 218 __le32 new_wr_req_cnt;
219 u32 wr_disc_cnt; 219 __le32 wr_disc_cnt;
220 u32 wr_rtry_cnt; 220 __le32 wr_rtry_cnt;
221 221
222/* PCI/PCI-X Write / DMA Transaction statistics. */ 222/* PCI/PCI-X Write / DMA Transaction statistics. */
223 u32 txp_wr_cnt; 223 __le32 txp_wr_cnt;
224 u32 rd_rtry_wr_ack_cnt; 224 __le32 rd_rtry_wr_ack_cnt;
225 u32 txd_wr_cnt; 225 __le32 txd_wr_cnt;
226 u32 txd_rd_cnt; 226 __le32 txd_rd_cnt;
227 u32 rxd_wr_cnt; 227 __le32 rxd_wr_cnt;
228 u32 rxd_rd_cnt; 228 __le32 rxd_rd_cnt;
229 u32 rxf_wr_cnt; 229 __le32 rxf_wr_cnt;
230 u32 txf_rd_cnt; 230 __le32 txf_rd_cnt;
231 231
232/* Tx MAC statistics overflow counters. */ 232/* Tx MAC statistics overflow counters. */
233 u32 tmac_data_octets_oflow; 233 __le32 tmac_data_octets_oflow;
234 u32 tmac_frms_oflow; 234 __le32 tmac_frms_oflow;
235 u32 tmac_bcst_frms_oflow; 235 __le32 tmac_bcst_frms_oflow;
236 u32 tmac_mcst_frms_oflow; 236 __le32 tmac_mcst_frms_oflow;
237 u32 tmac_ucst_frms_oflow; 237 __le32 tmac_ucst_frms_oflow;
238 u32 tmac_ttl_octets_oflow; 238 __le32 tmac_ttl_octets_oflow;
239 u32 tmac_any_err_frms_oflow; 239 __le32 tmac_any_err_frms_oflow;
240 u32 tmac_nucst_frms_oflow; 240 __le32 tmac_nucst_frms_oflow;
241 u64 tmac_vlan_frms; 241 __le64 tmac_vlan_frms;
242 u32 tmac_drop_ip_oflow; 242 __le32 tmac_drop_ip_oflow;
243 u32 tmac_vld_ip_oflow; 243 __le32 tmac_vld_ip_oflow;
244 u32 tmac_rst_tcp_oflow; 244 __le32 tmac_rst_tcp_oflow;
245 u32 tmac_icmp_oflow; 245 __le32 tmac_icmp_oflow;
246 u32 tpa_unknown_protocol; 246 __le32 tpa_unknown_protocol;
247 u32 tmac_udp_oflow; 247 __le32 tmac_udp_oflow;
248 u32 reserved_10; 248 __le32 reserved_10;
249 u32 tpa_parse_failure; 249 __le32 tpa_parse_failure;
250 250
251/* Rx MAC Statistics overflow counters. */ 251/* Rx MAC Statistics overflow counters. */
252 u32 rmac_data_octets_oflow; 252 __le32 rmac_data_octets_oflow;
253 u32 rmac_vld_frms_oflow; 253 __le32 rmac_vld_frms_oflow;
254 u32 rmac_vld_bcst_frms_oflow; 254 __le32 rmac_vld_bcst_frms_oflow;
255 u32 rmac_vld_mcst_frms_oflow; 255 __le32 rmac_vld_mcst_frms_oflow;
256 u32 rmac_accepted_ucst_frms_oflow; 256 __le32 rmac_accepted_ucst_frms_oflow;
257 u32 rmac_ttl_octets_oflow; 257 __le32 rmac_ttl_octets_oflow;
258 u32 rmac_discarded_frms_oflow; 258 __le32 rmac_discarded_frms_oflow;
259 u32 rmac_accepted_nucst_frms_oflow; 259 __le32 rmac_accepted_nucst_frms_oflow;
260 u32 rmac_usized_frms_oflow; 260 __le32 rmac_usized_frms_oflow;
261 u32 rmac_drop_events_oflow; 261 __le32 rmac_drop_events_oflow;
262 u32 rmac_frag_frms_oflow; 262 __le32 rmac_frag_frms_oflow;
263 u32 rmac_osized_frms_oflow; 263 __le32 rmac_osized_frms_oflow;
264 u32 rmac_ip_oflow; 264 __le32 rmac_ip_oflow;
265 u32 rmac_jabber_frms_oflow; 265 __le32 rmac_jabber_frms_oflow;
266 u32 rmac_icmp_oflow; 266 __le32 rmac_icmp_oflow;
267 u32 rmac_drop_ip_oflow; 267 __le32 rmac_drop_ip_oflow;
268 u32 rmac_err_drp_udp_oflow; 268 __le32 rmac_err_drp_udp_oflow;
269 u32 rmac_udp_oflow; 269 __le32 rmac_udp_oflow;
270 u32 reserved_11; 270 __le32 reserved_11;
271 u32 rmac_pause_cnt_oflow; 271 __le32 rmac_pause_cnt_oflow;
272 u64 rmac_ttl_1519_4095_frms; 272 __le64 rmac_ttl_1519_4095_frms;
273 u64 rmac_ttl_4096_8191_frms; 273 __le64 rmac_ttl_4096_8191_frms;
274 u64 rmac_ttl_8192_max_frms; 274 __le64 rmac_ttl_8192_max_frms;
275 u64 rmac_ttl_gt_max_frms; 275 __le64 rmac_ttl_gt_max_frms;
276 u64 rmac_osized_alt_frms; 276 __le64 rmac_osized_alt_frms;
277 u64 rmac_jabber_alt_frms; 277 __le64 rmac_jabber_alt_frms;
278 u64 rmac_gt_max_alt_frms; 278 __le64 rmac_gt_max_alt_frms;
279 u64 rmac_vlan_frms; 279 __le64 rmac_vlan_frms;
280 u32 rmac_len_discard; 280 __le32 rmac_len_discard;
281 u32 rmac_fcs_discard; 281 __le32 rmac_fcs_discard;
282 u32 rmac_pf_discard; 282 __le32 rmac_pf_discard;
283 u32 rmac_da_discard; 283 __le32 rmac_da_discard;
284 u32 rmac_red_discard; 284 __le32 rmac_red_discard;
285 u32 rmac_rts_discard; 285 __le32 rmac_rts_discard;
286 u32 reserved_12; 286 __le32 reserved_12;
287 u32 rmac_ingm_full_discard; 287 __le32 rmac_ingm_full_discard;
288 u32 reserved_13; 288 __le32 reserved_13;
289 u32 rmac_accepted_ip_oflow; 289 __le32 rmac_accepted_ip_oflow;
290 u32 reserved_14; 290 __le32 reserved_14;
291 u32 link_fault_cnt; 291 __le32 link_fault_cnt;
292 u8 buffer[20]; 292 u8 buffer[20];
293 swStat_t sw_stat; 293 swStat_t sw_stat;
294 xpakStat_t xpak_stat; 294 xpakStat_t xpak_stat;
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index 862a411a4aa0..c88babce9bca 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -1987,7 +1987,7 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action)
1987 sbale = &(adapter->response_queue.buffer[i]->element[0]); 1987 sbale = &(adapter->response_queue.buffer[i]->element[0]);
1988 sbale->length = 0; 1988 sbale->length = 0;
1989 sbale->flags = SBAL_FLAGS_LAST_ENTRY; 1989 sbale->flags = SBAL_FLAGS_LAST_ENTRY;
1990 sbale->addr = 0; 1990 sbale->addr = NULL;
1991 } 1991 }
1992 1992
1993 ZFCP_LOG_TRACE("calling do_QDIO on adapter %s (flags=0x%x, " 1993 ZFCP_LOG_TRACE("calling do_QDIO on adapter %s (flags=0x%x, "
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c
index 2f698763ba5d..81ba2d71cee2 100644
--- a/drivers/sbus/char/openprom.c
+++ b/drivers/sbus/char/openprom.c
@@ -630,7 +630,7 @@ static int openprom_ioctl(struct inode * inode, struct file * file,
630 case OPROMPATH2NODE: 630 case OPROMPATH2NODE:
631 if ((file->f_mode & FMODE_READ) == 0) 631 if ((file->f_mode & FMODE_READ) == 0)
632 return -EPERM; 632 return -EPERM;
633 return openprom_sunos_ioctl(inode, file, cmd, arg, 0); 633 return openprom_sunos_ioctl(inode, file, cmd, arg, NULL);
634 634
635 case OPIOCGET: 635 case OPIOCGET:
636 case OPIOCNEXTPROP: 636 case OPIOCNEXTPROP:
diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c
index ddc0681ac759..b30372f17f1c 100644
--- a/drivers/sbus/char/uctrl.c
+++ b/drivers/sbus/char/uctrl.c
@@ -400,7 +400,7 @@ static int __init ts102_uctrl_init(void)
400 } 400 }
401 401
402 driver->regs->uctrl_intr = UCTRL_INTR_RXNE_REQ|UCTRL_INTR_RXNE_MSK; 402 driver->regs->uctrl_intr = UCTRL_INTR_RXNE_REQ|UCTRL_INTR_RXNE_MSK;
403 printk("uctrl: 0x%x (irq %d)\n", driver->regs, driver->irq); 403 printk("uctrl: 0x%p (irq %d)\n", driver->regs, driver->irq);
404 uctrl_get_event_status(); 404 uctrl_get_event_status();
405 uctrl_get_external_status(); 405 uctrl_get_external_status();
406 return 0; 406 return 0;
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 83695416b2c9..2b344356a29e 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -3881,7 +3881,7 @@ typedef struct asc_board {
3881 /* 3881 /*
3882 * The following fields are used only for Wide Boards. 3882 * The following fields are used only for Wide Boards.
3883 */ 3883 */
3884 void *ioremap_addr; /* I/O Memory remap address. */ 3884 void __iomem *ioremap_addr; /* I/O Memory remap address. */
3885 ushort ioport; /* I/O Port address. */ 3885 ushort ioport; /* I/O Port address. */
3886 ADV_CARR_T *orig_carrp; /* ADV_CARR_T memory block. */ 3886 ADV_CARR_T *orig_carrp; /* ADV_CARR_T memory block. */
3887 adv_req_t *orig_reqp; /* adv_req_t memory block. */ 3887 adv_req_t *orig_reqp; /* adv_req_t memory block. */
@@ -3951,7 +3951,7 @@ typedef struct _PCI_CONFIG_SPACE_
3951 3951
3952/* Number of boards detected in system. */ 3952/* Number of boards detected in system. */
3953STATIC int asc_board_count = 0; 3953STATIC int asc_board_count = 0;
3954STATIC struct Scsi_Host *asc_host[ASC_NUM_BOARD_SUPPORTED] = { 0 }; 3954STATIC struct Scsi_Host *asc_host[ASC_NUM_BOARD_SUPPORTED] = { NULL };
3955 3955
3956/* Overrun buffer used by all narrow boards. */ 3956/* Overrun buffer used by all narrow boards. */
3957STATIC uchar overrun_buf[ASC_OVERRUN_BSIZE] = { 0 }; 3957STATIC uchar overrun_buf[ASC_OVERRUN_BSIZE] = { 0 };
@@ -6621,7 +6621,7 @@ adv_build_req(asc_board_t *boardp, struct scsi_cmnd *scp,
6621 dma_map_single(dev, scp->request_buffer, 6621 dma_map_single(dev, scp->request_buffer,
6622 scp->request_bufflen, scp->sc_data_direction); 6622 scp->request_bufflen, scp->sc_data_direction);
6623 } else { 6623 } else {
6624 scsiqp->vdata_addr = 0; 6624 scsiqp->vdata_addr = NULL;
6625 scp->SCp.dma_handle = 0; 6625 scp->SCp.dma_handle = 0;
6626 } 6626 }
6627 scsiqp->data_addr = cpu_to_le32(scp->SCp.dma_handle); 6627 scsiqp->data_addr = cpu_to_le32(scp->SCp.dma_handle);
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index 23f5e418ab55..e95b367d09ed 100644
--- a/drivers/scsi/dc395x.c
+++ b/drivers/scsi/dc395x.c
@@ -1219,7 +1219,7 @@ static void dump_register_info(struct AdapterCtlBlk *acb,
1219 srb, srb->cmd, srb->cmd->pid, 1219 srb, srb->cmd, srb->cmd->pid,
1220 srb->cmd->cmnd[0], srb->cmd->device->id, 1220 srb->cmd->cmnd[0], srb->cmd->device->id,
1221 srb->cmd->device->lun); 1221 srb->cmd->device->lun);
1222 printk(" sglist=%p cnt=%i idx=%i len=%Zd\n", 1222 printk(" sglist=%p cnt=%i idx=%i len=%zu\n",
1223 srb->segment_x, srb->sg_count, srb->sg_index, 1223 srb->segment_x, srb->sg_count, srb->sg_index,
1224 srb->total_xfer_length); 1224 srb->total_xfer_length);
1225 printk(" state=0x%04x status=0x%02x phase=0x%02x (%sconn.)\n", 1225 printk(" state=0x%04x status=0x%02x phase=0x%02x (%sconn.)\n",
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 3d355d054612..aff1b0cfd4b2 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -495,7 +495,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
495 memcpy(scmd->cmnd, cmnd, cmnd_size); 495 memcpy(scmd->cmnd, cmnd, cmnd_size);
496 496
497 if (copy_sense) { 497 if (copy_sense) {
498 int gfp_mask = GFP_ATOMIC; 498 gfp_t gfp_mask = GFP_ATOMIC;
499 499
500 if (shost->hostt->unchecked_isa_dma) 500 if (shost->hostt->unchecked_isa_dma)
501 gfp_mask |= __GFP_DMA; 501 gfp_mask |= __GFP_DMA;
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index b11f6dea2704..73dd2eedaaad 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -1057,7 +1057,7 @@ static void sunzilog_free_tables(void)
1057 1057
1058static void sunzilog_putchar(struct uart_port *port, int ch) 1058static void sunzilog_putchar(struct uart_port *port, int ch)
1059{ 1059{
1060 struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port); 1060 struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
1061 int loops = ZS_PUT_CHAR_MAX_DELAY; 1061 int loops = ZS_PUT_CHAR_MAX_DELAY;
1062 1062
1063 /* This is a timed polling loop so do not switch the explicit 1063 /* This is a timed polling loop so do not switch the explicit
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 2c9c9462d899..724822cac2b1 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -1216,7 +1216,7 @@ static int proc_submiturb_compat(struct dev_state *ps, void __user *arg)
1216{ 1216{
1217 struct usbdevfs_urb uurb; 1217 struct usbdevfs_urb uurb;
1218 1218
1219 if (get_urb32(&uurb,(struct usbdevfs_urb32 *)arg)) 1219 if (get_urb32(&uurb,(struct usbdevfs_urb32 __user *)arg))
1220 return -EFAULT; 1220 return -EFAULT;
1221 1221
1222 return proc_do_submiturb(ps, &uurb, ((struct usbdevfs_urb32 __user *)arg)->iso_frame_desc, arg); 1222 return proc_do_submiturb(ps, &uurb, ((struct usbdevfs_urb32 __user *)arg)->iso_frame_desc, arg);
@@ -1251,7 +1251,7 @@ static int processcompl_compat(struct async *as, void __user * __user *arg)
1251 } 1251 }
1252 1252
1253 free_async(as); 1253 free_async(as);
1254 if (put_user((u32)(u64)addr, (u32 __user *)arg)) 1254 if (put_user(ptr_to_compat(addr), (u32 __user *)arg))
1255 return -EFAULT; 1255 return -EFAULT;
1256 return 0; 1256 return 0;
1257} 1257}
@@ -1520,7 +1520,7 @@ static int usbdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
1520 1520
1521 case USBDEVFS_IOCTL32: 1521 case USBDEVFS_IOCTL32:
1522 snoop(&dev->dev, "%s: IOCTL\n", __FUNCTION__); 1522 snoop(&dev->dev, "%s: IOCTL\n", __FUNCTION__);
1523 ret = proc_ioctl_compat(ps, (compat_uptr_t)(long)p); 1523 ret = proc_ioctl_compat(ps, ptr_to_compat(p));
1524 break; 1524 break;
1525#endif 1525#endif
1526 1526