Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7266345imu; Mon, 3 Dec 2018 10:07:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/XzoioFkZI/5aJF8tDznQWq5OKBS+3m0ExXDdzWksAqYxUKnS5DZcrA7YNrQ+pCuluMISMw X-Received: by 2002:a17:902:ab84:: with SMTP id f4mr16481977plr.207.1543860447379; Mon, 03 Dec 2018 10:07:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543860447; cv=none; d=google.com; s=arc-20160816; b=vW3eiEjN5IWfrkM6du0X+mELBmZiKJOOUqOk78gNWkHwJuzt3xhpq+RdnSC1FIxT01 cDuuP5IX+CrrX9UNNWjHKnUAHWmvhilqSz+XpIHbbZW9q1K9zyj1gFHHi5rrfw4dXG3/ s0Xub7qGktXjfvMmFw5JfFu94X9idrl7TJNzJhOVzdQNWuyxlguFCvx22+5uy74PcgNE 6BczWZnISMXSBhAUyEkn5ycXFxA4XtA2FIf9DlRD/0DEgi+fAo7yi37B1KJzcHRWQLRf kMXC+CAPEm5UY2mm3VowSPmPnTSl7Gl+KLalsswfqis83ORXwbywGwGIAkGC2QY/HyBm mqqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TksQgbjjwn1mr6QYnWdBe1iiWmWJnzhsC8eitRHpofU=; b=hP44AEMO7XYgKe4IBUrTOEoferzIu+MLri1QtdnryDawDJl1vL1acnPVFbacZJn68U oX+3uRYl4LOtOL3P9kCdL9NXdK6P6qHsVhmWRb4EnlB2mNTqikvw6PWlM77wN4u0rNEY d0zHmUA5XhnCzkaDEuQlQFnqEZwFT5FhobS2jgSwvPio2L2ycUZM2ZX6uAuQcMBEHRVU le674yY/ayrt9sLtOeQk6xms43iiDqRaoPZQgQEqSpR5WE6lw3LQTXXH0JvfkcXHaRDD FvgpE5ffPK2kkE5AcrvraIMPXafLemg+UgW2rwQjIFCPgUs3oqQWgIi1rHxMLzH906og sk3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qhptneei; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x8si13226912pll.187.2018.12.03.10.06.46; Mon, 03 Dec 2018 10:07:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qhptneei; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726837AbeLCSF3 (ORCPT + 99 others); Mon, 3 Dec 2018 13:05:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:43144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726221AbeLCSF3 (ORCPT ); Mon, 3 Dec 2018 13:05:29 -0500 Received: from localhost (unknown [62.119.166.9]) (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 3211220850; Mon, 3 Dec 2018 18:05:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543860326; bh=2ivgRcZk9QiECILfE4o4lTW0ZERIpCDsRI+jjRT8ZXw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qhptneeiW0ohghymH2hSVgLQcAky77JA1ws7CRFYa44ZSCby2FEt8l2L6XAcrdMOk p1XEpB3PUp1WN2bw0WQiyECzuRNHCvs3uSHFWn9gGz5t2CFosjRciqSnZLXNcjMN48 E2DMX5cBUiCrld2LLBxe8hWXIHMwvGigJPSwl/eU= Date: Mon, 3 Dec 2018 19:05:21 +0100 From: Greg KH To: Sasha Levin Cc: Daniel Lezcano , Rafael David Tinoco , rui.zhang@intel.com, edubezval@gmail.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: v4.14 fix for Hikey 960 unbalanced IRQ enablement Message-ID: <20181203180521.GA15996@kroah.com> References: <20181203133107.4002-1-rafael.tinoco@linaro.org> <20181203141442.GA19335@kroah.com> <20181203151946.GG235790@sasha-vm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181203151946.GG235790@sasha-vm> User-Agent: Mutt/1.11.0 (2018-11-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 03, 2018 at 10:19:46AM -0500, Sasha Levin wrote: > On Mon, Dec 03, 2018 at 03:42:41PM +0100, Daniel Lezcano wrote: > > On 03/12/2018 15:14, Greg KH wrote: > > > On Mon, Dec 03, 2018 at 11:31:02AM -0200, Rafael David Tinoco wrote: > > > > Sasha, could you consider including this cherry-picked patchset in v4.14. > > > > > > > > Kernel v4.14 might suffer from the following unbalanced enablement for the board Hikey 960: > > > > > > > > Nov 5 12:02:54 hikey kernel: [ 22.148194] Unbalanced enable for IRQ 44 > > > > Nov 5 12:02:54 hikey kernel: [ 22.152193] ------------[ cut here ]------------ > > > > Nov 5 12:02:54 hikey kernel: [ 22.156872] WARNING: CPU: 2 PID: 509 at /home/inaddy/work/sources/linux/stable/stable-linux-4.14.y/kernel/irq/manage.c:525 __enable_irq+0x78/0x80 > > > > Nov 5 12:02:54 hikey kernel: [ 22.249606] CPU: 2 PID: 509 Comm: kworker/2:2 Not tainted 4.14.79 #1 > > > > Nov 5 12:02:54 hikey kernel: [ 22.255975] Hardware name: HiKey Development Board (DT) > > > > Nov 5 12:02:54 hikey kernel: [ 22.261248] Workqueue: events_freezable thermal_zone_device_check > > > > Nov 5 12:02:54 hikey kernel: [ 22.267368] task: ffff8000616e0e00 task.stack: ffff00000b5f0000 > > > > Nov 5 12:02:54 hikey kernel: [ 22.273312] PC is at __enable_irq+0x78/0x80 > > > > Nov 5 12:02:54 hikey kernel: [ 22.277516] LR is at __enable_irq+0x78/0x80 > > > > Nov 5 12:02:54 hikey kernel: [ 22.281718] pc : [] lr : [] pstate: 000001c5 > > > > Nov 5 12:02:54 hikey kernel: [ 22.289129] sp : ffff00000b5f3c80 > > > > Nov 5 12:02:54 hikey kernel: [ 22.292457] x29: ffff00000b5f3c80 x28: 0000000000000000 > > > > Nov 5 12:02:54 hikey kernel: [ 22.297804] x27: ffff80005c139e38 x26: ffff000008a71870 > > > > Nov 5 12:02:54 hikey kernel: [ 22.303148] x25: 0000000000000000 x24: 0000000000000002 > > > > Nov 5 12:02:54 hikey kernel: [ 22.308492] x23: ffff00000b5f3d9c x22: ffff80005d565e88 > > > > Nov 5 12:02:54 hikey kernel: [ 22.313836] x21: 000000000000f980 x20: 000000000000002c > > > > Nov 5 12:02:54 hikey kernel: [ 22.319181] x19: ffff800061726000 x18: 0000000000000010 > > > > Nov 5 12:02:54 hikey kernel: [ 22.324524] x17: 0000000000000000 x16: 0000000000000000 > > > > Nov 5 12:02:54 hikey kernel: [ 22.329868] x15: ffffffffffffffff x14: ffff000009269c08 > > > > Nov 5 12:02:54 hikey kernel: [ 22.335213] x13: ffff00008940678f x12: ffff000009406797 > > > > Nov 5 12:02:54 hikey kernel: [ 22.340558] x11: ffff000009290000 x10: ffff00000b5f3980 > > > > Nov 5 12:02:54 hikey kernel: [ 22.345902] x9 : 00000000ffffffd0 x8 : ffff00000862c298 > > > > Nov 5 12:02:54 hikey kernel: [ 22.351246] x7 : 6c62616e65206465 x6 : 00000000000001b2 > > > > Nov 5 12:02:54 hikey kernel: [ 22.356589] x5 : 0000000000000000 x4 : 0000000000000000 > > > > Nov 5 12:02:54 hikey kernel: [ 22.361931] x3 : 0000000000000000 x2 : ffff800063e824c8 > > > > Nov 5 12:02:54 hikey kernel: [ 22.367275] x1 : 000080005af95000 x0 : 000000000000001c > > > > Nov 5 12:02:54 hikey kernel: [ 22.372618] Call trace: > > > > Nov 5 12:02:54 hikey kernel: [ 22.375088] Exception stack(0xffff00000b5f3b40 to 0xffff00000b5f3c80) > > > > Nov 5 12:02:54 hikey kernel: [ 22.381560] 3b40: 000000000000001c 000080005af95000 ffff800063e824c8 0000000000000000 > > > > Nov 5 12:02:54 hikey kernel: [ 22.389417] 3b60: 0000000000000000 0000000000000000 00000000000001b2 6c62616e65206465 > > > > Nov 5 12:02:54 hikey kernel: [ 22.397276] 3b80: ffff00000862c298 00000000ffffffd0 ffff00000b5f3980 ffff000009290000 > > > > Nov 5 12:02:54 hikey kernel: [ 22.405136] 3ba0: ffff000009406797 ffff00008940678f ffff000009269c08 ffffffffffffffff > > > > Nov 5 12:02:54 hikey kernel: [ 22.412994] 3bc0: 0000000000000000 0000000000000000 0000000000000010 ffff800061726000 > > > > Nov 5 12:02:54 hikey kernel: [ 22.420852] 3be0: 000000000000002c 000000000000f980 ffff80005d565e88 ffff00000b5f3d9c > > > > Nov 5 12:02:54 hikey kernel: [ 22.428710] 3c00: 0000000000000002 0000000000000000 ffff000008a71870 ffff80005c139e38 > > > > Nov 5 12:02:54 hikey kernel: [ 22.436569] 3c20: 0000000000000000 ffff00000b5f3c80 ffff00000813e010 ffff00000b5f3c80 > > > > Nov 5 12:02:54 hikey kernel: [ 22.444426] 3c40: ffff00000813e010 00000000000001c5 0000000000000000 0000000000000000 > > > > Nov 5 12:02:54 hikey kernel: [ 22.452286] 3c60: ffffffffffffffff ffff800061800618 ffff00000b5f3c80 ffff00000813e010 > > > > Nov 5 12:02:54 hikey kernel: [ 22.460144] [] __enable_irq+0x78/0x80 > > > > Nov 5 12:02:54 hikey kernel: [ 22.465394] [] enable_irq+0x40/0x78 > > > > Nov 5 12:02:54 hikey kernel: [ 22.470493] [] hisi_thermal_get_temp+0x1b0/0x1d8 [hisi_thermal] > > > > Nov 5 12:02:54 hikey kernel: [ 22.478008] [] of_thermal_get_temp+0x38/0x50 > > > > Nov 5 12:02:54 hikey kernel: [ 22.483869] [] thermal_zone_get_temp+0x58/0x80 > > > > Nov 5 12:02:54 hikey kernel: [ 22.489903] [] thermal_zone_device_update.part.4+0x2c/0x1a8 > > > > Nov 5 12:02:54 hikey kernel: [ 22.497066] [] thermal_zone_device_check+0x40/0x50 > > > > Nov 5 12:02:54 hikey kernel: [ 22.503457] [] process_one_work+0x19c/0x3d0 > > > > Nov 5 12:02:54 hikey kernel: [ 22.509236] [] worker_thread+0x4c/0x428 > > > > Nov 5 12:02:54 hikey kernel: [ 22.514664] [] kthread+0x134/0x138 > > > > Nov 5 12:02:54 hikey kernel: [ 22.519659] [] ret_from_fork+0x10/0x1c > > > > Nov 5 12:02:54 hikey kernel: [ 22.524988] ---[ end trace 328d4bb2d9b066a0 ]--- > > > > > > > > This issue was solved when "hisi_thermal_alarm_irq" function was removed so only > > > > "hisi_thermal_alarm_irq_thread" would exist. This has fixed the issue for the > > > > unbalanced enablement since there is no more: > > > > > > > > disable_irq_nosync(irq); > > > > data->irq_enabled = false; > > > > > > > > logic being done in parallel to the threaded handler AND the > > > > thermal_zone_device_update() call only happens now if the temperature is already > > > > above the threshold. > > > > > > > > > > So should we revert a patch instead of taking these new ones? Would > > > that be easier and is this a "real" issue or just an annoying warning > > > splat in the kernel log? > > > > Actually, this warning is introduced with the driver and all the > > plumbers around to fix an irq bouncing. There is no patch to revert > > without removing the driver. > > Greg, > > Patch 5 in this series seems to explain the best what is happening here: > > > With the following changes, we fix all in one: > > > > - Do the setup, one time, at probe time > > > > - Add the IRQF_ONESHOT, ack the interrupt in the threaded handler > > > > - Remove the interrupt handler > > > > - Set the correct value for the LAG register > > > > - Remove all the irq_enabled stuff in the code as the interruption > > handling is fixed > > > > - Remove the 3ms delay > > > > - Reorder the initialization routine to be in the right order > > We can't revert anything because the breakage was there since the driver > was introduced. So the driver was broken in 4.14, why not just use 4.19 instead? This isn't a 4.14 regression, it's something that obviously no one has noticed for a year now, so why backport these big patches to 4.14 now? thanks, greg k-h