Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci-2.6.23
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci-2.6.23
Commits
11e29e21
Commit
11e29e21
authored
Oct 21, 2005
by
Alan Cox
Committed by
Jeff Garzik
Oct 21, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libata: handle early device PIO modes correctly
parent
307e4dc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
8 deletions
+36
-8
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+27
-4
include/linux/ata.h
include/linux/ata.h
+9
-4
No files found.
drivers/scsi/libata-core.c
View file @
11e29e21
...
@@ -1082,6 +1082,31 @@ static inline void ata_dump_id(struct ata_device *dev)
...
@@ -1082,6 +1082,31 @@ static inline void ata_dump_id(struct ata_device *dev)
dev
->
id
[
93
]);
dev
->
id
[
93
]);
}
}
/*
* Compute the PIO modes available for this device. This is not as
* trivial as it seems if we must consider early devices correctly.
*
* FIXME: pre IDE drive timing (do we care ?).
*/
static
unsigned
int
ata_pio_modes
(
struct
ata_device
*
adev
)
{
u16
modes
;
/* Usual case. Word 53 indicates word 88 is valid */
if
(
adev
->
id
[
ATA_ID_FIELD_VALID
]
&
(
1
<<
2
))
{
modes
=
adev
->
id
[
ATA_ID_PIO_MODES
]
&
0x03
;
modes
<<=
3
;
modes
|=
0x7
;
return
modes
;
}
/* If word 88 isn't valid then Word 51 holds the PIO timing number
for the maximum. Turn it into a mask and return it */
modes
=
(
2
<<
(
adev
->
id
[
ATA_ID_OLD_PIO_MODES
]
&
0xFF
))
-
1
;
return
modes
;
}
/**
/**
* ata_dev_identify - obtain IDENTIFY x DEVICE page
* ata_dev_identify - obtain IDENTIFY x DEVICE page
* @ap: port on which device we wish to probe resides
* @ap: port on which device we wish to probe resides
...
@@ -1215,10 +1240,8 @@ retry:
...
@@ -1215,10 +1240,8 @@ retry:
xfer_modes
=
dev
->
id
[
ATA_ID_UDMA_MODES
];
xfer_modes
=
dev
->
id
[
ATA_ID_UDMA_MODES
];
if
(
!
xfer_modes
)
if
(
!
xfer_modes
)
xfer_modes
=
(
dev
->
id
[
ATA_ID_MWDMA_MODES
])
<<
ATA_SHIFT_MWDMA
;
xfer_modes
=
(
dev
->
id
[
ATA_ID_MWDMA_MODES
])
<<
ATA_SHIFT_MWDMA
;
if
(
!
xfer_modes
)
{
if
(
!
xfer_modes
)
xfer_modes
=
(
dev
->
id
[
ATA_ID_PIO_MODES
])
<<
(
ATA_SHIFT_PIO
+
3
);
xfer_modes
=
ata_pio_modes
(
dev
);
xfer_modes
|=
(
0x7
<<
ATA_SHIFT_PIO
);
}
ata_dump_id
(
dev
);
ata_dump_id
(
dev
);
...
...
include/linux/ata.h
View file @
11e29e21
...
@@ -42,13 +42,18 @@ enum {
...
@@ -42,13 +42,18 @@ enum {
ATA_SECT_SIZE
=
512
,
ATA_SECT_SIZE
=
512
,
ATA_ID_WORDS
=
256
,
ATA_ID_WORDS
=
256
,
ATA_ID_PROD_OFS
=
27
,
ATA_ID_FW_REV_OFS
=
23
,
ATA_ID_SERNO_OFS
=
10
,
ATA_ID_SERNO_OFS
=
10
,
ATA_ID_MAJOR_VER
=
80
,
ATA_ID_FW_REV_OFS
=
23
,
ATA_ID_PIO_MODES
=
64
,
ATA_ID_PROD_OFS
=
27
,
ATA_ID_OLD_PIO_MODES
=
51
,
ATA_ID_FIELD_VALID
=
53
,
ATA_ID_MWDMA_MODES
=
63
,
ATA_ID_MWDMA_MODES
=
63
,
ATA_ID_PIO_MODES
=
64
,
ATA_ID_EIDE_DMA_MIN
=
65
,
ATA_ID_EIDE_PIO
=
67
,
ATA_ID_EIDE_PIO_IORDY
=
68
,
ATA_ID_UDMA_MODES
=
88
,
ATA_ID_UDMA_MODES
=
88
,
ATA_ID_MAJOR_VER
=
80
,
ATA_ID_PIO4
=
(
1
<<
1
),
ATA_ID_PIO4
=
(
1
<<
1
),
ATA_PCI_CTL_OFS
=
2
,
ATA_PCI_CTL_OFS
=
2
,
...
...
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