Skip to content

Commit

Permalink
esp_scsi: read status registers
Browse files Browse the repository at this point in the history
A read to ESP_INTRPT will clear ESP_STATUS and ESP_SSTEP. So read
all status registers in one go to avoid losing information.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Hannes Reinecke authored and Christoph Hellwig committed Nov 24, 2014
1 parent 1af6f60 commit 9535fff
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/scsi/esp_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,6 @@ static int esp_check_spur_intr(struct esp *esp)

default:
if (!(esp->sreg & ESP_STAT_INTR)) {
esp->ireg = esp_read8(ESP_INTRPT);
if (esp->ireg & ESP_INTR_SR)
return 1;

Expand Down Expand Up @@ -2056,7 +2055,12 @@ static void __esp_interrupt(struct esp *esp)
int finish_reset, intr_done;
u8 phase;

/*
* Once INTRPT is read STATUS and SSTEP are cleared.
*/
esp->sreg = esp_read8(ESP_STATUS);
esp->seqreg = esp_read8(ESP_SSTEP);
esp->ireg = esp_read8(ESP_INTRPT);

if (esp->flags & ESP_FLAG_RESETTING) {
finish_reset = 1;
Expand All @@ -2069,8 +2073,6 @@ static void __esp_interrupt(struct esp *esp)
return;
}

esp->ireg = esp_read8(ESP_INTRPT);

if (esp->ireg & ESP_INTR_SR)
finish_reset = 1;

Expand Down

0 comments on commit 9535fff

Please sign in to comment.