Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2901825pxb; Mon, 18 Apr 2022 10:38:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZYSwLF44dBP9yu0+9OtNRodzP4TsguzRB1i+967Pb4NipIcCNC7MtQI5GT6KCRqXHN1y7 X-Received: by 2002:a17:902:8306:b0:158:2d58:a36a with SMTP id bd6-20020a170902830600b001582d58a36amr12236488plb.55.1650303490049; Mon, 18 Apr 2022 10:38:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650303490; cv=none; d=google.com; s=arc-20160816; b=padHQEzdKPIx0GLO0dVQw4aUsTLTKuLDD3FiMXABXTiBALK4Qc8rd3s/xS4ptlwRUP EI5TQ+L0P4ijjfQRK/1j0idoZ2EGhBmrZlTKr39ue5fCcqolC6Tet4083rRoKDmt2rL9 hwyn/kUDefHBmBUHcDGsv6nmscg8oBd5Vs8cuFs3i9pEzOdSzGcMTko8W5pFUmKqmmTp 6WIxX/+gznyaro49M/89AWNB+6l0xIO1v7PAX6G9MDNR1SCptxTPbsHwH9rPjmebryYU 3bt5a57vA16oc+4EVTbBYBMN/jcAod32lko1hKEl2S2PlSEI7tPF2H2gr3EI3jxr/AQX vS/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EJhknOSWCl1UqWjyFGilOJ6ZF5zP7NJLcJqoM/Vod2s=; b=iBe1pXcbIr6aSJ1aweBn7XzUslh1LX9OBplAQLVu9UUrLmTh6I/zYuTskbde8MPd6T ez/4NJVmXMlqEGz+k00qLFyRkkyn84MnMqbKVApBpDxJj+twzbubyWME1sdWPuGsFPoW aMn1k9P1ZXFx+Z6n2Rm/NyLllZOT7Vh/vCz/4Dn04vKhAJ8cOcm/QcYcnOEsBRf+gzii stZJfxHuVDvuH2ChYdsH0GL6G8QJ5xKne9UwifOo2Rg1SfIFbbsDU/Gev09bV7E0s788 Dspf+9hYUxS6J0tQtTutwREItGxPv2J2cfLeZ6GB3MvUkxi5yaIgkUqCXLjz366rNBEX zrTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PjxoreFw; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mw12-20020a17090b4d0c00b001cb7eeadcccsi9819387pjb.90.2022.04.18.10.37.49; Mon, 18 Apr 2022 10:38: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=@linuxfoundation.org header.s=korg header.b=PjxoreFw; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244528AbiDROBY (ORCPT + 99 others); Mon, 18 Apr 2022 10:01:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243247AbiDRNkG (ORCPT ); Mon, 18 Apr 2022 09:40:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72CD42E0BF; Mon, 18 Apr 2022 05:59:08 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AE74F612D0; Mon, 18 Apr 2022 12:59:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F772C385AF; Mon, 18 Apr 2022 12:59:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650286747; bh=b7GJMzDePjimQ3005lTSOfTKtahDAyBwRnIzPIleSC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PjxoreFwyDzSLc2M3n7q3YL4YB9l/fc2cowBX4aftpdtZELShRqUYA1c5Isp2kmEE 5sHY4vxLEAJUscwAUYWhPxvGoMjcg4v/K3QopxUvqwZDrSd+IiF9HWTYJGT4xl9vg+ JaRv23wXB07KOnXZTTdSxDtlnXTczttQFXEFE2qs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Abraham , Kyungmin Park , Hyeonkook Kim , Jiri Slaby , Sasha Levin Subject: [PATCH 4.14 232/284] serial: samsung_tty: do not unlock port->lock for uart_write_wakeup() Date: Mon, 18 Apr 2022 14:13:33 +0200 Message-Id: <20220418121218.310817402@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121210.689577360@linuxfoundation.org> References: <20220418121210.689577360@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Jiri Slaby [ Upstream commit 988c7c00691008ea1daaa1235680a0da49dab4e8 ] The commit c15c3747ee32 (serial: samsung: fix potential soft lockup during uart write) added an unlock of port->lock before uart_write_wakeup() and a lock after it. It was always problematic to write data from tty_ldisc_ops::write_wakeup and it was even documented that way. We fixed the line disciplines to conform to this recently. So if there is still a missed one, we should fix them instead of this workaround. On the top of that, s3c24xx_serial_tx_dma_complete() in this driver still holds the port->lock while calling uart_write_wakeup(). So revert the wrap added by the commit above. Cc: Thomas Abraham Cc: Kyungmin Park Cc: Hyeonkook Kim Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20220308115153.4225-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/samsung.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 70d29b697e82..3886d4799603 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -764,11 +764,8 @@ static irqreturn_t s3c24xx_serial_tx_chars(int irq, void *id) goto out; } - if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) { - spin_unlock(&port->lock); + if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) uart_write_wakeup(port); - spin_lock(&port->lock); - } if (uart_circ_empty(xmit)) s3c24xx_serial_stop_tx(port); -- 2.35.1