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
nexedi
linux
Commits
f89b2b5d
Commit
f89b2b5d
authored
Aug 22, 2006
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'upstream-fixes' into upstream
Conflicts: drivers/ata/ata_piix.c
parents
77967052
f1a58eca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
17 deletions
+43
-17
drivers/ata/ata_piix.c
drivers/ata/ata_piix.c
+43
-17
No files found.
drivers/ata/ata_piix.c
View file @
f89b2b5d
...
@@ -531,27 +531,25 @@ static void piix_pata_error_handler(struct ata_port *ap)
...
@@ -531,27 +531,25 @@ static void piix_pata_error_handler(struct ata_port *ap)
}
}
/**
/**
* piix_sata_pre
reset - prereset
for SATA host controller
* piix_sata_pre
sent_mask - determine present mask
for SATA host controller
* @ap: Target port
* @ap: Target port
*
*
* Reads and configures SATA PCI device's PCI config register
* Reads SATA PCI device's PCI config register Port Configuration
* Port Configuration and Status (PCS) to determine port and
* and Status (PCS) to determine port and device availability.
* device availability. Return -ENODEV to skip reset if no
* device is present.
*
*
* LOCKING:
* LOCKING:
* None (inherited from caller).
* None (inherited from caller).
*
*
* RETURNS:
* RETURNS:
*
0 if device is present, -ENODEV otherwise.
*
determined present_mask
*/
*/
static
int
piix_sata_prereset
(
struct
ata_port
*
ap
)
static
unsigned
int
piix_sata_present_mask
(
struct
ata_port
*
ap
)
{
{
struct
pci_dev
*
pdev
=
to_pci_dev
(
ap
->
host_set
->
dev
);
struct
pci_dev
*
pdev
=
to_pci_dev
(
ap
->
host_set
->
dev
);
struct
piix_host_priv
*
hpriv
=
ap
->
host_set
->
private_data
;
struct
piix_host_priv
*
hpriv
=
ap
->
host_set
->
private_data
;
const
unsigned
int
*
map
=
hpriv
->
map
;
const
unsigned
int
*
map
=
hpriv
->
map
;
int
base
=
2
*
ap
->
port_no
;
int
base
=
2
*
ap
->
port_no
;
unsigned
int
present
=
0
;
unsigned
int
present
_mask
=
0
;
int
port
,
i
;
int
port
,
i
;
u16
pcs
;
u16
pcs
;
...
@@ -564,24 +562,52 @@ static int piix_sata_prereset(struct ata_port *ap)
...
@@ -564,24 +562,52 @@ static int piix_sata_prereset(struct ata_port *ap)
continue
;
continue
;
if
((
ap
->
flags
&
PIIX_FLAG_IGNORE_PCS
)
||
if
((
ap
->
flags
&
PIIX_FLAG_IGNORE_PCS
)
||
(
pcs
&
1
<<
(
hpriv
->
map_db
->
present_shift
+
port
)))
(
pcs
&
1
<<
(
hpriv
->
map_db
->
present_shift
+
port
)))
present
=
1
;
present
_mask
|=
1
<<
i
;
}
}
DPRINTK
(
"ata%u: LEAVE, pcs=0x%x present=0x%x
\n
"
,
DPRINTK
(
"ata%u: LEAVE, pcs=0x%x present
_mask
=0x%x
\n
"
,
ap
->
id
,
pcs
,
present
);
ap
->
id
,
pcs
,
present
_mask
);
if
(
!
present
)
{
return
present_mask
;
ata_port_printk
(
ap
,
KERN_INFO
,
"SATA port has no device.
\n
"
);
}
ap
->
eh_context
.
i
.
action
&=
~
ATA_EH_RESET_MASK
;
return
0
;
/**
* piix_sata_softreset - reset SATA host port via ATA SRST
* @ap: port to reset
* @classes: resulting classes of attached devices
*
* Reset SATA host port via ATA SRST. On controllers with
* reliable PCS present bits, the bits are used to determine
* device presence.
*
* LOCKING:
* Kernel thread context (may sleep)
*
* RETURNS:
* 0 on success, -errno otherwise.
*/
static
int
piix_sata_softreset
(
struct
ata_port
*
ap
,
unsigned
int
*
classes
)
{
unsigned
int
present_mask
;
int
i
,
rc
;
present_mask
=
piix_sata_present_mask
(
ap
);
rc
=
ata_std_softreset
(
ap
,
classes
);
if
(
rc
)
return
rc
;
for
(
i
=
0
;
i
<
ATA_MAX_DEVICES
;
i
++
)
{
if
(
!
(
present_mask
&
(
1
<<
i
)))
classes
[
i
]
=
ATA_DEV_NONE
;
}
}
return
ata_std_prereset
(
ap
)
;
return
0
;
}
}
static
void
piix_sata_error_handler
(
struct
ata_port
*
ap
)
static
void
piix_sata_error_handler
(
struct
ata_port
*
ap
)
{
{
ata_bmdma_drive_eh
(
ap
,
piix_sata_prereset
,
ata_std
_softreset
,
NULL
,
ata_bmdma_drive_eh
(
ap
,
ata_std_prereset
,
piix_sata
_softreset
,
NULL
,
ata_std_postreset
);
ata_std_postreset
);
}
}
...
...
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