Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3029226pxb; Mon, 18 Oct 2021 06:56:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzscrOpOrdXPq/MwNjjnxSyKiIm4qG+SK3hN9FazMAG3BhIClMImQpoFT8NwC7OfFuL0SlN X-Received: by 2002:a17:90a:8a0a:: with SMTP id w10mr25533360pjn.60.1634565377675; Mon, 18 Oct 2021 06:56:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634565377; cv=none; d=google.com; s=arc-20160816; b=wmtSm8ph57ryUYE0GGKyZyRh7qto0gvzpOGim0Ha1pFTT9fgcb2mpKwUDWjBnMiG5H dVj/zBCR5OxG+UxGuE7ogD1guja69EAupJ30SWEDe8wCSxS5JrxBTQjlViUChVAeRCqM EJJxkXRC/LQlQzww0PyO46aiEoo+HB0e+FBpnjzikOyWgxLei6c+o7y5oqlxcaeq591d +S2Xk+ToS4BoC2n4+hFsHj3H8Vfr2DJRI+TDR5BPgqPv7+eVsBwV9V+vtXy4LuxGtPOa 6qQe8I8ec8YESMHS/DE9TpIjVIe/1GPXVdQLK0wkIyAKAkKkLWf/zPrc4X1KmWffpjWf kHcQ== 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=bxLk6ypBhkn1sDoO7w6sGy5aBIUsLxPVNv6Mu2tVMmQ=; b=g7CDcPfBUiVvCuqosSNPXaiaoe4QMfrZwyu5DhfpRzQCPTIaMkbso6ny1aWYo3Cfh3 soarZmtjX3reTD9/KzOonbGV1fbYpTCjc5fKvR+NlekqqVH9I0FXjcHpPoXXNLvJtSsZ gUIdqaLQDzmNwrjI+ZUOfWFJhzNrHJlpUuO6IUY0b3H7y//kMt5vjEuF+hJWzVXhEXfs iOYQCgbHaEYbJATFpjmJaUswPzZHu1YEA050f8+/wGaxZ4GCwJJgF3Z4emvZT0SMDy1w DrXY/hDXfMwYNGbJqbshipzTHcDJ8fNZsw63s40MS5NMZZ5pvJkdEnS50JINBre2wqy0 9+rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="kju/ud2d"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j22si1452956pfr.76.2021.10.18.06.56.05; Mon, 18 Oct 2021 06:56:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="kju/ud2d"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232200AbhJRN5S (ORCPT + 99 others); Mon, 18 Oct 2021 09:57:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:57658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234167AbhJRNzO (ORCPT ); Mon, 18 Oct 2021 09:55:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BE16F6139D; Mon, 18 Oct 2021 13:39:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634564394; bh=aRWYbPLJdzMSYSxuiVXIJcGb6m+z+ik0PC3c3RYiH70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kju/ud2dOBkxrVrQZA6u8SWydnJAaA5VPpIqngaWAe1kvU5dtIq6FNRK4sVSKnN1W O1V99Gg8Pm2Mg0IDxzz57x7uHkm2780sCLNy8+Zi4oRJWK6t4xvyMzjZrnCdvCcwp3 AgvcJn20rVmikONq6HGJGkA2r8fyzPWSIphRt2kM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Usyskin , Tomas Winkler Subject: [PATCH 5.14 039/151] mei: hbm: drop hbm responses on early shutdown Date: Mon, 18 Oct 2021 15:23:38 +0200 Message-Id: <20211018132341.963860480@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132340.682786018@linuxfoundation.org> References: <20211018132340.682786018@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Usyskin commit 6d7163f2c49fda5658e43105a96b555c89a4548d upstream. Drop HBM responses also in the early shutdown phase where the usual traffic is allowed. Extend the rule that drop HBM responses received during the shutdown phase by also in MEI_DEV_POWERING_DOWN state. This resolves the stall if the driver is stopping in the middle of the link init or link reset. Fixes: da3eb47c90d4 ("mei: hbm: drop hbm responses on shutdown") Fixes: 36edb1407c3c ("mei: allow clients on bus to communicate in remove callback") Cc: # v5.12+ Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20211013074552.2278419-1-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/misc/mei/hbm.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) --- a/drivers/misc/mei/hbm.c +++ b/drivers/misc/mei/hbm.c @@ -1298,7 +1298,8 @@ int mei_hbm_dispatch(struct mei_device * if (dev->dev_state != MEI_DEV_INIT_CLIENTS || dev->hbm_state != MEI_HBM_STARTING) { - if (dev->dev_state == MEI_DEV_POWER_DOWN) { + if (dev->dev_state == MEI_DEV_POWER_DOWN || + dev->dev_state == MEI_DEV_POWERING_DOWN) { dev_dbg(dev->dev, "hbm: start: on shutdown, ignoring\n"); return 0; } @@ -1381,7 +1382,8 @@ int mei_hbm_dispatch(struct mei_device * if (dev->dev_state != MEI_DEV_INIT_CLIENTS || dev->hbm_state != MEI_HBM_DR_SETUP) { - if (dev->dev_state == MEI_DEV_POWER_DOWN) { + if (dev->dev_state == MEI_DEV_POWER_DOWN || + dev->dev_state == MEI_DEV_POWERING_DOWN) { dev_dbg(dev->dev, "hbm: dma setup response: on shutdown, ignoring\n"); return 0; } @@ -1448,7 +1450,8 @@ int mei_hbm_dispatch(struct mei_device * if (dev->dev_state != MEI_DEV_INIT_CLIENTS || dev->hbm_state != MEI_HBM_CLIENT_PROPERTIES) { - if (dev->dev_state == MEI_DEV_POWER_DOWN) { + if (dev->dev_state == MEI_DEV_POWER_DOWN || + dev->dev_state == MEI_DEV_POWERING_DOWN) { dev_dbg(dev->dev, "hbm: properties response: on shutdown, ignoring\n"); return 0; } @@ -1490,7 +1493,8 @@ int mei_hbm_dispatch(struct mei_device * if (dev->dev_state != MEI_DEV_INIT_CLIENTS || dev->hbm_state != MEI_HBM_ENUM_CLIENTS) { - if (dev->dev_state == MEI_DEV_POWER_DOWN) { + if (dev->dev_state == MEI_DEV_POWER_DOWN || + dev->dev_state == MEI_DEV_POWERING_DOWN) { dev_dbg(dev->dev, "hbm: enumeration response: on shutdown, ignoring\n"); return 0; }