Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2637189pxa; Mon, 17 Aug 2020 15:07:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNog3nQatAfaZsUjOzIHmp/Jq1FEJzIceVJ3ZbaStitk6OTBnMNF217FmBSooslRK9FCtZ X-Received: by 2002:a17:906:ca5a:: with SMTP id jx26mr16419688ejb.62.1597702023222; Mon, 17 Aug 2020 15:07:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597702023; cv=none; d=google.com; s=arc-20160816; b=I4sWXFp3otOyXwR2L6uJOt3Q4eaovbfRQHtX8y/9Mbouh2FsfqMrIGtt8w7+GUJGeA MNuOvPjNloMcUMHhqc3kSYi+u4yyxA/EfAJCITs4Jl45ATrDlqIb9bTfbYZpgoPLXcrx fVogrk158RSBQGUSIAnUaSYD4lUSH+G1OJB5Vk3fIA5gp7JJG/Wqe/4ZlbDcA/8ZnWOT sbPCx8by123wb+7g+SUjy+FURIYZYVBGxL90PMxt8eX8AW8BaX5kGMIrJwWEOZUhTrbg c5iQv+N8jkbSSGNvyor/3ngNrLBzpurev7RhTeU7UfAgpjQklyltCXv22C4TAGeQofRj Y+Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NaDEhDXWNqg8LPINL4aV8npSy7PP7PlcL9jGAjiey+0=; b=vdp7lHuOIaLtsUS9N6x0U6/zptv+4khH/Wf9HrlLOwzOvog+ZfNnYj96/X56F7BOlH nvmUepGbma0L7hdFZasbPZ8Qm2nWoyT3jeDX4gGzHAyeK3rwobY5+3Oq1JfNkzKa0IqV izgKibUDv8sXDC0y25+jQN+RRYXktyA7HxJga9SYtZiuau4s4Gs2/iJN6vwxqoC+JCcf P9T6o0A3lQ9EvqRaSvO+hDkBFv2Qcka6vdAYhad+L40sUEjDq4/l7gCjk9NZFwnC6AqU 8cfVe7nr0cGIVxFyXj3vjk6i2fpgHjthMR4LYCwDHpjDabmKmPObbu+rTZ3kkCwNdjRY nzaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HXoz2BUo; 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=fail (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 r20si11869430ejz.158.2020.08.17.15.06.39; Mon, 17 Aug 2020 15:07:03 -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=@kernel.org header.s=default header.b=HXoz2BUo; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388450AbgHQQIW (ORCPT + 99 others); Mon, 17 Aug 2020 12:08:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:57302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387727AbgHQPpt (ORCPT ); Mon, 17 Aug 2020 11:45:49 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EA43E2053B; Mon, 17 Aug 2020 15:45:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679148; bh=qCjkvgmmU7mm/aDr1MGFWcs+iVYgV6a/xKFymDiO9U4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HXoz2BUoW0Rz9PkFJdZfjqc4bCG3ktl09nRBA3mFkyy8tmExGkvBFweLSdi7J0KiT PwTz4m4sEkPplKKKCglskXlVVy66geHiRpGVL240Ult8oXG9zJtsynVeMjb+JMFH4P PZaZxtfPBPoMKUWtygX6vl+m0XRgIBofzkV/KW0U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Danesh Petigara , Al Cooper , Florian Fainelli , Felipe Balbi , Sasha Levin Subject: [PATCH 5.7 112/393] usb: bdc: Halt controller on suspend Date: Mon, 17 Aug 2020 17:12:42 +0200 Message-Id: <20200817143825.048580290@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Danesh Petigara [ Upstream commit 5fc453d7de3d0c345812453823a3a56783c5f82c ] GISB bus error kernel panics have been observed during S2 transition tests on the 7271t platform. The errors are a result of the BDC interrupt handler trying to access BDC register space after the system's suspend callbacks have completed. Adding a suspend hook to the BDC driver that halts the controller before S2 entry thus preventing unwanted access to the BDC register space during this transition. Signed-off-by: Danesh Petigara Signed-off-by: Al Cooper Acked-by: Florian Fainelli Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin --- drivers/usb/gadget/udc/bdc/bdc_core.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c index 5fde5a8b065c1..2dca11f0a7444 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_core.c +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c @@ -603,9 +603,14 @@ static int bdc_remove(struct platform_device *pdev) static int bdc_suspend(struct device *dev) { struct bdc *bdc = dev_get_drvdata(dev); + int ret; - clk_disable_unprepare(bdc->clk); - return 0; + /* Halt the controller */ + ret = bdc_stop(bdc); + if (!ret) + clk_disable_unprepare(bdc->clk); + + return ret; } static int bdc_resume(struct device *dev) -- 2.25.1