Return-Path: Received: from mail.monom.org ([188.138.9.77]:53770 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751551AbeFVO0v (ORCPT ); Fri, 22 Jun 2018 10:26:51 -0400 Subject: Re: [PATCH 4.{9,14,16,17}] serial: sh-sci: Use spin_{try}lock_irqsave instead of open coding version To: Sebastian Andrzej Siewior , Steven Rostedt , Julia Cartwright , tglx@linutronix.de Cc: stable@vger.kernel.org, gregkh@linuxfoundation.org, Daniel Wagner References: <20180622135642.20349-1-wagi@monom.org> <20180622135642.20349-2-wagi@monom.org> <20180622141526.tv7kjzpz2k2ggxar@linutronix.de> From: Daniel Wagner Message-ID: <648f8f93-815a-cb74-7b5e-6974465cfaec@monom.org> Date: Fri, 22 Jun 2018 16:26:48 +0200 MIME-Version: 1.0 In-Reply-To: <20180622141526.tv7kjzpz2k2ggxar@linutronix.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On 06/22/2018 04:15 PM, Sebastian Andrzej Siewior wrote: > On 2018-06-22 15:56:42 [+0200], Daniel Wagner wrote: >> From: Daniel Wagner >> >> [ Upstream commit 8afb1d2c12163f77777f84616a8e9444d0050ebe ] >> >> Commit 40f70c03e33a ("serial: sh-sci: add locking to console write >> function to avoid SMP lockup") copied the strategy to avoid locking >> problems in conjuncture with the console from the UART8250 >> driver. Instead using directly spin_{try}lock_irqsave(), >> local_irq_save() followed by spin_{try}lock() was used. While this is >> correct on mainline, for -rt it is a problem. spin_{try}lock() will >> check if it is running in a valid context. Since the local_irq_save() >> has already been executed, the context has changed and >> spin_{try}lock() will complain. The reason why spin_{try}lock() >> complains is that on -rt the spin locks are turned into mutexes and >> therefore can sleep. Sleeping with interrupts disabled is not valid. > > This change only effects RT. Usually I don't bother Greg/stable team > which changes which went upstream and help/fix RT but don't affect (as > in fix) non-RT code. > I usually add them to the RT queue and let RT-stable team pick it up. So > I would suggest I pick it up for v4.16 and it gets then picked up the > RT-stable team. > Any objections? I don't mind for all non 4.4 versions. The 4.4 is special for me. Ben will merge the stable into the cip tree and I merge the -rt patches on top the cip-rt tree. That's why I would like to get the patch via the stable tree.