From patchwork Mon Aug 17 15:12:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 266088 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9A1DC433DF for ; Mon, 17 Aug 2020 19:04:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A51C320738 for ; Mon, 17 Aug 2020 19:04:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597691064; bh=qCjkvgmmU7mm/aDr1MGFWcs+iVYgV6a/xKFymDiO9U4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=wjn2Eh6dvTC0YFF4e3LxQOH/DyiCtaMkBQv7jnvuMGMFhZTeXcJ9remz9w2ecW1Gl oiIhOtV6Zh/HylUzp63HC8huNLLB47w+rxXDGs1EPbxsKascGBHLhByaKBUintYkF0 W7r8OkFAMALWIyy3LYEMsQKws5Um/za0AyU+iEkk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387734AbgHQPpw (ORCPT ); Mon, 17 Aug 2020 11:45:52 -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 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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)