From mboxrd@z Thu Jan 1 00:00:00 1970 From: Prarit Bhargava Date: Thu, 10 Mar 2005 18:50:24 +0000 Subject: Re: Latest bk kernel does not properly free PCI IO & MEM allocations Message-Id: <423096F0.4060901@sgi.com> List-Id: References: <422F42A9.7050009@sgi.com> In-Reply-To: <422F42A9.7050009@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org > Greg KH wrote: Also, if you enable slab debugging, does this always=20 > occur? > =20 > Sorry Greg -- still waiting on linux-pci subscription ... :( Anyway just to continue the discussion -- here's a run with SLAB debug=20 on. The oops is now 100% reproducible.=20 [root@altix3 ~]# lspci 01:01.0 Co-processor: Silicon Graphics, Inc. IOC4 I/O controller (rev 53) 01:03.0 SCSI storage controller: QLogic Corp. ISP12160 Dual Channel=20 Ultra3 SCSI Processor (rev 06) 01:04.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5701=20 Gigabit Ethernet (rev 15) 02:01.0 Fibre Channel: QLogic Corp. QLA2312 Fibre Channel Adapter (rev 02) 02:01.1 Fibre Channel: QLogic Corp. QLA2312 Fibre Channel Adapter (rev 02) 03:01.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X=20 Fusion-MPT Dual Ultra320 SCSI (rev 07) 03:01.1 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X=20 Fusion-MPT Dual Ultra320 SCSI (rev 07) 05:01.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X=20 Fusion-MPT Dual Ultra320 SCSI (rev 07) 05:01.1 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X=20 Fusion-MPT Dual Ultra320 SCSI (rev 07) [root@altix3 ~]# cat /proc/iomem c00000880c200000-c00000880c2fffff : 0000:01:01.0 c00000880f400000-c00000880f41ffff : 0000:03:01.0 c00000880d400000-c00000880d41ffff : 0000:05:01.0 c00001880cc00000-c00001880cc00fff : 0000:02:01.0 c00001880cc01000-c00001880cc01fff : 0000:02:01.1 [root@altix3 ~]# cat /proc/ioports 00000060-0000006f : i8042 130027ad160-130027ad163 : PM1a_EVT_BLK 130027ad170-130027ad171 : PM1a_CNT_BLK 130027ad180-130027ad183 : PM_TMR 130027ad190-130027ad197 : GPE0_BLK c00000880c200100-c00000880c20011f : ide0 c00000880c200140-c00000880c200163 : ide0 c00000880c600000-c00000880c6000ff : 0000:01:03.0 c00001880ca00000-c00001880ca000ff : 0000:02:01.0 c00000880f200000-c00000880f2000ff : 0000:03:01.0 c00000880d200000-c00000880d2000ff : 0000:05:01.0 [root@altix3 ~]# !modprobe modprobe sgi_hotplug [root@altix3 ~]# cd /sys/bus/pci/slots/ [root@altix3 slots]# ls m_001=01_b_1_s_2 m_001=01_b_3_s_1 m_001=01_b_4_s_2 m_001=01_b_6_s_1 m_001=01_b_2_s_1 m_001=01_b_3_s_2 m_001=01_b_5_s_1 m_001=01_b_6_s_2 m_001=01_b_2_s_2 m_001=01_b_4_s_1 m_001=01_b_5_s_2 [root@altix3 slots]# cd m_001=01_b_5_s_1 [root@altix3 m_001=01_b_5_s_1]# echo 0 > power Begin PCI Hot-Plug Message for -> m_001=01_b_5_s_1 Remove operation successful End PCI Hot-Plug Message for -> m_001=01_b_5_s_1 [root@altix3 m_001=01_b_5_s_1]# lspci 01:01.0 Co-processor: Silicon Graphics, Inc. IOC4 I/O controller (rev 53) 01:03.0 SCSI storage controller: QLogic Corp. ISP12160 Dual Channel=20 Ultra3 SCSI Processor (rev 06) 01:04.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5701=20 Gigabit Ethernet (rev 15) 02:01.0 Fibre Channel: QLogic Corp. QLA2312 Fibre Channel Adapter (rev 02) 02:01.1 Fibre Channel: QLogic Corp. QLA2312 Fibre Channel Adapter (rev 02) 03:01.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X=20 Fusion-MPT Dual Ultra320 SCSI (rev 07) 03:01.1 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X=20 Fusion-MPT Dual Ultra320 SCSI (rev 07) [root@altix3 m_001=01_b_5_s_1]# cat /proc/iomem Segmentation fault Unable to handle kernel paging request at virtual address 6b6b6b6b6b6b6b8b cat[2871]: Oops 11012296146944 [1] Modules linked in: sgi_hotplug(U) md5(U) ipv6(U) parport_pc(U) lp(U)=20 parport(U) autofs4(U) sunrpc(U) ds(U) yenta_socket(U) pcmcia_core(U)=20 ipt_REJECT(U) ipt_state(U) ip_conntrack(U) iptable_filter(U)=20 ip_tables(U) vfat(U) fat(U) button(U) sgiioc4(U) tg3(U) dm_snapshot(U)=20 dm_zero(U) dm_mirror(U) ext3(U) jbd(U) dm_mod(U) qla2300(U) qla2xxx(U)=20 scsi_transport_fc(U) qla1280(U) mptscsih(U) mptbase(U) sd_mod(U) scsi_mod(U) Pid: 2871, CPU 3, comm: cat psr : 0000121008126010 ifs : 800000000000028d ip :=20 [] Not tainted ip is at r_show+0x51/0x120 unat: 0000000000000000 pfs : 0000000000000894 rsc : 0000000000000003 rnat: 0000101008126010 bsps: a00000010022fe80 pr : 000000000955a959 ldrs: 0000000000000000 ccv : 0000000000000000 fpsr: 0009804c8a70033f csd : 0000000000000000 ssd : 0000000000000000 b0 : a00000010015ee70 b6 : a00000010007db80 b7 : a00000010007dda0 f6 : 0fffafffffffff0000000 f7 : 0ffdec000000000000000 f8 : 10002c000000000000000 f9 : 100038000000000000000 f10 : 0fffebffffffff4000000 f11 : 1003e0000000000000000 r1 : a00000010096a980 r2 : a000000100702a18 r3 : e00001b07be04748 r8 : 6b6b6b6b6b6b6b6b r9 : 6b6b6b6b6b6b6b8b r10 : a000000100634858 r11 : a00000010007dda0 r12 : e00000b0759afe00 r13 : e00000b0759a8000 r14 : 000000000000ffff r15 : ffffffffffffffff r16 : a000000100702a08 r17 : 6b6b6b6b6b6b6b6b r18 : 0000000000000062 r19 : e00000b0759afe20 r20 : a0000001005cfa00 r21 : 0000000000000270 r22 : a0000001005cf790 r23 : a000000100778a18 r24 : a0000001007124d3 r25 : 0000000000000073 r26 : e00000b0759afe10 r27 : ffffffffffffffff r28 : e00000b0759afdd0 r29 : 000000000000000b r30 : 000000000000000c r31 : fffffffffffffffe Call Trace: [] show_stack+0x80/0xa0 sp=E00000b0759af9b0 bsp=E00000b0759a9110 [] show_regs+0x890/0x8c0 sp=E00000b0759afb80 bsp=E00000b0759a90c8 [] die+0x150/0x240 sp=E00000b0759afba0 bsp=E00000b0759a9088 [] ia64_do_page_fault+0x9f0/0xba0 sp=E00000b0759afba0 bsp=E00000b0759a9020 [] ia64_leave_kernel+0x0/0x260 sp=E00000b0759afc30 bsp=E00000b0759a9020 [] r_show+0x50/0x120 sp=E00000b0759afe00 bsp=E00000b0759a8fb0 [] seq_read+0x730/0x940 sp=E00000b0759afe10 bsp=E00000b0759a8f28 [] vfs_read+0x290/0x360 sp=E00000b0759afe20 bsp=E00000b0759a8ed8 [] sys_read+0x70/0xe0 sp=E00000b0759afe20 bsp=E00000b0759a8e60 [root@altix3 m_001=01_b_5_s_1]# I'm close to what I think an appropriate solution is. I could just remove the erroneous call to pci_free_resources, however, I believe that this may cause some drivers (that are dependent on the pci_free_resources call) to=20 break.=20 Since pci_free_resources is a legacy (deprecated?) call that we should modi= fy the code such that release_resources sets the appropriate pci_dev->res poin= ters to null, and pci_free_resources only attempts to free a resource if the=20 pointer is not NULL. At that time we would output a warning message about the deprecation of the call ... IMO, pci_free_resources should never be called. =20 Of course, you could argue that the drivers are broken if they depend on=20 pci_free_resources anyway ;) P. > ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id=14396&op=3Dclick _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel