Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1087736pxb; Fri, 6 Nov 2020 00:03:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJw02DVzVex64WBC7wtyyXXYesu7FFTyNZspSTc0wFShOF2ncJo5MNtQgw2BoCUkMpK+Em7/ X-Received: by 2002:a17:906:cc4c:: with SMTP id mm12mr901073ejb.141.1604649807592; Fri, 06 Nov 2020 00:03:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604649807; cv=none; d=google.com; s=arc-20160816; b=YfPyeTLLwDTmbmmkyhWWXVbI72NbpPTUC0clEjKNABg3VbYBpDpbWJ4X5+4DMaQS4q kyc9G0wsoZkyMpwq1tG3nQtiuBHbYes3fqXA9s4kWiUCGckskHYAWFBphAnajqU4qK5U 1UN9WwABK2/8GEwlp/FL2ENuYqhhFNFUOFS3uZNOql8mrQbbmOmPB5OBbr6DD5UpUwja CrS9sIDpghtO1iSeo3ZrVrw7sH6UVsIBNm3DG7f9c6ZQIbPm8wCl4+SDHVvV95U0s14l DVF/i2WTXtDhOe4x9fx0H4agIahOAp7A2xkO2liAYk9UKKlZw5uMsDaxo5cyNQT7BV3R aVPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=OUDJWBRHwmYg5tlx0f56mWuGsqX70lEgfuyCu6MGgDY=; b=FKWRSimDB62evFpnxr+irhUY+y4Im61juFu0gTILpvSkWAhcENqSoWo40QmqkESY3x Jpi9Q7WG14H6a36tbw9mAkmd4okybMlNkMdlkt3sEpNgneyW1K1T6xvXJ/zNAxFFLbV4 HtBvYFxSAu13X4ZzZr+1lROkSKJdzIkOZPGEjOtVvV3qf4S0B+Of7w74PKbhD4sV6xYA alyAW1zt4vI00TwNdZ6prxNOkqCXob2djwY0OZzKgi+yvwWS6RDorWSj4POlTgbQVMaM pyuowvVFVHwEPOsPKJigRXcnDj3RBT8qekQpLKmMMqux+e4oGWlChFEIOpLWdzXyE+wc y3cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=drBTIQeZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d23si328643ejd.151.2020.11.06.00.02.58; Fri, 06 Nov 2020 00:03:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=drBTIQeZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726494AbgKFIAV (ORCPT + 99 others); Fri, 6 Nov 2020 03:00:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbgKFIAV (ORCPT ); Fri, 6 Nov 2020 03:00:21 -0500 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7803CC0613CF for ; Fri, 6 Nov 2020 00:00:21 -0800 (PST) Received: by mail-pf1-x443.google.com with SMTP id 13so588205pfy.4 for ; Fri, 06 Nov 2020 00:00:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=OUDJWBRHwmYg5tlx0f56mWuGsqX70lEgfuyCu6MGgDY=; b=drBTIQeZXlaXVlJsp27DBaPcuBEycKjamPfhc6zYwpws6xfRK9vfgZiWkV4rNEi7M5 OWrmw4f3RSK30h82lZrWg1X+YsHJy/tE9Dsz47/UmJ0/mT7HxZu/b9lbjmfPzjoFdNw6 A/4gZ3r9bwpgfdaUM8bgOuTf9zzZJxt2nHtTrd9G454SzIEz0OXannaDks1IW1GuVQw9 mvkNK1oWCp4q139za+bDu/4H+zQKgMUlNHDiG7rblNCObYMnhLP2eY4a3Zj/SVWdqo7m idV07qkN/Nvy08s84lPX0sax058qONlFSIjttgXhUiETxNR1JCnD0RQwy56A3jAkpMMs fg5Q== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=OUDJWBRHwmYg5tlx0f56mWuGsqX70lEgfuyCu6MGgDY=; b=aSKFX7mn566q5evyCgGU90k8SN2ztMGGxOgowxYYyp3BZ4E7h/4d6b96DUze6a5EJ5 gdUTDsotooXBWV3z/okD84P46RlyslXqXPeICH1ajmIgwXmxOX/rQA8ZfJZRANJ54TQl ProPnEkBnLkLDTPEAUPw5pFG/CdVVc92tAmn7mIyOU1ITXInNCiNGq07Cpp7QWhqetLX yslSJAc35i4ulTIhm+iFozMqKP2RRssks/Wmqwx5ZJxJbEDbHlMXQXT6IyZaZbzu/u+v c/IHCOyah3LgF2JnAsq2n2QGSsPAroXld/T7QRGLnFhmr3BZMtrUG2uiS/RGBQKx+SYQ DWDA== X-Gm-Message-State: AOAM531QD/UgXbpQcOoB9+pfweCTogFsK4/wHFc/g/OirpgfklxLuLmI Cp9T0X4B6ClnXpsm/EdJbFu/ X-Received: by 2002:a17:90b:a51:: with SMTP id gw17mr1125617pjb.218.1604649620738; Fri, 06 Nov 2020 00:00:20 -0800 (PST) Received: from work ([103.59.133.81]) by smtp.gmail.com with ESMTPSA id a23sm810149pgv.35.2020.11.06.00.00.18 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Nov 2020 00:00:19 -0800 (PST) Date: Fri, 6 Nov 2020 13:30:14 +0530 From: Manivannan Sadhasivam To: Hemant Kumar Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, jhugo@codeaurora.org, bbhatt@codeaurora.org, loic.poulain@linaro.org Subject: Re: [PATCH v1 1/2] bus: mhi: core: Count number of HW channels supported by controller Message-ID: <20201106080014.GH3473@work> References: <1603504843-38557-1-git-send-email-hemantk@codeaurora.org> <1603504843-38557-2-git-send-email-hemantk@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1603504843-38557-2-git-send-email-hemantk@codeaurora.org> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 23, 2020 at 07:00:42PM -0700, Hemant Kumar wrote: > Device provides the total number of HW channels it supports using MHI > configuration register. Host supported HW channels shall not exceed > that value. In order to make this check, a counter is needed to store > total number of HW channels required by host. > > Signed-off-by: Hemant Kumar > --- > drivers/bus/mhi/core/init.c | 2 ++ > drivers/bus/mhi/core/internal.h | 1 + > include/linux/mhi.h | 1 + > 3 files changed, 4 insertions(+) > > diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c > index 0ffdebd..70fd6af 100644 > --- a/drivers/bus/mhi/core/init.c > +++ b/drivers/bus/mhi/core/init.c > @@ -725,6 +725,8 @@ static int parse_ch_cfg(struct mhi_controller *mhi_cntrl, > mhi_chan = &mhi_cntrl->mhi_chan[chan]; > mhi_chan->name = ch_cfg->name; > mhi_chan->chan = chan; > + if (chan >= MHI_HW_CHAN_START_IDX) > + mhi_cntrl->hw_chan++; > > mhi_chan->tre_ring.elements = ch_cfg->num_elements; > if (!mhi_chan->tre_ring.elements) > diff --git a/drivers/bus/mhi/core/internal.h b/drivers/bus/mhi/core/internal.h > index 7989269..3d8e480 100644 > --- a/drivers/bus/mhi/core/internal.h > +++ b/drivers/bus/mhi/core/internal.h > @@ -454,6 +454,7 @@ enum mhi_pm_state { > #define PRIMARY_CMD_RING 0 > #define MHI_DEV_WAKE_DB 127 > #define MHI_MAX_MTU 0xffff > +#define MHI_HW_CHAN_START_IDX 100 > #define MHI_RANDOM_U32_NONZERO(bmsk) (prandom_u32_max(bmsk) + 1) > > enum mhi_er_type { > diff --git a/include/linux/mhi.h b/include/linux/mhi.h > index d4841e5..ea441d2 100644 > --- a/include/linux/mhi.h > +++ b/include/linux/mhi.h > @@ -389,6 +389,7 @@ struct mhi_controller { > struct list_head lpm_chans; > int *irq; > u32 max_chan; > + u32 hw_chan; Please add Kdoc for this member. With that, Reviewed-by: Manivannan Sadhasivam Thanks, Mani > u32 total_ev_rings; > u32 hw_ev_rings; > u32 sw_ev_rings; > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project >