From: Helge Deller <deller@gmx.de>
To: stable@vger.kernel.org, gregkh@linuxfoundation.org
Subject: [PATCH] parisc/pci: Switch LBA PCI bus from Hard Fail to Soft Fail mode
Date: Mon, 14 Oct 2019 21:29:01 +0200 [thread overview]
Message-ID: <20191014192901.GA13704@ls3530.fritz.box> (raw)
Dear stable kernel maintainers,
can you please add the patch below into all stable kernels up until (and
including) kernel 4.16 ?
It's upstream patch b845f66f78bf which was merged in kernel 4.17.
It turned out, that this patch prevents multiple kernel crashes when
users add standard PCI cards (e.g. PCI USB cards) to parisc boxes and
expect them to simply work. Instead, without this patch, parisc kernels
prior to v4.17 will crash the box since the default PCI behaviour is to
fault if Linux drivers read/write to PCI memory regions which aren't
backed by real hardware. This happens e.g. when the Linux drivers poke
into PCI memory to check if a specific hardware revision was installed.
I got multiple reports from users which ran into this problem, and by
adding this patch to older kernels (which are still used as distribution
install kernels, e.g. v4.16 for debian) people will be able to install
Linux with such PCI cards without crashes and with working PCI cards.
Thanks!
Helge
______________
Subject: [PATCH] parisc/pci: Switch LBA PCI bus from Hard Fail to Soft Fail mode
Carlo Pisani noticed that his C3600 workstation behaved unstable during heavy
I/O on the PCI bus with a VIA VT6421 IDE/SATA PCI card.
To avoid such instability, this patch switches the LBA PCI bus from Hard Fail
mode into Soft Fail mode. In this mode the bus will return -1UL for timed out
MMIO transactions, which is exactly how the x86 (and most other architectures)
PCI busses behave.
This patch is based on a proposal by Grant Grundler and Kyle McMartin 10
years ago:
https://www.spinics.net/lists/linux-parisc/msg01027.html
Cc: Carlo Pisani <carlojpisani@gmail.com>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Reviewed-by: Grant Grundler <grantgrundler@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c
index 41b740aed3a3..69bd98421eb1 100644
--- a/drivers/parisc/lba_pci.c
+++ b/drivers/parisc/lba_pci.c
@@ -1403,9 +1403,27 @@ lba_hw_init(struct lba_device *d)
WRITE_REG32(stat, d->hba.base_addr + LBA_ERROR_CONFIG);
}
- /* Set HF mode as the default (vs. -1 mode). */
+
+ /*
+ * Hard Fail vs. Soft Fail on PCI "Master Abort".
+ *
+ * "Master Abort" means the MMIO transaction timed out - usually due to
+ * the device not responding to an MMIO read. We would like HF to be
+ * enabled to find driver problems, though it means the system will
+ * crash with a HPMC.
+ *
+ * In SoftFail mode "~0L" is returned as a result of a timeout on the
+ * pci bus. This is like how PCI busses on x86 and most other
+ * architectures behave. In order to increase compatibility with
+ * existing (x86) PCI hardware and existing Linux drivers we enable
+ * Soft Faul mode on PA-RISC now too.
+ */
stat = READ_REG32(d->hba.base_addr + LBA_STAT_CTL);
+#if defined(ENABLE_HARDFAIL)
WRITE_REG32(stat | HF_ENABLE, d->hba.base_addr + LBA_STAT_CTL);
+#else
+ WRITE_REG32(stat & ~HF_ENABLE, d->hba.base_addr + LBA_STAT_CTL);
+#endif
/*
** Writing a zero to STAT_CTL.rf (bit 0) will clear reset signal
next reply other threads:[~2019-10-14 19:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-14 19:29 Helge Deller [this message]
2019-10-16 21:18 ` [PATCH] parisc/pci: Switch LBA PCI bus from Hard Fail to Soft Fail mode Greg KH
2019-10-17 5:13 ` Helge Deller
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=20191014192901.GA13704@ls3530.fritz.box \
--to=deller@gmx.de \
--cc=gregkh@linuxfoundation.org \
--cc=stable@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.