Commit b797cab3 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] ipr iomem annotations

	Annotated.  Original reused the structure that contained pointers into
remapped iomem for storing offsets in such area, so we need to split that
beast.
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a0975992
...@@ -5433,7 +5433,7 @@ static void ipr_free_all_resources(struct ipr_ioa_cfg *ioa_cfg) ...@@ -5433,7 +5433,7 @@ static void ipr_free_all_resources(struct ipr_ioa_cfg *ioa_cfg)
ENTER; ENTER;
free_irq(pdev->irq, ioa_cfg); free_irq(pdev->irq, ioa_cfg);
iounmap((void *) ioa_cfg->hdw_dma_regs); iounmap(ioa_cfg->hdw_dma_regs);
pci_release_regions(pdev); pci_release_regions(pdev);
ipr_free_mem(ioa_cfg); ipr_free_mem(ioa_cfg);
scsi_host_put(ioa_cfg->host); scsi_host_put(ioa_cfg->host);
...@@ -5624,6 +5624,10 @@ static void __devinit ipr_initialize_bus_attr(struct ipr_ioa_cfg *ioa_cfg) ...@@ -5624,6 +5624,10 @@ static void __devinit ipr_initialize_bus_attr(struct ipr_ioa_cfg *ioa_cfg)
static void __devinit ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg, static void __devinit ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg,
struct Scsi_Host *host, struct pci_dev *pdev) struct Scsi_Host *host, struct pci_dev *pdev)
{ {
const struct ipr_interrupt_offsets *p;
struct ipr_interrupts *t;
void __iomem *base;
ioa_cfg->host = host; ioa_cfg->host = host;
ioa_cfg->pdev = pdev; ioa_cfg->pdev = pdev;
ioa_cfg->log_level = ipr_log_level; ioa_cfg->log_level = ipr_log_level;
...@@ -5655,17 +5659,19 @@ static void __devinit ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg, ...@@ -5655,17 +5659,19 @@ static void __devinit ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg,
host->max_cmd_len = IPR_MAX_CDB_LEN; host->max_cmd_len = IPR_MAX_CDB_LEN;
pci_set_drvdata(pdev, ioa_cfg); pci_set_drvdata(pdev, ioa_cfg);
memcpy(&ioa_cfg->regs, &ioa_cfg->chip_cfg->regs, sizeof(ioa_cfg->regs)); p = &ioa_cfg->chip_cfg->regs;
t = &ioa_cfg->regs;
base = ioa_cfg->hdw_dma_regs;
ioa_cfg->regs.set_interrupt_mask_reg += ioa_cfg->hdw_dma_regs; t->set_interrupt_mask_reg = base + p->set_interrupt_mask_reg;
ioa_cfg->regs.clr_interrupt_mask_reg += ioa_cfg->hdw_dma_regs; t->clr_interrupt_mask_reg = base + p->clr_interrupt_mask_reg;
ioa_cfg->regs.sense_interrupt_mask_reg += ioa_cfg->hdw_dma_regs; t->sense_interrupt_mask_reg = base + p->sense_interrupt_mask_reg;
ioa_cfg->regs.clr_interrupt_reg += ioa_cfg->hdw_dma_regs; t->clr_interrupt_reg = base + p->clr_interrupt_reg;
ioa_cfg->regs.sense_interrupt_reg += ioa_cfg->hdw_dma_regs; t->sense_interrupt_reg = base + p->sense_interrupt_reg;
ioa_cfg->regs.ioarrin_reg += ioa_cfg->hdw_dma_regs; t->ioarrin_reg = base + p->ioarrin_reg;
ioa_cfg->regs.sense_uproc_interrupt_reg += ioa_cfg->hdw_dma_regs; t->sense_uproc_interrupt_reg = base + p->sense_uproc_interrupt_reg;
ioa_cfg->regs.set_uproc_interrupt_reg += ioa_cfg->hdw_dma_regs; t->set_uproc_interrupt_reg = base + p->set_uproc_interrupt_reg;
ioa_cfg->regs.clr_uproc_interrupt_reg += ioa_cfg->hdw_dma_regs; t->clr_uproc_interrupt_reg = base + p->clr_uproc_interrupt_reg;
} }
/** /**
...@@ -5681,7 +5687,8 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev, ...@@ -5681,7 +5687,8 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev,
{ {
struct ipr_ioa_cfg *ioa_cfg; struct ipr_ioa_cfg *ioa_cfg;
struct Scsi_Host *host; struct Scsi_Host *host;
unsigned long ipr_regs, ipr_regs_pci; unsigned long ipr_regs_pci;
void __iomem *ipr_regs;
u32 rc = PCIBIOS_SUCCESSFUL; u32 rc = PCIBIOS_SUCCESSFUL;
ENTER; ENTER;
...@@ -5715,8 +5722,7 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev, ...@@ -5715,8 +5722,7 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev,
goto out_scsi_host_put; goto out_scsi_host_put;
} }
ipr_regs = (unsigned long)ioremap(ipr_regs_pci, ipr_regs = ioremap(ipr_regs_pci, pci_resource_len(pdev, 0));
pci_resource_len(pdev, 0));
if (!ipr_regs) { if (!ipr_regs) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
...@@ -5790,7 +5796,7 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev, ...@@ -5790,7 +5796,7 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev,
cleanup_nolog: cleanup_nolog:
ipr_free_mem(ioa_cfg); ipr_free_mem(ioa_cfg);
cleanup_nomem: cleanup_nomem:
iounmap((void *) ipr_regs); iounmap(ipr_regs);
out_release_regions: out_release_regions:
pci_release_regions(pdev); pci_release_regions(pdev);
out_scsi_host_put: out_scsi_host_put:
......
...@@ -749,7 +749,7 @@ struct ipr_misc_cbs { ...@@ -749,7 +749,7 @@ struct ipr_misc_cbs {
struct ipr_supported_device supp_dev; struct ipr_supported_device supp_dev;
}; };
struct ipr_interrupts { struct ipr_interrupt_offsets {
unsigned long set_interrupt_mask_reg; unsigned long set_interrupt_mask_reg;
unsigned long clr_interrupt_mask_reg; unsigned long clr_interrupt_mask_reg;
unsigned long sense_interrupt_mask_reg; unsigned long sense_interrupt_mask_reg;
...@@ -762,10 +762,23 @@ struct ipr_interrupts { ...@@ -762,10 +762,23 @@ struct ipr_interrupts {
unsigned long clr_uproc_interrupt_reg; unsigned long clr_uproc_interrupt_reg;
}; };
struct ipr_interrupts {
void __iomem *set_interrupt_mask_reg;
void __iomem *clr_interrupt_mask_reg;
void __iomem *sense_interrupt_mask_reg;
void __iomem *clr_interrupt_reg;
void __iomem *sense_interrupt_reg;
void __iomem *ioarrin_reg;
void __iomem *sense_uproc_interrupt_reg;
void __iomem *set_uproc_interrupt_reg;
void __iomem *clr_uproc_interrupt_reg;
};
struct ipr_chip_cfg_t { struct ipr_chip_cfg_t {
u32 mailbox; u32 mailbox;
u8 cache_line_size; u8 cache_line_size;
struct ipr_interrupts regs; struct ipr_interrupt_offsets regs;
}; };
enum ipr_shutdown_type { enum ipr_shutdown_type {
...@@ -884,9 +897,9 @@ struct ipr_ioa_cfg { ...@@ -884,9 +897,9 @@ struct ipr_ioa_cfg {
const struct ipr_chip_cfg_t *chip_cfg; const struct ipr_chip_cfg_t *chip_cfg;
unsigned long hdw_dma_regs; /* iomapped PCI memory space */ void __iomem *hdw_dma_regs; /* iomapped PCI memory space */
unsigned long hdw_dma_regs_pci; /* raw PCI memory space */ unsigned long hdw_dma_regs_pci; /* raw PCI memory space */
unsigned long ioa_mailbox; void __iomem *ioa_mailbox;
struct ipr_interrupts regs; struct ipr_interrupts regs;
u16 saved_pcix_cmd_reg; u16 saved_pcix_cmd_reg;
......
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