Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2663807pxa; Mon, 17 Aug 2020 15:56:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBVJM2d9o7A5JMJsr9ro8TC+8TLhSdpS/v3rEm0zRexKlmb9R4higBi/o8gNo7bbdrU9gF X-Received: by 2002:a17:906:e0c2:: with SMTP id gl2mr17202284ejb.160.1597704976942; Mon, 17 Aug 2020 15:56:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704976; cv=none; d=google.com; s=arc-20160816; b=g7Up+ttV9AIGIj1t17alwiVaESw4xXIyjDtBFEl392lLi65rEpY11FhJXPAmYFsmh1 XdJ0B7/vKq/1egwEt4D1OErYqrSSQNjpxoVQBUgWfT+1xG35rwGW77S3gTA491f0u7ZM 9bqSmNEZZkvgjnPRekGkdcdFhMrITnkpxbBESLbX5+Ta+RkZjEFj99jGl2/0xlg28kaB TPOqgcUVVejDvHH5WBPTrDlZz8lhMYANxJ235lupAW+O5hzrrwg1GT9FldyTqlYd3o3r VVLtqoAuk4y4aBPU37XzRofCKqpn3wOLaFiAbMoJDzkznAEstpTpOoKj2GSLMAcY7omH KiHw== 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=Mx9nRIOS58j9syMLEDfGsdKHi5uP8E+fB4PcNWEh3TwiSDy4DpiPp9Mb0vHz6YLhpt h9Zp9ZOKB2kP78o3iNvDq9oH0h1lCLeHykqoH3kaSP56fsakPMecvotX66L4Jyrds+xr z97O876tTZFiDtZm2Ve5XmnD681PJv1Y03RRgC1dn0WKHsTuiTHWMprkSIUWqjKTMoxQ BtwSarOTu0s/gKEXG6i5paRbnBtBJRGtoB52SbpMSjIt8ixOWR7AkI3LYxi8lYm+3cxJ 2yk5eUJ/zcoNi9bCOWvPvM++USaV9kLjOcy+gXUxY+WxUleAI9iqJUPsYzLuknyvWEns AJ1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1P2IxHbC; 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 l21si11383264edw.181.2020.08.17.15.55.52; Mon, 17 Aug 2020 15:56:16 -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=1P2IxHbC; 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 S1732501AbgHQTmo (ORCPT + 99 others); Mon, 17 Aug 2020 15:42:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:53702 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729621AbgHQPYH (ORCPT ); Mon, 17 Aug 2020 11:24:07 -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 B849923442; Mon, 17 Aug 2020 15:24:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597677847; bh=qCjkvgmmU7mm/aDr1MGFWcs+iVYgV6a/xKFymDiO9U4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1P2IxHbCkZkXFW0yZkP4Ad7MBw8Xv2FCvLguMMtAVi1jJetZZBvWmdJ/J+GfzKRp9 oTSy2SW35LNTV0FbMNVqB79OQnKg4ytkT/fcK0VAolhbyRQ3qCT7uPDCem2Ka5taLs o3jWXisYEJOo5/d2E/KbLCeQcRqEdWsMQcUREXL4= 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.8 130/464] usb: bdc: Halt controller on suspend Date: Mon, 17 Aug 2020 17:11:23 +0200 Message-Id: <20200817143840.040292115@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@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