Skip to content

Commit

Permalink
[SCSI] aacraid: pci_set_dma_max_seg_size opened up for late model con…
Browse files Browse the repository at this point in the history
…trollers

This patch ensures that the modern adapters get a maximum sg segment
size on par with the maximum transfer size. Added some localized
janitor fixes to the discussion patch I used with Fujita.

FUJITA Tomonori [mailto:fujita.tomonori@lab.ntt.co.jp] sez:
> I think that setting the proper maximum segment size for the late
> model cards (as you did above) makes sense.

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
  • Loading branch information
Salyzyn, Mark authored and James Bottomley committed Feb 8, 2008
1 parent 4d2de3a commit 62e9f5c
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions drivers/scsi/aacraid/linit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1130,31 +1130,29 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
if (error < 0)
goto out_deinit;

if (!(aac->adapter_info.options & AAC_OPT_NEW_COMM)) {
error = pci_set_dma_max_seg_size(pdev, 65536);
if (error)
goto out_deinit;
}

/*
* Lets override negotiations and drop the maximum SG limit to 34
*/
if ((aac_drivers[index].quirks & AAC_QUIRK_34SG) &&
(aac->scsi_host_ptr->sg_tablesize > 34)) {
aac->scsi_host_ptr->sg_tablesize = 34;
aac->scsi_host_ptr->max_sectors
= (aac->scsi_host_ptr->sg_tablesize * 8) + 112;
(shost->sg_tablesize > 34)) {
shost->sg_tablesize = 34;
shost->max_sectors = (shost->sg_tablesize * 8) + 112;
}

if ((aac_drivers[index].quirks & AAC_QUIRK_17SG) &&
(aac->scsi_host_ptr->sg_tablesize > 17)) {
aac->scsi_host_ptr->sg_tablesize = 17;
aac->scsi_host_ptr->max_sectors
= (aac->scsi_host_ptr->sg_tablesize * 8) + 112;
(shost->sg_tablesize > 17)) {
shost->sg_tablesize = 17;
shost->max_sectors = (shost->sg_tablesize * 8) + 112;
}

error = pci_set_dma_max_seg_size(pdev,
(aac->adapter_info.options & AAC_OPT_NEW_COMM) ?
(shost->max_sectors << 9) : 65536);
if (error)
goto out_deinit;

/*
* Firware printf works only with older firmware.
* Firmware printf works only with older firmware.
*/
if (aac_drivers[index].quirks & AAC_QUIRK_34SG)
aac->printf_enabled = 1;
Expand Down

0 comments on commit 62e9f5c

Please sign in to comment.