From owner-svn-src-all@freebsd.org Fri Dec 6 20:17:41 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B76FD1B529C for ; Fri, 6 Dec 2019 20:17:41 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2m.ore.mailhop.org (outbound2m.ore.mailhop.org [54.149.155.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47V3mP1y0hz3MGc for ; Fri, 6 Dec 2019 20:17:41 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1575663459; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=s0Goqi/nldnGbBys+9zyEMx/z1tvHVESDsAxzQ966F+lUHiPdmi+75yWkhP89lymP5hmH93SZcWRc LbY8ZnHEciEBlsTTmvgk/8f6vcBcjaKSp75lYM/hO/S6rXQ2D9Kx2euawRpep44ilRj/qP6ymkvNFI irCuFG7Auxx00UCbUyHHDHjLp/3SW1Yf/Sf49+e4dTyFZc1JEql2d5Z6l18vQpIVxIslmUBQvAZW7c EewOF68RutCvS36YXgygePF61hOiSjaE32s7uW6rpUV5mwcbEJurQ2UUrzWLUCenK6xplUqC3cAKKL IrVAEofPszqqzTRRpA/AocZU3dJCSGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=cuux4Ly1OA7fVynSAp2COGJpFQQkBeajYlHWoet/GP0=; b=KHoe8zcubnVkmUrBbT1cTaJiiVvebdOnVjTDpbN3sEaRu9SRfBYITeE+x1MwJTBmOgN8OoZFhDIUY UYWpOx32q8RwOlRp+wFX2vHRtgKlxxYd7ANAg60oAjViOOB16LBh4x7IK48aoMVEO0IoBumNB7JYj9 JwsYSrG8d1mjmPl+1Ub/OJFRUD7hRVolnSSbXkhNDi0dnAI2mXzIA1MgELCkdtG56fv5ecXEqE+3hJ 8GXxsbLjJ1aY5mK5uYnNdCawPVj2NZV4af6a6l1HXvo6bncebQaiwMgM0fq7+wNt/uycQsXPuAz35/ fRP0fUMqZrAwV7GookQy5XQZJH6UL4Q== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=cuux4Ly1OA7fVynSAp2COGJpFQQkBeajYlHWoet/GP0=; b=jf0WlaCJDW7RMR+FVdN3YMFVITdPcltc1YJDm6nBfapEflSQi8Ez+kQ7sZn9Y8hDOb4hSlEkj6KfT Yolgxl2ck8ns+mJ0CSwCPPS1InPe0x//D+wegtnHjEO8Y4O97IpcxlYEZIsLnCxc3B3+j9YfkCfN1Z rl3LqnlnRtTN0HttbMRuTbYdWp/deftdcxw/uAnEo6m8ujIMvofyIh1UTtecPDOZVognS0Y8yAdDxz kQMWiPcsevlgPi5idSFNzLA41A65T977B8fGsfTozkYdXQnpJdJYzo1Dz0ig/1ti+5YTG0g30Y/NuV EaXstZdoD5djn9qKDLci51gexxu3YIg== X-MHO-RoutePath: aGlwcGll X-MHO-User: 7187e685-1865-11ea-829e-79a40d15cccd X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 7187e685-1865-11ea-829e-79a40d15cccd; Fri, 06 Dec 2019 20:17:38 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id xB6KHaS6012391; Fri, 6 Dec 2019 13:17:36 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <4e4999fec53ec82f9cfa9a441be09b884cb77e4d.camel@freebsd.org> Subject: Re: svn commit: r355461 - head/sys/arm/mv From: Ian Lepore To: Luiz Otavio O Souza , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 06 Dec 2019 13:17:36 -0700 In-Reply-To: <201912062005.xB6K58OX065449@repo.freebsd.org> References: <201912062005.xB6K58OX065449@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47V3mP1y0hz3MGc X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.985,0]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US]; NEURAL_HAM_LONG(-0.98)[-0.980,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Dec 2019 20:17:41 -0000 On Fri, 2019-12-06 at 20:05 +0000, Luiz Otavio O Souza wrote: > Author: loos > Date: Fri Dec 6 20:05:08 2019 > New Revision: 355461 > URL: https://svnweb.freebsd.org/changeset/base/355461 > > Log: > Fix the ARM64 build, include the necessary header. > > While here, call device_delete_children() to detach and dealloc all > the > existent children and handle the child's detach errors properly. > > Reported by: jenkins, hselasky, ian > Sponsored by: Rubicon Communications, LLC (Netgate) > > Modified: > head/sys/arm/mv/a37x0_spi.c > > Modified: head/sys/arm/mv/a37x0_spi.c > ===================================================================== > ========= > --- head/sys/arm/mv/a37x0_spi.c Fri Dec 6 19:33:39 2019 (r355 > 460) > +++ head/sys/arm/mv/a37x0_spi.c Fri Dec 6 20:05:08 2019 (r355 > 461) > @@ -29,9 +29,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > - > #include > #include > +#include > #include > > #include > @@ -228,9 +228,11 @@ a37x0_spi_attach(device_t dev) > static int > a37x0_spi_detach(device_t dev) > { > + int err; > struct a37x0_spi_softc *sc; > > - bus_generic_detach(dev); > + if ((err = device_delete_children(dev)) != 0) > + return (err); > sc = device_get_softc(dev); > mtx_destroy(&sc->sc_mtx); > if (sc->sc_intrhand) Oops, not quite right; I should have been more explicit. Something more like this: if ((err = bus_generic_detach(dev)) != 0) return (err); device_delete_children(dev); The delete is basically cannot-fail (as long as they're not attached), but bus_generic_detach() can fail if the detach method of any child/grandchilden fails. Hrm. You know, now that I've just looked in the code for device_delete_children(), it appears it will call detach if necessary, so maybe your approach is fine. I've just never done it that way. If anyone knows a reason why one approach is better than the other, say so. Otherwise I guess we should call this good. -- Ian