From owner-cvs-all Thu Jan 17 12:35: 7 2002 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 6A3EA37B405; Thu, 17 Jan 2002 12:34:58 -0800 (PST) Received: (from joerg@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g0HKYwg74639; Thu, 17 Jan 2002 12:34:58 -0800 (PST) (envelope-from joerg) Message-Id: <200201172034.g0HKYwg74639@freefall.freebsd.org> From: Joerg Wunsch Date: Thu, 17 Jan 2002 12:34:58 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/dev/aic aic.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG joerg 2002/01/17 12:34:58 PST Modified files: sys/dev/aic aic.c Log: Back out the hack from rev 1.13 that was done to initiate a bus rescan at insert time. When asking gibbs for approval for an MFC, this was his reply: 1) It leaks memory if it can't allocate a path. 2) It defers allocation of aic->path until the call to scan the bus. This means the path may be NULL when an interrupt occurs prior to the call to scan the bus (stray bus reset for instance), which will lead to a panic. 3) The driver in current doesn't recover from the failure to allocate aic->path. The driver doesn't check during normal operation if the path is NULL, so again a panic will result. 4) aic_cam_rescan calls malloc with M_WAITOK. aic_cam_rescan is called from attach where it isn't necessarily safe to sleep. 5) And most importantly, it co-opts the xpt_periph from the driver level. This was never part of the design (xpt_periph used to be static). Making a call of this type may completely confuse the XPT if other XPT operations are ongoing. In the long term, Justin and Warner agreed to implement solution where CAM itself will initiate the bus rescan if a new bus is added. For the time being (and in particular in light of the upcoming 4.5 release), we now have camcontrol available on the boot floppy, and can have pccardd initiate the rescan through it. Revision Changes Path 1.15 +9 -36 src/sys/dev/aic/aic.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message