bk://linux-scsi.bkbits.net/scsi-misc-2.6 htejun@gmail.com[jejb]|ChangeSet|20050403135911|32582 htejun # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/04/04 01:13:36-07:00 akpm@bix.(none) # Merge bk://linux-scsi.bkbits.net/scsi-misc-2.6 # into bix.(none):/usr/src/bk-scsi # # drivers/scsi/sg.c # 2005/04/04 01:13:31-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/scsi_lib.c # 2005/04/04 01:13:31-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/Kconfig # 2005/04/04 01:13:31-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/53c700.c # 2005/04/04 01:13:31-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/04/04 01:12:09-07:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-scsi # # include/linux/pci_ids.h # 2005/04/04 01:12:04-07:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/pci/pci.ids # 2005/04/04 01:12:04-07:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/04/03 08:59:11-05:00 htejun@gmail.com # [PATCH] scsi: remove meaningless scsi_cmnd->serial_number_at_timeout field # # scsi_cmnd->serial_number_at_timeout doesn't serve any purpose # anymore. All serial_number == serial_number_at_timeout tests # are always true in abort callbacks. Kill the field. Also, as # ->pid always equals ->serial_number and ->serial_number # doesn't have any special meaning anymore, update comments # above ->serial_number accordingly. Once we remove all uses of # this field from all lldd's, this field should go. # # Signed-off-by: Tejun Heo # Signed-off-by: James Bottomley # # include/scsi/scsi_cmnd.h # 2005/03/31 03:06:21-06:00 htejun@gmail.com +9 -13 # scsi: remove meaningless scsi_cmnd->serial_number_at_timeout field # # drivers/scsi/sym53c8xx_2/sym_glue.c # 2005/03/31 03:06:21-06:00 htejun@gmail.com +0 -6 # scsi: remove meaningless scsi_cmnd->serial_number_at_timeout field # # drivers/scsi/scsi_lib.c # 2005/03/31 03:06:21-06:00 htejun@gmail.com +0 -1 # scsi: remove meaningless scsi_cmnd->serial_number_at_timeout field # # drivers/scsi/scsi_error.c # 2005/03/31 03:06:21-06:00 htejun@gmail.com +0 -7 # scsi: remove meaningless scsi_cmnd->serial_number_at_timeout field # # drivers/scsi/scsi.c # 2005/03/31 03:06:21-06:00 htejun@gmail.com +0 -2 # scsi: remove meaningless scsi_cmnd->serial_number_at_timeout field # # drivers/scsi/qla2xxx/qla_dbg.c # 2005/03/31 03:06:21-06:00 htejun@gmail.com +2 -4 # scsi: remove meaningless scsi_cmnd->serial_number_at_timeout field # # drivers/scsi/ncr53c8xx.c # 2005/03/31 03:06:21-06:00 htejun@gmail.com +2 -12 # scsi: remove meaningless scsi_cmnd->serial_number_at_timeout field # # drivers/scsi/ips.c # 2005/03/31 03:06:21-06:00 htejun@gmail.com +0 -7 # scsi: remove meaningless scsi_cmnd->serial_number_at_timeout field # # drivers/scsi/advansys.c # 2005/03/31 03:06:21-06:00 htejun@gmail.com +2 -3 # scsi: remove meaningless scsi_cmnd->serial_number_at_timeout field # # drivers/scsi/BusLogic.c # 2005/03/31 03:06:21-06:00 htejun@gmail.com +0 -7 # scsi: remove meaningless scsi_cmnd->serial_number_at_timeout field # # ChangeSet # 2005/04/03 08:55:06-05:00 htejun@gmail.com # [PATCH] scsi: remove unused scsi_cmnd->internal_timeout field # # scsi_cmnd->internal_timeout field doesn't have any meaning # anymore. Kill the field. # # Signed-off-by: Tejun Heo # Signed-off-by: James Bottomley # # include/scsi/scsi_cmnd.h # 2005/03/31 03:06:20-06:00 htejun@gmail.com +0 -6 # scsi: remove unused scsi_cmnd->internal_timeout field # # drivers/scsi/scsi_priv.h # 2005/03/31 03:06:20-06:00 htejun@gmail.com +0 -5 # scsi: remove unused scsi_cmnd->internal_timeout field # # drivers/scsi/scsi_lib.c # 2005/03/31 03:06:20-06:00 htejun@gmail.com +0 -1 # scsi: remove unused scsi_cmnd->internal_timeout field # # drivers/scsi/scsi_error.c # 2005/03/31 03:06:20-06:00 htejun@gmail.com +0 -1 # scsi: remove unused scsi_cmnd->internal_timeout field # # drivers/scsi/scsi.c # 2005/03/31 03:06:20-06:00 htejun@gmail.com +0 -1 # scsi: remove unused scsi_cmnd->internal_timeout field # # drivers/scsi/pci2000.c # 2005/03/31 03:06:20-06:00 htejun@gmail.com +2 -2 # scsi: remove unused scsi_cmnd->internal_timeout field # # drivers/scsi/advansys.c # 2005/03/31 03:06:20-06:00 htejun@gmail.com +0 -2 # scsi: remove unused scsi_cmnd->internal_timeout field # # ChangeSet # 2005/04/03 08:53:59-05:00 hch@lst.de # [PATCH] remove outdated print_* functions # # We have the scsi_print_* functions in the proper namespace for a long # time now and there weren't a lot users left. # # Signed-off-by: James Bottomley # # drivers/scsi/sun3_NCR5380.c # 2005/03/29 09:28:23-06:00 hch@lst.de +5 -4 # remove outdated print_* functions # # drivers/scsi/sg.c # 2005/03/29 09:34:48-06:00 hch@lst.de +2 -1 # remove outdated print_* functions # # drivers/scsi/seagate.c # 2005/03/29 09:34:50-06:00 hch@lst.de +3 -2 # remove outdated print_* functions # # drivers/scsi/scsi.h # 2005/03/29 11:28:04-06:00 hch@lst.de +0 -37 # remove outdated print_* functions # # drivers/scsi/scsi.c # 2005/03/29 09:26:17-06:00 hch@lst.de +1 -1 # remove outdated print_* functions # # drivers/scsi/constants.c # 2005/03/29 09:21:01-06:00 hch@lst.de +1 -1 # remove outdated print_* functions # # drivers/scsi/atari_NCR5380.c # 2005/03/29 09:28:13-06:00 hch@lst.de +5 -4 # remove outdated print_* functions # # drivers/scsi/arm/scsi.h # 2005/03/29 09:31:26-06:00 hch@lst.de +1 -1 # remove outdated print_* functions # # drivers/scsi/arm/fas216.c # 2005/03/29 09:34:11-06:00 hch@lst.de +5 -4 # remove outdated print_* functions # # drivers/scsi/arm/acornscsi.c # 2005/03/29 09:34:19-06:00 hch@lst.de +5 -4 # remove outdated print_* functions # # drivers/scsi/aha152x.c # 2005/03/29 09:31:57-06:00 hch@lst.de +9 -8 # remove outdated print_* functions # # drivers/scsi/NCR5380.c # 2005/03/29 09:28:01-06:00 hch@lst.de +5 -4 # remove outdated print_* functions # # drivers/scsi/53c7xx.c # 2005/03/29 09:32:18-06:00 hch@lst.de +12 -11 # remove outdated print_* functions # # ChangeSet # 2005/04/03 08:52:44-05:00 hch@lst.de # [PATCH] consolidate timeout defintions in scsi.h # # Adapted from a patch in SuSE's kernel SRPM. # # Signed-off-by: James Bottomley # # include/scsi/scsi.h # 2005/03/29 09:53:44-06:00 hch@lst.de +9 -0 # consolidate timeout defintions in scsi.h # # drivers/scsi/scsi_ioctl.c # 2005/03/29 09:54:02-06:00 hch@lst.de +0 -5 # consolidate timeout defintions in scsi.h # # drivers/block/scsi_ioctl.c # 2005/03/29 09:54:17-06:00 hch@lst.de +0 -5 # consolidate timeout defintions in scsi.h # # ChangeSet # 2005/04/02 21:57:48-06:00 jejb@mulgrave.(none) # [PATCH] finally fix 53c700 to use the generic iomem infrastructure # # This driver has had it's own different infrastructure for doing this for # ages, but it's time it used the common one. # # Signed-off-by: James Bottomley # # drivers/scsi/sim710.c # 2005/04/02 21:55:10-06:00 jejb@mulgrave.(none) +3 -2 # finally fix 53c700 to use the generic iomem infrastructure # # drivers/scsi/lasi700.c # 2005/04/02 21:55:10-06:00 jejb@mulgrave.(none) +1 -0 # finally fix 53c700 to use the generic iomem infrastructure # # drivers/scsi/NCR_D700.c # 2005/04/02 21:55:10-06:00 jejb@mulgrave.(none) +2 -3 # finally fix 53c700 to use the generic iomem infrastructure # # drivers/scsi/Kconfig # 2005/04/02 21:55:10-06:00 jejb@mulgrave.(none) +0 -10 # finally fix 53c700 to use the generic iomem infrastructure # # drivers/scsi/53c700.h # 2005/04/02 21:55:10-06:00 jejb@mulgrave.(none) +20 -172 # finally fix 53c700 to use the generic iomem infrastructure # # drivers/scsi/53c700.c # 2005/04/02 21:55:09-06:00 jejb@mulgrave.(none) +1 -2 # finally fix 53c700 to use the generic iomem infrastructure # # ChangeSet # 2005/04/02 07:57:17-06:00 aherrman@de.ibm.com # [PATCH] zfcp: convert to compat_ioctl # # Signed-off-by: Andreas Herrmann # Signed-off-by: James Bottomley # # drivers/s390/scsi/zfcp_aux.c # 2005/04/02 05:37:55-06:00 aherrman@de.ibm.com +12 -22 # zfcp: convert to compat_ioctl # # ChangeSet # 2005/04/02 07:51:23-06:00 dougg@torque.net # [PATCH] sg.c: update # # The attachment combines the most recent patch from # Yum Rayan (to reduce sg stack # usage), Adrian Bunk (to fix check # after use) and me (fix elapsed time calculation # (duration) on ia64 machines). # # I have modified the patch from Yum Rayan so kmalloc() # in sg_read() is only called for the (rare) code paths # that need them. # # Changelog: # - reduce stack usage in sg_ioctl() and sg_read() # - fix check after use in sg_mmap() # - hold duration internally in milliseconds and # check current time later than held time # # Signed-off-by: Douglas Gilbert # Signed-off-by: James Bottomley # # drivers/scsi/sg.c # 2005/03/27 20:16:58-06:00 dougg@torque.net +132 -71 # sg.c: update # # ChangeSet # 2005/03/31 13:03:45-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-scsi # # include/linux/pci_ids.h # 2005/03/31 13:03:41-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/30 17:33:10-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-scsi # # include/scsi/scsi_host.h # 2005/03/30 17:33:05-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/scsi_transport_spi.c # 2005/03/30 17:33:05-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/scsi_transport_fc.c # 2005/03/30 17:33:05-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/scsi_lib.c # 2005/03/30 17:33:05-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/osst.c # 2005/03/30 17:33:05-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/hosts.c # 2005/03/30 17:33:05-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/53c700.c # 2005/03/30 17:33:05-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/29 12:24:12-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-scsi # # include/linux/pci_ids.h # 2005/03/29 12:24:07-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/pci/pci.ids # 2005/03/29 12:24:07-08:00 akpm@bix.(none) +0 -0 # Auto merged # # Documentation/kernel-parameters.txt # 2005/03/29 12:24:06-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/27 16:45:03-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-scsi # # include/linux/pci_ids.h # 2005/03/27 16:44:56-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/pci/pci.ids # 2005/03/27 16:44:56-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/18 15:39:49-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-scsi # # include/linux/pci_ids.h # 2005/03/18 15:39:41-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/18 12:00:23-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-scsi # # include/linux/pci_ids.h # 2005/03/18 12:00:18-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/15 23:54:35-08:00 akpm@bix.(none) # Merge bix.(none):/usr/src/bk25 into bix.(none):/usr/src/bk-scsi # # include/scsi/scsi_host.h # 2005/03/15 23:54:27-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/st.c # 2005/03/15 23:54:27-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/scsi_transport_fc.c # 2005/03/15 23:54:26-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/scsi_lib.c # 2005/03/15 23:54:26-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/hosts.c # 2005/03/15 23:54:26-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/15 13:21:11-08:00 akpm@bix.(none) # Merge bk://linux-scsi.bkbits.net/scsi-misc-2.6 # into bix.(none):/usr/src/bk-scsi # # include/scsi/scsi_host.h # 2005/03/15 13:21:06-08:00 akpm@bix.(none) +0 -0 # Auto merged # # include/linux/pci_ids.h # 2005/03/15 13:21:06-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/st.c # 2005/03/15 13:21:06-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/sr.c # 2005/03/15 13:21:06-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/sg.c # 2005/03/15 13:21:06-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/sd.c # 2005/03/15 13:21:06-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/scsi_transport_spi.c # 2005/03/15 13:21:06-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/scsi_transport_fc.c # 2005/03/15 13:21:06-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/scsi_lib.c # 2005/03/15 13:21:06-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/scsi_devinfo.c # 2005/03/15 13:21:06-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/osst.c # 2005/03/15 13:21:06-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/megaraid/megaraid_mm.c # 2005/03/15 13:21:06-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/hosts.c # 2005/03/15 13:21:06-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/dc395x.c # 2005/03/15 13:21:06-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/Kconfig # 2005/03/15 13:21:05-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/53c700.c # 2005/03/15 13:21:05-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/pci/pci.ids # 2005/03/15 13:21:05-08:00 akpm@bix.(none) +0 -0 # Auto merged # # Documentation/kernel-parameters.txt # 2005/03/15 13:21:05-08:00 akpm@bix.(none) +0 -0 # Auto merged # # ChangeSet # 2005/03/15 00:03:31-08:00 akpm@bix.(none) # s # # drivers/pci/pci.ids # 2005/03/15 00:03:22-08:00 akpm@bix.(none) +1 -0 # s # # include/scsi/scsi_host.h # 2005/03/14 23:59:34-08:00 akpm@bix.(none) +0 -0 # Auto merged # # include/linux/pci_ids.h # 2005/03/14 23:59:34-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/st.c # 2005/03/14 23:59:34-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/sr.c # 2005/03/14 23:59:34-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/megaraid/megaraid_mm.c # 2005/03/14 23:59:34-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/sg.c # 2005/03/14 23:59:33-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/sd.c # 2005/03/14 23:59:33-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/scsi_transport_spi.c # 2005/03/14 23:59:33-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/scsi_transport_fc.c # 2005/03/14 23:59:33-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/scsi_lib.c # 2005/03/14 23:59:33-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/scsi_devinfo.c # 2005/03/14 23:59:33-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/osst.c # 2005/03/14 23:59:33-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/hosts.c # 2005/03/14 23:59:33-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/dc395x.c # 2005/03/14 23:59:33-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/Kconfig # 2005/03/14 23:59:33-08:00 akpm@bix.(none) +0 -0 # Auto merged # # drivers/scsi/53c700.c # 2005/03/14 23:59:33-08:00 akpm@bix.(none) +0 -0 # Auto merged # # Documentation/kernel-parameters.txt # 2005/03/14 23:59:32-08:00 akpm@bix.(none) +0 -0 # Auto merged # diff -Nru a/drivers/block/scsi_ioctl.c b/drivers/block/scsi_ioctl.c --- a/drivers/block/scsi_ioctl.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/block/scsi_ioctl.c 2005-04-04 18:44:36 -07:00 @@ -328,11 +328,6 @@ return 0; } -#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) -#define START_STOP_TIMEOUT (60 * HZ) -#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ) -#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) -#define READ_DEFECT_DATA_TIMEOUT (60 * HZ ) #define OMAX_SB_LEN 16 /* For backward compatibility */ static int sg_scsi_ioctl(struct file *file, request_queue_t *q, diff -Nru a/drivers/pci/pci.ids b/drivers/pci/pci.ids --- a/drivers/pci/pci.ids 2005-04-04 18:44:36 -07:00 +++ b/drivers/pci/pci.ids 2005-04-04 18:44:36 -07:00 @@ -1120,6 +1120,7 @@ 0180 Snipe chipset SCSI controller 1014 0241 iSeries 2757 DASD IOA 1014 0264 Quad Channel PCI-X U320 SCSI RAID Adapter (2780) + 1014 02BD Quad Channel PCI-X U320 DDR SCSI RAID Adapter (570F) 0188 EADS-X PCI-X to PCI-X Bridge 01a7 PCI-X to PCI-X Bridge 01bd ServeRAID Controller diff -Nru a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c --- a/drivers/s390/scsi/zfcp_aux.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/s390/scsi/zfcp_aux.c 2005-04-04 18:44:36 -07:00 @@ -52,19 +52,18 @@ static inline int zfcp_sg_list_copy_to_user(void __user *, struct zfcp_sg_list *, size_t); -static int zfcp_cfdc_dev_ioctl(struct inode *, struct file *, - unsigned int, unsigned long); +static int zfcp_cfdc_dev_ioctl(struct file *, unsigned int, unsigned long); #define ZFCP_CFDC_IOC_MAGIC 0xDD #define ZFCP_CFDC_IOC \ _IOWR(ZFCP_CFDC_IOC_MAGIC, 0, struct zfcp_cfdc_sense_data) -#ifdef CONFIG_COMPAT -static struct ioctl_trans zfcp_ioctl_trans = {ZFCP_CFDC_IOC, (void*) sys_ioctl}; -#endif static struct file_operations zfcp_cfdc_fops = { - .ioctl = zfcp_cfdc_dev_ioctl + .unlocked_ioctl = zfcp_cfdc_dev_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = zfcp_cfdc_dev_ioctl +#endif }; static struct miscdevice zfcp_cfdc_misc = { @@ -308,23 +307,16 @@ if (!zfcp_transport_template) return -ENODEV; - retval = register_ioctl32_conversion(zfcp_ioctl_trans.cmd, - zfcp_ioctl_trans.handler); - if (retval != 0) { - ZFCP_LOG_INFO("registration of ioctl32 conversion failed\n"); - goto out; - } - retval = misc_register(&zfcp_cfdc_misc); if (retval != 0) { ZFCP_LOG_INFO("registration of misc device " "zfcp_cfdc failed\n"); - goto out_misc_register; - } else { - ZFCP_LOG_TRACE("major/minor for zfcp_cfdc: %d/%d\n", - ZFCP_CFDC_DEV_MAJOR, zfcp_cfdc_misc.minor); + goto out; } + ZFCP_LOG_TRACE("major/minor for zfcp_cfdc: %d/%d\n", + ZFCP_CFDC_DEV_MAJOR, zfcp_cfdc_misc.minor); + /* Initialise proc semaphores */ sema_init(&zfcp_data.config_sema, 1); @@ -348,8 +340,6 @@ out_ccw_register: misc_deregister(&zfcp_cfdc_misc); - out_misc_register: - unregister_ioctl32_conversion(zfcp_ioctl_trans.cmd); out: return retval; } @@ -370,9 +360,9 @@ * -EPERM - Cannot create or queue FSF request or create SBALs * -ERESTARTSYS- Received signal (is mapped to EAGAIN by VFS) */ -static int -zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file, - unsigned int command, unsigned long buffer) +static long +zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command, + unsigned long buffer) { struct zfcp_cfdc_sense_data *sense_data, __user *sense_data_user; struct zfcp_adapter *adapter = NULL; diff -Nru a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c --- a/drivers/scsi/53c700.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/53c700.c 2005-04-04 18:44:36 -07:00 @@ -389,8 +389,7 @@ host->max_lun = NCR_700_MAX_LUNS; BUG_ON(NCR_700_transport_template == NULL); host->transportt = NCR_700_transport_template; - host->unique_id = hostdata->base; - host->base = hostdata->base; + host->unique_id = (unsigned long)hostdata->base; hostdata->eh_complete = NULL; host->hostdata[0] = (unsigned long)hostdata; /* kick the chip */ diff -Nru a/drivers/scsi/53c700.h b/drivers/scsi/53c700.h --- a/drivers/scsi/53c700.h 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/53c700.h 2005-04-04 18:44:36 -07:00 @@ -14,10 +14,6 @@ #include -#if defined(CONFIG_53C700_MEM_MAPPED) && defined(CONFIG_53C700_IO_MAPPED) -#define CONFIG_53C700_BOTH_MAPPED -#endif - /* Turn on for general debugging---too verbose for normal use */ #undef NCR_700_DEBUG /* Debug the tag queues, checking hash queue allocation and deallocation @@ -49,13 +45,6 @@ /* magic byte identifying an internally generated REQUEST_SENSE command */ #define NCR_700_INTERNAL_SENSE_MAGIC 0x42 -/* WARNING: Leave this in for now: the dependency preprocessor doesn't - * pick up file specific flags, so must define here if they are not - * set */ -#if !defined(CONFIG_53C700_IO_MAPPED) && !defined(CONFIG_53C700_MEM_MAPPED) -#error "Config.in must define either CONFIG_53C700_IO_MAPPED or CONFIG_53C700_MEM_MAPPED to use this scsi core." -#endif - struct NCR_700_Host_Parameters; /* These are the externally used routines */ @@ -184,7 +173,7 @@ struct NCR_700_Host_Parameters { /* These must be filled in by the calling driver */ int clock; /* board clock speed in MHz */ - unsigned long base; /* the base for the port (copied to host) */ + void __iomem *base; /* the base for the port (copied to host) */ struct device *dev; __u32 dmode_extra; /* adjustable bus settings */ __u32 differential:1; /* if we are differential */ @@ -199,9 +188,6 @@ /* NOTHING BELOW HERE NEEDS ALTERING */ __u32 fast:1; /* if we can alter the SCSI bus clock speed (so can negiotiate sync) */ -#ifdef CONFIG_53C700_BOTH_MAPPED - __u32 mem_mapped; /* set if memory mapped */ -#endif int sync_clock; /* The speed of the SYNC core */ __u32 *script; /* pointer to script location */ @@ -246,12 +232,18 @@ #ifdef CONFIG_53C700_LE_ON_BE #define bE (hostdata->force_le_on_be ? 0 : 3) #define bSWAP (hostdata->force_le_on_be) +/* This is terrible, but there's no raw version of ioread32. That means + * that on a be board we swap twice (once in ioread32 and once again to + * get the value correct) */ +#define bS_to_io(x) ((hostdata->force_le_on_be) ? (x) : cpu_to_le32(x)) #elif defined(__BIG_ENDIAN) #define bE 3 #define bSWAP 0 +#define bS_to_io(x) (x) #elif defined(__LITTLE_ENDIAN) #define bE 0 #define bSWAP 0 +#define bS_to_io(x) (x) #else #error "__BIG_ENDIAN or __LITTLE_ENDIAN must be defined, did you include byteorder.h?" #endif @@ -455,91 +447,42 @@ static inline __u8 -NCR_700_mem_readb(struct Scsi_Host *host, __u32 reg) -{ - const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) - = (struct NCR_700_Host_Parameters *)host->hostdata[0]; - - return readb(host->base + (reg^bE)); -} - -static inline __u32 -NCR_700_mem_readl(struct Scsi_Host *host, __u32 reg) -{ - __u32 value = __raw_readl(host->base + reg); - const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) - = (struct NCR_700_Host_Parameters *)host->hostdata[0]; -#if 1 - /* sanity check the register */ - if((reg & 0x3) != 0) - BUG(); -#endif - - return bS_to_cpu(value); -} - -static inline void -NCR_700_mem_writeb(__u8 value, struct Scsi_Host *host, __u32 reg) -{ - const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) - = (struct NCR_700_Host_Parameters *)host->hostdata[0]; - - writeb(value, host->base + (reg^bE)); -} - -static inline void -NCR_700_mem_writel(__u32 value, struct Scsi_Host *host, __u32 reg) -{ - const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) - = (struct NCR_700_Host_Parameters *)host->hostdata[0]; - -#if 1 - /* sanity check the register */ - if((reg & 0x3) != 0) - BUG(); -#endif - - __raw_writel(bS_to_host(value), host->base + reg); -} - -static inline __u8 -NCR_700_io_readb(struct Scsi_Host *host, __u32 reg) +NCR_700_readb(struct Scsi_Host *host, __u32 reg) { - const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) + const struct NCR_700_Host_Parameters *hostdata = (struct NCR_700_Host_Parameters *)host->hostdata[0]; - return inb(host->base + (reg^bE)); + return ioread8(hostdata->base + (reg^bE)); } static inline __u32 -NCR_700_io_readl(struct Scsi_Host *host, __u32 reg) +NCR_700_readl(struct Scsi_Host *host, __u32 reg) { - __u32 value = inl(host->base + reg); - const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) + const struct NCR_700_Host_Parameters *hostdata = (struct NCR_700_Host_Parameters *)host->hostdata[0]; - + __u32 value = ioread32(hostdata->base + reg); #if 1 /* sanity check the register */ if((reg & 0x3) != 0) BUG(); #endif - return bS_to_cpu(value); + return bS_to_io(value); } static inline void -NCR_700_io_writeb(__u8 value, struct Scsi_Host *host, __u32 reg) +NCR_700_writeb(__u8 value, struct Scsi_Host *host, __u32 reg) { - const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) + const struct NCR_700_Host_Parameters *hostdata = (struct NCR_700_Host_Parameters *)host->hostdata[0]; - outb(value, host->base + (reg^bE)); + iowrite8(value, hostdata->base + (reg^bE)); } static inline void -NCR_700_io_writel(__u32 value, struct Scsi_Host *host, __u32 reg) +NCR_700_writel(__u32 value, struct Scsi_Host *host, __u32 reg) { - const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) + const struct NCR_700_Host_Parameters *hostdata = (struct NCR_700_Host_Parameters *)host->hostdata[0]; #if 1 @@ -548,102 +491,7 @@ BUG(); #endif - outl(bS_to_host(value), host->base + reg); -} - -#ifdef CONFIG_53C700_BOTH_MAPPED - -static inline __u8 -NCR_700_readb(struct Scsi_Host *host, __u32 reg) -{ - __u8 val; - - const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) - = (struct NCR_700_Host_Parameters *)host->hostdata[0]; - - if(hostdata->mem_mapped) - val = NCR_700_mem_readb(host, reg); - else - val = NCR_700_io_readb(host, reg); - - return val; -} - -static inline __u32 -NCR_700_readl(struct Scsi_Host *host, __u32 reg) -{ - __u32 val; - - const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) - = (struct NCR_700_Host_Parameters *)host->hostdata[0]; - - if(hostdata->mem_mapped) - val = NCR_700_mem_readl(host, reg); - else - val = NCR_700_io_readl(host, reg); - - return val; -} - -static inline void -NCR_700_writeb(__u8 value, struct Scsi_Host *host, __u32 reg) -{ - const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) - = (struct NCR_700_Host_Parameters *)host->hostdata[0]; - - if(hostdata->mem_mapped) - NCR_700_mem_writeb(value, host, reg); - else - NCR_700_io_writeb(value, host, reg); -} - -static inline void -NCR_700_writel(__u32 value, struct Scsi_Host *host, __u32 reg) -{ - const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) - = (struct NCR_700_Host_Parameters *)host->hostdata[0]; - - if(hostdata->mem_mapped) - NCR_700_mem_writel(value, host, reg); - else - NCR_700_io_writel(value, host, reg); -} - -static inline void -NCR_700_set_mem_mapped(struct NCR_700_Host_Parameters *hostdata) -{ - hostdata->mem_mapped = 1; -} - -static inline void -NCR_700_set_io_mapped(struct NCR_700_Host_Parameters *hostdata) -{ - hostdata->mem_mapped = 0; + iowrite32(bS_to_io(value), hostdata->base + reg); } - - -#elif defined(CONFIG_53C700_IO_MAPPED) - -#define NCR_700_readb NCR_700_io_readb -#define NCR_700_readl NCR_700_io_readl -#define NCR_700_writeb NCR_700_io_writeb -#define NCR_700_writel NCR_700_io_writel - -#define NCR_700_set_io_mapped(x) -#define NCR_700_set_mem_mapped(x) error I/O mapped only - -#elif defined(CONFIG_53C700_MEM_MAPPED) - -#define NCR_700_readb NCR_700_mem_readb -#define NCR_700_readl NCR_700_mem_readl -#define NCR_700_writeb NCR_700_mem_writeb -#define NCR_700_writel NCR_700_mem_writel - -#define NCR_700_set_io_mapped(x) error MEM mapped only -#define NCR_700_set_mem_mapped(x) - -#else -#error neither CONFIG_53C700_MEM_MAPPED nor CONFIG_53C700_IO_MAPPED is set -#endif #endif diff -Nru a/drivers/scsi/53c7xx.c b/drivers/scsi/53c7xx.c --- a/drivers/scsi/53c7xx.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/53c7xx.c 2005-04-04 18:44:36 -07:00 @@ -280,6 +280,7 @@ #endif #include "scsi.h" +#include #include #include "53c7xx.h" #include @@ -1721,9 +1722,9 @@ printk ("scsi%d : test 2 INQUIRY to target %d, lun 0 : %s\n", host->host_no, i, data + 8); printk ("scsi%d : status ", host->host_no); - print_status (status); + scsi_print_status (status); printk ("\nscsi%d : message ", host->host_no); - print_msg (&msg); + scsi_print_msg (&msg); printk ("\n"); } else if (hostdata->test_completed == 3) { printk("scsi%d : test 2 no connection with target %d\n", @@ -2312,7 +2313,7 @@ printk ("scsi%d : received message", host->host_no); if (c) printk (" from target %d lun %d ", c->device->id, c->device->lun); - print_msg ((unsigned char *) hostdata->msg_buf); + scsi_print_msg ((unsigned char *) hostdata->msg_buf); printk("\n"); } @@ -3204,7 +3205,7 @@ case WRITE_10: #if 0 printk("scsi%d : command is ", host->host_no); - print_command(cmd->cmnd); + __scsi_print_command(cmd->cmnd); #endif #if 0 printk ("scsi%d : %d scatter/gather segments\n", host->host_no, @@ -3232,7 +3233,7 @@ */ default: printk("scsi%d : datain+dataout for command ", host->host_no); - print_command(cmd->cmnd); + __scsi_print_command(cmd->cmnd); datain = dataout = 2 * (cmd->use_sg ? cmd->use_sg : 1) + 3; } @@ -3938,7 +3939,7 @@ if (cmd) { printk("scsi%d : target %d, lun %d, command ", host->host_no, cmd->cmd->device->id, cmd->cmd->device->lun); - print_command (cmd->cmd->cmnd); + __scsi_print_command (cmd->cmd->cmnd); printk("scsi%d : dsp = 0x%x (virt 0x%p)\n", host->host_no, NCR53c7x0_read32(DSP_REG), bus_to_virt(NCR53c7x0_read32(DSP_REG))); @@ -4208,7 +4209,7 @@ if (hostdata->options & OPTION_DEBUG_INTR) { printk ("scsi%d : command complete : pid %lu, id %d,lun %d result 0x%x ", host->host_no, tmp->pid, tmp->device->id, tmp->device->lun, tmp->result); - print_command (tmp->cmnd); + __scsi_print_command (tmp->cmnd); } tmp->scsi_done(tmp); @@ -4297,7 +4298,7 @@ printk("scsi%d : interrupt for pid %lu, id %d, lun %d ", host->host_no, cmd->cmd->pid, (int) cmd->cmd->device->id, (int) cmd->cmd->device->lun); - print_command (cmd->cmd->cmnd); + __scsi_print_command (cmd->cmd->cmnd); } else { printk("scsi%d : no active command\n", host->host_no); } @@ -5539,7 +5540,7 @@ i > 0 && !check_address ((unsigned long) ptr, 1); ptr += len, i -= len) { printk(" "); - len = print_msg (ptr); + len = scsi_print_msg (ptr); printk("\n"); if (!len) break; @@ -5554,7 +5555,7 @@ if (cmd) { printk(" result = 0x%x, target = %d, lun = %d, cmd = ", cmd->result, cmd->device->id, cmd->device->lun); - print_command(cmd->cmnd); + __scsi_print_command(cmd->cmnd); } else printk("\n"); printk(" + %d : dsa_next = 0x%x\n", hostdata->dsa_next, @@ -6028,7 +6029,7 @@ virt_to_bus(event.dsa), event.dsa); if (event.pid != -1) { printk (" event for pid %ld ", event.pid); - print_command (event.cmnd); + __scsi_print_command (event.cmnd); } } } diff -Nru a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c --- a/drivers/scsi/BusLogic.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/BusLogic.c 2005-04-04 18:44:36 -07:00 @@ -2958,13 +2958,6 @@ struct BusLogic_CCB *CCB; BusLogic_IncrementErrorCounter(&HostAdapter->TargetStatistics[TargetID].CommandAbortsRequested); /* - If this Command has already completed, then no Abort is necessary. - */ - if (Command->serial_number != Command->serial_number_at_timeout) { - BusLogic_Warning("Unable to Abort Command to Target %d - " "Already Completed\n", HostAdapter, TargetID); - return SUCCESS; - } - /* Attempt to find an Active CCB for this Command. If no Active CCB for this Command is found, then no Abort is necessary. */ diff -Nru a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig --- a/drivers/scsi/Kconfig 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/Kconfig 2005-04-04 18:44:36 -07:00 @@ -942,11 +942,6 @@ Unless you have an NCR manufactured machine, the chances are that you do not have this SCSI card, so say N. -config 53C700_IO_MAPPED - bool - depends on SCSI_NCR_D700 - default y - config SCSI_LASI700 tristate "HP Lasi SCSI support for 53c700/710" depends on GSC && SCSI @@ -955,11 +950,6 @@ This is a driver for the SCSI controller in the Lasi chip found in many PA-RISC workstations & servers. If you do not know whether you have a Lasi chip, it is safe to say "Y" here. - -config 53C700_MEM_MAPPED - bool - depends on SCSI_LASI700 - default y config 53C700_LE_ON_BE bool diff -Nru a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c --- a/drivers/scsi/NCR5380.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/NCR5380.c 2005-04-04 18:44:36 -07:00 @@ -86,6 +86,7 @@ * 5. Test linked command handling code after Eric is ready with * the high level code. */ +#include #if (NDEBUG & NDEBUG_LISTS) #define LIST(x,y) {printk("LINE:%d Adding %p to %p\n", __LINE__, (void*)(x), (void*)(y)); if ((x)==(y)) udelay(5); } @@ -2371,7 +2372,7 @@ * 3..length+1 arguments * * Start the extended message buffer with the EXTENDED_MESSAGE - * byte, since print_msg() wants the whole thing. + * byte, since scsi_print_msg() wants the whole thing. */ extended_msg[0] = EXTENDED_MESSAGE; /* Accept first byte by clearing ACK */ @@ -2418,7 +2419,7 @@ default: if (!tmp) { printk("scsi%d: rejecting message ", instance->host_no); - print_msg(extended_msg); + scsi_print_msg(extended_msg); printk("\n"); } else if (tmp != EXTENDED_MESSAGE) printk("scsi%d: rejecting unknown message %02x from target %d, lun %d\n", instance->host_no, tmp, cmd->device->id, cmd->device->lun); @@ -2552,7 +2553,7 @@ if (!(msg[0] & 0x80)) { printk(KERN_ERR "scsi%d : expecting IDENTIFY message, got ", instance->host_no); - print_msg(msg); + scsi_print_msg(msg); abort = 1; } else { /* Accept message by clearing ACK */ @@ -2677,7 +2678,7 @@ Scsi_Cmnd *tmp, **prev; printk(KERN_WARNING "scsi%d : aborting command\n", instance->host_no); - print_Scsi_Cmnd(cmd); + scsi_print_command(cmd); NCR5380_print_status(instance); diff -Nru a/drivers/scsi/NCR_D700.c b/drivers/scsi/NCR_D700.c --- a/drivers/scsi/NCR_D700.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/NCR_D700.c 2005-04-04 18:44:36 -07:00 @@ -197,12 +197,10 @@ } /* Fill in the three required pieces of hostdata */ - hostdata->base = region; + hostdata->base = ioport_map(region, 64); hostdata->differential = (((1<clock = NCR_D700_CLOCK_MHZ; - NCR_700_set_io_mapped(hostdata); - /* and register the siop */ host = NCR_700_detect(&NCR_D700_driver_template, hostdata, p->dev); if (!host) { @@ -214,6 +212,7 @@ /* FIXME: read this from SUS */ host->this_id = id_array[slot * 2 + siop]; host->irq = irq; + host->base = region; scsi_scan_host(host); return 0; diff -Nru a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c --- a/drivers/scsi/advansys.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/advansys.c 2005-04-04 18:44:36 -07:00 @@ -9198,15 +9198,12 @@ s->use_sg, s->sglist_len, s->abort_reason); printk( -" serial_number 0x%x, serial_number_at_timeout 0x%x, retries %d, allowed %d\n", - (unsigned) s->serial_number, (unsigned) s->serial_number_at_timeout, - s->retries, s->allowed); +" serial_number 0x%x, retries %d, allowed %d\n", + (unsigned) s->serial_number, s->retries, s->allowed); printk( " timeout_per_command %d, timeout_total %d, timeout %d\n", s->timeout_per_command, s->timeout_total, s->timeout); - - printk(" internal_timeout %u\n", s->internal_timeout); printk( " scsi_done 0x%lx, done 0x%lx, host_scribble 0x%lx, result 0x%x\n", diff -Nru a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c --- a/drivers/scsi/aha152x.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/aha152x.c 2005-04-04 18:44:36 -07:00 @@ -257,6 +257,7 @@ #include #include "scsi.h" +#include #include #include "aha152x.h" @@ -986,7 +987,7 @@ if (HOSTDATA(shpnt)->debug & debug_queue) { printk(INFO_LEAD "queue: %p; cmd_len=%d pieces=%d size=%u cmnd=", CMDINFO(SCpnt), SCpnt, SCpnt->cmd_len, SCpnt->use_sg, SCpnt->request_bufflen); - print_command(SCpnt->cmnd); + __scsi_print_command(SCpnt->cmnd); } #endif @@ -1560,7 +1561,7 @@ #if 0 if(HOSTDATA(shpnt)->debug & debug_eh) { printk(ERR_LEAD "received sense: ", CMDINFO(DONE_SC)); - print_sense("bh", DONE_SC); + scsi_print_sense("bh", DONE_SC); } #endif @@ -1846,7 +1847,7 @@ #if defined(AHA152X_DEBUG) if (HOSTDATA(shpnt)->debug & debug_msgi) { printk(INFO_LEAD "inbound message %02x ", CMDINFO(CURRENT_SC), MSGI(0)); - print_msg(&MSGI(0)); + scsi_print_msg(&MSGI(0)); printk("\n"); } #endif @@ -1934,7 +1935,7 @@ break; printk(INFO_LEAD, CMDINFO(CURRENT_SC)); - print_msg(&MSGI(0)); + scsi_print_msg(&MSGI(0)); printk("\n"); ticks = (MSGI(3) * 4 + 49) / 50; @@ -2032,7 +2033,7 @@ int i; printk(DEBUG_LEAD "messages( ", CMDINFO(CURRENT_SC)); - for (i=0; idebug & debug_cmd) { printk(DEBUG_LEAD "cmd_init: ", CMDINFO(CURRENT_SC)); - print_command(CURRENT_SC->cmnd); + __scsi_print_command(CURRENT_SC->cmnd); } #endif @@ -2158,7 +2159,7 @@ #if defined(AHA152X_DEBUG) if (HOSTDATA(shpnt)->debug & debug_status) { printk(DEBUG_LEAD "inbound status %02x ", CMDINFO(CURRENT_SC), CURRENT_SC->SCp.Status); - print_status(CURRENT_SC->SCp.Status); + scsi_print_status(CURRENT_SC->SCp.Status); printk("\n"); } #endif @@ -2925,7 +2926,7 @@ printk(KERN_DEBUG "0x%08x: target=%d; lun=%d; cmnd=(", (unsigned int) ptr, ptr->device->id, ptr->device->lun); - print_command(ptr->cmnd); + __scsi_print_command(ptr->cmnd); printk(KERN_DEBUG "); request_bufflen=%d; resid=%d; phase |", ptr->request_bufflen, ptr->resid); diff -Nru a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c --- a/drivers/scsi/arm/acornscsi.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/arm/acornscsi.c 2005-04-04 18:44:36 -07:00 @@ -150,6 +150,7 @@ #include #include "../scsi.h" +#include #include #include "acornscsi.h" #include "msgqueue.h" @@ -866,7 +867,7 @@ default: printk(KERN_ERR "scsi%d.H: incomplete data transfer detected: result=%08X command=", host->host->host_no, SCpnt->result); - print_command(SCpnt->cmnd); + __scsi_print_command(SCpnt->cmnd); acornscsi_dumpdma(host, "done"); acornscsi_dumplog(host, SCpnt->device->id); SCpnt->result &= 0xffff; @@ -1369,7 +1370,7 @@ host->scsi.last_message = msg->msg[0]; #if (DEBUG & DEBUG_MESSAGES) - print_msg(msg->msg); + scsi_print_msg(msg->msg); #endif break; @@ -1391,7 +1392,7 @@ while ((msg = msgqueue_getmsg(&host->scsi.msgs, msgnr++)) != NULL) { unsigned int i; #if (DEBUG & DEBUG_MESSAGES) - print_msg(msg); + scsi_print_msg(msg); #endif i = 0; if (acornscsi_write_pio(host, msg->msg, &i, msg->length, 1000000)) @@ -1487,7 +1488,7 @@ #if (DEBUG & DEBUG_MESSAGES) printk("scsi%d.%c: message in: ", host->host->host_no, acornscsi_target(host)); - print_msg(message); + scsi_print_msg(message); printk("\n"); #endif diff -Nru a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c --- a/drivers/scsi/arm/fas216.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/arm/fas216.c 2005-04-04 18:44:36 -07:00 @@ -52,6 +52,7 @@ #include #include "../scsi.h" +#include #include #include "fas216.h" #include "scsi.h" @@ -309,7 +310,7 @@ va_end(args); printk(" CDB: "); - print_command(SCpnt->cmnd); + __scsi_print_command(SCpnt->cmnd); } static void @@ -2081,7 +2082,7 @@ info->host->host_no, '0' + SCpnt->device->id, SCpnt->result, info->scsi.SCp.ptr, info->scsi.SCp.this_residual); - print_command(SCpnt->cmnd); + __scsi_print_command(SCpnt->cmnd); SCpnt->result &= ~(255 << 16); SCpnt->result |= DID_BAD_TARGET << 16; goto request_sense; @@ -2170,7 +2171,7 @@ info->host->host_no, '0' + SCpnt->device->id, info->scsi.SCp.ptr, info->scsi.SCp.this_residual); info->scsi.SCp.ptr = NULL; - print_command(SCpnt->cmnd); + __scsi_print_command(SCpnt->cmnd); } /* @@ -2426,7 +2427,7 @@ info->stats.aborts += 1; printk(KERN_WARNING "scsi%d: abort command ", info->host->host_no); - print_command(SCpnt->data_cmnd); + __scsi_print_command(SCpnt->data_cmnd); print_debug_list(); fas216_dumpstate(info); diff -Nru a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h --- a/drivers/scsi/arm/scsi.h 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/arm/scsi.h 2005-04-04 18:44:36 -07:00 @@ -108,7 +108,7 @@ #if 0 //def BELT_AND_BRACES printk(KERN_WARNING "scsi%d.%c: zero length buffer passed for " "command ", SCpnt->host->host_no, '0' + SCpnt->target); - print_command(SCpnt->cmnd); + __scsi_print_command(SCpnt->cmnd); #endif SCpnt->SCp.ptr = NULL; } diff -Nru a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c --- a/drivers/scsi/atari_NCR5380.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/atari_NCR5380.c 2005-04-04 18:44:36 -07:00 @@ -73,6 +73,7 @@ * 1. Test linked command handling code after Eric is ready with * the high level code. */ +#include #if (NDEBUG & NDEBUG_LISTS) #define LIST(x,y) \ @@ -2354,7 +2355,7 @@ * 3..length+1 arguments * * Start the extended message buffer with the EXTENDED_MESSAGE - * byte, since print_msg() wants the whole thing. + * byte, since scsi_print_msg() wants the whole thing. */ extended_msg[0] = EXTENDED_MESSAGE; /* Accept first byte by clearing ACK */ @@ -2407,7 +2408,7 @@ default: if (!tmp) { printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO); - print_msg (extended_msg); + scsi_print_msg (extended_msg); printk("\n"); } else if (tmp != EXTENDED_MESSAGE) printk(KERN_DEBUG "scsi%d: rejecting unknown " @@ -2540,7 +2541,7 @@ if (!(msg[0] & 0x80)) { printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO); - print_msg(msg); + scsi_print_msg(msg); do_abort(instance); return; } @@ -2646,7 +2647,7 @@ unsigned long flags; printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO); - print_Scsi_Cmnd (cmd); + scsi_print_command(cmd); NCR5380_print_status (instance); diff -Nru a/drivers/scsi/constants.c b/drivers/scsi/constants.c --- a/drivers/scsi/constants.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/constants.c 2005-04-04 18:44:36 -07:00 @@ -372,7 +372,7 @@ /** * - * print_status - print scsi status description + * scsi_print_status - print scsi status description * @scsi_status: scsi status value * * If the status is recognized, the description is printed. diff -Nru a/drivers/scsi/ips.c b/drivers/scsi/ips.c --- a/drivers/scsi/ips.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/ips.c 2005-04-04 18:44:36 -07:00 @@ -833,13 +833,6 @@ if (!ha->active) return (FAILED); - if (SC->serial_number != SC->serial_number_at_timeout) { - /* HMM, looks like a bogus command */ - DEBUG(1, "Abort called with bogus scsi command"); - - return (FAILED); - } - /* See if the command is on the copp queue */ item = ha->copp_waitlist.head; while ((item) && (item->scsi_cmd != SC)) diff -Nru a/drivers/scsi/lasi700.c b/drivers/scsi/lasi700.c --- a/drivers/scsi/lasi700.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/lasi700.c 2005-04-04 18:44:36 -07:00 @@ -131,6 +131,7 @@ if (!host) goto out_kfree; host->this_id = 7; + host->base = base; host->irq = dev->irq; if(request_irq(dev->irq, NCR_700_intr, SA_SHIRQ, "lasi700", host)) { printk(KERN_ERR "lasi700: request_irq failed!\n"); diff -Nru a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c --- a/drivers/scsi/ncr53c8xx.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/ncr53c8xx.c 2005-04-04 18:44:36 -07:00 @@ -7486,23 +7486,13 @@ struct scsi_cmnd *done_list; #if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS - printk("ncr53c8xx_abort: pid=%lu serial_number=%ld serial_number_at_timeout=%ld\n", - cmd->pid, cmd->serial_number, cmd->serial_number_at_timeout); + printk("ncr53c8xx_abort: pid=%lu serial_number=%ld\n", + cmd->pid, cmd->serial_number); #else printk("ncr53c8xx_abort: command pid %lu\n", cmd->pid); #endif NCR_LOCK_NCB(np, flags); - -#if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS - /* - * We have to just ignore abort requests in some situations. - */ - if (cmd->serial_number != cmd->serial_number_at_timeout) { - sts = SCSI_ABORT_NOT_RUNNING; - goto out; - } -#endif sts = ncr_abort_command(np, cmd); out: diff -Nru a/drivers/scsi/pci2000.c b/drivers/scsi/pci2000.c --- a/drivers/scsi/pci2000.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/pci2000.c 2005-04-04 18:44:36 -07:00 @@ -438,8 +438,8 @@ if ( bus ) { DEB (if(*cdb) printk ("\nCDB: %X- %X %X %X %X %X %X %X %X %X %X ", SCpnt->cmd_len, cdb[0], cdb[1], cdb[2], cdb[3], cdb[4], cdb[5], cdb[6], cdb[7], cdb[8], cdb[9])); - DEB (if(*cdb) printk ("\ntimeout_per_command: %d, timeout_total: %d, timeout: %d, internal_timout: %d", SCpnt->timeout_per_command, - SCpnt->timeout_total, SCpnt->timeout, SCpnt->internal_timeout)); + DEB (if(*cdb) printk ("\ntimeout_per_command: %d, timeout_total: %d, timeout: %d", SCpnt->timeout_per_command, + SCpnt->timeout_total, SCpnt->timeout)); outl (SCpnt->timeout_per_command, padapter->mb1); outb_p (CMD_SCSI_TIMEOUT, padapter->cmd); if ( WaitReady (padapter) ) diff -Nru a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c --- a/drivers/scsi/qla2xxx/qla_dbg.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/qla2xxx/qla_dbg.c 2005-04-04 18:44:36 -07:00 @@ -1050,10 +1050,8 @@ for (i = 0; i < cmd->cmd_len; i++) { printk("0x%02x ", cmd->cmnd[i]); } - printk("\n seg_cnt=%d, allowed=%d, retries=%d, " - "serial_number_at_timeout=0x%lx\n", - cmd->use_sg, cmd->allowed, cmd->retries, - cmd->serial_number_at_timeout); + printk("\n seg_cnt=%d, allowed=%d, retries=%d\n", + cmd->use_sg, cmd->allowed, cmd->retries); printk(" request buffer=0x%p, request buffer len=0x%x\n", cmd->request_buffer, cmd->request_bufflen); printk(" tag=%d, transfersize=0x%x\n", diff -Nru a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c --- a/drivers/scsi/scsi.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/scsi.c 2005-04-04 18:44:36 -07:00 @@ -489,7 +489,7 @@ scsi_print_command(cmd); if (status_byte(cmd->result) & CHECK_CONDITION) { /* - * XXX The print_sense formatting/prefix + * XXX The scsi_print_sense formatting/prefix * doesn't match this function. */ scsi_print_sense("", cmd); @@ -686,7 +686,6 @@ cmd->request = sreq->sr_request; memcpy(cmd->data_cmnd, sreq->sr_cmnd, sizeof(cmd->data_cmnd)); cmd->serial_number = 0; - cmd->serial_number_at_timeout = 0; cmd->bufflen = sreq->sr_bufflen; cmd->buffer = sreq->sr_buffer; cmd->retries = 0; @@ -716,7 +715,6 @@ /* * Start the timer ticking. */ - cmd->internal_timeout = NORMAL_TIMEOUT; cmd->abort_reason = 0; cmd->result = 0; @@ -766,7 +764,6 @@ * Set the serial numbers back to zero */ cmd->serial_number = 0; - cmd->serial_number_at_timeout = 0; cmd->state = SCSI_STATE_BHQUEUE; cmd->owner = SCSI_OWNER_BH_HANDLER; diff -Nru a/drivers/scsi/scsi.h b/drivers/scsi/scsi.h --- a/drivers/scsi/scsi.h 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/scsi.h 2005-04-04 18:44:36 -07:00 @@ -23,7 +23,6 @@ #include /* for CONFIG_SCSI_LOGGING */ #include -#include #include #include #include @@ -60,42 +59,6 @@ #define scsi_to_pci_dma_dir(scsi_dir) ((int)(scsi_dir)) #define scsi_to_sbus_dma_dir(scsi_dir) ((int)(scsi_dir)) - -/* - * Old names for debug prettyprinting functions. - */ -static inline void print_Scsi_Cmnd(struct scsi_cmnd *cmd) -{ - return scsi_print_command(cmd); -} -static inline void print_command(unsigned char *cdb) -{ - return __scsi_print_command(cdb); -} -static inline void print_sense(const char *devclass, struct scsi_cmnd *cmd) -{ - return scsi_print_sense(devclass, cmd); -} -static inline void print_req_sense(const char *devclass, struct scsi_request *req) -{ - return scsi_print_req_sense(devclass, req); -} -static inline void print_driverbyte(int scsiresult) -{ - return scsi_print_driverbyte(scsiresult); -} -static inline void print_hostbyte(int scsiresult) -{ - return scsi_print_hostbyte(scsiresult); -} -static inline void print_status(unsigned char status) -{ - return scsi_print_status(status); -} -static inline int print_msg(const unsigned char *msg) -{ - return scsi_print_msg(msg); -} /* * This is the crap from the old error handling code. We have it in a special diff -Nru a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c --- a/drivers/scsi/scsi_error.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/scsi_error.c 2005-04-04 18:44:36 -07:00 @@ -79,11 +79,6 @@ */ scmd->owner = SCSI_OWNER_ERROR_HANDLER; scmd->state = SCSI_STATE_FAILED; - /* - * Set the serial_number_at_timeout to the current - * serial_number - */ - scmd->serial_number_at_timeout = scmd->serial_number; list_add_tail(&scmd->eh_entry, &shost->eh_cmd_q); set_bit(SHOST_RECOVERY, &shost->shost_state); shost->host_failed++; @@ -1061,7 +1056,6 @@ SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Bus RST\n", __FUNCTION__)); scmd->owner = SCSI_OWNER_LOWLEVEL; - scmd->serial_number_at_timeout = scmd->serial_number; if (!scmd->device->host->hostt->eh_bus_reset_handler) return FAILED; @@ -1093,7 +1087,6 @@ SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Host RST\n", __FUNCTION__)); scmd->owner = SCSI_OWNER_LOWLEVEL; - scmd->serial_number_at_timeout = scmd->serial_number; if (!scmd->device->host->hostt->eh_host_reset_handler) return FAILED; @@ -1839,7 +1832,6 @@ scmd->bufflen = 0; scmd->request_buffer = NULL; scmd->request_bufflen = 0; - scmd->internal_timeout = NORMAL_TIMEOUT; scmd->abort_reason = DID_ABORT; scmd->cmd_len = 0; diff -Nru a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c --- a/drivers/scsi/scsi_ioctl.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/scsi_ioctl.c 2005-04-04 18:44:36 -07:00 @@ -27,11 +27,6 @@ #define NORMAL_RETRIES 5 #define IOCTL_NORMAL_TIMEOUT (10 * HZ) -#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) -#define START_STOP_TIMEOUT (60 * HZ) -#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ) -#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) -#define READ_DEFECT_DATA_TIMEOUT (60 * HZ ) /* ZIP-250 on parallel port takes as long! */ #define MAX_BUF PAGE_SIZE diff -Nru a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c --- a/drivers/scsi/scsi_lib.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/scsi_lib.c 2005-04-04 18:44:36 -07:00 @@ -298,7 +298,6 @@ { cmd->owner = SCSI_OWNER_MIDLEVEL; cmd->serial_number = 0; - cmd->serial_number_at_timeout = 0; cmd->abort_reason = 0; memset(cmd->sense_buffer, 0, sizeof cmd->sense_buffer); @@ -320,7 +319,6 @@ memcpy(cmd->data_cmnd, cmd->cmnd, sizeof(cmd->cmnd)); cmd->buffer = cmd->request_buffer; cmd->bufflen = cmd->request_bufflen; - cmd->internal_timeout = NORMAL_TIMEOUT; cmd->abort_reason = 0; return 1; diff -Nru a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h --- a/drivers/scsi/scsi_priv.h 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/scsi_priv.h 2005-04-04 18:44:36 -07:00 @@ -30,11 +30,6 @@ #define SCSI_REQ_MAGIC 0x75F6D354 /* - * Flag bit for the internal_timeout array - */ -#define NORMAL_TIMEOUT 0 - -/* * Scsi Error Handler Flags */ #define scsi_eh_eflags_chk(scp, flags) \ diff -Nru a/drivers/scsi/seagate.c b/drivers/scsi/seagate.c --- a/drivers/scsi/seagate.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/seagate.c 2005-04-04 18:44:36 -07:00 @@ -103,6 +103,7 @@ #include #include "scsi.h" +#include #include #include "seagate.h" @@ -746,7 +747,7 @@ #if (DEBUG & PRINT_COMMAND) printk("scsi%d : target = %d, command = ", hostno, target); - print_command((unsigned char *) cmnd); + __scsi_print_command((unsigned char *) cmnd); #endif #if (DEBUG & PHASE_RESELECT) @@ -1553,7 +1554,7 @@ printk("\n"); #endif printk("scsi%d : status = ", hostno); - print_status(status); + scsi_print_status(status); printk(" message = %02x\n", message); #endif diff -Nru a/drivers/scsi/sg.c b/drivers/scsi/sg.c --- a/drivers/scsi/sg.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/sg.c 2005-04-04 18:44:36 -07:00 @@ -18,8 +18,8 @@ * */ -static int sg_version_num = 30532; /* 2 digits for each component */ -#define SG_VERSION_STR "3.5.32" +static int sg_version_num = 30533; /* 2 digits for each component */ +#define SG_VERSION_STR "3.5.33" /* * D. P. Gilbert (dgilbert@interlog.com, dougg@triode.net.au), notes: @@ -51,6 +51,7 @@ #include #include "scsi.h" +#include #include #include #include @@ -60,7 +61,7 @@ #ifdef CONFIG_SCSI_PROC_FS #include -static char *sg_version_date = "20050117"; +static char *sg_version_date = "20050328"; static int sg_proc_init(void); static void sg_proc_cleanup(void); @@ -330,14 +331,13 @@ static ssize_t sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) { - int res; Sg_device *sdp; Sg_fd *sfp; Sg_request *srp; int req_pack_id = -1; - struct sg_header old_hdr; - sg_io_hdr_t new_hdr; sg_io_hdr_t *hp; + struct sg_header *old_hdr = NULL; + int retval = 0; if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))) return -ENXIO; @@ -346,98 +346,138 @@ if (!access_ok(VERIFY_WRITE, buf, count)) return -EFAULT; if (sfp->force_packid && (count >= SZ_SG_HEADER)) { - if (__copy_from_user(&old_hdr, buf, SZ_SG_HEADER)) - return -EFAULT; - if (old_hdr.reply_len < 0) { + old_hdr = kmalloc(SZ_SG_HEADER, GFP_KERNEL); + if (!old_hdr) + return -ENOMEM; + if (__copy_from_user(old_hdr, buf, SZ_SG_HEADER)) { + retval = -EFAULT; + goto free_old_hdr; + } + if (old_hdr->reply_len < 0) { if (count >= SZ_SG_IO_HDR) { - if (__copy_from_user - (&new_hdr, buf, SZ_SG_IO_HDR)) - return -EFAULT; - req_pack_id = new_hdr.pack_id; + sg_io_hdr_t *new_hdr; + new_hdr = kmalloc(SZ_SG_IO_HDR, GFP_KERNEL); + if (!new_hdr) { + retval = -ENOMEM; + goto free_old_hdr; + } + retval =__copy_from_user + (new_hdr, buf, SZ_SG_IO_HDR); + req_pack_id = new_hdr->pack_id; + kfree(new_hdr); + if (retval) { + retval = -EFAULT; + goto free_old_hdr; + } } } else - req_pack_id = old_hdr.pack_id; + req_pack_id = old_hdr->pack_id; } srp = sg_get_rq_mark(sfp, req_pack_id); if (!srp) { /* now wait on packet to arrive */ - if (sdp->detached) - return -ENODEV; - if (filp->f_flags & O_NONBLOCK) - return -EAGAIN; + if (sdp->detached) { + retval = -ENODEV; + goto free_old_hdr; + } + if (filp->f_flags & O_NONBLOCK) { + retval = -EAGAIN; + goto free_old_hdr; + } while (1) { - res = 0; /* following is a macro that beats race condition */ + retval = 0; /* following macro beats race condition */ __wait_event_interruptible(sfp->read_wait, - (sdp->detached || (srp = sg_get_rq_mark(sfp, req_pack_id))), - res); - if (sdp->detached) - return -ENODEV; - if (0 == res) + (sdp->detached || + (srp = sg_get_rq_mark(sfp, req_pack_id))), + retval); + if (sdp->detached) { + retval = -ENODEV; + goto free_old_hdr; + } + if (0 == retval) break; - return res; /* -ERESTARTSYS because signal hit process */ + + /* -ERESTARTSYS as signal hit process */ + goto free_old_hdr; } } - if (srp->header.interface_id != '\0') - return sg_new_read(sfp, buf, count, srp); + if (srp->header.interface_id != '\0') { + retval = sg_new_read(sfp, buf, count, srp); + goto free_old_hdr; + } hp = &srp->header; - memset(&old_hdr, 0, SZ_SG_HEADER); - old_hdr.reply_len = (int) hp->timeout; - old_hdr.pack_len = old_hdr.reply_len; /* very old, strange behaviour */ - old_hdr.pack_id = hp->pack_id; - old_hdr.twelve_byte = + if (old_hdr == NULL) { + old_hdr = kmalloc(SZ_SG_HEADER, GFP_KERNEL); + if (! old_hdr) { + retval = -ENOMEM; + goto free_old_hdr; + } + } + memset(old_hdr, 0, SZ_SG_HEADER); + old_hdr->reply_len = (int) hp->timeout; + old_hdr->pack_len = old_hdr->reply_len; /* old, strange behaviour */ + old_hdr->pack_id = hp->pack_id; + old_hdr->twelve_byte = ((srp->data.cmd_opcode >= 0xc0) && (12 == hp->cmd_len)) ? 1 : 0; - old_hdr.target_status = hp->masked_status; - old_hdr.host_status = hp->host_status; - old_hdr.driver_status = hp->driver_status; + old_hdr->target_status = hp->masked_status; + old_hdr->host_status = hp->host_status; + old_hdr->driver_status = hp->driver_status; if ((CHECK_CONDITION & hp->masked_status) || (DRIVER_SENSE & hp->driver_status)) - memcpy(old_hdr.sense_buffer, srp->sense_b, - sizeof (old_hdr.sense_buffer)); + memcpy(old_hdr->sense_buffer, srp->sense_b, + sizeof (old_hdr->sense_buffer)); switch (hp->host_status) { /* This setup of 'result' is for backward compatibility and is best ignored by the user who should use target, host + driver status */ case DID_OK: case DID_PASSTHROUGH: case DID_SOFT_ERROR: - old_hdr.result = 0; + old_hdr->result = 0; break; case DID_NO_CONNECT: case DID_BUS_BUSY: case DID_TIME_OUT: - old_hdr.result = EBUSY; + old_hdr->result = EBUSY; break; case DID_BAD_TARGET: case DID_ABORT: case DID_PARITY: case DID_RESET: case DID_BAD_INTR: - old_hdr.result = EIO; + old_hdr->result = EIO; break; case DID_ERROR: - old_hdr.result = (srp->sense_b[0] == 0 && + old_hdr->result = (srp->sense_b[0] == 0 && hp->masked_status == GOOD) ? 0 : EIO; break; default: - old_hdr.result = EIO; + old_hdr->result = EIO; break; } /* Now copy the result back to the user buffer. */ if (count >= SZ_SG_HEADER) { - if (__copy_to_user(buf, &old_hdr, SZ_SG_HEADER)) - return -EFAULT; + if (__copy_to_user(buf, old_hdr, SZ_SG_HEADER)) { + retval = -EFAULT; + goto free_old_hdr; + } buf += SZ_SG_HEADER; - if (count > old_hdr.reply_len) - count = old_hdr.reply_len; + if (count > old_hdr->reply_len) + count = old_hdr->reply_len; if (count > SZ_SG_HEADER) { - if ((res = - sg_read_oxfer(srp, buf, count - SZ_SG_HEADER))) - return -EFAULT; + if (sg_read_oxfer(srp, buf, count - SZ_SG_HEADER)) { + retval = -EFAULT; + goto free_old_hdr; + } } } else - count = (old_hdr.result == 0) ? 0 : -EIO; + count = (old_hdr->result == 0) ? 0 : -EIO; sg_finish_rem_req(srp); - return count; + retval = count; +free_old_hdr: + if (old_hdr) + kfree(old_hdr); + return retval; } static ssize_t @@ -724,7 +764,7 @@ srp->data.sglist_len = 0; srp->data.bufflen = 0; srp->data.buffer = NULL; - hp->duration = jiffies; /* unit jiffies now, millisecs after done */ + hp->duration = jiffies_to_msecs(jiffies); /* Now send everything of to mid-level. The next time we hear about this packet is when sg_cmd_done() is called (i.e. a callback). */ scsi_do_req(SRpnt, (void *) cmnd, @@ -937,8 +977,13 @@ if (!access_ok(VERIFY_WRITE, p, SZ_SG_REQ_INFO * SG_MAX_QUEUE)) return -EFAULT; else { - sg_req_info_t rinfo[SG_MAX_QUEUE]; - Sg_request *srp; + sg_req_info_t *rinfo; + unsigned int ms; + + rinfo = kmalloc(SZ_SG_REQ_INFO * SG_MAX_QUEUE, + GFP_KERNEL); + if (!rinfo) + return -ENOMEM; read_lock_irqsave(&sfp->rq_list_lock, iflags); for (srp = sfp->headrp, val = 0; val < SG_MAX_QUEUE; ++val, srp = srp ? srp->nextrp : srp) { @@ -949,19 +994,30 @@ srp->header.masked_status & srp->header.host_status & srp->header.driver_status; - rinfo[val].duration = - srp->done ? srp->header.duration : - jiffies_to_msecs( - jiffies - srp->header.duration); + if (srp->done) + rinfo[val].duration = + srp->header.duration; + else { + ms = jiffies_to_msecs(jiffies); + rinfo[val].duration = + (ms > srp->header.duration) ? + (ms - srp->header.duration) : 0; + } rinfo[val].orphan = srp->orphan; - rinfo[val].sg_io_owned = srp->sg_io_owned; - rinfo[val].pack_id = srp->header.pack_id; - rinfo[val].usr_ptr = srp->header.usr_ptr; + rinfo[val].sg_io_owned = + srp->sg_io_owned; + rinfo[val].pack_id = + srp->header.pack_id; + rinfo[val].usr_ptr = + srp->header.usr_ptr; } } read_unlock_irqrestore(&sfp->rq_list_lock, iflags); - return (__copy_to_user(p, rinfo, - SZ_SG_REQ_INFO * SG_MAX_QUEUE) ? -EFAULT : 0); + result = __copy_to_user(p, rinfo, + SZ_SG_REQ_INFO * SG_MAX_QUEUE); + result = result ? -EFAULT : 0; + kfree(rinfo); + return result; } case SG_EMULATED_HOST: if (sdp->detached) @@ -1208,11 +1264,12 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma) { Sg_fd *sfp; - unsigned long req_sz = vma->vm_end - vma->vm_start; + unsigned long req_sz; Sg_scatter_hold *rsv_schp; if ((!filp) || (!vma) || (!(sfp = (Sg_fd *) filp->private_data))) return -ENXIO; + req_sz = vma->vm_end - vma->vm_start; SCSI_LOG_TIMEOUT(3, printk("sg_mmap starting, vm_start=%p, len=%d\n", (void *) vma->vm_start, (int) req_sz)); if (vma->vm_pgoff) @@ -1259,6 +1316,7 @@ Sg_fd *sfp; Sg_request *srp = NULL; unsigned long iflags; + unsigned int ms; if (SCpnt && (SRpnt = SCpnt->sc_request)) srp = (Sg_request *) SRpnt->upper_private_data; @@ -1295,9 +1353,9 @@ SCSI_LOG_TIMEOUT(4, printk("sg_cmd_done: %s, pack_id=%d, res=0x%x\n", sdp->disk->disk_name, srp->header.pack_id, (int) SRpnt->sr_result)); srp->header.resid = SCpnt->resid; - /* N.B. unit of duration changes here from jiffies to millisecs */ - srp->header.duration = - jiffies_to_msecs(jiffies - srp->header.duration); + ms = jiffies_to_msecs(jiffies); + srp->header.duration = (ms > srp->header.duration) ? + (ms - srp->header.duration) : 0; if (0 != SRpnt->sr_result) { struct scsi_sense_hdr sshdr; @@ -1311,7 +1369,7 @@ if ((sdp->sgdebug > 0) && ((CHECK_CONDITION == srp->header.masked_status) || (COMMAND_TERMINATED == srp->header.masked_status))) - print_req_sense("sg_cmd_done", SRpnt); + scsi_print_req_sense("sg_cmd_done", SRpnt); /* Following if statement is a patch supplied by Eric Youngdale */ if (driver_byte(SRpnt->sr_result) != 0 @@ -2395,7 +2453,7 @@ } if (resp) { resp->nextrp = NULL; - resp->header.duration = jiffies; + resp->header.duration = jiffies_to_msecs(jiffies); resp->my_cmdp = NULL; } write_unlock_irqrestore(&sfp->rq_list_lock, iflags); @@ -2990,6 +3048,7 @@ Sg_fd *fp; const sg_io_hdr_t *hp; const char * cp; + unsigned int ms; for (k = 0; (fp = sg_get_nth_sfp(sdp, k)); ++k) { seq_printf(s, " FD(%d): timeout=%dms bufflen=%d " @@ -3028,10 +3087,13 @@ srp->header.pack_id, blen); if (srp->done) seq_printf(s, " dur=%d", hp->duration); - else + else { + ms = jiffies_to_msecs(jiffies); seq_printf(s, " t_o/elap=%d/%d", - new_interface ? hp->timeout : jiffies_to_msecs(fp->timeout), - jiffies_to_msecs(hp->duration ? (jiffies - hp->duration) : 0)); + (new_interface ? hp->timeout : + jiffies_to_msecs(fp->timeout)), + (ms > hp->duration ? ms - hp->duration : 0)); + } seq_printf(s, "ms sgat=%d op=0x%02x\n", usg, (int) srp->data.cmd_opcode); } diff -Nru a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c --- a/drivers/scsi/sim710.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/sim710.c 2005-04-04 18:44:36 -07:00 @@ -120,11 +120,10 @@ } /* Fill in the three required pieces of hostdata */ - hostdata->base = base_addr; + hostdata->base = ioport_map(base_addr, 64); hostdata->differential = differential; hostdata->clock = clock; hostdata->chip710 = 1; - NCR_700_set_io_mapped(hostdata); /* and register the chip */ if((host = NCR_700_detect(&sim710_driver_template, hostdata, dev)) @@ -133,6 +132,7 @@ goto out_release; } host->this_id = scsi_id; + host->base = base_addr; host->irq = irq; if (request_irq(irq, NCR_700_intr, SA_SHIRQ, "sim710", host)) { printk(KERN_ERR "sim710: request_irq failed\n"); @@ -164,6 +164,7 @@ NCR_700_release(host); kfree(hostdata); free_irq(host->irq, host); + release_region(host->base, 64); return 0; } diff -Nru a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c --- a/drivers/scsi/sun3_NCR5380.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/sun3_NCR5380.c 2005-04-04 18:44:36 -07:00 @@ -69,6 +69,7 @@ * finally replaced that by the *_PRINTK() macros. * */ +#include /* * Further development / testing that should be done : @@ -2377,7 +2378,7 @@ * 3..length+1 arguments * * Start the extended message buffer with the EXTENDED_MESSAGE - * byte, since print_msg() wants the whole thing. + * byte, since scsi_print_msg() wants the whole thing. */ extended_msg[0] = EXTENDED_MESSAGE; /* Accept first byte by clearing ACK */ @@ -2430,7 +2431,7 @@ default: if (!tmp) { printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO); - print_msg (extended_msg); + scsi_print_msg (extended_msg); printk("\n"); } else if (tmp != EXTENDED_MESSAGE) printk(KERN_DEBUG "scsi%d: rejecting unknown " @@ -2565,7 +2566,7 @@ if (!(msg[0] & 0x80)) { printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO); - print_msg(msg); + scsi_print_msg(msg); do_abort(instance); return; } @@ -2691,7 +2692,7 @@ unsigned long flags; printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO); - print_Scsi_Cmnd (cmd); + scsi_print_command(cmd); NCR5380_print_status (instance); diff -Nru a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c --- a/drivers/scsi/sym53c8xx_2/sym_glue.c 2005-04-04 18:44:36 -07:00 +++ b/drivers/scsi/sym53c8xx_2/sym_glue.c 2005-04-04 18:44:36 -07:00 @@ -799,12 +799,6 @@ dev_warn(&cmd->device->sdev_gendev, "%s operation started.\n", opname); -#if 0 - /* This one should be the result of some race, thus to ignore */ - if (cmd->serial_number != cmd->serial_number_at_timeout) - goto prepare; -#endif - /* This one is queued in some place -> to wait for completion */ FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) { struct sym_ccb *cp = sym_que_entry(qp, struct sym_ccb, link_ccbq); diff -Nru a/include/scsi/scsi.h b/include/scsi/scsi.h --- a/include/scsi/scsi.h 2005-04-04 18:44:36 -07:00 +++ b/include/scsi/scsi.h 2005-04-04 18:44:36 -07:00 @@ -360,6 +360,15 @@ #define sense_error(sense) ((sense) & 0xf) #define sense_valid(sense) ((sense) & 0x80); +/* + * default timeouts +*/ +#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) +#define START_STOP_TIMEOUT (60 * HZ) +#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ) +#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) +#define READ_DEFECT_DATA_TIMEOUT (60 * HZ ) + #define IDENTIFY_BASE 0x80 #define IDENTIFY(can_disconnect, lun) (IDENTIFY_BASE |\ diff -Nru a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h --- a/include/scsi/scsi_cmnd.h 2005-04-04 18:44:36 -07:00 +++ b/include/scsi/scsi_cmnd.h 2005-04-04 18:44:36 -07:00 @@ -43,33 +43,23 @@ void (*done) (struct scsi_cmnd *); /* Mid-level done function */ /* - * A SCSI Command is assigned a nonzero serial_number when internal_cmnd - * passes it to the driver's queue command function. The serial_number - * is cleared when scsi_done is entered indicating that the command has - * been completed. If a timeout occurs, the serial number at the moment - * of timeout is copied into serial_number_at_timeout. By subsequently - * comparing the serial_number and serial_number_at_timeout fields - * during abort or reset processing, we can detect whether the command - * has already completed. This also detects cases where the command has - * completed and the SCSI Command structure has already being reused - * for another command, so that we can avoid incorrectly aborting or - * resetting the new command. - * The serial number is only unique per host. + * A SCSI Command is assigned a nonzero serial_number before passed + * to the driver's queue command function. The serial_number is + * cleared when scsi_done is entered indicating that the command + * has been completed. It currently doesn't have much use other + * than printk's. Some lldd's use this number for other purposes. + * It's almost certain that such usages are either incorrect or + * meaningless. Please kill all usages other than printk's. Also, + * as this number is always identical to ->pid, please convert + * printk's to use ->pid, so that we can kill this field. */ unsigned long serial_number; - unsigned long serial_number_at_timeout; int retries; int allowed; int timeout_per_command; int timeout_total; int timeout; - - /* - * We handle the timeout differently if it happens when a reset, - * abort, etc are in process. - */ - unsigned volatile char internal_timeout; unsigned char cmd_len; unsigned char old_cmd_len;