Skip to content

Commit e760e71

Browse files
author
Linus Torvalds
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: [SCSI] gdth: update deprecated pci_find_device [SCSI] gdth: scan for scsi devices [SCSI] sym53c416: fix module parameters [SCSI] lpfc 8.2.5 : Update lpfc driver version to 8.2.5 [SCSI] lpfc 8.2.5 : Fix buffer leaks [SCSI] lpfc 8.2.5 : Miscellaneous discovery Fixes [SCSI] lpfc 8.2.5 : Add MSI-X single message support [SCSI] lpfc 8.2.5 : Miscellaneous Fixes [SCSI] lpfc 8.2.5 : Correct ndlp referencing issues [SCSI] update SG_ALL to avoid causing chaining [SCSI] aic94xx: fix ABORT_TASK define conflict [SCSI] fas216: Use scsi_eh API for REQUEST_SENSE invocation [SCSI] ses: fix memory leaks [SCSI] aacraid: informational sysfs value corrections [SCSI] mpt fusion: Request I/O resources only when required [SCSI] aacraid: ignore adapter reset check polarity [SCSI] aacraid: add optional MSI support [SCSI] mpt fusion: Avoid racing when mptsas and mptcl module are loaded in parallel [SCSI] MegaRAID driver management char device moved to misc [SCSI] advansys: fix overrun_buf aligned bug
2 parents b2e3e65 + 9910930 commit e760e71

36 files changed

Lines changed: 1232 additions & 370 deletions

‎drivers/message/fusion/mptbase.c‎

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,9 +1470,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
14701470
if (mpt_debug_level)
14711471
printk(KERN_INFO MYNAM ": mpt_debug_level=%xh\n", mpt_debug_level);
14721472

1473-
if (pci_enable_device(pdev))
1474-
return r;
1475-
14761473
ioc = kzalloc(sizeof(MPT_ADAPTER), GFP_ATOMIC);
14771474
if (ioc == NULL) {
14781475
printk(KERN_ERR MYNAM ": ERROR - Insufficient memory to add adapter!\n");
@@ -1482,6 +1479,20 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
14821479
ioc->id = mpt_ids++;
14831480
sprintf(ioc->name, "ioc%d", ioc->id);
14841481

1482+
ioc->bars = pci_select_bars(pdev, IORESOURCE_MEM);
1483+
if (pci_enable_device_mem(pdev)) {
1484+
kfree(ioc);
1485+
printk(MYIOC_s_ERR_FMT "pci_enable_device_mem() "
1486+
"failed\n", ioc->name);
1487+
return r;
1488+
}
1489+
if (pci_request_selected_regions(pdev, ioc->bars, "mpt")) {
1490+
kfree(ioc);
1491+
printk(MYIOC_s_ERR_FMT "pci_request_selected_regions() with "
1492+
"MEM failed\n", ioc->name);
1493+
return r;
1494+
}
1495+
14851496
dinitprintk(ioc, printk(MYIOC_s_INFO_FMT ": mpt_adapter_install\n", ioc->name));
14861497

14871498
if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
@@ -1658,6 +1669,9 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
16581669
ioc->active = 0;
16591670
CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
16601671

1672+
/* Set IOC ptr in the pcidev's driver data. */
1673+
pci_set_drvdata(ioc->pcidev, ioc);
1674+
16611675
/* Set lookup ptr. */
16621676
list_add_tail(&ioc->list, &ioc_list);
16631677

@@ -1791,6 +1805,7 @@ mpt_suspend(struct pci_dev *pdev, pm_message_t state)
17911805
CHIPREG_WRITE32(&ioc->chip->IntStatus, 0);
17921806

17931807
pci_disable_device(pdev);
1808+
pci_release_selected_regions(pdev, ioc->bars);
17941809
pci_set_power_state(pdev, device_state);
17951810

17961811
return 0;
@@ -1807,17 +1822,25 @@ mpt_resume(struct pci_dev *pdev)
18071822
MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
18081823
u32 device_state = pdev->current_state;
18091824
int recovery_state;
1810-
int err;
18111825

18121826
printk(MYIOC_s_INFO_FMT
18131827
"pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n",
18141828
ioc->name, pdev, pci_name(pdev), device_state);
18151829

18161830
pci_set_power_state(pdev, 0);
18171831
pci_restore_state(pdev);
1818-
err = pci_enable_device(pdev);
1819-
if (err)
1820-
return err;
1832+
if (ioc->facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT) {
1833+
ioc->bars = pci_select_bars(ioc->pcidev, IORESOURCE_MEM |
1834+
IORESOURCE_IO);
1835+
if (pci_enable_device(pdev))
1836+
return 0;
1837+
} else {
1838+
ioc->bars = pci_select_bars(pdev, IORESOURCE_MEM);
1839+
if (pci_enable_device_mem(pdev))
1840+
return 0;
1841+
}
1842+
if (pci_request_selected_regions(pdev, ioc->bars, "mpt"))
1843+
return 0;
18211844

18221845
/* enable interrupts */
18231846
CHIPREG_WRITE32(&ioc->chip->IntMask, MPI_HIM_DIM);
@@ -1878,6 +1901,7 @@ mpt_signal_reset(u8 index, MPT_ADAPTER *ioc, int reset_phase)
18781901
* -2 if READY but IOCFacts Failed
18791902
* -3 if READY but PrimeIOCFifos Failed
18801903
* -4 if READY but IOCInit Failed
1904+
* -5 if failed to enable_device and/or request_selected_regions
18811905
*/
18821906
static int
18831907
mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
@@ -1976,6 +2000,18 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
19762000
}
19772001
}
19782002

2003+
if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP) &&
2004+
(ioc->facts.Flags & MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT)) {
2005+
pci_release_selected_regions(ioc->pcidev, ioc->bars);
2006+
ioc->bars = pci_select_bars(ioc->pcidev, IORESOURCE_MEM |
2007+
IORESOURCE_IO);
2008+
if (pci_enable_device(ioc->pcidev))
2009+
return -5;
2010+
if (pci_request_selected_regions(ioc->pcidev, ioc->bars,
2011+
"mpt"))
2012+
return -5;
2013+
}
2014+
19792015
/*
19802016
* Device is reset now. It must have de-asserted the interrupt line
19812017
* (if it was asserted) and it should be safe to register for the
@@ -1999,7 +2035,6 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
19992035
irq_allocated = 1;
20002036
ioc->pci_irq = ioc->pcidev->irq;
20012037
pci_set_master(ioc->pcidev); /* ?? */
2002-
pci_set_drvdata(ioc->pcidev, ioc);
20032038
dprintk(ioc, printk(MYIOC_s_INFO_FMT "installed at interrupt "
20042039
"%d\n", ioc->name, ioc->pcidev->irq));
20052040
}
@@ -2381,6 +2416,9 @@ mpt_adapter_dispose(MPT_ADAPTER *ioc)
23812416
ioc->memmap = NULL;
23822417
}
23832418

2419+
pci_disable_device(ioc->pcidev);
2420+
pci_release_selected_regions(ioc->pcidev, ioc->bars);
2421+
23842422
#if defined(CONFIG_MTRR) && 0
23852423
if (ioc->mtrr_reg > 0) {
23862424
mtrr_del(ioc->mtrr_reg, 0, 0);

‎drivers/message/fusion/mptbase.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ typedef struct _MPT_ADAPTER
629629
dma_addr_t HostPageBuffer_dma;
630630
int mtrr_reg;
631631
struct pci_dev *pcidev; /* struct pci_dev pointer */
632+
int bars; /* bitmask of BAR's that must be configured */
632633
u8 __iomem *memmap; /* mmap address */
633634
struct Scsi_Host *sh; /* Scsi Host pointer */
634635
SpiCfgData spi_data; /* Scsi config. data */

‎drivers/scsi/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ config SCSI_FD_MCS
722722

723723
config SCSI_GDTH
724724
tristate "Intel/ICP (former GDT SCSI Disk Array) RAID Controller support"
725-
depends on (ISA || EISA || PCI) && SCSI && ISA_DMA_API && PCI_LEGACY
725+
depends on (ISA || EISA || PCI) && SCSI && ISA_DMA_API
726726
---help---
727727
Formerly called GDT SCSI Disk Array Controller Support.
728728

‎drivers/scsi/aacraid/aachba.c‎

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -144,51 +144,77 @@ static char *aac_get_status_string(u32 status);
144144
*/
145145

146146
static int nondasd = -1;
147-
static int aac_cache = 0;
147+
static int aac_cache;
148148
static int dacmode = -1;
149-
149+
int aac_msi;
150150
int aac_commit = -1;
151151
int startup_timeout = 180;
152152
int aif_timeout = 120;
153153

154154
module_param(nondasd, int, S_IRUGO|S_IWUSR);
155-
MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices. 0=off, 1=on");
155+
MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices."
156+
" 0=off, 1=on");
156157
module_param_named(cache, aac_cache, int, S_IRUGO|S_IWUSR);
157-
MODULE_PARM_DESC(cache, "Disable Queue Flush commands:\n\tbit 0 - Disable FUA in WRITE SCSI commands\n\tbit 1 - Disable SYNCHRONIZE_CACHE SCSI command\n\tbit 2 - Disable only if Battery not protecting Cache");
158+
MODULE_PARM_DESC(cache, "Disable Queue Flush commands:\n"
159+
"\tbit 0 - Disable FUA in WRITE SCSI commands\n"
160+
"\tbit 1 - Disable SYNCHRONIZE_CACHE SCSI command\n"
161+
"\tbit 2 - Disable only if Battery not protecting Cache");
158162
module_param(dacmode, int, S_IRUGO|S_IWUSR);
159-
MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC. 0=off, 1=on");
163+
MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC."
164+
" 0=off, 1=on");
160165
module_param_named(commit, aac_commit, int, S_IRUGO|S_IWUSR);
161-
MODULE_PARM_DESC(commit, "Control whether a COMMIT_CONFIG is issued to the adapter for foreign arrays.\nThis is typically needed in systems that do not have a BIOS. 0=off, 1=on");
166+
MODULE_PARM_DESC(commit, "Control whether a COMMIT_CONFIG is issued to the"
167+
" adapter for foreign arrays.\n"
168+
"This is typically needed in systems that do not have a BIOS."
169+
" 0=off, 1=on");
170+
module_param_named(msi, aac_msi, int, S_IRUGO|S_IWUSR);
171+
MODULE_PARM_DESC(msi, "IRQ handling."
172+
" 0=PIC(default), 1=MSI, 2=MSI-X(unsupported, uses MSI)");
162173
module_param(startup_timeout, int, S_IRUGO|S_IWUSR);
163-
MODULE_PARM_DESC(startup_timeout, "The duration of time in seconds to wait for adapter to have it's kernel up and\nrunning. This is typically adjusted for large systems that do not have a BIOS.");
174+
MODULE_PARM_DESC(startup_timeout, "The duration of time in seconds to wait for"
175+
" adapter to have it's kernel up and\n"
176+
"running. This is typically adjusted for large systems that do not"
177+
" have a BIOS.");
164178
module_param(aif_timeout, int, S_IRUGO|S_IWUSR);
165-
MODULE_PARM_DESC(aif_timeout, "The duration of time in seconds to wait for applications to pick up AIFs before\nderegistering them. This is typically adjusted for heavily burdened systems.");
179+
MODULE_PARM_DESC(aif_timeout, "The duration of time in seconds to wait for"
180+
" applications to pick up AIFs before\n"
181+
"deregistering them. This is typically adjusted for heavily burdened"
182+
" systems.");
166183

167184
int numacb = -1;
168185
module_param(numacb, int, S_IRUGO|S_IWUSR);
169-
MODULE_PARM_DESC(numacb, "Request a limit to the number of adapter control blocks (FIB) allocated. Valid values are 512 and down. Default is to use suggestion from Firmware.");
186+
MODULE_PARM_DESC(numacb, "Request a limit to the number of adapter control"
187+
" blocks (FIB) allocated. Valid values are 512 and down. Default is"
188+
" to use suggestion from Firmware.");
170189

171190
int acbsize = -1;
172191
module_param(acbsize, int, S_IRUGO|S_IWUSR);
173-
MODULE_PARM_DESC(acbsize, "Request a specific adapter control block (FIB) size. Valid values are 512, 2048, 4096 and 8192. Default is to use suggestion from Firmware.");
192+
MODULE_PARM_DESC(acbsize, "Request a specific adapter control block (FIB)"
193+
" size. Valid values are 512, 2048, 4096 and 8192. Default is to use"
194+
" suggestion from Firmware.");
174195

175196
int update_interval = 30 * 60;
176197
module_param(update_interval, int, S_IRUGO|S_IWUSR);
177-
MODULE_PARM_DESC(update_interval, "Interval in seconds between time sync updates issued to adapter.");
198+
MODULE_PARM_DESC(update_interval, "Interval in seconds between time sync"
199+
" updates issued to adapter.");
178200

179201
int check_interval = 24 * 60 * 60;
180202
module_param(check_interval, int, S_IRUGO|S_IWUSR);
181-
MODULE_PARM_DESC(check_interval, "Interval in seconds between adapter health checks.");
203+
MODULE_PARM_DESC(check_interval, "Interval in seconds between adapter health"
204+
" checks.");
182205

183206
int aac_check_reset = 1;
184207
module_param_named(check_reset, aac_check_reset, int, S_IRUGO|S_IWUSR);
185-
MODULE_PARM_DESC(aac_check_reset, "If adapter fails health check, reset the adapter. a value of -1 forces the reset to adapters programmed to ignore it.");
208+
MODULE_PARM_DESC(aac_check_reset, "If adapter fails health check, reset the"
209+
" adapter. a value of -1 forces the reset to adapters programmed to"
210+
" ignore it.");
186211

187212
int expose_physicals = -1;
188213
module_param(expose_physicals, int, S_IRUGO|S_IWUSR);
189-
MODULE_PARM_DESC(expose_physicals, "Expose physical components of the arrays. -1=protect 0=off, 1=on");
214+
MODULE_PARM_DESC(expose_physicals, "Expose physical components of the arrays."
215+
" -1=protect 0=off, 1=on");
190216

191-
int aac_reset_devices = 0;
217+
int aac_reset_devices;
192218
module_param_named(reset_devices, aac_reset_devices, int, S_IRUGO|S_IWUSR);
193219
MODULE_PARM_DESC(reset_devices, "Force an adapter reset at initialization.");
194220

@@ -1315,7 +1341,7 @@ int aac_get_adapter_info(struct aac_dev* dev)
13151341
(int)sizeof(dev->supplement_adapter_info.VpdInfo.Tsid),
13161342
dev->supplement_adapter_info.VpdInfo.Tsid);
13171343
}
1318-
if (!aac_check_reset || ((aac_check_reset != 1) &&
1344+
if (!aac_check_reset || ((aac_check_reset == 1) &&
13191345
(dev->supplement_adapter_info.SupportedOptions2 &
13201346
AAC_OPTION_IGNORE_RESET))) {
13211347
printk(KERN_INFO "%s%d: Reset Adapter Ignored\n",
@@ -1353,13 +1379,14 @@ int aac_get_adapter_info(struct aac_dev* dev)
13531379

13541380
if (nondasd != -1)
13551381
dev->nondasd_support = (nondasd!=0);
1356-
if(dev->nondasd_support != 0) {
1382+
if (dev->nondasd_support && !dev->in_reset)
13571383
printk(KERN_INFO "%s%d: Non-DASD support enabled.\n",dev->name, dev->id);
1358-
}
13591384

13601385
dev->dac_support = 0;
13611386
if( (sizeof(dma_addr_t) > 4) && (dev->adapter_info.options & AAC_OPT_SGMAP_HOST64)){
1362-
printk(KERN_INFO "%s%d: 64bit support enabled.\n", dev->name, dev->id);
1387+
if (!dev->in_reset)
1388+
printk(KERN_INFO "%s%d: 64bit support enabled.\n",
1389+
dev->name, dev->id);
13631390
dev->dac_support = 1;
13641391
}
13651392

@@ -1369,8 +1396,9 @@ int aac_get_adapter_info(struct aac_dev* dev)
13691396
if(dev->dac_support != 0) {
13701397
if (!pci_set_dma_mask(dev->pdev, DMA_64BIT_MASK) &&
13711398
!pci_set_consistent_dma_mask(dev->pdev, DMA_64BIT_MASK)) {
1372-
printk(KERN_INFO"%s%d: 64 Bit DAC enabled\n",
1373-
dev->name, dev->id);
1399+
if (!dev->in_reset)
1400+
printk(KERN_INFO"%s%d: 64 Bit DAC enabled\n",
1401+
dev->name, dev->id);
13741402
} else if (!pci_set_dma_mask(dev->pdev, DMA_32BIT_MASK) &&
13751403
!pci_set_consistent_dma_mask(dev->pdev, DMA_32BIT_MASK)) {
13761404
printk(KERN_INFO"%s%d: DMA mask set failed, 64 Bit DAC disabled\n",

‎drivers/scsi/aacraid/aacraid.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,7 @@ struct aac_dev
10261026
u8 raw_io_64;
10271027
u8 printf_enabled;
10281028
u8 in_reset;
1029+
u8 msi;
10291030
};
10301031

10311032
#define aac_adapter_interrupt(dev) \
@@ -1881,6 +1882,7 @@ extern int startup_timeout;
18811882
extern int aif_timeout;
18821883
extern int expose_physicals;
18831884
extern int aac_reset_devices;
1885+
extern int aac_msi;
18841886
extern int aac_commit;
18851887
extern int update_interval;
18861888
extern int check_interval;

‎drivers/scsi/aacraid/commsup.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1458,7 +1458,7 @@ int aac_check_health(struct aac_dev * aac)
14581458

14591459
printk(KERN_ERR "%s: Host adapter BLINK LED 0x%x\n", aac->name, BlinkLED);
14601460

1461-
if (!aac_check_reset || ((aac_check_reset != 1) &&
1461+
if (!aac_check_reset || ((aac_check_reset == 1) &&
14621462
(aac->supplement_adapter_info.SupportedOptions2 &
14631463
AAC_OPTION_IGNORE_RESET)))
14641464
goto out;

0 commit comments

Comments
 (0)