Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] libsas, ipr: cleanup ata_host flags initialization via ata_host_init

libsas and ipr pass flags to ata_host_init that are meant for the port.

ata_host flags:
ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */
ATA_HOST_STARTED = (1 << 1), /* Host started */
ATA_HOST_PARALLEL_SCAN = (1 << 2), /* Ports on this host can be scanned in parallel */
ATA_HOST_IGNORE_ATA = (1 << 3), /* Ignore ATA devices on this host. */

flags passed by libsas:
ATA_FLAG_SATA = (1 << 1),
ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */
ATA_FLAG_NCQ = (1 << 10), /* host supports NCQ */

The only one that aliases is ATA_HOST_STARTED which is a 'don't care' in
the libsas and ipr cases since ata_hosts from these sources are not
registered with libata.

Reported-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Brian King <brking@us.ibm.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

authored by

Dan Williams and committed by
James Bottomley
8d8e7d13 e468dc11

+5 -16
+2 -8
drivers/ata/libata-core.c
··· 5960 5960 } 5961 5961 5962 5962 /** 5963 - * ata_sas_host_init - Initialize a host struct 5963 + * ata_sas_host_init - Initialize a host struct for sas (ipr, libsas) 5964 5964 * @host: host to initialize 5965 5965 * @dev: device host is attached to 5966 - * @flags: host flags 5967 5966 * @ops: port_ops 5968 5967 * 5969 - * LOCKING: 5970 - * PCI/etc. bus probe sem. 5971 - * 5972 5968 */ 5973 - /* KILLME - the only user left is ipr */ 5974 5969 void ata_host_init(struct ata_host *host, struct device *dev, 5975 - unsigned long flags, struct ata_port_operations *ops) 5970 + struct ata_port_operations *ops) 5976 5971 { 5977 5972 spin_lock_init(&host->lock); 5978 5973 mutex_init(&host->eh_mutex); 5979 5974 host->dev = dev; 5980 - host->flags = flags; 5981 5975 host->ops = ops; 5982 5976 } 5983 5977
+1 -2
drivers/scsi/ipr.c
··· 8775 8775 8776 8776 ioa_cfg = (struct ipr_ioa_cfg *)host->hostdata; 8777 8777 memset(ioa_cfg, 0, sizeof(struct ipr_ioa_cfg)); 8778 - ata_host_init(&ioa_cfg->ata_host, &pdev->dev, 8779 - sata_port_info.flags, &ipr_sata_ops); 8778 + ata_host_init(&ioa_cfg->ata_host, &pdev->dev, &ipr_sata_ops); 8780 8779 8781 8780 ioa_cfg->ipr_chip = ipr_get_chip_info(dev_id); 8782 8781
+1 -4
drivers/scsi/libsas/sas_ata.c
··· 580 580 struct ata_port *ap; 581 581 int rc; 582 582 583 - ata_host_init(&found_dev->sata_dev.ata_host, 584 - ha->dev, 585 - sata_port_info.flags, 586 - &sas_sata_ops); 583 + ata_host_init(&found_dev->sata_dev.ata_host, ha->dev, &sas_sata_ops); 587 584 ap = ata_sas_port_alloc(&found_dev->sata_dev.ata_host, 588 585 &sata_port_info, 589 586 shost);
+1 -2
include/linux/libata.h
··· 987 987 irq_handler_t irq_handler, unsigned long irq_flags, 988 988 struct scsi_host_template *sht); 989 989 extern void ata_host_detach(struct ata_host *host); 990 - extern void ata_host_init(struct ata_host *, struct device *, 991 - unsigned long, struct ata_port_operations *); 990 + extern void ata_host_init(struct ata_host *, struct device *, struct ata_port_operations *); 992 991 extern int ata_scsi_detect(struct scsi_host_template *sht); 993 992 extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 994 993 extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd);