Received: by 10.213.65.68 with SMTP id h4csp588651imn; Fri, 23 Mar 2018 11:02:29 -0700 (PDT) X-Google-Smtp-Source: AG47ELutUf/1ZKnBwq9p3atvtfcuXf1glAVqk44hrpcNMpAftEtN1tc85MEercqqXAre+jpvBWbR X-Received: by 10.98.102.131 with SMTP id s3mr18143375pfj.89.1521828149653; Fri, 23 Mar 2018 11:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521828149; cv=none; d=google.com; s=arc-20160816; b=lf+wfC1jECPGKSMfzGPLuOsJAUpWkUK+dmMe8fuAORmipHHkX/Dt/Ag6Ag6C/rP9mD 1gyIBpxeO9iMu/cJDXaBfXslKU5KXIq42UXLyza6mg57QqSQcx/W26OzBiNoLedtHc2J FPL3jgzzJlLrED7ry8Mj9VcYRlHqLeex3Fx8WsYmpwwHHrN43JCJZEEcxhFHArEpOEhg rX+a759LVkQ9RTTLLtAu+dd2ziLEPbmj/0H8zjyoglbXZUPa6OPtf52/JUQDBfIFEC+8 622mVYj9/nsiVxMihliQR53tqW9JM9TFNfdbHb4YYdhP+fdUsPbR+9DZxlnY/WFLTKAT 6ShA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:cc:to:from :date:arc-authentication-results; bh=uti7Pw896jzvwUC2KMi+AGopO+OSmoJ4orRfdwY5EEU=; b=VyHBS5S6Y5IbLAAWcSYpw/0sJHCm4RMJV995CLkvqG5PEOs9BLbMoHxL3p0jtAB7Mm kiyPAxXUqg8TMiRF3YDQgocs8Y3ICZehJfnVYQYIb8AByJqVyWT1Zq/oP5dUijfUWC9Y aY60Khh+mp92cmu984JtKl1PjtLuBu0KWnG44FiRJX1NgLlbtJHc2xHT8uaxlFnhtRKW 2D7ebnjbmNni2TX+NdLhRx57N04sgY9ioC/qBoMDF32XykGSLNfgROa5r6Sqduty9n61 rCniPO1KxtsRd8HXKJdnlYcScvu1kZ39r292C9Cnpv7z7MFimzOAs0veUAAp+D+WQ2sk YjwA== ARC-Authentication-Results: i=1; mx.google.com; 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 o3-v6si8738382pll.280.2018.03.23.11.02.12; Fri, 23 Mar 2018 11:02:29 -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; 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 S1752315AbeCWSAf (ORCPT + 99 others); Fri, 23 Mar 2018 14:00:35 -0400 Received: from mail.CARNet.hr ([161.53.123.6]:39987 "EHLO mail.carnet.hr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752294AbeCWSAe (ORCPT ); Fri, 23 Mar 2018 14:00:34 -0400 Received: from cnzgrivvl-t440p.carpriv.carnet.hr ([161.53.12.131]:46188 helo=gavran.carpriv.carnet.hr) by mail.carnet.hr with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1ezQzN-0006Hf-P0; Fri, 23 Mar 2018 19:00:30 +0100 Received: by gavran.carpriv.carnet.hr (Postfix, from userid 1000) id E24B925055; Fri, 23 Mar 2018 19:00:27 +0100 (CET) Date: Fri, 23 Mar 2018 19:00:27 +0100 From: Valentin Vidic To: Marcus Wolf Cc: Greg Kroah-Hartman , Simon =?iso-8859-1?Q?Sandstr=F6m?= , Marcus Wolf , Luca =?iso-8859-1?Q?S=F6the?= , Marcin Ciupak , Michael Panzlaff , Derek Robson , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Message-ID: <20180323180027.GM31333@gavran.carpriv.carnet.hr> References: <20180323094725.4904-1-Valentin.Vidic@CARNet.hr> <20180323114254.GL31333@gavran.carpriv.carnet.hr> <9442615c-5606-328a-f8cc-ad389af55ee3@smarthome-wolf.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9442615c-5606-328a-f8cc-ad389af55ee3@smarthome-wolf.de> User-Agent: Mutt/1.9.3 (2018-01-21) X-SA-Exim-Connect-IP: 161.53.12.131 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on rigel.CARNet.hr X-Spam-Level: X-Spam-Status: No, score=-2.9 required=10.0 tests=ALL_TRUSTED,BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 Subject: Re: [PATCH] staging: pi433: add descriptions for mutex locks X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 23, 2018 at 04:38:50PM +0100, Marcus Wolf wrote: > I had no time to work on the code for monthes now and the memorisation > of my thoughts when I was programming that (approx. one year ago) is > quite pale. > > As far as I remember, I read something, that the fifo has an integrated > protection, so no external protection is needed. But absolutely unsure. > > If I will find some time within the next days, I'll have a look at the > code and try to recall. > > But the most important thing already took place: We started thinking > about it :-) You are right, here is what kfifo.h says: /* * Note about locking : There is no locking required until only * one reader * and one writer is using the fifo and no kfifo_reset() will be * called * kfifo_reset_out() can be safely used, until it will be only called * in the reader thread. * For multiple writer and one reader there is only a need to lock the writer. * And vice versa for only one writer and multiple reader there is only a need * to lock the reader. */ In the case of pi433 there is only one reader (pi433_tx_thread) and there is no need for a lock there. But the char device (pi433_write) might have multiple writers so we leave the mutex just in that function? -- Valentin