Skip to content

Commit 950f564

Browse files
committed
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/ide-2.6
2 parents b1681c5 + 8495fb1 commit 950f564

6 files changed

Lines changed: 81 additions & 63 deletions

File tree

‎Documentation/cdrom/ide-cd‎

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -159,42 +159,7 @@ two arguments: the CDROM device, and the slot number to which you wish
159159
to change. If the slot number is -1, the drive is unloaded.
160160

161161

162-
4. Compilation options
163-
----------------------
164-
165-
There are a few additional options which can be set when compiling the
166-
driver. Most people should not need to mess with any of these; they
167-
are listed here simply for completeness. A compilation option can be
168-
enabled by adding a line of the form `#define <option> 1' to the top
169-
of ide-cd.c. All these options are disabled by default.
170-
171-
VERBOSE_IDE_CD_ERRORS
172-
If this is set, ATAPI error codes will be translated into textual
173-
descriptions. In addition, a dump is made of the command which
174-
provoked the error. This is off by default to save the memory used
175-
by the (somewhat long) table of error descriptions.
176-
177-
STANDARD_ATAPI
178-
If this is set, the code needed to deal with certain drives which do
179-
not properly implement the ATAPI spec will be disabled. If you know
180-
your drive implements ATAPI properly, you can turn this on to get a
181-
slightly smaller kernel.
182-
183-
NO_DOOR_LOCKING
184-
If this is set, the driver will never attempt to lock the door of
185-
the drive.
186-
187-
CDROM_NBLOCKS_BUFFER
188-
This sets the size of the buffer to be used for a CDROMREADAUDIO
189-
ioctl. The default is 8.
190-
191-
TEST
192-
This currently enables an additional ioctl which enables a user-mode
193-
program to execute an arbitrary packet command. See the source for
194-
details. This should be left off unless you know what you're doing.
195-
196-
197-
5. Common problems
162+
4. Common problems
198163
------------------
199164

200165
This section discusses some common problems encountered when trying to
@@ -371,7 +336,7 @@ f. Data corruption.
371336
expense of low system performance.
372337

373338

374-
6. cdchange.c
339+
5. cdchange.c
375340
-------------
376341

377342
/*

‎drivers/ide/cmd640.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ static void cmd640_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
606606
}
607607
#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
608608

609-
static void cmd640_init_dev(ide_drive_t *drive)
609+
static void __init cmd640_init_dev(ide_drive_t *drive)
610610
{
611611
unsigned int i = drive->hwif->channel * 2 + (drive->dn & 1);
612612

‎drivers/ide/icside.c‎

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ static struct cardinfo icside_cardinfo_v6_2 = {
6565
};
6666

6767
struct icside_state {
68+
unsigned int channel;
69+
unsigned int enabled;
6870
void __iomem *irq_port;
6971
void __iomem *ioc_base;
7072
unsigned int sel;
@@ -114,11 +116,18 @@ static void icside_irqenable_arcin_v6 (struct expansion_card *ec, int irqnr)
114116
struct icside_state *state = ec->irq_data;
115117
void __iomem *base = state->irq_port;
116118

117-
writeb(0, base + ICS_ARCIN_V6_INTROFFSET_1);
118-
readb(base + ICS_ARCIN_V6_INTROFFSET_2);
119+
state->enabled = 1;
119120

120-
writeb(0, base + ICS_ARCIN_V6_INTROFFSET_2);
121-
readb(base + ICS_ARCIN_V6_INTROFFSET_1);
121+
switch (state->channel) {
122+
case 0:
123+
writeb(0, base + ICS_ARCIN_V6_INTROFFSET_1);
124+
readb(base + ICS_ARCIN_V6_INTROFFSET_2);
125+
break;
126+
case 1:
127+
writeb(0, base + ICS_ARCIN_V6_INTROFFSET_2);
128+
readb(base + ICS_ARCIN_V6_INTROFFSET_1);
129+
break;
130+
}
122131
}
123132

124133
/* Prototype: icside_irqdisable_arcin_v6 (struct expansion_card *ec, int irqnr)
@@ -128,6 +137,8 @@ static void icside_irqdisable_arcin_v6 (struct expansion_card *ec, int irqnr)
128137
{
129138
struct icside_state *state = ec->irq_data;
130139

140+
state->enabled = 0;
141+
131142
readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_1);
132143
readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_2);
133144
}
@@ -149,6 +160,44 @@ static const expansioncard_ops_t icside_ops_arcin_v6 = {
149160
.irqpending = icside_irqpending_arcin_v6,
150161
};
151162

163+
/*
164+
* Handle routing of interrupts. This is called before
165+
* we write the command to the drive.
166+
*/
167+
static void icside_maskproc(ide_drive_t *drive, int mask)
168+
{
169+
ide_hwif_t *hwif = drive->hwif;
170+
struct expansion_card *ec = ECARD_DEV(hwif->dev);
171+
struct icside_state *state = ecard_get_drvdata(ec);
172+
unsigned long flags;
173+
174+
local_irq_save(flags);
175+
176+
state->channel = hwif->channel;
177+
178+
if (state->enabled && !mask) {
179+
switch (hwif->channel) {
180+
case 0:
181+
writeb(0, state->irq_port + ICS_ARCIN_V6_INTROFFSET_1);
182+
readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_2);
183+
break;
184+
case 1:
185+
writeb(0, state->irq_port + ICS_ARCIN_V6_INTROFFSET_2);
186+
readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_1);
187+
break;
188+
}
189+
} else {
190+
readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_2);
191+
readb(state->irq_port + ICS_ARCIN_V6_INTROFFSET_1);
192+
}
193+
194+
local_irq_restore(flags);
195+
}
196+
197+
static const struct ide_port_ops icside_v6_no_dma_port_ops = {
198+
.maskproc = icside_maskproc,
199+
};
200+
152201
#ifdef CONFIG_BLK_DEV_IDEDMA_ICS
153202
/*
154203
* SG-DMA support.
@@ -229,6 +278,7 @@ static void icside_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive)
229278

230279
static const struct ide_port_ops icside_v6_port_ops = {
231280
.set_dma_mode = icside_set_dma_mode,
281+
.maskproc = icside_maskproc,
232282
};
233283

234284
static void icside_dma_host_set(ide_drive_t *drive, int on)
@@ -272,6 +322,11 @@ static int icside_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
272322
*/
273323
BUG_ON(dma_channel_active(ec->dma));
274324

325+
/*
326+
* Ensure that we have the right interrupt routed.
327+
*/
328+
icside_maskproc(drive, 0);
329+
275330
/*
276331
* Route the DMA signals to the correct interface.
277332
*/
@@ -400,6 +455,7 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec)
400455

401456
static const struct ide_port_info icside_v6_port_info __initdata = {
402457
.init_dma = icside_dma_off_init,
458+
.port_ops = &icside_v6_no_dma_port_ops,
403459
.dma_ops = &icside_v6_dma_ops,
404460
.host_flags = IDE_HFLAG_SERIALIZE | IDE_HFLAG_MMIO,
405461
.mwdma_mask = ATA_MWDMA2,

‎drivers/ide/ide-cs.c‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,11 @@ static int ide_probe(struct pcmcia_device *link)
121121
static void ide_detach(struct pcmcia_device *link)
122122
{
123123
ide_info_t *info = link->priv;
124-
ide_hwif_t *hwif = info->host->ports[0];
125-
unsigned long data_addr, ctl_addr;
126124

127125
dev_dbg(&link->dev, "ide_detach(0x%p)\n", link);
128126

129-
data_addr = hwif->io_ports.data_addr;
130-
ctl_addr = hwif->io_ports.ctl_addr;
131-
132127
ide_release(link);
133128

134-
release_region(ctl_addr, 1);
135-
release_region(data_addr, 8);
136-
137129
kfree(info);
138130
} /* ide_detach */
139131

@@ -354,12 +346,19 @@ static void ide_release(struct pcmcia_device *link)
354346

355347
dev_dbg(&link->dev, "ide_release(0x%p)\n", link);
356348

357-
if (info->ndev)
358-
/* FIXME: if this fails we need to queue the cleanup somehow
359-
-- need to investigate the required PCMCIA magic */
349+
if (info->ndev) {
350+
ide_hwif_t *hwif = host->ports[0];
351+
unsigned long data_addr, ctl_addr;
352+
353+
data_addr = hwif->io_ports.data_addr;
354+
ctl_addr = hwif->io_ports.ctl_addr;
355+
360356
ide_host_remove(host);
357+
info->ndev = 0;
361358

362-
info->ndev = 0;
359+
release_region(ctl_addr, 1);
360+
release_region(data_addr, 8);
361+
}
363362

364363
pcmcia_disable_device(link);
365364
} /* ide_release */

‎drivers/ide/pdc202xx_old.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ static int pdc202xx_test_irq(ide_hwif_t *hwif)
9393
* bit 7: error, bit 6: interrupting,
9494
* bit 5: FIFO full, bit 4: FIFO empty
9595
*/
96-
return ((sc1d & 0x50) == 0x40) ? 1 : 0;
96+
return ((sc1d & 0x50) == 0x50) ? 1 : 0;
9797
} else {
9898
/*
9999
* bit 3: error, bit 2: interrupting,
100100
* bit 1: FIFO full, bit 0: FIFO empty
101101
*/
102-
return ((sc1d & 0x05) == 0x04) ? 1 : 0;
102+
return ((sc1d & 0x05) == 0x05) ? 1 : 0;
103103
}
104104
}
105105

‎drivers/ide/scc_pata.c‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -872,20 +872,18 @@ static struct pci_driver scc_pci_driver = {
872872
.remove = __devexit_p(scc_remove),
873873
};
874874

875-
static int scc_ide_init(void)
875+
static int __init scc_ide_init(void)
876876
{
877877
return ide_pci_register_driver(&scc_pci_driver);
878878
}
879879

880-
module_init(scc_ide_init);
881-
/* -- No exit code?
882-
static void scc_ide_exit(void)
880+
static void __exit scc_ide_exit(void)
883881
{
884-
ide_pci_unregister_driver(&scc_pci_driver);
882+
pci_unregister_driver(&scc_pci_driver);
885883
}
886-
module_exit(scc_ide_exit);
887-
*/
888884

885+
module_init(scc_ide_init);
886+
module_exit(scc_ide_exit);
889887

890888
MODULE_DESCRIPTION("PCI driver module for Toshiba SCC IDE");
891889
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)