Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp164774ybz; Thu, 23 Apr 2020 21:02:10 -0700 (PDT) X-Google-Smtp-Source: APiQypJgoKfm2ZP1A9AYIYIVFVZKvez+07FS/jlcUlhVxQ8tk27JxfEw3mn05zveLyHWNDzvCh0/ X-Received: by 2002:aa7:ce0f:: with SMTP id d15mr5567093edv.327.1587700930426; Thu, 23 Apr 2020 21:02:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587700930; cv=none; d=google.com; s=arc-20160816; b=DO46NCalGF7PLdeHMK4TtY50ikxR48eyvoT3JYhPFV3CIO4NHL45BkfLn/7QsUQbDk 9CM+Eja0AMYR51Y15cLebwMXei619uQNoG9cZ16fi0ZOW+g8jXd/roiT4Z05aldR6TVo F+RxJddeEEdDmfqqP3Sd2e9w93RuOTFLrs0F4bhtSAbn/Yi1V3Qg9q2CsZiRLlZeRCI+ SpLrOeb/BRylT/6a7ZEgJnc4yNya41oansmg0nbeGDbvzQeLmxfE5r5DcVyVOIsqGnSR EWpJxg9kYi7YEzqnhRwHn+SPDoybWf8TT8gNYwbCyks3hLC8I8m2ZE0WybxDIGjDPIY1 Qxmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=OQlQ+wnlPPSwWGxz5tXdlEB85veCyI0bjca+7B/4SpM=; b=jjPI9v5SmAv7MeyHIVySXDj2dlmuEqs6/b7cgTqQtRUmJQHLNmhnyj1RqGpkEZXhuN nDUBEIznkQE8siPl+/npkGW+KXBFfacCFi8KApXF2PruaOw/Jti0gjfGsoUk7fSwYnOh MZopKdSTKUpmjqL2tIJ1oQgmVUywMYy4PljT3gEEc5bPvl7igD+4dhPTPQJGsEy94r+B P5tcPI6J0zytyPXC/7gcqeGBCUgqaVuWx823v2h8GZ7wusN0xK7q+jaVHR8Y1DxKQYih GESpN/Dsf/50cUrmkYg0HOfZgYc874iAFj42RV+Yme4PzzxIC3YiW/ab66GYDIzxg0qB nZUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M2gDZ0zk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h5si2287602ejq.430.2020.04.23.21.01.47; Thu, 23 Apr 2020 21:02:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M2gDZ0zk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725922AbgDXEAQ (ORCPT + 99 others); Fri, 24 Apr 2020 00:00:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725816AbgDXEAQ (ORCPT ); Fri, 24 Apr 2020 00:00:16 -0400 Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D396C09B045 for ; Thu, 23 Apr 2020 21:00:16 -0700 (PDT) Received: by mail-ot1-x343.google.com with SMTP id c3so10160058otp.8 for ; Thu, 23 Apr 2020 21:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OQlQ+wnlPPSwWGxz5tXdlEB85veCyI0bjca+7B/4SpM=; b=M2gDZ0zkPA29rkaYlXI6Liui/LoGfVGgSS0fUKnxBaYab9Gifu73xEteUfQhLeYWot fP2OqHtPfht6HZ3iP8vaDS6HFv04SU6XWD/7pGcXQkgNZneClfR5YuGmsy7gjbegawww C/VJi4mUjdTuQFY9vSfaueDrZXnG4cbKLeCAotSM1RmSn+xXmWODtE/F+8sG7sgp6zt3 FvFp2wkOEDgPG1mndoKBLTGYetNFgasY1rnuGZZHrH4+hZ7HnSiS9OClZVnx32HcPGut RmEPtvmToC7A5Nwi/Cfv9MbiRQBByqC/7oD3OihOJLYPn5mi3epfi3y4X3qWp+blCunL 471g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OQlQ+wnlPPSwWGxz5tXdlEB85veCyI0bjca+7B/4SpM=; b=P/orE+YiDl9bEaTnUJldVnyq8ITlS3W7sTdelo2mPIKg0HL7y3d0tKFM6HnvaIOC3b GfcprmR/ZJlTkT0vFYt8HyXG75KdDthvKiDaqQak2W7n8vjVOwRewvVQ1dOOC5l7c1Y/ Jcy73VbJHjVvSsYaxBk1pCcJOn+gVzGosM8xEZuy0fmws3bmEbil2mAhnI+91+2WK43B t3IIOwL0Ztse33fYKhYYmFWpl/f1/XZmEKq2CoiPZCHU2ttUMicMstFNiG2nUCbILOwH XoxSyuJyHhj7A9RfTVRtEAxF1v/H1GrGkjCjID/ao6A8mDuvI9sIDNqMOomk74jhiYOK kRWQ== X-Gm-Message-State: AGi0PuarkqEbhZ1J0tLJ74Gk/wmm31kNC/T2qRBL2OzpstEnedZsIfU+ c6+goxaEPc6E7ijSmLFm2bC72I5Jt6ow7UnVLKA7gg== X-Received: by 2002:a9d:3988:: with SMTP id y8mr5916871otb.352.1587700814858; Thu, 23 Apr 2020 21:00:14 -0700 (PDT) MIME-Version: 1.0 References: <20200423220056.29450-1-john.stultz@linaro.org> In-Reply-To: From: John Stultz Date: Thu, 23 Apr 2020 21:00:04 -0700 Message-ID: Subject: Re: [RFC][PATCH] serial: amba-pl011: Make sure we initialize the port.lock spinlock To: Valentin Schneider Cc: lkml , Russell King , Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 23, 2020 at 4:14 PM Valentin Schneider wrote: > On 23/04/20 23:00, John Stultz wrote: > > Which seems to be due to the fact that after allocating the uap > > structure, the pl011 code doesn't initialize the spinlock. > > > > This patch fixes it by initializing the spinlock and the warning > > has gone away. > > > > Thanks for having a look. It does seem like the reasonable thing to do, and > I no longer get the warning on h960. > > That said, I got more curious as this doesn't show up on my Juno (same > Image). Digging into it I see that uart_add_one_port() has a call to > uart_port_spin_lock_init() a few lines before uart_configure_port() (in > which the above warning gets triggered). That thing says: > > * Ensure that the serial console lock is initialised early. > * If this port is a console, then the spinlock is already initialised. > > Which requires me to ask: are we doing the right thing here? Hrm. All good points. Obviously from the details above the port->lock initialization shouldn't be done in the way this patch proposes, but I'm at a loss as to why we're hitting the issue. My guess is it is tripping over the console case, but didn't get initialized there properly? I'll try to trace through the code to see more about what's going on. thanks -john