B3: problem with 4.11 (and 4.12-rc3 mainline) kernels / sata_mv

Discuss development on Bubba
Post Reply
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

B3: problem with 4.11 (and 4.12-rc3 mainline) kernels / sata_mv

Post by sakaki » 02 Jun 2017, 10:07

Hi,

there appears to be a problem with the >= 4.11 linux kernel on the B3, which is preventing the sata kernel drivers starting up properly. From dmesg:

Code: Select all

[    0.828904] sata_mv f1080000.sata: version 1.28
[    0.828922] sata_mv f1080000.sata: can't request region for resource
[mem 0xf1080000-0xf1084fff]
[    0.837773] sata_mv: probe of f1080000.sata failed with error -16
If you are running arch on your B3, this may already have affected you (as the linux-kirkwood-dt package has recently migrated to 4.11). The net result is that the HDD is not recognized, which may then cause a boot failure (e.g. systemd failing to complete mounting all /etc/fstab partitions).

If you are running arch on your B3, and this has not yet affected you, I recommend pinning your current kernel in place now, so it is not affected by any subsequent pacman -Syu. Issue:

Code: Select all

[root@archb3 ~]# nano -w /etc/pacman.conf
and uncomment the IgnorePkg line, then modifying it so it reads:

Code: Select all

IgnorePkg = linux-kirkwood-dt linux-api-headers
save, and exit nano. Done.

I'm going to do a kernel bisect on this to find the offending commit, but I won't have time for that for a week or so.

Best, sakaki

sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: B3: problem with 4.11 (and 4.12-rc3 mainline) kernels / sata_mv

Post by sakaki » 04 Jun 2017, 12:56

Hi,

this was annoying me so I did the kernel bisect today. The offending commit appears to be 368e5fbdfc60. I think this commit will break all kernels on the B3 (Arch, Gentoo, whatever) >= 4.11 (by break I mean that the sata driver won't start, so no HDD).

I'm going to contact the commit owner now prior to filing a bug report, to see if he has any suggestions. In the meantime, if you are trying to build a kernel >=4.11 for the B3, here's a small revert patch for the commit (mainline and the failing 4.11.3 Arch kernel boot OK with this patch applied):
revert_sata_mv_ioremap.patch

Just save this to a file in the kernel source directory, for example revert_ioremap.patch, then do

Code: Select all

linux # patch -p1 < revert_iomap.patch
Then build as normal. (Of course if you have a full git tree, you can just revert the commit directly, rather than working from a patch, but this is handy if working from a version tarball).

hth, sakaki
Edited to put a link to the patch file, rather than the code block which affects the whitespace.
Last edited by sakaki on 05 Jun 2017, 08:59, edited 1 time in total.

Gordon
Posts: 1367
Joined: 10 Aug 2011, 03:18

Re: B3: problem with 4.11 (and 4.12-rc3 mainline) kernels / sata_mv

Post by Gordon » 05 Jun 2017, 03:33

Good job!

Wonder if this is restricted to the B3. Hardly seems possible that other systems would not be affected by this issue as well.

sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: B3: problem with 4.11 (and 4.12-rc3 mainline) kernels / sata_mv

Post by sakaki » 05 Jun 2017, 06:27

Update: Andy Shevchenko has replied and kindly pointed me to a fix in the upstream, which reverts his 368e5fbdfc60 (essentially, what I posted above). Commit message reads:

Code: Select all

Revert "ata: sata_mv: Convert to devm_ioremap_resource()"

This reverts commit 368e5fbdfc60732643f34f538823ed4bc8829827.

devm_ioremap_resource() enforces that there are no overlapping
resources, where as devm_ioremap() does not. The sata phy driver needs
a subset of the sata IO address space, so maps some of the sata
address space. As a result, sata_mv now fails to probe, reporting it
cannot get its resources, and so we don't have any SATA disks.
I'll post on the Arch forums to see if they will put the revert patch in now for their 4.11.3; as you say Gordon, I guess this will have affected a few other platforms. But the issue should be fixed shortly in the mainline kernel.

Best, sakaki

sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: B3: problem with 4.11 (and 4.12-rc3 mainline) kernels / sata_mv

Post by sakaki » 05 Jun 2017, 09:06

Turns out Arch's linux-kirkwood-dt has had this fix applied already, two days ago, in 4.11.3-2.

So archlinux-on-b3 users should be OK to unpin the kernel now, and retry pacman -Syu.

Apologies for any inconvenience caused!

Best, sakaki

Post Reply