From patchwork Fri Jul 24 18:23:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11684079 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 53E06913 for ; Fri, 24 Jul 2020 18:27:07 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 21830206F0 for ; Fri, 24 Jul 2020 18:27:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3C72QKhh"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="j31dWumh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 21830206F0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1jc4byG4VxP77YQ32g81hgJKlrRX9qqr8twPow6vRRQ=; b=3C72QKhhX7UxS0z4zADhXZUVvC RwN9vjk/LQ8xce3SBARvdDYmr54VKJy1WV4e9qmnAQPC3olihwYrelbzr6EMP3O+PWqQe+avWXx9o bhmE4YOItu7POYvBIIVIpATzV9hGuifeHhHs4kfZ/JMfxpJSUVoXtXWelWZ131aWByK9x4o4uf6Er wNi4Vpp+Fgj/5oQnURTscm2bRYTMXk0d5urQMeEwiVyo3QW/8MCwnKBIHoK2Uh3L1pNGx/+xSSbBy sI/vji+odPo0KguYjCiD/6OR+xcBrYAta+Vp2hA+oDzvS49PZDu85+rD/ntJRc6Y+a4ygWWYZGkd7 MQuOnz1g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jz2Nf-0002Js-29; Fri, 24 Jul 2020 18:25:15 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jz2NE-00027M-1P for linux-arm-kernel@lists.infradead.org; Fri, 24 Jul 2020 18:24:48 +0000 Received: from kozik-lap.mshome.net (unknown [194.230.155.213]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1C59D2070E; Fri, 24 Jul 2020 18:24:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595615087; bh=x7xMPArX2Q8l2DRbmFscnClk9ELgBMvWmqASsxDhbfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j31dWumhoDOzSWirJxjWIezRfGLMLhjbROt5uNI8OIOlYwx76qTFnhOAKg0DKEsmi 67JXGcHTpUlZS+i63RgYBLAeKpFN5z0+wIT9YBUWzHmPtKEsLMHP5JkNNtGf8KpEJx pLaaUXFbqLOGCcqs9k64pNZTjlD786U8B6GUuPlE= From: Krzysztof Kozlowski To: Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Russell King , Catalin Marinas , Will Deacon , Krzysztof Kozlowski , Markus Mayer , Roger Quadros , Tony Lindgren , Vladimir Zapolskiy , Kukjin Kim , Lukasz Luba , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org Subject: [RFT 08/16] memory: omap-gpmc: Use WARN() instead of BUG() on wrong free Date: Fri, 24 Jul 2020 20:23:20 +0200 Message-Id: <20200724182328.3348-9-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200724182328.3348-1-krzk@kernel.org> References: <20200724182328.3348-1-krzk@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200724_142448_201032_4E957276 X-CRM114-Status: GOOD ( 13.06 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Olof Johansson , Arnd Bergmann MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Since driver tracks reserved memory, freeing a non-reserved GPMC should not be fatal and crash the system. Printing a warning is friendlier. Signed-off-by: Krzysztof Kozlowski --- Not tested on HW. --- drivers/memory/omap-gpmc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 9339a7c75fdd..414bfb481266 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -1072,8 +1072,7 @@ void gpmc_cs_free(int cs) spin_lock(&gpmc_mem_lock); if (cs >= gpmc_cs_num || cs < 0 || !gpmc_cs_reserved(cs)) { - printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs); - BUG(); + WARN(1, "Trying to free non-reserved GPMC CS%d\n", cs); spin_unlock(&gpmc_mem_lock); return; }