Bug 251346 - atapci: "Device leaked I/O resources"
Summary: atapci: "Device leaked I/O resources"
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.2-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-24 16:34 UTC by janm
Modified: 2020-12-01 15:02 UTC (History)
1 user (show)

See Also:


Attachments
Release allocated resources after chip initialisation failure. (826 bytes, text/plain)
2020-11-24 16:34 UTC, janm
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description janm 2020-11-24 16:34:49 UTC
Created attachment 219929 [details]
Release allocated resources after chip initialisation failure.

Booting 12.2 RELEASE on a Supermicro X11SPA motherboard gives this sequence of events in demsg.

atapci0: <Intel ATA controller> port 0x3050-0x3057,0x3040-0x3043,0x3030-0x3037,0x3020-0x3023,0x3010-0x301f at device 22.2 numa-domain 0 on pci0
atapci0: unable to map interrupt
device_attach: atapci0 attach returned 6
pci0:0:22:2: Device leaked I/O resources

Looking at the code, resources are allocated using bus_alloc_resource_any(), but not released in the interrupt mapping failure case. Patch attached.
Comment 1 commit-hook freebsd_committer 2020-11-24 17:13:22 UTC
A commit references this bug:

Author: markj
Date: Tue Nov 24 17:13:09 UTC 2020
New revision: 367989
URL: https://svnweb.freebsd.org/changeset/base/367989

Log:
  ata(4): Release the ioport resource if device initialization fails

  PR:		251346
  Submitted by:	janm@transactionware.com
  MFC after:	1 week

Changes:
  head/sys/dev/ata/ata-pci.c
Comment 2 commit-hook freebsd_committer 2020-12-01 15:02:02 UTC
A commit references this bug:

Author: markj
Date: Tue Dec  1 15:01:11 UTC 2020
New revision: 368230
URL: https://svnweb.freebsd.org/changeset/base/368230

Log:
  MFC r367989:
  ata(4): Release the ioport resource if device initialization fails

  PR:	251346

Changes:
_U  stable/12/
  stable/12/sys/dev/ata/ata-pci.c
Comment 3 Mark Johnston freebsd_committer 2020-12-01 15:02:46 UTC
Thanks for the patch.