Kernel 4.15

AmigaOne X5000 platform specific issues related to Linux only.
User avatar
xeno74
Posts: 5604
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.15

Post by xeno74 »

Hi All,

The bug is definitely in the commit a8a217c22116eff6c120d753c9934089fb229af0.

The kernel 4.14.0 boots without any problems on my X5000 and on my X1000. I have patched the kernel 4.14.0 source code with the bad commit I found with bisect last week.

After compiling, the kernel 4.14.0 doesn't boot anymore on my X5000.

Please help to find the bug in the bad commit.

Thanks,
Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

User avatar
xeno74
Posts: 5604
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.15

Post by xeno74 »

Hi All,

A little success. :-) I reverted the following files from the bad commit a8a217c22116eff6c120d753c9934089fb229af0:

Code: Select all

arch/powerpc/include/asm/spinlock.h
kernel/locking/spinlock.c
include/linux/spinlock_up.h
include/linux/spinlock.h
include/linux/rwlock.h
After that I compiled the latest git kernel again. Then I was able to boot the latest git kernel on my X5000. :-)

That means the bug is in one of these files.

Please help me to find the bug in these files above.

Thanks,
Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

User avatar
xeno74
Posts: 5604
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.15

Post by xeno74 »

Hi All,

I created a patch for the git kernel today.
Without the patch, the latest git kernel doesn't boot on my X5000.

spinlock_4.15-1.patch:

Code: Select all

--- a/arch/powerpc/include/asm/spinlock.h	2017-11-18 20:57:47.921703650 +0100
+++ b/arch/powerpc/include/asm/spinlock.h	2017-11-19 18:51:51.630906446 +0100
@@ -182,6 +182,9 @@ static inline void arch_spin_unlock(arch
  * read-locks.
  */
 
+#define arch_read_can_lock(rw)		((rw)->lock >= 0)
+#define arch_write_can_lock(rw)	(!(rw)->lock)
+
 #ifdef CONFIG_PPC64
 #define __DO_SIGN_EXTEND	"extsw	%0,%0\n"
 #define WRLOCK_TOKEN		LOCK_TOKEN	/* it's negative */
--- a/kernel/locking/spinlock.c	2017-11-18 20:57:48.974708915 +0100
+++ b/kernel/locking/spinlock.c	2017-11-19 18:26:18.526892449 +0100
@@ -35,6 +35,9 @@
  */
 #else
 
+#define raw_read_can_lock(l)	read_can_lock(l)
+#define raw_write_can_lock(l)	write_can_lock(l)
+
 /*
  * Some architectures can relax in favour of the CPU owning the lock.
  */
@@ -68,7 +71,7 @@ void __lockfunc __raw_##op##_lock(lockty
 									\
 		if (!(lock)->break_lock)				\
 			(lock)->break_lock = 1;				\
-		while ((lock)->break_lock)				\
+		while (!raw_##op##_can_lock(lock) && (lock)->break_lock)\	
 			arch_##op##_relax(&lock->raw_lock);		\
 	}								\
 	(lock)->break_lock = 0;						\
@@ -88,7 +91,7 @@ unsigned long __lockfunc __raw_##op##_lo
 									\
 		if (!(lock)->break_lock)				\
 			(lock)->break_lock = 1;				\
-		while ((lock)->break_lock)				\
+		while (!raw_##op##_can_lock(lock) && (lock)->break_lock)\	
 			arch_##op##_relax(&lock->raw_lock);		\
 	}								\
 	(lock)->break_lock = 0;						\
--- a/include/linux/spinlock_up.h	2017-11-18 20:57:38.788657985 +0100
+++ b/include/linux/spinlock_up.h	2017-11-19 18:48:19.787635450 +0100
@@ -69,4 +69,7 @@ static inline void arch_spin_unlock(arch
 
 #define arch_spin_is_contended(lock)	(((void)(lock), 0))
 
+#define arch_read_can_lock(lock)	(((void)(lock), 1))
+#define arch_write_can_lock(lock)	(((void)(lock), 1))
+
 #endif /* __LINUX_SPINLOCK_UP_H */
--- a/include/linux/spinlock.h	2017-11-18 20:57:38.693657510 +0100
+++ b/include/linux/spinlock.h	2017-11-19 18:37:36.933284464 +0100
@@ -283,6 +283,12 @@ static inline void do_raw_spin_unlock(ra
 	1 : ({ local_irq_restore(flags); 0; }); \
 })
 
+/**
+ * raw_spin_can_lock - would raw_spin_trylock() succeed?
+ * @lock: the spinlock in question.
+ */
+#define raw_spin_can_lock(lock)	(!raw_spin_is_locked(lock))
+
 /* Include rwlock functions */
 #include <linux/rwlock.h>
 
@@ -395,6 +401,11 @@ static __always_inline int spin_is_conte
 	return raw_spin_is_contended(&lock->rlock);
 }
 
+static __always_inline int spin_can_lock(spinlock_t *lock)
+{
+	return raw_spin_can_lock(&lock->rlock);
+}
+
 #define assert_spin_locked(lock)	assert_raw_spin_locked(&(lock)->rlock)
 
 /*
--- a/include/linux/rwlock.h	2017-11-18 20:57:38.652657305 +0100
+++ b/include/linux/rwlock.h	2017-11-19 18:19:54.045970054 +0100
@@ -59,6 +59,9 @@ do {								\
 # define do_raw_write_unlock(rwlock)	do {arch_write_unlock(&(rwlock)->raw_lock); __release(lock); } while (0)
 #endif
 
+#define read_can_lock(rwlock)		arch_read_can_lock(&(rwlock)->raw_lock)
+#define write_can_lock(rwlock)		arch_write_can_lock(&(rwlock)->raw_lock)
+
 /*
  * Define the various rw_lock methods.  Note we define these
  * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The various
Cheers,
Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

User avatar
xeno74
Posts: 5604
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.15

Post by xeno74 »

Hi All,

I have recently released the alpha3 of kernel 4.15 for the X5000 and X1000.

New:
Download: vmlinux-4.15-alpha3-AmigaOne_X1000_X5000.tar.gz

Please note: Hardware 3D acceleration doesn't work on the AmigaOne X1000 but it works without any problems on the AmigaOne X5000. I will try to revert the first DRM updates (Commit e60e1ee60630cafef5e430c2ae364877e061d980).

Image

Please test the alpha3.

Thanks,
Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

User avatar
xeno74
Posts: 5604
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.15

Post by xeno74 »

Hi Casey,

I need your help. Could you please test the alpha3 on your AmigaOne X5000? The alpha3 boots without any problems on my AmigaOne X5000 but Julian can't boot it. It's strange. Please test it.

Thanks in advance,
Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

Spectre660
Posts: 1491
Joined: Sat Jun 18, 2011 2:16 pm
Location: Montserrat

Re: Kernel 4.15

Post by Spectre660 »

Hi Christian,

The problem is with your firmware .

[ 2.333447] [drm] Loading verde Microcode
[ 2.337518] radeon 0000:01:00.0: Direct firmware load for radeon/verde_k_smc.bin failed with error -2
[ 2.346748] radeon 0000:01:00.0: Direct firmware load for radeon/VERDE_smc.bin failed with error -2
[ 2.355780] smc: error loading firmware "radeon/VERDE_smc.bin"
[ 2.361602] si_fw: mixing new and old firmware!
[ 2.366136] [drm:.si_init] *ERROR* Failed to load firmware!
[ 2.371704] radeon 0000:01:00.0: Fatal error during GPU init


Regards
Julian

User avatar
xeno74
Posts: 5604
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.15

Post by xeno74 »

Spectre660 wrote:Hi Christian,

The problem is with your firmware .

[ 2.333447] [drm] Loading verde Microcode
[ 2.337518] radeon 0000:01:00.0: Direct firmware load for radeon/verde_k_smc.bin failed with error -2
[ 2.346748] radeon 0000:01:00.0: Direct firmware load for radeon/VERDE_smc.bin failed with error -2
[ 2.355780] smc: error loading firmware "radeon/VERDE_smc.bin"
[ 2.361602] si_fw: mixing new and old firmware!
[ 2.366136] [drm:.si_init] *ERROR* Failed to load firmware!
[ 2.371704] radeon 0000:01:00.0: Fatal error during GPU init


Regards
Julian
Hi Julian,

OK, thanks. Could you also test the final kernel 4.14.0 on your AmigaOne X5000?

Download: vmlinux-4.14-AmigaOne_X1000_X5000.tar.gz

Thanks,
Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

Spectre660
Posts: 1491
Joined: Sat Jun 18, 2011 2:16 pm
Location: Montserrat

Re: Kernel 4.15

Post by Spectre660 »

Hi Christian ,

Same firmware problem.

Regards
Julian

User avatar
xeno74
Posts: 5604
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.15

Post by xeno74 »

Spectre660 wrote:Hi Christian ,

Same firmware problem.

Regards
Julian
Hi Julian,

Many thanks for your fast reply. I updated the firmware package to version 20170823-1 today. Additionally I added your firmwares to the kernel config. I will compile the alpha4. Later I will compile the kernel 4.14.1 with the new firmwares.

Thanks,
Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

User avatar
xeno74
Posts: 5604
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 4.15

Post by xeno74 »

Hi Julian,

Here is the alpha4 with the new firmwares (version 20170823-1) for the X5000 and X1000.

I use the following firmware package: firmware-linux-nonfree (20170823-1)

Download: vmlinux-4.15-alpha4-AmigaOne_X1000_X5000.tar.gz

The alpha4 has the following firmwares included:

Code: Select all

radeon/ARUBA_me.bin radeon/ARUBA_pfp.bin radeon/ARUBA_rlc.bin radeon/BARTS_mc.bin radeon/BARTS_me.bin radeon/BARTS_pfp.bin radeon/BARTS_smc.bin radeon/bonaire_ce.bin radeon/bonaire_mc.bin radeon/bonaire_me.bin radeon/bonaire_mec.bin  radeon/bonaire_pfp.bin radeon/bonaire_rlc.bin radeon/bonaire_sdma.bin radeon/bonaire_smc.bin radeon/BONAIRE_uvd.bin radeon/BONAIRE_vce.bin radeon/BTC_rlc.bin radeon/CAICOS_mc.bin radeon/CAICOS_me.bin radeon/CAICOS_pfp.bin radeon/CAICOS_smc.bin radeon/CAYMAN_mc.bin radeon/CAYMAN_me.bin radeon/CAYMAN_pfp.bin radeon/CAYMAN_rlc.bin radeon/CAYMAN_smc.bin radeon/CEDAR_me.bin radeon/CEDAR_pfp.bin radeon/CEDAR_rlc.bin radeon/CEDAR_smc.bin radeon/CYPRESS_me.bin radeon/CYPRESS_pfp.bin radeon/CYPRESS_rlc.bin radeon/CYPRESS_smc.bin radeon/CYPRESS_uvd.bin radeon/hainan_ce.bin radeon/hainan_mc.bin radeon/hainan_me.bin radeon/hainan_pfp.bin radeon/hainan_rlc.bin radeon/hainan_smc.bin radeon/hawaii_ce.bin radeon/hawaii_mc.bin radeon/hawaii_me.bin radeon/hawaii_mec.bin radeon/hawaii_pfp.bin radeon/hawaii_rlc.bin radeon/hawaii_sdma.bin radeon/hawaii_smc.bin radeon/JUNIPER_me.bin radeon/JUNIPER_pfp.bin radeon/JUNIPER_rlc.bin radeon/JUNIPER_smc.bin radeon/kabini_ce.bin radeon/kabini_me.bin radeon/kabini_mec.bin radeon/kabini_pfp.bin radeon/kabini_rlc.bin radeon/kabini_sdma.bin radeon/kaveri_ce.bin radeon/kaveri_me.bin radeon/kaveri_mec2.bin radeon/kaveri_mec.bin radeon/kaveri_pfp.bin radeon/kaveri_rlc.bin radeon/kaveri_sdma.bin radeon/mullins_ce.bin radeon/mullins_me.bin radeon/mullins_mec.bin radeon/mullins_pfp.bin radeon/mullins_rlc.bin radeon/mullins_sdma.bin radeon/oland_ce.bin radeon/oland_mc.bin radeon/oland_me.bin radeon/oland_pfp.bin radeon/oland_rlc.bin radeon/oland_smc.bin radeon/PALM_me.bin radeon/PALM_pfp.bin radeon/pitcairn_ce.bin radeon/pitcairn_k_smc.bin radeon/pitcairn_mc.bin radeon/pitcairn_me.bin radeon/pitcairn_pfp.bin radeon/pitcairn_rlc.bin radeon/pitcairn_smc.bin radeon/R100_cp.bin radeon/R200_cp.bin radeon/R300_cp.bin radeon/R420_cp.bin radeon/R520_cp.bin radeon/R600_me.bin radeon/R600_pfp.bin radeon/R600_rlc.bin radeon/R600_uvd.bin radeon/R700_rlc.bin radeon/REDWOOD_me.bin radeon/REDWOOD_pfp.bin radeon/REDWOOD_rlc.bin radeon/REDWOOD_smc.bin radeon/RS600_cp.bin radeon/RS690_cp.bin radeon/RS780_me.bin radeon/RS780_pfp.bin radeon/RS780_uvd.bin radeon/RV610_me.bin radeon/RV610_pfp.bin radeon/RV620_me.bin radeon/RV620_pfp.bin radeon/RV630_me.bin radeon/RV630_pfp.bin radeon/RV635_me.bin radeon/RV635_pfp.bin radeon/RV670_me.bin radeon/RV670_pfp.bin radeon/RV710_me.bin radeon/RV710_pfp.bin radeon/RV710_smc.bin radeon/RV710_uvd.bin radeon/RV730_me.bin radeon/RV730_pfp.bin radeon/RV730_smc.bin radeon/RV740_smc.bin radeon/RV770_me.bin radeon/RV770_pfp.bin radeon/RV770_smc.bin radeon/RV770_uvd.bin radeon/SUMO2_me.bin radeon/SUMO2_pfp.bin radeon/SUMO_me.bin radeon/SUMO_pfp.bin radeon/SUMO_rlc.bin radeon/SUMO_uvd.bin radeon/tahiti_ce.bin radeon/tahiti_mc.bin radeon/tahiti_me.bin radeon/tahiti_pfp.bin radeon/tahiti_rlc.bin radeon/tahiti_smc.bin radeon/TAHITI_uvd.bin radeon/TAHITI_vce.bin radeon/TURKS_mc.bin radeon/TURKS_me.bin radeon/TURKS_pfp.bin radeon/TURKS_smc.bin radeon/verde_ce.bin radeon/verde_mc.bin radeon/verde_me.bin radeon/verde_pfp.bin radeon/verde_rlc.bin radeon/verde_smc.bin radeon/si58_mc.bin radeon/hawaii_k_smc.bin radeon/hainan_k_smc.bin radeon/bonaire_k_smc.bin radeon/tahiti_k_smc.bin radeon/oland_k_smc.bin radeon/verde_k_smc.bin
Julian, could you please test the alpha4?

Thanks,
Christian
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

Post Reply