Skip to content

Commit 931fc82

Browse files
Finn Thaingeertu
authored andcommitted
m68k: mac: Fix IOP status/control register writes
When writing values to the IOP status/control register make sure those values do not have any extraneous bits that will clear interrupt flags. To place the SCC IOP into bypass mode would be desirable but this is not achieved by writing IOP_DMAINACTIVE | IOP_RUN | IOP_AUTOINC | IOP_BYPASS to the control register. Drop this ineffective register write. Remove the flawed and unused iop_bypass() function. Make use of the unused iop_stop() function. Fixes: 1da177e ("Linux-2.6.12-rc2") Signed-off-by: Finn Thain <[email protected]> Tested-by: Stan Johnson <[email protected]> Cc: Joshua Thompson <[email protected]> Link: https://lore.kernel.org/r/09bcb7359a1719a18b551ee515da3c4c3cf709e6.1590880333.git.fthain@telegraphics.com.au Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent aeb445b commit 931fc82

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

arch/m68k/mac/iop.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,22 +183,17 @@ static __inline__ void iop_writeb(volatile struct mac_iop *iop, __u16 addr, __u8
183183

184184
static __inline__ void iop_stop(volatile struct mac_iop *iop)
185185
{
186-
iop->status_ctrl &= ~IOP_RUN;
186+
iop->status_ctrl = IOP_AUTOINC;
187187
}
188188

189189
static __inline__ void iop_start(volatile struct mac_iop *iop)
190190
{
191191
iop->status_ctrl = IOP_RUN | IOP_AUTOINC;
192192
}
193193

194-
static __inline__ void iop_bypass(volatile struct mac_iop *iop)
195-
{
196-
iop->status_ctrl |= IOP_BYPASS;
197-
}
198-
199194
static __inline__ void iop_interrupt(volatile struct mac_iop *iop)
200195
{
201-
iop->status_ctrl |= IOP_IRQ;
196+
iop->status_ctrl = IOP_IRQ | IOP_RUN | IOP_AUTOINC;
202197
}
203198

204199
static int iop_alive(volatile struct mac_iop *iop)
@@ -244,7 +239,6 @@ void __init iop_preinit(void)
244239
} else {
245240
iop_base[IOP_NUM_SCC] = (struct mac_iop *) SCC_IOP_BASE_QUADRA;
246241
}
247-
iop_base[IOP_NUM_SCC]->status_ctrl = 0x87;
248242
iop_scc_present = 1;
249243
} else {
250244
iop_base[IOP_NUM_SCC] = NULL;
@@ -256,7 +250,7 @@ void __init iop_preinit(void)
256250
} else {
257251
iop_base[IOP_NUM_ISM] = (struct mac_iop *) ISM_IOP_BASE_QUADRA;
258252
}
259-
iop_base[IOP_NUM_ISM]->status_ctrl = 0;
253+
iop_stop(iop_base[IOP_NUM_ISM]);
260254
iop_ism_present = 1;
261255
} else {
262256
iop_base[IOP_NUM_ISM] = NULL;

0 commit comments

Comments
 (0)