Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Sagar Shrikant Kadam <sagar.kadam@sifive.com>
Cc: Atish.Patra@wdc.com, linux-riscv@lists.infradead.org,
	Anup.Patel@wdc.com, palmer@dabbelt.com, paul.walmsley@sifive.com
Subject: Re: [PATCH] tty: serial: add missing spin_lock_init for SiFive UART
Date: Thu, 7 May 2020 08:49:58 +0200	[thread overview]
Message-ID: <20200507064958.GB798308@kroah.com> (raw)
In-Reply-To: <1588793212-5586-2-git-send-email-sagar.kadam@sifive.com>

On Wed, May 06, 2020 at 12:26:52PM -0700, Sagar Shrikant Kadam wrote:
> Uninitialised spin lock on sifive serial port (ssp) raised
> a race condition and resulted in spin lock bad magic 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] http://lists.infradead.org/pipermail/linux-riscv/2020-May/009713.html

In the future, can you link to lore.kernel.org instead?

> 
> Fixes: 45c054d0815b ("tty: serial: add driver for the SiFive UART")

So this should also go to stable kernels, right?

> Reported-by: Atish Patra <Atish.Patra@wdc.com>
> Signed-off-by: Sagar Shrikant Kadam <sagar.kadam@sifive.com>
> ---
>  drivers/tty/serial/sifive.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c
> index 13eadcb..b061bdb 100644
> --- a/drivers/tty/serial/sifive.c
> +++ b/drivers/tty/serial/sifive.c
> @@ -989,6 +989,7 @@ static int sifive_serial_probe(struct platform_device *pdev)
>  	ssp->clk = clk;
>  	ssp->clk_notifier.notifier_call = sifive_serial_clk_notifier;
>  
> +	spin_lock_init(&ssp->port.lock);

Shouldn't the port lock be initialized by the tty core instead?  I think
this is the second time I've seen this type of fix needed recently...

thanks,

greg k-h


  parent reply	other threads:[~2020-05-07  6:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06 19:26 [PATCH] fix for spin lock bad magic on SiFive UART Sagar Shrikant Kadam
2020-05-06 19:26 ` [PATCH] tty: serial: add missing spin_lock_init for " Sagar Shrikant Kadam
2020-05-06 23:10   ` Atish Patra
2020-05-07  3:34     ` Sagar Kadam
2020-05-07  6:49   ` Greg KH [this message]
2020-05-07 17:32     ` Palmer Dabbelt
2020-05-08  7:16       ` Sagar Kadam
2020-05-06 23:12 ` [PATCH] fix for spin lock bad magic on " Atish Patra
2020-05-07  3:59   ` Sagar Kadam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200507064958.GB798308@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Anup.Patel@wdc.com \
    --cc=Atish.Patra@wdc.com \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=sagar.kadam@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox