Kernel 5.4

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

Re: Kernel 5.4

Post by xeno74 »

Skateman wrote:Kernel 5.4 RC7-2 running on the AmigaOne X5000 :-)
Hi Skateman,

Hey it’s me on the screenshot. :-D Thanks a lot for testing the RC7-2.

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

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9319
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 5.4

Post by xeno74 »

FYI: Source files of the Dawicontrol DC 2976 UW SCSI board (PCI): drivers/scsi/sym53c8xx_2

Code: Select all

/*
 *  DMA addressing mode.
 *
 *  0 : 32 bit addressing for all chips.
 *  1 : 40 bit addressing when supported by chip.
 *  2 : 64 bit addressing when supported by chip,
 *      limited to 16 segments of 4 GB -> 64 GB max.
 */
#define	SYM_CONF_DMA_ADDRESSING_MODE CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE
Cyrus config:

CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1

I will configure “0 : 32 bit addressing for all chips” for the RC8. Maybe this is the solution.
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9319
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 5.4

Post by xeno74 »

Hi All,

Here is the RC8 of kernel 5.4 for testing.

New:
Download: linux-image-5.4-rc8-X1000_X5000.tar.gz

Screenshot of Fienix PowerPC with the RC8 of kernel 5.4 on an A-EON AmigaOne X5000/40:

Image

@Roland
Please test the kernel with your Dawicontrol DC 2976 UW SCSI PCI board.

@All
Please test all kernels.

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

Running Linux on AmigaONEs can require some tinkering.
User avatar
Skateman
Posts: 858
Joined: Thu Aug 10, 2017 8:36 pm
Location: The Netherlands

Re: Kernel 5.4

Post by Skateman »

Kernel 5.4 RC8 up and running on the AmigaOne X5000

Image

Big picture http://www.skateman.nl/wp-content/uploa ... 193919.png
AmigaOne X5000 -> 2GHz / 16GB RAM / Radeon RX 570 / Radeon X1950 / M-Audio 5.1 -> AmigaOS / Linux
Amiga 1200 -> Recapped / 68ec020 ACA 1221ec / CF HDD / RetroNET connected to the world
Vampire 4SA - RPi4 Running AmiKitXE Full
Roland
Posts: 824
Joined: Tue May 02, 2017 7:23 am

Re: Kernel 5.4

Post by Roland »

xeno74 wrote: @Roland
Please test the kernel with your Dawicontrol DC 2976 UW SCSI PCI board.
Thanks for trying to solve the issue! But I can test it only after a few weeks, when I'm back to my X5000 again.
- Roland -
User avatar
xeno74
Posts: 9319
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 5.4

Post by xeno74 »

Roland wrote: Thanks for trying to solve the issue! But I can test it only after a few weeks, when I'm back to my X5000 again.
OK, I will leave CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 for the next kernels. ;-)
Skateman wrote:Kernel 5.4 RC8 up and running on the AmigaOne X5000
Many thanks for testing the RC8! :-)
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9319
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 5.4

Post by xeno74 »

Roland,

Please also test the RC8-2.

New:

- X5000/20 and X5000/40: dma-v1.patch for solving the DMA issues with some PCI cards

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

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9319
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 5.4

Post by xeno74 »

xeno74 wrote:Roland,

Please also test the RC8-2.

New:

- X5000/20 and X5000/40: dma-v1.patch for solving the DMA issues with some PCI cards

Thanks,
Christian
Roland,

Another kernel for testing.

Download: linux-image-5.4-rc9-X5000.tar.gz

New:

- git clone git://git.infradead.org/users/hch/misc.git --branch fsl-dma-debugging a

Please post the dmesg output.

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

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9319
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 5.4

Post by xeno74 »

FYI:
Christoph Hellwig wrote: I think we have two sorta overlapping issues here. One is that I think
we need the bus_dma_limit, which should mostly help for something like
a SCSI controller that doesn't need streaming mappings (btw, do we
have more details on that somewhere?).

And something weird with the videobuf things. Your change of the dma
masks suggests that the driver doesn't do the right allocations and thus
hits bounce buffering (swiotlb). We should fix that for real, but the
fact that the bounce buffering itself also fails is even more interesting.

Can you try this git branch:

git://git.infradead.org/users/hch/misc.git fsl-dma-debugging

Gitweb:

http://git.infradead.org/users/hch/misc ... -debugging

and send me the dmesg with that with your TV adapter?
xeno74 wrote: Hello Christoph,

Please find attached the dmesg of your Git kernel.

Thanks,
Christian
Link to the dmesg: dmesg_p5040_2019-11-23.txt (text/plain), 53.86 KB
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
User avatar
xeno74
Posts: 9319
Joined: Fri Mar 23, 2012 7:58 am

Re: Kernel 5.4

Post by xeno74 »

xeno74 wrote:Hi All,

Great news! :-)

The issue with the BT878 TV cards is solved.

GFP_DMA32 was renamed to GFP_DMA in the PowerPC updates 4.21-1 in December last year.

Some PCI devices still use GFP_DMA32 (grep -r GFP_DMA32 *). I renamed GFP_DMA32 to GFP_DMA in the file "drivers/media/v4l2-core/videobuf-dma-sg.c".
After compiling the RC7 of kernel 5.4, my BT878 TV card works again.

I created a patch for renaming GFP_DMA32 to GFP_DMA.

Code: Select all

--- a/drivers/media/v4l2-core/videobuf-dma-sg.c	2019-11-11 01:17:15.000000000 +0100
+++ b/drivers/media/v4l2-core/videobuf-dma-sg.c	2019-11-13 10:07:19.288958966 +0100
@@ -440,7 +440,7 @@ static vm_fault_t videobuf_vm_fault(stru
 	dprintk(3, "fault: fault @ %08lx [vma %08lx-%08lx]\n",
 		vmf->address, vma->vm_start, vma->vm_end);
 
-	page = alloc_page(GFP_USER | __GFP_DMA32);
+	page = alloc_page(GFP_USER | __GFP_DMA);
 	if (!page)
 		return VM_FAULT_OOM;
 	clear_user_highpage(page, vmf->address);
FYI:
Message: 4
Date: Sun, 24 Nov 2019 20:20:07 -0800
From: John Hubbard <jhubbard@nvidia.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>, Alex Williamson
<alex.williamson@redhat.com>, Benjamin Herrenschmidt
<benh@kernel.crashing.org>, Bj?rn T?pel <bjorn.topel@intel.com>,
Christoph Hellwig <hch@infradead.org>, Dan Williams
<dan.j.williams@intel.com>, Daniel Vetter <daniel@ffwll.ch>, Dave
Chinner <david@fromorbit.com>, David Airlie <airlied@linux.ie>, "David
S . Miller" <davem@davemloft.net>, Ira Weiny <ira.weiny@intel.com>,
Jan Kara <jack@suse.cz>, Jason Gunthorpe <jgg@ziepe.ca>, Jens Axboe
<axboe@kernel.dk>, Jonathan Corbet <corbet@lwn.net>, J?r?me Glisse
<jglisse@redhat.com>, Magnus Karlsson <magnus.karlsson@intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>, Michael Ellerman
<mpe@ellerman.id.au>, Michal Hocko <mhocko@suse.com>, Mike Kravetz
<mike.kravetz@oracle.com>, Paul Mackerras <paulus@samba.org>, Shuah
Khan <shuah@kernel.org>, Vlastimil Babka <vbabka@suse.cz>,
<bpf@vger.kernel.org>, <dri-devel@lists.freedesktop.org>,
<kvm@vger.kernel.org>, <linux-block@vger.kernel.org>,
<linux-doc@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
<linux-kselftest@vger.kernel.org>, <linux-media@vger.kernel.org>,
<linux-rdma@vger.kernel.org>, <linuxppc-dev@lists.ozlabs.org>,
<netdev@vger.kernel.org>, <linux-mm@kvack.org>, LKML
<linux-kernel@vger.kernel.org>, John Hubbard <jhubbard@nvidia.com>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>
Subject: [PATCH 15/19] media/v4l2-core: pin_user_pages (FOLL_PIN) and
put_user_page() conversion
Message-ID: <20191125042011.3002372-16-jhubbard@nvidia.com>
Content-Type: text/plain

1. Change v4l2 from get_user_pages() to pin_user_pages().

2. Because all FOLL_PIN-acquired pages must be released via
put_user_page(), also convert the put_page() call over to
put_user_pages_dirty_lock().

Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>

Code: Select all

drivers/media/v4l2-core/videobuf-dma-sg.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c
index 28262190c3ab..162a2633b1e3 100644
--- a/drivers/media/v4l2-core/videobuf-dma-sg.c
+++ b/drivers/media/v4l2-core/videobuf-dma-sg.c
@@ -183,12 +183,12 @@ static int videobuf_dma_init_user_locked(struct videobuf_dmabuf *dma,
   dprintk(1, "init user [0x%lx+0x%lx => %d pages]\n",
       data, size, dma->nr_pages);

-    err = get_user_pages(data & PAGE_MASK, dma->nr_pages,
+    err = pin_user_pages(data & PAGE_MASK, dma->nr_pages,
                flags | FOLL_LONGTERM, dma->pages, NULL);

   if (err != dma->nr_pages) {
       dma->nr_pages = (err >= 0) ? err : 0;
-        dprintk(1, "get_user_pages: err=%d [%d]\n", err,
+        dprintk(1, "pin_user_pages: err=%d [%d]\n", err,
           dma->nr_pages);
       return err < 0 ? err : -EINVAL;
   }
@@ -349,11 +349,8 @@ int videobuf_dma_free(struct videobuf_dmabuf *dma)
   BUG_ON(dma->sglen);

   if (dma->pages) {
-        for (i = 0; i < dma->nr_pages; i++) {
-            if (dma->direction == DMA_FROM_DEVICE)
-                set_page_dirty_lock(dma->pages[i]);
-            put_page(dma->pages[i]);
-        }
+        put_user_pages_dirty_lock(dma->pages, dma->nr_pages,
+                      dma->direction == DMA_FROM_DEVICE);
       kfree(dma->pages);
       dma->pages = NULL;
   }
http://www.amigalinux.org
http://www.supertuxkart-amiga.de

Running Linux on AmigaONEs can require some tinkering.
Post Reply