From patchwork Thu Apr 26 08:53:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 134424 Delivered-To: patches@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1973272lji; Thu, 26 Apr 2018 01:53:17 -0700 (PDT) X-Received: by 2002:a19:9f10:: with SMTP id i16-v6mr15955769lfe.29.1524732797616; Thu, 26 Apr 2018 01:53:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524732797; cv=none; d=google.com; s=arc-20160816; b=n5XuARQdn54I8W59UzStHbp8qOempI2pQYxOkEQsvPZQZpHAFGt/NWIaQWHw5hkoub 5vx2cEZN7N5YzdwpDGWYX3PtoQb8w8rs44PLAHALJ/HI+VEsUq7YxO3a3dqaxP3Iqdiw ookgCqvr3i9rTLImm0eLZWWj+SIsKuDDAj4msIHoYeqGNQjrxpg2SoEOAcur3ofr9TPw m2mEjrc/Cw5Xt/IrcALkVIJYTXNQRA1pAk2+zj1jy/ZOV5Ay5Z5b6pdg9Cr9hpLaiPnT pe0SGgCYTX5ZMA1Xc62fdIgrD9N/CHCv5b0gi0VlYyoSMzaIhfErV90FJvd1o0i/znTF EmXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=erb1SyGANxVl6gHWShUQ9kqj4ktELneZ9u3fj92lBqQ=; b=lBiLcZB4PepkxYDfTiedhfD/YlPE/O4JobKGeCt6VipfeWMtNZpyFK7ZL+/tNw+doU 9Jv+hn/XF/uwEczNt0jcFtIQ0Gqzg0pELKiDpDWgk5KHa1i3KbWgPRLIDB/Zw/HoAsuS B8EqcNEUYG3ril4NpPFR0aOsQ+vbqEmzhTx4eaQjptdsB3svb2iqvGrDROiQst+Anofq um+vy45VKU9sFRXRV7qL1r0Fblvrls92i8lU3LEAWtgtrCYNGThl3m6feRfQlQuROsjh DTWxa1j7Lh3g5YcESFeghBofQCj12qzXmyvz0KJoItjgE7Vc4lMdS4JKKFD1fA/eJQxv HhHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cz1EUeiH; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id y129-v6sor3381698lfc.39.2018.04.26.01.53.17 for (Google Transport Security); Thu, 26 Apr 2018 01:53:17 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cz1EUeiH; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=erb1SyGANxVl6gHWShUQ9kqj4ktELneZ9u3fj92lBqQ=; b=cz1EUeiHl4NbC4RH9BK8Rr4UfAAbIWjpkVSp9BHZa3En8vWutSIOU06QmHyIWWX3X5 rMnT+nU2ht6VOTONGDxf7AMf55c7bEcRBefUZ4w6vYYEJC21R9eadYF4tTpy9LgqlpmO Wwkl5PFXleIpRHfBrS2RGX++kUkPmNQVulyNc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=erb1SyGANxVl6gHWShUQ9kqj4ktELneZ9u3fj92lBqQ=; b=CyNIxD+lAA48R9jWX9iePwXweiQKfjbMsRgx9b7PthD9rh7O5dS/G0QieQZTg7m8mU FRXHHYEiDr1AX2YIjP/Xl4h2fo69Uyf5KOF93Zs0CE+eM1wMCs7GuAXzgiusCXmrNpd3 ERbMV7AwTxX1afGeTlyaZ0JomYw/3ZK6RuBJX3Q98WL1TIhXwet0I3c5kf7CNq9yP5Mc YXYv/RH9H81g732y0ajTPzAWnSxEFFkSz8gqfgTyvIJ0a5CqbYbLm5ksSGfprWw7ATCx 2o2nCTkoftRlyeKb0n7FPM3IkWdzDL2mK4gLv56C1PQSQ0YHI/C80x4UjJ7um25ocrmr cMVA== X-Gm-Message-State: ALQs6tCD7mgt2bdjCMS+nnZ8+F8eNt/xyhbdJLt6VonFBFcWtLgZoFvy jMCKZGus6cBgTRNDTvLCEbrr1jeN X-Google-Smtp-Source: AB8JxZqanroxBvuAAJhH4Qr5NuNHaCTuHoLRrKMou4quakAWpZv+8j2I/o5BAAS2MwMo/bEUcvrsag== X-Received: by 2002:a19:fc04:: with SMTP id a4-v6mr16815435lfi.136.1524732797391; Thu, 26 Apr 2018 01:53:17 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u83-v6sm681097lff.65.2018.04.26.01.53.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Apr 2018 01:53:16 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Greg Kroah-Hartman , linux-pm@vger.kernel.org Cc: Ulf Hansson , Kevin Hilman , Geert Uytterhoeven , Viresh Kumar , Vincent Guittot , Mark Brown , Vinod Koul , Sanyog Kale , Pierre-Louis Bossart , Wolfram Sang , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "# v4 . 11+" Subject: [PATCH 01/11] PM / Domains: Fix error path during attach in genpd Date: Thu, 26 Apr 2018 10:53:00 +0200 Message-Id: <1524732790-2234-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> References: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> In case the PM domain fails to be powered on in genpd_dev_pm_attach(), it returns -EPROBE_DEFER, but keeping the device attached to its PM domain. This leads to problems when the next attempt to attach is re-tried. More precisely, in that situation an -EEXIST error code is returned, because the device already has its PM domain pointer assigned, from the first attempt. Now, because of the sloppy error handling by the existing callers of dev_pm_domain_attach(), probing is allowed to continue when -EEXIST is returned. However, in such case there are no guarantees that the PM domain is powered on by genpd, which may lead to hangs when buses/drivers tried to access their devices. Let's fix this behaviour, simply by detaching the device when powering on fails in genpd_dev_pm_attach(). Cc: # v4.11+ Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.7.4 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 1ea0e25..ef6cf3d5 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2246,6 +2246,9 @@ int genpd_dev_pm_attach(struct device *dev) genpd_lock(pd); ret = genpd_power_on(pd, 0); genpd_unlock(pd); + + if (ret) + genpd_remove_device(pd, dev); out: return ret ? -EPROBE_DEFER : 0; } From patchwork Thu Apr 26 08:53:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 134425 Delivered-To: patches@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1973287lji; Thu, 26 Apr 2018 01:53:18 -0700 (PDT) X-Received: by 10.46.133.24 with SMTP id j24mr1130671lji.12.1524732798868; Thu, 26 Apr 2018 01:53:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524732798; cv=none; d=google.com; s=arc-20160816; b=m+GoaYyTe49dtvJbf6GWd4D9uAPzEuaPG2P2O3+AEjgiQsiX+iCwkmFbwsJmWYiU/P 4biY9kDlJ6P/4+UEYw/h9bzYkx3SyNnBp+obsKU0HzhsqVbup7L1puL1VMstihftasvC /CQKgPuR5GPcdZQEYAOgAirGAcwA4HzAGnbAZ0V0q4FYzCYuQX9UGsnaefanzBqKvK5q lfYjieJS1ZLjfDuLsgdfDdF7QUT99jXZtd9XDGwoOUK/enrFBJUJxs/s7MXJhPqQwlqy 9rgTrsHRCPbU4iVw7Usqyi4tpOCvEEXg4nr9SZtoxv59b+PyQXRhzldoNSMlKr1zqVJG 7CtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=T9Wib4djefmVxBJqaikiWSvLHOActznyxXHnlI0JbYo=; b=laCvNXGFvCsBNQfTCLmCm5r0ruyeWUTBNG99OOP3ov96aDObPF4yRSi4taKn2Hi6DJ rxhbGbjMW19BmHqe1sqB551+TTECXoUq6P+KIQbtCr/1pnYrkMBMS5aojbFewTgqAWNZ iNEEgkCKhGxWfRIZPLZ0vUJP7t/73t+pIHQV7gPKAqfBWWJ2NW8Xzz7I5f+v2KwAHzzA MFcS90I+Lb7bIyv7IUA5rB6gUA2FV+yLJO/MDq/vDKonA4xi7b6XvD/qyXVlK6iZRUTx +pKVXZDwdx9JVbaq+aU4+sVM1oNmpNeOUPNfwL6MHYRIKcbhMT8teAEoyoZLAS32b8xi iYkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QKKACr4/; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id m66-v6sor4581030lfg.89.2018.04.26.01.53.18 for (Google Transport Security); Thu, 26 Apr 2018 01:53:18 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QKKACr4/; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=T9Wib4djefmVxBJqaikiWSvLHOActznyxXHnlI0JbYo=; b=QKKACr4//cMEPXh2kGBdBTTlrq18MdPu6x3XyUXR/vYCJF9ztck8vksYZOjtf/Tpm5 R4LfOvXPo9mw0bbtSLD+XKJUmFVebdkY1MWRNbzv7ScbnV2ZBhDBPTPpg89MdXj6+2pw xhqvHuLkfi96UUFus/Kvzomt99qgdoGlRF/Gc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=T9Wib4djefmVxBJqaikiWSvLHOActznyxXHnlI0JbYo=; b=WbQOuJxqYLXZKIF7J2tvjX8Yk32pLeoOKJVzGcMel2vtRQPD5bh1+toxbhmU+jFfx1 UNvk4oXUlXw6+UCX7w5kggMPgJbwEH+OUleaPCCpVO9Iln9gydk9cFezqUpJXXkjk+K5 MgTDYMT/VqCxUK9TItqsf+yQepVATVsfX4Wab7jym8Fyq8gD0XuuoITZJhDz1Icn44kh 0K9epgJWF+eQZYCDBtWLFze1kAlOCEMxrnZeK3JOiqBeg82jAOHjlNNV1mdVGGwo6ywW 7q3q3WAR0SZKSCrGIZ3IvN5rk9l4dvfaUy6ifA+RB8D3g4styG7B3ZUiPYJVSNYh1e0e D4/w== X-Gm-Message-State: ALQs6tC9Ntxi0kgKkbtvRVIG+Yr3g4f59j6snuKqolrP/1uaI3zxZ2kX pz4XBG4LQdLZEjzeZwYqmfJLQgyV X-Google-Smtp-Source: AB8JxZoMYppiNVNJ8LrqJuEo2YSyCCdCZ6BA+20vnaKxwNfLnK/TG4wklADjtV76PtgngxoU67648Q== X-Received: by 2002:a19:6d02:: with SMTP id i2-v6mr6556915lfc.81.1524732798661; Thu, 26 Apr 2018 01:53:18 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u83-v6sm681097lff.65.2018.04.26.01.53.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Apr 2018 01:53:18 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Greg Kroah-Hartman , linux-pm@vger.kernel.org Cc: Ulf Hansson , Kevin Hilman , Geert Uytterhoeven , Viresh Kumar , Vincent Guittot , Mark Brown , Vinod Koul , Sanyog Kale , Pierre-Louis Bossart , Wolfram Sang , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 02/11] PM / Domains: Drop comment in genpd about legacy Samsung DT binding Date: Thu, 26 Apr 2018 10:53:01 +0200 Message-Id: <1524732790-2234-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> References: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> The parsing of the Samsung specific DT binding is gone, but the comment in the function header remained. Let's drop the comment to avoid confusions. Fixes: 001d50c9a14f ("PM / Domains: Remove obsolete "samsung,power-domain" check") Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 3 --- 1 file changed, 3 deletions(-) -- 2.7.4 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index ef6cf3d5..d3703a1 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2185,9 +2185,6 @@ static void genpd_dev_pm_sync(struct device *dev) * Parse device's OF node to find a PM domain specifier. If such is found, * attaches the device to retrieved pm_domain ops. * - * Both generic and legacy Samsung-specific DT bindings are supported to keep - * backwards compatibility with existing DTBs. - * * Returns 0 on successfully attached PM domain or negative error code. Note * that if a power-domain exists for the device, but it cannot be found or * turned on, then return -EPROBE_DEFER to ensure that the device is not From patchwork Thu Apr 26 08:53:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 134426 Delivered-To: patches@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1973308lji; Thu, 26 Apr 2018 01:53:20 -0700 (PDT) X-Received: by 2002:a19:cf89:: with SMTP id f131-v6mr15833468lfg.130.1524732800304; Thu, 26 Apr 2018 01:53:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524732800; cv=none; d=google.com; s=arc-20160816; b=DYZsQMLOmj36VtGSn+wa61AkSAZNmhjXdaT8I8tPXZ5lGvh1IPphN3BI7aWUG9XMLL oaTGB/x8Rj54Kc4F6M1ZA3QgKgFyfVhUuCcoRMcpUA94kGtg+GN0TkBpHmfdHGaooL7M O6Y2DJtYq8yof6ZzAWbln3QulqFsfRgpyRadqmk2Iwaow/gh6rn8WtV8AJfYFgW4pexh dNtfq92SehCrNo3VnAUw6IScSRQO+akANy9epEZbcRhi2EOWISZ0eo6NrEQo4l6b72vw h3/GEZYoO42O0X4HMJy1N5nSz4j4BMm+bmzmErur2MOy99h7fKB6umXbC/eNTVnea7Fh AlwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=592d1ZuHzXITHjPuFb/XpT9ecoVcy1aDhYaYmkB2pFg=; b=o6hdaPkcJepdrBmcQ+UBiHgYuij62syFSitPjKXLuU9ubDAgEkiQagrMDFVUUxy2Bg Yt0+9duK3Ltuo8iKuYiF/+IHIwiHAkx69j/Gl9KLcw9830jCgjNUJgvYK9iN31BqoSle KCkf91CMfkmxf6CgparKd+OWuTKBN5ebGYmrl4ojiZ1gkxuIXLIF2HEVUssnBFEUWErk Wu+TLQ3xFCoX3Dj8G/6nBxFiit4HBokGkxMDULJU0gXDmGAaA85kJTv0RJpee3RDNGHP TMvvAr4bNRzINCcwLNNtTmFJ6WcyHtHDUHdTtlxv06fQtME3R8edHc5Yb4fj0j7xlZTG 9qfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bgxQbXgk; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id l67-v6sor3363602lfk.16.2018.04.26.01.53.20 for (Google Transport Security); Thu, 26 Apr 2018 01:53:20 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bgxQbXgk; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=592d1ZuHzXITHjPuFb/XpT9ecoVcy1aDhYaYmkB2pFg=; b=bgxQbXgkUl9kjuonovDbW0cvR9tFPdjH+rJ9mmG3egXz0cf9O4lFiNqwqlqll4iF65 EQjE5ZX/Twj9lX5+ivfDIXkkl6OkrUEQLIhUgIEkDeUy9FcM1Wg98REY/x08AxmOIVbp zr15KMgEQkhZCqRg90WO94L+fZqa5lYPTWYus= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=592d1ZuHzXITHjPuFb/XpT9ecoVcy1aDhYaYmkB2pFg=; b=a9cRsn1NNdMM4oiUnZWoMynlJ2cjy4VOgLRZpiYUGAVl4G4WuE8G7Ssn1XaUZ5KD4f 2q7BowZCh/BQNaErBdP4Cw7g8E2tmIbyIpGenZyEjaXjZe9P5n1QpqSUDaamqo8VyEIW 0xTAqjeCQT/RU31mZVSWA8lKQ1aKTHq8KP+v4AhuKTa6opybwQ/+4KDM3Raz0VKh5XXM UdFmchj+u7BfamLm7CVSmBQc9RzKSqEUZMcGR19HFsnOwMfcnG9cqzKspGcRsSXTjWTo qtAauuNEcToT/6oGGMmVYQT4ZDZG7yZbV85tvWJVpRiJ7mu195FqtHtUF1UeQeSqGd7V QjCQ== X-Gm-Message-State: ALQs6tBSEtgU9XSHtJZJuQ8iVhGEQB2ETjcEds1IGiDvmAJLesRzQh0D z1A9ozBqPh5OgO9XNBI2a71US7pc X-Google-Smtp-Source: AB8JxZpmEFysc1YWVrAwbCtS0RNgYGZBA9lukz8bbM5jIWBv95xCe8brHRdkbkBv4p+Eg3Rwv0BB6Q== X-Received: by 2002:a19:5c05:: with SMTP id q5-v6mr15645875lfb.14.1524732799969; Thu, 26 Apr 2018 01:53:19 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u83-v6sm681097lff.65.2018.04.26.01.53.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Apr 2018 01:53:19 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Greg Kroah-Hartman , linux-pm@vger.kernel.org Cc: Ulf Hansson , Kevin Hilman , Geert Uytterhoeven , Viresh Kumar , Vincent Guittot , Mark Brown , Vinod Koul , Sanyog Kale , Pierre-Louis Bossart , Wolfram Sang , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 03/11] PM / Domains: Drop redundant code in genpd while attaching devices Date: Thu, 26 Apr 2018 10:53:02 +0200 Message-Id: <1524732790-2234-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> References: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> The driver core together with the PM core, nowadays deals with deferring all probes during the device system sleep phases. Therefore genpd no longer need to care about this situation, so let's drop the corresponding code. Signed-off-by: Ulf Hansson --- drivers/base/power/domain.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) -- 2.7.4 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index d3703a1..d4b96ed 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1377,7 +1377,7 @@ static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, struct gpd_timing_data *td) { struct generic_pm_domain_data *gpd_data; - int ret = 0; + int ret; dev_dbg(dev, "%s()\n", __func__); @@ -1390,11 +1390,6 @@ static int genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, genpd_lock(genpd); - if (genpd->prepared_count > 0) { - ret = -EAGAIN; - goto out; - } - ret = genpd->attach_dev ? genpd->attach_dev(genpd, dev) : 0; if (ret) goto out; @@ -2194,7 +2189,6 @@ int genpd_dev_pm_attach(struct device *dev) { struct of_phandle_args pd_args; struct generic_pm_domain *pd; - unsigned int i; int ret; if (!dev->of_node) @@ -2220,14 +2214,7 @@ int genpd_dev_pm_attach(struct device *dev) dev_dbg(dev, "adding to PM domain %s\n", pd->name); - for (i = 1; i < GENPD_RETRY_MAX_MS; i <<= 1) { - ret = genpd_add_device(pd, dev, NULL); - if (ret != -EAGAIN) - break; - - mdelay(i); - cond_resched(); - } + ret = genpd_add_device(pd, dev, NULL); mutex_unlock(&gpd_list_lock); if (ret < 0) { From patchwork Thu Apr 26 08:53:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 134427 Delivered-To: patches@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1973324lji; Thu, 26 Apr 2018 01:53:21 -0700 (PDT) X-Received: by 10.46.153.153 with SMTP id w25mr7239767lji.34.1524732801567; Thu, 26 Apr 2018 01:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524732801; cv=none; d=google.com; s=arc-20160816; b=E6J9/4RW6aJiaMCXKoCRCosDbNWAdzGOqzfyY5WLJSNoM36XX69SPZchLaY/1UgJ8+ nusLWFBgyqdkBg2Av+/bVtGA5zJcY2f+z8rNvWCTYhTCkZlbIt303SoJOKJr0rf6no0N eSyX/zACZo2SpRsUYoOuJDIPv12rRs/gac67I//sHHHeHYFNM1+dcssj2n2bgzPibtGh xO401j27wHBLAngkoRHXz0vWxceRCZKabWDh1OMtMPvmekBksVq/TpnjhqU/4zWZdimu 8yUrJY1sUPmkIAm97vInEQR1Jew5V6Xj7hBKmDqnMJGIC0O5V+CM/Stizeanp+TGD+63 VR3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=0GyqQznU278kM2emAIQfIFInCTzuUYGErGb1DqJIbtQ=; b=qzuHog7yFDN4Si7TFYi2eQHAySgHvYztV7rOLtbzooZ/7G86/50+yMja3P/riudHpQ CNWWxcSsw2fuNRqO+dyXxb5mmQwLjG/NGEqg1P/i2c5im0jB5+h/3R/COd1OvZ+FhZXh JystGVE8yyubSiQVDHwenqvsuFcqtXooG/696oUC/M0pRFwnTCLGMYrJYRch2xryqRBv Kxzdk6+r9qA9JJili6ehR8MsJhr2bUDQiX58/91RIyHxmtHAfagNDB3tAnvA4j44nsf2 AI+NXVUCOigJEfu0Mjp6TtmCEOSvJGrjSa6udjP3ZWLzVW6oHcpSvEh9SF33Hwzdb43w 1Z+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZVBeT7vE; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id g29-v6sor974240lfi.26.2018.04.26.01.53.21 for (Google Transport Security); Thu, 26 Apr 2018 01:53:21 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZVBeT7vE; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0GyqQznU278kM2emAIQfIFInCTzuUYGErGb1DqJIbtQ=; b=ZVBeT7vEelur7ywutblazacQt0thtbPcy1AA8wejXPWGHVfsi/gGd4fLGNwS+z2SS/ kYsNNEb+O18tpmTu/p8kJgSTja7Sjq5GmT/ZT0PEEKzebodwJBs2N8dw40eHtKGPs0dD IHibcnOYi/1lJbzJqJaVLdUoItTMnG7U5vT8s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0GyqQznU278kM2emAIQfIFInCTzuUYGErGb1DqJIbtQ=; b=s3njrUhxand7Kc/WhOmvA8gy6Ea/h+QWQ+U1iZqL97yyF46xM+qCTddEIS4teK5suW l/Z7tgbEwoMhHeJaYLdoM+d08Kbhk39oaNJaICswIZRithwGTjaOfuZGHgiBS1Zdob+t oj9Jxr2Tmk8OOY2X0heMSsS3hw5aGPBG2RXxwwWtgEyEH4DNDPt5oOUwkrbJJQFuH0VM GXv2UjnOpsCC8i+Umfjzb5LgxgvpWvxT+b+gA0fkS9X+XHYoA9TcFjWLPPFDB9BbwjC1 Jt8cAaKdzZwnzh4IqXPZwszIjNa9nEny9uYl7Fsndd1gUSVFI85EQ5ZetFtWQLmY0DkM 7Wbg== X-Gm-Message-State: ALQs6tBZhSNHdGpcNyb2wvUfKgn1xCW/q8zba2xJg+L4DEYjdMWQrH1p zigtiQZmRsw/3RW364lN/2JpoKrY X-Google-Smtp-Source: AB8JxZpUhL3m3fgj9e1oO7eZFkyPRdW/mrAPcSsU4ZM6YwUIxSxl70Afa/JiuZr1NtwnnRR3A0mMKg== X-Received: by 2002:a19:1462:: with SMTP id k95-v6mr16871980lfi.23.1524732801276; Thu, 26 Apr 2018 01:53:21 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u83-v6sm681097lff.65.2018.04.26.01.53.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Apr 2018 01:53:20 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Greg Kroah-Hartman , linux-pm@vger.kernel.org Cc: Ulf Hansson , Kevin Hilman , Geert Uytterhoeven , Viresh Kumar , Vincent Guittot , Mark Brown , Vinod Koul , Sanyog Kale , Pierre-Louis Bossart , Wolfram Sang , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 04/11] PM / Domains: Check for existing PM domain in dev_pm_domain_attach() Date: Thu, 26 Apr 2018 10:53:03 +0200 Message-Id: <1524732790-2234-5-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> References: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> Instead of checking if an existing PM domain pointer has been assigned in genpd_dev_pm_attach() and acpi_dev_pm_attach(), move the check to the common path in dev_pm_domain_attach(), thus potentially avoid one unnecessary check. Signed-off-by: Ulf Hansson --- drivers/acpi/device_pm.c | 3 --- drivers/base/power/common.c | 3 +++ drivers/base/power/domain.c | 3 --- 3 files changed, 3 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index 3d96e4d..d006300 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c @@ -1259,9 +1259,6 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on) if (!adev) return -ENODEV; - if (dev->pm_domain) - return -EEXIST; - /* * Only attach the power domain to the first device if the * companion is shared by multiple. This is to prevent doing power diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c index f6a9ad5..f3cf61f 100644 --- a/drivers/base/power/common.c +++ b/drivers/base/power/common.c @@ -104,6 +104,9 @@ int dev_pm_domain_attach(struct device *dev, bool power_on) { int ret; + if (dev->pm_domain) + return -EEXIST; + ret = acpi_dev_pm_attach(dev, power_on); if (ret) ret = genpd_dev_pm_attach(dev); diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index d4b96ed..b816adb 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2194,9 +2194,6 @@ int genpd_dev_pm_attach(struct device *dev) if (!dev->of_node) return -ENODEV; - if (dev->pm_domain) - return -EEXIST; - ret = of_parse_phandle_with_args(dev->of_node, "power-domains", "#power-domain-cells", 0, &pd_args); if (ret < 0) From patchwork Thu Apr 26 08:53:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 134428 Delivered-To: patches@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1973351lji; Thu, 26 Apr 2018 01:53:23 -0700 (PDT) X-Received: by 2002:a19:c6cc:: with SMTP id w195-v6mr15827105lff.40.1524732803090; Thu, 26 Apr 2018 01:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524732803; cv=none; d=google.com; s=arc-20160816; b=UgCFYg1vELRgAFIhKqPm6GYMzQc6LGfqe+SNM4UnVubhCM6DhyeaZf/1FxyMSI9Ndz Gw8udptRhH+3joo3rRoMj8efYkMsvzb1UEaUxUWpow54XwhSB1chOW/5xuuHutyQKb2N tOkjkLAgFhOeNR8MAfeLdK6BJYH0qT9QonWAyT+6UmqMB1e5tHZMmKes0rDEm6h6HNcL maZZNOa9mJBFF0hgcRsBGmv4/iREEra6/689IAXN4++TbuH827MTuQI0Ajg7yCnMqwoc fLejjWi/LvfGXUGvFM02JJBrz4N/W1R6GQuTpPLSkbJWI7vOsw5w2owPn8a70YIXR8Tl C49w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=myhUo+RRBuBr1W4j3dNgjvpKR9j5RD+zME8+Uz1EWlA=; b=HFwe588HdFg7eT7Osk/+LOOBC7D4pnrM7hb1zMJlFgF9wvNnhzOkXQ+NEqtMuL4AzL QGQXuwvkv5mnduIGPUbz3RA/MTDVX5LFupPnq2XqcFNR7GstdoAaXELXNcGB02/xaoAf jxnIDO6Nm8oqVCCX11+6xTQBMdS5JTOZc5KFlPwW4zP4dBkcd1ZEz2/1z/caN/M3Zamr 7sUqRxdBiAFf93eebm4Pqf2XpCZhybdPn2IxI0k1M+4bTO0atNJGk5Var2M5t+Sk26Av ul8LyGz46R1xI2pQ9Py0ef2YlwVRkAd5Oj+xMuvqJGXfu95t4cTmAJXoajOC9NTruy33 Iirw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jByH7P3D; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id m66-v6sor4581053lfg.89.2018.04.26.01.53.23 for (Google Transport Security); Thu, 26 Apr 2018 01:53:23 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jByH7P3D; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=myhUo+RRBuBr1W4j3dNgjvpKR9j5RD+zME8+Uz1EWlA=; b=jByH7P3DzOotnPMjCYUIpL4xMIbWmjIyyByhpxOPqK7fNrQDTJ079SmiQh/9oo5qD1 KEo0e81ihoXTx5di5XNiYZ5kdh9kpT1/Uk/3pe/oGuX5xsaRInYYLTmNT3AcMae8TJv4 FHO78zgjP9/r+VJWqgrHL0mFbzdvjSgBGG1Po= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=myhUo+RRBuBr1W4j3dNgjvpKR9j5RD+zME8+Uz1EWlA=; b=BG1omyAWDJPnA5PsJzDldzTTXh53qmfARw/Ayp7i4mXoXG3u3YcXZ0KkdFXk/BzOt1 x9akWbowrUjYhsJ172KGILSdU0vRXB2WY8Irwm6KZlGFbxn597n9VUcyiq2g+ZtVwd4U xxHjdSJiiubw6+kOXei5jcf/A9NsTYz/uVh+CQ5QiupzIb9JUBRt+alI0Fdfovxho6Ju HRnw6IvFUeVZDzL3Ij065K05ssnoUS9uo/y8V9r9kF5zFk1oHITI51JygzZdkxuTHLg4 UQjip8WXCS3zhSlIFCJYlcED3Wk47eQYQrwGNXyqFF2b3hxjPzJoy802+SZJbR5bdpUG UmAA== X-Gm-Message-State: ALQs6tACKjcpuVVRbE47HhM75XC6DzUYEXNuijEc1DFJkLj0A5dVGtIV XgqvkRKeHq9w+rtY7yFAmKvfmGc2 X-Google-Smtp-Source: AB8JxZpmBkzo6Ygg1o+pbE6kj8XIK+loIVKJpjYpBna9W22AgODjnbsaJ5mPShWrEY9ENWm2EpPeqw== X-Received: by 2002:a19:9b51:: with SMTP id d78-v6mr13646312lfe.66.1524732802713; Thu, 26 Apr 2018 01:53:22 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u83-v6sm681097lff.65.2018.04.26.01.53.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Apr 2018 01:53:21 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Greg Kroah-Hartman , linux-pm@vger.kernel.org Cc: Ulf Hansson , Kevin Hilman , Geert Uytterhoeven , Viresh Kumar , Vincent Guittot , Mark Brown , Vinod Koul , Sanyog Kale , Pierre-Louis Bossart , Wolfram Sang , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 05/11] PM / Domains: Allow a better error handling of dev_pm_domain_attach() Date: Thu, 26 Apr 2018 10:53:04 +0200 Message-Id: <1524732790-2234-6-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> References: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> The callers of dev_pm_domain_attach() currently checks the returned error code for -EPROBE_DEFER and needs to ignore other error codes. This is an unnecessary limitation, which also leads to a rather strange behaviour in the error path. Address this limitation, by changing the return codes from acpi_dev_pm_attach() and genpd_dev_pm_attach(). More precisely, let them return 0, when no PM domain is needed for the device and then return 1, in case the device was successfully attached to its PM domain. In this way, dev_pm_domain_attach(), gets a better understanding of what happens in the attach attempts and also allowing its caller to better act on real errors codes. Signed-off-by: Ulf Hansson --- drivers/acpi/device_pm.c | 6 +++--- drivers/base/power/common.c | 7 ++++--- drivers/base/power/domain.c | 19 ++++++++++--------- include/linux/acpi.h | 2 +- include/linux/pm_domain.h | 2 +- 5 files changed, 19 insertions(+), 17 deletions(-) -- 2.7.4 diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index d006300..a7c2673 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c @@ -1257,7 +1257,7 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on) struct acpi_device *adev = ACPI_COMPANION(dev); if (!adev) - return -ENODEV; + return 0; /* * Only attach the power domain to the first device if the @@ -1265,7 +1265,7 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on) * management twice. */ if (!acpi_device_is_first_physical_node(adev, dev)) - return -EBUSY; + return 0; acpi_add_pm_notifier(adev, dev, acpi_pm_notify_work_func); dev_pm_domain_set(dev, &acpi_general_pm_domain); @@ -1275,7 +1275,7 @@ int acpi_dev_pm_attach(struct device *dev, bool power_on) } dev->pm_domain->detach = acpi_dev_pm_detach; - return 0; + return 1; } EXPORT_SYMBOL_GPL(acpi_dev_pm_attach); #endif /* CONFIG_PM */ diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c index f3cf61f..5e4b481 100644 --- a/drivers/base/power/common.c +++ b/drivers/base/power/common.c @@ -98,7 +98,8 @@ EXPORT_SYMBOL_GPL(dev_pm_put_subsys_data); * Callers must ensure proper synchronization of this function with power * management callbacks. * - * Returns 0 on successfully attached PM domain or negative error code. + * Returns 0 on successfully attached PM domain and when it found that the + * device don't need a PM domain, else a negative error code. */ int dev_pm_domain_attach(struct device *dev, bool power_on) { @@ -108,10 +109,10 @@ int dev_pm_domain_attach(struct device *dev, bool power_on) return -EEXIST; ret = acpi_dev_pm_attach(dev, power_on); - if (ret) + if (!ret) ret = genpd_dev_pm_attach(dev); - return ret; + return ret < 0 ? ret : 0; } EXPORT_SYMBOL_GPL(dev_pm_domain_attach); diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index b816adb..455ecea 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2180,10 +2180,11 @@ static void genpd_dev_pm_sync(struct device *dev) * Parse device's OF node to find a PM domain specifier. If such is found, * attaches the device to retrieved pm_domain ops. * - * Returns 0 on successfully attached PM domain or negative error code. Note - * that if a power-domain exists for the device, but it cannot be found or - * turned on, then return -EPROBE_DEFER to ensure that the device is not - * probed and to re-try again later. + * Returns 1 on successfully attached PM domain, 0 when the device don't need a + * PM domain or a negative error code in case of failures. Note that if a + * power-domain exists for the device, but it cannot be found or turned on, + * then return -EPROBE_DEFER to ensure that the device is not probed and to + * re-try again later. */ int genpd_dev_pm_attach(struct device *dev) { @@ -2192,12 +2193,12 @@ int genpd_dev_pm_attach(struct device *dev) int ret; if (!dev->of_node) - return -ENODEV; + return 0; ret = of_parse_phandle_with_args(dev->of_node, "power-domains", "#power-domain-cells", 0, &pd_args); if (ret < 0) - return ret; + return 0; mutex_lock(&gpd_list_lock); pd = genpd_get_from_provider(&pd_args); @@ -2218,7 +2219,7 @@ int genpd_dev_pm_attach(struct device *dev) if (ret != -EPROBE_DEFER) dev_err(dev, "failed to add to PM domain %s: %d", pd->name, ret); - goto out; + return ret; } dev->pm_domain->detach = genpd_dev_pm_detach; @@ -2230,8 +2231,8 @@ int genpd_dev_pm_attach(struct device *dev) if (ret) genpd_remove_device(pd, dev); -out: - return ret ? -EPROBE_DEFER : 0; + + return ret ? -EPROBE_DEFER : 1; } EXPORT_SYMBOL_GPL(genpd_dev_pm_attach); diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 15bfb15..c01675b 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -899,7 +899,7 @@ static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; } static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } static inline int acpi_dev_pm_attach(struct device *dev, bool power_on) { - return -ENODEV; + return 0; } #endif diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 04dbef9..a1da66e 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -280,7 +280,7 @@ static inline int of_genpd_parse_idle_states(struct device_node *dn, static inline int genpd_dev_pm_attach(struct device *dev) { - return -ENODEV; + return 0; } static inline From patchwork Thu Apr 26 08:53:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 134429 Delivered-To: patches@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1973371lji; Thu, 26 Apr 2018 01:53:24 -0700 (PDT) X-Received: by 10.46.151.206 with SMTP id m14mr2900718ljj.102.1524732804269; Thu, 26 Apr 2018 01:53:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524732804; cv=none; d=google.com; s=arc-20160816; b=nG0YOb6VJO9PcjZTEaEMHsQa7PjE+kjeG1D1ztPC1EUpxwb1scnMvNuSVzkBnCG/7+ XAN2Ho6bZIx8MHl4kjFSnT5njKT46e8joblrMvTrIy909ovXySglTGYmahVFLaotjmnD hTgzcuVVDMuDXTL49Iu4DgM5GJ2Wb9xDvYHvN5AKYvF97Rbthv2K4i1fhe1O2AuorNBI E5wTqYzZOzPXAwnMxt+ZbUa596jhJmiOS0KmIhnkqkDK1p/UlxGYlR02mP2MwO/SiDzl 2SmcrVvYtS1B1C1TbmMfzQBAjpq0cLxmIbF37O08RoCscfLnRsqNAH60E5LB1SUy+NId NW5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=soNOtJTU3RLapthGVgaxgE2rq+eWjefBnIsGZ8fdPIU=; b=DnJigYWbI9saHR+Sfkb3TxGmR012VNL7Uko7u7WeQKqsg9YYQMDZRkF26771bdW7U7 ySTii1F2OMX5Lybw53dpcIMYIgYJ2tTV3f635Ld7RW/LzqI76zCFnaYOoWNIdHoMThKT y5kGzRRAlxADhd8EYrnw6guTwn/erZVF7NsJxshxxW7FK0u/mftU5SMTegEO9ijLFOMI FBpVWtAQbHSDN436Vhgeu8lUynJFh3ex4GFMjQDF2nRUFzFOc3d06OzG4YxoE2PpB0hz iTqZcCTNf3QBg/kLVYaBc/vtMTCEzC+q013CDPedV+3QtWXT0pVH8PonPrODgpYeUqBw rFqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XNyT9mzJ; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id m88-v6sor386658lfi.81.2018.04.26.01.53.24 for (Google Transport Security); Thu, 26 Apr 2018 01:53:24 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XNyT9mzJ; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=soNOtJTU3RLapthGVgaxgE2rq+eWjefBnIsGZ8fdPIU=; b=XNyT9mzJnUkGkoFXZutUPqR6OUTdzK7zOJtCsxtOa4FzXYXviyirFT13T/Udc9yQn4 guB3FCR/XQKjsCm3Bex2FGOY08H959IC2f8xPmw+Tq6U4nLaJrFI8eOKZmlnIIe0ONtU 9+mwEATHkJkNqOfN2ZiFRaJ39a2GeuDi+XgJY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=soNOtJTU3RLapthGVgaxgE2rq+eWjefBnIsGZ8fdPIU=; b=REZ3VZwZhUY6HpbzwPDY8sZnxF9RheOg/4Y6PnJuYyeWSRopvDNPOZbFtJxifQEY10 JuXGsRcSAJdw9IkE73H45VnGehhHVFpzcnZFVwFMItvVT8C8wApYLHJQjXPRjJmVyH4E 8w5V2eB8Juy8roBKcPyo7kSMombRPwGjjf/QqgdX0yc3TqRscaqNgrYj6sYFjpT6ZucN cSrUyilSAO1O0CIjdO+SQUVTsHY/iacsMB9qwkXsV1rSTNW11CZptoQB5FC4DUCBsJbN 5wGdS20z0ac+jGv/zAW0CwGMOzjpamhnKfddlodbK48zf91KCNH8/qch5Xx92lkqvnX6 zx+Q== X-Gm-Message-State: ALQs6tAzVKnnX2HfgBt7LMFs/iKhHeO6D93MMlZ5T6rxx58LfN//MpDn 5zy7i6nXf/vdan+pI+NPvP2ikL9o X-Google-Smtp-Source: AB8JxZpUUskqWy8u6tjl2FAxw4EfS+g2nkLhpili7g5TEQVTRxrLN9JQ6GyyueALctaQCs06aqn/+Q== X-Received: by 2002:a19:dd83:: with SMTP id w3-v6mr16829692lfi.82.1524732804044; Thu, 26 Apr 2018 01:53:24 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u83-v6sm681097lff.65.2018.04.26.01.53.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Apr 2018 01:53:23 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Greg Kroah-Hartman , linux-pm@vger.kernel.org Cc: Ulf Hansson , Kevin Hilman , Geert Uytterhoeven , Viresh Kumar , Vincent Guittot , Mark Brown , Vinod Koul , Sanyog Kale , Pierre-Louis Bossart , Wolfram Sang , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 06/11] amba: Respect all error codes from dev_pm_domain_attach() Date: Thu, 26 Apr 2018 10:53:05 +0200 Message-Id: <1524732790-2234-7-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> References: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> The limitation of being able to check only for -EPROBE_DEFER from dev_pm_domain_attach() has been removed. Hence let's respect all error codes and bail out accordingly. Cc: Russell King Signed-off-by: Ulf Hansson --- drivers/amba/bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 594c228..79fcbff 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -243,7 +243,7 @@ static int amba_probe(struct device *dev) break; ret = dev_pm_domain_attach(dev, true); - if (ret == -EPROBE_DEFER) + if (ret) break; ret = amba_get_enable_pclk(pcdev); @@ -370,7 +370,7 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent) } ret = dev_pm_domain_attach(&dev->dev, true); - if (ret == -EPROBE_DEFER) { + if (ret) { iounmap(tmp); goto err_release; } From patchwork Thu Apr 26 08:53:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 134430 Delivered-To: patches@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1973394lji; Thu, 26 Apr 2018 01:53:25 -0700 (PDT) X-Received: by 10.46.83.68 with SMTP id t4mr15260164ljd.83.1524732805521; Thu, 26 Apr 2018 01:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524732805; cv=none; d=google.com; s=arc-20160816; b=m2x1Ypo8OHERtgcDENNfUP36tYjKECmVIsyEIyxvmkFL472rt4eybdJi5v7cso/wb3 nCOkLwYTIaW3n55OI+iTYnCDhUGCO23Z8wlwuW6ngSOOCdFV3HjuMJMgitml6LPnJUVE FWLT7dJ8r4LJracOXSM+XId4PSiRHgW9SML063HE0HSKrFh+glok1ZyjuJmtNpd2dbNx 59ht+10KshVXCRkNJ5+kUjSO/bEWHHszEtLsoh2+m3DpY+mpGTXHdoU291itHNHutIbK 9Z4AM1LSGO3FN1VJmCdPHI0UVwsU6yf/mOk/mN3PWCf66G/s3TDHHPSrdeyCp2KYaLVi jJCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=H5Anx8HHtixBsfJHQkkyvqYQI+3r9uHRYHoqlZJ0xFo=; b=0Rjk5Ou7fjyty92jjNCZcooxpIWJo2CiuIGWBRbj1bPAbgPcLHVbh1XlyrYsrYErDZ J2dlwTWVzHO1WPol5bKsyd8hrr329MmUeA4TNXcfZqtTdkXgrp2ylJUw9FpvtH2JXrdI l4UXAUoVaDTc6XrzjNvYwcBVCobW5lWpjucKaK52FhpZwH58+3x00Pm2t8+s6ldgzlHH GQZhXHL0J1K2TmPOKtycFEPtBl+Bj0yjGxDl5JIOSWNXKShXhDDWwvcbmqrYcAbiotXH c8uEyP9EokAtyokJQJgwFjwpwp2/no4wzMAUyLlfs/gHi8lsSH7EkHNJ6ZSRjqXIKLL/ oJcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YdPW6sbQ; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 95-v6sor1190982lfs.68.2018.04.26.01.53.25 for (Google Transport Security); Thu, 26 Apr 2018 01:53:25 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YdPW6sbQ; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=H5Anx8HHtixBsfJHQkkyvqYQI+3r9uHRYHoqlZJ0xFo=; b=YdPW6sbQPY8Muux5gkatKh561Txo8eyhKxXlPQ8jkQ58z67Q639FkquWzMa+en0XeL DA9GalT/t8Yks8vsnzSB9hhLGn6oEvCHyqz8x3NYrChLmnxv4/rfXTI7R3wXqEhgNg// S1L8IU5RI9UEGk5XLjEc+S0Kgqr4EVd/1K4YY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=H5Anx8HHtixBsfJHQkkyvqYQI+3r9uHRYHoqlZJ0xFo=; b=dbdhDiYhC8RFaSwyZvyOxUe9XZ7bdStpfAcAw3PkoKHWiU1urU24zimHdJO6ni2BVJ 0+a2OymvHDcAGDHFVAOGPSj8Vi21GhCIvFcZ1rHt/yvRkh9SaSuzBh+FdvupefFtpV7x u725c0vD5tp6nXbUdiBbx48tXf+ZPmfETQUH++WFdWbhgtleMdPXbPUUTFxULzvnAPmv gxvkwYSR3pHD+LWedyVxTTPM/qkl1P+HrJ0m9gXo+FSdqJPDIksGxWxWYMN93F2oJDBy cjQGLTepiHWpZdTMk8oW69JtTEZdQcNi7c1SapU4rp6T/JNBYfSMQLbydYv7wO4HKEts 6jZg== X-Gm-Message-State: ALQs6tCzIYVj2Q7wwOSY3fq87cMzlUAj6RT5DBFFM81Lx70F/db+WHTt nzj6EUEN8gvMmlN2wo587Mwe6fXG X-Google-Smtp-Source: AB8JxZq8Upp3SruXHrnUeX4byXevOhdkpWfiIciJPXCcvr+cFZc5+nFzRwL9rxyhIE/fhbS4O8MBnw== X-Received: by 2002:a19:b587:: with SMTP id g7-v6mr16791341lfk.90.1524732805294; Thu, 26 Apr 2018 01:53:25 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u83-v6sm681097lff.65.2018.04.26.01.53.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Apr 2018 01:53:24 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Greg Kroah-Hartman , linux-pm@vger.kernel.org Cc: Ulf Hansson , Kevin Hilman , Geert Uytterhoeven , Viresh Kumar , Vincent Guittot , Mark Brown , Vinod Koul , Sanyog Kale , Pierre-Louis Bossart , Wolfram Sang , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 07/11] driver core: Respect all error codes from dev_pm_domain_attach() Date: Thu, 26 Apr 2018 10:53:06 +0200 Message-Id: <1524732790-2234-8-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> References: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> The limitation of being able to check only for -EPROBE_DEFER from dev_pm_domain_attach() has been removed. Hence let's respect all error codes and bail out accordingly. Cc: Greg Kroah-Hartman Signed-off-by: Ulf Hansson --- drivers/base/platform.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) -- 2.7.4 diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 8075ddc..9460139 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -572,17 +572,16 @@ static int platform_drv_probe(struct device *_dev) return ret; ret = dev_pm_domain_attach(_dev, true); - if (ret != -EPROBE_DEFER) { - if (drv->probe) { - ret = drv->probe(dev); - if (ret) - dev_pm_domain_detach(_dev, true); - } else { - /* don't fail if just dev_pm_domain_attach failed */ - ret = 0; - } + if (ret) + goto out; + + if (drv->probe) { + ret = drv->probe(dev); + if (ret) + dev_pm_domain_detach(_dev, true); } +out: if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) { dev_warn(_dev, "probe deferral not supported\n"); ret = -ENXIO; From patchwork Thu Apr 26 08:53:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 134431 Delivered-To: patches@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1973410lji; Thu, 26 Apr 2018 01:53:26 -0700 (PDT) X-Received: by 2002:a19:1f4a:: with SMTP id f71-v6mr15755399lff.12.1524732806765; Thu, 26 Apr 2018 01:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524732806; cv=none; d=google.com; s=arc-20160816; b=C+jf7M1SZJ8mCim9hpfcSCMCuPcdPPon4+c9F1OaJuHp3HlyLxGNF9zjSQe9XE7njT KRD+9zRevNGWBiaYpDIt1VRfOjsXAFsEHBhwbRIKa4y75i2EZBR+EhuoTcI6qfN4bjEO AiNNouosxzS9hQlBz+fNwiggUNUDGOWDA7UCDTvYUR7UOmEv3SaDYFRBF1/8c5S5yOK5 RPLTcicaVTQzY8aQ8+vstkDLKfbhRXPrc/1ivWyEeWFcvkzOjyG5kGsVQtIh7nJsWozO GJtcBb6+18Y9WDWd5auire82FqOUVJXPRVenX3eky0bbIViik/x37pXIPug4N8JNFpDI cm9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=hU5FXEWc+uiOnBCNzHi77rqnIeKqwSZvkLGgu3DHGbc=; b=i8irMgt1/e68pR9TUovK/LqwJWEyqxqFy+pufuvvwSkflOqrP5nvyxAXHnytSNgmU2 cprXZgIXORHTV15o+/uhbbI5683IIFjVCJGhuqi2zMHcyEX2HTfeJ2aBXIufUbRrYkQu YVsFHI84y6GqMpPu1DMSFRHoqO0eSI+gg9DO2sNLHhKENPE9SeslpCeBDZ+z2sBBx+fl IdjghxCdQ9coPC+/bjw1TfwQbB6s/NlgUdD0MiVx3SEMbKdM0Lsk4EXGgVP+SCz64u9X U66hhcKLwsRDTfuNFzXz4BsxpdDw2M79OSWZ2tGHVaXn9YM/OQY/rCvEnIaVWiTog21e PFEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QhaqIzG9; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id g29-v6sor974281lfi.26.2018.04.26.01.53.26 for (Google Transport Security); Thu, 26 Apr 2018 01:53:26 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QhaqIzG9; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hU5FXEWc+uiOnBCNzHi77rqnIeKqwSZvkLGgu3DHGbc=; b=QhaqIzG9/Wm9QFqAOWMKeTUP7SEbO9cMJy87+BH8Ek0mtJdV94Ktu7otlRxYfj66K7 5Uvg4DJd+zvlk2LqbWywLL7D47doseuAlSSg144Dx7i0OZC2K57FFmOCTf2hsvpI61zt pgXEyZjridNIYiW39fZjdNCYkZfdS9jLlEC88= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hU5FXEWc+uiOnBCNzHi77rqnIeKqwSZvkLGgu3DHGbc=; b=PFvajJwdAMvsDC+c8xySJHTB23lmzdsLYgjsTYy9ys+NORx6YW8MVh9ksWfrzNIjbu Vd2It/1qbiSKYXeFIPHE3MJawe88mf3m7k7pagY2NkU/tbRyS0TB5UEEXpArK7blcu5L GWbedEXsWJI+JC6SSmmtapSOJ2SoaLkmKyjnBFEt6O9NHU/TXfW0tfOOj+fD3rtMjmPW AOOm2QL7gaIpFezCKBGNBVgOElSwJlAP8ypRB1t/WEp0I5gtIkNlHQGE89MOZHVRlqCW ryEysV+KAroiedozRAQkFdppypDvlFNVSNZl/F6XZH/nzmA8d73ER0rtWAD/dKZG7DM4 rFdw== X-Gm-Message-State: ALQs6tBOwuUZaJBWA7am6arD7/2NXAFaVpwX6OKkNkustb33jDiCNbez vif6yCl016HkuKSDR8O8Uj7Y7D3+ X-Google-Smtp-Source: AB8JxZoJgNcglg0Z2vo/HvKrEcTo/CLva2VpGhVnoHZ6oCSVLLaX0T1EUL3fdeUHLPnCdbV531886w== X-Received: by 2002:a19:8e8e:: with SMTP id a14-v6mr17038210lfl.145.1524732806570; Thu, 26 Apr 2018 01:53:26 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u83-v6sm681097lff.65.2018.04.26.01.53.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Apr 2018 01:53:25 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Greg Kroah-Hartman , linux-pm@vger.kernel.org Cc: Ulf Hansson , Kevin Hilman , Geert Uytterhoeven , Viresh Kumar , Vincent Guittot , Mark Brown , Vinod Koul , Sanyog Kale , Pierre-Louis Bossart , Wolfram Sang , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 08/11] i2c: Respect all error codes from dev_pm_domain_attach() Date: Thu, 26 Apr 2018 10:53:07 +0200 Message-Id: <1524732790-2234-9-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> References: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> The limitation of being able to check only for -EPROBE_DEFER from dev_pm_domain_attach() has been removed. Hence let's respect all error codes and bail out accordingly. Cc: Wolfram Sang Signed-off-by: Ulf Hansson --- drivers/i2c/i2c-core-base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 Acked-by: Wolfram Sang diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 1ba40bb..a17f46a 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -363,7 +363,7 @@ static int i2c_device_probe(struct device *dev) goto err_clear_wakeup_irq; status = dev_pm_domain_attach(&client->dev, true); - if (status == -EPROBE_DEFER) + if (status) goto err_clear_wakeup_irq; /* From patchwork Thu Apr 26 08:53:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 134432 Delivered-To: patches@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1973430lji; Thu, 26 Apr 2018 01:53:28 -0700 (PDT) X-Received: by 10.46.150.137 with SMTP id q9mr6809999lji.35.1524732808004; Thu, 26 Apr 2018 01:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524732807; cv=none; d=google.com; s=arc-20160816; b=ea5XcDA8Yajtdhmngsk+EqSQ+tM06MDJo5+cFqycOm+Grs35iJUQnB21AuCO+jq9hx dQTFSMqrD5KSm8TTbTI97y+bThJsBFbp64bMQM2fGk5kE2hd/axONLZkd9BWlvNBeBLP Os/Yy1bRC57lBOsSvKxM9SEUQQq3W50z84XITG5uuDrdsWYV7DSUhs0KH+Bm559NADhK FZkNK+bgBIBdPZSA7Pi5ELi7lEGIoeSkdNnWDNgcbFcbOdbelTHU3d7bSpEgYnRjlgg4 ZpG1zVS1m+/llmdvUaGw5X2w2Z+DflQGz5lmnxOGFeG2l7SFHi1eZVCn0dMtdOvG4k/+ RYPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=1maFe3CUWeD8N7WGQ8g1FblEYpZX+jN7LBKPNpZNBvQ=; b=WsNSMd5Kk6kpjsoCZFAbmPci3LggDmqQrn9Y1TX/ZW2LN6MAj/d+ZT0Dx9qKQCbxWT YE+vjzh9TKo6tBK75pw0mruZaKYaa09aFOn9cyNJ0JoveXeThCDAVfSJhVipJfj4Lw5c us6pZS0ZoLu18j8b0nT/hRIALqOxnqiW0MkwJnbyREYWx6c9/geAV7pJdZYTUjkjenHd XNjEaLx1O9HDadcgFHaVByQ/oBzwT1pnSRSYhoYbdP3yhSOY4HT2C6P3aigzUb8sJPmM EP9kex1+r+wZK5dJ9vVpy79O6oZCwCRpH3H8J0UkbZuala+ij+QaInQ/mgvNGOAQvFuw IRAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BG4mqMK5; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id u87-v6sor4552687lfi.12.2018.04.26.01.53.27 for (Google Transport Security); Thu, 26 Apr 2018 01:53:27 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BG4mqMK5; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1maFe3CUWeD8N7WGQ8g1FblEYpZX+jN7LBKPNpZNBvQ=; b=BG4mqMK58a3SBlxP01HoNqMQsN8lKv5VEcNA+IZ25wX2o+f8aQXkUyKBjeF81f4Ugr EaNrTSPVYpgoUdL+4iV3bLR5foiVeICFZh2g95RoqelkS6SsAwIB1SwgO9yVRftWYa16 Y68v0k38hi71CEKz0tIPsZzylQbQKkS7FvT44= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1maFe3CUWeD8N7WGQ8g1FblEYpZX+jN7LBKPNpZNBvQ=; b=qrCSJDbzjKD3dMpZ1in7wz7242PSEwXBlUy5lpnrs9aTNJv44ql+FV6nOkGQ1Sa1KH Wh1pzlXVuIUzDbsb6WG/l1U/7bZSGqTPIX1VvWqsiubnjO+3UWTJ0jMdVVw13MqwwHxE W8ahGVjUFGowkRTdYMFhbd9dF+Lz5GVtngQRtN1Ib1o51rHfEPLkC6FOM9ECdh29n/f9 JtFyLSjFPKxXkALyUh20BbVmKy022N1R915uvin3cIpYugM47SL6SLzBCGZ5LRSW6L4E 3MYJCfX4lfkER4/5RI+KxATXNKqZsweUjUGIPXwFZmUFdzBVYZU1wL3ecGImAlS9jApX xMqQ== X-Gm-Message-State: ALQs6tDdcjFAQnrBxedRjhdNsh4tATJtxAWrtVzYJBg8FqyUnpufCHpS iA3UnK6BTpcYvHqThKC/Sh0k/pux X-Google-Smtp-Source: AB8JxZoJG4RN8QM8LiaL9OTrpNuu/ioadGRH78XxkRMh74fyKk4+BBlx7cOyuCpc7EdO+OTdy9Jjug== X-Received: by 2002:a19:2bc6:: with SMTP id r189-v6mr15292935lfr.24.1524732807800; Thu, 26 Apr 2018 01:53:27 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u83-v6sm681097lff.65.2018.04.26.01.53.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Apr 2018 01:53:27 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Greg Kroah-Hartman , linux-pm@vger.kernel.org Cc: Ulf Hansson , Kevin Hilman , Geert Uytterhoeven , Viresh Kumar , Vincent Guittot , Mark Brown , Vinod Koul , Sanyog Kale , Pierre-Louis Bossart , Wolfram Sang , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 09/11] mmc: sdio: Respect all error codes from dev_pm_domain_attach() Date: Thu, 26 Apr 2018 10:53:08 +0200 Message-Id: <1524732790-2234-10-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> References: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> The limitation of being able to check only for -EPROBE_DEFER from dev_pm_domain_attach() has been removed. Hence let's respect all error codes and bail out accordingly. Signed-off-by: Ulf Hansson --- drivers/mmc/core/sdio_bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c index 2b32b88..b6d8203 100644 --- a/drivers/mmc/core/sdio_bus.c +++ b/drivers/mmc/core/sdio_bus.c @@ -139,7 +139,7 @@ static int sdio_bus_probe(struct device *dev) return -ENODEV; ret = dev_pm_domain_attach(dev, false); - if (ret == -EPROBE_DEFER) + if (ret) return ret; /* Unbound SDIO functions are always suspended. From patchwork Thu Apr 26 08:53:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 134433 Delivered-To: patches@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1973457lji; Thu, 26 Apr 2018 01:53:29 -0700 (PDT) X-Received: by 2002:a19:434c:: with SMTP id m12-v6mr16741884lfj.120.1524732809238; Thu, 26 Apr 2018 01:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524732809; cv=none; d=google.com; s=arc-20160816; b=CefIRpA1X9nClgc3B9NgOOj0wkKbNUoGef0W59hHMbSuzOng2ocZStZ8lzOlwD+ymo /us2jq3Yr+0PrIxoz6aRmVZyrpX6zHn8ijREkKzKs0Bt6pQymz8Mr3XaO+sshXSSsbIs C7MrZEZTasdBRHHwdTUYOYTDIM6v5hlOSeV9fs4KZtlk4FG0KlsVpBH8BPC8/j1No9dY nQqdNvIBU36op3Xh29nZrcNe0NYU4Ywz8eE2tid0b3yj6097Fa4NhWh69hwI80Likm9z M2Q/QeT5rD+FV7TlBNIOe0cYpT189wYrWub5GBLplUi4cyTkc4CiAcrQ5YIHNwZ+WabY +qPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=rlrpHb/IeX5xP3SDTjra/zpY68YkXnTDM31XH0nhg+w=; b=JNCXwToErg3tY+UYSZcpvbggpywJQPw9bR/VYOYXBvQvJYHtn+vStKnRbK/Q9dZZkD KEbwCzfhhXUdGBDsJPr9mACihtjGxqYGaU1Mzt8xmZqe6rIkoy3qVpIWGBEAJVvvcuZH E5vf2xQ60CrXKbot+GIfonPcMqCcamphnx/qzj/Rx3aiDUEGFbwuuSiQU9r2UFLW/QhJ WTggRacfdpa3Wesx74hezhFqz0WWc6sJRq3HzPLsJ0noRz+hmpS3oeVbKb89kP/yJ8mf BpytRvZccw6NHH0hXi3NXcsK73XkRmZitUflUFVR7IDutIQFt3u9gUjLM4HLAJcTBPS9 YxTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=erboZ726; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id r10-v6sor4305471lfg.2.2018.04.26.01.53.29 for (Google Transport Security); Thu, 26 Apr 2018 01:53:29 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=erboZ726; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rlrpHb/IeX5xP3SDTjra/zpY68YkXnTDM31XH0nhg+w=; b=erboZ726gLb32PLZTg+zkx7X3M1NsEd2Otmi4MtLIBl3FQu2qsH7HMyqy7gOY0SR1h Ztof8dJRE3lAPsjQgjMQR8jGHKjRKqeDmJW5ZnLfam6z+EcJMru4RBZ1wm7kU6t7TDmV xXrEujyGJp6nko5wdATO1OR8cqgvGnCGmYo2E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rlrpHb/IeX5xP3SDTjra/zpY68YkXnTDM31XH0nhg+w=; b=DuBry1Vi7FGPIqy/tUjc/dURGXjo+Mm5u+yudWSfruAYH5vxjNYoNZ4ZRu2u+Frntt RFfOuoCVrZlMtsdtK58taLm6V7+tTgIf+FRYYPUpaLlEmVUYJy7e/cavTdBvhr8d7Rs3 xSL2LkMzhBgTqolkEoK1jD1Vb2FUHO4UluAAbwMAOc/96fSL0rvopc/ZXq9MLJ18STI6 PdmrmdNSx9w7z3X0xWhOz65OJke4HZbLRvZt5G6jI97wvwGefWfm3EXCVGbn+TNXESI+ c8OmZOkqEo6wXTR7csmzMRfGeYWyNWSvvrtczt2WTqnxXvD5/kQ1SK6DkXPhi1h+CRsT dPzQ== X-Gm-Message-State: ALQs6tB9xND3ovdOIhjWTfoF42KxBsDSBuIeSBaqNoRYzo4c7snYy6bt iCb1i4X/PiapjM2sckHgN20+K8yS X-Google-Smtp-Source: AB8JxZo4zVxcacJ9yKjlB/IJFq/AqR9WWf+d4AGgC5HSHcYgPfMP7Tn5imDu+bDc+/qfDi1F25griA== X-Received: by 2002:a19:8dd4:: with SMTP id p203-v6mr3651009lfd.137.1524732809021; Thu, 26 Apr 2018 01:53:29 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u83-v6sm681097lff.65.2018.04.26.01.53.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Apr 2018 01:53:28 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Greg Kroah-Hartman , linux-pm@vger.kernel.org Cc: Ulf Hansson , Kevin Hilman , Geert Uytterhoeven , Viresh Kumar , Vincent Guittot , Mark Brown , Vinod Koul , Sanyog Kale , Pierre-Louis Bossart , Wolfram Sang , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/11] soundwire: Respect all error codes from dev_pm_domain_attach() Date: Thu, 26 Apr 2018 10:53:09 +0200 Message-Id: <1524732790-2234-11-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> References: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> The limitation of being able to check only for -EPROBE_DEFER from dev_pm_domain_attach() has been removed. Hence let's respect all error codes and bail out accordingly. Cc: Vinod Koul Cc: Sanyog Kale Cc: Pierre-Louis Bossart Signed-off-by: Ulf Hansson --- drivers/soundwire/bus_type.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/drivers/soundwire/bus_type.c b/drivers/soundwire/bus_type.c index d5f3a70..283b283 100644 --- a/drivers/soundwire/bus_type.c +++ b/drivers/soundwire/bus_type.c @@ -83,17 +83,16 @@ static int sdw_drv_probe(struct device *dev) * attach to power domain but don't turn on (last arg) */ ret = dev_pm_domain_attach(dev, false); - if (ret != -EPROBE_DEFER) { - ret = drv->probe(slave, id); - if (ret) { - dev_err(dev, "Probe of %s failed: %d\n", drv->name, ret); - dev_pm_domain_detach(dev, false); - } - } - if (ret) return ret; + ret = drv->probe(slave, id); + if (ret) { + dev_err(dev, "Probe of %s failed: %d\n", drv->name, ret); + dev_pm_domain_detach(dev, false); + return ret; + } + /* device is probed so let's read the properties now */ if (slave->ops && slave->ops->read_prop) slave->ops->read_prop(slave); From patchwork Thu Apr 26 08:53:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 134434 Delivered-To: patches@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1973478lji; Thu, 26 Apr 2018 01:53:30 -0700 (PDT) X-Received: by 2002:a19:10c1:: with SMTP id 62-v6mr16787581lfq.76.1524732810669; Thu, 26 Apr 2018 01:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524732810; cv=none; d=google.com; s=arc-20160816; b=pZecdG80ycm3iMHcZkAQGCSofd1dO9BLPqIL01TB+igPkpZ2B3kXpFazB+AjwgFMBh prU6sUWvi6HY1bmhGdKIYr96jP7G4vLarXueDDKCDA9rdGooK2JcLhLmFLfY/x853Wby KrzAoyDBQb0uiAdurvTxScyRCYEbaRAdCP1+zOw844ZuU6HY+Y5q5gXg+enQqxwX2U8k 0kMWJabSj6F/JEcg0i1kL8il6TuzQiygYa5+SCVvEkJOkqKvaNwwhUjasQqRQcdg9nfC uBKSzsZdD8jOUHwIm25UQ0aS+V5549xgsaMKoRk0lkaV+L6Tk5zvqDZxDTQPGXhEeEr6 78dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=4qRjfjcsNTisdPc2jK1jipH7JeqOKH7dML3l+Hiob5c=; b=FK33/A0kHM/ypzKDr1Vyn9DZqhqkG/5WJeTaHSb75P9nOjrQ4Ka9KugvCJHAPviQYK Fea43GniAsAAJwYZjXmf32eusoCP5zVsuQphdcMjwhF/GpkGFoyxnK6ErbN6NQmEQWnO HpFy+MbZZjw76soCNWokmRRvxTJxW4njBh28kLtvzWIS82I4GT4Wvx/A0NOalzNsD5V5 vvGm3cd5NerL/JNyjhf5HpET9qjrU/oNy0G0RY+93AIPbpb3/lXD6tt/L3DUXVCugibv bBVg7qbRkIB81HVLVZQZ9pZrEqHTgtrM6nO6v8exEZRrGHA5NVLEz5R48LzNgofj/uAK mL+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cr+cY3A4; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id t142-v6sor4569226lfe.52.2018.04.26.01.53.30 for (Google Transport Security); Thu, 26 Apr 2018 01:53:30 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cr+cY3A4; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4qRjfjcsNTisdPc2jK1jipH7JeqOKH7dML3l+Hiob5c=; b=Cr+cY3A453fhyYe6SnBd+HXPJoxr1ZAjXPrKlbWCjDFHpolEbfuqV5Z6yBE9OMYpAX AaDJWruyyCIxaJxD5ncc2uOo2j6y1DpgQ6DW+7FSffZHIzs3y7haaCEke+K9Gfp+1uio gTAQx3zWR9bNEIEIrRCfMz+n3K1JMKg1WX3r4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4qRjfjcsNTisdPc2jK1jipH7JeqOKH7dML3l+Hiob5c=; b=Prl70nfi14hW7yp3WjBkSIWniA4e/MuvAJNaVZL1AdH3BkcEJ2yAYHvObvmi24LFOY BOkCEkJ96HMbKc+Q+1bo+uovi+jNN04UU+YvON176CydxB9y25U2MkMVDRm6wAp+AUp+ cilUmtgYVJUxfxEEfyTJ/OWfty/crN+wJGsQiUvzD530myGOwmcKBLfg8Ol4PS2DpnsF AIcvXpLwVZj6EBuvsv2riLfZifzxbKGyEdsF80tgp3i0vgmmq8562g+Pr+bp9xUfseKF b5D2P1nLZ3PBqdCaAi/qlB/KpHOkeQEJAalneo4puEp3PLXGVoidWrKxINtKjhnuHsQ+ 7tuA== X-Gm-Message-State: ALQs6tDZVu5KonVdbiNbPVVBy0e5DE86aULl7KIk+pslF7Fnl4iRAcSc wJcG3p5RTkbXH2WZPk+2A6LFjtfw X-Google-Smtp-Source: AB8JxZr0FO6Dc/su+Yv7xk87b2fh/iPmzRVQyBUX/0+XYx44xeHrK+u+tntfi29r1fL+O9Zg15yaOg== X-Received: by 2002:a19:8f06:: with SMTP id r6-v6mr17093851lfd.56.1524732810431; Thu, 26 Apr 2018 01:53:30 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id u83-v6sm681097lff.65.2018.04.26.01.53.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Apr 2018 01:53:29 -0700 (PDT) From: Ulf Hansson To: "Rafael J . Wysocki" , Greg Kroah-Hartman , linux-pm@vger.kernel.org Cc: Ulf Hansson , Kevin Hilman , Geert Uytterhoeven , Viresh Kumar , Vincent Guittot , Mark Brown , Vinod Koul , Sanyog Kale , Pierre-Louis Bossart , Wolfram Sang , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 11/11] spi: Respect all error codes from dev_pm_domain_attach() Date: Thu, 26 Apr 2018 10:53:10 +0200 Message-Id: <1524732790-2234-12-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> References: <1524732790-2234-1-git-send-email-ulf.hansson@linaro.org> The limitation of being able to check only for -EPROBE_DEFER from dev_pm_domain_attach() has been removed. Hence let's respect all error codes and bail out accordingly. Cc: Mark Brown Signed-off-by: Ulf Hansson --- drivers/spi/spi.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 7b213fa..eeab67f 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -356,11 +356,12 @@ static int spi_drv_probe(struct device *dev) } ret = dev_pm_domain_attach(dev, true); - if (ret != -EPROBE_DEFER) { - ret = sdrv->probe(spi); - if (ret) - dev_pm_domain_detach(dev, true); - } + if (ret) + return ret; + + ret = sdrv->probe(spi); + if (ret) + dev_pm_domain_detach(dev, true); return ret; }