Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292989
b: refs/heads/master
c: b91bb29
h: refs/heads/master
i:
  292987: d771133
v: v3
  • Loading branch information
Dan Williams authored and James Bottomley committed Feb 19, 2012
1 parent 4a6431e commit 21f8257
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 327 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 87c8331fcf72e501c3a3c0cdc5c9391ec72f7cf2
refs/heads/master: b91bb296188118eea9fdc6093cfcf76bbe8589ba
2 changes: 2 additions & 0 deletions trunk/drivers/scsi/aic94xx/aic94xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ void asd_invalidate_edb(struct asd_ascb *ascb, int edb_id);

int asd_execute_task(struct sas_task *, int num, gfp_t gfp_flags);

void asd_set_dmamode(struct domain_device *dev);

/* ---------- TMFs ---------- */
int asd_abort_task(struct sas_task *);
int asd_abort_task_set(struct domain_device *, u8 *lun);
Expand Down
38 changes: 24 additions & 14 deletions trunk/drivers/scsi/aic94xx/aic94xx_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,36 +109,46 @@ static int asd_init_sata_tag_ddb(struct domain_device *dev)
return 0;
}

static int asd_init_sata(struct domain_device *dev)
void asd_set_dmamode(struct domain_device *dev)
{
struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha;
struct ata_device *ata_dev = sas_to_ata_dev(dev);
int ddb = (int) (unsigned long) dev->lldd_dev;
u32 qdepth = 0;
int res = 0;

asd_ddbsite_write_word(asd_ha, ddb, ATA_CMD_SCBPTR, 0xFFFF);
if ((dev->dev_type == SATA_DEV || dev->dev_type == SATA_PM_PORT) &&
dev->sata_dev.identify_device &&
dev->sata_dev.identify_device[10] != 0) {
u16 w75 = le16_to_cpu(dev->sata_dev.identify_device[75]);
u16 w76 = le16_to_cpu(dev->sata_dev.identify_device[76]);

if (w76 & 0x100) /* NCQ? */
qdepth = (w75 & 0x1F) + 1;
if (dev->dev_type == SATA_DEV || dev->dev_type == SATA_PM_PORT) {
if (ata_id_has_ncq(ata_dev->id))
qdepth = ata_id_queue_depth(ata_dev->id);
asd_ddbsite_write_dword(asd_ha, ddb, SATA_TAG_ALLOC_MASK,
(1ULL<<qdepth)-1);
asd_ddbsite_write_byte(asd_ha, ddb, NUM_SATA_TAGS, qdepth);
}

if (qdepth > 0)
if (asd_init_sata_tag_ddb(dev) != 0) {
unsigned long flags;

spin_lock_irqsave(dev->sata_dev.ap->lock, flags);
ata_dev->flags |= ATA_DFLAG_NCQ_OFF;
spin_unlock_irqrestore(dev->sata_dev.ap->lock, flags);
}
}

static int asd_init_sata(struct domain_device *dev)
{
struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha;
int ddb = (int) (unsigned long) dev->lldd_dev;

asd_ddbsite_write_word(asd_ha, ddb, ATA_CMD_SCBPTR, 0xFFFF);
if (dev->dev_type == SATA_DEV || dev->dev_type == SATA_PM ||
dev->dev_type == SATA_PM_PORT) {
struct dev_to_host_fis *fis = (struct dev_to_host_fis *)
dev->frame_rcvd;
asd_ddbsite_write_byte(asd_ha, ddb, SATA_STATUS, fis->status);
}
asd_ddbsite_write_word(asd_ha, ddb, NCQ_DATA_SCB_PTR, 0xFFFF);
if (qdepth > 0)
res = asd_init_sata_tag_ddb(dev);
return res;

return 0;
}

static int asd_init_target_ddb(struct domain_device *dev)
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/scsi/aic94xx/aic94xx_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,8 @@ static struct sas_domain_function_template aic94xx_transport_functions = {
.lldd_clear_nexus_ha = asd_clear_nexus_ha,

.lldd_control_phy = asd_control_phy,

.lldd_ata_set_dmamode = asd_set_dmamode,
};

static const struct pci_device_id aic94xx_pci_table[] __devinitdata = {
Expand Down
Loading

0 comments on commit 21f8257

Please sign in to comment.