From patchwork Tue Aug 10 19:26:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 494376 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp4264397jap; Tue, 10 Aug 2021 12:27:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjKjhuw0z5Fe3aek0+A1JQlpIGWUhjpaU9g8A12PmQiJo8lo/Anr6PxdwwWndr3off7lU9 X-Received: by 2002:a05:6e02:1c2a:: with SMTP id m10mr120590ilh.114.1628623631481; Tue, 10 Aug 2021 12:27:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628623631; cv=none; d=google.com; s=arc-20160816; b=b6eLVswdnxz+RFJgjSjJ8e4gyMAK9ZjlZQoIJU/w1R1nlpeQ2iJzg/UTxdC927Qh7C VuPZfb4YPuWjaIFOGFMiI0l7lOQdiGshKPHrLjMuzpI+G4tdZJC2Q3nVuKC4FfXXpT4p ZEh8o7TLanygsitMfoscjkxIFVvV21OGSLWGg9Q6KlIu+0rrfXNtDi7oGKUORWX3Mp+4 ekTc0jJ8vhOAuRf5IGGR8hSAfXMT6PCOrIlBYl+RAk97VKHObHbg52efhaSCPwpYUOoQ kXJjbvvcoz4qc3VbeXWrfIS+luF9ZYcKRzK5+DWEg3zXLlJ9BbWFOqEyQDHMDtF55wfW pI3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=sACdsDyDQsF4yV+XkTB5JJNrhLHQe5xnvwvES9nsAV4=; b=FI3tGn9Lqy+MRezN96kfXl3gnuIRgt82O/plQh82C7H/ponLAQUXEzaJasqkA6Vtdm u49rpPTbB8C8eAfz6wrzPQqyISnMpCvNWTg7soUjll8FYcURZA1D4+G9H273AW6GF6cW RMNHoHo9+erksPYEWZN0zJrwy0jJtjsMSJ04wgrl3FKWZJNyp1S+XMZ9d+4LZmhhSgiI WBPplYXQlxOfXKxMVW+1DWF7BMzqXGLY7OQUkKqo7Z/6Jv2wOd35MwQPqaaotsn0P01E WMGAAoE2oXRP/YJ+FEdOxmceY8x5IgySJSZpjfP3lf+lzDmuMn8lzaH9uLxC1woR6NGk xxzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wvgoQqvL; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 h15si22116369ile.62.2021.08.10.12.27.11; Tue, 10 Aug 2021 12:27:11 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-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=wvgoQqvL; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S232508AbhHJT1b (ORCPT + 8 others); Tue, 10 Aug 2021 15:27:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230442AbhHJT13 (ORCPT ); Tue, 10 Aug 2021 15:27:29 -0400 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91037C0613D3 for ; Tue, 10 Aug 2021 12:27:07 -0700 (PDT) Received: by mail-il1-x12c.google.com with SMTP id c3so199016ilh.3 for ; Tue, 10 Aug 2021 12:27:07 -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:mime-version :content-transfer-encoding; bh=sACdsDyDQsF4yV+XkTB5JJNrhLHQe5xnvwvES9nsAV4=; b=wvgoQqvLEvW82Em5I64QcTOdjmrmncOcgqsxT1p7oqQ2uHkKHTFqet7M2MLzmmnRpV QmLAajHimETprqe/kHTqxzgQFmWwqu6T8Qk/+2dOpEEaxMUHQTS34FYN1ee5c+7SHp/v 5IkCwNJz+ZK3CuDbPh7nGdN+uihg2GV5OpC+X7PdJM4TTs3fnUccuOVXA9UYJlP5YnQT 6nKijHQQBoGZ0pdeVEeVk6RdwN1WfC/f42+CiCNgTflDRww31xDtTu8Q6NvhRXXL7REa w3YGIOu0E5Wb2I50MweGiBG9oh9pM1iL4aBeC4Uvib+4gNFSw0pLWSV8oqy4ZP64mKeO sdQg== 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:mime-version :content-transfer-encoding; bh=sACdsDyDQsF4yV+XkTB5JJNrhLHQe5xnvwvES9nsAV4=; b=AHZxm5fcr42zBxZ+0g729pLfHFFjoPT8rebu/fM6j46LDA+LlEH4z9aAi+9qnpSG1G qHYyILmOi1dIN0iQ2IWxO7GS5t1g9RD7cnJ9ivce5vE+64zE9VjN17Sl7ogL3FuQ77ZV 81l5wsyz2RAJVgAonAPLJXYE4PY6uxgWNA1DUQBKlP0R1nvLfbEtd9VH+ZbJQTphS9ip gQDcSBJz3Jkek0TDUTQizHVnnCTV68SnVXBkVB7Nx+0ha1psRmbpucFpy73EX9yv6Bly RIKVV/O5PJaBVaKHAf5+NN57npnPqO40Sp5TX5gLpyXIHVUrDmBGlhp0oi7jRSyDT1Hu 39Ww== X-Gm-Message-State: AOAM5337dxVTAbCAxofHD6RLVQb9bnB2fy0sY2FUEm3ed6hSPXlqAFlP nJijYAqhxsX7/GZFaVvrgzB9Dw== X-Received: by 2002:a92:6e12:: with SMTP id j18mr671211ilc.243.1628623626983; Tue, 10 Aug 2021 12:27:06 -0700 (PDT) Received: from presto.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id c5sm3025356ioz.25.2021.08.10.12.27.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 12:27:06 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: bjorn.andersson@linaro.org, evgreen@chromium.org, cpratapa@codeaurora.org, subashab@codeaurora.org, elder@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 0/7] net: ipa: use runtime PM reference counting Date: Tue, 10 Aug 2021 14:26:57 -0500 Message-Id: <20210810192704.2476461-1-elder@linaro.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This series does further rework of the IPA clock code so that we rely on some of the core runtime power management code (including its referencing counting) instead. The first patch makes ipa_clock_get() act like pm_runtime_get_sync(). The second patch makes system suspend occur regardless of the current reference count value, which is again more like how the runtime PM core code behaves. The third patch creates functions to encapsulate all hardware suspend and resume activity. The fourth uses those functions as the ->runtime_suspend and ->runtime_resume power callbacks. With that in place, ipa_clock_get() and ipa_clock_put() are changed to use runtime PM get and put functions when needed. The fifth patch eliminates an extra clock reference previously used to control system suspend. The sixth eliminates the "IPA clock" reference count and mutex. The final patch replaces the one call to ipa_clock_get_additional() with a call to pm_runtime_get_if_active(), making the former unnecessary. -Alec Alex Elder (7): net: ipa: have ipa_clock_get() return a value net: ipa: disable clock in suspend net: ipa: resume in ipa_clock_get() net: ipa: use runtime PM core net: ipa: get rid of extra clock reference net: ipa: kill IPA clock reference count net: ipa: kill ipa_clock_get_additional() drivers/net/ipa/ipa_clock.c | 165 +++++++++++--------------------- drivers/net/ipa/ipa_clock.h | 18 ++-- drivers/net/ipa/ipa_interrupt.c | 9 +- drivers/net/ipa/ipa_main.c | 35 +++---- drivers/net/ipa/ipa_modem.c | 15 ++- drivers/net/ipa/ipa_smp2p.c | 33 ++++--- drivers/net/ipa/ipa_uc.c | 12 ++- 7 files changed, 121 insertions(+), 166 deletions(-) -- 2.27.0