Commit 2ad2225a authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] mesh iomem annotations

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 39087943
...@@ -144,9 +144,9 @@ struct mesh_target { ...@@ -144,9 +144,9 @@ struct mesh_target {
}; };
struct mesh_state { struct mesh_state {
volatile struct mesh_regs *mesh; volatile struct mesh_regs __iomem *mesh;
int meshintr; int meshintr;
volatile struct dbdma_regs *dma; volatile struct dbdma_regs __iomem *dma;
int dmaintr; int dmaintr;
struct Scsi_Host *host; struct Scsi_Host *host;
struct mesh_state *next; struct mesh_state *next;
...@@ -304,8 +304,8 @@ static inline void dumpslog(struct mesh_state *ms) ...@@ -304,8 +304,8 @@ static inline void dumpslog(struct mesh_state *ms)
static void static void
mesh_dump_regs(struct mesh_state *ms) mesh_dump_regs(struct mesh_state *ms)
{ {
volatile struct mesh_regs *mr = ms->mesh; volatile struct mesh_regs __iomem *mr = ms->mesh;
volatile struct dbdma_regs *md = ms->dma; volatile struct dbdma_regs __iomem *md = ms->dma;
int t; int t;
struct mesh_target *tp; struct mesh_target *tp;
...@@ -338,7 +338,7 @@ mesh_dump_regs(struct mesh_state *ms) ...@@ -338,7 +338,7 @@ mesh_dump_regs(struct mesh_state *ms)
/* /*
* Flush write buffers on the bus path to the mesh * Flush write buffers on the bus path to the mesh
*/ */
static inline void mesh_flush_io(volatile struct mesh_regs *mr) static inline void mesh_flush_io(volatile struct mesh_regs __iomem *mr)
{ {
(void)in_8(&mr->mesh_id); (void)in_8(&mr->mesh_id);
} }
...@@ -359,8 +359,8 @@ static void mesh_completed(struct mesh_state *ms, struct scsi_cmnd *cmd) ...@@ -359,8 +359,8 @@ static void mesh_completed(struct mesh_state *ms, struct scsi_cmnd *cmd)
*/ */
static void mesh_init(struct mesh_state *ms) static void mesh_init(struct mesh_state *ms)
{ {
volatile struct mesh_regs *mr = ms->mesh; volatile struct mesh_regs __iomem *mr = ms->mesh;
volatile struct dbdma_regs *md = ms->dma; volatile struct dbdma_regs __iomem *md = ms->dma;
mesh_flush_io(mr); mesh_flush_io(mr);
udelay(100); udelay(100);
...@@ -406,7 +406,7 @@ static void mesh_init(struct mesh_state *ms) ...@@ -406,7 +406,7 @@ static void mesh_init(struct mesh_state *ms)
static void mesh_start_cmd(struct mesh_state *ms, struct scsi_cmnd *cmd) static void mesh_start_cmd(struct mesh_state *ms, struct scsi_cmnd *cmd)
{ {
volatile struct mesh_regs *mr = ms->mesh; volatile struct mesh_regs __iomem *mr = ms->mesh;
int t, id; int t, id;
id = cmd->device->id; id = cmd->device->id;
...@@ -467,7 +467,7 @@ static void mesh_start_cmd(struct mesh_state *ms, struct scsi_cmnd *cmd) ...@@ -467,7 +467,7 @@ static void mesh_start_cmd(struct mesh_state *ms, struct scsi_cmnd *cmd)
dlog(ms, "intr b4 arb, intr/exc/err/fc=%.8x", dlog(ms, "intr b4 arb, intr/exc/err/fc=%.8x",
MKWORD(mr->interrupt, mr->exception, MKWORD(mr->interrupt, mr->exception,
mr->error, mr->fifo_count)); mr->error, mr->fifo_count));
mesh_interrupt(0, (void *)ms, 0); mesh_interrupt(0, (void *)ms, NULL);
if (ms->phase != arbitrating) if (ms->phase != arbitrating)
return; return;
} }
...@@ -505,7 +505,7 @@ static void mesh_start_cmd(struct mesh_state *ms, struct scsi_cmnd *cmd) ...@@ -505,7 +505,7 @@ static void mesh_start_cmd(struct mesh_state *ms, struct scsi_cmnd *cmd)
dlog(ms, "intr after disresel, intr/exc/err/fc=%.8x", dlog(ms, "intr after disresel, intr/exc/err/fc=%.8x",
MKWORD(mr->interrupt, mr->exception, MKWORD(mr->interrupt, mr->exception,
mr->error, mr->fifo_count)); mr->error, mr->fifo_count));
mesh_interrupt(0, (void *)ms, 0); mesh_interrupt(0, (void *)ms, NULL);
if (ms->phase != arbitrating) if (ms->phase != arbitrating)
return; return;
dlog(ms, "after intr after disresel, intr/exc/err/fc=%.8x", dlog(ms, "after intr after disresel, intr/exc/err/fc=%.8x",
...@@ -595,8 +595,8 @@ static void mesh_done(struct mesh_state *ms, int start_next) ...@@ -595,8 +595,8 @@ static void mesh_done(struct mesh_state *ms, int start_next)
struct mesh_target *tp = &ms->tgts[ms->conn_tgt]; struct mesh_target *tp = &ms->tgts[ms->conn_tgt];
cmd = ms->current_req; cmd = ms->current_req;
ms->current_req = 0; ms->current_req = NULL;
tp->current_req = 0; tp->current_req = NULL;
if (cmd) { if (cmd) {
cmd->result = (ms->stat << 16) + cmd->SCp.Status; cmd->result = (ms->stat << 16) + cmd->SCp.Status;
if (ms->stat == DID_OK) if (ms->stat == DID_OK)
...@@ -638,7 +638,7 @@ static inline void add_sdtr_msg(struct mesh_state *ms) ...@@ -638,7 +638,7 @@ static inline void add_sdtr_msg(struct mesh_state *ms)
static void set_sdtr(struct mesh_state *ms, int period, int offset) static void set_sdtr(struct mesh_state *ms, int period, int offset)
{ {
struct mesh_target *tp = &ms->tgts[ms->conn_tgt]; struct mesh_target *tp = &ms->tgts[ms->conn_tgt];
volatile struct mesh_regs *mr = ms->mesh; volatile struct mesh_regs __iomem *mr = ms->mesh;
int v, tr; int v, tr;
tp->sdtr_state = sdtr_done; tp->sdtr_state = sdtr_done;
...@@ -679,8 +679,8 @@ static void set_sdtr(struct mesh_state *ms, int period, int offset) ...@@ -679,8 +679,8 @@ static void set_sdtr(struct mesh_state *ms, int period, int offset)
static void start_phase(struct mesh_state *ms) static void start_phase(struct mesh_state *ms)
{ {
int i, seq, nb; int i, seq, nb;
volatile struct mesh_regs *mr = ms->mesh; volatile struct mesh_regs __iomem *mr = ms->mesh;
volatile struct dbdma_regs *md = ms->dma; volatile struct dbdma_regs __iomem *md = ms->dma;
struct scsi_cmnd *cmd = ms->current_req; struct scsi_cmnd *cmd = ms->current_req;
struct mesh_target *tp = &ms->tgts[ms->conn_tgt]; struct mesh_target *tp = &ms->tgts[ms->conn_tgt];
...@@ -823,7 +823,7 @@ static void start_phase(struct mesh_state *ms) ...@@ -823,7 +823,7 @@ static void start_phase(struct mesh_state *ms)
static inline void get_msgin(struct mesh_state *ms) static inline void get_msgin(struct mesh_state *ms)
{ {
volatile struct mesh_regs *mr = ms->mesh; volatile struct mesh_regs __iomem *mr = ms->mesh;
int i, n; int i, n;
n = mr->fifo_count; n = mr->fifo_count;
...@@ -855,7 +855,7 @@ static inline int msgin_length(struct mesh_state *ms) ...@@ -855,7 +855,7 @@ static inline int msgin_length(struct mesh_state *ms)
static void reselected(struct mesh_state *ms) static void reselected(struct mesh_state *ms)
{ {
volatile struct mesh_regs *mr = ms->mesh; volatile struct mesh_regs __iomem *mr = ms->mesh;
struct scsi_cmnd *cmd; struct scsi_cmnd *cmd;
struct mesh_target *tp; struct mesh_target *tp;
int b, t, prev; int b, t, prev;
...@@ -988,7 +988,7 @@ static void handle_reset(struct mesh_state *ms) ...@@ -988,7 +988,7 @@ static void handle_reset(struct mesh_state *ms)
int tgt; int tgt;
struct mesh_target *tp; struct mesh_target *tp;
struct scsi_cmnd *cmd; struct scsi_cmnd *cmd;
volatile struct mesh_regs *mr = ms->mesh; volatile struct mesh_regs __iomem *mr = ms->mesh;
for (tgt = 0; tgt < 8; ++tgt) { for (tgt = 0; tgt < 8; ++tgt) {
tp = &ms->tgts[tgt]; tp = &ms->tgts[tgt];
...@@ -1030,7 +1030,7 @@ static irqreturn_t do_mesh_interrupt(int irq, void *dev_id, struct pt_regs *ptre ...@@ -1030,7 +1030,7 @@ static irqreturn_t do_mesh_interrupt(int irq, void *dev_id, struct pt_regs *ptre
static void handle_error(struct mesh_state *ms) static void handle_error(struct mesh_state *ms)
{ {
int err, exc, count; int err, exc, count;
volatile struct mesh_regs *mr = ms->mesh; volatile struct mesh_regs __iomem *mr = ms->mesh;
err = in_8(&mr->error); err = in_8(&mr->error);
exc = in_8(&mr->exception); exc = in_8(&mr->exception);
...@@ -1124,7 +1124,7 @@ static void handle_error(struct mesh_state *ms) ...@@ -1124,7 +1124,7 @@ static void handle_error(struct mesh_state *ms)
static void handle_exception(struct mesh_state *ms) static void handle_exception(struct mesh_state *ms)
{ {
int exc; int exc;
volatile struct mesh_regs *mr = ms->mesh; volatile struct mesh_regs __iomem *mr = ms->mesh;
exc = in_8(&mr->exception); exc = in_8(&mr->exception);
out_8(&mr->interrupt, INT_EXCEPTION | INT_CMDDONE); out_8(&mr->interrupt, INT_EXCEPTION | INT_CMDDONE);
...@@ -1324,8 +1324,8 @@ static void set_dma_cmds(struct mesh_state *ms, struct scsi_cmnd *cmd) ...@@ -1324,8 +1324,8 @@ static void set_dma_cmds(struct mesh_state *ms, struct scsi_cmnd *cmd)
static void halt_dma(struct mesh_state *ms) static void halt_dma(struct mesh_state *ms)
{ {
volatile struct dbdma_regs *md = ms->dma; volatile struct dbdma_regs __iomem *md = ms->dma;
volatile struct mesh_regs *mr = ms->mesh; volatile struct mesh_regs __iomem *mr = ms->mesh;
struct scsi_cmnd *cmd = ms->current_req; struct scsi_cmnd *cmd = ms->current_req;
int t, nb; int t, nb;
...@@ -1373,7 +1373,7 @@ static void halt_dma(struct mesh_state *ms) ...@@ -1373,7 +1373,7 @@ static void halt_dma(struct mesh_state *ms)
static void phase_mismatch(struct mesh_state *ms) static void phase_mismatch(struct mesh_state *ms)
{ {
volatile struct mesh_regs *mr = ms->mesh; volatile struct mesh_regs __iomem *mr = ms->mesh;
int phase; int phase;
dlog(ms, "phasemm ch/cl/seq/fc=%.8x", dlog(ms, "phasemm ch/cl/seq/fc=%.8x",
...@@ -1452,7 +1452,7 @@ static void phase_mismatch(struct mesh_state *ms) ...@@ -1452,7 +1452,7 @@ static void phase_mismatch(struct mesh_state *ms)
static void cmd_complete(struct mesh_state *ms) static void cmd_complete(struct mesh_state *ms)
{ {
volatile struct mesh_regs *mr = ms->mesh; volatile struct mesh_regs __iomem *mr = ms->mesh;
struct scsi_cmnd *cmd = ms->current_req; struct scsi_cmnd *cmd = ms->current_req;
struct mesh_target *tp = &ms->tgts[ms->conn_tgt]; struct mesh_target *tp = &ms->tgts[ms->conn_tgt];
int seq, n, t; int seq, n, t;
...@@ -1618,7 +1618,7 @@ static void cmd_complete(struct mesh_state *ms) ...@@ -1618,7 +1618,7 @@ static void cmd_complete(struct mesh_state *ms)
mesh_done(ms, 1); mesh_done(ms, 1);
return; return;
case disconnecting: case disconnecting:
ms->current_req = 0; ms->current_req = NULL;
ms->phase = idle; ms->phase = idle;
mesh_start(ms); mesh_start(ms);
return; return;
...@@ -1665,7 +1665,7 @@ static int mesh_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) ...@@ -1665,7 +1665,7 @@ static int mesh_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
static void mesh_interrupt(int irq, void *dev_id, struct pt_regs *ptregs) static void mesh_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
{ {
struct mesh_state *ms = (struct mesh_state *) dev_id; struct mesh_state *ms = (struct mesh_state *) dev_id;
volatile struct mesh_regs *mr = ms->mesh; volatile struct mesh_regs __iomem *mr = ms->mesh;
int intr; int intr;
#if 0 #if 0
...@@ -1713,8 +1713,8 @@ static int mesh_abort(struct scsi_cmnd *cmd) ...@@ -1713,8 +1713,8 @@ static int mesh_abort(struct scsi_cmnd *cmd)
static int mesh_host_reset(struct scsi_cmnd *cmd) static int mesh_host_reset(struct scsi_cmnd *cmd)
{ {
struct mesh_state *ms = (struct mesh_state *) cmd->device->host->hostdata; struct mesh_state *ms = (struct mesh_state *) cmd->device->host->hostdata;
volatile struct mesh_regs *mr = ms->mesh; volatile struct mesh_regs __iomem *mr = ms->mesh;
volatile struct dbdma_regs *md = ms->dma; volatile struct dbdma_regs __iomem *md = ms->dma;
printk(KERN_DEBUG "mesh_host_reset\n"); printk(KERN_DEBUG "mesh_host_reset\n");
...@@ -1813,7 +1813,7 @@ static int mesh_resume(struct macio_dev *mdev) ...@@ -1813,7 +1813,7 @@ static int mesh_resume(struct macio_dev *mdev)
static int mesh_shutdown(struct macio_dev *mdev) static int mesh_shutdown(struct macio_dev *mdev)
{ {
struct mesh_state *ms = (struct mesh_state *)macio_get_drvdata(mdev); struct mesh_state *ms = (struct mesh_state *)macio_get_drvdata(mdev);
volatile struct mesh_regs *mr; volatile struct mesh_regs __iomem *mr;
unsigned long flags; unsigned long flags;
printk(KERN_INFO "resetting MESH scsi bus(es)\n"); printk(KERN_INFO "resetting MESH scsi bus(es)\n");
...@@ -1892,17 +1892,15 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_match *match) ...@@ -1892,17 +1892,15 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_match *match)
ms->mdev = mdev; ms->mdev = mdev;
ms->pdev = pdev; ms->pdev = pdev;
ms->mesh = (volatile struct mesh_regs *) ms->mesh = ioremap(macio_resource_start(mdev, 0), 0x1000);
ioremap(macio_resource_start(mdev, 0), 0x1000);
if (ms->mesh == NULL) { if (ms->mesh == NULL) {
printk(KERN_ERR "mesh: can't map registers\n"); printk(KERN_ERR "mesh: can't map registers\n");
goto out_free; goto out_free;
} }
ms->dma = (volatile struct dbdma_regs *) ms->dma = ioremap(macio_resource_start(mdev, 1), 0x1000);
ioremap(macio_resource_start(mdev, 1), 0x1000);
if (ms->dma == NULL) { if (ms->dma == NULL) {
printk(KERN_ERR "mesh: can't map registers\n"); printk(KERN_ERR "mesh: can't map registers\n");
iounmap((void *)ms->mesh); iounmap(ms->mesh);
goto out_free; goto out_free;
} }
...@@ -1934,7 +1932,7 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_match *match) ...@@ -1934,7 +1932,7 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_match *match)
for (tgt = 0; tgt < 8; ++tgt) { for (tgt = 0; tgt < 8; ++tgt) {
ms->tgts[tgt].sdtr_state = do_sdtr; ms->tgts[tgt].sdtr_state = do_sdtr;
ms->tgts[tgt].sync_params = ASYNC_PARAMS; ms->tgts[tgt].sync_params = ASYNC_PARAMS;
ms->tgts[tgt].current_req = 0; ms->tgts[tgt].current_req = NULL;
} }
if ((cfp = (int *) get_property(mesh, "clock-frequency", NULL))) if ((cfp = (int *) get_property(mesh, "clock-frequency", NULL)))
...@@ -1968,8 +1966,8 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_match *match) ...@@ -1968,8 +1966,8 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_match *match)
return 0; return 0;
out_unmap: out_unmap:
iounmap((void *)ms->dma); iounmap(ms->dma);
iounmap((void *)ms->mesh); iounmap(ms->mesh);
out_free: out_free:
scsi_host_put(mesh_host); scsi_host_put(mesh_host);
out_release: out_release:
...@@ -1994,8 +1992,8 @@ static int mesh_remove(struct macio_dev *mdev) ...@@ -1994,8 +1992,8 @@ static int mesh_remove(struct macio_dev *mdev)
set_mesh_power(ms, 0); set_mesh_power(ms, 0);
/* Unmap registers & dma controller */ /* Unmap registers & dma controller */
iounmap((void *) ms->mesh); iounmap(ms->mesh);
iounmap((void *) ms->dma); iounmap(ms->dma);
/* Free DMA commands memory */ /* Free DMA commands memory */
pci_free_consistent(macio_get_pci_dev(mdev), ms->dma_cmd_size, pci_free_consistent(macio_get_pci_dev(mdev), ms->dma_cmd_size,
......
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