Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2107171lqz; Tue, 2 Apr 2024 07:28:00 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUqm39I2cK/UwjQSkbtX7ayQln8/uPpgY2dErpVQwHeu5ItbhML5eKSWJp43oYcMKEzOKHfJ07Qv0+REgZkiQNSwfkHLJpmA03NxPSelQ== X-Google-Smtp-Source: AGHT+IHPSCUHbgz1Gyq5JIfvMM7eIvYmfH87pBfsbSaxXJbadBCW//n9htU/aSTmmzhVYLHZtL/L X-Received: by 2002:a17:902:b602:b0:1e0:abeb:8fb4 with SMTP id b2-20020a170902b60200b001e0abeb8fb4mr8978797pls.41.1712068080167; Tue, 02 Apr 2024 07:28:00 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z12-20020a170902834c00b001dddd1df881si10813948pln.295.2024.04.02.07.27.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 07:28:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128131-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b="ka/TmWA3"; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-128131-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128131-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C36BC283B09 for ; Tue, 2 Apr 2024 14:27:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0DC886AFC; Tue, 2 Apr 2024 14:27:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ka/TmWA3" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FD528615E for ; Tue, 2 Apr 2024 14:27:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712068074; cv=none; b=gKMW3cg/9hCvX0gQcLNxH1gU2tvcjYhUehHLE6hSE0USDxiVxPbmBmkPKLAF7KMTLr54lUlOWban0sMfxLJ950xV0+0cdTCN7hza5O4cxaSWhY/pUNNUBS+MrZjE5QuO8JyzgNVWxiZ7an6irxGuGLydlvl5S5+lDun69yqR7Qw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712068074; c=relaxed/simple; bh=ZSgVBOH7JXa+1vKhQpi7bkdSxzUCt7bmMNzjk/zbVw4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LQN0vwWQxnomQKneHf2giLC4cwgNAiE3Rn3KcFF772uu3aK6NUXyy5oKqY3eFfIrTlQWfHekmVyJcGi3QAcz6rYJIHIeowrdj8M5Do6f+WHGjvUByqeRyRWyzZ5SoBxH5bWHjoaaWb4KhKn4KspWWl4/SveDBOx449N+WVaQTzs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ka/TmWA3; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712068072; x=1743604072; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ZSgVBOH7JXa+1vKhQpi7bkdSxzUCt7bmMNzjk/zbVw4=; b=ka/TmWA3ehPmL1HEUlgP3Vj4YXtOufl1ZbPZfrxLIZH/bzO2q8jvXjSO AOY72q1ckrerzDaosu8i4R/ZV8XUUKR11iDlsPCq80cnkqzmNtoRC9Jgo 1KEss8nqyCr8L1EXVANJFUejvKJwhp3u3wOQytaWm+aliUPoVIQu7kiBs ThnwPj9nFyaSoOu5zMfAfvUJ+K8GgSXNcDxZmsw8JE2FoFkxbMrlGHMin cXY6jYSVHITLzYAh4QhK08AOf+t5/AAw27X8zZtSkrpanj5xqNZqfPKvP PTqfAFCeiIKSoDa1xiDBbLBMAopwIOoHaRHuwQoWcEZSgYxuSpBezR0zc Q==; X-CSE-ConnectionGUID: rGIxRCRDSTWqAGzGJfnXTg== X-CSE-MsgGUID: +jfxzMncRquXN0BzghQqsA== X-IronPort-AV: E=McAfee;i="6600,9927,11032"; a="10205330" X-IronPort-AV: E=Sophos;i="6.07,175,1708416000"; d="scan'208";a="10205330" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2024 07:27:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11032"; a="915142839" X-IronPort-AV: E=Sophos;i="6.07,175,1708416000"; d="scan'208";a="915142839" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2024 07:27:49 -0700 Received: from andy by smile with local (Exim 4.97) (envelope-from ) id 1rrf74-00000000phT-3nOm; Tue, 02 Apr 2024 17:27:46 +0300 Date: Tue, 2 Apr 2024 17:27:46 +0300 From: Andy Shevchenko To: "fengchunguo@126.com" Cc: ilpo.jarvinen@linux.intel.com, gregkh@linuxfoundation.org, jirislaby@kernel.org, linux-kernel@vger.kernel.org, Gary Feng Subject: Re: [PATCH] tty: serial: fixed uart irq maybe cause irq storm Message-ID: References: <1711966746-225228-1-git-send-email-fengchunguo@126.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1711966746-225228-1-git-send-email-fengchunguo@126.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Mon, Apr 01, 2024 at 06:19:06PM +0800, fengchunguo@126.com wrote: > From: "Gary Feng" > > if not disable uart irq before disable clk, uart irq maybe triggered after > disabled clk immediately, then maybe cause irq storm. > > Reproduced the below call trace, see i2c not be connected, but irq storm > was triggered. > i2c_designware 30b70000.i2c: controller timed out > CPU: 2 PID: 2932 Comm: gnss@1.0-servic > Tainted: G O 5.14.61-00094-geaa0149416cc-dirty #8 > Hardware name: Semidrive kunlun x9 REF Board (DT) > Call trace: > [] dump_backtrace+0x0/0x3c0 > [] show_stack+0x14/0x1c > [] dump_stack+0xc4/0xfc > [] __report_bad_irq+0x50/0xe0 > [] note_interrupt+0x248/0x28c > [] handle_irq_event+0x78/0xa4 > [] handle_fasteoi_irq+0xe4/0x1b4 > [] __handle_domain_irq+0x7c/0xbc > [] gic_handle_irq+0x4c/0xb8 > [] el1_irq+0xb0/0x124 > [] _raw_spin_unlock_irqrestore+0x10/0x44 > [] dw8250_set_termios+0x48/0xf4 > [] serial8250_set_termios+0x14/0x28 > [] uart_change_speed+0x38/0x10c > [] uart_set_termios+0xd0/0x17c > [] tty_set_termios+0x160/0x1e4 > [] set_termios+0x32c/0x3bc > [] tty_mode_ioctl+0x6f0/0x7d8 > [] n_tty_ioctl_helper+0x10c/0x1e8 > [] n_tty_ioctl+0x120/0x194 > [] tty_ioctl+0x658/0xa34 > [] do_vfs_ioctl+0x554/0x810 > [] SyS_ioctl+0x88/0x94 > Exception stack(0xffff00000ccf3ec0 to 0xffff00000ccf4000 Please read https://www.kernel.org/doc/html/latest/process/submitting-patches.html#backtraces-in-commit-messages and update the commit message accordingly. .. > + /*Need disable uart irq before disabled clk, because uart irq maybe triggered after > + * disabled clk immediately, then cause irq storm. > + */ /* * Use canonical multi-line comment * style and make sure the lines are not * too long. */ .. FWIW, the patch that compares this with current clock rate most likely will be reverted, meaning your fix might be not needed anymore, or has to be rebased. -- With Best Regards, Andy Shevchenko