From owner-freebsd-hackers@FreeBSD.ORG Sun Aug 15 05:33:39 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6416106566B for ; Sun, 15 Aug 2010 05:33:39 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 48CE98FC12 for ; Sun, 15 Aug 2010 05:33:39 +0000 (UTC) Received: by bwz20 with SMTP id 20so1131678bwz.13 for ; Sat, 14 Aug 2010 22:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=+jnpkzf1sLmix92BWzNe322DS6FrwXVDSpUmsRbb4L8=; b=pV0oSaWD+xCGP8O+4PktluPqVfj2S9Cb868Yfg6PU75RVdWmGjEJumrkSoE87TSP7I yxUNnmU+TYPCcjbyy5vqCkznBEmNQGd7bKp4Esg7MZsoKAoXGf4p0vz7jh4JOCEcOfQj JUkFNwlq2BgSFl+2uDzma++xZr/jLgvIE5QaM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=BcDLpr/yZXSDajicykriB02BZJfhazafqeokKVqJ+4hJmZs316/lBw+rSLlatfAN8k IxfGysqlf0JQy2dUyyUvbvzUOIiyg3TmCix27WNER8lB+R8j0PcX8BDf6C7ug5gEroPT kgGdIXtul2bAL0+4q7rrmPNCSOlk/tuUA4vJI= MIME-Version: 1.0 Received: by 10.204.45.213 with SMTP id g21mr2258286bkf.11.1281850418203; Sat, 14 Aug 2010 22:33:38 -0700 (PDT) Received: by 10.204.82.6 with HTTP; Sat, 14 Aug 2010 22:33:38 -0700 (PDT) Date: Sat, 14 Aug 2010 22:33:38 -0700 Message-ID: From: Garrett Cooper To: hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Mailman-Approved-At: Sun, 15 Aug 2010 11:02:19 +0000 Cc: Subject: Why doesn't ppc(4) check non-ENXIO failures during probe? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Aug 2010 05:33:39 -0000 One thing that's puzzling me about the ppc(4) driver's ISA routines is that it only checks to see whether or not the device has an IO error: (from sys/dev/ppc/ppc_isa.c) @@ -121,8 +121,8 @@ parent = device_get_parent(dev); error = ISA_PNP_PROBE(parent, dev, lpc_ids); if (error == ENXIO) return (ENXIO); if (error != 0) /* XXX shall be set after detection */ device_set_desc(dev, "Parallel port"); But what about the case where ENOENT is returned :)? (from sys/isa/isa_common.c) static int isa_pnp_probe(device_t dev, device_t child, struct isa_pnp_id *ids) { struct isa_device* idev = DEVTOISA(child); if (!idev->id_vendorid) return (ENOENT); while (ids && ids->ip_id) { /* * Really ought to support >1 compat id per device. */ if (idev->id_logicalid == ids->ip_id || idev->id_compatid == ids->ip_id) { if (ids->ip_desc) device_set_desc(child, ids->ip_desc); return (0); } ids++; } return (ENXIO); } Does it make sense for this patch to be applied to ppc(4)? I think it solves some problems with bogus device.hints files and the ppc driver, but my eye is a bit untrained for this stuff and I don't have the experience to say with absolute authority whether or not it's the case. Thanks, -Garrett Index: sys/dev/ppc/ppc_isa.c =================================================================== --- sys/dev/ppc/ppc_isa.c (revision 211309) +++ sys/dev/ppc/ppc_isa.c (working copy) @@ -121,8 +121,8 @@ parent = device_get_parent(dev); error = ISA_PNP_PROBE(parent, dev, lpc_ids); - if (error == ENXIO) - return (ENXIO); + if (error) + return (error); if (error != 0) /* XXX shall be set after detection */ device_set_desc(dev, "Parallel port");