Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1835313pxb; Wed, 9 Feb 2022 05:37:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZ1uuYXD2HVWpJ3K6hkXIP+pePPCdiOqMAX3byrHtZ28+VmumFGqwj3uFW1f3KiZsA9knU X-Received: by 2002:a17:906:77c3:: with SMTP id m3mr1954035ejn.698.1644413820184; Wed, 09 Feb 2022 05:37:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644413820; cv=none; d=google.com; s=arc-20160816; b=0U+sN2uzIAorzl4ufj/7N/UlB4TYxocq75JL9YXcIi/dDQw1phzkHSrvGFqJH4B8Fb 3DbAURQuTfXFaf6ABh9MCxI9/ZWBsKT9oRgGFWBI7ulKgUHNjLm5wVRK4jwE57X+7IFH 9wMfCflL8y2Le1qKCOd7IukOqzPE0s3PYUW/Hdkpuv6EXZ5kDu91WAddpm/TXRaiUtO9 hN8cojUY58NuLu0yVr+6x2c49Bq/dafmAuMtdkLWknPzzXgO1qiBKZuLAYj1mB8qLFgl 4fuUg3eOVw0bOq4eQYl3utN4zbh6Pfl2g8/OW/n/eh6PjqIdzkhFyeIInhW00E/WLrT9 o1GQ== 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=mPOhX+PMvbE3nMy9D/LO76ZIhW2byGrvD0+G9dkKQQo=; b=kqZe5pGrHLmbPyVZYSHHu/X7YIJojJzae2vDz2zwunEU2s/02jNFTX1asrb8eSqObE 52mxAI2atbHP36cWgPzq7JQeMgyFpRsQt6x7VnXvm7iipVfZIvxwYdEWZYN6e5Fhfsjh 7RtRGKZeqgWsR2XhOcd32m2zI4KovxyX1o6rYdJ2RqlcbFDxLSfVrkx3ke9Gj+g9C0sd aOyWi0A4vU41l+SYXp6oOXHMSB6nWE0V/qxk6+1oit/QR0Imno4x6p9HFztPOrmcGMPa XulX3MUhymYqtj/u/XX94jFmL9qh7tOqH3YqraPVjHJ5Al8bSA0z1j32vXb4BO8YJ4Sl XVNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jhm64i+b; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk32si10870485ejc.391.2022.02.09.05.36.35; Wed, 09 Feb 2022 05:37:00 -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=@kernel.org header.s=k20201202 header.b=jhm64i+b; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233769AbiBINAW (ORCPT + 99 others); Wed, 9 Feb 2022 08:00:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231338AbiBINAV (ORCPT ); Wed, 9 Feb 2022 08:00:21 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C970CC05CB9A; Wed, 9 Feb 2022 05:00:24 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 76575B820FD; Wed, 9 Feb 2022 13:00:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBCE1C340E7; Wed, 9 Feb 2022 13:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644411622; bh=/9X2xp0j3tXfdxWQ7rCzTJr5aPGFd8EeKLBHz48x/oE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jhm64i+brAqc11UYf7pdgHKYCcqwsnFGTTe8UFR7UeAC/KPXuENCgwkKFaUeW/t+k o2mdgr/jviqmqGPHBo0s9JuRn1JQ9seArYZRzYx9TLGEwXsi7bRPKAmjfDPGovKwP3 eHZGPPO55IKOo/cRdkzLQYJIZ/GKhqOV6otRaSUswXpKVEcF68IUZFoVUU35U9o2id lFkOUIQzMIq36jRfyXJJ8alaIkCwzOd46/s1o8pd9iczbUTUvPQctLC0aw+iy6b43M vQcjkfa0++k5pQi+YrmQep0jMDdQoDzZq6Ki7MGuGVr0msBsiVx3+rBWhzmUSrBazg HAiqprwBGeg2Q== Date: Wed, 9 Feb 2022 18:30:14 +0530 From: Manivannan Sadhasivam To: mhi@lists.linux.dev Cc: quic_hemantk@quicinc.com, quic_bbhatt@quicinc.com, quic_jhugo@quicinc.com, vinod.koul@linaro.org, bjorn.andersson@linaro.org, dmitry.baryshkov@linaro.org, quic_vbadigan@quicinc.com, quic_cang@quicinc.com, quic_skananth@quicinc.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, elder@linaro.org, Paul Davey , Hemant Kumar , stable@vger.kernel.org Subject: Re: [PATCH 01/23] bus: mhi: Fix pm_state conversion to string Message-ID: <20220209130014.GC10700@workstation> References: <20220209094601.26131-1-manivannan.sadhasivam@linaro.org> <20220209094601.26131-2-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220209094601.26131-2-manivannan.sadhasivam@linaro.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 09, 2022 at 03:15:39PM +0530, Manivannan Sadhasivam wrote: > From: Paul Davey > > On big endian architectures the mhi debugfs files which report pm state > give "Invalid State" for all states. This is caused by using > find_last_bit which takes an unsigned long* while the state is passed in > as an enum mhi_pm_state which will be of int size. > > Fix by using __fls to pass the value of state instead of find_last_bit. > > Fixes: a6e2e3522f29 ("bus: mhi: core: Add support for PM state transitions") > Signed-off-by: Paul Davey > Reviewed-by: Manivannan Sadhasivam > Reviewed-by: Hemant Kumar > Cc: stable@vger.kernel.org > Signed-off-by: Manivannan Sadhasivam Please ignore this patch. It is missing the v2 prefix. Thanks, Mani > --- > drivers/bus/mhi/core/init.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c > index 046f407dc5d6..0d588b60929e 100644 > --- a/drivers/bus/mhi/core/init.c > +++ b/drivers/bus/mhi/core/init.c > @@ -79,10 +79,12 @@ static const char * const mhi_pm_state_str[] = { > > const char *to_mhi_pm_state_str(enum mhi_pm_state state) > { > - unsigned long pm_state = state; > - int index = find_last_bit(&pm_state, 32); > + int index; > > - if (index >= ARRAY_SIZE(mhi_pm_state_str)) > + if (state) > + index = __fls(state); > + > + if (!state || index >= ARRAY_SIZE(mhi_pm_state_str)) > return "Invalid State"; > > return mhi_pm_state_str[index]; > @@ -789,7 +791,6 @@ static int parse_ch_cfg(struct mhi_controller *mhi_cntrl, > mhi_chan->offload_ch = ch_cfg->offload_channel; > mhi_chan->db_cfg.reset_req = ch_cfg->doorbell_mode_switch; > mhi_chan->pre_alloc = ch_cfg->auto_queue; > - mhi_chan->wake_capable = ch_cfg->wake_capable; > > /* > * If MHI host allocates buffers, then the channel direction > -- > 2.25.1 >