Received: by 10.192.165.148 with SMTP id m20csp3817449imm; Mon, 7 May 2018 20:37:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrm97/655Oz0fYEPQnvoGxQ9kHByRmuUBDAEgsCJGywNMZr0QspqLLbzgtUqdcMOK6kjlva X-Received: by 2002:a63:af1d:: with SMTP id w29-v6mr32090837pge.247.1525750656410; Mon, 07 May 2018 20:37:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525750656; cv=none; d=google.com; s=arc-20160816; b=jj1kR2e3AuZUcSGR+cdclTcOxCwsWz1U3GeeobZYv4WVkcibMF+wKlrlN3fLKRc9a6 4DHWYbTdPu4crMsk5fLwsPS1rDx1Cd3VOZE3hcO7Xwjp2I48LIa+aU1gQYXDhUgLMTAP ZdPBxv1w1CcWfBQ3eiybeUxbGA+mGyQHwpFae1rEWQ3oxIrF5vtf3xvDc/6w23nW2+bR YwA5Ec+FtxOA/DbDv6yDTYSkHhYHljshAZllUFHKzFx0gVzqJedwsxEG23eJAzTjMYDV ZZrhmfsoN/ZrQEgGmN4j57FVtKEsrNdtTqKZIqA3eSnzWLnBNm2baY5tDCT/Mf4Gw/tX +SuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature:arc-authentication-results; bh=s8SfJ81sUZtkf/XL1tgQgJ/+e5xoA/1icGelLNyjoLs=; b=KzgyP8ghU9Op1TDvaeTz5R/rNHUZx37oJIcmQtbd/KDbm9PuM28+6ZYw5uqGMK6G54 byc6wUWoQLd9PsAE9fULTpjsEgP67Yp19m2nxLnEUG7Pr0DZWmHXR5q6I0MVrs8Zr7OI otlZHAYieRLPEuazOb0AOcrRnZSVoXGvUifcQbuM6bdnwglPLM3HTt2BifUg6AhcTYaP dq3lTlLZ0dJQvAe6kIGHpw4a+oDEdAkAlHIg+0grmbxR/wp0jzTU4YrWCW/WXLrPdbDf 8AvAv2evgmy6GgvTLB9qqxJrrtwjWbQbGunMq5WY9vYnWQK9klfp7zq96GmsKWaD4oG+ j4IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=u+tUPFOF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3-v6si13817955pgp.506.2018.05.07.20.37.21; Mon, 07 May 2018 20:37: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=pass header.i=@gmail.com header.s=20161025 header.b=u+tUPFOF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753935AbeEHDhK (ORCPT + 99 others); Mon, 7 May 2018 23:37:10 -0400 Received: from mail-pl0-f52.google.com ([209.85.160.52]:36860 "EHLO mail-pl0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753510AbeEHDhJ (ORCPT ); Mon, 7 May 2018 23:37:09 -0400 Received: by mail-pl0-f52.google.com with SMTP id v24-v6so1369561plo.3 for ; Mon, 07 May 2018 20:37:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=s8SfJ81sUZtkf/XL1tgQgJ/+e5xoA/1icGelLNyjoLs=; b=u+tUPFOFI/VBtVzgB6LSEFcGCGZEeJ6bOiEeIO/Hd36XvIagWPUTt7vacIl2bc1cOH t+Og7Suabk4HRCuhNKtAZ9+iLm5ClxadGAQpLJE0Ik1Fo+D+b86Uidypfm68HIA+9DbI IraQgBNBnDrjOydmikeBuIXhWFrA+WjSzn0J3mcbojxbrLzp42ObseHEa/1JEn4Nczg1 vGlBpPF7of3AqYAB68eP2ms2pK7eWjPIxHpqxYuY6tsqmW46gwnrQ0Ha/Q4GZ4cIZ+nl h2b1MnZOTtWutOlthr42a4aCteKDj0Tu5Zi+WGwIj2Q7tDnDNEES3QWbdEREOjPO3t2G zFTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=s8SfJ81sUZtkf/XL1tgQgJ/+e5xoA/1icGelLNyjoLs=; b=XFsbTOL3AKA8lSUt/CTvqSpEtbW1Igyfcy0olTnY05P2JOW9y9diV95fNQIiumPA7w hFz06ad+Fkkvl0dX5Y46m/9TqDnU71a0UeDqAO6kKKRMhhd84dFYbaDG67nvb66K8otc e5S6PzqjU7Y5ZPzxjce9MdMS58i0wWXa2AbJRtZ31dsYq9sVojk7+zQBp2/2LpPeEBiV Z5pcheYeCPIGpsddvo+3SkSBjCjwnFUHEj4AxdSD62E0aI820wScIxj4URlTIzE55sp8 /pyGHpSjdHRH2iGsRd2V4P/HYqshWh81tWPR33jSE1jf420CSV+uyQ5fvdHuHte/as+i dB/w== X-Gm-Message-State: ALQs6tB+eH4xFeuXLpFXK3+W/uCKJI5VQhNK2WJyewgzUhvxFs4W9d+n eD96NXFmYNkFLxs9CoBKhxA= X-Received: by 2002:a17:902:8f97:: with SMTP id z23-v6mr16828040plo.329.1525750628640; Mon, 07 May 2018 20:37:08 -0700 (PDT) Received: from roar.ozlabs.ibm.com (59-102-70-78.tpgi.com.au. [59.102.70.78]) by smtp.gmail.com with ESMTPSA id g3-v6sm27639834pgr.34.2018.05.07.20.37.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 May 2018 20:37:07 -0700 (PDT) Date: Tue, 8 May 2018 13:36:56 +1000 From: Nicholas Piggin To: Michael Ellerman Cc: Benjamin Herrenschmidt , Greg Kroah-Hartman , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Jiri Slaby Subject: Re: [PATCH 08/15] powerpc/powernv: implement opal_put_chars_atomic Message-ID: <20180508133656.5ad92847@roar.ozlabs.ibm.com> In-Reply-To: <87zi1bbvnl.fsf@concordia.ellerman.id.au> References: <20180430145558.4308-1-npiggin@gmail.com> <20180430145558.4308-9-npiggin@gmail.com> <1525168138.2325.100.camel@kernel.crashing.org> <20180501203721.7b60fcd8@roar.ozlabs.ibm.com> <87zi1bbvnl.fsf@concordia.ellerman.id.au> Organization: IBM X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 07 May 2018 20:35:42 +1000 Michael Ellerman wrote: > Nicholas Piggin writes: > > > On Tue, 01 May 2018 19:48:58 +1000 > > Benjamin Herrenschmidt wrote: > > > >> On Tue, 2018-05-01 at 00:55 +1000, Nicholas Piggin wrote: > >> > The RAW console does not need writes to be atomic, so relax > >> > opal_put_chars to be able to do partial writes, and implement an > >> > _atomic variant which does not take a spinlock. This API is used > >> > in xmon, so the less locking that is used, the better chance there > >> > is that a crash can be debugged. > >> > >> Same comment I already had :-) "atomic" in Linux tends to mean > >> something else (ie, atomic context), so I'd rather have something > >> like opal_put_chars_sync() or such... > > > > Oh yeah, I didn't ignore you, just... I thought atomic was okay. > > atomic *also* tends to mean happens atomically. I think the in > > atomic context meaning actually tends to be inatomic. > > > > Sync I actually thought could be more easily confused with > > synchronous vs asynchronous here. > > I think we probably want opal_put_chars() to stay as it is. > > And then add a variant for the call (just xmon?) that want lock free > behaviour. No it's not the lock which is important here, it is whether the message goes to the console atomically versus other writes. The raw console does not require this, only one which sends some control characters, which is the hvterm-protocol compatible variant of the vio console, and I think FSP console. BMC consoles for example always use raw. > opal_put_chars_unlocked() or something? I prefer the _atomic as the special case. Ordinarily we don't have a special requirement, but with the control characters then we do. Thanks, Nick