Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with connected HFS+ USB Drive #2564

Closed
Eyeless77 opened this issue May 23, 2018 · 3 comments
Closed

Issue with connected HFS+ USB Drive #2564

Eyeless77 opened this issue May 23, 2018 · 3 comments
Labels
Close within 30 days Issue will be closed within 30 days unless requested to stay open Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator.

Comments

@Eyeless77
Copy link

I've got a RPi running some docker containers and I've got an issue with one of them which serves Time Machine backups. There is an external Seagate HDD with external power supply which is formatted to HFS+ and connected via USB to the raspberry and then mounted to container. When I start a Time Machine backup from my mac there are lots of errors in console. I tried different images from odarriba and mbentley with different versions of netatalk (tested with 3.1.10 and 3.1.11). Also I tried to downgrade to 4.9 kernel, but errors are the same. After I get this error I cannot gracefully reboot raspberry, it freezes on reboot, I have to plug the power off manually or use sysrq magic commands. After that I plug HDD to my mac and fix the drive with fsck manually, because this issue damages the backup partition. Then I make sure that fsck.hfsplus on raspberry returns no errors and try to make one more backup but get the same error and that's annoying. Could anyone tell what is the problem?

pi@pi-home:~ $ uname -a Linux pi-home 4.14.42-v7+ #1114 SMP Mon May 21 16:39:21 BST 2018 armv7l GNU/Linux

pi@pi-home:~ $ /opt/vc/bin/vcgencmd version May 18 2018 18:05:14 Copyright (c) 2012 Broadcom version c75d403819718d12049aa2edd2009356a6cb592f (clean) (release)

May 23 22:29:32 pi-home kernel: [  633.005077] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.005293] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.005494] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.005693] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.005891] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.006172] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.006370] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.006564] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.006758] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.006949] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.007148] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.007522] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.007713] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.007900] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.008087] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.008404] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.008591] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.008790] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.008973] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.009166] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.009345] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.009520] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.009694] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.009867] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.010038] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.010211] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.010381] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.010551] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.010719] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.010885] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.011051] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.011218] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.011382] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.011545] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.011706] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.011865] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.012022] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.012181] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.012339] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.012495] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.012649] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.012801] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.012954] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.013104] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.013253] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.013403] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.013559] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.013718] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.013865] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.014007] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.014149] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.014290] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.014430] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.014570] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.014708] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.014843] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.014977] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.015115] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.015249] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.015381] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.015510] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.015641] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.015767] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.015891] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.016089] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.016216] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.016336] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.016454] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.016570] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.016687] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.016804] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.016919] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.017035] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.017147] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.017258] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.017368] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.017475] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.017581] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.017685] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.017791] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.017895] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.017996] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.018097] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.018196] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.018295] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.018391] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.018487] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.018582] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.018674] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.018765] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.018854] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.018941] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.019029] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.019116] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.019203] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.019340] hfsplus: trying to free free bnode 0(1)
May 23 22:29:32 pi-home kernel: [  633.019379] Unable to handle kernel paging request at virtual address 49c00000
May 23 22:29:32 pi-home kernel: [  633.019392] pgd = b9388000
May 23 22:29:32 pi-home kernel: [  633.019402] [49c00000] *pgd=00000000
May 23 22:29:32 pi-home kernel: [  633.019422] Internal error: Oops: 805 [#1] SMP ARM
May 23 22:29:32 pi-home kernel: [  633.019433] Modules linked in: veth xt_nat xt_tcpudp ipt_MASQUERADE nf_nat_masquerade_ipv4 nf_conntrack_netlink nfnetlink iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 xt_addrtype iptable_filter xt_conntrack nf_nat nf_conntrack br_netfilter bridge stp llc fuse overlay rfcomm cmac bnep hci_uart btbcm serdev bluetooth ecdh_generic nls_utf8 hfsplus joydev evdev sg brcmfmac brcmutil cfg80211 rfkill snd_bcm2835(C) snd_pcm snd_timer snd fixed uio_pdrv_genirq uio i2c_dev ip_tables x_tables ipv6
May 23 22:29:32 pi-home kernel: [  633.019669] CPU: 1 PID: 4286 Comm: afpd Tainted: G         C      4.14.42-v7+ #1114
May 23 22:29:32 pi-home kernel: [  633.019679] Hardware name: BCM2835
May 23 22:29:32 pi-home kernel: [  633.019689] task: b9194b00 task.stack: a2c7c000
May 23 22:29:32 pi-home kernel: [  633.019711] PC is at memcpy+0xd0/0x330
May 23 22:29:32 pi-home kernel: [  633.019762] LR is at hfsplus_bnode_write+0xac/0x128 [hfsplus]
May 23 22:29:32 pi-home kernel: [  633.019774] pc : [<807834f0>]    lr : [<7f3c8788>]    psr: 600f0013
May 23 22:29:32 pi-home kernel: [  633.019789] sp : a2c7dd54  ip : 000000c8  fp : a2c7dd94
May 23 22:29:32 pi-home kernel: [  633.019800] r10: 8bc65cc8  r9 : 00000002  r8 : 80d1008c
May 23 22:29:32 pi-home kernel: [  633.019811] r7 : 80c069c4  r6 : a2c7dd9e  r5 : 8bc65cfc  r4 : 000000ff
May 23 22:29:32 pi-home kernel: [  633.019823] r3 : 00000000  r2 : 00000000  r1 : a2c7dda0  r0 : 49c00000
May 23 22:29:32 pi-home kernel: [  633.019836] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
May 23 22:29:32 pi-home kernel: [  633.019848] Control: 10c5383d  Table: 3938806a  DAC: 00000055
May 23 22:29:32 pi-home kernel: [  633.019859] Process afpd (pid: 4286, stack limit = 0xa2c7c210)
May 23 22:29:32 pi-home kernel: [  633.019871] Stack: (0xa2c7dd54 to 0xa2c7e000)
May 23 22:29:32 pi-home kernel: [  633.019884] dd40:                                              49c00000 00000002 7f3c8788
May 23 22:29:32 pi-home kernel: [  633.019901] dd60: 00000000 00000000 a2c7ddac 8bc65cc0 a2c7de0c 0000000e 00001fdc 00001ffc
May 23 22:29:32 pi-home kernel: [  633.019917] dd80: 00000046 00000046 a2c7ddac a2c7dd98 7f3c8838 7f3c86e8 b6d6d000 c8ff0011
May 23 22:29:32 pi-home kernel: [  633.019934] dda0: a2c7dddc a2c7ddb0 7f3cadf0 7f3c8810 00000010 a2c7de0c b6f0cd68 00002408
May 23 22:29:32 pi-home kernel: [  633.019952] ddc0: 00002408 00000002 a2c7de50 00000008 a2c7de04 a2c7dde0 7f3cd448 7f3cacd4
May 23 22:29:32 pi-home kernel: [  633.019968] dde0: 08240000 10000000 7f3cd688 00000000 b6f0cd68 00002408 a2c7de4c a2c7de08
May 23 22:29:32 pi-home kernel: [  633.019985] de00: 7f3cd9d8 7f3cd3b0 a2c7de50 a6cfd400 a6cfd50c b6d6d000 8bc65cc0 ffffffff
May 23 22:29:32 pi-home kernel: [  633.020001] de20: 0000000e 00000042 00000050 00000004 00000000 00000000 b6f0cd68 b6d65800
May 23 22:29:32 pi-home kernel: [  633.020019] de40: a2c7def4 a2c7de50 7f3c657c 7f3cd998 5b05c11c 00000000 00000000 814d8000
May 23 22:29:32 pi-home kernel: [  633.020035] de60: 814d8206 b6d6a000 8bdb4d00 00000034 00000556 00000008 0000055e 0000001a
May 23 22:29:32 pi-home kernel: [  633.020051] de80: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
May 23 22:29:32 pi-home kernel: [  633.020067] dea0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
May 23 22:29:32 pi-home kernel: [  633.020089] dec0: 00000000 00000000 00000000 00000000 b97abce8 00000000 b97abd58 b6d65800
May 23 22:29:32 pi-home kernel: [  633.020107] dee0: 00000000 b97abce8 a2c7df14 a2c7def8 7f3c4288 7f3c6394 8bd9a840 b97abce8
May 23 22:29:32 pi-home kernel: [  633.020124] df00: a2fac810 940514c8 a2c7df54 a2c7df18 8028bc40 7f3c41f4 00000000 00000000
May 23 22:29:32 pi-home kernel: [  633.020140] df20: 8028bde4 8bd9a848 b9195028 00000000 b9195028 b9194b00 b9195044 80c97e04
May 23 22:29:32 pi-home kernel: [  633.020157] df40: 8bd9a840 00000080 a2c7df64 a2c7df58 8028bdfc 8028bbb0 a2c7df8c a2c7df68
May 23 22:29:32 pi-home kernel: [  633.020174] df60: 8013bbfc 8028bdf0 a2c7c000 a2c7c010 80108204 a2c7dfb0 80108204 a2c7c000
May 23 22:29:32 pi-home kernel: [  633.020191] df80: a2c7dfac a2c7df90 8010b810 8013bb4c 7eed24b0 00000001 00000000 00000006
May 23 22:29:32 pi-home kernel: [  633.020210] dfa0: 00000000 a2c7dfb0 80108094 8010b750 00000000 00000001 00000000 0000000b
May 23 22:29:32 pi-home kernel: [  633.020226] dfc0: 7eed24b0 00000001 00000000 00000006 00000001 00000000 00000001 7eed24b0
May 23 22:29:32 pi-home kernel: [  633.020242] dfe0: 00000000 7eed2434 76eb7ff8 768ecbdc 40000010 0000000b 00000000 00000000
May 23 22:29:32 pi-home kernel: [  633.020317] [<807834f0>] (memcpy) from [<7f3c8788>] (hfsplus_bnode_write+0xac/0x128 [hfsplus])
May 23 22:29:32 pi-home kernel: [  633.020429] [<7f3c8788>] (hfsplus_bnode_write [hfsplus]) from [<7f3c8838>] (hfsplus_bnode_write_u16+0x34/0x3c [hfsplus])
May 23 22:29:32 pi-home kernel: [  633.020515] [<7f3c8838>] (hfsplus_bnode_write_u16 [hfsplus]) from [<7f3cadf0>] (hfsplus_brec_remove+0x128/0x178 [hfsplus])
May 23 22:29:32 pi-home kernel: [  633.020599] [<7f3cadf0>] (hfsplus_brec_remove [hfsplus]) from [<7f3cd448>] (__hfsplus_delete_attr+0xa4/0xec [hfsplus])
May 23 22:29:32 pi-home kernel: [  633.020684] [<7f3cd448>] (__hfsplus_delete_attr [hfsplus]) from [<7f3cd9d8>] (hfsplus_delete_all_attrs+0x4c/0xbc [hfsplus])
May 23 22:29:32 pi-home kernel: [  633.020769] [<7f3cd9d8>] (hfsplus_delete_all_attrs [hfsplus]) from [<7f3c657c>] (hfsplus_delete_cat+0x1f4/0x30c [hfsplus])
May 23 22:29:32 pi-home kernel: [  633.020857] [<7f3c657c>] (hfsplus_delete_cat [hfsplus]) from [<7f3c4288>] (hfsplus_file_release+0xa0/0xac [hfsplus])
May 23 22:29:32 pi-home kernel: [  633.020917] [<7f3c4288>] (hfsplus_file_release [hfsplus]) from [<8028bc40>] (__fput+0x9c/0x1e8)
May 23 22:29:32 pi-home kernel: [  633.020941] [<8028bc40>] (__fput) from [<8028bdfc>] (____fput+0x18/0x1c)
May 23 22:29:32 pi-home kernel: [  633.020963] [<8028bdfc>] (____fput) from [<8013bbfc>] (task_work_run+0xbc/0xe0)
May 23 22:29:32 pi-home kernel: [  633.020988] [<8013bbfc>] (task_work_run) from [<8010b810>] (do_work_pending+0xcc/0xd0)
May 23 22:29:32 pi-home kernel: [  633.021012] [<8010b810>] (do_work_pending) from [<80108094>] (slow_work_pending+0xc/0x20)
May 23 22:29:32 pi-home kernel: [  633.021029] Code: 14d13001 24d14001 24d1c001 14c03001 (24c04001)
May 23 22:29:32 pi-home kernel: [  633.021046] ---[ end trace 0a803365bebd3f0f ]---
@pelwell
Copy link
Contributor

pelwell commented May 23, 2018

Through the advanced technique known as "googling the error message" it seems the problem appeared as early as the 4.8 kernel (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1646565) and affects multiple/all platforms (https://lkml.org/lkml/2017/1/9/808, https://lime-technology.com/forums/topic/67183-help-unraid-frozen-after-a-rsync-that-segfaulted/).

There's no way we can spend the time (if we even have enough expertise) to debug a problem in a generic upstream module like hfsplus. I was hoping I could at least give you the email address of one of the developers responsible, but the Linux MAINTAINERS file has this to say:

HFSPLUS FILESYSTEM
L:	[email protected]
S:	Orphan
F:	Documentation/filesystems/hfsplus.txt
F:	fs/hfsplus/

which would explain the lack of progress.

@JamesH65
Copy link
Contributor

I'm inclined to close within 30 days unless further interactions are posted. If you wish this issue to remain open, please add a comment, but be aware there's no way we will be doing any work on this. A closed issue may be reopened if requested.

@JamesH65 JamesH65 added Close within 30 days Issue will be closed within 30 days unless requested to stay open Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator. labels Jun 25, 2018
@JamesH65
Copy link
Contributor

Closing due to lack of activity. Please request to be reopened if you feel this issue is still relevant.

ED6E0F17 pushed a commit to ED6E0F17/linux that referenced this issue Jan 1, 2020
commit 3194d25 upstream.

With lastest kernel, the following warning is observed at startup:

[    1.500609] ------------[ cut here ]------------
[    1.505225] remove_proc_entry: removing non-empty directory 'irq/22', leaking at least 'fsl_spi'
[    1.514234] WARNING: CPU: 0 PID: 1 at fs/proc/generic.c:682 remove_proc_entry+0x198/0x1c0
[    1.522403] CPU: 0 PID: 1 Comm: swapper Not tainted 5.4.0-s3k-dev-02248-g93532430a4ff raspberrypi#2564
[    1.530724] NIP:  c0197694 LR: c0197694 CTR: c0050d80
[    1.535762] REGS: df4a5af0 TRAP: 0700   Not tainted  (5.4.0-02248-g93532430a4ff)
[    1.543818] MSR:  00029032 <EE,ME,IR,DR,RI>  CR: 22028222  XER: 00000000
[    1.550524]
[    1.550524] GPR00: c0197694 df4a5ba8 df4a0000 00000054 00000000 00000000 00004a38 00000010
[    1.550524] GPR08: c07c5a30 00000800 00000000 00001032 22000208 00000000 c0004b14 00000000
[    1.550524] GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 c0830000 c07fc078
[    1.550524] GPR24: c08e8ca0 df665d10 df60ea98 c07c9db8 00000001 df5d5ae3 df5d5a80 df43f8e3
[    1.585327] NIP [c0197694] remove_proc_entry+0x198/0x1c0
[    1.590628] LR [c0197694] remove_proc_entry+0x198/0x1c0
[    1.595829] Call Trace:
[    1.598280] [df4a5ba8] [c0197694] remove_proc_entry+0x198/0x1c0 (unreliable)
[    1.605321] [df4a5bd8] [c0067acc] unregister_irq_proc+0x5c/0x70
[    1.611238] [df4a5bf8] [c005fbc4] free_desc+0x3c/0x80
[    1.616286] [df4a5c18] [c005fe2c] irq_free_descs+0x70/0xa8
[    1.621778] [df4a5c38] [c033d3fc] of_fsl_spi_probe+0xdc/0x3cc
[    1.627525] [df4a5c88] [c02f0f64] platform_drv_probe+0x44/0xa4
[    1.633350] [df4a5c98] [c02eee44] really_probe+0x1ac/0x418
[    1.638829] [df4a5cc8] [c02ed3e8] bus_for_each_drv+0x64/0xb0
[    1.644481] [df4a5cf8] [c02ef950] __device_attach+0xd4/0x128
[    1.650132] [df4a5d28] [c02ed61c] bus_probe_device+0xa0/0xbc
[    1.655783] [df4a5d48] [c02ebbe8] device_add+0x544/0x74c
[    1.661096] [df4a5d88] [c0382b78] of_platform_device_create_pdata+0xa4/0x100
[    1.668131] [df4a5da8] [c0382cf4] of_platform_bus_create+0x120/0x20c
[    1.674474] [df4a5df8] [c0382d50] of_platform_bus_create+0x17c/0x20c
[    1.680818] [df4a5e48] [c0382e88] of_platform_bus_probe+0x9c/0xf0
[    1.686907] [df4a5e68] [c0751404] __machine_initcall_cmpcpro_cmpcpro_declare_of_platform_devices+0x74/0x1a4
[    1.696629] [df4a5e98] [c072a4cc] do_one_initcall+0x8c/0x1d4
[    1.702282] [df4a5ef8] [c072a768] kernel_init_freeable+0x154/0x204
[    1.708455] [df4a5f28] [c0004b2c] kernel_init+0x18/0x110
[    1.713769] [df4a5f38] [c00122ac] ret_from_kernel_thread+0x14/0x1c
[    1.719926] Instruction dump:
[    1.722889] 2c030000 4182004c 3863ffb0 3c80c05f 80e3005c 388436a0 3c60c06d 7fa6eb78
[    1.730630] 7fe5fb78 38840280 38634178 4be8c611 <0fe00000> 4bffff6c 3c60c071 7fe4fb78
[    1.738556] ---[ end trace 05d0720bf2e352e2 ]---

The problem comes from the error path which calls
irq_dispose_mapping() while the IRQ has been requested with
devm_request_irq().

IRQ doesn't need to be mapped with irq_of_parse_and_map(). The only
need is to get the IRQ virtual number. For that, use
of_irq_to_resource() instead of the
irq_of_parse_and_map()/irq_dispose_mapping() pair.

Fixes: 500a32a ("spi: fsl: Call irq_dispose_mapping in err path")
Cc: [email protected]
Signed-off-by: Christophe Leroy <[email protected]>
Link: https://lore.kernel.org/r/518cfb83347d5372748e7fe72f94e2e9443d0d4a.1575905123.git.christophe.leroy@c-s.fr
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
popcornmix pushed a commit that referenced this issue Jan 6, 2020
[ Upstream commit 3194d25 ]

With lastest kernel, the following warning is observed at startup:

[    1.500609] ------------[ cut here ]------------
[    1.505225] remove_proc_entry: removing non-empty directory 'irq/22', leaking at least 'fsl_spi'
[    1.514234] WARNING: CPU: 0 PID: 1 at fs/proc/generic.c:682 remove_proc_entry+0x198/0x1c0
[    1.522403] CPU: 0 PID: 1 Comm: swapper Not tainted 5.4.0-s3k-dev-02248-g93532430a4ff #2564
[    1.530724] NIP:  c0197694 LR: c0197694 CTR: c0050d80
[    1.535762] REGS: df4a5af0 TRAP: 0700   Not tainted  (5.4.0-02248-g93532430a4ff)
[    1.543818] MSR:  00029032 <EE,ME,IR,DR,RI>  CR: 22028222  XER: 00000000
[    1.550524]
[    1.550524] GPR00: c0197694 df4a5ba8 df4a0000 00000054 00000000 00000000 00004a38 00000010
[    1.550524] GPR08: c07c5a30 00000800 00000000 00001032 22000208 00000000 c0004b14 00000000
[    1.550524] GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 c0830000 c07fc078
[    1.550524] GPR24: c08e8ca0 df665d10 df60ea98 c07c9db8 00000001 df5d5ae3 df5d5a80 df43f8e3
[    1.585327] NIP [c0197694] remove_proc_entry+0x198/0x1c0
[    1.590628] LR [c0197694] remove_proc_entry+0x198/0x1c0
[    1.595829] Call Trace:
[    1.598280] [df4a5ba8] [c0197694] remove_proc_entry+0x198/0x1c0 (unreliable)
[    1.605321] [df4a5bd8] [c0067acc] unregister_irq_proc+0x5c/0x70
[    1.611238] [df4a5bf8] [c005fbc4] free_desc+0x3c/0x80
[    1.616286] [df4a5c18] [c005fe2c] irq_free_descs+0x70/0xa8
[    1.621778] [df4a5c38] [c033d3fc] of_fsl_spi_probe+0xdc/0x3cc
[    1.627525] [df4a5c88] [c02f0f64] platform_drv_probe+0x44/0xa4
[    1.633350] [df4a5c98] [c02eee44] really_probe+0x1ac/0x418
[    1.638829] [df4a5cc8] [c02ed3e8] bus_for_each_drv+0x64/0xb0
[    1.644481] [df4a5cf8] [c02ef950] __device_attach+0xd4/0x128
[    1.650132] [df4a5d28] [c02ed61c] bus_probe_device+0xa0/0xbc
[    1.655783] [df4a5d48] [c02ebbe8] device_add+0x544/0x74c
[    1.661096] [df4a5d88] [c0382b78] of_platform_device_create_pdata+0xa4/0x100
[    1.668131] [df4a5da8] [c0382cf4] of_platform_bus_create+0x120/0x20c
[    1.674474] [df4a5df8] [c0382d50] of_platform_bus_create+0x17c/0x20c
[    1.680818] [df4a5e48] [c0382e88] of_platform_bus_probe+0x9c/0xf0
[    1.686907] [df4a5e68] [c0751404] __machine_initcall_cmpcpro_cmpcpro_declare_of_platform_devices+0x74/0x1a4
[    1.696629] [df4a5e98] [c072a4cc] do_one_initcall+0x8c/0x1d4
[    1.702282] [df4a5ef8] [c072a768] kernel_init_freeable+0x154/0x204
[    1.708455] [df4a5f28] [c0004b2c] kernel_init+0x18/0x110
[    1.713769] [df4a5f38] [c00122ac] ret_from_kernel_thread+0x14/0x1c
[    1.719926] Instruction dump:
[    1.722889] 2c030000 4182004c 3863ffb0 3c80c05f 80e3005c 388436a0 3c60c06d 7fa6eb78
[    1.730630] 7fe5fb78 38840280 38634178 4be8c611 <0fe00000> 4bffff6c 3c60c071 7fe4fb78
[    1.738556] ---[ end trace 05d0720bf2e352e2 ]---

The problem comes from the error path which calls
irq_dispose_mapping() while the IRQ has been requested with
devm_request_irq().

IRQ doesn't need to be mapped with irq_of_parse_and_map(). The only
need is to get the IRQ virtual number. For that, use
of_irq_to_resource() instead of the
irq_of_parse_and_map()/irq_dispose_mapping() pair.

Fixes: 500a32a ("spi: fsl: Call irq_dispose_mapping in err path")
Cc: [email protected]
Signed-off-by: Christophe Leroy <[email protected]>
Link: https://lore.kernel.org/r/518cfb83347d5372748e7fe72f94e2e9443d0d4a.1575905123.git.christophe.leroy@c-s.fr
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
sigmaris pushed a commit to sigmaris/linux that referenced this issue Feb 9, 2020
With lastest kernel, the following warning is observed at startup:

[    1.500609] ------------[ cut here ]------------
[    1.505225] remove_proc_entry: removing non-empty directory 'irq/22', leaking at least 'fsl_spi'
[    1.514234] WARNING: CPU: 0 PID: 1 at fs/proc/generic.c:682 remove_proc_entry+0x198/0x1c0
[    1.522403] CPU: 0 PID: 1 Comm: swapper Not tainted 5.4.0-s3k-dev-02248-g93532430a4ff raspberrypi#2564
[    1.530724] NIP:  c0197694 LR: c0197694 CTR: c0050d80
[    1.535762] REGS: df4a5af0 TRAP: 0700   Not tainted  (5.4.0-02248-g93532430a4ff)
[    1.543818] MSR:  00029032 <EE,ME,IR,DR,RI>  CR: 22028222  XER: 00000000
[    1.550524]
[    1.550524] GPR00: c0197694 df4a5ba8 df4a0000 00000054 00000000 00000000 00004a38 00000010
[    1.550524] GPR08: c07c5a30 00000800 00000000 00001032 22000208 00000000 c0004b14 00000000
[    1.550524] GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 c0830000 c07fc078
[    1.550524] GPR24: c08e8ca0 df665d10 df60ea98 c07c9db8 00000001 df5d5ae3 df5d5a80 df43f8e3
[    1.585327] NIP [c0197694] remove_proc_entry+0x198/0x1c0
[    1.590628] LR [c0197694] remove_proc_entry+0x198/0x1c0
[    1.595829] Call Trace:
[    1.598280] [df4a5ba8] [c0197694] remove_proc_entry+0x198/0x1c0 (unreliable)
[    1.605321] [df4a5bd8] [c0067acc] unregister_irq_proc+0x5c/0x70
[    1.611238] [df4a5bf8] [c005fbc4] free_desc+0x3c/0x80
[    1.616286] [df4a5c18] [c005fe2c] irq_free_descs+0x70/0xa8
[    1.621778] [df4a5c38] [c033d3fc] of_fsl_spi_probe+0xdc/0x3cc
[    1.627525] [df4a5c88] [c02f0f64] platform_drv_probe+0x44/0xa4
[    1.633350] [df4a5c98] [c02eee44] really_probe+0x1ac/0x418
[    1.638829] [df4a5cc8] [c02ed3e8] bus_for_each_drv+0x64/0xb0
[    1.644481] [df4a5cf8] [c02ef950] __device_attach+0xd4/0x128
[    1.650132] [df4a5d28] [c02ed61c] bus_probe_device+0xa0/0xbc
[    1.655783] [df4a5d48] [c02ebbe8] device_add+0x544/0x74c
[    1.661096] [df4a5d88] [c0382b78] of_platform_device_create_pdata+0xa4/0x100
[    1.668131] [df4a5da8] [c0382cf4] of_platform_bus_create+0x120/0x20c
[    1.674474] [df4a5df8] [c0382d50] of_platform_bus_create+0x17c/0x20c
[    1.680818] [df4a5e48] [c0382e88] of_platform_bus_probe+0x9c/0xf0
[    1.686907] [df4a5e68] [c0751404] __machine_initcall_cmpcpro_cmpcpro_declare_of_platform_devices+0x74/0x1a4
[    1.696629] [df4a5e98] [c072a4cc] do_one_initcall+0x8c/0x1d4
[    1.702282] [df4a5ef8] [c072a768] kernel_init_freeable+0x154/0x204
[    1.708455] [df4a5f28] [c0004b2c] kernel_init+0x18/0x110
[    1.713769] [df4a5f38] [c00122ac] ret_from_kernel_thread+0x14/0x1c
[    1.719926] Instruction dump:
[    1.722889] 2c030000 4182004c 3863ffb0 3c80c05f 80e3005c 388436a0 3c60c06d 7fa6eb78
[    1.730630] 7fe5fb78 38840280 38634178 4be8c611 <0fe00000> 4bffff6c 3c60c071 7fe4fb78
[    1.738556] ---[ end trace 05d0720bf2e352e2 ]---

The problem comes from the error path which calls
irq_dispose_mapping() while the IRQ has been requested with
devm_request_irq().

IRQ doesn't need to be mapped with irq_of_parse_and_map(). The only
need is to get the IRQ virtual number. For that, use
of_irq_to_resource() instead of the
irq_of_parse_and_map()/irq_dispose_mapping() pair.

Fixes: 500a32a ("spi: fsl: Call irq_dispose_mapping in err path")
Cc: [email protected]
Signed-off-by: Christophe Leroy <[email protected]>
Link: https://lore.kernel.org/r/518cfb83347d5372748e7fe72f94e2e9443d0d4a.1575905123.git.christophe.leroy@c-s.fr
Signed-off-by: Mark Brown <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Close within 30 days Issue will be closed within 30 days unless requested to stay open Waiting for external input Waiting for a comment from the originator of the issue, or a collaborator.
Projects
None yet
Development

No branches or pull requests

3 participants