Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1346659lqz; Mon, 1 Apr 2024 03:32:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU3TyDaMd1NiPPvOh15LSXx/sMx8Paeu8evbIzMXMgFnEgd55+A7gau7mXp7mheGRm74inPjAeIr/rLd9LDsCSE3f1gUhQkcRbYYIdPPg== X-Google-Smtp-Source: AGHT+IHUpzsxvcjZ9HSzmAYYCXjdQBnvEPQ62ntrK0ZtkdK9kwcJ574JGP8aEOCHWQuWxTozp4Vq X-Received: by 2002:a05:6a00:1252:b0:6e8:3d35:a880 with SMTP id u18-20020a056a00125200b006e83d35a880mr9519372pfi.7.1711967568494; Mon, 01 Apr 2024 03:32:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711967568; cv=pass; d=google.com; s=arc-20160816; b=g17MdmMDNOHrH0eyrd9kdOPiiZ/QU6P2rdNPXMvYaEOHgLaWYCq7h3NDJrx9ZcbhiM O6VUEPRSB3yBtR7aanx/9MIt0+D5wQl4gtIZvKO9QkMbwg6U7n4geg4Hdm6nNVfu9UAW i56VxiD04pA+XItdlMauDoB/8pnBw6IBqnBq32xKyYzvOl3qDHQvepyHE33Edmi6atRY hC57shFrJCoZpr93roe6QYhRfgwEGv1G0nzX8B7FbHEnh1T7vI8HqnJ4UT+aVDExiDSn bH6rwbEJ5Nuvz5Ih/kOsNFCe6uNlrSNDFvyCKPxmcg4bU6LyzVR9eFdDkPIWUewwCthy GSpQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=TUmyVgd177lZ3MYljOhaPf/ZU1PaRnNdkoZcppwbIBM=; fh=+bEVnGnXqMHdDEO8Qo0VY9JCI5HEYvYRvDlWfmxnURA=; b=iSJ+hd+7r72w8bUWUvhMAJuHs0vcED+igFWrFbL2zsOUzElIBHzQyolQFXC1Szjyfn TjVLDvFqX67ctApjoz3dm4vnCz/URCnk4ZWgGgrleTEc3FTd0IaxUbFdzBJXVzjKY3o4 GanTPbPNu8bDGMaVb8xmesI5CZjaigayeYVXs8ZdRjEZJTAAgIIJwZkupMnuO8y8gK/P nRW/xxDP5o5UYCKlxHFSx9mGLOsq0W7cid206K4wBCT//ed/gG6Ap6QQM78M8Eu3I8DO CZI6u377YH3D5eDSBw4gU8WCJhj0bNFjLqO8xaN8YFQDgqIS7+g/BqxKc0vfML7sj6vj ZLRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=L4rEMlVh; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-126596-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-126596-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k188-20020a633dc5000000b005dcd29596e2si9080760pga.608.2024.04.01.03.32.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 03:32:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-126596-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=pass header.i=@linuxfoundation.org header.s=korg header.b=L4rEMlVh; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-126596-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-126596-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org 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 117EA281E86 for ; Mon, 1 Apr 2024 10:32:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B2E3819472; Mon, 1 Apr 2024 10:32:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="L4rEMlVh" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D932DD52B for ; Mon, 1 Apr 2024 10:32:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711967562; cv=none; b=bKrT726TFzlyUlW8k1sr/IZjTL31I6/JRwN6iBAO+vLSvWE0Kg2uZ0MdbnrfS7aIgFoS1Q+FRYJWaRwDMdQPOD2Mp5jD1Qdt5+/zyEa/1ZwOXw0tmnJQzJ8yROUdzkDOPeAW0vohp9lc+NAUNsNMotBrfBuCelaBkjTXGMcW+40= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711967562; c=relaxed/simple; bh=VKbhvGB/H5FPJQ4BNky4cRNh9erO4bHex9ypDk2lDLo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aDbbWbCYM1LZR/a0oPOsVo+McgQkyKe8e8UYtJujTjPF5A9COznAB12k45ldbeEG7otx5s0lur4vSHORkbzn5rjPlY8wB2py4FKe/ShqweM55t92REBlL5EKXbDIPNwGcjP1XHJIY00MCYs/XrO4h0oVHpdG4j5SaE6c8WYFFcc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=L4rEMlVh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B156C433F1; Mon, 1 Apr 2024 10:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1711967562; bh=VKbhvGB/H5FPJQ4BNky4cRNh9erO4bHex9ypDk2lDLo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=L4rEMlVhaiXICSdBbXs20/xxLo6F3xmA1yEc/AsibVoFKHBlhs1K2vBzIsZQRo6j3 Xy9eJlF1TJ9f4UFDqGBPwabWrxGQ/NAJaiY3VfT2uRou8Kl8cplafH6HgmcgD0gq5i mUMTubSHyJ2TkWy04PTBqDP3iNEpUQocal+8AxNk= Date: Mon, 1 Apr 2024 12:32:39 +0200 From: Greg KH To: "fengchunguo@126.com" Cc: ilpo.jarvinen@linux.intel.com, andriy.shevchenko@linux.intel.com, jirislaby@kernel.org, linux-kernel@vger.kernel.org, Gary Feng Subject: Re: [PATCH] tty: serial: fixed uart irq maybe cause irq storm Message-ID: <2024040124-gone-retreat-6596@gregkh> 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> 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 > > Signed-off-by: chunguo.feng > --- > drivers/tty/serial/8250/8250_dw.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c > index c1d43f0..133c24e 100644 > --- a/drivers/tty/serial/8250/8250_dw.c > +++ b/drivers/tty/serial/8250/8250_dw.c > @@ -359,6 +359,12 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios, > > rate = clk_round_rate(d->clk, newrate); > if (rate > 0 && p->uartclk != rate) { > + /*Need disable uart irq before disabled clk, because uart irq maybe triggered after > + * disabled clk immediately, then cause irq storm. > + */ > + if (p->irq) > + disabled_irq(p->irq); > + > clk_disable_unprepare(d->clk); > /* > * Note that any clock-notifer worker will block in > @@ -368,6 +374,9 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios, > if (!ret) > p->uartclk = rate; > clk_prepare_enable(d->clk); > + > + if (p->irq) > + enable_irq(p->irq); > } > > dw8250_do_set_termios(p, termios, old); > -- > 2.7.4 > Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - This looks like a new version of a previously submitted patch, but you did not list below the --- line any changes from the previous version. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/process/submitting-patches.rst for what needs to be done here to properly describe this. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot