From: Mauro Carvalho Chehab <mchehab@kernel.org>
To: Markus Dobel <markus.dobel@gmx.de>,
Brad Love <brad@nextdimension.cc>,
Alex Deucher <alexdeucher@gmail.com>
Cc: linux-media@vger.kernel.org, linux-media-owner@vger.kernel.org
Subject: Re: [PATCH] Revert 95f408bb Ryzen DMA related RiSC engine stall fixes
Date: Sun, 16 Dec 2018 12:23:15 -0200 [thread overview]
Message-ID: <20181216122315.2539ae80@coco.lan> (raw)
In-Reply-To: <8858694d5934ce78e46ef48d6f90061a@gmx.de>
Em Sun, 16 Dec 2018 11:37:02 +0100
Markus Dobel <markus.dobel@gmx.de> escreveu:
> On 06.12.2018 19:01, Mauro Carvalho Chehab wrote:
> > Em Thu, 06 Dec 2018 18:18:23 +0100
> > Markus Dobel <markus.dobel@gmx.de> escreveu:
> >
> >> Hi everyone,
> >>
> >> I will try if the hack mentioned fixes the issue for me on the weekend
> >> (but I assume, as if effectively removes the function).
> >
> > It should, but it keeps a few changes. Just want to be sure that what
> > would be left won't cause issues. If this works, the logic that would
> > solve Ryzen DMA fixes will be contained into a single point, making
> > easier to maintain it.
>
> Hi,
>
> I wanted to have this setup running stable for a few days before
> replying, that's why I am answering only now.
>
> But yes, as expected, with Mauro's hack, the driver has been stable for
> me for about a week, with several
> scheduled recordings in tvheadend, none of them missed.
>
> So, adding a reliable detection for affected chipsets, where the `if
> (1)` currently is, should work.
Markus,
Thanks for testing!
Brad/Alex,
I guess we should then stick with this patch:
https://patchwork.linuxtv.org/patch/53351/
The past approach that we used on cx88, bttv and other old drivers
were to patch drivers/pci/quirks.c, making them to "taint" DMA
memory controllers that were known to bad affect on media devices,
and then some logic at the drivers to check for such "taint".
However, that would require to touch another subsystem, with
usually cause delays. Also, as Alex pointed, this could well
be just a matter of incompatibility between the cx23885 and
the Ryzen DMA controller, and may not affect any other drivers.
So, let's start with a logic like what I proposed, fine
tuning it to the Ryzen DMA controllers with we know have
troubles with the driver.
We need to list the PCI ID of the memory controllers at the
device ID table on that patch, though. At the RFC patch,
I just added an IOMMU PCI ID from a randon Ryzen CPU:
+static struct {
+ int vendor, dev;
+} const broken_dev_id[] = {
+ /* According with
+ * https://openbenchmarking.org/system/1703021-RI-AMDZEN08075/Ryzen%207%201800X/lspci,
+ * 0x1451 is PCI ID for the IOMMU found on Ryzen 7
+ */
+ { PCI_VENDOR_ID_AMD, 0x1451 },
+};
+
Ideally, the ID for the affected Ryzen DMA engines should be there at
include/linux/pci_ids.h, instead of hard-coded inside a driver.
Also, we should, instead, add there the PCI IDs of the DMA engines
that are known to have problems with the cx23885.
There one thing that still bothers me: could this problem be due to
some BIOS setup [1]? If so, are there any ways for dynamically
disabling such features inside the driver?
[1] like this: https://www.techarp.com/bios-guide/cpu-pci-write-buffer/
Brad,
From your reports about the DMA issues, do you know what generations
of the Ryzen are affected?
Alex,
Do you know if are there any differences at the IP block for the
DMA engine used on different Ryzen CPUs? I mean: I suspect that
the engine for Ryzen 2nd generation would likely be different than
the one at the 1st generation, but, along the same generation, does
the Ryzen 3, 5, 7 and Threadripper use the same DMA engine?
Thanks,
Mauro
next prev parent reply other threads:[~2018-12-16 14:23 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-21 13:45 [PATCH] Revert 95f408bb Ryzen DMA related RiSC engine stall fixes Markus Dobel
2018-12-05 11:07 ` Mauro Carvalho Chehab
2018-12-06 16:37 ` Brad Love
2018-12-06 17:18 ` Markus Dobel
2018-12-06 18:01 ` Mauro Carvalho Chehab
2018-12-06 18:36 ` Alex Deucher
2018-12-06 19:07 ` Mauro Carvalho Chehab
2018-12-06 19:32 ` Mauro Carvalho Chehab
2018-12-18 22:59 ` [PATCH v2] cx23885: only reset DMA on problematic CPUs Brad Love
2018-12-18 23:49 ` Alex Deucher
2018-12-19 17:26 ` Brad Love
2018-12-19 17:40 ` Brad Love
2018-12-19 11:08 ` Matthias Schwarzott
2018-12-19 17:09 ` Brad Love
2018-12-19 17:07 ` [PATCH v3] " Brad Love
2018-12-20 13:43 ` Mauro Carvalho Chehab
2018-12-16 10:37 ` [PATCH] Revert 95f408bb Ryzen DMA related RiSC engine stall fixes Markus Dobel
2018-12-16 14:23 ` Mauro Carvalho Chehab [this message]
2018-12-18 2:05 ` Alex Deucher
2018-12-18 6:32 ` Markus Dobel
2018-12-18 12:45 ` Mauro Carvalho Chehab
2018-12-18 23:11 ` Brad Love
2018-12-18 23:46 ` Alex Deucher
2018-12-19 0:05 ` Brad Love
2018-12-19 0:08 ` Brad Love
2018-12-19 19:07 ` Alex Deucher
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=20181216122315.2539ae80@coco.lan \
--to=mchehab@kernel.org \
--cc=alexdeucher@gmail.com \
--cc=brad@nextdimension.cc \
--cc=linux-media-owner@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=markus.dobel@gmx.de \
/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;
as well as URLs for NNTP newsgroup(s).