Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2135624iof; Tue, 7 Jun 2022 20:56:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwru13YZ2fxrO9hkCYRo187jIsv5WHuFB4qbAHID9SIQmLASjbVkRzRXyojPXmdDtEyDJrv X-Received: by 2002:a63:6901:0:b0:3f9:caa5:cffc with SMTP id e1-20020a636901000000b003f9caa5cffcmr28705224pgc.324.1654660615943; Tue, 07 Jun 2022 20:56:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654660615; cv=none; d=google.com; s=arc-20160816; b=RkR5MIgSwK2rzzPt8Ur04aLIdMGX0xc6zV5k1p9yKdK4QsZhB/WTQ1doTa8jNpd+ak 9ya6JiRA+2Km7/Xw5l7wLmtpPrye3KF6wKe+cdWU2qYavOxxDafYsWUS9K6Rs3dT0qNt c5QVI9DrGLFB+LGR8Ji7OiGmiWZzSooTvmYWYLdio27ONF2g5zFKzUBOjngpXsUUQ/nY va+uciBHeXeGrVqMnqEz4ajX0UEBdaxJUKtbcW15bEUlu3FaV5ms5c1CoSVnGYBeGgYL NLGxhmklI5Scs7i47Y0lU9sywepFE9gJUmLlkUXzh8ZxwRxYD+zM5zL52fQ2rduRsQ4c /72A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=W8xWNLy9zOrrCH6sO1KF+DBCn/GQft1X8+R5BqH3EI8=; b=AQITBl46gErjWxbrfcGyUO37VYMdNfs0Ih6eL/q7JpIjnTSdhC1H0Q9u4ZuBVnmlhq xhwqU8g0HUW9RcR++FOCnERzb5ZOc69jV98l/9w9MJqu8KxIyOcfkS4Z/hCkjQjTcOQv 5ardcGQem3ajO8QVhvYD8IrMyln3zDv042bVrgrWCQ8cOTTDnZVBovFZ+Uh1L+skeHEn Qm37mjQz8WzNXh4W6HG4UWhjsUtD0mpjbvBo+9qBumilzeVEm72QHIQIBUsccnPB+5ai rSy89NkcIeW4LV4uu1qxForesGyXuLHiXCyh2nVM4rv2z+6yWWV3tCSkIom30eWPyY5N eFOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Iee8egRh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p4-20020a170902e74400b00163937195e7si31020282plf.372.2022.06.07.20.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 20:56:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Iee8egRh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 098DD2109CB; Tue, 7 Jun 2022 20:17:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383932AbiFGWNV (ORCPT + 99 others); Tue, 7 Jun 2022 18:13:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379821AbiFGVLD (ORCPT ); Tue, 7 Jun 2022 17:11:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A438B215E7F; Tue, 7 Jun 2022 11:52:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 259B8B81FE1; Tue, 7 Jun 2022 18:52:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8ED2CC385A2; Tue, 7 Jun 2022 18:52:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654627925; bh=OkvOHVTj+0RUFez+W4m7EDCBB4EaSlENkTb8ZwkIaAo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Iee8egRh1HPtgHgTpiedPTd0c7uOilwPVWg18V4c+vghMrEyKOJERngoXS/guJ+Fg abdWb3T0etPgL3WJCLYfbC5OG7gkUuEsx+xYHaS/sl0Lo4jV5dyozeW2eOdcQ8NGEr 1iH1WfpArBEa0sYnQQkajwBkeL4R4EjNAjBnbd0I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yihang Li , Xiang Chen , John Garry , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.18 142/879] scsi: hisi_sas: Undo RPM resume for failed notify phy event for v3 HW Date: Tue, 7 Jun 2022 18:54:20 +0200 Message-Id: <20220607165006.827225822@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xiang Chen [ Upstream commit 9b5387fe5af38116b452259d87cd66594b6277c1 ] If we fail to notify the phy up event then undo the RPM resume, as the phy up notify event handling pairs with that RPM resume. Link: https://lore.kernel.org/r/1651839939-101188-1-git-send-email-john.garry@huawei.com Reported-by: Yihang Li Tested-by: Yihang Li Signed-off-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 79f87d7c3e68..7d819fc0395e 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -1563,9 +1563,15 @@ static irqreturn_t phy_up_v3_hw(int phy_no, struct hisi_hba *hisi_hba) phy->port_id = port_id; - /* Call pm_runtime_put_sync() with pairs in hisi_sas_phyup_pm_work() */ + /* + * Call pm_runtime_get_noresume() which pairs with + * hisi_sas_phyup_pm_work() -> pm_runtime_put_sync(). + * For failure call pm_runtime_put() as we are in a hardirq context. + */ pm_runtime_get_noresume(dev); - hisi_sas_notify_phy_event(phy, HISI_PHYE_PHY_UP_PM); + res = hisi_sas_notify_phy_event(phy, HISI_PHYE_PHY_UP_PM); + if (!res) + pm_runtime_put(dev); res = IRQ_HANDLED; -- 2.35.1