From patchwork Tue May 26 18:53:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 225321 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B8C3C433DF for ; Tue, 26 May 2020 19:17:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 234B220776 for ; Tue, 26 May 2020 19:17:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590520633; bh=O9GuyrYBQ8P7jHWBTNTtQT6lMUojNgow4wxmzXQ9/G8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=RExdy/+tDSq2Hn6bPHeGjpeiZCe0nhG7lWM8m/UHl1d3LSWeN0/GTHKITY1/YVFPZ 0RHKXuUCl5OM1uV0h9jGTFXoZYKMqDWtM8EainPRZJzhKsvf+QDqiQB/oInI3g91ue uA6sjG0JRokB2Vo6U9EJQiKWeG6nr6xmRs0iRfhM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392073AbgEZTRJ (ORCPT ); Tue, 26 May 2020 15:17:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:46238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392218AbgEZTO6 (ORCPT ); Tue, 26 May 2020 15:14:58 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A4AC220776; Tue, 26 May 2020 19:14:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590520498; bh=O9GuyrYBQ8P7jHWBTNTtQT6lMUojNgow4wxmzXQ9/G8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SYUpbj/WjZOBP6MVPnjqYQq7/wZ+xqytYaK9yjIcZrdJ5kMXZR/99I6MSYjcpylOu FsneB+8UHySN35bpBSFHWOm/4U2P//9AU1pG+xldz7CD/CalQlgCoe3Kooivw77PwR xHA2tiyyuT8Pk0yCggJ7I6oDWb1JTVjE8nDLClOU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Atish Patra , Sagar Shrikant Kadam , Palmer Dabbelt Subject: [PATCH 5.6 102/126] tty: serial: add missing spin_lock_init for SiFive serial console Date: Tue, 26 May 2020 20:53:59 +0200 Message-Id: <20200526183946.284470957@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526183937.471379031@linuxfoundation.org> References: <20200526183937.471379031@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sagar Shrikant Kadam commit 17b4efdf4e4867079012a48ca10d965fe9d68822 upstream. An uninitialised spin lock for sifive serial console raises a bad magic spin_lock error as reported and discussed here [1]. Initialising the spin lock resolves the issue. The fix is tested on HiFive Unleashed A00 board with Linux 5.7-rc4 and OpenSBI v0.7 [1] https://lore.kernel.org/linux-riscv/b9fe49483a903f404e7acc15a6efbef756db28ae.camel@wdc.com Fixes: 45c054d0815b ("tty: serial: add driver for the SiFive UART") Reported-by: Atish Patra Signed-off-by: Sagar Shrikant Kadam Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Cc: stable Link: https://lore.kernel.org/r/1589019852-21505-2-git-send-email-sagar.kadam@sifive.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/sifive.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/tty/serial/sifive.c +++ b/drivers/tty/serial/sifive.c @@ -840,6 +840,7 @@ console_initcall(sifive_console_init); static void __ssp_add_console_port(struct sifive_serial_port *ssp) { + spin_lock_init(&ssp->port.lock); sifive_serial_console_ports[ssp->port.line] = ssp; }