From patchwork Tue Jan 27 20:13:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 43849 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 439A023FFF for ; Tue, 27 Jan 2015 20:14:42 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id c13sf8820700eek.1 for ; Tue, 27 Jan 2015 12:14:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=CdOL3ve+ZVRxQnBMYVLjBLPCZKEXU8IC2TmRCpWC/7Y=; b=Xyl3ihqI5blMMYvSPoW8E+LrEgRyyxBOYGcQ04lhh41TdomSLGGI+zzZR7G+dcsQhu wTp1y/JazIXmwH/ItRqki/dC4/xtD3m/vYyKaVbqzicHqqoK8bvFh0nY/Wyk3oisjUvK Kj83WR9GPlWF73tnWpgEPwGijpNAhkRgsyJuXopI8AlI+CkJvgHZv/UZiCNC1L0sIs+R s+fnFJQQI0DEih8B9ULSgwaykkEQtgCG00bP/wjLpHjK3VG/S0wrhdjo8mst3PiCLSK9 EveudktY/mDmDEGEcJKNxhtilMrNuOOCiVlC8JApj3RJnoggEGYPRLGaqEOUtE74ACwj LzYQ== X-Gm-Message-State: ALoCoQmnwKKaWrdR3WPUg/5DWmIQfAbTdF/9KMXnQnfu+cVn5G0vnsEAPs4tvy//HTpW1v0FvZ3P X-Received: by 10.194.221.65 with SMTP id qc1mr521131wjc.7.1422389681557; Tue, 27 Jan 2015 12:14:41 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.162 with SMTP id f2ls94464lam.5.gmail; Tue, 27 Jan 2015 12:14:41 -0800 (PST) X-Received: by 10.152.22.67 with SMTP id b3mr4008673laf.82.1422389681315; Tue, 27 Jan 2015 12:14:41 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id q7si2317214lah.13.2015.01.27.12.14.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 Jan 2015 12:14:41 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id l4so15050385lbv.13 for ; Tue, 27 Jan 2015 12:14:41 -0800 (PST) X-Received: by 10.152.116.43 with SMTP id jt11mr3892823lab.69.1422389681233; Tue, 27 Jan 2015 12:14:41 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1213902lbj; Tue, 27 Jan 2015 12:14:40 -0800 (PST) X-Received: by 10.152.7.7 with SMTP id f7mr3683179laa.27.1422389661981; Tue, 27 Jan 2015 12:14:21 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id kt1si2217357lac.129.2015.01.27.12.14.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 Jan 2015 12:14:21 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id gq15so15326250lab.12 for ; Tue, 27 Jan 2015 12:14:21 -0800 (PST) X-Received: by 10.112.14.6 with SMTP id l6mr3892349lbc.91.1422389661866; Tue, 27 Jan 2015 12:14:21 -0800 (PST) Received: from uffe-Latitude-E6430s.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id ya4sm713470lbb.32.2015.01.27.12.14.19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Jan 2015 12:14:21 -0800 (PST) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Kevin Hilman , linux-pm@vger.kernel.org Cc: Geert Uytterhoeven , Dmitry Torokhov , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Ulf Hansson Subject: [PATCH 8/8] PM / Domains: Handle errors from genpd's ->attach_dev() callback Date: Tue, 27 Jan 2015 21:13:45 +0100 Message-Id: <1422389625-11730-9-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1422389625-11730-1-git-send-email-ulf.hansson@linaro.org> References: <1422389625-11730-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The optional genpd's ->attach_dev() callback is invoked from __pm_genpd_add_device(). Let's add error handling from the response from this callback and propagate the error code. When __pm_genpd_add_device() is invoked through the generic OF-based PM domain look-up path, the device is being probed. Returning an error will mean the device won't be attached to its PM domain. Errors of -EPROBE_DEFER get special treatment and is propagated to the driver core. Therefore this change also enables the ->attach_dev() callback to be able to request for a deferred probe sequence. Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 0fd5ee1..ba4abbe 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1467,8 +1467,9 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, goto out; } - if (genpd->attach_dev) - genpd->attach_dev(genpd, dev); + ret = genpd->attach_dev ? genpd->attach_dev(genpd, dev) : 0; + if (ret) + goto out; genpd->device_count++; genpd->max_off_time_changed = true;