Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp490377ybz; Fri, 24 Apr 2020 21:09:31 -0700 (PDT) X-Google-Smtp-Source: APiQypK/NzmHnmPxqbdDKRPzcKX20HzLan4eC+TcX1y4eyw3VtMSFhVjWR6dtvrsuCW/JoGSgE6y X-Received: by 2002:a17:906:d14b:: with SMTP id br11mr10569875ejb.213.1587787770983; Fri, 24 Apr 2020 21:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587787770; cv=none; d=google.com; s=arc-20160816; b=xI+jOuar0XxmK7bBCBT0Ebb0c/UP/nQy7OQTbgfr4n4FGsYG6D6J3x/mdVU3Yq2rn4 eTmL9eYmpJnrZuPCeorRNbyF9hjqZGIRUlgjqm3GBvuABFekNLEDKjNdiTJ63a/9/4MM YmJo606o3TsJq2EWzOsP3/oiKW3cEoyN0NOytf71OM0AZBSexsv4ENL9jNq6bdTdp7ZH p46kkOU2p7Kh9I7yApc6waAvB6zFsSLa7rY5JhnsPHT/5zYIdMqrgi0sjxZ10Pbr1dJu 3glWDDM81kFUcEjMUsnvy7H27ezi4uvVhRdIK4axwySNYc1EWU/BjHIwNuWlaE7aeeY7 sdDg== 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=5Ky0eyr9lLThTQVUeFvCBClSKtV93JYH6d8kHWt9AbY=; b=wnPUAY6IAZc723+CUEmIUzywDsU1aHAdGBfRQGl5x46hf6gmPpqZSTfOdymDyR5N/F OKoo8Q7/LHWK1UGiacoq5JMfJzs02mqXVVtsfmIKQqeMn9ZPWFnRLD4g93BrvQV+ffS3 pbUNdzn9gTej4ERGaUKt41cimeHiLAfVT+pi/a7mRAAOSdhC1gTkZ+Y4JhXedLOn8LJP Y4XsxbS+IGOaO8MDU7nmASwLjshPhZLWHWHke3NXLa6JDKxH5t4UKv9roMK7nuVHkIHE oBrP7upMogi9goxnRV+JAhSoU349hy57TQ83o/i8ctpylXJp3uA0gdy6waY1H0wR2w3x 4n6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xsmyrmaP; 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 y11si963634edt.286.2020.04.24.21.09.07; Fri, 24 Apr 2020 21:09:30 -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=xsmyrmaP; 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 S1726073AbgDYEFF (ORCPT + 99 others); Sat, 25 Apr 2020 00:05:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725909AbgDYEFE (ORCPT ); Sat, 25 Apr 2020 00:05:04 -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 7882EC09B04A for ; Fri, 24 Apr 2020 21:05:04 -0700 (PDT) Received: by mail-ot1-x343.google.com with SMTP id i27so16255783ota.7 for ; Fri, 24 Apr 2020 21:05:04 -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=5Ky0eyr9lLThTQVUeFvCBClSKtV93JYH6d8kHWt9AbY=; b=xsmyrmaPpckFzclp7L+uXkwIuEQPI0AkgTZpagovbHJzVpyzvl7xsdYmVYyYlEd4cE AjiV8KyC6Ha79JNisdzpuGRwzhZDpJXvfgeFJuewUZPJkxFcXxCnpGtwPjwdxZGk/71c MhbiUOkwdbLhYOuWso0i8s+l+VBZ14EpWPC0/99g+6smIEjGvGvR8os79N2J+lzBtGbR s3WnThEwyPG/GrvoUiJvodTdyImCxcINnatR+Ccr/k0wy7rU+6t5f/3q5oiOM8dhPEt4 OvMoxj3DtqdxI5smzsaTPVQ34HTBrcqo0Qud1AjDjgTzOBI3qqofJIk5n977BDQ7JWP7 Ve9Q== 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=5Ky0eyr9lLThTQVUeFvCBClSKtV93JYH6d8kHWt9AbY=; b=HIzjij+0pP4mDmeTE9KAaD7rxWseYg5Ek1J5lyRv23pe/yy7g2BCFg/pPvaAJ1tWl0 mHOAaQMpq74WhiRijAg2kiX6fXl1iaKQ/ncb8Hfv96Jqb9CT8VkZ/pBKQZ3OGrYFwflw Oq7K+g8Zd+QglBHSog1A3/su1l9//bpItwbwHG9HtPGe/2cbonEyGNlz5KOZNRqi1iCJ VZx2+ZXcBZCjrTEGdUlSAApz7omSU41Uid0ltFKNQtDoUKnWkhFZ23IZ9V4B12PiDz4z 35VRkfvx2iLOkf5VP7Kdj2bn9bqLd5leGfotAjh1sRz+3kM6k3vNTzXJbsXNdmy+h2CE yxnA== X-Gm-Message-State: AGi0PuZjFq/zmqyNCMxQHIUVioJ5eQcjhRDnnkfUVS4gAqstpemCt3Ew M3ibjwKSMnT0SqibYrAL+/lHTQChWs75c17pUlqiGA== X-Received: by 2002:aca:c311:: with SMTP id t17mr9055910oif.169.1587787503419; Fri, 24 Apr 2020 21:05:03 -0700 (PDT) MIME-Version: 1.0 References: <20200423220056.29450-1-john.stultz@linaro.org> In-Reply-To: From: John Stultz Date: Fri, 24 Apr 2020 21:04:50 -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? So I got a little bit of time to look at this before I got pulled off to other things (and now its Friday night, so I figured I'd reply before I forget it on Monday). I did check and lockdep is tripping when we add ttyAMA6 which is the serial console on the board. I wasn't able to trace back to why we hadn't already called spin_lock_init() in the console code, but it seems we haven't. Also I checked on HiKey as well, and there I'm seeing the same lockdep splat and this fix seems to resolve it. So more digging is needed. If anyone has a better idea of what might be awry or if the lock does need to be initialized in the driver (it's a bit inconsistent, I see some drivers do but others don't), let me know. thanks -john