Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7103
b: refs/heads/master
c: 374b187
h: refs/heads/master
i:
  7101: 91a5aa5
  7099: df339b7
  7095: 97b883b
  7087: fba4191
  7071: f14a338
  7039: ab37f6a
v: v3
  • Loading branch information
Jeff Garzik committed Aug 30, 2005
1 parent 9f9441e commit b31ab85
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 40 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: ea6ba10bbb88e106f9e2db7dc253993bb3bbbe3b
refs/heads/master: 374b1873571bf80dc0c1fcceaaad067980f3b9de
7 changes: 3 additions & 4 deletions trunk/drivers/scsi/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,8 +995,7 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
probe_ent->dev = pci_dev_to_dev(pdev);
INIT_LIST_HEAD(&probe_ent->node);

mmio_base = ioremap(pci_resource_start(pdev, AHCI_PCI_BAR),
pci_resource_len(pdev, AHCI_PCI_BAR));
mmio_base = pci_iomap(pdev, AHCI_PCI_BAR, 0);
if (mmio_base == NULL) {
rc = -ENOMEM;
goto err_out_free_ent;
Expand Down Expand Up @@ -1040,7 +1039,7 @@ static int ahci_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
err_out_hpriv:
kfree(hpriv);
err_out_iounmap:
iounmap(mmio_base);
pci_iounmap(pdev, mmio_base);
err_out_free_ent:
kfree(probe_ent);
err_out_msi:
Expand Down Expand Up @@ -1081,7 +1080,7 @@ static void ahci_remove_one (struct pci_dev *pdev)
}

kfree(hpriv);
iounmap(host_set->mmio_base);
pci_iounmap(pdev, host_set->mmio_base);
kfree(host_set);

if (have_msi)
Expand Down
9 changes: 4 additions & 5 deletions trunk/drivers/scsi/ata_piix.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,19 +584,18 @@ static void pci_enable_intx(struct pci_dev *pdev)
static int piix_disable_ahci(struct pci_dev *pdev)
{
void __iomem *mmio;
unsigned long addr;
u32 tmp;
int rc = 0;

/* BUG: pci_enable_device has not yet been called. This
* works because this device is usually set up by BIOS.
*/

addr = pci_resource_start(pdev, AHCI_PCI_BAR);
if (!addr || !pci_resource_len(pdev, AHCI_PCI_BAR))
if (!pci_resource_start(pdev, AHCI_PCI_BAR) ||
!pci_resource_len(pdev, AHCI_PCI_BAR))
return 0;

mmio = ioremap(addr, 64);
mmio = pci_iomap(pdev, AHCI_PCI_BAR, 64);
if (!mmio)
return -ENOMEM;

Expand All @@ -610,7 +609,7 @@ static int piix_disable_ahci(struct pci_dev *pdev)
rc = -EIO;
}

iounmap(mmio);
pci_iounmap(pdev, mmio);
return rc;
}

Expand Down
11 changes: 10 additions & 1 deletion trunk/drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4200,6 +4200,15 @@ ata_probe_ent_alloc(struct device *dev, struct ata_port_info *port)



#ifdef CONFIG_PCI

void ata_pci_host_stop (struct ata_host_set *host_set)
{
struct pci_dev *pdev = to_pci_dev(host_set->dev);

pci_iounmap(pdev, host_set->mmio_base);
}

/**
* ata_pci_init_native_mode - Initialize native-mode driver
* @pdev: pci device to be initialized
Expand All @@ -4212,7 +4221,6 @@ ata_probe_ent_alloc(struct device *dev, struct ata_port_info *port)
* ata_probe_ent structure should then be freed with kfree().
*/

#ifdef CONFIG_PCI
struct ata_probe_ent *
ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port)
{
Expand Down Expand Up @@ -4595,6 +4603,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_simulate);

#ifdef CONFIG_PCI
EXPORT_SYMBOL_GPL(pci_test_config_bits);
EXPORT_SYMBOL_GPL(ata_pci_host_stop);
EXPORT_SYMBOL_GPL(ata_pci_init_native_mode);
EXPORT_SYMBOL_GPL(ata_pci_init_one);
EXPORT_SYMBOL_GPL(ata_pci_remove_one);
Expand Down
9 changes: 5 additions & 4 deletions trunk/drivers/scsi/sata_nv.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,16 @@ static void nv_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
static void nv_host_stop (struct ata_host_set *host_set)
{
struct nv_host *host = host_set->private_data;
struct pci_dev *pdev = to_pci_dev(host_set->dev);

// Disable hotplug event interrupts.
if (host->host_desc->disable_hotplug)
host->host_desc->disable_hotplug(host_set);

kfree(host);

ata_host_stop(host_set);
if (host_set->mmio_base)
pci_iounmap(pdev, host_set->mmio_base);
}

static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
Expand Down Expand Up @@ -420,8 +422,7 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
if (host->host_flags & NV_HOST_FLAGS_SCR_MMIO) {
unsigned long base;

probe_ent->mmio_base = ioremap(pci_resource_start(pdev, 5),
pci_resource_len(pdev, 5));
probe_ent->mmio_base = pci_iomap(pdev, 5, 0);
if (probe_ent->mmio_base == NULL) {
rc = -EIO;
goto err_out_free_host;
Expand Down Expand Up @@ -457,7 +458,7 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)

err_out_iounmap:
if (host->host_flags & NV_HOST_FLAGS_SCR_MMIO)
iounmap(probe_ent->mmio_base);
pci_iounmap(pdev, probe_ent->mmio_base);
err_out_free_host:
kfree(host);
err_out_free_ent:
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/scsi/sata_promise.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf);
static void pdc_irq_clear(struct ata_port *ap);
static int pdc_qc_issue_prot(struct ata_queued_cmd *qc);


static Scsi_Host_Template pdc_ata_sht = {
.module = THIS_MODULE,
.name = DRV_NAME,
Expand Down Expand Up @@ -132,7 +133,7 @@ static struct ata_port_operations pdc_sata_ops = {
.scr_write = pdc_sata_scr_write,
.port_start = pdc_port_start,
.port_stop = pdc_port_stop,
.host_stop = ata_host_stop,
.host_stop = ata_pci_host_stop,
};

static struct ata_port_operations pdc_pata_ops = {
Expand All @@ -153,7 +154,7 @@ static struct ata_port_operations pdc_pata_ops = {

.port_start = pdc_port_start,
.port_stop = pdc_port_stop,
.host_stop = ata_host_stop,
.host_stop = ata_pci_host_stop,
};

static struct ata_port_info pdc_port_info[] = {
Expand Down Expand Up @@ -663,8 +664,7 @@ static int pdc_ata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
probe_ent->dev = pci_dev_to_dev(pdev);
INIT_LIST_HEAD(&probe_ent->node);

mmio_base = ioremap(pci_resource_start(pdev, 3),
pci_resource_len(pdev, 3));
mmio_base = pci_iomap(pdev, 3, 0);
if (mmio_base == NULL) {
rc = -ENOMEM;
goto err_out_free_ent;
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/scsi/sata_qstor.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,11 +538,12 @@ static void qs_port_stop(struct ata_port *ap)
static void qs_host_stop(struct ata_host_set *host_set)
{
void __iomem *mmio_base = host_set->mmio_base;
struct pci_dev *pdev = to_pci_dev(host_set->dev);

writeb(0, mmio_base + QS_HCT_CTRL); /* disable host interrupts */
writeb(QS_CNFG3_GSRST, mmio_base + QS_HCF_CNFG3); /* global reset */

ata_host_stop(host_set);
pci_iounmap(pdev, mmio_base);
}

static void qs_host_init(unsigned int chip_id, struct ata_probe_ent *pe)
Expand Down Expand Up @@ -646,8 +647,7 @@ static int qs_ata_init_one(struct pci_dev *pdev,
goto err_out_regions;
}

mmio_base = ioremap(pci_resource_start(pdev, 4),
pci_resource_len(pdev, 4));
mmio_base = pci_iomap(pdev, 4, 0);
if (mmio_base == NULL) {
rc = -ENOMEM;
goto err_out_regions;
Expand Down Expand Up @@ -697,7 +697,7 @@ static int qs_ata_init_one(struct pci_dev *pdev,
return 0;

err_out_iounmap:
iounmap(mmio_base);
pci_iounmap(pdev, mmio_base);
err_out_regions:
pci_release_regions(pdev);
err_out:
Expand Down
7 changes: 4 additions & 3 deletions trunk/drivers/scsi/sata_sil.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ static u32 sil_scr_read (struct ata_port *ap, unsigned int sc_reg);
static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
static void sil_post_set_mode (struct ata_port *ap);


static struct pci_device_id sil_pci_tbl[] = {
{ 0x1095, 0x3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w },
{ 0x1095, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w },
Expand Down Expand Up @@ -172,7 +173,7 @@ static struct ata_port_operations sil_ops = {
.scr_write = sil_scr_write,
.port_start = ata_port_start,
.port_stop = ata_port_stop,
.host_stop = ata_host_stop,
.host_stop = ata_pci_host_stop,
};

static struct ata_port_info sil_port_info[] = {
Expand Down Expand Up @@ -231,6 +232,7 @@ MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, sil_pci_tbl);
MODULE_VERSION(DRV_VERSION);


static unsigned char sil_get_device_cache_line(struct pci_dev *pdev)
{
u8 cache_line = 0;
Expand Down Expand Up @@ -426,8 +428,7 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
probe_ent->irq_flags = SA_SHIRQ;
probe_ent->host_flags = sil_port_info[ent->driver_data].host_flags;

mmio_base = ioremap(pci_resource_start(pdev, 5),
pci_resource_len(pdev, 5));
mmio_base = pci_iomap(pdev, 5, 0);
if (mmio_base == NULL) {
rc = -ENOMEM;
goto err_out_free_ent;
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/scsi/sata_svw.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ static struct ata_port_operations k2_sata_ops = {
.scr_write = k2_sata_scr_write,
.port_start = ata_port_start,
.port_stop = ata_port_stop,
.host_stop = ata_host_stop,
.host_stop = ata_pci_host_stop,
};

static void k2_sata_setup_port(struct ata_ioports *port, unsigned long base)
Expand Down Expand Up @@ -392,8 +392,7 @@ static int k2_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *e
probe_ent->dev = pci_dev_to_dev(pdev);
INIT_LIST_HEAD(&probe_ent->node);

mmio_base = ioremap(pci_resource_start(pdev, 5),
pci_resource_len(pdev, 5));
mmio_base = pci_iomap(pdev, 5, 0);
if (mmio_base == NULL) {
rc = -ENOMEM;
goto err_out_free_ent;
Expand Down
15 changes: 7 additions & 8 deletions trunk/drivers/scsi/sata_sx4.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,14 @@ static struct pci_driver pdc_sata_pci_driver = {

static void pdc20621_host_stop(struct ata_host_set *host_set)
{
struct pci_dev *pdev = to_pci_dev(host_set->dev);
struct pdc_host_priv *hpriv = host_set->private_data;
void *dimm_mmio = hpriv->dimm_mmio;

iounmap(dimm_mmio);
pci_iounmap(pdev, dimm_mmio);
kfree(hpriv);

ata_host_stop(host_set);
pci_iounmap(pdev, host_set->mmio_base);
}

static int pdc_port_start(struct ata_port *ap)
Expand Down Expand Up @@ -1418,8 +1419,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
probe_ent->dev = pci_dev_to_dev(pdev);
INIT_LIST_HEAD(&probe_ent->node);

mmio_base = ioremap(pci_resource_start(pdev, 3),
pci_resource_len(pdev, 3));
mmio_base = pci_iomap(pdev, 3, 0);
if (mmio_base == NULL) {
rc = -ENOMEM;
goto err_out_free_ent;
Expand All @@ -1433,8 +1433,7 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *
}
memset(hpriv, 0, sizeof(*hpriv));

dimm_mmio = ioremap(pci_resource_start(pdev, 4),
pci_resource_len(pdev, 4));
dimm_mmio = pci_iomap(pdev, 4, 0);
if (!dimm_mmio) {
kfree(hpriv);
rc = -ENOMEM;
Expand Down Expand Up @@ -1481,9 +1480,9 @@ static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *

err_out_iounmap_dimm: /* only get to this label if 20621 */
kfree(hpriv);
iounmap(dimm_mmio);
pci_iounmap(pdev, dimm_mmio);
err_out_iounmap:
iounmap(mmio_base);
pci_iounmap(pdev, mmio_base);
err_out_free_ent:
kfree(probe_ent);
err_out_regions:
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/scsi/sata_vsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static struct ata_port_operations vsc_sata_ops = {
.scr_write = vsc_sata_scr_write,
.port_start = ata_port_start,
.port_stop = ata_port_stop,
.host_stop = ata_host_stop,
.host_stop = ata_pci_host_stop,
};

static void __devinit vsc_sata_setup_port(struct ata_ioports *port, unsigned long base)
Expand Down Expand Up @@ -326,8 +326,7 @@ static int __devinit vsc_sata_init_one (struct pci_dev *pdev, const struct pci_d
probe_ent->dev = pci_dev_to_dev(pdev);
INIT_LIST_HEAD(&probe_ent->node);

mmio_base = ioremap(pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0));
mmio_base = pci_iomap(pdev, 0, 0);
if (mmio_base == NULL) {
rc = -ENOMEM;
goto err_out_free_ent;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ struct pci_bits {
unsigned long val;
};

extern void ata_pci_host_stop (struct ata_host_set *host_set);
extern struct ata_probe_ent *
ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port);
extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits);
Expand Down

0 comments on commit b31ab85

Please sign in to comment.