From patchwork Mon Dec 10 07:09:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lokesh Vutla X-Patchwork-Id: 1855421 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 2C3B9E0164 for ; Mon, 10 Dec 2012 07:09:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752494Ab2LJHJw (ORCPT ); Mon, 10 Dec 2012 02:09:52 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:45113 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752209Ab2LJHJb (ORCPT ); Mon, 10 Dec 2012 02:09:31 -0500 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id qBA79OGw009168; Mon, 10 Dec 2012 01:09:25 -0600 Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id qBA79Ofj004485; Mon, 10 Dec 2012 12:39:24 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Mon, 10 Dec 2012 12:39:24 +0530 Received: from a0131933lt.apr.dhcp.ti.com (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with ESMTP id qBA79KlN030499; Mon, 10 Dec 2012 12:39:24 +0530 From: Lokesh Vutla To: CC: , , , , , Nishanth Menon Subject: [PATCH 5/9] memory: emif: use restart if power_off not present when out of spec Date: Mon, 10 Dec 2012 12:39:14 +0530 Message-ID: <1355123358-5273-6-git-send-email-lokeshvutla@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1355123358-5273-1-git-send-email-lokeshvutla@ti.com> References: <1355123358-5273-1-git-send-email-lokeshvutla@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Nishanth Menon Some machine or kernel variants might have missed implementation of power off handlers. We DONOT want to let the system be in "out of spec" state in this condition. So, WARN and attempt a machine restart in the hopes of clearing the out-of-spec temperature condition. NOTE: This is not the safest option, but safer than leaving the system in unstable conditions. Signed-off-by: Nishanth Menon --- drivers/memory/emif.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c index ffbdf9e..625732d 100644 --- a/drivers/memory/emif.c +++ b/drivers/memory/emif.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include "emif.h" #include "of_memory.h" @@ -1013,7 +1014,13 @@ static irqreturn_t emif_threaded_isr(int irq, void *dev_id) if (emif->temperature_level == SDRAM_TEMP_VERY_HIGH_SHUTDOWN) { dev_emerg(emif->dev, "SDRAM temperature exceeds operating limit.. Needs shut down!!!\n"); - kernel_power_off(); + /* If we have Power OFF ability, use it, else try restarting */ + if (pm_power_off) { + kernel_power_off(); + } else { + WARN(1, "FIXME: NO pm_power_off!!! trying restart\n"); + kernel_restart("SDRAM Over-temp Emergency restart"); + } return IRQ_HANDLED; }