From patchwork Wed Oct 7 00:19:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 315374 Delivered-To: patch@linaro.org Received: by 2002:a92:d603:0:0:0:0:0 with SMTP id w3csp1028286ilm; Tue, 6 Oct 2020 17:20:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwShzbEoCvTC04E06kN6TCEEHqm1kAZ7c40dr7iCK3WLsNVdnbHzAwfK3gSzgEJ65hH1oXm X-Received: by 2002:a17:906:3ac5:: with SMTP id z5mr659864ejd.46.1602030013339; Tue, 06 Oct 2020 17:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602030013; cv=none; d=google.com; s=arc-20160816; b=a8GILL4blpTeDQ+vJygbN3dp5F/rytpFMcP3ocCn0RSC5EIftJ64LKQ2Q+Etw5Kko2 EraLAIIxeuxjes121dErIB7hBcwYhcV+Qlrkzj7kkgT4odBPa0AqBaQF5ixELkY3Y1Nz 86FqAtZ3X+aB+Ua4XSnhUPbVT1LEkgWIpaacw0ADXWA/4GktAw4X2+FsfayubnZ4hnZx zZ5cLD1DKIgkxYZsTei0abFlP4sl8IKY5RUj5Cks1kAtMBNdnxMOHC29dwRBT+GQnMem +m1yjSHikQ7RvHPHybgE32nGcykf2cwcup9cBU8X/cAsBEqyV1JMsUAl3lv6bwnjkRfT a3ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=CjEUI/O5nyKq05nG1WVXTi7g9bQBDlF9MtDWFFyQoGY=; b=D8/iI6q0Yu6YgOyeAPQH6kYhL4+pl75ompVAk0QTVX1oB6Nu5uT63fzHNa4uPeKu77 NjHYApMSH306h6/2OR2y2/mKj21X8RhFGMQaWQ8AR/7Kb3c0M5vZRsqqxHwlD20zsZxM A+IJB0yxlluqlSui2SRinBNxTYMDI8KzLUdknkRtNzA6+Uytej3+WkJ/NT4fh9frKHYM 7YCaiKmutGFrmyQsoZ7qo24DEqoaMZgFcGfP/0wtvMS5UdoftGNZdsQL8HtoVkCmRmzY pONjvsGD2nrJwNjziUxYUlLQgesfw+1zplVX5R/WbwYpVAaVyIUrGaFarthYC/wjdIL8 QL3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=szmKAa4h; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f3si275103ejz.386.2020.10.06.17.20.13; Tue, 06 Oct 2020 17:20:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=szmKAa4h; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726719AbgJGAUJ (ORCPT + 9 others); Tue, 6 Oct 2020 20:20:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725996AbgJGAUJ (ORCPT ); Tue, 6 Oct 2020 20:20:09 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C682DC0613D2 for ; Tue, 6 Oct 2020 17:20:08 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id e18so146007wrw.9 for ; Tue, 06 Oct 2020 17:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=CjEUI/O5nyKq05nG1WVXTi7g9bQBDlF9MtDWFFyQoGY=; b=szmKAa4h1nHPyu9kcgwhbnZwdWEom7YpolFcRBsSoQqYFmkDojdFrkPBDrQ6P1b1OE SDL4RKZBrZwXqPHgUvMGkC1lAl2laNSh3a+GQ9VABKqDmqmF/uCP7XgqLFoN3xuptB64 0xb/cb3LTEyj24Lsv9JQqC9fac7s5gq/WWSJVWrWFsTgwMxzXEQNPY+FEQJ9GsXNmhL7 Tez0OXL6tqaAQFOTNU60zjq9hfbFnHrNgCLoYtFggR0g4U+AX+JvNGhX3oNh/qE1Dw8g CrNjetASxcd+r8aXNDuXkHLvjaQZQPNOK7cdWpSczqXMBga/9flrOAJKfw7vayD0r54i J7xg== 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; bh=CjEUI/O5nyKq05nG1WVXTi7g9bQBDlF9MtDWFFyQoGY=; b=mcdEel5VxEhf8fuI9PiMk85zYe/WQE+l/1gM49KRZMg+M+NN3+4DQ+bxj+IpU6i/eq Gs+rNb2J2qcIvQqIhKjGxrdYQs52YGeSNr8+xKSEUgA+MEG+3uLjvQK9SD0fR/+uECQg sTrMj4xfmqi1cFJUD0FbdTMmMyyq2Zu17YXjmw14aJNnMAyhoC9TOQOmWXShO5nPBa4Z sfYHzjmjZRPtUMmWD/SPCvmiJUyib0SfzVEkxPRuo+k6+tavnNpRKz0sgzPGCsdihWBS H64d95sChGmeUaOm6Sd/jlPDk6RdXoVRGSkK37j4ixUFgk5GfSwbIa1FB2yoFss0/OPS Ds8A== X-Gm-Message-State: AOAM531QCEC5RU7+lyA/yvUxeZ//tZ6Y2LsKEhqYqkty1tnMVt9nXYjT iythkiSZrv8DzPWbakFRjHdJMD3gz3zRzDg7 X-Received: by 2002:adf:a418:: with SMTP id d24mr470329wra.80.1602030007166; Tue, 06 Oct 2020 17:20:07 -0700 (PDT) Received: from localhost.localdomain ([195.24.90.54]) by smtp.gmail.com with ESMTPSA id 142sm402650wma.14.2020.10.06.17.20.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2020 17:20:06 -0700 (PDT) From: Stanimir Varbanov To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J . Wysocki" , Stanimir Varbanov Subject: [PATCH] PM: runtime: Use pmruntime sync variant to put suppliers Date: Wed, 7 Oct 2020 03:19:34 +0300 Message-Id: <20201007001934.18606-1-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Calling pm_runtime_put_sync over a device with suppliers with device link flags PM_RUNTIME | RPM_ACTIVE it is observed that the supplier is not put (turned off) at the end, but instead put asynchronously. In some case This could lead to issues for the callers which expects that the pmruntime sync variants should also put the suppliers synchronously. Also the opposite rpm_get_suppliers is already using pmruntime _sync variant of the API. Correct this by changing pmruntime_put to pmruntime_put_sync in rpm_put_suppliers. Signed-off-by: Stanimir Varbanov --- drivers/base/power/runtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c index 6f605f7820bb..8dab4fcab4e8 100644 --- a/drivers/base/power/runtime.c +++ b/drivers/base/power/runtime.c @@ -313,7 +313,7 @@ static void rpm_put_suppliers(struct device *dev) device_links_read_lock_held()) { while (refcount_dec_not_one(&link->rpm_active)) - pm_runtime_put(link->supplier); + pm_runtime_put_sync(link->supplier); } }