Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1883249imm; Sat, 2 Jun 2018 11:17:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ0jfc8Ajb4tHgdydSAi5X4UmW5KpHwQmmBplzgWtnjNDg5GeWRwgjmP2F9UsWIixDcNUuX X-Received: by 2002:a63:3807:: with SMTP id f7-v6mr12505870pga.446.1527963464897; Sat, 02 Jun 2018 11:17:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527963464; cv=none; d=google.com; s=arc-20160816; b=dGg/MRi2l6rZ6LZ7S4QK0T7rDTYdl0MgDvOxdpz6asj9g8kwE3RGXThCOJnKIz9N6o FTVGYWHl2RZSEp9fITOVyZxyNWCxdyV3AJosBGcZoM5Si/tUlYM7aywHqSI2nRfd4HO3 AIoFZfCNcTvoR9/E9DBJnKTuS36zKodfWARZPX5j8Od8JTTm7HY2Kvu/KEF98Bz03aM9 dm7/CDEKgXTFm/U4KfJN9eihcCPPnHIBOm16AEVE28i2nk9B+bPU2WGpbORns1BjtBp3 HbidqFHxiCEcI45xd7+lw4GSxZ3s/RoKfJYMoWJ5SMFfwEZsbPoATndEPQ1XWsxtscV9 qLHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=hMctXNcvio77J7QipAUAl+z5x95G0bNpDbERgHoHqTA=; b=D0dDIIRKzMhd9NGPGItibyn7yNu+yAH1xiMODa4PsYOFHtu+v7zONQrQ+4VP/JPcLY h2iN7OrVbnUaZR78RjU+jBZeeNnGPU1nERJIfX8c/TR5XyEi8N/6dMtSxSrb+9ZYkNLi b3/OrU9fpo8NO0rLb/jLR3p7dAPipiwFeeZYRqVTIJJFtZBJXQNKh1AtUDmm0EyOAWD6 ywghB7iBRmJgvuOWOWks2qnKquMPIyieg58gcZu3NxmMQgNG3O4LudMbvpK9OzcXmalD BUZgz1Tp5TR9HSF6RM5AfQ2LWgZbYFu3UfbZLl4VBwoM1VB4vzU0qz+s1JuFMznSeAb8 kkkA== 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 x1-v6si40920774plv.520.2018.06.02.11.17.10; Sat, 02 Jun 2018 11:17:44 -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 S1751812AbeFBSQb (ORCPT + 99 others); Sat, 2 Jun 2018 14:16:31 -0400 Received: from mslow2.mail.gandi.net ([217.70.178.242]:33694 "EHLO slow1-d.mail.gandi.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751031AbeFBSQa (ORCPT ); Sat, 2 Jun 2018 14:16:30 -0400 Received: from relay12.mail.gandi.net (unknown [217.70.178.232]) by slow1-d.mail.gandi.net (Postfix) with ESMTP id A67AB3A55D3 for ; Sat, 2 Jun 2018 20:08:17 +0200 (CEST) Received: from localhost (modemcable141.60-22-96.mc.videotron.ca [96.22.60.141]) (Authenticated sender: hle@owl.eu.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 95E91200014; Sat, 2 Jun 2018 20:08:13 +0200 (CEST) Date: Sat, 2 Jun 2018 14:08:08 -0400 From: Hugo Lefeuvre To: Greg Kroah-Hartman Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernelnewbies@kernelnewbies.org Subject: Re: [PATCH] staging: pi433: add rw semaphore fixing concurrency issues Message-ID: <20180602180808.GA2052@hle-laptop.local> References: <20180601125037.GA2339@hle-laptop.local> <20180601160954.GA4895@kroah.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="u3/rZRmxL6MmkK24" Content-Disposition: inline In-Reply-To: <20180601160954.GA4895@kroah.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Level: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, > Unless you can measure the performance difference, do not use a rw > semaphore, just use a normal mutex please. Odds are it will be faster > in the end and take up less space. >=20 > So please test, or if you can't test, just use a mutex. I don't have the device yet, so I won't be able to test. I have opted for t= he mutex instead. I have just sent an updated version fixing another issue in my code: The mutex can't be included in pi433_instance because we have to lock it before dereferencing our pi433_instance pointer. The best solution I could think of was to create a wrapper struct pi433_data which would contain pointers to the pi433_instance and its mutex. I couldn't find any similar situation in the kernel, so I'm not sure it's the right way to go though. Thanks ! Regards, Hugo --=20 Hugo Lefeuvre (hle) | www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA --u3/rZRmxL6MmkK24 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEE5LpPtQuYJzvmooL3LVy48vb3khkFAlsS3QIACgkQLVy48vb3 khl7Ywf+JgbCTVNU4nnILdewRJwkssfRjabXeWDV4g7bXBTJs95CINea1zPUh+4H 6ivbIQJTZAe6aISgRFeMkRVwLdpC+eQHv1Tzn7yR2gthzMfU58tRpX8e4H62i0OC s8wlCrVvke7Fd8D6Cspxa5L6qVX5yY0gaABJnLh26J2/k3C0HPHQOLp9yLivSMDs BAf+hXStf7hbUN6Bm+Ju0CYyQvD3zvvsEsVSIAOhGJBBGFNl5og+wh7s2twMVKOb 2Rm+/ISG16wTlYm+H0PrQtJPu5P4pNB98Lo0GwO8ExouOvMjENROEgdD2HVwWmju Tu+s0ILa6l4JoKJB+4S0eypp6e7IVQ== =8z3d -----END PGP SIGNATURE----- --u3/rZRmxL6MmkK24--