From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuninori Morimoto Date: Fri, 04 Dec 2015 08:32:57 +0000 Subject: [PATCH 3/8 v2] thermal: rcar: check irq possibility in rcar_thermal_irq_xxx() Message-Id: <87d1umfwf6.wl%kuninori.morimoto.gx@renesas.com> List-Id: References: <87h9jyfwj7.wl%kuninori.morimoto.gx@renesas.com> In-Reply-To: <87h9jyfwj7.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Simon , Zhang Rui , Eduardo Valentin Cc: Magnus , linux-sh@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org From: Kuninori Morimoto Current rcar thermal driver sometimes checks irq possibility when it calls rcar_thermal_irq_enable/disable(), but sometimes not. This patch checks it inside rcar_thermal_irq_enable/disable(). Signed-off-by: Kuninori Morimoto --- v1 -> v2 - new patch drivers/thermal/rcar_thermal.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index 4d1bc2b..aaedf37 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -297,6 +297,9 @@ static void _rcar_thermal_irq_ctrl(struct rcar_thermal_priv *priv, int enable) unsigned long flags; u32 mask = 0x3 << rcar_id_to_shift(priv); /* enable Rising/Falling */ + if (!rcar_has_irq_support(priv)) + return; + spin_lock_irqsave(&common->lock, flags); rcar_thermal_common_bset(common, INTMSK, mask, enable ? 0 : mask); @@ -381,8 +384,7 @@ static int rcar_thermal_remove(struct platform_device *pdev) struct rcar_thermal_priv *priv; rcar_thermal_for_each_priv(priv, common) { - if (rcar_has_irq_support(priv)) - rcar_thermal_irq_disable(priv); + rcar_thermal_irq_disable(priv); thermal_zone_device_unregister(priv->zone); } @@ -468,8 +470,7 @@ static int rcar_thermal_probe(struct platform_device *pdev) goto error_unregister; } - if (rcar_has_irq_support(priv)) - rcar_thermal_irq_enable(priv); + rcar_thermal_irq_enable(priv); list_move_tail(&priv->list, &common->head); -- 1.9.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755578AbbLDIdH (ORCPT ); Fri, 4 Dec 2015 03:33:07 -0500 Received: from relmlor4.renesas.com ([210.160.252.174]:56677 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755275AbbLDIdC (ORCPT ); Fri, 4 Dec 2015 03:33:02 -0500 X-IronPort-AV: E=Sophos;i="5.20,380,1444662000"; d="scan'";a="199892136" Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Message-ID: <87d1umfwf6.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 3/8 v2] thermal: rcar: check irq possibility in rcar_thermal_irq_xxx() User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Simon , Zhang Rui , Eduardo Valentin CC: Magnus , , , In-Reply-To: <87h9jyfwj7.wl%kuninori.morimoto.gx@renesas.com> References: <87h9jyfwj7.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="US-ASCII" Date: Fri, 4 Dec 2015 08:32:57 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: KAWPR01CA0004.jpnprd01.prod.outlook.com (25.161.24.14) To SG2PR06MB1017.apcprd06.prod.outlook.com (25.161.9.25) X-Microsoft-Exchange-Diagnostics: 1;SG2PR06MB1017;2:OMUwJcMKRm3WKBpUq6m6XTEmozE7hmZRZLZ4oUkUIo/cb4C+5CZCemKikNlRCp8QVfymSNO5dzdiltk7mahz5trwQSOquKFiMZu8vmr8tNNxsnuymY/1L2IcQ0/pMlwHm4KBOR0lcCpzMIy5ERWnWw==;3:KG+dBHbamypoUouBT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U09CDOzi0k6mDqkpAZFbrrbTAnsQmKel9pUnZoRrxKgYHJwQ0ENWBbP3L6E/VBex1wlBalmjMEwFgLXoVX6YJYZcKH8DVe/XeJ174/bENHpKXuEUAT1f87zdH+Pr6vIsjF71qkukKMW12objz9w5Picr2PhNkqpXYGeb2gcXYxxCICiOd4ds/c/9RavoE5SdacGImzvcOoOMtgb+7wvGbuX/7o7B2J7/McnWRVh3SIqxPTxHBWWH/BjNUdqHJBVqFZ7W65saxRV7FGLtMB2I54sSpCxju4FrFPuXUQUPC2XOm8Jve35RnuKjhoOgkC5xZ2yD3rDPDqCURm4ANSM22aQUdN95GM4RvwT4A/i X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85106069007906); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(8121501046)(5005006)(10201501046)(3002001);SRVR:SG2PR06MB1017;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB1017; X-Forefront-PRVS: 07807C55DC X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(199003)(189002)(1096002)(189998001)(3846002)(101416001)(23726003)(36756003)(97736004)(2950100001)(586003)(81156007)(5001960100002)(6116002)(77096005)(92566002)(5004730100002)(5008740100001)(42186005)(50466002)(69596002)(50986999)(106356001)(53416004)(122386002)(40100003)(54356999)(66066001)(19580395003)(229853001)(47776003)(19580405001)(76176999)(87976001)(105586002)(46406003)(86362001)(5001770100001)(33646002)(83506001)(4001350100001);DIR:OUT;SFP:1102;SCL:1;SRVR:SG2PR06MB1017;H:morimoto-PC.renesas.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SG2PR06MB1017;23:zmE0AZr2V29yPXjZr8u5DKQolVB1KghD8KOPJGe8s?= =?us-ascii?Q?chCjfYZFm2J5TaGz23fqTcOIpr0bAqNxTLTa6Arc5aN1HQgBymJmw0Omz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4Ld0+mLaX1KtDGiFwL8jAiBtkk72uZUDK8?= =?us-ascii?Q?Dxbc261XrFqWvMuCyt77+O6+TBYozGlQKO6Uw9m37z32ImXw/ZnnFBgVwgC0?= =?us-ascii?Q?NkrrHoqktuYQHW5Bb/bPp6qE+HR5OpD1MT0hgbhcVAKoqQ21Wu5zpZB0GycK?= =?us-ascii?Q?0TtLI7gYWo=3D?= X-Microsoft-Exchange-Diagnostics: 1;SG2PR06MB1017;5:ZObig+MwxNdSaEr53u1yMwat3MChZ7ObkanH92a+0hi4yWnoixocOrwNKsoz9qTYbKrv5V98DrmyV6N+hjg/b8383bOOKycnPzH9iyKAVPRX46Y6drnBt1SAUMnDx7mUrodQ9XKG1dQkKVn6/jbNWw==;24:8TGByNFqeemVpXyd0kSguqr1RRBmdxTR0neDjX3uoB0KnNQ7j6M9EP4icqWeTYhHFC3QOxBI0V/oHtzRCJkwBv69+Tnw9Ao/l+XnlaspNvU=;20:62pnncFqg3jt9DRs/I9OmWrfz6SH9hefr/bc03t6OTdx6i60/fqN7GEgwhCFnu29+u5+DH4t4QdmMBHyUi4bJvF57FtlIlSWkMdQDEj4lHDWoNq1A42aOW7SzfI3I8iMRtOo864tpybuvwnce6oIuDskZxJjLUUJtPRjGIzb/As= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2015 08:32:57.5374 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB1017 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kuninori Morimoto Current rcar thermal driver sometimes checks irq possibility when it calls rcar_thermal_irq_enable/disable(), but sometimes not. This patch checks it inside rcar_thermal_irq_enable/disable(). Signed-off-by: Kuninori Morimoto --- v1 -> v2 - new patch drivers/thermal/rcar_thermal.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index 4d1bc2b..aaedf37 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -297,6 +297,9 @@ static void _rcar_thermal_irq_ctrl(struct rcar_thermal_priv *priv, int enable) unsigned long flags; u32 mask = 0x3 << rcar_id_to_shift(priv); /* enable Rising/Falling */ + if (!rcar_has_irq_support(priv)) + return; + spin_lock_irqsave(&common->lock, flags); rcar_thermal_common_bset(common, INTMSK, mask, enable ? 0 : mask); @@ -381,8 +384,7 @@ static int rcar_thermal_remove(struct platform_device *pdev) struct rcar_thermal_priv *priv; rcar_thermal_for_each_priv(priv, common) { - if (rcar_has_irq_support(priv)) - rcar_thermal_irq_disable(priv); + rcar_thermal_irq_disable(priv); thermal_zone_device_unregister(priv->zone); } @@ -468,8 +470,7 @@ static int rcar_thermal_probe(struct platform_device *pdev) goto error_unregister; } - if (rcar_has_irq_support(priv)) - rcar_thermal_irq_enable(priv); + rcar_thermal_irq_enable(priv); list_move_tail(&priv->list, &common->head); -- 1.9.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuninori Morimoto Subject: [PATCH 3/8 v2] thermal: rcar: check irq possibility in rcar_thermal_irq_xxx() Date: Fri, 4 Dec 2015 08:32:57 +0000 Message-ID: <87d1umfwf6.wl%kuninori.morimoto.gx@renesas.com> References: <87h9jyfwj7.wl%kuninori.morimoto.gx@renesas.com> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="US-ASCII" Return-path: In-Reply-To: <87h9jyfwj7.wl%kuninori.morimoto.gx@renesas.com> Sender: linux-kernel-owner@vger.kernel.org To: Simon , Zhang Rui , Eduardo Valentin Cc: Magnus , linux-sh@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-pm@vger.kernel.org From: Kuninori Morimoto Current rcar thermal driver sometimes checks irq possibility when it calls rcar_thermal_irq_enable/disable(), but sometimes not. This patch checks it inside rcar_thermal_irq_enable/disable(). Signed-off-by: Kuninori Morimoto --- v1 -> v2 - new patch drivers/thermal/rcar_thermal.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index 4d1bc2b..aaedf37 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -297,6 +297,9 @@ static void _rcar_thermal_irq_ctrl(struct rcar_thermal_priv *priv, int enable) unsigned long flags; u32 mask = 0x3 << rcar_id_to_shift(priv); /* enable Rising/Falling */ + if (!rcar_has_irq_support(priv)) + return; + spin_lock_irqsave(&common->lock, flags); rcar_thermal_common_bset(common, INTMSK, mask, enable ? 0 : mask); @@ -381,8 +384,7 @@ static int rcar_thermal_remove(struct platform_device *pdev) struct rcar_thermal_priv *priv; rcar_thermal_for_each_priv(priv, common) { - if (rcar_has_irq_support(priv)) - rcar_thermal_irq_disable(priv); + rcar_thermal_irq_disable(priv); thermal_zone_device_unregister(priv->zone); } @@ -468,8 +470,7 @@ static int rcar_thermal_probe(struct platform_device *pdev) goto error_unregister; } - if (rcar_has_irq_support(priv)) - rcar_thermal_irq_enable(priv); + rcar_thermal_irq_enable(priv); list_move_tail(&priv->list, &common->head); -- 1.9.1