aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/scsi_host.h
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@suse.de>2009-11-05 14:33:12 -0500
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:01:30 -0500
commitd139b9bd0e52dda14fd13412e7096e68b56d0076 (patch)
tree518daa6384ff606ec77dd8fe4714ea2f177d92c4 /include/scsi/scsi_host.h
parent5917290ce9b376866b165d02a5ed88d5ecdb32d0 (diff)
[SCSI] scsi_lib_dma: fix bug with dma maps on nested scsi objects
Some of our virtual SCSI hosts don't have a proper bus parent at the top, which can be a problem for doing DMA on them This patch makes the host device cache a pointer to the physical bus device and provides an extra API for setting it (the normal API picks it up from the parent). This patch also modifies the qla2xxx and lpfc vport logic to use the new DMA host setting API. Acked-By: James Smart <james.smart@emulex.com> Cc: Stable Tree <stable@kernel.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'include/scsi/scsi_host.h')
-rw-r--r--include/scsi/scsi_host.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 603054d8f40c..6ff6bc18e294 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -683,6 +683,12 @@ struct Scsi_Host {
683 void *shost_data; 683 void *shost_data;
684 684
685 /* 685 /*
686 * Points to the physical bus device we'd use to do DMA
687 * Needed just in case we have virtual hosts.
688 */
689 struct device *dma_dev;
690
691 /*
686 * We should ensure that this is aligned, both for better performance 692 * We should ensure that this is aligned, both for better performance
687 * and also because some compilers (m68k) don't automatically force 693 * and also because some compilers (m68k) don't automatically force
688 * alignment to a long boundary. 694 * alignment to a long boundary.
@@ -726,7 +732,9 @@ extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *);
726extern void scsi_flush_work(struct Scsi_Host *); 732extern void scsi_flush_work(struct Scsi_Host *);
727 733
728extern struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *, int); 734extern struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *, int);
729extern int __must_check scsi_add_host(struct Scsi_Host *, struct device *); 735extern int __must_check scsi_add_host_with_dma(struct Scsi_Host *,
736 struct device *,
737 struct device *);
730extern void scsi_scan_host(struct Scsi_Host *); 738extern void scsi_scan_host(struct Scsi_Host *);
731extern void scsi_rescan_device(struct device *); 739extern void scsi_rescan_device(struct device *);
732extern void scsi_remove_host(struct Scsi_Host *); 740extern void scsi_remove_host(struct Scsi_Host *);
@@ -737,6 +745,12 @@ extern const char *scsi_host_state_name(enum scsi_host_state);
737 745
738extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); 746extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *);
739 747
748static inline int __must_check scsi_add_host(struct Scsi_Host *host,
749 struct device *dev)
750{
751 return scsi_add_host_with_dma(host, dev, dev);
752}
753
740static inline struct device *scsi_get_device(struct Scsi_Host *shost) 754static inline struct device *scsi_get_device(struct Scsi_Host *shost)
741{ 755{
742 return shost->shost_gendev.parent; 756 return shost->shost_gendev.parent;