Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2661586rwl; Thu, 13 Apr 2023 09:13:10 -0700 (PDT) X-Google-Smtp-Source: AKy350aZtNeXX4j5u/+A2YUd/brqe4tYzrOL+JnyRPR4ZpT9nbsTD4CQWCRZG0bYbhueW+Fl9Hjf X-Received: by 2002:a17:90b:1bc9:b0:23f:d487:1bc8 with SMTP id oa9-20020a17090b1bc900b0023fd4871bc8mr8232517pjb.13.1681402390032; Thu, 13 Apr 2023 09:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681402390; cv=none; d=google.com; s=arc-20160816; b=Xhp4u8xdMRCQvTJa/7vX05rJiAZoY4lPszdaP0E6liNMzR+rquu8meF/SvtHUz3V52 iEGJP/KWtcDc7NJ7M8o+hh2aAdp/8/INSJiqc2OD901YsylHnEdx/cAtTU/62DmQsPtK p7AN+Zv++hAUhgIDl0lJg+xuoeIe9NgU6M5gunYs3CB6trtxQF3Ir/laR4as/FZVbU6w dDymtxOxV7wxxhlhiZmPyDKqJn83dWYt4rvh9WQqBgpebu4AcNyyisVr8MVn0rHQW7ih OByiUgNSFpz4XEMRPkR3MM/9icZNaTbZE/3itF+t0mr8hRq2idc/G3bKffWPi/FhpVNv 1f8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=qrFLlFy92oRVnraujfR9d4P8XcfkiGwaaYbcKQs7+T0=; b=bDntrufIU7AoxfAOGbTDszdHsEaSIaI8AIxfN8WvfwFrcOdaRCNJU7+y/pSPot8WIW qeNt/NsQ1yG9qALxC2ZTWiyvO9OTiu6+4FqYYO0jzRhbV/verWSLvK0JfZhUV++ksu0E k0LKvSRfblWMganFykf3tB904d6sjVOrFuGCI9xysFJ4b6UwN2TLpF9luzaa0i2p8VD5 dvAVfmc5jbCOE+/9J4d1TTQM+nw485MFUdMLG+tG8kCNHDLmlJ7IS7ZZoks9ND8BtYv/ DYBAU/pRepKRtIaTL5Hl4eU1LxGnKkoOPtV1r09/lTOFEAnyUumVhlV/6UNj8W8adXKO 0l2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Ak1fzE/z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y5-20020a17090a8b0500b00235dc16de3asi5070454pjn.16.2023.04.13.09.12.56; Thu, 13 Apr 2023 09:13:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Ak1fzE/z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229696AbjDMQGm (ORCPT + 99 others); Thu, 13 Apr 2023 12:06:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229560AbjDMQGl (ORCPT ); Thu, 13 Apr 2023 12:06:41 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D93383EA; Thu, 13 Apr 2023 09:06:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681402000; x=1712938000; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=rOehdBIrreHkMjOxugsVNu2ybTTdqeAOr5KilNtz1OA=; b=Ak1fzE/z0NYUWwyrwx5KhjEgUwCa0MKMf+/q3lV+R9NdM9s6ZnfEdb4v s2kbg6iNqyj8OVt4LrMqeS53s4t2so4GXfp8DOCZzSXq0bo6TMo2PWkTq 5Bs+9SOVy2tHa8PpXzgB2K8a5DHq6EeuwVJctX1OdmvXiW0zF3ps7Wo3D wLxQQHl844g/j+rDGI6GaA2DMEQoqbxQ5krsuwl9o/U5nxmEJDrZY75PC cbdhgJ2TFl2NabQ1dQv9Zx+JknH0A5c5JTRtzZeibF+31OpQVifl4I7rF //JAV3/uM8z2OuINv+qELQV6vKCkMAJZfvq4336dt8AySqCtupXNVT3Kv w==; X-IronPort-AV: E=McAfee;i="6600,9927,10679"; a="341722722" X-IronPort-AV: E=Sophos;i="5.99,194,1677571200"; d="scan'208";a="341722722" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2023 09:06:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10679"; a="754062124" X-IronPort-AV: E=Sophos;i="5.99,194,1677571200"; d="scan'208";a="754062124" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga008.fm.intel.com with ESMTP; 13 Apr 2023 09:06:37 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pmzT1-00GcXx-1e; Thu, 13 Apr 2023 19:06:35 +0300 Date: Thu, 13 Apr 2023 19:06:35 +0300 From: Andy Shevchenko To: Tony Lindgren Cc: Greg Kroah-Hartman , Jiri Slaby , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-omap@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] serial: 8250: Clear port->pm on port specific driver unbind Message-ID: References: <20230413070342.36155-1-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230413070342.36155-1-tony@atomide.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 13, 2023 at 10:03:41AM +0300, Tony Lindgren wrote: > When we unbind a serial port hardware specific 8250 driver, the generic > serial8250 driver takes over the port. After that we see an oops about 10 > seconds later. This can produce the following at least on some TI SoCs: > > Unhandled fault: imprecise external abort (0x1406) > Internal error: : 1406 [#1] SMP ARM > > Turns out that we may still have the serial port hardware specific driver > port->pm in use, and serial8250_pm() tries to call it after the port > specific driver is gone: > > serial8250_pm [8250_base] from uart_change_pm+0x54/0x8c [serial_base] > uart_change_pm [serial_base] from uart_hangup+0x154/0x198 [serial_base] > uart_hangup [serial_base] from __tty_hangup.part.0+0x328/0x37c > __tty_hangup.part.0 from disassociate_ctty+0x154/0x20c > disassociate_ctty from do_exit+0x744/0xaac > do_exit from do_group_exit+0x40/0x8c > do_group_exit from __wake_up_parent+0x0/0x1c > > Let's fix the issue by clearing port->pm in serial8250_unregister_port(). Sounds to me like a fix that needs a Fixes tag. Code wise LGTM, Reviewed-by: Andy Shevchenko > Signed-off-by: Tony Lindgren > --- > drivers/tty/serial/8250/8250_core.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c > --- a/drivers/tty/serial/8250/8250_core.c > +++ b/drivers/tty/serial/8250/8250_core.c > @@ -1157,6 +1157,7 @@ void serial8250_unregister_port(int line) > uart->port.flags &= ~UPF_BOOT_AUTOCONF; > uart->port.type = PORT_UNKNOWN; > uart->port.dev = &serial8250_isa_devs->dev; > + uart->port.pm = NULL; > uart->capabilities = 0; > serial8250_apply_quirks(uart); > uart_add_one_port(&serial8250_reg, &uart->port); > -- > 2.40.0 -- With Best Regards, Andy Shevchenko