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: 775225 Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (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 2666D7EF1E for ; Fri, 23 Feb 2024 13:39:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695578; cv=none; b=NKdk5QrTXr9YisIEUHeCiFOq2IiXiPIIwQbwp0M/DTW9KU2Dsd/11RVEMjNZFhqYC9SzDI00EOr4G5MkXBp/wvZ92rAu/qgDL1oFV6YwMjbBMxA1EB5bXNWxos1up3c1EGUmDMhqzeEuhpzoZ+a4EOPTSYFjJI2JLFb2rnu2X1w= 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.49 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-f49.google.com with SMTP id ca18e2360f4ac-7c72290deb6so33577439f.3 for ; Fri, 23 Feb 2024 05:39:36 -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=r7LuNHRz7ZxVzdGbMj2gVKG+PtOm9W8AVm6ELiIufLSg97mKPjjoio61nGwmq5j7SO XfzGo0ffNQXjASQ6BoIC6IRYS0HfXQTWTH/CrmUhRn4U4Z5ovAFPOZQWt+Qyf9HR1uPK QfwDSuS0YERbgLZSCTo06Zk/mgAyTw7ue1H5rGAAEwp5nJBlUgLqcMOTyamA8+ipb3k7 KPLwQgIPZVmbEGoWQdv9AXa/F1w2FvO6/qmxlRj7eFu2M5kFBLK8dEnkZlIJPLCdN/T+ I/nlQvMTFBWC2knlxxbJLAbdDJja+Og6sg5NMD+Z8ZUA9ZG5QGCbfoSaWzmTvrYKomt0 OOVw== X-Forwarded-Encrypted: i=1; AJvYcCW9J2vPTsXLTbEwIfeImc6H+abJxXAXJSTDqOrVbEl7YQ5Bn35k33Fq9gWTXuH1rysV43SyFrWe1r+/KLw91w93hT1vEcXZStrtSlzXeg== X-Gm-Message-State: AOJu0YyO5SZEnmK7GkZRo8HRfOEo624oVLO9E81cXyVUbH6fSp+rYR9b EufQxDXG4CuE4Q4I5NuaACMNMdIySUJRD3SjIhwGZQYU6wvjpifGdzQFS4o+ons= 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: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 775589 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 431BF7F484 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=1708695579; cv=none; b=CRTfuavQNqypTT5UN0voykAiaBg1z6mKrwmnFAUOrZqzXYppmZWo11sKpjwqf8SJ7Zj0Kc0m4TRC1FKhajTnmqJhH4tyeYF3h+23sedDgnsnC5cKz3UbTdB4kTFKVXntvg/TniaI6DnL8B5WBD2Qqz0yz83IamxtTkm3K4Lpt9w= 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.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="uaAeS5iX" Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-7c488a5af5eso22088239f.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=dIbGnLY5LWX1+CCh5yvsm7HZaIccuybyHdzcKyBfi0MHrfR9pWNfYOwM3L4LTkY/mX SK4dK5jeaBGTyaMDkZF4KiK7lJtp4Gdo1iCo3210hXmrtFWxATPPpaywakyJwzJQhd3h 3yxREYSN3qXo/M/s0mrksDer57RzwmyOekQgRL5k9nEYIrvW4OSedNR1KdxA/k5rk9oR BBfROYTVOMFgGXKRa3jKpeNmoD05vu/ry680AoUg7YVU9JDDNG7Z2dnuSyYwMAn5fbV/ VqBTX+7aei+YS4gX9HhgI6IbE239OxDobDJ+ERFux7LT1IFm915z/ThaUSew94RlDhCD lnLA== X-Forwarded-Encrypted: i=1; AJvYcCXfsrlYssPi9Y9+iNftOd1xEUSTPqgdO8NilDNknZVzgm1mwY9eoFUNRm65TietW7YTs9rPawh7oqHtyABxshEQ3PTcYDcNmij/dHBfZw== X-Gm-Message-State: AOJu0YxdtFYk06145VtqcgsJSVa+eCkzqm5BPxolWWCfT3mQUb8OwCWd wCztnFaauMot823BRQtetUzfTRIEo6WnGk7QtOHv6k8YaM7edGlBwsepaAXFb0w= 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: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 775224 Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (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 977B17FBBD for ; Fri, 23 Feb 2024 13:39:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695581; cv=none; b=S4PvtsePj4/PLFrkHC9ciO3N+wlxL7qA8BaUOwwawWi3VImFwsomLkwj5O5IWnS+q67mqL5FiG1Y+4THKBINhCMXO1Jip6UDEOewjqwW1nkjmwMfXv6sl9zzKoj7Ot7s2pp/y7611X/8T3wKaqrWgzW53HC8pLF8H/+jjIbjObQ= 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.54 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-f54.google.com with SMTP id ca18e2360f4ac-7c78573f294so13426939f.0 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=G0bokeUH87YYBmBOuqgWxfF3nW6Oscvca8rRPPt8aa7/nDsDh9wD5xHxVO8nAWqEU0 hbhwPBkRoJL5SZ/sZQYtlhFwLGpOCLaQ+pTweD3vhxWpyJsr2hFq/fpWLaGK9TeoKVRS nhxzyNZ/u3zbkyVAmtjPlQ9uxfcFXSBsJzic0/VjNjJFjr7PDYhNY9v0optHGK1aViZx AJ6isxXtBf4TXX2vBtYP9BNVHAezXzR0Qe06wh6D5+QoukuKo7lMryUGWkVbTdpA1SDK ZNZeW+cVE8o4CLRQs20FC1IdoFM91JTiivHF6Jvg8KZPTyE8XZDpOeHJv3QYrBytbVFY QDhw== X-Forwarded-Encrypted: i=1; AJvYcCU0MgmPxZHlz+0qDZDhQKMeG79IsGjDy3tXCpukm3UGjEimd5beaPE5tmjer97mz0RtuQMpd0iPBY5cEq+GjEVKK3gPCR+RaNt3ivZznQ== X-Gm-Message-State: AOJu0Ywktkxpb6wHagTkYLan9ABKQagQpTyR1azloSEuNVXddZGkLizd y49xIyOB2xmWGsVD4osUML6MAcRKNltCgKwoYl1AFcyOnoX/+51/60saHw3/0tw= 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: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 775588 Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) (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 E93E47FBC5 for ; Fri, 23 Feb 2024 13:39:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695582; cv=none; b=f/Y+SN0dLNMro+bmUivRMI6QZoRlCbuU3Y+URZfRnzK8R+4q4phm6ZG9fiYsC0d6cdqSdZk1wi5GT3NnE/27ynaob/AkMRbaTpfLtpR0GHSTRllPVm25+iiJb6WJHpGh7Q6uv+pYVn5tCmmskXre0pYFqdmVYOz5pw6CCESyjjw= 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.47 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-f47.google.com with SMTP id ca18e2360f4ac-7c784a9ff80so11041339f.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=CzNZ6X2JWoXoyIIY74jzMe5EAzPGDGUc+3kQTUS9CshRtBabZj1xqLv0wkRTnIiQin 7rpqggzPiZUAIKswzbMr2374C1lOtld+VSWdbsFTcmn5jX43tuwoYvAGS8Dcf3o1Rs9s Esrg8EFsZnFId60/q/hmf8n7GYP5lRv5dXiZCH7Q8Pe+N7RAg7vFdZem/agkwKjEWESu f4vgQq1zhjapI54tqInz1QhfWWLCfSox4DK0D5PAJjiSjS2OLmouyDjKEP1rwfu2I/iI IB/tnPWMXQ1kPjVBsZgGsJ07xgeOukGP8IjGA/DTZK5/DK4/ILOO8EK7eIq1WXANLdll 4QdQ== X-Forwarded-Encrypted: i=1; AJvYcCXVf+X3vunG8JpOSpIVk7GrLgaNwwMqb4lHk5b3kHW+CZZ3oKdXa+MqolMb+z56xDlPc/NzCQfHsTV+05VXebMlQez0nowUxXfu55l5rA== X-Gm-Message-State: AOJu0Yy9+8RKQAeNWBK2FUrtgITWjSSFC1qNjLk8IqFrwifLkX4Kx7Mg hZp8xN+VI0hlPgp6/d0fcjjnaDUQfUq6vn0E62h06DF0lOYtFv84je26Hn1Bde4= 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: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 775223 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 560328288E for ; Fri, 23 Feb 2024 13:39:42 +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=1708695584; cv=none; b=lMWChom1/M3Sewu3JdHew3uxe9QrPJxF0J3qQE8/nu1ivLqzpschbxC0xsddcrtRncjbZWEojQVolIakuYccxbgSrrP1KdI/08Cxl+gQbxapQ8SnHfYQm5Cp/wjCibeVqdxWKIJZmHZW5q4JEIkeFtCSirFs4bizxcKaKGrUYrI= 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.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="O8aUQ4jG" Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-7c490498729so33903439f.1 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=ATc2PbKD4pcPd34MH10yQhvDJsFrigiuYiRJVlS6zgVJ8iLB5pYXZfjYvURdu5KJC9 hpAdxzcIDBINLynJDy7vxp1/swROhZnIgsXSDFNHbsmy+mo7ObqqevFJur2qk/g28pFQ vw+eH0EOSpiPz8kz4NnqUfe+1A0bsmJwv3UWWnT4I9cuaR3ZXHpoxVyp2WXhqO7m3Pnk /y6f0J0Wg8qfrCLEqI1rd5my6rVxx+CR/kF6n9nKovk9P61w1oWTtnxRWDF1spM3Kk1U Rp1Sh5Xb9enkcvwxeUCxbLZJLe7BfVQldruLrXhO6NmCuGkLTqhiGXTB/dzQK7bDd0JJ zT4g== X-Forwarded-Encrypted: i=1; AJvYcCXAdb1D1FNbMDVy0wfQo4Sd3xiIsQOb2T4zXzyH82WpEFVsKqcoiDDavXBjuBhdCK5amml/L+FzMBCSKcjd1hdDIuhDPm6/n6h4Pb2ukw== X-Gm-Message-State: AOJu0YwzJH+bJq1N3qvhSBj2nm9NPC64plu9dil+H+Hv2rE2QgKPcSH9 qTSPxx1fkMaxLjxssAIzGgZ2kMNgzaU9275FXK68kMaMXOnILYufDO7etrgGLeM= 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: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 775587 Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (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 3EBDD82D6D for ; Fri, 23 Feb 2024 13:39:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695584; cv=none; b=t/GP0qfCvQ71EA3LHwgp7rku1BLSUbCY4IJMlihJmi3UBeJNIjH4+egDK1f74qsXoUmnMDmojG3xWcWzg1KUAu4MV8OTnzzvpY7zX8NUGLY0HSzxHMa32y5rFcf2bAkL6hUDnem9QZEb2s6Cm5pN9cHVUoJvPf9ZrvZtbkuITFM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708695584; c=relaxed/simple; bh=R1NuUyaeVwVoZIwzuPLNIPw/PKBxSpCjUIAi7QjCL0o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=l38oHI766xwLKm2zbob9GC7qdUIO3uW8TUG+CInGLCOb1UZrnEK3I/A1Gkz8qJ7P9fwMXDFGv7fjYe8c9HvKwqaq7xJMkvYCju3Jl4Vkstmf4f8nhbgnANbX0nhbrskwqJiH5OAgAzOydchZVuzcIcp2MAcBk0a5zWZywuHwXx8= 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.51 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-f51.google.com with SMTP id ca18e2360f4ac-7c788332976so22258539f.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=VJM4dsMSJ/Zj5DEh/N2N/oKRXjMyCXk65+VNnHiF2c0dYHmH4F6LfkdBm4K+n5E2nD eK7Zh9fiOrH3iGYKKgugpbNUuvagnWm166AIR5ItpQtHfS65axpN3degFmVsx0B6o9Yq 2V3o9PMYwmvBDYQ6GXyk9mZMidgI2x66eQ1CPUKjm2oW4cMUnyU9Omd/AnJ1nA5UJAUA B1bKPyI+ws19lQktTAD7VDlQ7boZu4DifEUuRxHP55V37Or/ASjgiY8cMPoqKru7c8HN d5rIcD25uKhwqS3K2YwlAkBPBSdrz5CmQwv1tE9SeMYw/Sg8iWvwTCgZfW8zoFiQExNJ MuvQ== X-Forwarded-Encrypted: i=1; AJvYcCW8P14AFtU2X63qYxYbNc2ldPbhzNlzDo8iUpK2zZ11y4Z8LPo2fhCvmVcxYvLbVfDngFHorzLC8VPkWbyPanfHTu+YQz0r2FdeAP/sZg== X-Gm-Message-State: AOJu0YwMNJnAUCqRG9CQIAfRZKvOTWcpO1qoPkKp+swM8RoiriusLbIE Y4Di7yMaMRCiNAbtBQpIkT3vh3qAm1yLkVCTS594OLjZOZxY4T7JypA24ApxfXo= 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: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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);