From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F144C10DCE for ; Wed, 18 Mar 2020 13:48:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 10E3820724 for ; Wed, 18 Mar 2020 13:48:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="v+0xVmql" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727031AbgCRNsb (ORCPT ); Wed, 18 Mar 2020 09:48:31 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:52955 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726851AbgCRNsb (ORCPT ); Wed, 18 Mar 2020 09:48:31 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1584539310; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=e7D++PiZS2wNSyjtok+pyoNm2YTmDPQke/rQXBiRN5U=; b=v+0xVmqlyEYqGZJyr1xyBYtMgx9ufvvxVyzxWxuJlNHt6k+vRn+XeWj0edh5krwMdJrhg+4N 9SsrKwWC7sZdwOAGXX2k0deJ6+AoSIrO5EJdkGRQs+MD287ynrdiT5nxS+NihuX7B1w3rp6G qKwPw0PmqRyZEq35CoXw4sFE4Js= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI1MzIzYiIsICJsaW51eC1hcm0tbXNtQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e7226a2.7f4612e53730-smtp-out-n03; Wed, 18 Mar 2020 13:48:18 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 29F15C43636; Wed, 18 Mar 2020 13:48:18 +0000 (UTC) Received: from [192.168.0.8] (unknown [183.83.138.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: akashast) by smtp.codeaurora.org (Postfix) with ESMTPSA id AB192C433CB; Wed, 18 Mar 2020 13:48:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org AB192C433CB Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=akashast@codeaurora.org Subject: Re: [PATCH V2 7/8] spi: spi-qcom-qspi: Add interconnect support To: Evan Green Cc: Matthias Kaehlcke , Greg Kroah-Hartman , Andy Gross , Bjorn Andersson , wsa@the-dreams.de, Mark Brown , Mark Rutland , Rob Herring , linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Stephen Boyd , Manu Gautam , linux-arm-msm , linux-serial@vger.kernel.org, Doug Anderson , Georgi Djakov References: <1584105134-13583-1-git-send-email-akashast@codeaurora.org> <1584105134-13583-8-git-send-email-akashast@codeaurora.org> <20200314005817.GN144492@google.com> <3aeb3083-2a31-b269-510d-eb608ff14ce5@codeaurora.org> From: Akash Asthana Message-ID: Date: Wed, 18 Mar 2020 19:18:07 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Hi Evan, On 3/18/2020 12:38 AM, Evan Green wrote: > On Tue, Mar 17, 2020 at 5:13 AM Akash Asthana wrote: >> Hi Matthias, >> >> On 3/14/2020 6:28 AM, Matthias Kaehlcke wrote: >>> Hi, >>> >>> On Fri, Mar 13, 2020 at 06:42:13PM +0530, Akash Asthana wrote: >>>> Get the interconnect paths for QSPI device and vote according to the >>>> current bus speed of the driver. >>>> >>>> Signed-off-by: Akash Asthana >>>> --- >>>> - As per Bjorn's comment, introduced and using devm_of_icc_get API for getting >>>> path handle >>>> - As per Matthias comment, added error handling for icc_set_bw call >>>> >>>> drivers/spi/spi-qcom-qspi.c | 46 ++++++++++++++++++++++++++++++++++++++++++++- >>>> 1 file changed, 45 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c >>>> index 3c4f83b..ad48f43 100644 >>>> --- a/drivers/spi/spi-qcom-qspi.c >>>> +++ b/drivers/spi/spi-qcom-qspi.c >>>> @@ -2,6 +2,7 @@ >>>> // Copyright (c) 2017-2018, The Linux foundation. All rights reserved. >>>> >>>> #include >>>> +#include >>>> #include >>>> #include >>>> #include >>>> @@ -139,7 +140,10 @@ struct qcom_qspi { >>>> struct device *dev; >>>> struct clk_bulk_data *clks; >>>> struct qspi_xfer xfer; >>>> - /* Lock to protect xfer and IRQ accessed registers */ >>>> + struct icc_path *icc_path_cpu_to_qspi; >>>> + unsigned int avg_bw_cpu; >>>> + unsigned int peak_bw_cpu; >>> This triplet is a recurring pattern, and is probably not limited to geni SE/QSPI. >>> On https://patchwork.kernel.org/patch/11436889/#23221925 I suggested the creation >>> of a geni SE specific struct, however adding a generic convenience struct to >>> 'linux/interconnect.h' might be the better solution: >>> >>> struct icc_client { >>> struct icc_path *path; >>> unsigned int avg_bw; >>> unsigned int peak_bw; >>> }; >>> >>> I'm sure there are better names for it, but this would be the idea. >> Yeah, I think introducing this to ICC header would be better solution. > +Georgi > > I'm not as convinced this structure is generally useful and belongs in > the interconnect core. The thing that strikes me as weird with putting > it in the core is now we're saving these values both inside and > outside the interconnect core. IIUC, you meant to say struct icc_req(inside icc_path) will be saving avg_bw and peak_bw so no need to save it outside icc_path? > In the GENI case here, we only really > need them to undo the 0 votes we cast during suspend. If "vote for 0 > in suspend and whatever it was before at resume" is a recurring theme, > maybe the core should give us path_disable() and path_enable() calls > instead. I'm thinking out loud, maybe Georgi has some thoughts. > > Akash, for now if you want to avoid wading into a larger discussion > maybe just refactor to a common structure local to GENI. Ok Thanks, Akash > > > -Evan -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project From mboxrd@z Thu Jan 1 00:00:00 1970 From: Akash Asthana Subject: Re: [PATCH V2 7/8] spi: spi-qcom-qspi: Add interconnect support Date: Wed, 18 Mar 2020 19:18:07 +0530 Message-ID: References: <1584105134-13583-1-git-send-email-akashast@codeaurora.org> <1584105134-13583-8-git-send-email-akashast@codeaurora.org> <20200314005817.GN144492@google.com> <3aeb3083-2a31-b269-510d-eb608ff14ce5@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-arm-msm-owner@vger.kernel.org To: Evan Green Cc: Matthias Kaehlcke , Greg Kroah-Hartman , Andy Gross , Bjorn Andersson , wsa@the-dreams.de, Mark Brown , Mark Rutland , Rob Herring , linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Stephen Boyd , Manu Gautam , linux-arm-msm , linux-serial@vger.kernel.org, Doug Anderson , Georgi Djakov List-Id: linux-i2c@vger.kernel.org Hi Evan, On 3/18/2020 12:38 AM, Evan Green wrote: > On Tue, Mar 17, 2020 at 5:13 AM Akash Asthana wrote: >> Hi Matthias, >> >> On 3/14/2020 6:28 AM, Matthias Kaehlcke wrote: >>> Hi, >>> >>> On Fri, Mar 13, 2020 at 06:42:13PM +0530, Akash Asthana wrote: >>>> Get the interconnect paths for QSPI device and vote according to the >>>> current bus speed of the driver. >>>> >>>> Signed-off-by: Akash Asthana >>>> --- >>>> - As per Bjorn's comment, introduced and using devm_of_icc_get API for getting >>>> path handle >>>> - As per Matthias comment, added error handling for icc_set_bw call >>>> >>>> drivers/spi/spi-qcom-qspi.c | 46 ++++++++++++++++++++++++++++++++++++++++++++- >>>> 1 file changed, 45 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c >>>> index 3c4f83b..ad48f43 100644 >>>> --- a/drivers/spi/spi-qcom-qspi.c >>>> +++ b/drivers/spi/spi-qcom-qspi.c >>>> @@ -2,6 +2,7 @@ >>>> // Copyright (c) 2017-2018, The Linux foundation. All rights reserved. >>>> >>>> #include >>>> +#include >>>> #include >>>> #include >>>> #include >>>> @@ -139,7 +140,10 @@ struct qcom_qspi { >>>> struct device *dev; >>>> struct clk_bulk_data *clks; >>>> struct qspi_xfer xfer; >>>> - /* Lock to protect xfer and IRQ accessed registers */ >>>> + struct icc_path *icc_path_cpu_to_qspi; >>>> + unsigned int avg_bw_cpu; >>>> + unsigned int peak_bw_cpu; >>> This triplet is a recurring pattern, and is probably not limited to geni SE/QSPI. >>> On https://patchwork.kernel.org/patch/11436889/#23221925 I suggested the creation >>> of a geni SE specific struct, however adding a generic convenience struct to >>> 'linux/interconnect.h' might be the better solution: >>> >>> struct icc_client { >>> struct icc_path *path; >>> unsigned int avg_bw; >>> unsigned int peak_bw; >>> }; >>> >>> I'm sure there are better names for it, but this would be the idea. >> Yeah, I think introducing this to ICC header would be better solution. > +Georgi > > I'm not as convinced this structure is generally useful and belongs in > the interconnect core. The thing that strikes me as weird with putting > it in the core is now we're saving these values both inside and > outside the interconnect core. IIUC, you meant to say struct icc_req(inside icc_path) will be saving avg_bw and peak_bw so no need to save it outside icc_path? > In the GENI case here, we only really > need them to undo the 0 votes we cast during suspend. If "vote for 0 > in suspend and whatever it was before at resume" is a recurring theme, > maybe the core should give us path_disable() and path_enable() calls > instead. I'm thinking out loud, maybe Georgi has some thoughts. > > Akash, for now if you want to avoid wading into a larger discussion > maybe just refactor to a common structure local to GENI. Ok Thanks, Akash > > > -Evan -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project