Kernel 4.4

AmigaOne X1000 platform specific issues related to Linux only.
tlosmx
Beta Tester
Beta Tester
Posts: 195
Joined: Sat Feb 09, 2013 9:15 am

Re: Kernel 4.4

Post by tlosmx »

Srtest wrote:I doesn't work - no picture. The only thing changed is that I switched the HD5870 for a R9 270, so it must be a setting that has something to do with that, at least as far as the kernel is concerned. Maybe Virtio (CONFIG_DRM_VIRTIO_GPU=y).
... did you have the Console video output or nothing everyware ?
with R9 270 you can test Xorg with amdgpu driver
sudo aptitude install xserver-xorg-video-amdgpu
change the xorg.config swap radeon with amdgpu
remember to make modprobe amdgpu before
AmigaOne Xe 933 mhz Radeon 9000pro Samsung 840 SSD
Pegasos2 1266mhz Radeon 9800pro Verbatib Sata3 SSD
Sam 460ex Lite 2gb Ram , Radeon 6670,Toshiba 500gb Sata/HDD
Amiga Cd32 / Amiga 600 / Amiga 500 / Amiga CDtv/ Amiga 4000 / Amiga 1200 /Amiga 2000 and many many many z3 Boards

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

Re: Kernel 4.4

Post by xeno74 »

I removed some source code from the Nemo patch for the file dma.c (arch/powerpc/kernel/dma.c). After that I compiled the RC8 again and the P.A. Semi Ethernet interface is still working. That means the removed source code isn't responsible for the problem.

New Nemo patch: nemo_4.4-12.patch

We are near of the problematic source code. ;-)
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

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

Re: Kernel 4.4

Post by xeno74 »

Srtest wrote:It's not working and this time I don't even get to the monitor blackout phase as the cfe firmware outputs a "I/O error".

Please remove everything that has to do with virtio as it didn't exist in RC3.
@Srtest

I removed all virtio things from the kernel 4.4 final.

@All

I patched the final version with our new Nemo patch 4.4-12 and after that I compiled it today.

New:
Download: vmlinux-4.4-AmigaONE_X1000.tar.gz


MATE on Debian Sid PowerPC with the final version of kernel 4.4 and the new iceweasel 44.0b2:

Image
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

User avatar
Srtest
Posts: 240
Joined: Wed Jun 11, 2014 5:06 pm

Re: Kernel 4.4

Post by Srtest »

"e2fs: I/O error on device -1"

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

Re: Kernel 4.4

Post by xeno74 »

Srtest wrote:"e2fs: I/O error on device -1"
I think it is something wrong with the file system. Could anyone else test this kernel, please?
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

User avatar
Srtest
Posts: 240
Joined: Wed Jun 11, 2014 5:06 pm

Re: Kernel 4.4

Post by Srtest »

Tested both -fatfs and -ext2 on usbdisk0 and cf0. When it manages to get past I/O error it reaches the monitor blackout phase.

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

Re: Kernel 4.4

Post by xeno74 »

Srtest wrote:Tested both -fatfs and -ext2 on usbdisk0 and cf0. When it manages to get past I/O error it reaches the monitor blackout phase.
Oh sorry I don't know. Does it work with the kernel 4.1.15?

@All

I removed some source code from the Nemo patch again. After that I compiled the final of the kernel 4.4 again and the P.A. Semi Ethernet interface is still working. That means the removed source code isn't responsible for the problem.

New Nemo patch: nemo_4.4-13.patch

Here is the rest of the code, which I need to solve the P.A. Semi Ethernet issue:

Code: Select all

diff -rupN linux-4.4/arch/powerpc/Kconfig linux-4.4-nemo/arch/powerpc/Kconfig
--- linux-4.4/arch/powerpc/Kconfig    2015-12-07 00:43:12.000000000 +0100
+++ linux-4.4-nemo/arch/powerpc/Kconfig    2015-12-07 14:48:23.371987988 +0100
@@ -158,8 +155,6 @@ config PPC
     select HAVE_PERF_EVENTS_NMI if PPC64
     select EDAC_SUPPORT
     select EDAC_ATOMIC_SCRUB
-    select ARCH_HAS_DMA_SET_COHERENT_MASK
-    select HAVE_ARCH_SECCOMP_FILTER

 config GENERIC_CSUM
     def_bool CPU_LITTLE_ENDIAN
@@ -419,8 +414,7 @@ config PPC64_SUPPORTS_MEMORY_FAILURE

 config KEXEC
     bool "kexec system call"
-    depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP)) || PPC_BOOK3E
-    select KEXEC_CORE
+    depends on (PPC_BOOK3S || FSL_BOOKE || (44x && !SMP))
     help
       kexec is a system call that implements the ability to shutdown your
       current kernel, and to start another kernel.  It is like a reboot

diff -rupN linux-4.4/arch/powerpc/kernel/dma.c linux-4.4-nemo/arch/powerpc/kernel/dma.c
--- linux-4.4/arch/powerpc/kernel/dma.c    2015-12-07 00:43:12.000000000 +0100
+++ linux-4.4-nemo/arch/powerpc/kernel/dma.c    2015-12-07 14:49:38.098286892 +0100
@@ -40,31 +39,9 @@ static u64 __maybe_unused get_pfn_limit(
     return pfn;
 }

-static int dma_direct_dma_supported(struct device *dev, u64 mask)
-{
-#ifdef CONFIG_PPC64
-    u64 limit = get_dma_offset(dev) + (memblock_end_of_DRAM() - 1);
-
-    /* Limit fits in the mask, we are good */
-    if (mask >= limit)
-        return 1;
-
-#ifdef CONFIG_FSL_SOC
-    /* Freescale gets another chance via ZONE_DMA/ZONE_DMA32, however
-     * that will have to be refined if/when they support iommus
-     */
-    return 1;
-#endif
-    /* Sorry ... */
-    return 0;
-#else
-    return 1;
-#endif
-}
-
-void *__dma_direct_alloc_coherent(struct device *dev, size_t size,
-                  dma_addr_t *dma_handle, gfp_t flag,
-                  struct dma_attrs *attrs)
+void *dma_direct_alloc_coherent(struct device *dev, size_t size,
+                dma_addr_t *dma_handle, gfp_t flag,
+                struct dma_attrs *attrs)
 {
     void *ret;
 #ifdef CONFIG_NOT_COHERENT_CACHE
@@ -119,9 +96,9 @@ void *__dma_direct_alloc_coherent(struct
 #endif
 }

-void __dma_direct_free_coherent(struct device *dev, size_t size,
-                void *vaddr, dma_addr_t dma_handle,
-                struct dma_attrs *attrs)
+void dma_direct_free_coherent(struct device *dev, size_t size,
+                  void *vaddr, dma_addr_t dma_handle,
+                  struct dma_attrs *attrs)
 {
 #ifdef CONFIG_NOT_COHERENT_CACHE
     __dma_free_coherent(size, vaddr);
@@ -130,51 +107,6 @@ void __dma_direct_free_coherent(struct d
 #endif
 }

-static void *dma_direct_alloc_coherent(struct device *dev, size_t size,
-                       dma_addr_t *dma_handle, gfp_t flag,
-                       struct dma_attrs *attrs)
-{
-    struct iommu_table *iommu;
-
-    /* The coherent mask may be smaller than the real mask, check if
-     * we can really use the direct ops
-     */
-    if (dma_direct_dma_supported(dev, dev->coherent_dma_mask))
-        return __dma_direct_alloc_coherent(dev, size, dma_handle,
-                           flag, attrs);
-
-    /* Ok we can't ... do we have an iommu ? If not, fail */
-    iommu = get_iommu_table_base(dev);
-    if (!iommu)
-        return NULL;
-
-    /* Try to use the iommu */
-    return iommu_alloc_coherent(dev, iommu, size, dma_handle,
-                    dev->coherent_dma_mask, flag,
-                    dev_to_node(dev));
-}
-
-static void dma_direct_free_coherent(struct device *dev, size_t size,
-                     void *vaddr, dma_addr_t dma_handle,
-                     struct dma_attrs *attrs)
-{
-    struct iommu_table *iommu;
-
-    /* See comments in dma_direct_alloc_coherent() */
-    if (dma_direct_dma_supported(dev, dev->coherent_dma_mask))
-        return __dma_direct_free_coherent(dev, size, vaddr, dma_handle,
-                          attrs);
-    /* Maybe we used an iommu ... */
-    iommu = get_iommu_table_base(dev);
-
-    /* If we hit that we should have never allocated in the first
-     * place so how come we are freeing ?
-     */
-    if (WARN_ON(!iommu))
-        return;
-    iommu_free_coherent(iommu, size, vaddr, dma_handle);
-}
-
 int dma_direct_mmap_coherent(struct device *dev, struct vm_area_struct *vma,
                  void *cpu_addr, dma_addr_t handle, size_t size,
                  struct dma_attrs *attrs)
@@ -215,6 +147,18 @@ static void dma_direct_unmap_sg(struct d
 {
 }

+static int dma_direct_dma_supported(struct device *dev, u64 mask)
+{
+#ifdef CONFIG_PPC64
+    /* Could be improved so platforms can set the limit in case
+     * they have limited DMA windows
+     */
+    return mask >= get_dma_offset(dev) + (memblock_end_of_DRAM() - 1);
+#else
+    return 1;
+#endif
+}
+
 static u64 dma_direct_get_required_mask(struct device *dev)
 {
     u64 end, mask;
@@ -286,25 +230,6 @@ struct dma_map_ops dma_direct_ops = {
 };
 EXPORT_SYMBOL(dma_direct_ops);

-int dma_set_coherent_mask(struct device *dev, u64 mask)
-{
-    if (!dma_supported(dev, mask)) {
-        /*
-         * We need to special case the direct DMA ops which can
-         * support a fallback for coherent allocations. There
-         * is no dma_op->set_coherent_mask() so we have to do
-         * things the hard way:
-         */
-        if (get_dma_ops(dev) != &dma_direct_ops ||
-            get_iommu_table_base(dev) == NULL ||
-            !dma_iommu_dma_supported(dev, mask))
-            return -EIO;
-    }
-    dev->coherent_dma_mask = mask;
-    return 0;
-}
-EXPORT_SYMBOL(dma_set_coherent_mask);
-
 #define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16)

 int __dma_set_mask(struct device *dev, u64 dma_mask)
Could you please look in the rest of the code? Maybe you can find the problem.

Thanks in advance,

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

Running Linux on AmigaONEs can require some tinkering.

zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 5:40 am
Location: France

Re: Kernel 4.4

Post by zzd10h »

Hi,
I tested all the 4.4 kernels, here are my results on X1000/R7-250X :

4.4.2 OK
4.4.3 OK
4.4.4 rc2 = KO black screen after "Booting Linux via __start()..."
4.4.5 = KO black screen after "Booting Linux via __start()..."
4.4.6 =KO stay at "Booting Linux via __start()..."
4.4.7 = KO black screen after "Booting Linux via __start()..."
4.4.8 = KO black screen after "Booting Linux via __start()..."

So latest working is 4.4.3, it seems that I have the same problem than srtest...
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE

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

Re: Kernel 4.4

Post by xeno74 »

zzd10h wrote:Hi,
I tested all the 4.4 kernels, here are my results on X1000/R7-250X :

4.4.4 rc2 = KO black screen after "Booting Linux via __start()..."
You mean 4.4-rc4, don't you?
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.

zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 5:40 am
Location: France

Re: Kernel 4.4

Post by zzd10h »

Yes, 4.4.4-2 don't boot
this one http://forum.hyperion-entertainment.biz ... =20#p36135

So latest working 4.4 kernel for me is 4.4.3
this one
http://forum.hyperion-entertainment.biz ... =10#p36015

Could you confirm that srtest problem is the same one ?
If yes, the problem could be really the newest Radeon GFX card.
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE

Post Reply