Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96942
b: refs/heads/master
c: 06aaca3
h: refs/heads/master
v: v3
  • Loading branch information
Mark Lord authored and Jeff Garzik committed May 19, 2008
1 parent 6a15e6d commit a396701
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 96e2c487933e5f69e98fffdcae2c35c78a671c07
refs/heads/master: 06aaca3f6301d04463b1ee0eb75c0352147159f2
16 changes: 14 additions & 2 deletions trunk/drivers/ata/sata_mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
#include <linux/libata.h>

#define DRV_NAME "sata_mv"
#define DRV_VERSION "1.20"
#define DRV_VERSION "1.21"

enum {
/* BAR's are enumerated in terms of pci_resource_start() terms */
Expand Down Expand Up @@ -1695,6 +1695,18 @@ static void mv_pmp_eh_prep(struct ata_port *ap, unsigned int pmp_map)
}
}

static int mv_req_q_empty(struct ata_port *ap)
{
void __iomem *port_mmio = mv_ap_base(ap);
u32 in_ptr, out_ptr;

in_ptr = (readl(port_mmio + EDMA_REQ_Q_IN_PTR_OFS)
>> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK;
out_ptr = (readl(port_mmio + EDMA_REQ_Q_OUT_PTR_OFS)
>> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK;
return (in_ptr == out_ptr); /* 1 == queue_is_empty */
}

static int mv_handle_fbs_ncq_dev_err(struct ata_port *ap)
{
struct mv_port_priv *pp = ap->private_data;
Expand Down Expand Up @@ -1728,7 +1740,7 @@ static int mv_handle_fbs_ncq_dev_err(struct ata_port *ap)
ap->qc_active, failed_links,
ap->nr_active_links);

if (ap->nr_active_links <= failed_links) {
if (ap->nr_active_links <= failed_links && mv_req_q_empty(ap)) {
mv_process_crpb_entries(ap, pp);
mv_stop_edma(ap);
mv_eh_freeze(ap);
Expand Down

0 comments on commit a396701

Please sign in to comment.