Skip to contentSkip to conversation

rsxx: Disallows DMA transfer during format.

PATCH In review Philip J. Kelleher 2 participants 3 messages Apr 30, 2013 – May 1, 2013 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 9/9 rsxx: Disallows DMA transfer during format.

From: Philip J Kelleher <[email protected]>

Verifies the card is not formatting before DMAs are transferred.

-------------------------------------------------------------------------------

drivers/block/rsxx/dma.c +2 -1
diff -uprN -X linux-block-vanilla/Documentation/dontdiff linux-block-vanilla/drivers/block/rsxx/dma.c linux-block/drivers/block/rsxx/dma.c
@@ -721,7 +721,8 @@ int rsxx_dma_queue_bio(struct rsxx_cardi
 		}
 	}
 
-	if (unlikely(card->halt))
+	if (unlikely(card->halt) ||
+	    unlikely(card->state == CARD_STATE_FORMATTING))
 		goto bvec_err;
 
 	for (i = 0; i < card->n_targets; i++) {
maintainer
#1 lore raw
Quoted 13 lines · Philip J. Kelleher

From: Philip J Kelleher <[email protected]>

Verifies the card is not formatting before DMAs are transferred.

-------------------------------------------------------------------------------

diff -uprN -X linux-block-vanilla/Documentation/dontdiff linux-block-vanilla/drivers/block/rsxx/dma.c linux-block/drivers/block/rsxx/dma.c

drivers/block/rsxx/dma.c int rsxx_dma_queue_bio(struct rsxx_cardi · line 728

Quoted 9 lines
drivers/block/rsxx/dma.c +2 -1
@@ -721,7 +721,8 @@ int rsxx_dma_queue_bio(struct rsxx_cardi
 		}
 	}
 
-	if (unlikely(card->halt))
+	if (unlikely(card->halt) ||
+	    unlikely(card->state == CARD_STATE_FORMATTING))
 		goto bvec_err;
 
 	for (i = 0; i < card->n_targets; i++) {

What happens if card->state is set to formatting right after this check?

Signature · 1 line
Jens Axboe
#2 lore raw

Thanks for the prompt reply.

I was actually questioning myself if I should include this patch in in my patch series.

This case really is only a solution if no data is running before a format is issued. It is currently a know bug if data is running and a format is issued.

Go ahead and disregard this patch. Once I get sometime to fix data and format for all cases is when I'll submitted it.

Quoted 29 lines · Jens Axboe
Quoted 13 lines · Philip J. Kelleher

From: Philip J Kelleher <[email protected]>

Verifies the card is not formatting before DMAs are transferred.

-------------------------------------------------------------------------------

diff -uprN -X linux-block-vanilla/Documentation/dontdiff linux-block-vanilla/drivers/block/rsxx/dma.c linux-block/drivers/block/rsxx/dma.c

drivers/block/rsxx/dma.c int rsxx_dma_queue_bio(struct rsxx_cardi · line 728

Quoted 9 lines
drivers/block/rsxx/dma.c +2 -1
@@ -721,7 +721,8 @@ int rsxx_dma_queue_bio(struct rsxx_cardi
 		}
 	}
 
-	if (unlikely(card->halt))
+	if (unlikely(card->halt) ||
+	    unlikely(card->state == CARD_STATE_FORMATTING))
 		goto bvec_err;
 
 	for (i = 0; i < card->n_targets; i++) {

What happens if card->state is set to formatting right after this check?

Signature · 1 line
Jens Axboe