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: Tue, 17 Mar 2020 17:43:01 +0530 Message-ID: <3aeb3083-2a31-b269-510d-eb608ff14ce5@codeaurora.org> References: <1584105134-13583-1-git-send-email-akashast@codeaurora.org> <1584105134-13583-8-git-send-email-akashast@codeaurora.org> <20200314005817.GN144492@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, agross-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, bjorn.andersson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org, broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, swboyd-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, mgautam-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, evgreen-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org To: Matthias Kaehlcke Return-path: In-Reply-To: <20200314005817.GN144492-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> Content-Language: en-US Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-spi.vger.kernel.org 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. Regards, Akash -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project