Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3630811pxb; Mon, 24 Jan 2022 13:58:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdd/Fm3GvadyEcLTeledtApCs3odF4DabdTLfnDKYJ4IaWZ9k65j4S8+yhB6o96JXEvykU X-Received: by 2002:a17:90a:65c7:: with SMTP id i7mr327789pjs.116.1643061494956; Mon, 24 Jan 2022 13:58:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643061494; cv=none; d=google.com; s=arc-20160816; b=iI5P/NU2Xk2g7Lm88szqaDCb73DB+T1djLKj4lDfXb3wvBP0SDE/XKH+ej8oX5fiJ+ feQmW3AtFMxe7sfN5AZfoGmEnKg2y8Cwk/gEEL8sw7iWdPlWOezz9edKF5iPmmivySAy iryHc8Fwm8A0qrA/VrSNnw0bEDhMyB002bVpLiW1GM7CMPtI182bHrlXzHEgbJlRUzyN aGqI0keGor7ZEFg9KKnwTtmuvlqfUzDqdzSgmGI3fxbIvSNviP/Xki8yG8BcdJN3RFaT YSVumT6BOgSzmdUsdYvX3Ze6jYpQrULAPxv5Cm1pJXcyVxUBZF0SmebkhSTt2rwGKKxk VPcw== 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=Evw+NZmhumLiwiRCwTGQiMKlKeQeK1RP4ZsPCCDbEhY=; b=GGpNh7u4X/Xnn5DqMlOj0puqe61+8CIdRRLfN9gF6u0ZVeukN9JKqtjk0viFye4sVN St70yXXC218zHRqoOtvFo49HHFmGdR3hzuqToz//uM20slDP07u7HypRtQD4j87+k1JV xuCv0HJmJyadItAhkCE5JUNIfMLzlJnQ5uOl+px5Ky93KwEGRxN9JK7VFbDwOYs6XaKj lDr15/wKfadVZJMXelv/kIJhURUdo5fkBoPf8ZNpC+Iu6nBuGWVq3VBOrBEOzkgGEYHm c5rnU/3oJFfB0VSE9EQLqs15BNm5Ks5F6l/N/WZrYLOEnndlZ6h1f68QMToIM01y6xJD q09A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fDgPvDMx; 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 mu12si800607pjb.0.2022.01.24.13.57.55; Mon, 24 Jan 2022 13:58:14 -0800 (PST) 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=fDgPvDMx; 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 S1447251AbiAXVqd (ORCPT + 99 others); Mon, 24 Jan 2022 16:46:33 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:35602 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1448372AbiAXVMc (ORCPT ); Mon, 24 Jan 2022 16:12:32 -0500 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 dfw.source.kernel.org (Postfix) with ESMTPS id 5F56C6131F; Mon, 24 Jan 2022 21:12:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30496C340E5; Mon, 24 Jan 2022 21:12:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058750; bh=IjNxPGEtSYkVvnCwbHUvJvg0zijHBM+PZ9Fgl4BzepI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fDgPvDMxi5maui4pDfdzJp3zWSTYQRPMXKfTIhEhp89li4R6Sf3T0whgFEGwV2iEk X6IQ/0Ng50oCOvCkyaJNBFFvXly0Rh40Hwwg9Lu9koYigRbehOHvK0tHHLMcS4mWVz q997VIK41FdjCIPpdfLUR72zQcRLeXMnMZgjcovc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Minas Harutyunyan , Dinh Nguyen , Sasha Levin Subject: [PATCH 5.16 0390/1039] usb: dwc2: do not gate off the hardware if it does not support clock gating Date: Mon, 24 Jan 2022 19:36:19 +0100 Message-Id: <20220124184138.426988331@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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: Dinh Nguyen [ Upstream commit 34146c68083f1aef6709196b3dc888c1ceffd357 ] We should not be clearing the HCD_FLAG_HW_ACCESSIBLE bit if the hardware does not support clock gating. Fixes: 50fb0c128b6e ("usb: dwc2: Add clock gating entering flow by system suspend") Acked-by: Minas Harutyunyan Signed-off-by: Dinh Nguyen Link: https://lore.kernel.org/r/20220104135922.734776-1-dinguyen@kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/dwc2/hcd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 13c779a28e94f..f63a27d11fac8 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -4399,11 +4399,12 @@ static int _dwc2_hcd_suspend(struct usb_hcd *hcd) * If not hibernation nor partial power down are supported, * clock gating is used to save power. */ - if (!hsotg->params.no_clock_gating) + if (!hsotg->params.no_clock_gating) { dwc2_host_enter_clock_gating(hsotg); - /* After entering suspend, hardware is not accessible */ - clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); + /* After entering suspend, hardware is not accessible */ + clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); + } break; default: goto skip_power_saving; -- 2.34.1