Open Doridian opened 3 years ago
No dice at all, I get the following repeatedly, does not detect any drives or work at all.
[ 22.749865] mpt2sas_cm0: sending diag reset !!
[ 23.727989] mpt2sas_cm0: diag reset: SUCCESS
[ 23.787230] mpt2sas_cm0: CurrentHostPageSize is 0: Setting default host page size to 4k
[ 38.877862] mpt2sas_cm0: config_request: manufacturing(0), action(0), form(0x00000000), smid(10236)
[ 38.877884] mpt2sas_cm0: _config_request: command timeout
[ 38.877897] mpt2sas_cm0: Command Timeout
[ 38.877907] mf:
[ 38.877918] 04000000
[ 38.877929] 00000000
[ 38.877939] 00000000
[ 38.877949] 00000000
[ 38.877959] 00000000
[ 38.877969] 09000000
[ 38.877979] 00000000
[ 38.877989] d3000000
[ 38.877998]
[ 38.878007] ffffffff
[ 38.878017] ffffffff
[ 38.878027] 00000000
[ 38.878053] mpt2sas_cm0: _config_request: attempting retry (1)
@Doridian did you make any progress?
I can confirm this error is caused by the PCIe controller that only supports 32bit MMIO reads/writes. I compiled a custom kernel with the patch suggested here: https://github.com/raspberrypi/linux/issues/4158#issuecomment-783469773 and the error was gone.
sweet, good find
For anyone getting these posts by mail, and following the various Graphics Cards threads, it will affect them too (writeq
and write
4 - 256 + bytes:
diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
index fd172c41df90..3731da41c680 100644
--- a/arch/arm64/include/asm/io.h
+++ b/arch/arm64/include/asm/io.h
@@ -42,7 +42,9 @@ static __always_inline void __raw_writel(u32 val, volatile void __iomem *addr)
#define __raw_writeq __raw_writeq
static inline void __raw_writeq(u64 val, volatile void __iomem *addr)
{
- asm volatile("str %x0, [%1]" : : "rZ" (val), "r" (addr));
+ //asm volatile("str %x0, [%1]" : : "rZ" (val), "r" (addr));
+ asm volatile("str %w0, [%1]" : : "rZ" ((u32)val), "r" (addr));
+ asm volatile("str %w0, [%1]" : : "rZ" ((u32)(val>>32)), "r" (addr + 4));
}
#define __raw_readb __raw_readb
Sadly this code lacks locking of the writeq, so it fails very hard on IO. Results are data corruption and finally kernel Oops. So i followed this approach to activate the code in the driver instead:
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c 2022-02-26 13:15:10.867598263 +0100
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c 2022-02-26 09:31:09.297463161 +0100
@@ -3798,7 +3798,7 @@
* care of 32 bit environment where its not quarenteed to send the entire word
* in one transfer.
*/
-#if defined(writeq) && defined(CONFIG_64BIT)
+#if defined(writeq) && defined(CONFIG_64BIT) && !defined(CONFIG_ARCH_BCM2835)
static inline void
_base_writeq(__u64 b, volatile void __iomem *addr, spinlock_t *writeq_lock)
{
Everything looks promising so far.
Driver loads, no immediate kernel panics, heartbeat LED is blinking. However, those timeouts without any devices attached don't make me hopeful. Let's try plugging in some devices next...