From mboxrd@z Thu Jan 1 00:00:00 1970 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.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 30DABC433E7 for ; Sun, 18 Oct 2020 00:34:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C439820878 for ; Sun, 18 Oct 2020 00:34:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="S89FTpfX"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pjFVxaXU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C439820878 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Udj/mWK9kkTsQpfXF9TiMPodM0Ii20iuy7noCJnRu+0=; b=S89FTpfX+gYWJF0Nd4p4PEFeH x5PwLC0kbREsqUUXjcG4QDZNta5V73PWeK4K+aUJsg385KXrGg78Ftunrd9oFMmu1bW7rmCF9cfCb JZUk12qZmtZOTPfXIGPrO/Zs9CxjA9w/T55nJrUhpm9INDEI5Jo9I7/p7cypovpgq+V8Tuz1OTtZm UJh+h3AumuBcmM2odl343SgthrV4z7//OhJr9Q8IkIM29pIDdCDC/3ulwQ/9lgsRP2Be2KkN6d6GI n4IeTCHRadohLI9A6JEcNDXqNzgjzTDcI2C+t8tQO9IzYqUALbi+LGdPE4bfB5fDnCJuxLQWgVejs MzGeKLU+w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kTwca-0001hY-5m; Sun, 18 Oct 2020 00:32:24 +0000 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kTwcX-0001hA-C0 for linux-arm-kernel@lists.infradead.org; Sun, 18 Oct 2020 00:32:22 +0000 Received: by mail-pj1-x1044.google.com with SMTP id gm14so3330582pjb.2 for ; Sat, 17 Oct 2020 17:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=S2bgd+e0UALuCUEud5wAO2L9WRMFqabg5wBMLwiT87k=; b=pjFVxaXUBBMCfuuUGpTiKvOrwQ7p5OEsH4c9gfBpA/m7AgY78k0FkAr3CdLobBNJqD MxXy0AiEfaJl0L3EzaWFNgA9zqQ5TF+J3lWaD0M27UYvPDAjZJPv83ZEow+nrLqBHl11 SaASWnUACNAMTfRXsI5WwO0YHV80ETMhXVwPR7AjM9tsrtnpV7lybJdab7xNExG6fW1e dbQ5u+yuaMHwVMoUtKv+eEOA5bGe0f/OnllXtaBktDK00+d+RUR/NzDdBNgTsWvk3Cf8 qkYrSFMQ603eDlt05bW3P7m7wMUT1Wz+vQpFfyJwj29s/li0BT53qDKjZH2AFfTOuqhi 9+9Q== 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=S2bgd+e0UALuCUEud5wAO2L9WRMFqabg5wBMLwiT87k=; b=t6/Ou+EtQ9549M17JhMauN43Dk5j7qwGY74ANzHB3ZDfkzuBTiyjJJUhk6DEPWtEqj gsCeR7X2mvxv1I4QfWh2AdDVqYwYfHl86Es6uGfF3fVeH95YqdL4KrXR2ymjhuPdx2Pd CP8l9BbmTuKSR5h4GrJTNjUOxsxrBzyJaxMILwDcTzMoZwZqh99n6ZuBrkprZHSULviW BLRFewrEFmyvBOXbaDB9nSPeZIY+Wc+WgiDl0AeQQL3kSsOkQfJP3b4fnBU/gX99KxkH lcjZPCN2LUsF0z1LN8Sop3dqDHsRc+v8VJ3Rob2M8tXpNnJRchC9+OZNi5Ra+QdWZkWR Q6Lg== X-Gm-Message-State: AOAM531q+zrdF0pnnUVN9cS2d0eSU6AxW08AMOlN5p1zstQm2lhEh3E/ lESviGrsX+L+yMboyWXrFDJHKOhG+I5ZqG7CcEU= X-Google-Smtp-Source: ABdhPJxN6AqUcUwkYK2418A4yZbLATLA5NxZ1dHaSQzR0vBsOg/qcHLwKnad60pPI9dcsmaS+V7M9ff8iYJXzbeWejs= X-Received: by 2002:a17:90b:1b47:: with SMTP id nv7mr11003426pjb.101.1602981137603; Sat, 17 Oct 2020 17:32:17 -0700 (PDT) MIME-Version: 1.0 References: <20200923161950.6237-1-Sergey.Semin@baikalelectronics.ru> <20200923161950.6237-4-Sergey.Semin@baikalelectronics.ru> In-Reply-To: <20200923161950.6237-4-Sergey.Semin@baikalelectronics.ru> From: Jonathan Liu Date: Sun, 18 Oct 2020 11:32:06 +1100 Message-ID: Subject: Re: [PATCH 3/3] serial: 8250_dw: Fix clk-notifier/port suspend deadlock To: Serge Semin X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201017_203221_458078_24E68756 X-CRM114-Status: GOOD ( 13.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Will Deacon , Hans de Goede , Greg Kroah-Hartman , linux-kernel , Maxime Ripard , Russell King , Alexey Malahov , Andy Shevchenko , Serge Semin , linux-serial@vger.kernel.org, Andy Shevchenko , Jiri Slaby , linux-arm-kernel , Pavel Parkhomenko Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 23 Sep 2020 at 16:19, Serge Semin wrote: > > It has been discovered that there is a potential deadlock between > the clock-change-notifier thread and the UART port suspending one: > > CPU0 (suspend CPU/UART) CPU1 (update clock) > ---- ---- > lock(&port->mutex); > lock((work_completion)(&data->clk_work)); > lock(&port->mutex); > lock((work_completion)(&data->clk_work)); > > *** DEADLOCK *** > > The best way to fix this is to eliminate the CPU0 > port->mutex/work-completion scenario. So we suggest to register and > unregister the clock-notifier during the DW APB UART port probe/remove > procedures, instead of doing that at the points of the port > startup/shutdown. > > Link: https://lore.kernel.org/linux-serial/f1cd5c75-9cda-6896-a4e2-42c5bfc3f5c3@redhat.com > > Fixes: cc816969d7b5 ("serial: 8250_dw: Fix common clocks usage race condition") > Reported-by: Hans de Goede > Signed-off-by: Serge Semin Tested-by: Jonathan Liu Fixes hang while closing the serial port on RK3399 that I was experiencing often with Linux 5.9. After applying this patch, it no longer hangs while closing the serial port. No problems while rebooting either. Thanks. Regards, Jonathan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel