Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1341426imm; Mon, 9 Jul 2018 23:30:18 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdC00jTKGSpVyZHK5H66u45EytmFtH7JyMOL25/1toA4vYkZQo7GIs+4xVbzrZxQDCkPHGz X-Received: by 2002:a17:902:b596:: with SMTP id a22-v6mr22997461pls.154.1531204218200; Mon, 09 Jul 2018 23:30:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531204218; cv=none; d=google.com; s=arc-20160816; b=tuxTcRhdhndLVIUkMNChu1zbhfDO+cEXgNPDiyxVklRyeiVjFO2ky4CG6EOQQBxgJI NsPZphfvAydE1r6/aL5n0FMr5yW0nTRr8nutzLvs6OEuvppvU5T0pwlpjlyxW3uIHCHU fd/g4ZN9yJnccQLmrIVP8hy8RqykDLcjm8TMFYkVld0POmZ7oS+PwxP1hDL198QcOr2F vP7gCqPkLGKYF0OBAi07F2pCuGXKBt0AswV05u1KvxaENhMUuQ1JCr6zO5IvNPjSuHiE 1QwLLD8mVVMZ9m1vrDfPFoMqxQE3qc+XoEg0WBOkTpGFkycvgairqIRFMbfQ86amRJlF PAnA== 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=TCmnogIuWCkUD5DrOc3t4rhCzHNY9ynTLLNqfoRBTMg=; b=N/kLrV/0bbdfTofpMbbZyhfMlBKsX2nxOT5b31koa21GufLNAyZDSHGsmj5QNbwb8s hh0ywg66YJUPidTwBUwWV0OjuR/+3YYv57coH/VjJWonTIuQD+4K+0N6rcPlJ+nnfqZy KPN6UzdWyLmyw3S2FTXcS6g0nJCZZ3csMPEsJAYga6AWFavFbP0P3QX696dguT7t9DQm t+gw8L/OecNOtS/gTPziGEAAyPRuRUdTmAmkYNMwVtVRTjZrwDXz7TqLflZ/7UvibWcf 790wLYBoFvoOcyE1Ee6gnMoxaY+tWAzRUiY5xkbuEFBxzUskJDCIbRel9qoTUOc1/R7h pvpw== 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 c10-v6si16292659pla.98.2018.07.09.23.30.01; Mon, 09 Jul 2018 23:30:18 -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 S1751194AbeGJG3Q (ORCPT + 99 others); Tue, 10 Jul 2018 02:29:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56894 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751086AbeGJG3L (ORCPT ); Tue, 10 Jul 2018 02:29:11 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A1AACCB0; Tue, 10 Jul 2018 06:29:10 +0000 (UTC) Date: Tue, 10 Jul 2018 08:29:07 +0200 From: Greg Kroah-Hartman To: Sujeev Dias Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, Tony Truong , Siddartha Mohanadoss Subject: Re: [PATCH v2 3/7] mhi_bus: core: add support for data transfer Message-ID: <20180710062907.GB892@kroah.com> References: <1524795811-21399-1-git-send-email-sdias@codeaurora.org> <1531166894-30984-1-git-send-email-sdias@codeaurora.org> <1531166894-30984-4-git-send-email-sdias@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1531166894-30984-4-git-send-email-sdias@codeaurora.org> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 09, 2018 at 01:08:10PM -0700, Sujeev Dias wrote: > +static void mhi_add_ring_element(struct mhi_controller *mhi_cntrl, > + struct mhi_ring *ring) > +{ > + ring->wp += ring->el_size; > + if (ring->wp >= (ring->base + ring->len)) > + ring->wp = ring->base; > + /* smp update */ > + smp_wmb(); Why do this? You need to comment the heck out of odd stuff like this. Also, why are you using your own ring buffer code? What's wrong with the code that is in the kernel already for this type of thing? thanks, greg k-h