diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/bfa/bfad_fwimg.c | 2 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfad_im.c | 2 | ||||
-rw-r--r-- | drivers/scsi/dpt_i2o.c | 2 | ||||
-rw-r--r-- | drivers/scsi/gdth.c | 2 | ||||
-rw-r--r-- | drivers/scsi/hosts.c | 2 | ||||
-rw-r--r-- | drivers/scsi/ipr.c | 42 | ||||
-rw-r--r-- | drivers/scsi/ipr.h | 1 | ||||
-rw-r--r-- | drivers/scsi/libsas/sas_expander.c | 1 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/aha152x_stub.c | 42 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/fdomain_stub.c | 44 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/nsp_cs.c | 8 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/qlogic_stub.c | 45 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/sym53c500_cs.c | 42 | ||||
-rw-r--r-- | drivers/scsi/pmcraid.c | 10 | ||||
-rw-r--r-- | drivers/scsi/scsi_scan.c | 18 | ||||
-rw-r--r-- | drivers/scsi/scsi_sysctl.c | 11 | ||||
-rw-r--r-- | drivers/scsi/scsi_sysfs.c | 63 | ||||
-rw-r--r-- | drivers/scsi/scsi_transport_fc.c | 3 | ||||
-rw-r--r-- | drivers/scsi/sd_dif.c | 2 |
19 files changed, 147 insertions, 195 deletions
diff --git a/drivers/scsi/bfa/bfad_fwimg.c b/drivers/scsi/bfa/bfad_fwimg.c index 2c2082d6ce45..2ad65f275a92 100644 --- a/drivers/scsi/bfa/bfad_fwimg.c +++ b/drivers/scsi/bfa/bfad_fwimg.c | |||
@@ -41,6 +41,8 @@ u32 *bfi_image_cb; | |||
41 | 41 | ||
42 | #define BFAD_FW_FILE_CT "ctfw.bin" | 42 | #define BFAD_FW_FILE_CT "ctfw.bin" |
43 | #define BFAD_FW_FILE_CB "cbfw.bin" | 43 | #define BFAD_FW_FILE_CB "cbfw.bin" |
44 | MODULE_FIRMWARE(BFAD_FW_FILE_CT); | ||
45 | MODULE_FIRMWARE(BFAD_FW_FILE_CB); | ||
44 | 46 | ||
45 | u32 * | 47 | u32 * |
46 | bfad_read_firmware(struct pci_dev *pdev, u32 **bfi_image, | 48 | bfad_read_firmware(struct pci_dev *pdev, u32 **bfi_image, |
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index ae3a0689a66f..f788c2a0ab07 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c | |||
@@ -948,7 +948,7 @@ bfad_os_fc_host_init(struct bfad_im_port_s *im_port) | |||
948 | if (bfad_supported_fc4s & (BFA_PORT_ROLE_FCP_IM | BFA_PORT_ROLE_FCP_TM)) | 948 | if (bfad_supported_fc4s & (BFA_PORT_ROLE_FCP_IM | BFA_PORT_ROLE_FCP_TM)) |
949 | /* For FCP type 0x08 */ | 949 | /* For FCP type 0x08 */ |
950 | fc_host_supported_fc4s(host)[2] = 1; | 950 | fc_host_supported_fc4s(host)[2] = 1; |
951 | if (bfad_supported_fc4s | BFA_PORT_ROLE_FCP_IPFC) | 951 | if (bfad_supported_fc4s & BFA_PORT_ROLE_FCP_IPFC) |
952 | /* For LLC/SNAP type 0x05 */ | 952 | /* For LLC/SNAP type 0x05 */ |
953 | fc_host_supported_fc4s(host)[3] = 0x20; | 953 | fc_host_supported_fc4s(host)[3] = 0x20; |
954 | /* For fibre channel services type 0x20 */ | 954 | /* For fibre channel services type 0x20 */ |
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index 7d1aac31ec8d..496764349c41 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -1919,7 +1919,7 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg) | |||
1919 | size = size>>16; | 1919 | size = size>>16; |
1920 | size *= 4; | 1920 | size *= 4; |
1921 | if (size > MAX_MESSAGE_SIZE) { | 1921 | if (size > MAX_MESSAGE_SIZE) { |
1922 | rcode = EINVAL; | 1922 | rcode = -EINVAL; |
1923 | goto cleanup; | 1923 | goto cleanup; |
1924 | } | 1924 | } |
1925 | /* Copy in the user's I2O command */ | 1925 | /* Copy in the user's I2O command */ |
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c index 185e6bc4dd40..9e8fce0f0c1b 100644 --- a/drivers/scsi/gdth.c +++ b/drivers/scsi/gdth.c | |||
@@ -2900,7 +2900,7 @@ static int gdth_read_event(gdth_ha_str *ha, int handle, gdth_evt_str *estr) | |||
2900 | eindex = handle; | 2900 | eindex = handle; |
2901 | estr->event_source = 0; | 2901 | estr->event_source = 0; |
2902 | 2902 | ||
2903 | if (eindex >= MAX_EVENTS) { | 2903 | if (eindex < 0 || eindex >= MAX_EVENTS) { |
2904 | spin_unlock_irqrestore(&ha->smp_lock, flags); | 2904 | spin_unlock_irqrestore(&ha->smp_lock, flags); |
2905 | return eindex; | 2905 | return eindex; |
2906 | } | 2906 | } |
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 28a753d796f3..554626e18062 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -164,8 +164,8 @@ void scsi_remove_host(struct Scsi_Host *shost) | |||
164 | return; | 164 | return; |
165 | } | 165 | } |
166 | spin_unlock_irqrestore(shost->host_lock, flags); | 166 | spin_unlock_irqrestore(shost->host_lock, flags); |
167 | mutex_unlock(&shost->scan_mutex); | ||
168 | scsi_forget_host(shost); | 167 | scsi_forget_host(shost); |
168 | mutex_unlock(&shost->scan_mutex); | ||
169 | scsi_proc_host_rm(shost); | 169 | scsi_proc_host_rm(shost); |
170 | 170 | ||
171 | spin_lock_irqsave(shost->host_lock, flags); | 171 | spin_lock_irqsave(shost->host_lock, flags); |
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index d40d5c79fff1..206c2fa8c1ba 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -4194,6 +4194,25 @@ static irqreturn_t ipr_handle_other_interrupt(struct ipr_ioa_cfg *ioa_cfg, | |||
4194 | } | 4194 | } |
4195 | 4195 | ||
4196 | /** | 4196 | /** |
4197 | * ipr_isr_eh - Interrupt service routine error handler | ||
4198 | * @ioa_cfg: ioa config struct | ||
4199 | * @msg: message to log | ||
4200 | * | ||
4201 | * Return value: | ||
4202 | * none | ||
4203 | **/ | ||
4204 | static void ipr_isr_eh(struct ipr_ioa_cfg *ioa_cfg, char *msg) | ||
4205 | { | ||
4206 | ioa_cfg->errors_logged++; | ||
4207 | dev_err(&ioa_cfg->pdev->dev, "%s\n", msg); | ||
4208 | |||
4209 | if (WAIT_FOR_DUMP == ioa_cfg->sdt_state) | ||
4210 | ioa_cfg->sdt_state = GET_DUMP; | ||
4211 | |||
4212 | ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NONE); | ||
4213 | } | ||
4214 | |||
4215 | /** | ||
4197 | * ipr_isr - Interrupt service routine | 4216 | * ipr_isr - Interrupt service routine |
4198 | * @irq: irq number | 4217 | * @irq: irq number |
4199 | * @devp: pointer to ioa config struct | 4218 | * @devp: pointer to ioa config struct |
@@ -4208,6 +4227,7 @@ static irqreturn_t ipr_isr(int irq, void *devp) | |||
4208 | volatile u32 int_reg, int_mask_reg; | 4227 | volatile u32 int_reg, int_mask_reg; |
4209 | u32 ioasc; | 4228 | u32 ioasc; |
4210 | u16 cmd_index; | 4229 | u16 cmd_index; |
4230 | int num_hrrq = 0; | ||
4211 | struct ipr_cmnd *ipr_cmd; | 4231 | struct ipr_cmnd *ipr_cmd; |
4212 | irqreturn_t rc = IRQ_NONE; | 4232 | irqreturn_t rc = IRQ_NONE; |
4213 | 4233 | ||
@@ -4238,13 +4258,7 @@ static irqreturn_t ipr_isr(int irq, void *devp) | |||
4238 | IPR_HRRQ_REQ_RESP_HANDLE_MASK) >> IPR_HRRQ_REQ_RESP_HANDLE_SHIFT; | 4258 | IPR_HRRQ_REQ_RESP_HANDLE_MASK) >> IPR_HRRQ_REQ_RESP_HANDLE_SHIFT; |
4239 | 4259 | ||
4240 | if (unlikely(cmd_index >= IPR_NUM_CMD_BLKS)) { | 4260 | if (unlikely(cmd_index >= IPR_NUM_CMD_BLKS)) { |
4241 | ioa_cfg->errors_logged++; | 4261 | ipr_isr_eh(ioa_cfg, "Invalid response handle from IOA"); |
4242 | dev_err(&ioa_cfg->pdev->dev, "Invalid response handle from IOA\n"); | ||
4243 | |||
4244 | if (WAIT_FOR_DUMP == ioa_cfg->sdt_state) | ||
4245 | ioa_cfg->sdt_state = GET_DUMP; | ||
4246 | |||
4247 | ipr_initiate_ioa_reset(ioa_cfg, IPR_SHUTDOWN_NONE); | ||
4248 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); | 4262 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); |
4249 | return IRQ_HANDLED; | 4263 | return IRQ_HANDLED; |
4250 | } | 4264 | } |
@@ -4271,8 +4285,18 @@ static irqreturn_t ipr_isr(int irq, void *devp) | |||
4271 | 4285 | ||
4272 | if (ipr_cmd != NULL) { | 4286 | if (ipr_cmd != NULL) { |
4273 | /* Clear the PCI interrupt */ | 4287 | /* Clear the PCI interrupt */ |
4274 | writel(IPR_PCII_HRRQ_UPDATED, ioa_cfg->regs.clr_interrupt_reg); | 4288 | do { |
4275 | int_reg = readl(ioa_cfg->regs.sense_interrupt_reg) & ~int_mask_reg; | 4289 | writel(IPR_PCII_HRRQ_UPDATED, ioa_cfg->regs.clr_interrupt_reg); |
4290 | int_reg = readl(ioa_cfg->regs.sense_interrupt_reg) & ~int_mask_reg; | ||
4291 | } while (int_reg & IPR_PCII_HRRQ_UPDATED && | ||
4292 | num_hrrq++ < IPR_MAX_HRRQ_RETRIES); | ||
4293 | |||
4294 | if (int_reg & IPR_PCII_HRRQ_UPDATED) { | ||
4295 | ipr_isr_eh(ioa_cfg, "Error clearing HRRQ"); | ||
4296 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); | ||
4297 | return IRQ_HANDLED; | ||
4298 | } | ||
4299 | |||
4276 | } else | 4300 | } else |
4277 | break; | 4301 | break; |
4278 | } | 4302 | } |
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h index 163245a1c3e5..19bbcf39f0c9 100644 --- a/drivers/scsi/ipr.h +++ b/drivers/scsi/ipr.h | |||
@@ -144,6 +144,7 @@ | |||
144 | #define IPR_IOA_MAX_SECTORS 32767 | 144 | #define IPR_IOA_MAX_SECTORS 32767 |
145 | #define IPR_VSET_MAX_SECTORS 512 | 145 | #define IPR_VSET_MAX_SECTORS 512 |
146 | #define IPR_MAX_CDB_LEN 16 | 146 | #define IPR_MAX_CDB_LEN 16 |
147 | #define IPR_MAX_HRRQ_RETRIES 3 | ||
147 | 148 | ||
148 | #define IPR_DEFAULT_BUS_WIDTH 16 | 149 | #define IPR_DEFAULT_BUS_WIDTH 16 |
149 | #define IPR_80MBs_SCSI_RATE ((80 * 10) / (IPR_DEFAULT_BUS_WIDTH / 8)) | 150 | #define IPR_80MBs_SCSI_RATE ((80 * 10) / (IPR_DEFAULT_BUS_WIDTH / 8)) |
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index b3381959acce..33cf988c8c8a 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c | |||
@@ -960,7 +960,6 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id) | |||
960 | 960 | ||
961 | } | 961 | } |
962 | } | 962 | } |
963 | res = 0; | ||
964 | } | 963 | } |
965 | 964 | ||
966 | return res; | 965 | return res; |
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c index 67cde0138061..528733b4a392 100644 --- a/drivers/scsi/pcmcia/aha152x_stub.c +++ b/drivers/scsi/pcmcia/aha152x_stub.c | |||
@@ -54,15 +54,6 @@ | |||
54 | #include <pcmcia/cistpl.h> | 54 | #include <pcmcia/cistpl.h> |
55 | #include <pcmcia/ds.h> | 55 | #include <pcmcia/ds.h> |
56 | 56 | ||
57 | #ifdef PCMCIA_DEBUG | ||
58 | static int pc_debug = PCMCIA_DEBUG; | ||
59 | module_param(pc_debug, int, 0644); | ||
60 | #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) | ||
61 | static char *version = | ||
62 | "aha152x_cs.c 1.54 2000/06/12 21:27:25 (David Hinds)"; | ||
63 | #else | ||
64 | #define DEBUG(n, args...) | ||
65 | #endif | ||
66 | 57 | ||
67 | /*====================================================================*/ | 58 | /*====================================================================*/ |
68 | 59 | ||
@@ -103,7 +94,7 @@ static int aha152x_probe(struct pcmcia_device *link) | |||
103 | { | 94 | { |
104 | scsi_info_t *info; | 95 | scsi_info_t *info; |
105 | 96 | ||
106 | DEBUG(0, "aha152x_attach()\n"); | 97 | dev_dbg(&link->dev, "aha152x_attach()\n"); |
107 | 98 | ||
108 | /* Create new SCSI device */ | 99 | /* Create new SCSI device */ |
109 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 100 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
@@ -115,7 +106,6 @@ static int aha152x_probe(struct pcmcia_device *link) | |||
115 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 106 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; |
116 | link->io.IOAddrLines = 10; | 107 | link->io.IOAddrLines = 10; |
117 | link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; | 108 | link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; |
118 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; | ||
119 | link->conf.Attributes = CONF_ENABLE_IRQ; | 109 | link->conf.Attributes = CONF_ENABLE_IRQ; |
120 | link->conf.IntType = INT_MEMORY_AND_IO; | 110 | link->conf.IntType = INT_MEMORY_AND_IO; |
121 | link->conf.Present = PRESENT_OPTION; | 111 | link->conf.Present = PRESENT_OPTION; |
@@ -127,7 +117,7 @@ static int aha152x_probe(struct pcmcia_device *link) | |||
127 | 117 | ||
128 | static void aha152x_detach(struct pcmcia_device *link) | 118 | static void aha152x_detach(struct pcmcia_device *link) |
129 | { | 119 | { |
130 | DEBUG(0, "aha152x_detach(0x%p)\n", link); | 120 | dev_dbg(&link->dev, "aha152x_detach\n"); |
131 | 121 | ||
132 | aha152x_release_cs(link); | 122 | aha152x_release_cs(link); |
133 | 123 | ||
@@ -137,9 +127,6 @@ static void aha152x_detach(struct pcmcia_device *link) | |||
137 | 127 | ||
138 | /*====================================================================*/ | 128 | /*====================================================================*/ |
139 | 129 | ||
140 | #define CS_CHECK(fn, ret) \ | ||
141 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | ||
142 | |||
143 | static int aha152x_config_check(struct pcmcia_device *p_dev, | 130 | static int aha152x_config_check(struct pcmcia_device *p_dev, |
144 | cistpl_cftable_entry_t *cfg, | 131 | cistpl_cftable_entry_t *cfg, |
145 | cistpl_cftable_entry_t *dflt, | 132 | cistpl_cftable_entry_t *dflt, |
@@ -164,19 +151,22 @@ static int aha152x_config_cs(struct pcmcia_device *link) | |||
164 | { | 151 | { |
165 | scsi_info_t *info = link->priv; | 152 | scsi_info_t *info = link->priv; |
166 | struct aha152x_setup s; | 153 | struct aha152x_setup s; |
167 | int last_ret, last_fn; | 154 | int ret; |
168 | struct Scsi_Host *host; | 155 | struct Scsi_Host *host; |
169 | 156 | ||
170 | DEBUG(0, "aha152x_config(0x%p)\n", link); | 157 | dev_dbg(&link->dev, "aha152x_config\n"); |
171 | 158 | ||
172 | last_ret = pcmcia_loop_config(link, aha152x_config_check, NULL); | 159 | ret = pcmcia_loop_config(link, aha152x_config_check, NULL); |
173 | if (last_ret) { | 160 | if (ret) |
174 | cs_error(link, RequestIO, last_ret); | 161 | goto failed; |
175 | goto failed; | ||
176 | } | ||
177 | 162 | ||
178 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); | 163 | ret = pcmcia_request_irq(link, &link->irq); |
179 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); | 164 | if (ret) |
165 | goto failed; | ||
166 | |||
167 | ret = pcmcia_request_configuration(link, &link->conf); | ||
168 | if (ret) | ||
169 | goto failed; | ||
180 | 170 | ||
181 | /* Set configuration options for the aha152x driver */ | 171 | /* Set configuration options for the aha152x driver */ |
182 | memset(&s, 0, sizeof(s)); | 172 | memset(&s, 0, sizeof(s)); |
@@ -194,7 +184,7 @@ static int aha152x_config_cs(struct pcmcia_device *link) | |||
194 | host = aha152x_probe_one(&s); | 184 | host = aha152x_probe_one(&s); |
195 | if (host == NULL) { | 185 | if (host == NULL) { |
196 | printk(KERN_INFO "aha152x_cs: no SCSI devices found\n"); | 186 | printk(KERN_INFO "aha152x_cs: no SCSI devices found\n"); |
197 | goto cs_failed; | 187 | goto failed; |
198 | } | 188 | } |
199 | 189 | ||
200 | sprintf(info->node.dev_name, "scsi%d", host->host_no); | 190 | sprintf(info->node.dev_name, "scsi%d", host->host_no); |
@@ -203,8 +193,6 @@ static int aha152x_config_cs(struct pcmcia_device *link) | |||
203 | 193 | ||
204 | return 0; | 194 | return 0; |
205 | 195 | ||
206 | cs_failed: | ||
207 | cs_error(link, last_fn, last_ret); | ||
208 | failed: | 196 | failed: |
209 | aha152x_release_cs(link); | 197 | aha152x_release_cs(link); |
210 | return -ENODEV; | 198 | return -ENODEV; |
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c index 06254f46a0dd..914040684079 100644 --- a/drivers/scsi/pcmcia/fdomain_stub.c +++ b/drivers/scsi/pcmcia/fdomain_stub.c | |||
@@ -59,16 +59,6 @@ MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>"); | |||
59 | MODULE_DESCRIPTION("Future Domain PCMCIA SCSI driver"); | 59 | MODULE_DESCRIPTION("Future Domain PCMCIA SCSI driver"); |
60 | MODULE_LICENSE("Dual MPL/GPL"); | 60 | MODULE_LICENSE("Dual MPL/GPL"); |
61 | 61 | ||
62 | #ifdef PCMCIA_DEBUG | ||
63 | static int pc_debug = PCMCIA_DEBUG; | ||
64 | module_param(pc_debug, int, 0); | ||
65 | #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) | ||
66 | static char *version = | ||
67 | "fdomain_cs.c 1.47 2001/10/13 00:08:52 (David Hinds)"; | ||
68 | #else | ||
69 | #define DEBUG(n, args...) | ||
70 | #endif | ||
71 | |||
72 | /*====================================================================*/ | 62 | /*====================================================================*/ |
73 | 63 | ||
74 | typedef struct scsi_info_t { | 64 | typedef struct scsi_info_t { |
@@ -86,7 +76,7 @@ static int fdomain_probe(struct pcmcia_device *link) | |||
86 | { | 76 | { |
87 | scsi_info_t *info; | 77 | scsi_info_t *info; |
88 | 78 | ||
89 | DEBUG(0, "fdomain_attach()\n"); | 79 | dev_dbg(&link->dev, "fdomain_attach()\n"); |
90 | 80 | ||
91 | /* Create new SCSI device */ | 81 | /* Create new SCSI device */ |
92 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 82 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
@@ -99,7 +89,6 @@ static int fdomain_probe(struct pcmcia_device *link) | |||
99 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 89 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; |
100 | link->io.IOAddrLines = 10; | 90 | link->io.IOAddrLines = 10; |
101 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; | 91 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; |
102 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; | ||
103 | link->conf.Attributes = CONF_ENABLE_IRQ; | 92 | link->conf.Attributes = CONF_ENABLE_IRQ; |
104 | link->conf.IntType = INT_MEMORY_AND_IO; | 93 | link->conf.IntType = INT_MEMORY_AND_IO; |
105 | link->conf.Present = PRESENT_OPTION; | 94 | link->conf.Present = PRESENT_OPTION; |
@@ -111,7 +100,7 @@ static int fdomain_probe(struct pcmcia_device *link) | |||
111 | 100 | ||
112 | static void fdomain_detach(struct pcmcia_device *link) | 101 | static void fdomain_detach(struct pcmcia_device *link) |
113 | { | 102 | { |
114 | DEBUG(0, "fdomain_detach(0x%p)\n", link); | 103 | dev_dbg(&link->dev, "fdomain_detach\n"); |
115 | 104 | ||
116 | fdomain_release(link); | 105 | fdomain_release(link); |
117 | 106 | ||
@@ -120,9 +109,6 @@ static void fdomain_detach(struct pcmcia_device *link) | |||
120 | 109 | ||
121 | /*====================================================================*/ | 110 | /*====================================================================*/ |
122 | 111 | ||
123 | #define CS_CHECK(fn, ret) \ | ||
124 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | ||
125 | |||
126 | static int fdomain_config_check(struct pcmcia_device *p_dev, | 112 | static int fdomain_config_check(struct pcmcia_device *p_dev, |
127 | cistpl_cftable_entry_t *cfg, | 113 | cistpl_cftable_entry_t *cfg, |
128 | cistpl_cftable_entry_t *dflt, | 114 | cistpl_cftable_entry_t *dflt, |
@@ -137,20 +123,22 @@ static int fdomain_config_check(struct pcmcia_device *p_dev, | |||
137 | static int fdomain_config(struct pcmcia_device *link) | 123 | static int fdomain_config(struct pcmcia_device *link) |
138 | { | 124 | { |
139 | scsi_info_t *info = link->priv; | 125 | scsi_info_t *info = link->priv; |
140 | int last_ret, last_fn; | 126 | int ret; |
141 | char str[22]; | 127 | char str[22]; |
142 | struct Scsi_Host *host; | 128 | struct Scsi_Host *host; |
143 | 129 | ||
144 | DEBUG(0, "fdomain_config(0x%p)\n", link); | 130 | dev_dbg(&link->dev, "fdomain_config\n"); |
145 | 131 | ||
146 | last_ret = pcmcia_loop_config(link, fdomain_config_check, NULL); | 132 | ret = pcmcia_loop_config(link, fdomain_config_check, NULL); |
147 | if (last_ret) { | 133 | if (ret) |
148 | cs_error(link, RequestIO, last_ret); | ||
149 | goto failed; | 134 | goto failed; |
150 | } | ||
151 | 135 | ||
152 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); | 136 | ret = pcmcia_request_irq(link, &link->irq); |
153 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); | 137 | if (ret) |
138 | goto failed; | ||
139 | ret = pcmcia_request_configuration(link, &link->conf); | ||
140 | if (ret) | ||
141 | goto failed; | ||
154 | 142 | ||
155 | /* A bad hack... */ | 143 | /* A bad hack... */ |
156 | release_region(link->io.BasePort1, link->io.NumPorts1); | 144 | release_region(link->io.BasePort1, link->io.NumPorts1); |
@@ -162,11 +150,11 @@ static int fdomain_config(struct pcmcia_device *link) | |||
162 | host = __fdomain_16x0_detect(&fdomain_driver_template); | 150 | host = __fdomain_16x0_detect(&fdomain_driver_template); |
163 | if (!host) { | 151 | if (!host) { |
164 | printk(KERN_INFO "fdomain_cs: no SCSI devices found\n"); | 152 | printk(KERN_INFO "fdomain_cs: no SCSI devices found\n"); |
165 | goto cs_failed; | 153 | goto failed; |
166 | } | 154 | } |
167 | 155 | ||
168 | if (scsi_add_host(host, NULL)) | 156 | if (scsi_add_host(host, NULL)) |
169 | goto cs_failed; | 157 | goto failed; |
170 | scsi_scan_host(host); | 158 | scsi_scan_host(host); |
171 | 159 | ||
172 | sprintf(info->node.dev_name, "scsi%d", host->host_no); | 160 | sprintf(info->node.dev_name, "scsi%d", host->host_no); |
@@ -175,8 +163,6 @@ static int fdomain_config(struct pcmcia_device *link) | |||
175 | 163 | ||
176 | return 0; | 164 | return 0; |
177 | 165 | ||
178 | cs_failed: | ||
179 | cs_error(link, last_fn, last_ret); | ||
180 | failed: | 166 | failed: |
181 | fdomain_release(link); | 167 | fdomain_release(link); |
182 | return -ENODEV; | 168 | return -ENODEV; |
@@ -188,7 +174,7 @@ static void fdomain_release(struct pcmcia_device *link) | |||
188 | { | 174 | { |
189 | scsi_info_t *info = link->priv; | 175 | scsi_info_t *info = link->priv; |
190 | 176 | ||
191 | DEBUG(0, "fdomain_release(0x%p)\n", link); | 177 | dev_dbg(&link->dev, "fdomain_release\n"); |
192 | 178 | ||
193 | scsi_remove_host(info->host); | 179 | scsi_remove_host(info->host); |
194 | pcmcia_disable_device(link); | 180 | pcmcia_disable_device(link); |
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index e32c344d7ad8..c2341af587a3 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c | |||
@@ -1564,12 +1564,10 @@ static int nsp_cs_probe(struct pcmcia_device *link) | |||
1564 | link->io.IOAddrLines = 10; /* not used */ | 1564 | link->io.IOAddrLines = 10; /* not used */ |
1565 | 1565 | ||
1566 | /* Interrupt setup */ | 1566 | /* Interrupt setup */ |
1567 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; | 1567 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; |
1568 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; | ||
1569 | 1568 | ||
1570 | /* Interrupt handler */ | 1569 | /* Interrupt handler */ |
1571 | link->irq.Handler = &nspintr; | 1570 | link->irq.Handler = &nspintr; |
1572 | link->irq.Instance = info; | ||
1573 | link->irq.Attributes |= IRQF_SHARED; | 1571 | link->irq.Attributes |= IRQF_SHARED; |
1574 | 1572 | ||
1575 | /* General socket configuration */ | 1573 | /* General socket configuration */ |
@@ -1684,10 +1682,10 @@ static int nsp_cs_config_check(struct pcmcia_device *p_dev, | |||
1684 | if (cfg_mem->req.Size < 0x1000) | 1682 | if (cfg_mem->req.Size < 0x1000) |
1685 | cfg_mem->req.Size = 0x1000; | 1683 | cfg_mem->req.Size = 0x1000; |
1686 | cfg_mem->req.AccessSpeed = 0; | 1684 | cfg_mem->req.AccessSpeed = 0; |
1687 | if (pcmcia_request_window(&p_dev, &cfg_mem->req, &p_dev->win) != 0) | 1685 | if (pcmcia_request_window(p_dev, &cfg_mem->req, &p_dev->win) != 0) |
1688 | goto next_entry; | 1686 | goto next_entry; |
1689 | map.Page = 0; map.CardOffset = mem->win[0].card_addr; | 1687 | map.Page = 0; map.CardOffset = mem->win[0].card_addr; |
1690 | if (pcmcia_map_mem_page(p_dev->win, &map) != 0) | 1688 | if (pcmcia_map_mem_page(p_dev, p_dev->win, &map) != 0) |
1691 | goto next_entry; | 1689 | goto next_entry; |
1692 | 1690 | ||
1693 | cfg_mem->data->MmioAddress = (unsigned long) ioremap_nocache(cfg_mem->req.Base, cfg_mem->req.Size); | 1691 | cfg_mem->data->MmioAddress = (unsigned long) ioremap_nocache(cfg_mem->req.Base, cfg_mem->req.Size); |
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c index 20c3e5e6d88a..f85f094870b4 100644 --- a/drivers/scsi/pcmcia/qlogic_stub.c +++ b/drivers/scsi/pcmcia/qlogic_stub.c | |||
@@ -62,15 +62,6 @@ | |||
62 | 62 | ||
63 | static char qlogic_name[] = "qlogic_cs"; | 63 | static char qlogic_name[] = "qlogic_cs"; |
64 | 64 | ||
65 | #ifdef PCMCIA_DEBUG | ||
66 | static int pc_debug = PCMCIA_DEBUG; | ||
67 | module_param(pc_debug, int, 0644); | ||
68 | #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) | ||
69 | static char *version = "qlogic_cs.c 1.79-ac 2002/10/26 (David Hinds)"; | ||
70 | #else | ||
71 | #define DEBUG(n, args...) | ||
72 | #endif | ||
73 | |||
74 | static struct scsi_host_template qlogicfas_driver_template = { | 65 | static struct scsi_host_template qlogicfas_driver_template = { |
75 | .module = THIS_MODULE, | 66 | .module = THIS_MODULE, |
76 | .name = qlogic_name, | 67 | .name = qlogic_name, |
@@ -159,7 +150,7 @@ static int qlogic_probe(struct pcmcia_device *link) | |||
159 | { | 150 | { |
160 | scsi_info_t *info; | 151 | scsi_info_t *info; |
161 | 152 | ||
162 | DEBUG(0, "qlogic_attach()\n"); | 153 | dev_dbg(&link->dev, "qlogic_attach()\n"); |
163 | 154 | ||
164 | /* Create new SCSI device */ | 155 | /* Create new SCSI device */ |
165 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 156 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
@@ -171,7 +162,6 @@ static int qlogic_probe(struct pcmcia_device *link) | |||
171 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 162 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; |
172 | link->io.IOAddrLines = 10; | 163 | link->io.IOAddrLines = 10; |
173 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; | 164 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; |
174 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; | ||
175 | link->conf.Attributes = CONF_ENABLE_IRQ; | 165 | link->conf.Attributes = CONF_ENABLE_IRQ; |
176 | link->conf.IntType = INT_MEMORY_AND_IO; | 166 | link->conf.IntType = INT_MEMORY_AND_IO; |
177 | link->conf.Present = PRESENT_OPTION; | 167 | link->conf.Present = PRESENT_OPTION; |
@@ -183,7 +173,7 @@ static int qlogic_probe(struct pcmcia_device *link) | |||
183 | 173 | ||
184 | static void qlogic_detach(struct pcmcia_device *link) | 174 | static void qlogic_detach(struct pcmcia_device *link) |
185 | { | 175 | { |
186 | DEBUG(0, "qlogic_detach(0x%p)\n", link); | 176 | dev_dbg(&link->dev, "qlogic_detach\n"); |
187 | 177 | ||
188 | qlogic_release(link); | 178 | qlogic_release(link); |
189 | kfree(link->priv); | 179 | kfree(link->priv); |
@@ -192,9 +182,6 @@ static void qlogic_detach(struct pcmcia_device *link) | |||
192 | 182 | ||
193 | /*====================================================================*/ | 183 | /*====================================================================*/ |
194 | 184 | ||
195 | #define CS_CHECK(fn, ret) \ | ||
196 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | ||
197 | |||
198 | static int qlogic_config_check(struct pcmcia_device *p_dev, | 185 | static int qlogic_config_check(struct pcmcia_device *p_dev, |
199 | cistpl_cftable_entry_t *cfg, | 186 | cistpl_cftable_entry_t *cfg, |
200 | cistpl_cftable_entry_t *dflt, | 187 | cistpl_cftable_entry_t *dflt, |
@@ -213,19 +200,22 @@ static int qlogic_config_check(struct pcmcia_device *p_dev, | |||
213 | static int qlogic_config(struct pcmcia_device * link) | 200 | static int qlogic_config(struct pcmcia_device * link) |
214 | { | 201 | { |
215 | scsi_info_t *info = link->priv; | 202 | scsi_info_t *info = link->priv; |
216 | int last_ret, last_fn; | 203 | int ret; |
217 | struct Scsi_Host *host; | 204 | struct Scsi_Host *host; |
218 | 205 | ||
219 | DEBUG(0, "qlogic_config(0x%p)\n", link); | 206 | dev_dbg(&link->dev, "qlogic_config\n"); |
220 | 207 | ||
221 | last_ret = pcmcia_loop_config(link, qlogic_config_check, NULL); | 208 | ret = pcmcia_loop_config(link, qlogic_config_check, NULL); |
222 | if (last_ret) { | 209 | if (ret) |
223 | cs_error(link, RequestIO, last_ret); | 210 | goto failed; |
211 | |||
212 | ret = pcmcia_request_irq(link, &link->irq); | ||
213 | if (ret) | ||
224 | goto failed; | 214 | goto failed; |
225 | } | ||
226 | 215 | ||
227 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); | 216 | ret = pcmcia_request_configuration(link, &link->conf); |
228 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); | 217 | if (ret) |
218 | goto failed; | ||
229 | 219 | ||
230 | if ((info->manf_id == MANFID_MACNICA) || (info->manf_id == MANFID_PIONEER) || (info->manf_id == 0x0098)) { | 220 | if ((info->manf_id == MANFID_MACNICA) || (info->manf_id == MANFID_PIONEER) || (info->manf_id == 0x0098)) { |
231 | /* set ATAcmd */ | 221 | /* set ATAcmd */ |
@@ -244,7 +234,7 @@ static int qlogic_config(struct pcmcia_device * link) | |||
244 | 234 | ||
245 | if (!host) { | 235 | if (!host) { |
246 | printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name); | 236 | printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name); |
247 | goto cs_failed; | 237 | goto failed; |
248 | } | 238 | } |
249 | 239 | ||
250 | sprintf(info->node.dev_name, "scsi%d", host->host_no); | 240 | sprintf(info->node.dev_name, "scsi%d", host->host_no); |
@@ -253,12 +243,9 @@ static int qlogic_config(struct pcmcia_device * link) | |||
253 | 243 | ||
254 | return 0; | 244 | return 0; |
255 | 245 | ||
256 | cs_failed: | ||
257 | cs_error(link, last_fn, last_ret); | ||
258 | pcmcia_disable_device(link); | ||
259 | failed: | 246 | failed: |
247 | pcmcia_disable_device(link); | ||
260 | return -ENODEV; | 248 | return -ENODEV; |
261 | |||
262 | } /* qlogic_config */ | 249 | } /* qlogic_config */ |
263 | 250 | ||
264 | /*====================================================================*/ | 251 | /*====================================================================*/ |
@@ -267,7 +254,7 @@ static void qlogic_release(struct pcmcia_device *link) | |||
267 | { | 254 | { |
268 | scsi_info_t *info = link->priv; | 255 | scsi_info_t *info = link->priv; |
269 | 256 | ||
270 | DEBUG(0, "qlogic_release(0x%p)\n", link); | 257 | dev_dbg(&link->dev, "qlogic_release\n"); |
271 | 258 | ||
272 | scsi_remove_host(info->host); | 259 | scsi_remove_host(info->host); |
273 | 260 | ||
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c index b330c11a1752..e7564d8f0cbf 100644 --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c | |||
@@ -77,17 +77,6 @@ | |||
77 | #include <pcmcia/ds.h> | 77 | #include <pcmcia/ds.h> |
78 | #include <pcmcia/ciscode.h> | 78 | #include <pcmcia/ciscode.h> |
79 | 79 | ||
80 | /* ================================================================== */ | ||
81 | |||
82 | #ifdef PCMCIA_DEBUG | ||
83 | static int pc_debug = PCMCIA_DEBUG; | ||
84 | module_param(pc_debug, int, 0); | ||
85 | #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) | ||
86 | static char *version = | ||
87 | "sym53c500_cs.c 0.9c 2004/10/27 (Bob Tracy)"; | ||
88 | #else | ||
89 | #define DEBUG(n, args...) | ||
90 | #endif | ||
91 | 80 | ||
92 | /* ================================================================== */ | 81 | /* ================================================================== */ |
93 | 82 | ||
@@ -525,7 +514,7 @@ SYM53C500_release(struct pcmcia_device *link) | |||
525 | struct scsi_info_t *info = link->priv; | 514 | struct scsi_info_t *info = link->priv; |
526 | struct Scsi_Host *shost = info->host; | 515 | struct Scsi_Host *shost = info->host; |
527 | 516 | ||
528 | DEBUG(0, "SYM53C500_release(0x%p)\n", link); | 517 | dev_dbg(&link->dev, "SYM53C500_release\n"); |
529 | 518 | ||
530 | /* | 519 | /* |
531 | * Do this before releasing/freeing resources. | 520 | * Do this before releasing/freeing resources. |
@@ -697,9 +686,6 @@ static struct scsi_host_template sym53c500_driver_template = { | |||
697 | .shost_attrs = SYM53C500_shost_attrs | 686 | .shost_attrs = SYM53C500_shost_attrs |
698 | }; | 687 | }; |
699 | 688 | ||
700 | #define CS_CHECK(fn, ret) \ | ||
701 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | ||
702 | |||
703 | static int SYM53C500_config_check(struct pcmcia_device *p_dev, | 689 | static int SYM53C500_config_check(struct pcmcia_device *p_dev, |
704 | cistpl_cftable_entry_t *cfg, | 690 | cistpl_cftable_entry_t *cfg, |
705 | cistpl_cftable_entry_t *dflt, | 691 | cistpl_cftable_entry_t *dflt, |
@@ -719,24 +705,27 @@ static int | |||
719 | SYM53C500_config(struct pcmcia_device *link) | 705 | SYM53C500_config(struct pcmcia_device *link) |
720 | { | 706 | { |
721 | struct scsi_info_t *info = link->priv; | 707 | struct scsi_info_t *info = link->priv; |
722 | int last_ret, last_fn; | 708 | int ret; |
723 | int irq_level, port_base; | 709 | int irq_level, port_base; |
724 | struct Scsi_Host *host; | 710 | struct Scsi_Host *host; |
725 | struct scsi_host_template *tpnt = &sym53c500_driver_template; | 711 | struct scsi_host_template *tpnt = &sym53c500_driver_template; |
726 | struct sym53c500_data *data; | 712 | struct sym53c500_data *data; |
727 | 713 | ||
728 | DEBUG(0, "SYM53C500_config(0x%p)\n", link); | 714 | dev_dbg(&link->dev, "SYM53C500_config\n"); |
729 | 715 | ||
730 | info->manf_id = link->manf_id; | 716 | info->manf_id = link->manf_id; |
731 | 717 | ||
732 | last_ret = pcmcia_loop_config(link, SYM53C500_config_check, NULL); | 718 | ret = pcmcia_loop_config(link, SYM53C500_config_check, NULL); |
733 | if (last_ret) { | 719 | if (ret) |
734 | cs_error(link, RequestIO, last_ret); | 720 | goto failed; |
721 | |||
722 | ret = pcmcia_request_irq(link, &link->irq); | ||
723 | if (ret) | ||
735 | goto failed; | 724 | goto failed; |
736 | } | ||
737 | 725 | ||
738 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); | 726 | ret = pcmcia_request_configuration(link, &link->conf); |
739 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); | 727 | if (ret) |
728 | goto failed; | ||
740 | 729 | ||
741 | /* | 730 | /* |
742 | * That's the trouble with copying liberally from another driver. | 731 | * That's the trouble with copying liberally from another driver. |
@@ -824,8 +813,6 @@ err_release: | |||
824 | printk(KERN_INFO "sym53c500_cs: no SCSI devices found\n"); | 813 | printk(KERN_INFO "sym53c500_cs: no SCSI devices found\n"); |
825 | return -ENODEV; | 814 | return -ENODEV; |
826 | 815 | ||
827 | cs_failed: | ||
828 | cs_error(link, last_fn, last_ret); | ||
829 | failed: | 816 | failed: |
830 | SYM53C500_release(link); | 817 | SYM53C500_release(link); |
831 | return -ENODEV; | 818 | return -ENODEV; |
@@ -855,7 +842,7 @@ static int sym53c500_resume(struct pcmcia_device *link) | |||
855 | static void | 842 | static void |
856 | SYM53C500_detach(struct pcmcia_device *link) | 843 | SYM53C500_detach(struct pcmcia_device *link) |
857 | { | 844 | { |
858 | DEBUG(0, "SYM53C500_detach(0x%p)\n", link); | 845 | dev_dbg(&link->dev, "SYM53C500_detach\n"); |
859 | 846 | ||
860 | SYM53C500_release(link); | 847 | SYM53C500_release(link); |
861 | 848 | ||
@@ -868,7 +855,7 @@ SYM53C500_probe(struct pcmcia_device *link) | |||
868 | { | 855 | { |
869 | struct scsi_info_t *info; | 856 | struct scsi_info_t *info; |
870 | 857 | ||
871 | DEBUG(0, "SYM53C500_attach()\n"); | 858 | dev_dbg(&link->dev, "SYM53C500_attach()\n"); |
872 | 859 | ||
873 | /* Create new SCSI device */ | 860 | /* Create new SCSI device */ |
874 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 861 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
@@ -880,7 +867,6 @@ SYM53C500_probe(struct pcmcia_device *link) | |||
880 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 867 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; |
881 | link->io.IOAddrLines = 10; | 868 | link->io.IOAddrLines = 10; |
882 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; | 869 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; |
883 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; | ||
884 | link->conf.Attributes = CONF_ENABLE_IRQ; | 870 | link->conf.Attributes = CONF_ENABLE_IRQ; |
885 | link->conf.IntType = INT_MEMORY_AND_IO; | 871 | link->conf.IntType = INT_MEMORY_AND_IO; |
886 | 872 | ||
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index 86d158ee3572..4874dd62a62f 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c | |||
@@ -1076,7 +1076,7 @@ static struct pmcraid_cmd *pmcraid_init_hcam | |||
1076 | 1076 | ||
1077 | ioarcb->data_transfer_length = cpu_to_le32(rcb_size); | 1077 | ioarcb->data_transfer_length = cpu_to_le32(rcb_size); |
1078 | 1078 | ||
1079 | ioadl[0].flags |= cpu_to_le32(IOADL_FLAGS_READ_LAST); | 1079 | ioadl[0].flags |= IOADL_FLAGS_READ_LAST; |
1080 | ioadl[0].data_len = cpu_to_le32(rcb_size); | 1080 | ioadl[0].data_len = cpu_to_le32(rcb_size); |
1081 | ioadl[0].address = cpu_to_le32(dma); | 1081 | ioadl[0].address = cpu_to_le32(dma); |
1082 | 1082 | ||
@@ -2256,7 +2256,7 @@ static void pmcraid_request_sense(struct pmcraid_cmd *cmd) | |||
2256 | 2256 | ||
2257 | ioadl->address = cpu_to_le64(cmd->sense_buffer_dma); | 2257 | ioadl->address = cpu_to_le64(cmd->sense_buffer_dma); |
2258 | ioadl->data_len = cpu_to_le32(SCSI_SENSE_BUFFERSIZE); | 2258 | ioadl->data_len = cpu_to_le32(SCSI_SENSE_BUFFERSIZE); |
2259 | ioadl->flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC); | 2259 | ioadl->flags = IOADL_FLAGS_LAST_DESC; |
2260 | 2260 | ||
2261 | /* request sense might be called as part of error response processing | 2261 | /* request sense might be called as part of error response processing |
2262 | * which runs in tasklets context. It is possible that mid-layer might | 2262 | * which runs in tasklets context. It is possible that mid-layer might |
@@ -3022,7 +3022,7 @@ static int pmcraid_build_ioadl( | |||
3022 | ioadl[i].flags = 0; | 3022 | ioadl[i].flags = 0; |
3023 | } | 3023 | } |
3024 | /* setup last descriptor */ | 3024 | /* setup last descriptor */ |
3025 | ioadl[i - 1].flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC); | 3025 | ioadl[i - 1].flags = IOADL_FLAGS_LAST_DESC; |
3026 | 3026 | ||
3027 | return 0; | 3027 | return 0; |
3028 | } | 3028 | } |
@@ -3392,7 +3392,7 @@ static int pmcraid_build_passthrough_ioadls( | |||
3392 | } | 3392 | } |
3393 | 3393 | ||
3394 | /* setup the last descriptor */ | 3394 | /* setup the last descriptor */ |
3395 | ioadl[i - 1].flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC); | 3395 | ioadl[i - 1].flags = IOADL_FLAGS_LAST_DESC; |
3396 | 3396 | ||
3397 | return 0; | 3397 | return 0; |
3398 | } | 3398 | } |
@@ -5319,7 +5319,7 @@ static void pmcraid_querycfg(struct pmcraid_cmd *cmd) | |||
5319 | cpu_to_le32(sizeof(struct pmcraid_config_table)); | 5319 | cpu_to_le32(sizeof(struct pmcraid_config_table)); |
5320 | 5320 | ||
5321 | ioadl = &(ioarcb->add_data.u.ioadl[0]); | 5321 | ioadl = &(ioarcb->add_data.u.ioadl[0]); |
5322 | ioadl->flags = cpu_to_le32(IOADL_FLAGS_LAST_DESC); | 5322 | ioadl->flags = IOADL_FLAGS_LAST_DESC; |
5323 | ioadl->address = cpu_to_le64(pinstance->cfg_table_bus_addr); | 5323 | ioadl->address = cpu_to_le64(pinstance->cfg_table_bus_addr); |
5324 | ioadl->data_len = cpu_to_le32(sizeof(struct pmcraid_config_table)); | 5324 | ioadl->data_len = cpu_to_le32(sizeof(struct pmcraid_config_table)); |
5325 | 5325 | ||
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 50526fa207e5..012f73a96880 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -955,16 +955,6 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result, | |||
955 | return SCSI_SCAN_LUN_PRESENT; | 955 | return SCSI_SCAN_LUN_PRESENT; |
956 | } | 956 | } |
957 | 957 | ||
958 | static inline void scsi_destroy_sdev(struct scsi_device *sdev) | ||
959 | { | ||
960 | scsi_device_set_state(sdev, SDEV_DEL); | ||
961 | if (sdev->host->hostt->slave_destroy) | ||
962 | sdev->host->hostt->slave_destroy(sdev); | ||
963 | transport_destroy_device(&sdev->sdev_gendev); | ||
964 | put_device(&sdev->sdev_dev); | ||
965 | put_device(&sdev->sdev_gendev); | ||
966 | } | ||
967 | |||
968 | #ifdef CONFIG_SCSI_LOGGING | 958 | #ifdef CONFIG_SCSI_LOGGING |
969 | /** | 959 | /** |
970 | * scsi_inq_str - print INQUIRY data from min to max index, strip trailing whitespace | 960 | * scsi_inq_str - print INQUIRY data from min to max index, strip trailing whitespace |
@@ -1142,7 +1132,7 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget, | |||
1142 | } | 1132 | } |
1143 | } | 1133 | } |
1144 | } else | 1134 | } else |
1145 | scsi_destroy_sdev(sdev); | 1135 | __scsi_remove_device(sdev); |
1146 | out: | 1136 | out: |
1147 | return res; | 1137 | return res; |
1148 | } | 1138 | } |
@@ -1503,7 +1493,7 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags, | |||
1503 | /* | 1493 | /* |
1504 | * the sdev we used didn't appear in the report luns scan | 1494 | * the sdev we used didn't appear in the report luns scan |
1505 | */ | 1495 | */ |
1506 | scsi_destroy_sdev(sdev); | 1496 | __scsi_remove_device(sdev); |
1507 | return ret; | 1497 | return ret; |
1508 | } | 1498 | } |
1509 | 1499 | ||
@@ -1713,7 +1703,7 @@ static void scsi_sysfs_add_devices(struct Scsi_Host *shost) | |||
1713 | shost_for_each_device(sdev, shost) { | 1703 | shost_for_each_device(sdev, shost) { |
1714 | if (!scsi_host_scan_allowed(shost) || | 1704 | if (!scsi_host_scan_allowed(shost) || |
1715 | scsi_sysfs_add_sdev(sdev) != 0) | 1705 | scsi_sysfs_add_sdev(sdev) != 0) |
1716 | scsi_destroy_sdev(sdev); | 1706 | __scsi_remove_device(sdev); |
1717 | } | 1707 | } |
1718 | } | 1708 | } |
1719 | 1709 | ||
@@ -1946,7 +1936,7 @@ void scsi_free_host_dev(struct scsi_device *sdev) | |||
1946 | { | 1936 | { |
1947 | BUG_ON(sdev->id != sdev->host->this_id); | 1937 | BUG_ON(sdev->id != sdev->host->this_id); |
1948 | 1938 | ||
1949 | scsi_destroy_sdev(sdev); | 1939 | __scsi_remove_device(sdev); |
1950 | } | 1940 | } |
1951 | EXPORT_SYMBOL(scsi_free_host_dev); | 1941 | EXPORT_SYMBOL(scsi_free_host_dev); |
1952 | 1942 | ||
diff --git a/drivers/scsi/scsi_sysctl.c b/drivers/scsi/scsi_sysctl.c index 63a30f566f3a..2b6b93f7d8ef 100644 --- a/drivers/scsi/scsi_sysctl.c +++ b/drivers/scsi/scsi_sysctl.c | |||
@@ -13,26 +13,23 @@ | |||
13 | 13 | ||
14 | 14 | ||
15 | static ctl_table scsi_table[] = { | 15 | static ctl_table scsi_table[] = { |
16 | { .ctl_name = DEV_SCSI_LOGGING_LEVEL, | 16 | { .procname = "logging_level", |
17 | .procname = "logging_level", | ||
18 | .data = &scsi_logging_level, | 17 | .data = &scsi_logging_level, |
19 | .maxlen = sizeof(scsi_logging_level), | 18 | .maxlen = sizeof(scsi_logging_level), |
20 | .mode = 0644, | 19 | .mode = 0644, |
21 | .proc_handler = &proc_dointvec }, | 20 | .proc_handler = proc_dointvec }, |
22 | { } | 21 | { } |
23 | }; | 22 | }; |
24 | 23 | ||
25 | static ctl_table scsi_dir_table[] = { | 24 | static ctl_table scsi_dir_table[] = { |
26 | { .ctl_name = DEV_SCSI, | 25 | { .procname = "scsi", |
27 | .procname = "scsi", | ||
28 | .mode = 0555, | 26 | .mode = 0555, |
29 | .child = scsi_table }, | 27 | .child = scsi_table }, |
30 | { } | 28 | { } |
31 | }; | 29 | }; |
32 | 30 | ||
33 | static ctl_table scsi_root_table[] = { | 31 | static ctl_table scsi_root_table[] = { |
34 | { .ctl_name = CTL_DEV, | 32 | { .procname = "dev", |
35 | .procname = "dev", | ||
36 | .mode = 0555, | 33 | .mode = 0555, |
37 | .child = scsi_dir_table }, | 34 | .child = scsi_dir_table }, |
38 | { } | 35 | { } |
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 758598ff3b90..5a065055e68a 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -888,15 +888,17 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev) | |||
888 | transport_configure_device(&starget->dev); | 888 | transport_configure_device(&starget->dev); |
889 | error = device_add(&sdev->sdev_gendev); | 889 | error = device_add(&sdev->sdev_gendev); |
890 | if (error) { | 890 | if (error) { |
891 | put_device(sdev->sdev_gendev.parent); | ||
892 | printk(KERN_INFO "error 1\n"); | 891 | printk(KERN_INFO "error 1\n"); |
893 | return error; | 892 | goto out_remove; |
894 | } | 893 | } |
895 | error = device_add(&sdev->sdev_dev); | 894 | error = device_add(&sdev->sdev_dev); |
896 | if (error) { | 895 | if (error) { |
897 | printk(KERN_INFO "error 2\n"); | 896 | printk(KERN_INFO "error 2\n"); |
898 | goto clean_device; | 897 | device_del(&sdev->sdev_gendev); |
898 | goto out_remove; | ||
899 | } | 899 | } |
900 | transport_add_device(&sdev->sdev_gendev); | ||
901 | sdev->is_visible = 1; | ||
900 | 902 | ||
901 | /* create queue files, which may be writable, depending on the host */ | 903 | /* create queue files, which may be writable, depending on the host */ |
902 | if (sdev->host->hostt->change_queue_depth) { | 904 | if (sdev->host->hostt->change_queue_depth) { |
@@ -907,67 +909,56 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev) | |||
907 | } | 909 | } |
908 | else | 910 | else |
909 | error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_depth); | 911 | error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_depth); |
910 | if (error) { | 912 | if (error) |
911 | __scsi_remove_device(sdev); | 913 | goto out_remove; |
912 | goto out; | 914 | |
913 | } | ||
914 | if (sdev->host->hostt->change_queue_type) | 915 | if (sdev->host->hostt->change_queue_type) |
915 | error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_type_rw); | 916 | error = device_create_file(&sdev->sdev_gendev, &sdev_attr_queue_type_rw); |
916 | else | 917 | else |
917 | error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_type); | 918 | error = device_create_file(&sdev->sdev_gendev, &dev_attr_queue_type); |
918 | if (error) { | 919 | if (error) |
919 | __scsi_remove_device(sdev); | 920 | goto out_remove; |
920 | goto out; | ||
921 | } | ||
922 | 921 | ||
923 | error = bsg_register_queue(rq, &sdev->sdev_gendev, NULL, NULL); | 922 | error = bsg_register_queue(rq, &sdev->sdev_gendev, NULL, NULL); |
924 | 923 | ||
925 | if (error) | 924 | if (error) |
925 | /* we're treating error on bsg register as non-fatal, | ||
926 | * so pretend nothing went wrong */ | ||
926 | sdev_printk(KERN_INFO, sdev, | 927 | sdev_printk(KERN_INFO, sdev, |
927 | "Failed to register bsg queue, errno=%d\n", error); | 928 | "Failed to register bsg queue, errno=%d\n", error); |
928 | 929 | ||
929 | /* we're treating error on bsg register as non-fatal, so pretend | ||
930 | * nothing went wrong */ | ||
931 | error = 0; | ||
932 | |||
933 | /* add additional host specific attributes */ | 930 | /* add additional host specific attributes */ |
934 | if (sdev->host->hostt->sdev_attrs) { | 931 | if (sdev->host->hostt->sdev_attrs) { |
935 | for (i = 0; sdev->host->hostt->sdev_attrs[i]; i++) { | 932 | for (i = 0; sdev->host->hostt->sdev_attrs[i]; i++) { |
936 | error = device_create_file(&sdev->sdev_gendev, | 933 | error = device_create_file(&sdev->sdev_gendev, |
937 | sdev->host->hostt->sdev_attrs[i]); | 934 | sdev->host->hostt->sdev_attrs[i]); |
938 | if (error) { | 935 | if (error) |
939 | __scsi_remove_device(sdev); | 936 | goto out_remove; |
940 | goto out; | ||
941 | } | ||
942 | } | 937 | } |
943 | } | 938 | } |
944 | 939 | ||
945 | transport_add_device(&sdev->sdev_gendev); | 940 | return 0; |
946 | out: | ||
947 | return error; | ||
948 | |||
949 | clean_device: | ||
950 | scsi_device_set_state(sdev, SDEV_CANCEL); | ||
951 | |||
952 | device_del(&sdev->sdev_gendev); | ||
953 | transport_destroy_device(&sdev->sdev_gendev); | ||
954 | put_device(&sdev->sdev_dev); | ||
955 | put_device(&sdev->sdev_gendev); | ||
956 | 941 | ||
942 | out_remove: | ||
943 | __scsi_remove_device(sdev); | ||
957 | return error; | 944 | return error; |
945 | |||
958 | } | 946 | } |
959 | 947 | ||
960 | void __scsi_remove_device(struct scsi_device *sdev) | 948 | void __scsi_remove_device(struct scsi_device *sdev) |
961 | { | 949 | { |
962 | struct device *dev = &sdev->sdev_gendev; | 950 | struct device *dev = &sdev->sdev_gendev; |
963 | 951 | ||
964 | if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0) | 952 | if (sdev->is_visible) { |
965 | return; | 953 | if (scsi_device_set_state(sdev, SDEV_CANCEL) != 0) |
954 | return; | ||
966 | 955 | ||
967 | bsg_unregister_queue(sdev->request_queue); | 956 | bsg_unregister_queue(sdev->request_queue); |
968 | device_unregister(&sdev->sdev_dev); | 957 | device_unregister(&sdev->sdev_dev); |
969 | transport_remove_device(dev); | 958 | transport_remove_device(dev); |
970 | device_del(dev); | 959 | device_del(dev); |
960 | } else | ||
961 | put_device(&sdev->sdev_dev); | ||
971 | scsi_device_set_state(sdev, SDEV_DEL); | 962 | scsi_device_set_state(sdev, SDEV_DEL); |
972 | if (sdev->host->hostt->slave_destroy) | 963 | if (sdev->host->hostt->slave_destroy) |
973 | sdev->host->hostt->slave_destroy(sdev); | 964 | sdev->host->hostt->slave_destroy(sdev); |
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 600502aa3b61..6531c91501be 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c | |||
@@ -3698,6 +3698,7 @@ fc_bsg_host_dispatch(struct request_queue *q, struct Scsi_Host *shost, | |||
3698 | fail_host_msg: | 3698 | fail_host_msg: |
3699 | /* return the errno failure code as the only status */ | 3699 | /* return the errno failure code as the only status */ |
3700 | BUG_ON(job->reply_len < sizeof(uint32_t)); | 3700 | BUG_ON(job->reply_len < sizeof(uint32_t)); |
3701 | job->reply->reply_payload_rcv_len = 0; | ||
3701 | job->reply->result = ret; | 3702 | job->reply->result = ret; |
3702 | job->reply_len = sizeof(uint32_t); | 3703 | job->reply_len = sizeof(uint32_t); |
3703 | fc_bsg_jobdone(job); | 3704 | fc_bsg_jobdone(job); |
@@ -3783,6 +3784,7 @@ check_bidi: | |||
3783 | fail_rport_msg: | 3784 | fail_rport_msg: |
3784 | /* return the errno failure code as the only status */ | 3785 | /* return the errno failure code as the only status */ |
3785 | BUG_ON(job->reply_len < sizeof(uint32_t)); | 3786 | BUG_ON(job->reply_len < sizeof(uint32_t)); |
3787 | job->reply->reply_payload_rcv_len = 0; | ||
3786 | job->reply->result = ret; | 3788 | job->reply->result = ret; |
3787 | job->reply_len = sizeof(uint32_t); | 3789 | job->reply_len = sizeof(uint32_t); |
3788 | fc_bsg_jobdone(job); | 3790 | fc_bsg_jobdone(job); |
@@ -3840,6 +3842,7 @@ fc_bsg_request_handler(struct request_queue *q, struct Scsi_Host *shost, | |||
3840 | /* check if we have the msgcode value at least */ | 3842 | /* check if we have the msgcode value at least */ |
3841 | if (job->request_len < sizeof(uint32_t)) { | 3843 | if (job->request_len < sizeof(uint32_t)) { |
3842 | BUG_ON(job->reply_len < sizeof(uint32_t)); | 3844 | BUG_ON(job->reply_len < sizeof(uint32_t)); |
3845 | job->reply->reply_payload_rcv_len = 0; | ||
3843 | job->reply->result = -ENOMSG; | 3846 | job->reply->result = -ENOMSG; |
3844 | job->reply_len = sizeof(uint32_t); | 3847 | job->reply_len = sizeof(uint32_t); |
3845 | fc_bsg_jobdone(job); | 3848 | fc_bsg_jobdone(job); |
diff --git a/drivers/scsi/sd_dif.c b/drivers/scsi/sd_dif.c index 88da97745710..84be62149c6c 100644 --- a/drivers/scsi/sd_dif.c +++ b/drivers/scsi/sd_dif.c | |||
@@ -418,7 +418,7 @@ error: | |||
418 | __func__, virt, phys, be32_to_cpu(sdt->ref_tag), | 418 | __func__, virt, phys, be32_to_cpu(sdt->ref_tag), |
419 | be16_to_cpu(sdt->app_tag)); | 419 | be16_to_cpu(sdt->app_tag)); |
420 | 420 | ||
421 | return -EIO; | 421 | return -EILSEQ; |
422 | } | 422 | } |
423 | 423 | ||
424 | /* | 424 | /* |