From patchwork Fri Feb 23 13:39:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13569111 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 577C17F460 for ; Fri, 23 Feb 2024 13:39:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695578; cv=none; b=gpPr9PA2IC9aJXQxUwf1y6DaVBPTmqAnGUS9YUlNL+qLWRT3Hq09y6M2XOjpAxjUHFFdkQ3PY5aK87XcT98L1sPPmq4kWqVN2OxbofMcCJ+mNHmAm+afBfM4MyEOz+pujaoF38W2/BbRQ9O/4W4Q4OoXQvFcEHSmtuNTmQkZr3E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695578; c=relaxed/simple; bh=Otvyd2MsHFXrOkwOQxydra3hVlb5u0R7qZzhz2ed4Fg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=j6XBgIsKxXIqQO66FQrP6JFUCJsb+FICNV0N38X64PTu6DJViuxwmb14vJR+eivQJOx9q8g2JyA//OvSN5JeSIywPCQfi18dFaOC5RBU08ZSWZ76KIvkKfxpO9sItID7Wpmgag4ZasuDS9xJhEDMeZAgNnx17Dr6EvlCL9jAQyY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=VLKiRBzg; arc=none smtp.client-ip=209.85.166.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VLKiRBzg" Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-7c48ef54d9bso16430039f.2 for ; Fri, 23 Feb 2024 05:39:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708695576; x=1709300376; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4sNCG7M726gTL8Llpt0gPnGSGC/YST1sdl72eg4G5Bg=; b=VLKiRBzgsXBoGMWuamMRqaGfTHGG8SO0OxUfmPDhgyQ3NsW6XCbzLLKKCzFyS5AzxE S4WbOHdlUTpC5jzdAnevEepD34WLCQimM9oRAbHpJ6tXugWbaACmmpGJ+NpaUhHAF0lx di4Erx47MtqTjLgAZt30Pi59a/9Q3jHlaR/V5i4FSAIt26locSm3lIUBtV7JjCglCpnb 2aun2UBD4bLk6mMLVjNJQXTKUVRVoZwzdmtFk3Nqepzl3eAvbF26LPj7H8RCg42NHy3e aPXjLsyk/ENS9VPeOZOIDpYaqPhpg3hC22uPAJGWUZuoInG5PRyRgUBcbuV7H8vwBltK zYAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708695576; x=1709300376; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4sNCG7M726gTL8Llpt0gPnGSGC/YST1sdl72eg4G5Bg=; b=Bjo5xQVJJ8tWmoVr8d9wrZTQtRzfIATc06QsRCG+79z8QVHYn2hmlf+91vtUmRcLee 1vAteG+Z9Bb3tSqArQKP0sy/dsVC931xmeJTQl4TdGN3fCrcK91rQQ8fbQGOM9GzkFC0 pq9FCyF2+6JYuQVbxksK6zavvhxUHEiP7fc4XrUwdSAmHcGEe8yyRJM6A9TXW4klBu/6 /iNTbl2M4gvnqNw5oh/RPLafqxa0zXF2z+3C8n9Lqv0YWIRxwaJeVXTnuJKq/wjIwcNZ GgkxARHI5OLCPlBsLgJ5X9Hq9svW4nV6QmRBFm1u6UQZI/F28LhlTibbFI0KBsd+7i0y RVZA== X-Forwarded-Encrypted: i=1; AJvYcCXZk61tbM3RQweynnL7LZwSmTU4E1G8XtJbSh+1QLdFp0PLPdwcdv5Gg77++xbgj3ZYnN5vx4WOxD7Ak7k2AcpiubnHRD+O X-Gm-Message-State: AOJu0YwkNjZ73L3A76e7dIg/+juAx2LeyXkVFAI9mWKWNMH2opPzbIRu JKJ7IQD57TC15AaHc5KLeRlyGla92VtIS4lJMvTY3R2ekMfgngchCdO183EL9Rg= X-Google-Smtp-Source: AGHT+IFxeXcd7g/tpcSglbnwOaRKYbO1Bk6zlg6uSwPZlSClK9s0o9j2TzDIYcP5g5NFpgyuBrvtBA== X-Received: by 2002:a05:6602:17de:b0:7c7:8d94:583c with SMTP id z30-20020a05660217de00b007c78d94583cmr1874917iox.16.1708695576302; Fri, 23 Feb 2024 05:39:36 -0800 (PST) Received: from localhost.localdomain (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.gmail.com with ESMTPSA id p11-20020a6b630b000000b007c76a2d6a98sm1836838iog.53.2024.02.23.05.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 05:39:35 -0800 (PST) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 1/6] net: ipa: don't bother aborting system resume Date: Fri, 23 Feb 2024 07:39:25 -0600 Message-Id: <20240223133930.582041-2-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240223133930.582041-1-elder@linaro.org> References: <20240223133930.582041-1-elder@linaro.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The IPA interrupt can fire if there is data to be delivered to a GSI channel that is suspended. This condition occurs in three scenarios. First, runtime power management automatically suspends the IPA hardware after half a second of inactivity. This has nothing to do with system suspend, so a SYSTEM IPA power flag is used to avoid calling pm_wakeup_dev_event() when runtime suspended. Second, if the system is suspended, the receipt of an IPA interrupt should trigger a system resume. Configuring the IPA interrupt for wakeup accomplishes this. Finally, if system suspend is underway and the IPA interrupt fires, we currently call pm_wakeup_dev_event() to abort the system suspend. The IPA driver correctly handles quiescing the hardware before suspending it, so there's really no need to abort a suspend in progress in the third case. We can simply quiesce and suspend things, and be done. Incoming data can still wake the system after it's suspended. The IPA interrupt has wakeup mode enabled, so if it fires *after* we've suspended, it will trigger a wakeup (if not disabled via sysfs). Stop calling pm_wakeup_dev_event() to abort a system suspend in progress in ipa_power_suspend_handler(). Signed-off-by: Alex Elder --- Note: checkpatch warns: braces {} are not necessary... drivers/net/ipa/ipa_power.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c index 128a816f65237..694bc71e0a170 100644 --- a/drivers/net/ipa/ipa_power.c +++ b/drivers/net/ipa/ipa_power.c @@ -220,8 +220,9 @@ void ipa_power_suspend_handler(struct ipa *ipa, enum ipa_irq_id irq_id) * system suspend, trigger a system resume. */ if (!__test_and_set_bit(IPA_POWER_FLAG_RESUMED, ipa->power->flags)) - if (test_bit(IPA_POWER_FLAG_SYSTEM, ipa->power->flags)) - pm_wakeup_dev_event(&ipa->pdev->dev, 0, true); + if (test_bit(IPA_POWER_FLAG_SYSTEM, ipa->power->flags)) { + ; + } /* Acknowledge/clear the suspend interrupt on all endpoints */ ipa_interrupt_suspend_clear_all(ipa->interrupt); From patchwork Fri Feb 23 13:39:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13569112 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F42A7F479 for ; Fri, 23 Feb 2024 13:39:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695579; cv=none; b=Wfg55I/rLkFSqXPsR3A0O2d574eiXbqqcj7B6fYhyhnEfRSJa0AGXiKn8aptIjkR9hI8sXvlYhEdPs8jMRik/6SPU69Ct7XmIfgumzgIxF9edzL2hiXded/uipqR/ReMY782YxKEJBBk0LJgCK6nDCEhMXyDl0eSj3K0xH2JZNU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695579; c=relaxed/simple; bh=voB5J/gWI489fiUoN4WmnD8Oq5taa5Y4VccTJXCT+QE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Rsr4HqA17Ptjh5h9Ml1j9AtPkFMqVBPEowB3X/Sdj+BrXNKAd9CMtzKPpOt2j3KeB8sGCVQ/mmrfmFTrf0XLlrK8h0+d1E5Dv5/HgnsmFL4izO2hZmJy+BaAptSmXKyNdAQ4M1t8fIxI8G6IpEdM86J97bAXjHxPL5YGYEMuNJ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=uaAeS5iX; arc=none smtp.client-ip=209.85.166.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="uaAeS5iX" Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-7c488a5af5eso22088139f.1 for ; Fri, 23 Feb 2024 05:39:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708695577; x=1709300377; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xWiT0h/7JNt0Wi4P0Jnc6qFGd/ux4GQTUN2IFCPouK8=; b=uaAeS5iXsXCcQS4/sxdIhXb0mq1RQjZpzM1pMf9R5LmxdKff0ufM+etG24zUvi2VUZ EszG8klHN2iluUxKU3CQeo55niFdqRkSepv5tqdqrzvezpCdTL4+RFIdCDg7LT3DDPiu 9rtXZVzOnI7HDsWYqfZZOU6sTa/msfCnAzQy4VR51cwI5LjuCFzjduk1YiwkEEsBv9wR p3oMgg1KJGHJdXFkX/Ku12SKkJCfOVdsfumb91fFQ6JdeKHPPu/to+3ZPzkKmPCX1eyu QXPLJt3PjDn8gbje7eW3wstzg3C7ZcuSqpS90FP8e/3IsarVmcMKCkdYCcWlWRTsibQV WrDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708695577; x=1709300377; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xWiT0h/7JNt0Wi4P0Jnc6qFGd/ux4GQTUN2IFCPouK8=; b=UWXaYWR0nuKIvAqrvh93w6JvIUInENTikMyt9kzm3pt9RfJclXRNfB3pDHzZPvW66u 1OftoPrrRx9M+QACM6SImvjJkafjxQ28JqzSlrxUgPTRhIRhJuLo4oq7jz6LxQx6B9Tb CM60w1aUwtc0pAEcjXVLjAtMEzDjeQlMlaL/edYuMh/jCHiZNpLhTT7/F6x3jvzTEsEz K2zzkYE/fn29v5hISHZ5hGEWVesNYPyURWO+zxPDDxvOJxFUNVz/F6Pi3kJyvScnqXI4 XaHHbQRrygpNAwB2Wp5S18ALDf2n68dDFguL9lmlWFwPzkdawJZGuuiM0yhQBuNZbC/w DPCQ== X-Forwarded-Encrypted: i=1; AJvYcCXsAvbL//Lis0VYnBRa8tviNnx88cFGo3/xUV1fO3TLL+NpnSj3hQ3YAEPOZqVMTDTORHrI2LinW6vXcALzdylxjFx0VwS5 X-Gm-Message-State: AOJu0YzsT8v+gQNuLX7tJsdQ6OOruK1uR0KOTzQOa9A0zYMLCuUfSDxI ronetJPtGdq/4WyY1y8qmSJ5PArxXs9J45XyPvVCD8v4dtstfgIJFNe5eCZ+3HU= X-Google-Smtp-Source: AGHT+IGNKITui78tgeJKpSFfKPvLuXP9hpg0hkvTUTZ1gUgB1JNcJrjXSv8yGqV5nkB0u574NEl53g== X-Received: by 2002:a6b:5f0e:0:b0:7c4:831d:32e with SMTP id t14-20020a6b5f0e000000b007c4831d032emr1877101iob.0.1708695577350; Fri, 23 Feb 2024 05:39:37 -0800 (PST) Received: from localhost.localdomain (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.gmail.com with ESMTPSA id p11-20020a6b630b000000b007c76a2d6a98sm1836838iog.53.2024.02.23.05.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 05:39:37 -0800 (PST) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/6] net: ipa: kill IPA_POWER_FLAG_SYSTEM Date: Fri, 23 Feb 2024 07:39:26 -0600 Message-Id: <20240223133930.582041-3-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240223133930.582041-1-elder@linaro.org> References: <20240223133930.582041-1-elder@linaro.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The SYSTEM IPA power flag is set, cleared, and tested. But nothing happens based on its value when tested, so it serves no purpose. Get rid of this flag. Signed-off-by: Alex Elder --- Note: checkpatch warns: braces {} are not necessary... drivers/net/ipa/ipa_power.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c index 694bc71e0a170..be9e859e853fb 100644 --- a/drivers/net/ipa/ipa_power.c +++ b/drivers/net/ipa/ipa_power.c @@ -37,12 +37,10 @@ /** * enum ipa_power_flag - IPA power flags * @IPA_POWER_FLAG_RESUMED: Whether resume from suspend has been signaled - * @IPA_POWER_FLAG_SYSTEM: Hardware is system (not runtime) suspended * @IPA_POWER_FLAG_COUNT: Number of defined power flags */ enum ipa_power_flag { IPA_POWER_FLAG_RESUMED, - IPA_POWER_FLAG_SYSTEM, IPA_POWER_FLAG_COUNT, /* Last; not a flag */ }; @@ -173,8 +171,6 @@ static int ipa_suspend(struct device *dev) { struct ipa *ipa = dev_get_drvdata(dev); - __set_bit(IPA_POWER_FLAG_SYSTEM, ipa->power->flags); - /* Increment the disable depth to ensure that the IRQ won't * be re-enabled until the matching _enable call in * ipa_resume(). We do this to ensure that the interrupt @@ -196,8 +192,6 @@ static int ipa_resume(struct device *dev) ret = pm_runtime_force_resume(dev); - __clear_bit(IPA_POWER_FLAG_SYSTEM, ipa->power->flags); - /* Now that PM runtime is enabled again it's safe * to turn the IRQ back on and process any data * that was received during suspend. @@ -219,10 +213,9 @@ void ipa_power_suspend_handler(struct ipa *ipa, enum ipa_irq_id irq_id) * just to handle the interrupt, so we're done. If we are in a * system suspend, trigger a system resume. */ - if (!__test_and_set_bit(IPA_POWER_FLAG_RESUMED, ipa->power->flags)) - if (test_bit(IPA_POWER_FLAG_SYSTEM, ipa->power->flags)) { - ; - } + if (!__test_and_set_bit(IPA_POWER_FLAG_RESUMED, ipa->power->flags)) { + ; + } /* Acknowledge/clear the suspend interrupt on all endpoints */ ipa_interrupt_suspend_clear_all(ipa->interrupt); From patchwork Fri Feb 23 13:39:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13569113 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C7557FBAA for ; Fri, 23 Feb 2024 13:39:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695581; cv=none; b=BsvQ7V71gY5w308GI2ymSDvyfwE9JSllsUqLyF7IcIVCIAg16JC/nzKTAHgPp381Z/6Ysgj1SseeqKOG7rZlTFghi9VBKIso8Tdq7bjPTa/jGRsPjapkGtRJPgmAtdBgrjMPc7gzq6gie5EWGN4E74psxbKN5N1BuxJROq5Y8Lg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695581; c=relaxed/simple; bh=Tla2k0k531201c95gigszwFY7DvwtKH+tw/tpz1eF2w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mtQetKlg3DqSal/rrnhd9lHLBUDp/N1Ke24rUKoE2FNP9gd0VwzxBwvYL2cuj0vA68S0pWAPw0m+NUQ1BKfm+tPLsYmwPIYUPxpmSOZlzFDWfmV3rA17Z8QAogKVKDrA6zVsBSY+0veUJZTUZqLLZ3B+4EthLEmsA1BO+5kCzOY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=dNPW6w6c; arc=none smtp.client-ip=209.85.166.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dNPW6w6c" Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-7c7894b39edso10755139f.3 for ; Fri, 23 Feb 2024 05:39:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708695579; x=1709300379; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EJ8Qwlxhg9YFCAYjvWLb98mk2SEQ027zBe4HYyCS1FU=; b=dNPW6w6cwfW6W1NCZbV1yoOW5MZq0CWEdx+a10FblmVVYf9N3VhQcckk2Ui8shAHJf Pcuiq7HrjIMMAIfvOt27s1budo7DNcrjgZt1RMNCh8DVZD9zQXhcJnVmhxhgeYw7peN7 BzzvC25LWnNwkqeUgAVbkYjJtWhKTHFKlRtcFL2VvSehBL8mPyG7b4WPxfoe1kV/D5WW UociXTpDN9MPG75uFe+iBh0QuZQTGgItMjcph73yMSs744iBKRhqGkA1FNDEk6200gKM iuKSbfOjg3aZW6Lzfx9Eqnz+Oz8eBZl9SNku0iX/Y729TpU7pDPBaTydjBkLikfxHMo9 0gPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708695579; x=1709300379; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EJ8Qwlxhg9YFCAYjvWLb98mk2SEQ027zBe4HYyCS1FU=; b=AsWdl2JQHePqmH8OMpPtqb2u6h/6kQk8icJMzqjHYSsXV5OW/YY4GS4bSm1SQ+ARZj pt4rswSOvjNMCcS56u9InyBMuGwVaQWy7Y0e6Ve1thnj2Z5+gMMjCctPtN19F3ePlb58 ky4w1TY4frTKGs5h73QzfJgj8YPxx/wQY6iFZVJl3qFpAlqURZ/H3hmlio4SgIBevM/I nvzv5AQsAVDNgbAlTq6H2/W3Zrb1f7uLWCP2iHNwiY/eEftmUVbXnd8P9biFBHpOU/k5 4zJhDOpetLDDonl0RzeyF2I6UuoyGi/3cD3SGyF1IcexkZ1+x3J2quS9yqgolNbuZIbo Juew== X-Forwarded-Encrypted: i=1; AJvYcCXvkGepqQgXGDHaVPMOhbOxwwmQeSP8BbJOmTxeRHdlpmVFUjScwqUjykKm456E32ZA1X3tw8x5l2BhoHcqUXai5/KbHujU X-Gm-Message-State: AOJu0YyEkTz5bg22B9ZKi/t92pgzk4to9IIUmYnfKo1lYZ6AubX7y1uy KFmZ6h5mPERSZ0qdwayc6d3w6CvglCJ+4hhRQ2EQJqnqCnUXPAUGlmMhzaUxCgQ= X-Google-Smtp-Source: AGHT+IGzhlXaZOiypkRbVk7gUr6RKQAReuLqhx5KSarwn6NGhZ5p1GRHlOhgnXN/RAp+SGlI5U6Cyw== X-Received: by 2002:a05:6602:1308:b0:7c7:8f23:7d21 with SMTP id h8-20020a056602130800b007c78f237d21mr1983533iov.18.1708695578400; Fri, 23 Feb 2024 05:39:38 -0800 (PST) Received: from localhost.localdomain (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.gmail.com with ESMTPSA id p11-20020a6b630b000000b007c76a2d6a98sm1836838iog.53.2024.02.23.05.39.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 05:39:38 -0800 (PST) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 3/6] net: ipa: kill the IPA_POWER_FLAG_RESUMED flag Date: Fri, 23 Feb 2024 07:39:27 -0600 Message-Id: <20240223133930.582041-4-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240223133930.582041-1-elder@linaro.org> References: <20240223133930.582041-1-elder@linaro.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The IPA_POWER_FLAG_RESUMED was originally used to avoid calling pm_wakeup_dev_event() more than once when handling a SUSPEND interrupt. This call is no longer made, so there' no need for the flag, so get rid of it. That leaves no more IPA power flags usefully defined, so just get rid of the bitmap in the IPA power structure and the definition of the ipa_power_flag enumerated type. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_power.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c index be9e859e853fb..eee251d67f81a 100644 --- a/drivers/net/ipa/ipa_power.c +++ b/drivers/net/ipa/ipa_power.c @@ -34,22 +34,11 @@ #define IPA_AUTOSUSPEND_DELAY 500 /* milliseconds */ -/** - * enum ipa_power_flag - IPA power flags - * @IPA_POWER_FLAG_RESUMED: Whether resume from suspend has been signaled - * @IPA_POWER_FLAG_COUNT: Number of defined power flags - */ -enum ipa_power_flag { - IPA_POWER_FLAG_RESUMED, - IPA_POWER_FLAG_COUNT, /* Last; not a flag */ -}; - /** * struct ipa_power - IPA power management information * @dev: IPA device pointer * @core: IPA core clock * @qmp: QMP handle for AOSS communication - * @flags: Boolean state flags * @interconnect_count: Number of elements in interconnect[] * @interconnect: Interconnect array */ @@ -57,7 +46,6 @@ struct ipa_power { struct device *dev; struct clk *core; struct qmp *qmp; - DECLARE_BITMAP(flags, IPA_POWER_FLAG_COUNT); u32 interconnect_count; struct icc_bulk_data interconnect[] __counted_by(interconnect_count); }; @@ -139,7 +127,6 @@ static int ipa_runtime_suspend(struct device *dev) /* Endpoints aren't usable until setup is complete */ if (ipa->setup_complete) { - __clear_bit(IPA_POWER_FLAG_RESUMED, ipa->power->flags); ipa_endpoint_suspend(ipa); gsi_suspend(&ipa->gsi); } @@ -209,14 +196,6 @@ u32 ipa_core_clock_rate(struct ipa *ipa) void ipa_power_suspend_handler(struct ipa *ipa, enum ipa_irq_id irq_id) { - /* To handle an IPA interrupt we will have resumed the hardware - * just to handle the interrupt, so we're done. If we are in a - * system suspend, trigger a system resume. - */ - if (!__test_and_set_bit(IPA_POWER_FLAG_RESUMED, ipa->power->flags)) { - ; - } - /* Acknowledge/clear the suspend interrupt on all endpoints */ ipa_interrupt_suspend_clear_all(ipa->interrupt); } From patchwork Fri Feb 23 13:39:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13569114 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF43281AB1 for ; Fri, 23 Feb 2024 13:39:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695582; cv=none; b=TfQC8fLiXeXBftIjtNAKCE5kVguG7iBPRNRT1IiYzjXKp78TE8HO5Yfs9syiqaXMO2SaYh95OhrSKQF++yWLsQSno7jYgxsaYsTJjJzaPJ+8j6f+HLzDAiZQqrk5HQ8OVmjRjqmlb7WPVGsD0NJP2DI8Oo7IXlEdy3WcrzaD8iE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695582; c=relaxed/simple; bh=46OEvxCUZOG0ruOPXMwETLi+p6CGJ5C1qF9K+H3PvbY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gBlV5nQUIju4hQGpVwYBNAPX/ZswuZzRW0mELgqG1RTQBZT4hjPE7C2A8fEYT3Q6QmcSw9X84fGVAjSmHGUQhmAkTWiqiOm9Zu0XXHpe151FY8vx1x7+UgDXclZRerJsKiMLIj2/Es/YGi7iH8nbrfeCmVd0WyGsAStiyPNizZA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=fy8UyQ56; arc=none smtp.client-ip=209.85.166.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="fy8UyQ56" Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-7c784a9ff80so11041439f.0 for ; Fri, 23 Feb 2024 05:39:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708695580; x=1709300380; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BNgvh3MFbGff8zkaafQFr7XhBPRC4e9c/AqOz6KeXsg=; b=fy8UyQ56ZSKhdxF6HxdkERCDoUoESlk/Vpc5+e7gT85ga3AJsWgj/nHTf47Pv2FMHT onMN/aUe7P4/pUS3IMo5nfUYJwINwhfqOC/YqJCt7Gm7VqzXZuIb+s8T1coHETuPgVx8 IGm4kTTFf8vbHuRp+7cll4H9S0Zs/1cxnqvdnRCo5Bl99MRl3O0EbD0aA8+TV0ktGXjb TW4Cx6zYj8ZgboBdNVRWuOcv94i4Su//ederFIAmA50opVHkyfbUq+cWpqE5mUbi6uFe kAoZftsUZPIl5PjG0GGJ/OmJMtfkM1QNFcQoDPqYZg6RetI7Pm7DrV7N4fHEsLgX54kJ 7Txw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708695580; x=1709300380; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BNgvh3MFbGff8zkaafQFr7XhBPRC4e9c/AqOz6KeXsg=; b=KAuo22V88Nzh/Fw9+U0bCLENzvJYWWtjmAcSBjC2hkyiupeq/5GM9ixXCojZT5Rn4P wEGxrJc7FOFSPkKHIt4DAkGHc9i9fZh7DPQLWNj4uv0FNV5fLofJ1CVK3JAKAue+lfTJ 5M7u6PkboJkg84V2Mywen302JYFxoJmIcYh6pHKw3JcCLnwgILw6zjnRo+NNDJkMlq0y a9DCfGHe/GeOySKw8RZNk55FmcuyR87v0BphI8FgQzGp3kJpfbjefElmWe1utREbVo8B FQG1iy+lKHKDz9EZAdKoTJvpuZySZL7W4kS/KdBkw+Y9dcT+yWI4RK2FoReff7ZR1ca6 nxFg== X-Forwarded-Encrypted: i=1; AJvYcCXQ0dL7q0kRjk2s2XHBF+8mmN/9xCa0UcHbKF3I6nHhUCKMOrM7JcjTynYVTmW+0jqK6elV5OeNHFMjVqnBoJa2GYqVkwAG X-Gm-Message-State: AOJu0YwaRQ/2nwTs3jzuJfi/eelSL1SvDA62gX8rAIoq0J6MrLfs4hW3 JAJHdp6Xhk4kOIiamq3DZYyPiwtwBkubBh9eCP9SHUQq7mNZn9kUfxQ9sPOE45I= X-Google-Smtp-Source: AGHT+IG9LWtZiZctodKf3c6/8tnMA+P+/9qmimvMxAU8H3yJNcXRsCx5CtJ9MtjwKxyLhZiHcWpWPA== X-Received: by 2002:a6b:c9d7:0:b0:7c4:9cb9:dac with SMTP id z206-20020a6bc9d7000000b007c49cb90dacmr1796068iof.19.1708695580130; Fri, 23 Feb 2024 05:39:40 -0800 (PST) Received: from localhost.localdomain (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.gmail.com with ESMTPSA id p11-20020a6b630b000000b007c76a2d6a98sm1836838iog.53.2024.02.23.05.39.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 05:39:39 -0800 (PST) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 4/6] net: ipa: move ipa_interrupt_suspend_clear_all() up Date: Fri, 23 Feb 2024 07:39:28 -0600 Message-Id: <20240223133930.582041-5-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240223133930.582041-1-elder@linaro.org> References: <20240223133930.582041-1-elder@linaro.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The next patch makes ipa_interrupt_suspend_clear_all() static, calling it only within "ipa_interrupt.c". Move its definition higher in the file so no declaration is needed. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_interrupt.c | 48 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index a78c692f2d3c5..e5e01655e8c28 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -43,6 +43,30 @@ struct ipa_interrupt { u32 enabled; }; +/* Clear the suspend interrupt for all endpoints that signaled it */ +void ipa_interrupt_suspend_clear_all(struct ipa_interrupt *interrupt) +{ + struct ipa *ipa = interrupt->ipa; + u32 unit_count; + u32 unit; + + unit_count = DIV_ROUND_UP(ipa->endpoint_count, 32); + for (unit = 0; unit < unit_count; unit++) { + const struct reg *reg; + u32 val; + + reg = ipa_reg(ipa, IRQ_SUSPEND_INFO); + val = ioread32(ipa->reg_virt + reg_n_offset(reg, unit)); + + /* SUSPEND interrupt status isn't cleared on IPA version 3.0 */ + if (ipa->version == IPA_VERSION_3_0) + continue; + + reg = ipa_reg(ipa, IRQ_SUSPEND_CLR); + iowrite32(val, ipa->reg_virt + reg_n_offset(reg, unit)); + } +} + /* Process a particular interrupt type that has been received */ static void ipa_interrupt_process(struct ipa_interrupt *interrupt, u32 irq_id) { @@ -205,30 +229,6 @@ ipa_interrupt_suspend_disable(struct ipa_interrupt *interrupt, u32 endpoint_id) ipa_interrupt_suspend_control(interrupt, endpoint_id, false); } -/* Clear the suspend interrupt for all endpoints that signaled it */ -void ipa_interrupt_suspend_clear_all(struct ipa_interrupt *interrupt) -{ - struct ipa *ipa = interrupt->ipa; - u32 unit_count; - u32 unit; - - unit_count = DIV_ROUND_UP(ipa->endpoint_count, 32); - for (unit = 0; unit < unit_count; unit++) { - const struct reg *reg; - u32 val; - - reg = ipa_reg(ipa, IRQ_SUSPEND_INFO); - val = ioread32(ipa->reg_virt + reg_n_offset(reg, unit)); - - /* SUSPEND interrupt status isn't cleared on IPA version 3.0 */ - if (ipa->version == IPA_VERSION_3_0) - continue; - - reg = ipa_reg(ipa, IRQ_SUSPEND_CLR); - iowrite32(val, ipa->reg_virt + reg_n_offset(reg, unit)); - } -} - /* Simulate arrival of an IPA TX_SUSPEND interrupt */ void ipa_interrupt_simulate_suspend(struct ipa_interrupt *interrupt) { From patchwork Fri Feb 23 13:39:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13569115 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5928F82896 for ; Fri, 23 Feb 2024 13:39:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695584; cv=none; b=tlyCNu9N3rG6kmeFcTU372wIuRGcTWMfpMvviRkoDm1or1goq5TVrhvI4HBxlXCfBqC0rh/Je6DMI1FNYcCy8D/cHBRO9Rm2rN9uORuavq74xwrirdowPKf8yyXtkb5VQOZ1sMDIVfIR7zegMgygmrrvUl4LZknpkzvw74COLOk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695584; c=relaxed/simple; bh=Pj2JWq0/eV8U5LfntKGtg4RB7pCZupoH1JIKsRgKPx4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kFIcAOHvpJu1d2TOGcE77X38aBdI/knsKxL/KZRZ6IQYUe/yLEASdfvS4heLXtVte2qX6lULwFEpeq4QPwQmGxPbjomfguyzNcPPa1hTN7WshIzLnfhZPJQEdwROWArwmf7P17cT3E5rzER0kCVWDPgiPxHojVSSojQq98gxyOU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=O8aUQ4jG; arc=none smtp.client-ip=209.85.166.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="O8aUQ4jG" Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-7c7229e85b5so24979139f.0 for ; Fri, 23 Feb 2024 05:39:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708695581; x=1709300381; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IBcLB2tUwTkIv16rWdqMqkrF0q8yxOXRHBRsAy8swM0=; b=O8aUQ4jG8lmp01u37oDalWNDeLhO+v+TJ3ReXTGeydJoKZfVztBW7iRbn8Zh5mgcuf 2eTnQvbdB7/ZD6jrn9y7nGSzWafOTkHCDVbOGNLSUSvqv4QJwC9/M0yNqwPC1IRPCPta 84uyrHOO9UeagFQp99cekpspM/I/Bt2HfljyMRyAgZZdydsR+IwrzQqF5RfSWBr0XPCX EXD5wli/cAaSg/ToK5E5bKzHIa7grD7UP7eHfSkK2jEsdz427FfaG7o+hVLqaFDLtTRg 3gLy0hfr0uEdxlK1T6HbkybysFmtruxXUaFF93acFQWe3U/7UYESt/zuzgGBah19eVSj 1m+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708695581; x=1709300381; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IBcLB2tUwTkIv16rWdqMqkrF0q8yxOXRHBRsAy8swM0=; b=M1B5lhD4v3k8PH3kRhQNrFz29S6DcwhMUQrmZcY/j2zAqm7doNj0WbUzFnr7PFEQ8U p2t02/m1387eQb8Lf/bN3V77ENtDIFuoFh/Gr9V+cvJwWIct0meCrRdCckA3b71MYbH8 zjW26EwlFYNETEQwgC3F1fHg5gkifQbL+fhONftzRbEQe2I7Zma4UEgvclaWSDH3jQ7Y kOUX68Vq4iY6CmswWj2Q05RkYdgMhhKcOuAaMZO0KCEaWHMu5rAYL/mrtKLQJxWRhB/r XLrZkeuSnGu3/izweFyYmibb7vnNfgVSJvPZ8sbXVOtImpZ9Pii3AkGVc2ttxolYRKW9 KvGA== X-Forwarded-Encrypted: i=1; AJvYcCXf4Q6xzAWZkxPPNmjOJB1F+65vJNkGPO4HJq8LCgKx8oHd+3w5j9rzOk9qp4tPKOPB26/R68I7bs3KD51GTRrCsWmzHgjx X-Gm-Message-State: AOJu0YyM7aOMtdaUYeH1Hc0G3WT4WJ1hF9PEuGrggUJbCJ6qp+go+Vpm 6Cy+yVp4pQIu+FgkWfx00eWpiOxz+5XydTiPdFfs7ukM5uqqHbNDWBqxG/xS21U= X-Google-Smtp-Source: AGHT+IG5YOuxXZsiAWHenMCPy9sDchco4RRy8B330LWJc57qG3Jmlqz4IFLtHq/b6aqPGK8KOIQCeA== X-Received: by 2002:a5d:9c12:0:b0:7c6:67e4:b151 with SMTP id 18-20020a5d9c12000000b007c667e4b151mr2049467ioe.9.1708695581405; Fri, 23 Feb 2024 05:39:41 -0800 (PST) Received: from localhost.localdomain (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.gmail.com with ESMTPSA id p11-20020a6b630b000000b007c76a2d6a98sm1836838iog.53.2024.02.23.05.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 05:39:41 -0800 (PST) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 5/6] net: ipa: kill ipa_power_suspend_handler() Date: Fri, 23 Feb 2024 07:39:29 -0600 Message-Id: <20240223133930.582041-6-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240223133930.582041-1-elder@linaro.org> References: <20240223133930.582041-1-elder@linaro.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Now that ipa_power_suspend_handler() is a trivial wrapper around ipa_interrupt_suspend_clear_all(), we can open-code it in the one place it's used, and get rid of the function. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_interrupt.c | 4 ++-- drivers/net/ipa/ipa_interrupt.h | 8 -------- drivers/net/ipa/ipa_power.c | 6 ------ drivers/net/ipa/ipa_power.h | 11 ----------- 4 files changed, 2 insertions(+), 27 deletions(-) diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index e5e01655e8c28..501962cc4e90f 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -44,7 +44,7 @@ struct ipa_interrupt { }; /* Clear the suspend interrupt for all endpoints that signaled it */ -void ipa_interrupt_suspend_clear_all(struct ipa_interrupt *interrupt) +static void ipa_interrupt_suspend_clear_all(struct ipa_interrupt *interrupt) { struct ipa *ipa = interrupt->ipa; u32 unit_count; @@ -94,7 +94,7 @@ static void ipa_interrupt_process(struct ipa_interrupt *interrupt, u32 irq_id) * caused the interrupt, so defer clearing until after * the handler has been called. */ - ipa_power_suspend_handler(ipa, irq_id); + ipa_interrupt_suspend_clear_all(interrupt); fallthrough; default: /* Silently ignore (and clear) any other condition */ diff --git a/drivers/net/ipa/ipa_interrupt.h b/drivers/net/ipa/ipa_interrupt.h index 12e3e798ccb38..53e1b71685c75 100644 --- a/drivers/net/ipa/ipa_interrupt.h +++ b/drivers/net/ipa/ipa_interrupt.h @@ -34,14 +34,6 @@ void ipa_interrupt_suspend_enable(struct ipa_interrupt *interrupt, void ipa_interrupt_suspend_disable(struct ipa_interrupt *interrupt, u32 endpoint_id); -/** - * ipa_interrupt_suspend_clear_all - clear all suspend interrupts - * @interrupt: IPA interrupt structure - * - * Clear the TX_SUSPEND interrupt for all endpoints that signaled it. - */ -void ipa_interrupt_suspend_clear_all(struct ipa_interrupt *interrupt); - /** * ipa_interrupt_simulate_suspend() - Simulate TX_SUSPEND IPA interrupt * @interrupt: IPA interrupt structure diff --git a/drivers/net/ipa/ipa_power.c b/drivers/net/ipa/ipa_power.c index eee251d67f81a..0f635b8356bfb 100644 --- a/drivers/net/ipa/ipa_power.c +++ b/drivers/net/ipa/ipa_power.c @@ -194,12 +194,6 @@ u32 ipa_core_clock_rate(struct ipa *ipa) return ipa->power ? (u32)clk_get_rate(ipa->power->core) : 0; } -void ipa_power_suspend_handler(struct ipa *ipa, enum ipa_irq_id irq_id) -{ - /* Acknowledge/clear the suspend interrupt on all endpoints */ - ipa_interrupt_suspend_clear_all(ipa->interrupt); -} - static int ipa_power_retention_init(struct ipa_power *power) { struct qmp *qmp = qmp_get(power->dev); diff --git a/drivers/net/ipa/ipa_power.h b/drivers/net/ipa/ipa_power.h index 718aacf5e2b23..227cc04bea806 100644 --- a/drivers/net/ipa/ipa_power.h +++ b/drivers/net/ipa/ipa_power.h @@ -30,17 +30,6 @@ u32 ipa_core_clock_rate(struct ipa *ipa); */ void ipa_power_retention(struct ipa *ipa, bool enable); -/** - * ipa_power_suspend_handler() - Handler for SUSPEND IPA interrupts - * @ipa: IPA pointer - * @irq_id: IPA interrupt ID (unused) - * - * If an RX endpoint is suspended, and the IPA has a packet destined for - * that endpoint, the IPA generates a SUSPEND interrupt to inform the AP - * that it should resume the endpoint. - */ -void ipa_power_suspend_handler(struct ipa *ipa, enum ipa_irq_id irq_id); - /** * ipa_power_setup() - Set up IPA power management * @ipa: IPA pointer From patchwork Fri Feb 23 13:39:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 13569116 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D9E882D73 for ; Fri, 23 Feb 2024 13:39:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695586; cv=none; b=BRnVvMqnWNeT3Hf1PKbFqTDHQ5tdSTFsCvu0PSZ7D1QwlZGCCw8TNYxVA9bxZ8OfIm0xswpEViT9ex47TQOR56oxSBeGJmQ063DE3F8cVcIGlyEWouCxNeHkC8LS6MnEOSqY3W9f072d7aGBabX+j8zJ00E9WksyDvg67pnpQ/I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695586; c=relaxed/simple; bh=R1NuUyaeVwVoZIwzuPLNIPw/PKBxSpCjUIAi7QjCL0o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BGxBAbsMu/0wMtu92JIP1tVKWTRkXts44TxoHAYiEvY6j4vYQ6Na21l7FRyry4PblGQzpT6M5q+dOLXNXs0pz9ZShk3+WdbZoTAVa8fmaViXU/eTERFRuNRZNuuIqGpFiii5Fob0QDO6qlJkZiEgshfpIS2FR6wvhfuN+xAlAm4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=UYnM5gJ7; arc=none smtp.client-ip=209.85.166.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UYnM5gJ7" Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-7c788332976so22258439f.3 for ; Fri, 23 Feb 2024 05:39:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708695582; x=1709300382; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7gvcLqkFe+gopYfSZR07+vFTVoG9g+I5ZfBO7osdbeo=; b=UYnM5gJ7bDRw+VHe7aE04T7ZfdC5mYfQWi9lHOgsHBR04QpxNTaNJalgcU6bWGpaaI 7MdppIe6eBTwVtv98+7eexyNpBT97Cyb42JtvRUes55YisDLC2w12P7MrQx0b9BQixeU YofI4sH2VTOZAsYwGhy7SujQJlrIfPcVhC6UKomVlGa7ze+krKoNP9XIMOu802oJh241 bf4mRLjA5FXQolJdFOcnzso5Pk4MjBvcXkTFpKEvyz4DLTSh5hS+6KV5B15HQzQX1tK0 ABoAGvtOJEorIxbE1ogURFfSnyKZbi+Lov3uWpNMjWoLLxQ0bitubBJWklLI/dwmKrdG fwtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708695582; x=1709300382; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7gvcLqkFe+gopYfSZR07+vFTVoG9g+I5ZfBO7osdbeo=; b=aXLUwQZP8npdcRu2vyzc0Npce+xSyO1TK78PF0wlSyJkTcVyKpJZFzDtJ2JkMHZ8Is 1/KKBQYhmVd4gXHSsGLqiouI308MIjJ47lG4w+dGzAaLKFDkhZ8anW1wpdh8afix2HR/ XqK90tGBBDbmmGxOoZE/hTq6sjsmwYhqMjkDGTTEy6Lqw3EWEjkwkk4yIFEN5DXJV+H8 kYcK/DSFqxzar1vsuD0tjVGJTzX0OgXepHXup4qy6HppcjF09RR+cuaaVGx58HTn0DOv Flswz11w3JgBMPh0UmnHja3UqyL0ln5BrKWyTbB/PCQKk17f+rBZouDbdbQO4vAyxqCd 6cLQ== X-Forwarded-Encrypted: i=1; AJvYcCVtR8wl1sK3xbe1mvIgAoXwsmUr+43Q91ynjlU/U8YSIbs5LIO6i1itwcRrgzJio6a4GlOz7h0N5f0+XXI+aou7S37w5v3N X-Gm-Message-State: AOJu0Yx7RDiFrMfbY92hSnx29RAQZlM0V+HkQQfiRU8HL29FyHS1h2Dl doinoUvUUuum3yRSqOx3YPbHA71mtqZsbKplSLUM4QZ9LumTtgyClwBFbLPwTA4= X-Google-Smtp-Source: AGHT+IE/HlJHMChgqnPJEnIEbroCxWOXAm0Jz8sTh1lr/FnApKR5HEYZd0VbmWlq/M4D+Sik0Wc49w== X-Received: by 2002:a5e:a906:0:b0:7c7:97a0:d2f4 with SMTP id c6-20020a5ea906000000b007c797a0d2f4mr1799853iod.9.1708695582465; Fri, 23 Feb 2024 05:39:42 -0800 (PST) Received: from localhost.localdomain (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.gmail.com with ESMTPSA id p11-20020a6b630b000000b007c76a2d6a98sm1836838iog.53.2024.02.23.05.39.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 05:39:42 -0800 (PST) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 6/6] net: ipa: don't bother zeroing an already zero register Date: Fri, 23 Feb 2024 07:39:30 -0600 Message-Id: <20240223133930.582041-7-elder@linaro.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240223133930.582041-1-elder@linaro.org> References: <20240223133930.582041-1-elder@linaro.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org In ipa_interrupt_suspend_clear_all(), if the SUSPEND_INFO register read contains no set bits, there's no interrupt condition to clear. Skip the write to the clear register in that case. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_interrupt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ipa/ipa_interrupt.c b/drivers/net/ipa/ipa_interrupt.c index 501962cc4e90f..4d80bf77a5323 100644 --- a/drivers/net/ipa/ipa_interrupt.c +++ b/drivers/net/ipa/ipa_interrupt.c @@ -59,7 +59,7 @@ static void ipa_interrupt_suspend_clear_all(struct ipa_interrupt *interrupt) val = ioread32(ipa->reg_virt + reg_n_offset(reg, unit)); /* SUSPEND interrupt status isn't cleared on IPA version 3.0 */ - if (ipa->version == IPA_VERSION_3_0) + if (!val || ipa->version == IPA_VERSION_3_0) continue; reg = ipa_reg(ipa, IRQ_SUSPEND_CLR);