Received: by 10.192.165.148 with SMTP id m20csp4095711imm; Tue, 8 May 2018 02:53:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoHK4UJtABT/dVAtI1v13FpeebE6WBENzbjlW6U1IdnF74G5/uGlqNhp3NJqGAVyKvy4Qli X-Received: by 10.98.172.20 with SMTP id v20mr40077301pfe.101.1525773216435; Tue, 08 May 2018 02:53:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525773216; cv=none; d=google.com; s=arc-20160816; b=fQn/49OqAmQWMIs3pQiiXn3wEPIqQYIfFLddkLnhj9763qqjq+mQ+AnpcaBFFYO7tl AyRAvm74mRuGTP86HS0ksdM3IJCLtbRH7Sygy0KkMVbU8wdqgYXzVcBVEK1G5OqY1wbt IObQ1h00yZoGN8eARO4OEqPfKa7Im+YCxhjyBQNhZvVhr5TSazyrgyLp05Yu24/mph2Y bWARwKys4nyFMjBJqX7rHBJkxqfjK5DxdpHqnXeeH7vFyDxQY7sIenoQ634YFsD/v9DD hCX9IFhcz3d/3nZ3xSyRlFmqx1j++OXZdy5z17wAI84WZ8a3K0Dbi/P9AUpE9wZ3hc1E qKzw== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=nQ2/civxVDrv/AszB2CWtUBpL4jKCsXr3QyFQymHy40=; b=KGYZFVRjmc/7Jsy3Wb2AOiJvm0fhU+AQhjg09PMFXbSB6LufhzaCp61bhGu1/526pX DxRWwPpt+vdx0TV3dNAue16FnfHQ/BMaXh9cfj5e/Wvi3bzgYgzxcGrYXqVJ/QhLoq/7 Vk6PdnwWm5dMfPOa3EBtxw+dLPEhc1Q58J/gP/TwG4sYvIyehlZKuPoPJaJG6ycGi7kL oBWQKwW8A8Tg+ghV+G/8VQqk77vCWf0O/wywdeZmKiH8RY5ofeXCO+aDcCScNpLLXFcK jV2uBTsu51EAGIQLkxNwbS+RG+UwOVAKG863V7KDbPjw8MI72YQwBPGXl4jjEIJ47hEf 0LQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=D367DX0e; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16-v6si25250006pli.176.2018.05.08.02.53.21; Tue, 08 May 2018 02:53:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=D367DX0e; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932376AbeEHJw7 (ORCPT + 99 others); Tue, 8 May 2018 05:52:59 -0400 Received: from mail-ua0-f195.google.com ([209.85.217.195]:45005 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932067AbeEHJwz (ORCPT ); Tue, 8 May 2018 05:52:55 -0400 Received: by mail-ua0-f195.google.com with SMTP id h15so20263184uan.11; Tue, 08 May 2018 02:52:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=nQ2/civxVDrv/AszB2CWtUBpL4jKCsXr3QyFQymHy40=; b=D367DX0eqDY3r3QeLS+eRftWxD08RZO10C4vuWIZz+Nnr8A/NQ5AH9l6IzPrrTmqeF Yvv+WW9V8oFjSB8t57OtoOP+mXcTDY7eZ96pde6v5e0IFrkZ2R+x0GmXPSzhAMJOCJWX GsHYbEZ0CxWCqHBrrtavteGV3XATNuZRLai31dj91xdrtYsypwY22PBg/RkS6fC7+Gkg MF+jK5gHxzt9A9TX5aH0KVRJRROIsmNiDJ/l7uGp4H+FtMi5aC83dKrN+vZFJIaRARKx NhN6cwIoUfc11jwzL6+jhwnMNJA4XKga2TQgjSWIlxjFBslRKDZkCAWd+YosjvLlPgBW TpFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=nQ2/civxVDrv/AszB2CWtUBpL4jKCsXr3QyFQymHy40=; b=mMBgoSKl73QdKL6a9kdAO5VYZ4cHxIb98LqItEw+XbACUUytZRO/5uPuBspXWAWgD6 BTP17mvzrP/CPWaFsdYnA9ROVUM6bn/urD9bF410452NBjcB9TLk/2eXvmq4rdU57e6Z btG98TcAd0BjWru3ABwU+346Cvk056E4Tdv1PWDvkM3RFvC9qf16bzURWG4Xe51KFQrn 3VyWeMB0jAr/LzanraX2b9+TsBAFxOTxmLVfdQviVB1CH42spzywkfv9cfyZanW/bnVs dGLEixTBOEtFvwhxRJBP6H532sti/coZPsoCIp2iSs3zrtGHy4W6V3imv+PlyWbKFJyq AkRw== X-Gm-Message-State: ALQs6tDcPhYBBbagyYmjHVoJ48DIJNo5M+PfViKh+covl9alVGOOSOie qKDhnqpJ5DzQbTPJ5jxunnF9aFCGI8wZILHVli4= X-Received: by 10.176.81.6 with SMTP id e6mr36538093uaa.33.1525773174652; Tue, 08 May 2018 02:52:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.122.10 with HTTP; Tue, 8 May 2018 02:52:53 -0700 (PDT) In-Reply-To: <20180508085509.31384-1-wagi@monom.org> References: <20180508085509.31384-1-wagi@monom.org> From: Geert Uytterhoeven Date: Tue, 8 May 2018 11:52:53 +0200 X-Google-Sender-Auth: dnVsDsal0SYT2muYhwXIuwOBbLU Message-ID: Subject: Re: [PATCH v3] serial: sh-sci: Use spin_{try}lock_irqsave instead of open coding version To: Daniel Wagner Cc: Linux Kernel Mailing List , linux-rt-users@vger.kernel.org, "open list:SERIAL DRIVERS" , Linux-sh list , Greg KH , Daniel Wagner , Sebastian Andrzej Siewior 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 Tue, May 8, 2018 at 10:55 AM, Daniel Wagner wrote: > From: Daniel Wagner > > Commit 40f70c03e33a ("serial: sh-sci: add locking to console write > function to avoid SMP lockup") copied the strategy to avoid locking > problems in conjuncture with the console from the UART8250 > driver. Instead using directly spin_{try}lock_irqsave(), > local_irq_save() followed by spin_{try}lock() was used. While this is > correct on mainline, for -rt it is a problem. spin_{try}lock() will > check if it is running in a valid context. Since the local_irq_save() > has already been executed, the context has changed and > spin_{try}lock() will complain. The reason why spin_{try}lock() > complains is that on -rt the spin locks are turned into mutexes and > therefore can sleep. Sleeping with interrupts disabled is not valid. [...] > Cc: Geert Uytterhoeven > Cc: Sebastian Andrzej Siewior > Signed-off-by: Daniel Wagner > --- > changes since v2: > - dropped the local_irq_save() it's wrong as Sebastian pointed out > > changes since v1: > - Ported to current mainline (initial version was against v4.4.y) > - Left local_irq_save() in place when spinlocks are not used as suggested > by Geert. Thanks for the update! Reviewed-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds