Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47807
b: refs/heads/master
c: 1996676
h: refs/heads/master
i:
  47805: c0c7275
  47803: 48c6680
  47799: f17b856
  47791: bb565b7
  47775: b014c67
  47743: 3b1bb3d
v: v3
  • Loading branch information
Hannes Reinecke authored and James Bottomley committed Feb 10, 2007
1 parent 34e1ad1 commit dbae77e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 22 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: 55048021177eee956af88333ec4565919c8567e4
refs/heads/master: 19966769f9fc1968dcf5bffec2e53f7f40100872
9 changes: 0 additions & 9 deletions trunk/drivers/scsi/aic7xxx/aic79xx_osm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1126,15 +1126,6 @@ ahd_linux_register_host(struct ahd_softc *ahd, struct scsi_host_template *templa
return 0;
}

uint64_t
ahd_linux_get_memsize(void)
{
struct sysinfo si;

si_meminfo(&si);
return ((uint64_t)si.totalram << PAGE_SHIFT);
}

/*
* Place the SCSI bus into a known state by either resetting it,
* or forcing transfer negotiations on the next command to any
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/scsi/aic7xxx/aic79xx_osm.h
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,6 @@ ahd_insb(struct ahd_softc * ahd, long port, uint8_t *array, int count)
int ahd_linux_register_host(struct ahd_softc *,
struct scsi_host_template *);

uint64_t ahd_linux_get_memsize(void);

/*************************** Pretty Printing **********************************/
struct info_str {
char *buffer;
Expand Down
19 changes: 9 additions & 10 deletions trunk/drivers/scsi/aic7xxx/aic79xx_osm_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ ahd_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct ahd_pci_identity *entry;
char *name;
int error;
struct device *dev = &pdev->dev;

pci = pdev;
entry = ahd_find_pci_device(pci);
Expand Down Expand Up @@ -161,20 +162,18 @@ ahd_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_set_master(pdev);

if (sizeof(dma_addr_t) > 4) {
uint64_t memsize;
const uint64_t mask_39bit = 0x7FFFFFFFFFULL;
const u64 required_mask = dma_get_required_mask(dev);

memsize = ahd_linux_get_memsize();

if (memsize >= 0x8000000000ULL
&& pci_set_dma_mask(pdev, DMA_64BIT_MASK) == 0) {
if (required_mask > DMA_39BIT_MASK &&
dma_set_mask(dev, DMA_64BIT_MASK) == 0)
ahd->flags |= AHD_64BIT_ADDRESSING;
} else if (memsize > 0x80000000
&& pci_set_dma_mask(pdev, mask_39bit) == 0) {
else if (required_mask > DMA_32BIT_MASK &&
dma_set_mask(dev, DMA_39BIT_MASK) == 0)
ahd->flags |= AHD_39BIT_ADDRESSING;
}
else
dma_set_mask(dev, DMA_32BIT_MASK);
} else {
pci_set_dma_mask(pdev, DMA_32BIT_MASK);
dma_set_mask(dev, DMA_32BIT_MASK);
}
ahd->dev_softc = pci;
error = ahd_pci_config(ahd, entry);
Expand Down

0 comments on commit dbae77e

Please sign in to comment.