Bug 128037 - [pccbb] [patch] System hang on shutdown with PCMCIA-CF adapter inserted
Summary: [pccbb] [patch] System hang on shutdown with PCMCIA-CF adapter inserted
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-13 02:40 UTC by Arthur Hartwig
Modified: 2018-01-03 05:16 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arthur Hartwig 2008-10-13 02:40:01 UTC
System has a TI PCI1520 Cardbus PCI bridge. If a PCMCIA to Compact Flash
adapter is inserted in the Cardbus slot and the system is shutdown then
the shutdown does not complete.

This has been not been observed on multi-CPU systems. It has been observed
on single CPU systems with a 1.5GHz Celeron CPU but not on a single CPU
system with a XEON 2.80GHz CPU. (This CPU has hyperthreading capability
but it is run with hyperthreading disabled and a single CPU kernel.)

Breaking into ddb from the console shows one thread in cbb_power() called
from cbb_shutdown() and another thread in cbb_intr(). From setting
breakpoints it appears the exca_clrb(&sc->exca[0], EXCA_INTR,
EXCA_INTR_RESET); call in cbb_shutdown() causes a delayed interrupt request
which, on slower CPUs, interrupts cbb_power() early in its execution and
certainly before power to the socket is turned off. The interrupt
apparently is not cleared by the interrupt handlers and repeats
indefinitely, preventing cbb_power() making progress to the points of
turning off power to the card. (On a multi-CPU system cbb_shutdown and
cbb_intr() can run in parallel concurrently so the continuous interrupts
don't stop cbb_power() making progress to the point of turning off power
to the socket.)

Fix: 

In cbb_shutdown() in sys/dev/pccbb/pccbb.c add disable_intr() before the exca_clrb() and enable_intr() after cbb_power() so the code reads:

	disable_intr();
	exca_clrb(&sc->exca[0], EXCA_INTR, EXCA_INTR_RESET);

	cbb_set(sc, CBB_SOCKET_MASK, 0);
	cbb_set(sc, CBB_SOCKET_EVENT, 0xffffffff);

	cbb_power(brdev, CARD_OFF); 
	enable_intr();
How-To-Repeat: Shutdown a "slower" single CPU system with a PCMCIA-Compact Flash adapter
in the slot of a TI PCI1520 Cardbus PCI bridge. (It is unknown if this
problem occurs with other Cardbus PCI bridges.)
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:42 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped