mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: Michal Lazo <michal.lazo@gmail.com>
Cc: "open list:ARM/Amlogic Meson..." <linux-amlogic@lists.infradead.org>
Subject: Re: amlogic meson pcie driver with dvb device
Date: Wed, 3 Jun 2020 17:11:54 +0200	[thread overview]
Message-ID: <61fcd18e-0ea8-d5dd-9772-dfc4333a319c@baylibre.com> (raw)
In-Reply-To: <CAHPeh9=Vq1SAbCipoFhZC_im88tPwAtvfgc+0z-LCe3P7Eq-LA@mail.gmail.com>

Hi,

On 03/06/2020 12:25, Michal Lazo wrote:
> Hi
> From time to time PCIE host can't find device without the patch
> https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/dwc&id=87dccf09323fc363bd0d072fcc12b96622ab8c69
> So patch really solved the problem

Good news

> 
> I am using this M.2 to PCIE
> https://www.aliexpress.com/item/32850272748.html?spm=a2g0o.productlist.0.0.5faa5fd8qQvrhe&algo_pvid=a87d8ad9-b690-42a8-b991-16cb8c5964b5&algo_expid=a87d8ad9-b690-42a8-b991-16cb8c5964b5-39&btsid=0be3764315911784140856821ec51a&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_ 
> 
> PCIE wifi card is working fine

Nice to hear, thx for the reference.

> But I don't have luck with DVB
> And I would also like to try gfx card

It's known GFX cards doesn't work well on ARM64 with limited physical physical PCI space like here.

> As MACCHIATObin and some other boards are able to use big gfx cards
> So I think that bitcoin miners would be interested 
> 
> DVB card don't have mainline drivers :(
> so they use this https://github.com/tbsdtv/linux_media/wiki

Ok, so maybe these dvb driver are broken somehow.

> 
> khadas@Khadas:~/tbs/media_build/v4l$ /home/khadas/tbs/media/scripts/faddr2line si2183.ko si2183_init+0x34
> si2183_init+0x34/0x618:
> i2c_get_clientdata at /usr/src/linux-headers-5.7.0/./include/linux/i2c.h:356
> (inlined by) si2183_init at /home/khadas/tbs/media_build/v4l/si2183.c:878
> 
> https://github.com/tbsdtv/linux_media/blob/latest/drivers/media/dvb-frontends/si2183.c#L878  

Looks like the i2c device is not found, so maybe a driver is missing somewhere to have i2c over
PCI. Since it's out of tree, can't really help here.

You should compare with another ARM board where is works.

Neil


> Is it possible to add vmlinux to  faddr2line
> so I we see whole stacktrace ?
> 
> On Wed, Jun 3, 2020 at 9:37 AM Neil Armstrong <narmstrong@baylibre.com <mailto:narmstrong@baylibre.com>> wrote:
> 
>     Hi Michal,
> 
>     [please CC linux-amlogic@lists.infradead.org <mailto:linux-amlogic@lists.infradead.org> for these kind of questions,
>     other people may also be interested]
> 
>     On 03/06/2020 01:56, Michal Lazo wrote:
>     > Hi Neal
>     > I am playing with khadas vim3 2GB RAM
>     > and I have DVB-T card  connected to device with PCIE to M.2
>     > First I have problem with dma buffer size
>     > so I changed coherent_pool=16M
>     > as drivers don't want to probe
> 
>     I never tried the PCIe driver with something else than an NVMe, and I don't have the HW to, so I can't help...
> 
>     Did you try this patch ?
>     https://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/commit/?h=pci/dwc&id=87dccf09323fc363bd0d072fcc12b96622ab8c69
> 
>     But I'm curious, what did you use to connect a DVB card on the M.2 port ?
> 
>     >
>     > Now I have problem with drivers
>     > [    7.530312] TBSECP3 driver 0000:01:00.0: DVB: registering adapter 7 frontend 0 (Turbosight TBS 6209 (Octa DVB-T/T2/C/C2/ISDB-T))...
>     > [    7.530384] TBSECP3 driver 0000:01:00.0: Turbosight TBS 6209 (Octa DVB-T/T2/C/C2/ISDB-T): PCI 0000:01:00.0, IRQ 36, MMIO 0xfc700000
>     > [    9.637643] ieee80211 phy0: brcmf_dongle_roam: WLC_SET_ROAM_TRIGGER error (-52)
>     > [    9.880865] meson8b-dwmac ff3f0000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
>     > [    9.880891] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
>     > [   10.249253] Unable to handle kernel paging request at virtual address 0000000900000098
>     > [   10.253852] Mem abort info:
>     > [   10.256588]   ESR = 0x96000004
>     > [   10.259629]   EC = 0x25: DABT (current EL), IL = 32 bits
>     > [   10.264880]   SET = 0, FnV = 0
>     > [   10.267898]   EA = 0, S1PTW = 0
>     > [   10.271002] Data abort info:
>     > [   10.273850]   ISV = 0, ISS = 0x00000004
>     > [   10.277643]   CM = 0, WnR = 0
>     > [   10.280570] user pgtable: 4k pages, 48-bit VAs, pgdp=000000004a9aa000
>     > [   10.286961] [0000000900000098] pgd=0000000000000000
>     > [   10.291792] Internal error: Oops: 96000004 [#1] SMP
>     > [   10.296608] Modules linked in: zram zsmalloc si2157(O) si2183(O) tbsecp3(O) hci_uart btqca tas2101(O) btsdio btbcm videobuf2_vmalloc(O) bluetooth videobuf2_memops(O) videobuf2_common(O) panfrost ao_cec_g12a ecdh_generic ecc gpu_sched brcmfmac brcmutil cfg80211 rfkill ip_tables x_tables btrfs blake2b_generic xor xor_neon zstd_compress zlib_deflate raid6_pq libcrc32c gpio_pca953x rtc_hym8563 gpio_keys_polled
>     > [   10.336753] CPU: 1 PID: 2252 Comm: kdvb-ad-0-fe-0 Tainted: G           O      5.7.0 #0.9.1
>     > [   10.344942] Hardware name: Khadas VIM3 (DT)
>     > [   10.349084] pstate: 40000005 (nZcv daif -PAN -UAO)
>     > [   10.353835] pc : si2183_init+0x34/0x618 [si2183]
>     > [   10.358404] lr : dvb_frontend_init+0x28/0xb0
>     > [   10.362623] sp : ffff800014753d00
>     > [   10.365902] x29: ffff800014753d00 x28: 0000000000000000
>     > [   10.371162] x27: ffff000045a60738 x26: ffff000074e40b28
>     > [   10.376425] x25: ffff8000123a9000 x24: 0000000900000000
>     > [   10.381685] x23: ffff8000124ccc30 x22: ffff000074c6ac00
>     > [   10.386946] x21: ffff000074964100 x20: ffff000074964100
>     > [   10.392207] x19: ffff000074e40800 x18: 0000000000000000
>     > [   10.397468] x17: 0000000000000000 x16: 0000000000000000
>     > [   10.402730] x15: 0000000000000000 x14: 0000000000000122
>     > [   10.407991] x13: 0000000000000122 x12: 0000000000000001
>     > [   10.413252] x11: 0000000000000001 x10: 00000000000008c0
>     > [   10.418513] x9 : ffff800014753d90 x8 : ffff000074964a20
>     > [   10.423775] x7 : 0000000000000400 x6 : 0000000000000001
>     > [   10.429036] x5 : 0000000000000001 x4 : 0000000000000001
>     > [   10.434297] x3 : ffff0000749647cc x2 : ffff0000749647cc
>     > [   10.439558] x1 : 0000000000000000 x0 : ffff000074964530
>     > [   10.444820] Call trace:
>     > [   10.447241]  si2183_init+0x34/0x618 [si2183]
> 
>     You should find where this failed.
>     You can find by calling :
> 
>     $ scripts/faddr2line vmlinux si2183_init+0x34
> 
>     where you built the kernel.
> 
>     > [   10.451465]  dvb_frontend_init+0x28/0xb0
>     > [   10.455345]  dvb_frontend_thread+0x70/0x630
>     > [   10.459486]  kthread+0x120/0x128
>     > [   10.462677]  ret_from_fork+0x10/0x18
>     > [   10.466214] Code: f9419e78 f9400001 f9004fe1 d2800001 (f9404f17)
>     > [   10.472252] ---[ end trace c9ac52dd6dd46eda ]---
>     >
>     >
>     > this is from pcie
>     > dmesg | grep "pci"
>     > [    0.337887] dw-pcie fc000000.pcie: IRQ index 1 not found
>     > [    0.338032] meson-pcie fc000000.pcie: get phy failed, -517
>     > [    1.238322] ehci-pci: EHCI PCI platform driver
>     > [    1.254013] ohci-pci: OHCI PCI platform driver
>     > [    1.625682] dw-pcie fc000000.pcie: IRQ index 1 not found
>     > [    1.632404] meson-pcie fc000000.pcie: host bridge /soc/pcie@fc000000 ranges:
>     > [    1.637209] meson-pcie fc000000.pcie:       IO 0x00fc600000..0x00fc6fffff -> 0x0000000000
>     > [    1.645311] meson-pcie fc000000.pcie:      MEM 0x00fc700000..0x00fdffffff -> 0x00fc700000
>     > [    1.658361] meson-pcie fc000000.pcie: Link up
>     > [    1.658454] meson-pcie fc000000.pcie: PCI host bridge to bus 0000:00
>     > [    1.664069] pci_bus 0000:00: root bus resource [bus 00-ff]
>     > [    1.669454] pci_bus 0000:00: root bus resource [io  0x0000-0xfffff]
>     > [    1.669457] pci_bus 0000:00: root bus resource [mem 0xfc700000-0xfdffffff]
>     > [    1.680598] pci 0000:00:00.0: [16c3:abcd] type 01 class 0x060400
>     > [    1.691911] pci 0000:00:00.0: reg 0x38: [mem 0x00000000-0x0000ffff pref]
>     > [    1.703738] pci 0000:00:00.0: supports D1
>     > [    1.716202] pci 0000:00:00.0: PME# supported from D0 D1 D3hot D3cold
>     > [    1.718012] pci 0000:01:00.0: [544d:6178] type 00 class 0x048000
>     > [    1.739761] pci 0000:01:00.0: reg 0x10: [mem 0xfffc0000-0xffffffff]
>     > [    1.746061] pci 0000:01:00.0: Upstream bridge's Max Payload Size set to 128 (was 256, max 256)
>     > [    1.754422] pci 0000:01:00.0: Max Payload Size set to 128 (was 128, max 128)
>     > [    1.788507] pci 0000:00:00.0: BAR 8: assigned [mem 0xfc700000-0xfc7fffff]
>     > [    1.789645] pci 0000:00:00.0: BAR 6: assigned [mem 0xfc800000-0xfc80ffff pref]
>     > [    1.796805] pci 0000:01:00.0: BAR 0: assigned [mem 0xfc700000-0xfc73ffff]
>     > [    1.803543] pci 0000:00:00.0: PCI bridge to [bus 01-ff]
>     > [    1.808706] pci 0000:00:00.0:   bridge window [mem 0xfc700000-0xfc7fffff]
>     > [    1.815635] pcieport 0000:00:00.0: PME: Signaling with IRQ 33
>     > [    1.821412] pcieport 0000:00:00.0: AER: enabled with IRQ 33
> 
>     This looks ok
> 
>     >
>     > lspci -xkvv
>     > 00:00.0 PCI bridge: Synopsys, Inc. DWC_usb3 / PCIe bridge (rev 01) (prog-if 00 [Normal decode])
>     >         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
>     >         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>     >         Latency: 0
>     >         Interrupt: pin A routed to IRQ 33
>     >         Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
>     >         I/O behind bridge: [disabled]
>     >         Memory behind bridge: fc700000-fc7fffff [size=1M]
>     >         Prefetchable memory behind bridge: [disabled]
>     >         Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
>     >         Expansion ROM at fc800000 [virtual] [disabled] [size=64K]
>     >         BridgeCtl: Parity- SERR+ NoISA- VGA- VGA16- MAbort- >Reset- FastB2B-
>     >                 PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
>     >         Capabilities: <access denied>
>     >         Kernel driver in use: pcieport
>     > 00: c3 16 cd ab 07 04 10 00 01 00 04 06 00 00 01 00
>     > 10: 00 00 00 00 00 00 00 00 00 01 ff 00 f0 00 00 00
>     > 20: 70 fc 70 fc f0 ff 00 00 00 00 00 00 00 00 00 00
>     > 30: 00 00 00 00 40 00 00 00 00 00 00 00 20 01 02 00
>     >
>     > 01:00.0 Multimedia controller: TBS Technologies DVB Tuner PCIe Card
>     >         Subsystem: TBS Technologies (wrong ID) TBS6209 DVB-T2/C2/T/C/ISDB-T OctaTV Tuner
>     >         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
>     >         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>     >         Latency: 0
>     >         Interrupt: pin A routed to IRQ 36
>     >         Region 0: Memory at fc700000 (32-bit, non-prefetchable) [size=256K]
>     >         Capabilities: <access denied>
>     >         Kernel driver in use: TBSECP3 driver
>     >         Kernel modules: tbsecp3
>     > 00: 4d 54 78 61 06 04 10 00 00 00 80 04 00 00 00 00
>     > 10: 00 00 70 fc 00 00 00 00 00 00 00 00 00 00 00 00
>     > 20: 00 00 00 00 00 00 00 00 00 00 00 00 09 62 01 00
>     > 30: 00 00 00 00 50 00 00 00 00 00 00 00 20 01 00 00
> 
>     Same
> 
>     >
>     > any idea ?
>     > All works fine on intel board
> 
>     The PCIe arch is different between Intel and ARM boards, especially the Amlogic ones
>     since we are limited to 32bit physical adressing, so it's expected PCIe card for PCs could
>     fail on such platforms.
> 
>     Neil
> 


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

      parent reply	other threads:[~2020-06-03 15:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAHPeh9mU+2pESBPrmeKke--V2_+CuBrmOGoCSBC+d73ri_3-0g@mail.gmail.com>
2020-06-03  7:37 ` Neil Armstrong
     [not found]   ` <CAHPeh9=Vq1SAbCipoFhZC_im88tPwAtvfgc+0z-LCe3P7Eq-LA@mail.gmail.com>
2020-06-03 15:11     ` Neil Armstrong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61fcd18e-0ea8-d5dd-9772-dfc4333a319c@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=michal.lazo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®