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
67846b30
Commit
67846b30
authored
Oct 05, 2005
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libata: add ata_ratelimit(), use it in AHCI driver irq handler
parent
643736a5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
6 deletions
+50
-6
drivers/scsi/ahci.c
drivers/scsi/ahci.c
+25
-6
drivers/scsi/libata-core.c
drivers/scsi/libata-core.c
+23
-0
include/linux/libata.h
include/linux/libata.h
+2
-0
No files found.
drivers/scsi/ahci.c
View file @
67846b30
...
@@ -672,17 +672,36 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs *
...
@@ -672,17 +672,36 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs *
for
(
i
=
0
;
i
<
host_set
->
n_ports
;
i
++
)
{
for
(
i
=
0
;
i
<
host_set
->
n_ports
;
i
++
)
{
struct
ata_port
*
ap
;
struct
ata_port
*
ap
;
u32
tmp
;
VPRINTK
(
"port %u
\n
"
,
i
);
if
(
!
(
irq_stat
&
(
1
<<
i
)))
continue
;
ap
=
host_set
->
ports
[
i
];
ap
=
host_set
->
ports
[
i
];
tmp
=
irq_stat
&
(
1
<<
i
);
if
(
ap
)
{
if
(
tmp
&&
ap
)
{
struct
ata_queued_cmd
*
qc
;
struct
ata_queued_cmd
*
qc
;
qc
=
ata_qc_from_tag
(
ap
,
ap
->
active_tag
);
qc
=
ata_qc_from_tag
(
ap
,
ap
->
active_tag
);
if
(
ahci_host_intr
(
ap
,
qc
))
if
(
!
ahci_host_intr
(
ap
,
qc
))
irq_ack
|=
(
1
<<
i
);
if
(
ata_ratelimit
())
{
struct
pci_dev
*
pdev
=
to_pci_dev
(
ap
->
host_set
->
dev
);
printk
(
KERN_WARNING
"ahci(%s): unhandled interrupt on port %u
\n
"
,
pci_name
(
pdev
),
i
);
}
VPRINTK
(
"port %u
\n
"
,
i
);
}
else
{
VPRINTK
(
"port %u (no irq)
\n
"
,
i
);
if
(
ata_ratelimit
())
{
struct
pci_dev
*
pdev
=
to_pci_dev
(
ap
->
host_set
->
dev
);
printk
(
KERN_WARNING
"ahci(%s): interrupt on disabled port %u
\n
"
,
pci_name
(
pdev
),
i
);
}
}
}
irq_ack
|=
(
1
<<
i
);
}
}
if
(
irq_ack
)
{
if
(
irq_ack
)
{
...
...
drivers/scsi/libata-core.c
View file @
67846b30
...
@@ -48,6 +48,7 @@
...
@@ -48,6 +48,7 @@
#include <linux/completion.h>
#include <linux/completion.h>
#include <linux/suspend.h>
#include <linux/suspend.h>
#include <linux/workqueue.h>
#include <linux/workqueue.h>
#include <linux/jiffies.h>
#include <scsi/scsi.h>
#include <scsi/scsi.h>
#include "scsi.h"
#include "scsi.h"
#include "scsi_priv.h"
#include "scsi_priv.h"
...
@@ -4688,6 +4689,27 @@ static void __exit ata_exit(void)
...
@@ -4688,6 +4689,27 @@ static void __exit ata_exit(void)
module_init
(
ata_init
);
module_init
(
ata_init
);
module_exit
(
ata_exit
);
module_exit
(
ata_exit
);
static
unsigned
long
ratelimit_time
;
static
spinlock_t
ata_ratelimit_lock
=
SPIN_LOCK_UNLOCKED
;
int
ata_ratelimit
(
void
)
{
int
rc
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
ata_ratelimit_lock
,
flags
);
if
(
time_after
(
jiffies
,
ratelimit_time
))
{
rc
=
1
;
ratelimit_time
=
jiffies
+
(
HZ
/
5
);
}
else
rc
=
0
;
spin_unlock_irqrestore
(
&
ata_ratelimit_lock
,
flags
);
return
rc
;
}
/*
/*
* libata is essentially a library of internal helper functions for
* libata is essentially a library of internal helper functions for
* low-level ATA host controller drivers. As such, the API/ABI is
* low-level ATA host controller drivers. As such, the API/ABI is
...
@@ -4729,6 +4751,7 @@ EXPORT_SYMBOL_GPL(sata_phy_reset);
...
@@ -4729,6 +4751,7 @@ EXPORT_SYMBOL_GPL(sata_phy_reset);
EXPORT_SYMBOL_GPL
(
__sata_phy_reset
);
EXPORT_SYMBOL_GPL
(
__sata_phy_reset
);
EXPORT_SYMBOL_GPL
(
ata_bus_reset
);
EXPORT_SYMBOL_GPL
(
ata_bus_reset
);
EXPORT_SYMBOL_GPL
(
ata_port_disable
);
EXPORT_SYMBOL_GPL
(
ata_port_disable
);
EXPORT_SYMBOL_GPL
(
ata_ratelimit
);
EXPORT_SYMBOL_GPL
(
ata_scsi_ioctl
);
EXPORT_SYMBOL_GPL
(
ata_scsi_ioctl
);
EXPORT_SYMBOL_GPL
(
ata_scsi_queuecmd
);
EXPORT_SYMBOL_GPL
(
ata_scsi_queuecmd
);
EXPORT_SYMBOL_GPL
(
ata_scsi_error
);
EXPORT_SYMBOL_GPL
(
ata_scsi_error
);
...
...
include/linux/libata.h
View file @
67846b30
...
@@ -410,6 +410,8 @@ extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmn
...
@@ -410,6 +410,8 @@ extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmn
extern
int
ata_scsi_error
(
struct
Scsi_Host
*
host
);
extern
int
ata_scsi_error
(
struct
Scsi_Host
*
host
);
extern
int
ata_scsi_release
(
struct
Scsi_Host
*
host
);
extern
int
ata_scsi_release
(
struct
Scsi_Host
*
host
);
extern
unsigned
int
ata_host_intr
(
struct
ata_port
*
ap
,
struct
ata_queued_cmd
*
qc
);
extern
unsigned
int
ata_host_intr
(
struct
ata_port
*
ap
,
struct
ata_queued_cmd
*
qc
);
extern
int
ata_ratelimit
(
void
);
/*
/*
* Default driver ops implementations
* Default driver ops implementations
*/
*/
...
...
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