Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
f04d3972
Commit
f04d3972
authored
Jul 31, 2002
by
Martin Dalecki
Committed by
Jens Axboe
Jul 31, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] 2.5.29 IDE 111
- Change over queuedata to carry the device instead of the channel information.
parent
10ba6918
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
31 deletions
+18
-31
drivers/ide/ide.c
drivers/ide/ide.c
+13
-27
drivers/ide/probe.c
drivers/ide/probe.c
+5
-4
No files found.
drivers/ide/ide.c
View file @
f04d3972
...
@@ -505,27 +505,13 @@ ide_startstop_t ata_error(struct ata_device *drive, struct request *rq, const ch
...
@@ -505,27 +505,13 @@ ide_startstop_t ata_error(struct ata_device *drive, struct request *rq, const ch
*/
*/
void
do_ide_request
(
request_queue_t
*
q
)
void
do_ide_request
(
request_queue_t
*
q
)
{
{
/* FIXME: queuedata should contain the device instead.
struct
ata_device
*
drive
=
q
->
queuedata
;
*/
struct
ata_channel
*
ch
=
drive
->
channel
;
struct
ata_channel
*
channel
=
q
->
queuedata
;
while
(
!
test_and_set_bit
(
IDE_BUSY
,
channel
->
active
))
{
while
(
!
test_and_set_bit
(
IDE_BUSY
,
ch
->
active
))
{
struct
ata_device
*
drive
=
NULL
;
unsigned
int
unit
;
unsigned
int
unit
;
ide_startstop_t
ret
;
ide_startstop_t
ret
;
/*
* Select the device corresponding to the queue.
*/
for
(
unit
=
0
;
unit
<
MAX_DRIVES
;
++
unit
)
{
struct
ata_device
*
tmp
=
&
channel
->
drives
[
unit
];
if
(
&
tmp
->
queue
==
q
)
{
drive
=
tmp
;
break
;
}
}
if
(
drive
)
{
if
(
drive
)
{
/* No request pending?! */
/* No request pending?! */
if
(
blk_queue_empty
(
&
drive
->
queue
))
if
(
blk_queue_empty
(
&
drive
->
queue
))
...
@@ -542,7 +528,7 @@ void do_ide_request(request_queue_t *q)
...
@@ -542,7 +528,7 @@ void do_ide_request(request_queue_t *q)
*/
*/
// printk(KERN_INFO "no device found!\n");
// printk(KERN_INFO "no device found!\n");
for
(
unit
=
0
;
unit
<
MAX_DRIVES
;
++
unit
)
{
for
(
unit
=
0
;
unit
<
MAX_DRIVES
;
++
unit
)
{
struct
ata_device
*
tmp
=
&
ch
annel
->
drives
[
unit
];
struct
ata_device
*
tmp
=
&
ch
->
drives
[
unit
];
if
(
!
tmp
->
present
)
if
(
!
tmp
->
present
)
continue
;
continue
;
...
@@ -567,7 +553,7 @@ void do_ide_request(request_queue_t *q)
...
@@ -567,7 +553,7 @@ void do_ide_request(request_queue_t *q)
*/
*/
ide_release_lock
(
&
ide_irq_lock
);
/* for atari only */
ide_release_lock
(
&
ide_irq_lock
);
/* for atari only */
clear_bit
(
IDE_BUSY
,
ch
annel
->
active
);
clear_bit
(
IDE_BUSY
,
ch
->
active
);
/* All requests are done.
/* All requests are done.
*
*
...
@@ -576,15 +562,15 @@ void do_ide_request(request_queue_t *q)
...
@@ -576,15 +562,15 @@ void do_ide_request(request_queue_t *q)
* are not prepared to take them.
* are not prepared to take them.
*/
*/
if
(
ch
annel
->
drive
&&
!
channel
->
drive
->
using_tcq
)
if
(
ch
->
drive
&&
!
ch
->
drive
->
using_tcq
)
ata_irq_enable
(
ch
annel
->
drive
,
0
);
ata_irq_enable
(
ch
->
drive
,
0
);
return
;
return
;
}
}
/* Remember the last drive we where acting on.
/* Remember the last drive we where acting on.
*/
*/
ch
annel
->
drive
=
drive
;
ch
->
drive
=
drive
;
/* Feed commands to a drive until it barfs.
/* Feed commands to a drive until it barfs.
*/
*/
...
@@ -598,14 +584,14 @@ void do_ide_request(request_queue_t *q)
...
@@ -598,14 +584,14 @@ void do_ide_request(request_queue_t *q)
if
(
!
ata_can_queue
(
drive
))
{
if
(
!
ata_can_queue
(
drive
))
{
if
(
!
ata_pending_commands
(
drive
))
{
if
(
!
ata_pending_commands
(
drive
))
{
clear_bit
(
IDE_BUSY
,
ch
annel
->
active
);
clear_bit
(
IDE_BUSY
,
ch
->
active
);
if
(
drive
->
using_tcq
)
if
(
drive
->
using_tcq
)
ata_irq_enable
(
drive
,
0
);
ata_irq_enable
(
drive
,
0
);
}
}
break
;
break
;
}
}
if
(
test_bit
(
IDE_DMA
,
ch
annel
->
active
))
{
if
(
test_bit
(
IDE_DMA
,
ch
->
active
))
{
printk
(
KERN_ERR
"%s: error: DMA in progress...
\n
"
,
drive
->
name
);
printk
(
KERN_ERR
"%s: error: DMA in progress...
\n
"
,
drive
->
name
);
break
;
break
;
}
}
...
@@ -624,7 +610,7 @@ void do_ide_request(request_queue_t *q)
...
@@ -624,7 +610,7 @@ void do_ide_request(request_queue_t *q)
if
(
!
(
rq
=
elv_next_request
(
&
drive
->
queue
)))
{
if
(
!
(
rq
=
elv_next_request
(
&
drive
->
queue
)))
{
if
(
!
ata_pending_commands
(
drive
))
{
if
(
!
ata_pending_commands
(
drive
))
{
clear_bit
(
IDE_BUSY
,
ch
annel
->
active
);
clear_bit
(
IDE_BUSY
,
ch
->
active
);
if
(
drive
->
using_tcq
)
if
(
drive
->
using_tcq
)
ata_irq_enable
(
drive
,
0
);
ata_irq_enable
(
drive
,
0
);
}
}
...
@@ -642,7 +628,7 @@ void do_ide_request(request_queue_t *q)
...
@@ -642,7 +628,7 @@ void do_ide_request(request_queue_t *q)
drive
->
rq
=
rq
;
drive
->
rq
=
rq
;
spin_unlock
(
ch
annel
->
lock
);
spin_unlock
(
ch
->
lock
);
/* allow other IRQs while we start this request */
/* allow other IRQs while we start this request */
local_irq_enable
();
local_irq_enable
();
...
@@ -687,7 +673,7 @@ void do_ide_request(request_queue_t *q)
...
@@ -687,7 +673,7 @@ void do_ide_request(request_queue_t *q)
ret
=
ATA_OP_FINISHED
;
ret
=
ATA_OP_FINISHED
;
}
}
spin_lock_irq
(
ch
annel
->
lock
);
spin_lock_irq
(
ch
->
lock
);
/* continue if command started, so we are busy */
/* continue if command started, so we are busy */
}
while
(
ret
!=
ATA_OP_CONTINUES
);
}
while
(
ret
!=
ATA_OP_CONTINUES
);
}
}
...
...
drivers/ide/probe.c
View file @
f04d3972
...
@@ -977,23 +977,24 @@ static int init_irq(struct ata_channel *ch)
...
@@ -977,23 +977,24 @@ static int init_irq(struct ata_channel *ch)
ch
->
drive
=
drive
;
ch
->
drive
=
drive
;
/*
/*
* Init the per device request queue
* Init the per device request queue
.
*/
*/
q
=
&
drive
->
queue
;
q
=
&
drive
->
queue
;
q
->
queuedata
=
drive
->
channel
;
q
->
queuedata
=
drive
;
blk_init_queue
(
q
,
do_ide_request
,
drive
->
channel
->
lock
);
blk_init_queue
(
q
,
do_ide_request
,
drive
->
channel
->
lock
);
blk_queue_segment_boundary
(
q
,
ch
->
seg_boundary_mask
);
blk_queue_segment_boundary
(
q
,
ch
->
seg_boundary_mask
);
blk_queue_max_segment_size
(
q
,
ch
->
max_segment_size
);
blk_queue_max_segment_size
(
q
,
ch
->
max_segment_size
);
/* ATA can do up to 128K per request, pdc4030 needs smaller limit */
/* ATA can do up to 128K per request, pdc4030 needs smaller
* limit. */
#ifdef CONFIG_BLK_DEV_PDC4030
#ifdef CONFIG_BLK_DEV_PDC4030
if
(
drive
->
channel
->
chipset
==
ide_pdc4030
)
if
(
drive
->
channel
->
chipset
==
ide_pdc4030
)
max_sectors
=
127
;
max_sectors
=
127
;
#endif
#endif
blk_queue_max_sectors
(
q
,
max_sectors
);
blk_queue_max_sectors
(
q
,
max_sectors
);
/*
IDE
DMA can do PRD_ENTRIES number of segments. */
/*
ATA
DMA can do PRD_ENTRIES number of segments. */
blk_queue_max_hw_segments
(
q
,
PRD_ENTRIES
);
blk_queue_max_hw_segments
(
q
,
PRD_ENTRIES
);
/* FIXME: This is a driver limit and could be eliminated. */
/* FIXME: This is a driver limit and could be eliminated. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment