From owner-svn-src-all@freebsd.org Wed May 18 19:32:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA447B41460 for ; Wed, 18 May 2016 19:32:39 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lb0-x22e.google.com (mail-lb0-x22e.google.com [IPv6:2a00:1450:4010:c04::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7322A1BFD for ; Wed, 18 May 2016 19:32:39 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lb0-x22e.google.com with SMTP id h1so21121082lbj.3 for ; Wed, 18 May 2016 12:32:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jdgX9ZL3kJV0LNLL+F8yxDraFaTWEDIxOhzZ3RuTRbg=; b=KAjlvls399BRzbfo8Ziy2TGm5CS/H68EUVXBammaqGH0GRRxp5PDhkC0HezeZR7m+d N+RL8y8jWwpn7dCxc8HtPAUT20xAAbtB+KfBx9DH7WsrrW8UUwj3b4AnlwiIat168QHO IZwdZjyaUA+QwohRTUGPAbP4u8VfSBFfe44FJeru8xa81ywIS8/YGLQ9lsubEDpRwKC9 SQCIET61fH52F9OA+u05XUlNCosNcOMksoEkkE69jyqBxJc6BOcVWMHAN/m2r7Ofv14P 9s3yJ/slO1/TMI7FIkNtqfLtJOhweOcSwNw9xH5vwpBYkopddxhOlpdy9uV9OwAechXe vkrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jdgX9ZL3kJV0LNLL+F8yxDraFaTWEDIxOhzZ3RuTRbg=; b=Kiqnjj+uEV5lFdKnOe+7TNL71L9aWU0OtasBWEDFeq0jX0JCaxvPPtZeIHqpvXwxca TfFQJsV5/knNLcq0J4z96HM6NOPvDRoaxO3tyNcjGyjmUZLReCJd8mNVz34Dtug6qISP 2T2dry5HReMwVCi9iSyUYhQyBVLTalt8fcXo6X9QGifjxB2j5s7uqG7nkqQMt3a0ePuY l41jcZC3gyF55Q2nDj5udgcP/UvbuNAilrLEfkrVi2FbFgLow4pcW89k2YwRg4ehlIyC +TDCJLVwsw7s4jqAJNZ1rrdEpzj7eY7R+2qoy1eZVSV3BMWlYMUFBHwFiLiQ+nflI9x9 PJfg== X-Gm-Message-State: AOPr4FWWekjPUe2QBEX7oLMx4BJ0ih1WomU30DfKYcTcwNJIrCLUNlSnTQfvIwYeMzINbLZh1JvE9/SI2ukn/A== X-Received: by 10.112.73.40 with SMTP id i8mr3112014lbv.101.1463599957507; Wed, 18 May 2016 12:32:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.157.68 with HTTP; Wed, 18 May 2016 12:32:17 -0700 (PDT) In-Reply-To: <20160518162409.1074344e@zapp> References: <201605181505.u4IF5ixZ018827@repo.freebsd.org> <20160518162409.1074344e@zapp> From: Zbigniew Bodek Date: Wed, 18 May 2016 21:32:17 +0200 Message-ID: Subject: Re: svn commit: r300149 - in head/sys: arm/allwinner arm/allwinner/a10 arm/arm arm/broadcom/bcm2835 arm/mv arm/nvidia arm/ti arm/ti/omap4 arm64/arm64 kern mips/mediatek mips/mips sys To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 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: Wed, 18 May 2016 19:32:40 -0000 Hello Andrew, Thanks for your reply. Please see my comments in-line. Kind regards zbb 2016-05-18 17:24 GMT+02:00 Andrew Turner : > On Wed, 18 May 2016 17:15:10 +0200 > Zbigniew Bodek wrote: > > > 2016-05-18 17:05 GMT+02:00 Andrew Turner : > ... > > > #ifdef INTRNG > > > xref = OF_xref_from_node(ofw_bus_get_node(dev)); > > > - if (intr_pic_register(dev, xref) != 0) { > > > + if (intr_pic_register(dev, xref) == NULL) { > > > device_printf(dev, "could not register PIC\n"); > > > goto error; > > > } > > > @@ -172,7 +172,7 @@ error: > > > /* Failure so free resources */ > > > gic_v3_detach(dev); > > > > > > - return (err); > > > + return (ENXIO); > > > > > > > > > Few line above we have: > > err = gic_v3_attach(dev); > > if (err != 0) > > goto error; > > > > So now we would not return error code from gic_v3_attach() but always > > ENXIO... > > The error value doesn't matter, as long as it's non-zero. This also > fixes the return value in the intrng case if either of > intr_pic_register or intr_pic_claim_root fail. You might get a little > information from the return value being printed, however it would be > more useful to have verbose logging to print an error message. > > So if you wanted to fix INTRNG part why didn't you just set an error value in case of intr_pic_register() failure before "goto error"? Simply: + if (intr_pic_register(dev, xref) == NULL) { device_printf(dev, "could not register PIC\n"); + err = ENXIO; goto error; } Because now we set an error value and in case of real error (not when gic_v3_attach() returns 0) we print ENXIO while doing nothing with the err variable... > In all of these failure cases there isn't much we can do as there is no > root interrupt controller, the boot will fail later on when we enable > interrupts. > I know but that is not the explanation for breaking the logic here. > > Andrew >