[SCSI] libsas: don't recover 'gone' devices in sas_ata_hard_reset()
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / scsi / isci / init.c
CommitLineData
6f231dda
DW
1/*
2 * This file is provided under a dual BSD/GPLv2 license. When using or
3 * redistributing this file, you may do so under either license.
4 *
5 * GPL LICENSE SUMMARY
6 *
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21 * The full GNU General Public License is included in this distribution
22 * in the file called LICENSE.GPL.
23 *
24 * BSD LICENSE
25 *
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27 * All rights reserved.
28 *
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
31 * are met:
32 *
33 * * Redistributions of source code must retain the above copyright
34 * notice, this list of conditions and the following disclaimer.
35 * * Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in
37 * the documentation and/or other materials provided with the
38 * distribution.
39 * * Neither the name of Intel Corporation nor the names of its
40 * contributors may be used to endorse or promote products derived
41 * from this software without specific prior written permission.
42 *
43 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
44 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
45 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
46 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
47 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
49 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
50 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
51 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 */
55
56#include <linux/kernel.h>
57#include <linux/init.h>
58#include <linux/module.h>
d044af17
DW
59#include <linux/firmware.h>
60#include <linux/efi.h>
6f231dda 61#include <asm/string.h>
3a7bda83 62#include <scsi/scsi_host.h>
6f231dda
DW
63#include "isci.h"
64#include "task.h"
d044af17 65#include "probe_roms.h"
6f231dda 66
98e2a5a3 67#define MAJ 1
d3fd2e2b 68#define MIN 1
98e2a5a3
DW
69#define BUILD 0
70#define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \
71 __stringify(BUILD)
72
73MODULE_VERSION(DRV_VERSION);
74
6f231dda 75static struct scsi_transport_template *isci_transport_template;
6f231dda
DW
76
77static DEFINE_PCI_DEVICE_TABLE(isci_id_table) = {
78 { PCI_VDEVICE(INTEL, 0x1D61),},
79 { PCI_VDEVICE(INTEL, 0x1D63),},
80 { PCI_VDEVICE(INTEL, 0x1D65),},
81 { PCI_VDEVICE(INTEL, 0x1D67),},
82 { PCI_VDEVICE(INTEL, 0x1D69),},
83 { PCI_VDEVICE(INTEL, 0x1D6B),},
84 { PCI_VDEVICE(INTEL, 0x1D60),},
85 { PCI_VDEVICE(INTEL, 0x1D62),},
86 { PCI_VDEVICE(INTEL, 0x1D64),},
87 { PCI_VDEVICE(INTEL, 0x1D66),},
88 { PCI_VDEVICE(INTEL, 0x1D68),},
89 { PCI_VDEVICE(INTEL, 0x1D6A),},
90 {}
91};
92
6f231dda
DW
93MODULE_DEVICE_TABLE(pci, isci_id_table);
94
6f231dda 95/* linux isci specific settings */
6f231dda 96
6024d38b 97unsigned char no_outbound_task_to = 2;
b5f18a20
DJ
98module_param(no_outbound_task_to, byte, 0);
99MODULE_PARM_DESC(no_outbound_task_to, "No Outbound Task Timeout (1us incr)");
100
101u16 ssp_max_occ_to = 20;
102module_param(ssp_max_occ_to, ushort, 0);
103MODULE_PARM_DESC(ssp_max_occ_to, "SSP Max occupancy timeout (100us incr)");
104
105u16 stp_max_occ_to = 5;
106module_param(stp_max_occ_to, ushort, 0);
107MODULE_PARM_DESC(stp_max_occ_to, "STP Max occupancy timeout (100us incr)");
108
109u16 ssp_inactive_to = 5;
110module_param(ssp_inactive_to, ushort, 0);
111MODULE_PARM_DESC(ssp_inactive_to, "SSP inactivity timeout (100us incr)");
112
113u16 stp_inactive_to = 5;
114module_param(stp_inactive_to, ushort, 0);
115MODULE_PARM_DESC(stp_inactive_to, "STP inactivity timeout (100us incr)");
116
be168a3b 117unsigned char phy_gen = SCIC_SDS_PARM_GEN2_SPEED;
b5f18a20
DJ
118module_param(phy_gen, byte, 0);
119MODULE_PARM_DESC(phy_gen, "PHY generation (1: 1.5Gbps 2: 3.0Gbps 3: 6.0Gbps)");
120
7000f7c7 121unsigned char max_concurr_spinup;
b5f18a20
DJ
122module_param(max_concurr_spinup, byte, 0);
123MODULE_PARM_DESC(max_concurr_spinup, "Max concurrent device spinup");
124
9fee607f
JS
125uint cable_selection_override = CABLE_OVERRIDE_DISABLED;
126module_param(cable_selection_override, uint, 0);
127
128MODULE_PARM_DESC(cable_selection_override,
129 "This field indicates length of the SAS/SATA cable between "
130 "host and device. If any bits > 15 are set (default) "
131 "indicates \"use platform defaults\"");
132
3a7bda83
DJ
133static ssize_t isci_show_id(struct device *dev, struct device_attribute *attr, char *buf)
134{
135 struct Scsi_Host *shost = container_of(dev, typeof(*shost), shost_dev);
136 struct sas_ha_struct *sas_ha = SHOST_TO_SAS_HA(shost);
137 struct isci_host *ihost = container_of(sas_ha, typeof(*ihost), sas_ha);
138
139 return snprintf(buf, PAGE_SIZE, "%d\n", ihost->id);
140}
141
142static DEVICE_ATTR(isci_id, S_IRUGO, isci_show_id, NULL);
143
144struct device_attribute *isci_host_attrs[] = {
145 &dev_attr_isci_id,
146 NULL
147};
148
6f231dda
DW
149static struct scsi_host_template isci_sht = {
150
151 .module = THIS_MODULE,
152 .name = DRV_NAME,
92cd5115 153 .proc_name = DRV_NAME,
6f231dda
DW
154 .queuecommand = sas_queuecommand,
155 .target_alloc = sas_target_alloc,
156 .slave_configure = sas_slave_configure,
6f231dda
DW
157 .scan_finished = isci_host_scan_finished,
158 .scan_start = isci_host_scan_start,
159 .change_queue_depth = sas_change_queue_depth,
160 .change_queue_type = sas_change_queue_type,
161 .bios_param = sas_bios_param,
162 .can_queue = ISCI_CAN_QUEUE_VAL,
163 .cmd_per_lun = 1,
164 .this_id = -1,
165 .sg_tablesize = SG_ALL,
166 .max_sectors = SCSI_DEFAULT_MAX_SECTORS,
167 .use_clustering = ENABLE_CLUSTERING,
168 .eh_device_reset_handler = sas_eh_device_reset_handler,
169 .eh_bus_reset_handler = isci_bus_reset_handler,
170 .slave_alloc = sas_slave_alloc,
171 .target_destroy = sas_target_destroy,
172 .ioctl = sas_ioctl,
3a7bda83 173 .shost_attrs = isci_host_attrs,
6f231dda
DW
174};
175
176static struct sas_domain_function_template isci_transport_ops = {
177
178 /* The class calls these to notify the LLDD of an event. */
179 .lldd_port_formed = isci_port_formed,
180 .lldd_port_deformed = isci_port_deformed,
181
182 /* The class calls these when a device is found or gone. */
183 .lldd_dev_found = isci_remote_device_found,
184 .lldd_dev_gone = isci_remote_device_gone,
185
186 .lldd_execute_task = isci_task_execute_task,
187 /* Task Management Functions. Must be called from process context. */
188 .lldd_abort_task = isci_task_abort_task,
189 .lldd_abort_task_set = isci_task_abort_task_set,
190 .lldd_clear_aca = isci_task_clear_aca,
191 .lldd_clear_task_set = isci_task_clear_task_set,
192 .lldd_I_T_nexus_reset = isci_task_I_T_nexus_reset,
193 .lldd_lu_reset = isci_task_lu_reset,
194 .lldd_query_task = isci_task_query_task,
195
196 /* Port and Adapter management */
197 .lldd_clear_nexus_port = isci_task_clear_nexus_port,
198 .lldd_clear_nexus_ha = isci_task_clear_nexus_ha,
199
200 /* Phy management */
201 .lldd_control_phy = isci_phy_control,
ad4f4c1d
DW
202
203 /* GPIO support */
204 .lldd_write_gpio = isci_gpio_write,
6f231dda
DW
205};
206
207
208/******************************************************************************
209* P R O T E C T E D M E T H O D S
210******************************************************************************/
211
212
213
214/**
215 * isci_register_sas_ha() - This method initializes various lldd
216 * specific members of the sas_ha struct and calls the libsas
217 * sas_register_ha() function.
218 * @isci_host: This parameter specifies the lldd specific wrapper for the
219 * libsas sas_ha struct.
220 *
221 * This method returns an error code indicating sucess or failure. The user
222 * should check for possible memory allocation error return otherwise, a zero
223 * indicates success.
224 */
225static int isci_register_sas_ha(struct isci_host *isci_host)
226{
227 int i;
228 struct sas_ha_struct *sas_ha = &(isci_host->sas_ha);
229 struct asd_sas_phy **sas_phys;
230 struct asd_sas_port **sas_ports;
231
232 sas_phys = devm_kzalloc(&isci_host->pdev->dev,
233 SCI_MAX_PHYS * sizeof(void *),
234 GFP_KERNEL);
235 if (!sas_phys)
236 return -ENOMEM;
237
238 sas_ports = devm_kzalloc(&isci_host->pdev->dev,
239 SCI_MAX_PORTS * sizeof(void *),
240 GFP_KERNEL);
241 if (!sas_ports)
242 return -ENOMEM;
243
244 /*----------------- Libsas Initialization Stuff----------------------
245 * Set various fields in the sas_ha struct:
246 */
247
248 sas_ha->sas_ha_name = DRV_NAME;
249 sas_ha->lldd_module = THIS_MODULE;
150fc6fc 250 sas_ha->sas_addr = &isci_host->phys[0].sas_addr[0];
6f231dda
DW
251
252 /* set the array of phy and port structs. */
253 for (i = 0; i < SCI_MAX_PHYS; i++) {
e531381e
DW
254 sas_phys[i] = &isci_host->phys[i].sas_phy;
255 sas_ports[i] = &isci_host->ports[i].sas_port;
6f231dda
DW
256 }
257
258 sas_ha->sas_phy = sas_phys;
259 sas_ha->sas_port = sas_ports;
260 sas_ha->num_phys = SCI_MAX_PHYS;
261
262 sas_ha->lldd_queue_size = ISCI_CAN_QUEUE_VAL;
263 sas_ha->lldd_max_execute_num = 1;
264 sas_ha->strict_wide_ports = 1;
265
266 sas_register_ha(sas_ha);
267
268 return 0;
269}
270
34cad85d
DW
271static void isci_unregister(struct isci_host *isci_host)
272{
273 struct Scsi_Host *shost;
274
6f231dda
DW
275 if (!isci_host)
276 return;
277
34cad85d 278 shost = isci_host->shost;
34cad85d
DW
279
280 sas_unregister_ha(&isci_host->sas_ha);
6f231dda
DW
281
282 sas_remove_host(isci_host->shost);
283 scsi_remove_host(isci_host->shost);
284 scsi_host_put(isci_host->shost);
285}
286
287static int __devinit isci_pci_init(struct pci_dev *pdev)
288{
cc3dbd0a 289 int err, bar_num, bar_mask = 0;
6f231dda
DW
290 void __iomem * const *iomap;
291
292 err = pcim_enable_device(pdev);
293 if (err) {
294 dev_err(&pdev->dev,
295 "failed enable PCI device %s!\n",
296 pci_name(pdev));
297 return err;
298 }
299
300 for (bar_num = 0; bar_num < SCI_PCI_BAR_COUNT; bar_num++)
301 bar_mask |= 1 << (bar_num * 2);
302
303 err = pcim_iomap_regions(pdev, bar_mask, DRV_NAME);
304 if (err)
305 return err;
306
307 iomap = pcim_iomap_table(pdev);
308 if (!iomap)
309 return -ENOMEM;
310
311 pci_set_master(pdev);
312
313 err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
314 if (err) {
315 err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
316 if (err)
317 return err;
318 }
319
320 err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
321 if (err) {
322 err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
323 if (err)
324 return err;
325 }
326
327 return 0;
328}
329
6f231dda
DW
330static int num_controllers(struct pci_dev *pdev)
331{
332 /* bar size alone can tell us if we are running with a dual controller
333 * part, no need to trust revision ids that might be under broken firmware
334 * control
335 */
336 resource_size_t scu_bar_size = pci_resource_len(pdev, SCI_SCU_BAR*2);
337 resource_size_t smu_bar_size = pci_resource_len(pdev, SCI_SMU_BAR*2);
f942f32e 338
6f231dda
DW
339 if (scu_bar_size >= SCI_SCU_BAR_SIZE*SCI_MAX_CONTROLLERS &&
340 smu_bar_size >= SCI_SMU_BAR_SIZE*SCI_MAX_CONTROLLERS)
341 return SCI_MAX_CONTROLLERS;
342 else
343 return 1;
344}
345
346static int isci_setup_interrupts(struct pci_dev *pdev)
347{
348 int err, i, num_msix;
31e824ed 349 struct isci_host *ihost;
6f231dda
DW
350 struct isci_pci_info *pci_info = to_pci_info(pdev);
351
352 /*
353 * Determine the number of vectors associated with this
354 * PCI function.
355 */
356 num_msix = num_controllers(pdev) * SCI_NUM_MSI_X_INT;
357
358 for (i = 0; i < num_msix; i++)
359 pci_info->msix_entries[i].entry = i;
360
361 err = pci_enable_msix(pdev, pci_info->msix_entries, num_msix);
362 if (err)
363 goto intx;
364
365 for (i = 0; i < num_msix; i++) {
366 int id = i / SCI_NUM_MSI_X_INT;
367 struct msix_entry *msix = &pci_info->msix_entries[i];
92f4f0f5
DW
368 irq_handler_t isr;
369
31e824ed 370 ihost = pci_info->hosts[id];
92f4f0f5
DW
371 /* odd numbered vectors are error interrupts */
372 if (i & 1)
373 isr = isci_error_isr;
374 else
375 isr = isci_msix_isr;
6f231dda 376
92f4f0f5 377 err = devm_request_irq(&pdev->dev, msix->vector, isr, 0,
31e824ed 378 DRV_NAME"-msix", ihost);
6f231dda
DW
379 if (!err)
380 continue;
381
382 dev_info(&pdev->dev, "msix setup failed falling back to intx\n");
383 while (i--) {
384 id = i / SCI_NUM_MSI_X_INT;
31e824ed 385 ihost = pci_info->hosts[id];
6f231dda 386 msix = &pci_info->msix_entries[i];
31e824ed 387 devm_free_irq(&pdev->dev, msix->vector, ihost);
6f231dda
DW
388 }
389 pci_disable_msix(pdev);
390 goto intx;
391 }
6f231dda
DW
392 return 0;
393
394 intx:
31e824ed
DW
395 for_each_isci_host(i, ihost, pdev) {
396 err = devm_request_irq(&pdev->dev, pdev->irq, isci_intx_isr,
397 IRQF_SHARED, DRV_NAME"-intx", ihost);
398 if (err)
399 break;
400 }
6f231dda
DW
401 return err;
402}
403
6f231dda
DW
404static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id)
405{
406 struct isci_host *isci_host;
407 struct Scsi_Host *shost;
408 int err;
409
57f20f4e 410 isci_host = devm_kzalloc(&pdev->dev, sizeof(*isci_host), GFP_KERNEL);
6f231dda
DW
411 if (!isci_host)
412 return NULL;
413
414 isci_host->pdev = pdev;
415 isci_host->id = id;
416
417 shost = scsi_host_alloc(&isci_sht, sizeof(void *));
418 if (!shost)
419 return NULL;
420 isci_host->shost = shost;
421
9fee607f
JS
422 dev_info(&pdev->dev, "%sSCU controller %d: phy 3-0 cables: "
423 "{%s, %s, %s, %s}\n",
424 (is_cable_select_overridden() ? "* " : ""), isci_host->id,
425 lookup_cable_names(decode_cable_selection(isci_host, 3)),
426 lookup_cable_names(decode_cable_selection(isci_host, 2)),
427 lookup_cable_names(decode_cable_selection(isci_host, 1)),
428 lookup_cable_names(decode_cable_selection(isci_host, 0)));
429
6f231dda
DW
430 err = isci_host_init(isci_host);
431 if (err)
432 goto err_shost;
433
434 SHOST_TO_SAS_HA(shost) = &isci_host->sas_ha;
435 isci_host->sas_ha.core.shost = shost;
436 shost->transportt = isci_transport_template;
437
438 shost->max_id = ~0;
439 shost->max_lun = ~0;
440 shost->max_cmd_len = MAX_COMMAND_SIZE;
441
442 err = scsi_add_host(shost, &pdev->dev);
443 if (err)
444 goto err_shost;
445
446 err = isci_register_sas_ha(isci_host);
447 if (err)
448 goto err_shost_remove;
449
450 return isci_host;
451
452 err_shost_remove:
453 scsi_remove_host(shost);
454 err_shost:
455 scsi_host_put(shost);
456
457 return NULL;
458}
459
6f231dda
DW
460static int __devinit isci_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
461{
462 struct isci_pci_info *pci_info;
463 int err, i;
464 struct isci_host *isci_host;
858d4aa7 465 const struct firmware *fw = NULL;
d37ee7e8 466 struct isci_orom *orom = NULL;
4711ba10 467 char *source = "(platform)";
6f231dda 468
dc00c8b6
DW
469 dev_info(&pdev->dev, "driver configured for rev: %d silicon\n",
470 pdev->revision);
6f231dda
DW
471
472 pci_info = devm_kzalloc(&pdev->dev, sizeof(*pci_info), GFP_KERNEL);
473 if (!pci_info)
474 return -ENOMEM;
475 pci_set_drvdata(pdev, pci_info);
476
8db37aab
DJ
477 if (efi_enabled)
478 orom = isci_get_efi_var(pdev);
d37ee7e8
DW
479
480 if (!orom)
d044af17
DW
481 orom = isci_request_oprom(pdev);
482
2d70de5a 483 for (i = 0; orom && i < ARRAY_SIZE(orom->ctrl); i++) {
594e566a
DJ
484 if (sci_oem_parameters_validate(&orom->ctrl[i],
485 orom->hdr.version)) {
2d70de5a
DW
486 dev_warn(&pdev->dev,
487 "[%d]: invalid oem parameters detected, falling back to firmware\n", i);
488 devm_kfree(&pdev->dev, orom);
489 orom = NULL;
490 break;
491 }
492 }
493
d044af17 494 if (!orom) {
4711ba10 495 source = "(firmware)";
d044af17
DW
496 orom = isci_request_firmware(pdev, fw);
497 if (!orom) {
498 /* TODO convert this to WARN_TAINT_ONCE once the
499 * orom/efi parameter support is widely available
500 */
501 dev_warn(&pdev->dev,
502 "Loading user firmware failed, using default "
503 "values\n");
504 dev_warn(&pdev->dev,
505 "Default OEM configuration being used: 4 "
506 "narrow ports, and default SAS Addresses\n");
858d4aa7 507 }
858d4aa7
DJ
508 }
509
d044af17 510 if (orom)
3b67c1f3 511 dev_info(&pdev->dev,
4711ba10 512 "OEM SAS parameters (version: %u.%u) loaded %s\n",
3b67c1f3 513 (orom->hdr.version & 0xf0) >> 4,
4711ba10 514 (orom->hdr.version & 0xf), source);
3b67c1f3 515
d044af17
DW
516 pci_info->orom = orom;
517
6f231dda
DW
518 err = isci_pci_init(pdev);
519 if (err)
520 return err;
521
522 for (i = 0; i < num_controllers(pdev); i++) {
523 struct isci_host *h = isci_host_alloc(pdev, i);
524
525 if (!h) {
526 err = -ENOMEM;
527 goto err_host_alloc;
528 }
b329aff1 529 pci_info->hosts[i] = h;
3d2d7525
DJ
530
531 /* turn on DIF support */
532 scsi_host_set_prot(h->shost,
533 SHOST_DIF_TYPE1_PROTECTION |
534 SHOST_DIF_TYPE2_PROTECTION |
535 SHOST_DIF_TYPE3_PROTECTION);
536 scsi_host_set_guard(h->shost, SHOST_DIX_GUARD_CRC);
6f231dda
DW
537 }
538
539 err = isci_setup_interrupts(pdev);
540 if (err)
541 goto err_host_alloc;
542
b329aff1 543 for_each_isci_host(i, isci_host, pdev)
6f231dda
DW
544 scsi_scan_host(isci_host->shost);
545
546 return 0;
547
548 err_host_alloc:
b329aff1 549 for_each_isci_host(i, isci_host, pdev)
34cad85d 550 isci_unregister(isci_host);
6f231dda
DW
551 return err;
552}
553
554static void __devexit isci_pci_remove(struct pci_dev *pdev)
555{
d9dcb4ba 556 struct isci_host *ihost;
b329aff1 557 int i;
6f231dda 558
d9dcb4ba
DW
559 for_each_isci_host(i, ihost, pdev) {
560 isci_unregister(ihost);
561 isci_host_deinit(ihost);
89a7301f 562 sci_controller_disable_interrupts(ihost);
6f231dda
DW
563 }
564}
565
f942f32e
DW
566static struct pci_driver isci_pci_driver = {
567 .name = DRV_NAME,
568 .id_table = isci_id_table,
569 .probe = isci_pci_probe,
570 .remove = __devexit_p(isci_pci_remove),
571};
572
6f231dda
DW
573static __init int isci_init(void)
574{
d9c37390 575 int err;
6f231dda 576
98e2a5a3
DW
577 pr_info("%s: Intel(R) C600 SAS Controller Driver - version %s\n",
578 DRV_NAME, DRV_VERSION);
6f231dda 579
6f231dda
DW
580 isci_transport_template = sas_domain_attach_transport(&isci_transport_ops);
581 if (!isci_transport_template)
d9c37390 582 return -ENOMEM;
6f231dda
DW
583
584 err = pci_register_driver(&isci_pci_driver);
585 if (err)
d9c37390 586 sas_release_transport(isci_transport_template);
6f231dda
DW
587
588 return err;
589}
590
591static __exit void isci_exit(void)
592{
593 pci_unregister_driver(&isci_pci_driver);
594 sas_release_transport(isci_transport_template);
6f231dda
DW
595}
596
597MODULE_LICENSE("Dual BSD/GPL");
598MODULE_FIRMWARE(ISCI_FW_NAME);
599module_init(isci_init);
600module_exit(isci_exit);