From patchwork Mon Aug 17 15:14:46 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: 266211 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=ham 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 EB3D1C433E1 for ; Mon, 17 Aug 2020 18:24:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C826D20716 for ; Mon, 17 Aug 2020 18:24:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597688677; bh=nLJEez5D3+KWTGWkl7L3ZwkzvHX5nNJKbSCaoB6TIp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=YnjZIsUHqsZhH+TgXbb0rsutZ7NA48Uol1h0RsKngRLbY0DLa0718ix5Dcxpn6N/3 ZNSDRDQ+7umfGrnFuYETPv3f5yR7ydOavZQ2fFxawpDcQXnE1mlXJQ/zoVSPKk0zm0 Fh218N/jSB8OA5guDUYS+lZ1dmbcJ+VQtr/U7f8Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390810AbgHQSYg (ORCPT ); Mon, 17 Aug 2020 14:24:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:50646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731039AbgHQQDF (ORCPT ); Mon, 17 Aug 2020 12:03:05 -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 EB5F120729; Mon, 17 Aug 2020 16:03:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680185; bh=nLJEez5D3+KWTGWkl7L3ZwkzvHX5nNJKbSCaoB6TIp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J2oqFalbkckYAf6ihzl1nZyCEiM8VffQENB0pJ/AgJ6yRk7zRwyiTivryFxsjQg/v eMqFSVUsZNSSVmUKAQjlH0GktNhw4qPaLJemBEquiUHDP3yJJOKtXF7NPA7t1OWFbm wifAVYBTUt4CM1X2MaTsEuz/+WIzyKc4+czpL30c= 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.4 085/270] usb: bdc: Halt controller on suspend Date: Mon, 17 Aug 2020 17:14:46 +0200 Message-Id: <20200817143800.003536313@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143755.807583758@linuxfoundation.org> References: <20200817143755.807583758@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 174555e94a6c0..3d33499db50b5 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_core.c +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c @@ -605,9 +605,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)