Re: [bug] ata subsystem related crash with latest -git

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jens Axboe
Date: Thursday, October 18, 2007 - 2:17 am

On Thu, Oct 18 2007, Jeff Garzik wrote:

The sata_mv construct looks a bit odd. Does this work? That last
end_mv_sg test should always be true, just being paranoid...

diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 4df8311..5397eea 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -1138,8 +1138,9 @@ static void mv_fill_sg(struct ata_queued_cmd *qc)
 {
 	struct mv_port_priv *pp = qc->ap->private_data;
 	struct scatterlist *sg;
-	struct mv_sg *mv_sg;
+	struct mv_sg *mv_sg, *end_mv_sg;
 
+	end_mv_sg = NULL;
 	mv_sg = pp->sg_tbl;
 	ata_for_each_sg(sg, qc) {
 		dma_addr_t addr = sg_dma_address(sg);
@@ -1158,14 +1159,12 @@ static void mv_fill_sg(struct ata_queued_cmd *qc)
 
 			sg_len -= len;
 			addr += len;
-
-			if (!sg_len && ata_sg_is_last(sg, qc))
-				mv_sg->flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL);
-
+			end_mv_sg = mv_sg;
 			mv_sg++;
 		}
-
 	}
+	if (end_mv_sg)
+		end_mv_sg->flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL);
 }
 
 static inline void mv_crqb_pack_cmd(__le16 *cmdw, u8 data, u8 addr, unsigned last)

-- 
Jens Axboe

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[bug] block subsystem related crash with latest -git, Ingo Molnar, (Wed Oct 17, 8:46 am)
Re: [bug] block subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 9:50 am)
[bug] ata subsystem related crash with latest -git, Ingo Molnar, (Wed Oct 17, 10:45 am)
Re: [bug] block subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 10:52 am)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Wed Oct 17, 10:53 am)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Wed Oct 17, 10:55 am)
Re: [bug] block subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 10:56 am)
Re: [bug] ata subsystem related crash with latest -git, Ingo Molnar, (Wed Oct 17, 10:58 am)
Re: [bug] ata subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 11:08 am)
Re: [bug] ata subsystem related crash with latest -git, Ingo Molnar, (Wed Oct 17, 11:13 am)
Re: [bug] block subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 11:13 am)
Re: [bug] block subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 11:14 am)
Re: [bug] block subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 11:18 am)
Re: [bug] block subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 11:22 am)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Wed Oct 17, 11:37 am)
Re: [bug] block subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 11:58 am)
Re: [bug] ata subsystem related crash with latest -git, Ingo Molnar, (Wed Oct 17, 12:04 pm)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Wed Oct 17, 12:08 pm)
Re: [bug] ata subsystem related crash with latest -git, Ingo Molnar, (Wed Oct 17, 12:09 pm)
Re: [bug] ata subsystem related crash with latest -git, Ingo Molnar, (Wed Oct 17, 12:14 pm)
Re: [bug] block subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 12:15 pm)
Re: [bug] ata subsystem related crash with latest -git, Ingo Molnar, (Wed Oct 17, 12:17 pm)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Wed Oct 17, 12:25 pm)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Wed Oct 17, 12:25 pm)
Re: [bug] ata subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 12:28 pm)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Wed Oct 17, 12:35 pm)
Re: [bug] ata subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 12:42 pm)
Re: [bug] ata subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 12:45 pm)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Wed Oct 17, 12:49 pm)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Wed Oct 17, 12:55 pm)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Wed Oct 17, 12:56 pm)
Re: [bug] ata subsystem related crash with latest -git, Ingo Molnar, (Wed Oct 17, 1:05 pm)
Re: [bug] ata subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 1:10 pm)
Re: [bug] block subsystem related crash with latest -git, Luca Tettamanti, (Wed Oct 17, 1:15 pm)
Re: [bug] ata subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 1:24 pm)
Re: [bug] ata subsystem related crash with latest -git, Ingo Molnar, (Wed Oct 17, 1:51 pm)
Re: [bug] ata subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 2:11 pm)
Re: [bug] ata subsystem related crash with latest -git, FUJITA Tomonori, (Wed Oct 17, 4:00 pm)
Re: [bug] ata subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 6:07 pm)
Re: [bug] ata subsystem related crash with latest -git, Jeff Garzik, (Wed Oct 17, 6:14 pm)
Re: [bug] ata subsystem related crash with latest -git, David Miller, (Wed Oct 17, 6:19 pm)
Re: [bug] ata subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 6:36 pm)
Re: [bug] ata subsystem related crash with latest -git, David Miller, (Wed Oct 17, 6:49 pm)
Re: [bug] ata subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 9:01 pm)
Re: [bug] ata subsystem related crash with latest -git, Jeff Garzik, (Wed Oct 17, 9:14 pm)
Re: [bug] ata subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 9:20 pm)
Re: [bug] ata subsystem related crash with latest -git, Jeff Garzik, (Wed Oct 17, 9:31 pm)
Re: [bug] ata subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 9:45 pm)
Re: [bug] ata subsystem related crash with latest -git, Linus Torvalds, (Wed Oct 17, 9:53 pm)
Re: [bug] ata subsystem related crash with latest -git, Jeff Garzik, (Wed Oct 17, 10:45 pm)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Thu Oct 18, 12:05 am)
Re: [bug] ata subsystem related crash with latest -git, Ingo Molnar, (Thu Oct 18, 12:07 am)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Thu Oct 18, 12:09 am)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Thu Oct 18, 12:10 am)
Re: [bug] ata subsystem related crash with latest -git, Jeff Garzik, (Thu Oct 18, 12:30 am)
Re: [bug] ata subsystem related crash with latest -git, Jeff Garzik, (Thu Oct 18, 1:22 am)
Re: [bug] ata subsystem related crash with latest -git, Jeff Garzik, (Thu Oct 18, 1:38 am)
Re: [bug] ata subsystem related crash with latest -git, Jeff Garzik, (Thu Oct 18, 1:51 am)
Re: [bug] ata subsystem related crash with latest -git, Jeff Garzik, (Thu Oct 18, 2:01 am)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Thu Oct 18, 2:17 am)
Re: [bug] ata subsystem related crash with latest -git, Jeff Garzik, (Thu Oct 18, 2:32 am)
Re: [bug] ata subsystem related crash with latest -git, Jeff Garzik, (Thu Oct 18, 3:04 am)
Re: [bug] ata subsystem related crash with latest -git, Ingo Molnar, (Thu Oct 18, 3:13 am)
Re: [bug] ata subsystem related crash with latest -git, Ingo Molnar, (Thu Oct 18, 3:49 am)
Re: [bug] ata subsystem related crash with latest -git, Jeff Garzik, (Thu Oct 18, 3:50 am)
Re: [bug] ata subsystem related crash with latest -git, Ingo Molnar, (Thu Oct 18, 4:03 am)
Re: [bug] ata subsystem related crash with latest -git, David Miller, (Thu Oct 18, 4:55 am)
Re: [bug] ata subsystem related crash with latest -git, David Miller, (Thu Oct 18, 5:05 am)
Re: [bug] ata subsystem related crash with latest -git, David Miller, (Thu Oct 18, 5:36 am)
Re: [bug] ata subsystem related crash with latest -git, Benny Halevy, (Thu Oct 18, 5:58 am)
Re: [bug] ata subsystem related crash with latest -git, Benny Halevy, (Thu Oct 18, 6:49 am)
Re: [bug] ata subsystem related crash with latest -git, Benny Halevy, (Thu Oct 18, 7:16 am)
Re: [bug] ata subsystem related crash with latest -git, Olof Johansson, (Thu Oct 18, 7:58 am)
Re: [bug] ata subsystem related crash with latest -git, Linus Torvalds, (Thu Oct 18, 9:55 am)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Thu Oct 18, 10:01 am)
Re: [bug] ata subsystem related crash with latest -git, Arjan van de Ven, (Thu Oct 18, 10:10 am)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Thu Oct 18, 10:10 am)
Re: [bug] ata subsystem related crash with latest -git, Jens Axboe, (Thu Oct 18, 10:14 am)
Re: [bug] ata subsystem related crash with latest -git, Jeff Garzik, (Thu Oct 18, 12:20 pm)
Re: [bug] ata subsystem related crash with latest -git, FUJITA Tomonori, (Fri Oct 19, 1:59 am)
Re: [bug] ata subsystem related crash with latest -git, Torsten Kaiser, (Sat Oct 20, 4:55 am)