Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #53174 > unrolled thread

[PATCH] Fix hppa kernel crash at boot in block/blk-merge.c

Started byHelge Deller <deller@gmx.de>
First post2016-03-10 18:30 +0100
Last post2016-04-14 08:50 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.debian.kernel


Contents

  [PATCH] Fix hppa kernel crash at boot in block/blk-merge.c Helge Deller <deller@gmx.de> - 2016-03-10 18:30 +0100
    Re: [PATCH] Fix hppa kernel crash at boot in block/blk-merge.c Ben Hutchings <ben@decadent.org.uk> - 2016-04-14 00:50 +0200
      Re: [PATCH] Fix hppa kernel crash at boot in block/blk-merge.c Helge Deller <deller@gmx.de> - 2016-04-14 08:50 +0200

#53174 — [PATCH] Fix hppa kernel crash at boot in block/blk-merge.c

FromHelge Deller <deller@gmx.de>
Date2016-03-10 18:30 +0100
Subject[PATCH] Fix hppa kernel crash at boot in block/blk-merge.c
Message-ID<rbczp-1Pk-11@gated-at.bofh.it>
Since kernel 4.3 we have a problem on hppa that it crashes at bootup
during the SCSI drive detection.
There are multiple threads about this issue and this link is maybe a good start:
https://patchwork.kernel.org/patch/8402441/.

Now, after quite some time, we could identify what's going wrong.
The attached patch avoids this crash by switching to compiling with
"-O1" instead of "-O2" for a function in block/blk-merge.c (for hppa only).

This patch is meant to be a temporary patch for the debian kernel, until we 
have been able to fix the real problem (in gcc and/or kernel code).

Would it be possible to add this patch to the debian kernel tree for
stable and experimental kernels in the meantime, so that we get bootable
kernels on hppa again?

Thanks,
Helge

diff -up ./block/blk-merge.c.org ./block/blk-merge.c
--- ./block/blk-merge.c.org	2016-03-10 09:44:33.171141161 +0100
+++ ./block/blk-merge.c	2016-03-10 09:47:33.391119064 +0100
@@ -80,7 +80,15 @@ static inline unsigned get_max_io_size(s
 	return sectors;
 }
 
-static struct bio *blk_bio_segment_split(struct request_queue *q,
+static struct bio *
+#ifdef __hppa__
+	/* 
+	 * gcc-4.9 miscompiles this function at O2, leading to a kernel crash at bootup.
+	 * So, let's temporarily compile this function with O1 until the bug is fully analyzed and fixed.
+	 */
+	__attribute__ ((optimize("O1")))
+#endif
+blk_bio_segment_split(struct request_queue *q,
 					 struct bio *bio,
 					 struct bio_set *bs,
 					 unsigned *segs)

[toc] | [next] | [standalone]


#53591

FromBen Hutchings <ben@decadent.org.uk>
Date2016-04-14 00:50 +0200
Message-ID<rnBLH-7P-1@gated-at.bofh.it>
In reply to#53174

[Multipart message — attachments visible in raw view] — view raw

On Thu, 2016-03-10 at 18:23 +0100, Helge Deller wrote:
> Since kernel 4.3 we have a problem on hppa that it crashes at bootup
> during the SCSI drive detection.
> There are multiple threads about this issue and this link is maybe a good start:
> https://patchwork.kernel.org/patch/8402441/.
> 
> Now, after quite some time, we could identify what's going wrong.
> The attached patch avoids this crash by switching to compiling with
> "-O1" instead of "-O2" for a function in block/blk-merge.c (for hppa only).
> 
> This patch is meant to be a temporary patch for the debian kernel, until we 
> have been able to fix the real problem (in gcc and/or kernel code).
> 
> Would it be possible to add this patch to the debian kernel tree for
> stable and experimental kernels in the meantime, so that we get bootable
> kernels on hppa again?

Yes, but is this still needed when using gcc 5 (now used for all
architectures)?

Ben.

-- 
Ben Hutchings
It is easier to change the specification to fit the program than vice versa.

[toc] | [prev] | [next] | [standalone]


#53602

FromHelge Deller <deller@gmx.de>
Date2016-04-14 08:50 +0200
Message-ID<rnJgd-5Y0-1@gated-at.bofh.it>
In reply to#53591
Hi Ben,

On 14.04.2016 00:48, Ben Hutchings wrote:
> On Thu, 2016-03-10 at 18:23 +0100, Helge Deller wrote:
>> Since kernel 4.3 we have a problem on hppa that it crashes at bootup
>> during the SCSI drive detection.
>> There are multiple threads about this issue and this link is maybe a good start:
>> https://patchwork.kernel.org/patch/8402441/.
>>
>> Now, after quite some time, we could identify what's going wrong.
>> The attached patch avoids this crash by switching to compiling with
>> "-O1" instead of "-O2" for a function in block/blk-merge.c (for hppa only).
>>
>> This patch is meant to be a temporary patch for the debian kernel, until we 
>> have been able to fix the real problem (in gcc and/or kernel code).
>>
>> Would it be possible to add this patch to the debian kernel tree for
>> stable and experimental kernels in the meantime, so that we get bootable
>> kernels on hppa again?
> 
> Yes, but is this still needed when using gcc 5 (now used for all
> architectures)?

I need to check gcc-5.
Regarding the patch to the parisc kernel, you can drop my request.
We reverted a gcc-4.9 change, and now the kernel builds&boots sucessfully again.

Thanks!
Helge

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.kernel


csiph-web