Since SATA devices attached to SAS HBAs will not have a host_set, add a helper function to retrieve the host_set flags which can check for the existence of a host_set. Signed-off-by: Brian King <brking@xxxxxxxxxx> --- libata-dev-bjking1/drivers/scsi/libata-core.c | 7 +++---- libata-dev-bjking1/include/linux/libata.h | 7 +++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff -puN drivers/scsi/libata-core.c~libata_sas_no_simplex drivers/scsi/libata-core.c --- libata-dev/drivers/scsi/libata-core.c~libata_sas_no_simplex 2006-04-11 14:15:38.000000000 -0500 +++ libata-dev-bjking1/drivers/scsi/libata-core.c 2006-04-11 14:15:38.000000000 -0500 @@ -2071,7 +2071,7 @@ int ata_set_mode(struct ata_port *ap, st /* Record simplex status. If we selected DMA then the other * host channels are not permitted to do so. */ - if (used_dma && (ap->host_set->flags & ATA_HOST_SIMPLEX)) + if (used_dma && (ata_host_flags(ap) & ATA_HOST_SIMPLEX)) ap->host_set->simplex_claimed = 1; /* step5: chip specific finalisation */ @@ -2904,7 +2904,6 @@ static int ata_dma_blacklisted(const str */ static void ata_dev_xfermask(struct ata_port *ap, struct ata_device *dev) { - struct ata_host_set *hs = ap->host_set; unsigned long xfer_mask; int i; @@ -2942,8 +2941,8 @@ static void ata_dev_xfermask(struct ata_ printk(KERN_WARNING "ata%u: dev %u is on DMA blacklist, " "disabling DMA\n", ap->id, dev->devno); - if (hs->flags & ATA_HOST_SIMPLEX) { - if (hs->simplex_claimed) + if (ata_host_flags(ap) & ATA_HOST_SIMPLEX) { + if (ap->host_set->simplex_claimed) xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); } diff -puN include/linux/libata.h~libata_sas_no_simplex include/linux/libata.h --- libata-dev/include/linux/libata.h~libata_sas_no_simplex 2006-04-11 14:15:38.000000000 -0500 +++ libata-dev-bjking1/include/linux/libata.h 2006-04-11 14:15:38.000000000 -0500 @@ -986,4 +986,11 @@ static inline struct ata_port *ata_shost return (struct ata_port *) &host->hostdata[0]; } +static inline unsigned int ata_host_flags(struct ata_port *ap) +{ + if (ap->host_set) + return ap->host_set->flags; + return 0; +} + #endif /* __LINUX_LIBATA_H__ */ _ - : send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html