Skip to contentSkip to conversation

new bio: compile fix for alpha

PATCH Applied Ivan Kokshaysky 3 participants 7 messages Nov 29, 2001 – Dec 7, 2001

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Added BUG_ON macro, similar to x86 one;
arg 2 for blk_queue_bounce_limit() declared long long' in blkdev.h and u64' in ll_rw_blk.c, which is not the same thing on alpha. There are several compiler warnings "long long format, long arg", caused by the same reason, but I think they could be ignored at this point.

Ivan.

include/linux/blkdev.h +1 -1
@@ -238,7 +238,7 @@ extern void blk_attempt_remerge(request_
 extern int blk_init_queue(request_queue_t *, request_fn_proc *, char *);
 extern void blk_cleanup_queue(request_queue_t *);
 extern void blk_queue_make_request(request_queue_t *, make_request_fn *);
-extern void blk_queue_bounce_limit(request_queue_t *, unsigned long long);
+extern void blk_queue_bounce_limit(request_queue_t *, u64);
 extern void blk_queue_max_sectors(request_queue_t *q, unsigned short);
 extern void blk_queue_max_segments(request_queue_t *q, unsigned short);
 extern void blk_queue_max_segment_size(request_queue_t *q, unsigned int);
include/asm-alpha/page.h +7 -0
@@ -64,7 +64,14 @@ do {										\
 	printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__);			\
 	__asm__ __volatile__("call_pal %0  # bugchk" : : "i" (PAL_bugchk));	\
 } while (0)
+
 #define PAGE_BUG(page)	BUG()
+
+#define BUG_ON(condition)			\
+	do {					\
+		if (unlikely((long)(condition)))\
+			BUG();			\
+	} while (0)
 
 /* Pure 2^n version of get_order */
 extern __inline__ int get_order(unsigned long size)
#1 lore raw
Quoted 3 lines · Ivan Kokshaysky

Added BUG_ON macro, similar to x86 one;
arg 2 for blk_queue_bounce_limit() declared long long' in blkdev.h and u64' in ll_rw_blk.c, which is not the same thing on alpha.

Ah indeed, thanks.

Quoted 2 lines

There are several compiler warnings "long long format, long arg", caused by the same reason, but I think they could be ignored at this point.

Please send whatever you find, thanks.

Signature · 1 line
Jens Axboe
#2 lore raw
In reply to Ivan Kokshaysky
Quoted 1 line · Jens Axboe

Please send whatever you find, thanks.

Well, I think this one is critical - in -pre4 BIO_CONTIG macro has been changed:
- (bio_to_phys((bio)) + bio_size((bio)) == bio_to_phys((nxt)))
+ (bvec_to_phys(__BVEC_END((bio)) + (bio)->bi_size) ==bio_to_phys((nxt)))

		      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This means that you add size in bytes to the `struct bio_vec' pointer, which is obviously bogus. I wonder why this typo didn't expose itself on x86 - on alpha I've got an oops on very first disk i/o in partition check...

The rest is cleaning up some format vs. arg inconsistency on 64-bit platforms.
Oh, and yet another [incorrect] BUG_ON macro on alpha killed.

Ivan.

fs/bio.c +1 -1
@@ -703,7 +703,7 @@ static int __init init_bio(void)
 		panic("bio: can't create bio_cachep slab cache\n");
 
 	nr = bio_init_pool();
-	printk("BIO: pool of %d setup, %uKb (%d bytes/bio)\n", nr, nr * sizeof(struct bio) >> 10, sizeof(struct bio));
+	printk("BIO: pool of %d setup, %luKb (%ld bytes/bio)\n", nr, nr * sizeof(struct bio) >> 10, sizeof(struct bio));
 
 	biovec_init_pool();
 
include/linux/bio.h +1 -1
@@ -120,7 +120,7 @@ struct bio {
  */
 #define __BVEC_END(bio) bio_iovec_idx((bio), (bio)->bi_idx - 1)
 #define BIO_CONTIG(bio, nxt) \
-	(bvec_to_phys(__BVEC_END((bio)) + (bio)->bi_size) == bio_to_phys((nxt)))
+	(bvec_to_phys(__BVEC_END((bio))) + (bio)->bi_size == bio_to_phys((nxt)))
 #define __BIO_SEG_BOUNDARY(addr1, addr2, mask) \
 	(((addr1) | (mask)) == (((addr2) - 1) | (mask)))
 #define BIO_SEG_BOUNDARY(q, b1, b2) \
include/asm-alpha/page.h +0 -6
@@ -73,12 +73,6 @@ do {										\
 			BUG();			\
 	} while (0)
 
-#define BUG_ON(condition)			\
-	do {					\
-		if (unlikely((int)(condition)))	\
-			BUG();			\
-	} while (0)
-
 /* Pure 2^n version of get_order */
 extern __inline__ int get_order(unsigned long size)
 {
drivers/block/ll_rw_blk.c +3 -3
@@ -177,7 +177,7 @@ void blk_queue_bounce_limit(request_queu
 		if (dma_addr == BLK_BOUNCE_ANY)
 			printk("no I/O memory limit\n");
 		else
-			printk("I/O limit %luMb (mask 0x%Lx)\n", mb, (u64) dma_addr);
+			printk("I/O limit %luMb (mask 0x%Lx)\n", mb, (long long) dma_addr);
 	}
 
 	q->bounce_pfn = bounce_pfn;
@@ -1056,7 +1056,7 @@ void generic_make_request(struct bio *bi
 				printk(KERN_INFO "%s: rw=%ld, want=%ld, limit=%Lu\n",
 				       kdevname(bio->bi_dev), bio->bi_rw,
 				       (sector + nr_sectors)>>1,
-				       (u64) blk_size[major][minor]);
+				       (long long) blk_size[major][minor]);
 			}
 			set_bit(BIO_EOF, &bio->bi_flags);
 			goto end_io;
@@ -1076,7 +1076,7 @@ void generic_make_request(struct bio *bi
 		if (!q) {
 			printk(KERN_ERR
 			       "generic_make_request: Trying to access nonexistent block-device %s (%Lu)\n",
-			       kdevname(bio->bi_dev), (u64) bio->bi_sector);
+			       kdevname(bio->bi_dev), (long long) bio->bi_sector);
 end_io:
 			bio->bi_end_io(bio, nr_sectors);
 			break;
Applied
#3 lore raw
In reply to Ivan Kokshaysky
Quoted 8 lines · Ivan Kokshaysky
Quoted 1 line · Jens Axboe

Please send whatever you find, thanks.

Well, I think this one is critical - in -pre4 BIO_CONTIG macro has been changed:

(quoted diff) +1 -1
-	(bio_to_phys((bio)) + bio_size((bio)) == bio_to_phys((nxt)))
+	(bvec_to_phys(__BVEC_END((bio)) + (bio)->bi_size) ==bio_to_phys((nxt)))
		      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Quoted 4 lines

This means that you add size in bytes to the `struct bio_vec' pointer, which is obviously bogus. I wonder why this typo didn't expose itself on x86 - on alpha I've got an oops on very first disk i/o in partition check...

Irk, good spotting. Thanks!

Quoted 3 lines

The rest is cleaning up some format vs. arg inconsistency on 64-bit platforms.
Oh, and yet another [incorrect] BUG_ON macro on alpha killed.

Applied, although I think we'll make BUG_ON a kernel generic and not platform specific as per Rusty's patch.

Signature · 1 line
Jens Axboe
#4 lore raw
In reply to Ivan Kokshaysky

Jens,

This interface is totally cool and much appreciated. I am nearly done getting the page cache mapped into NWFS. I am waiting for the bugs to settle down, I still see some issues with the AHA1512 drivers, but IDE works great and is really fast.

Jeff

Quoted 31 lines · Jens Axboe
Quoted 8 lines · Ivan Kokshaysky
Quoted 1 line · Jens Axboe

Please send whatever you find, thanks.

Well, I think this one is critical - in -pre4 BIO_CONTIG macro has been changed:

(quoted diff) +1 -1
-	(bio_to_phys((bio)) + bio_size((bio)) == bio_to_phys((nxt)))
+	(bvec_to_phys(__BVEC_END((bio)) + (bio)->bi_size) ==bio_to_phys((nxt)))
		      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Quoted 4 lines

This means that you add size in bytes to the `struct bio_vec' pointer, which is obviously bogus. I wonder why this typo didn't expose itself on x86 - on alpha I've got an oops on very first disk i/o in partition check...

Irk, good spotting. Thanks!

Quoted 3 lines

The rest is cleaning up some format vs. arg inconsistency on 64-bit platforms.
Oh, and yet another [incorrect] BUG_ON macro on alpha killed.

Applied, although I think we'll make BUG_ON a kernel generic and not platform specific as per Rusty's patch.

Signature · 7 lines
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#5 lore raw
In reply to Ivan Kokshaysky
Quoted 2 lines · Jens Axboe

Applied, although I think we'll make BUG_ON a kernel generic and not platform specific as per Rusty's patch.

Agreed, this would be better.

Ivan.

#6 lore raw
In reply to Ivan Kokshaysky
Quoted 8 lines · Jeff V. Merkey

Jens,

This interface is totally cool and much appreciated. I am nearly done getting the page cache mapped into NWFS. I am waiting for the bugs to settle down, I still see some issues with the AHA1512 drivers, but IDE works great and is really fast.

Great, glad to hear it. There will be "issues" for a while :-)

Signature · 1 line
Jens Axboe