Commit 87665b16 authored by James Bottomley's avatar James Bottomley

Merge mulgrave.(none):/home/jejb/BK/scsi-dma-mask-2.5

into mulgrave.(none):/home/jejb/BK/scsi-misc-2.5
parents a8164344 f7598d2e
...@@ -479,12 +479,6 @@ struct Scsi_Host ...@@ -479,12 +479,6 @@ struct Scsi_Host
*/ */
unsigned int max_host_blocked; unsigned int max_host_blocked;
/*
* For SCSI hosts which are PCI devices, set pci_dev so that
* we can do BIOS EDD 3.0 mappings
*/
struct pci_dev *pci_dev;
/* /*
* Support for driverfs filesystem * Support for driverfs filesystem
*/ */
...@@ -522,11 +516,21 @@ static inline void scsi_assign_lock(struct Scsi_Host *shost, spinlock_t *lock) ...@@ -522,11 +516,21 @@ static inline void scsi_assign_lock(struct Scsi_Host *shost, spinlock_t *lock)
shost->host_lock = lock; shost->host_lock = lock;
} }
static inline void scsi_set_device(struct Scsi_Host *shost,
struct device *dev)
{
shost->host_gendev = dev;
}
static inline struct device *scsi_get_device(struct Scsi_Host *shost)
{
return shost->host_gendev;
}
static inline void scsi_set_pci_device(struct Scsi_Host *shost, static inline void scsi_set_pci_device(struct Scsi_Host *shost,
struct pci_dev *pdev) struct pci_dev *pdev)
{ {
shost->pci_dev = pdev; scsi_set_device(shost, &pdev->dev);
shost->host_gendev = &pdev->dev;
} }
......
...@@ -393,12 +393,13 @@ int scsi_ioctl_send_command(Scsi_Device * dev, Scsi_Ioctl_Command * sic) ...@@ -393,12 +393,13 @@ int scsi_ioctl_send_command(Scsi_Device * dev, Scsi_Ioctl_Command * sic)
* any copy_to_user() error on failure there * any copy_to_user() error on failure there
*/ */
static int static int
scsi_ioctl_get_pci(Scsi_Device * dev, void *arg) scsi_ioctl_get_pci(Scsi_Device * sdev, void *arg)
{ {
struct device *dev = scsi_get_device(sdev->host);
if (!dev->host->pci_dev) return -ENXIO; if (!dev) return -ENXIO;
return copy_to_user(arg, dev->host->pci_dev->slot_name, return copy_to_user(arg, dev->bus_id,
sizeof(dev->host->pci_dev->slot_name)); sizeof(dev->bus_id));
} }
......
...@@ -373,11 +373,12 @@ static void scsi_initialize_merge_fn(struct scsi_device *sd) ...@@ -373,11 +373,12 @@ static void scsi_initialize_merge_fn(struct scsi_device *sd)
{ {
request_queue_t *q = &sd->request_queue; request_queue_t *q = &sd->request_queue;
struct Scsi_Host *sh = sd->host; struct Scsi_Host *sh = sd->host;
struct device *dev = scsi_get_device(sh);
u64 bounce_limit; u64 bounce_limit;
if (sh->highmem_io) { if (sh->highmem_io) {
if (sh->pci_dev && PCI_DMA_BUS_IS_PHYS) { if (dev && dev->dma_mask && PCI_DMA_BUS_IS_PHYS) {
bounce_limit = sh->pci_dev->dma_mask; bounce_limit = *dev->dma_mask;
} else { } else {
/* /*
* Platforms with virtual-DMA translation * Platforms with virtual-DMA translation
......
...@@ -3765,13 +3765,14 @@ static int st_attach(Scsi_Device * SDp) ...@@ -3765,13 +3765,14 @@ static int st_attach(Scsi_Device * SDp)
tpnt->try_dio = try_direct_io && !SDp->host->unchecked_isa_dma; tpnt->try_dio = try_direct_io && !SDp->host->unchecked_isa_dma;
bounce_limit = BLK_BOUNCE_HIGH; /* Borrowed from scsi_merge.c */ bounce_limit = BLK_BOUNCE_HIGH; /* Borrowed from scsi_merge.c */
if (SDp->host->highmem_io) { if (SDp->host->highmem_io) {
struct device *dev = scsi_get_device(SDp->host);
if (!PCI_DMA_BUS_IS_PHYS) if (!PCI_DMA_BUS_IS_PHYS)
/* Platforms with virtual-DMA translation /* Platforms with virtual-DMA translation
* hardware have no practical limit. * hardware have no practical limit.
*/ */
bounce_limit = BLK_BOUNCE_ANY; bounce_limit = BLK_BOUNCE_ANY;
else if (SDp->host->pci_dev) else if (dev && dev->dma_mask)
bounce_limit = SDp->host->pci_dev->dma_mask; bounce_limit = *dev->dma_mask;
} else if (SDp->host->unchecked_isa_dma) } else if (SDp->host->unchecked_isa_dma)
bounce_limit = BLK_BOUNCE_ISA; bounce_limit = BLK_BOUNCE_ISA;
bounce_limit >>= PAGE_SHIFT; bounce_limit >>= PAGE_SHIFT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment