Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130813
b: refs/heads/master
c: 99cf610
h: refs/heads/master
i:
  130811: f6cee81
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Feb 3, 2009
1 parent 593f62a commit 83e4d2e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 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: 9913ff8abf1c70a8d52560dc931e1901d025ad27
refs/heads/master: 99cf610aa4840d822cdc67d194b23b55010ca9bd
4 changes: 2 additions & 2 deletions trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -5404,8 +5404,8 @@ void ata_dev_init(struct ata_device *dev)
dev->horkage = 0;
spin_unlock_irqrestore(ap->lock, flags);

memset((void *)dev + ATA_DEVICE_CLEAR_OFFSET, 0,
sizeof(*dev) - ATA_DEVICE_CLEAR_OFFSET);
memset((void *)dev + ATA_DEVICE_CLEAR_BEGIN, 0,
ATA_DEVICE_CLEAR_END - ATA_DEVICE_CLEAR_BEGIN);
dev->pio_mask = UINT_MAX;
dev->mwdma_mask = UINT_MAX;
dev->udma_mask = UINT_MAX;
Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/ata/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,11 @@ void ata_dev_disable(struct ata_device *dev)
ata_acpi_on_disable(dev);
ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO0 | ATA_DNXFER_QUIET);
dev->class++;

/* From now till the next successful probe, ering is used to
* track probe failures. Clear accumulated device error info.
*/
ata_ering_clear(&dev->ering);
}

/**
Expand Down Expand Up @@ -2765,6 +2770,8 @@ static int ata_eh_revalidate_and_attach(struct ata_link *link,
readid_flags, dev->id);
switch (rc) {
case 0:
/* clear error info accumulated during probe */
ata_ering_clear(&dev->ering);
new_mask |= 1 << dev->devno;
break;
case -ENOENT:
Expand Down
18 changes: 10 additions & 8 deletions trunk/include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ struct ata_device {
acpi_handle acpi_handle;
union acpi_object *gtf_cache;
#endif
/* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */
/* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */
u64 n_sectors; /* size of device, if ATA */
unsigned int class; /* ATA_DEV_xxx */
unsigned long unpark_deadline;
Expand All @@ -605,20 +605,22 @@ struct ata_device {
u16 heads; /* Number of heads */
u16 sectors; /* Number of sectors per track */

/* error history */
int spdn_cnt;
struct ata_ering ering;

union {
u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
u32 gscr[SATA_PMP_GSCR_DWORDS]; /* PMP GSCR block */
};

/* error history */
int spdn_cnt;
/* ering is CLEAR_END, read comment above CLEAR_END */
struct ata_ering ering;
};

/* Offset into struct ata_device. Fields above it are maintained
* acress device init. Fields below are zeroed.
/* Fields between ATA_DEVICE_CLEAR_BEGIN and ATA_DEVICE_CLEAR_END are
* cleared to zero on ata_dev_init().
*/
#define ATA_DEVICE_CLEAR_OFFSET offsetof(struct ata_device, n_sectors)
#define ATA_DEVICE_CLEAR_BEGIN offsetof(struct ata_device, n_sectors)
#define ATA_DEVICE_CLEAR_END offsetof(struct ata_device, ering)

struct ata_eh_info {
struct ata_device *dev; /* offending device */
Expand Down

0 comments on commit 83e4d2e

Please sign in to comment.