lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ed82fe57-fade-7dc7-50e4-acce014a5d2a@nvidia.com>
Date:   Tue, 7 Mar 2023 01:11:37 +0530
From:   Sumit Gupta <sumitg@...dia.com>
To:     Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        <treding@...dia.com>, <dmitry.osipenko@...labora.com>,
        <viresh.kumar@...aro.org>, <rafael@...nel.org>,
        <jonathanh@...dia.com>, <robh+dt@...nel.org>,
        <linux-kernel@...r.kernel.org>, <linux-tegra@...r.kernel.org>,
        <linux-pm@...r.kernel.org>, <devicetree@...r.kernel.org>
CC:     <sanjayc@...dia.com>, <ksitaraman@...dia.com>, <ishah@...dia.com>,
        <bbasu@...dia.com>, Sumit Gupta <sumitg@...dia.com>
Subject: Re: [Patch v1 04/10] memory: tegra: add support for software mc
 clients in Tegra234



On 22/12/22 17:06, Krzysztof Kozlowski wrote:
> External email: Use caution opening links or attachments
> 
> 
> On 20/12/2022 17:02, Sumit Gupta wrote:
>> Adding support for dummy memory controller clients for use by
>> software.
> 
> Use imperative mode (applies to other commits as well)
> https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95
> 
Thank you for suggesting.
I referred this and changed in v2.

>> ---
>>   drivers/memory/tegra/mc.c       | 65 +++++++++++++++++++++++----------
>>   drivers/memory/tegra/tegra234.c | 21 +++++++++++
>>   include/soc/tegra/mc.h          |  3 ++
>>   include/soc/tegra/tegra-icc.h   |  7 ++++
>>   4 files changed, 76 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
>> index ff887fb03bce..4ddf9808fe6b 100644
>> --- a/drivers/memory/tegra/mc.c
>> +++ b/drivers/memory/tegra/mc.c
>> @@ -755,6 +755,39 @@ const char *const tegra_mc_error_names[8] = {
>>        [6] = "SMMU translation error",
>>   };
>>
>> +static int tegra_mc_add_icc_node(struct tegra_mc *mc, unsigned int id, const char *name,
>> +                              unsigned int bpmp_id, unsigned int type)
>> +{
>> +     struct tegra_icc_node *tnode;
>> +     struct icc_node *node;
>> +     int err;
>> +
>> +     tnode = kzalloc(sizeof(*tnode), GFP_KERNEL);
>> +     if (!tnode)
>> +             return -ENOMEM;
>> +
>> +     /* create MC client node */
>> +     node = icc_node_create(id);
>> +     if (IS_ERR(node))
>> +             return -EINVAL;
> 
> Why do you return other error? It does not look like you moved the code
> correctly, but with changes. I also do not see how this is related to
> commit msg...
> 
Corrected in v2.

Thanks,
Sumit

>> +
>> +     node->name = name;
>> +     icc_node_add(node, &mc->provider);
>> +
>> +     /* link Memory Client to Memory Controller */
>> +     err = icc_link_create(node, TEGRA_ICC_MC);
>> +     if (err)
>> +             return err;
>> +
>> +     node->data = tnode;
>> +     tnode->node = node;
>> +     tnode->bpmp_id = bpmp_id;
>> +     tnode->type = type;
>> +     tnode->mc = mc;
>> +
>> +     return 0;
>> +}
>> +
>>   /*
>>    * Memory Controller (MC) has few Memory Clients that are issuing memory
>>    * bandwidth allocation requests to the MC interconnect provider. The MC
>> @@ -780,7 +813,6 @@ const char *const tegra_mc_error_names[8] = {
>>    */
>>   static int tegra_mc_interconnect_setup(struct tegra_mc *mc)
>>   {
>> -     struct tegra_icc_node *tnode;
>>        struct icc_node *node;
>>        unsigned int i;
>>        int err;
>> @@ -820,30 +852,23 @@ static int tegra_mc_interconnect_setup(struct tegra_mc *mc)
>>                goto remove_nodes;
>>
>>        for (i = 0; i < mc->soc->num_clients; i++) {
>> -             tnode = kzalloc(sizeof(*tnode), GFP_KERNEL);
>> -             if (!tnode)
>> -                     return -ENOMEM;
>> -
>> -             /* create MC client node */
>> -             node = icc_node_create(mc->soc->clients[i].id);
>> -             if (IS_ERR(node)) {
>> -                     err = PTR_ERR(node);
>> +             err = tegra_mc_add_icc_node(mc, mc->soc->clients[i].id,
>> +                                         mc->soc->clients[i].name,
>> +                                         mc->soc->clients[i].bpmp_id,
>> +                                         mc->soc->clients[i].type);
>> +             if (err)
>>                        goto remove_nodes;
>> -             }
>>
>> -             node->name = mc->soc->clients[i].name;
>> -             icc_node_add(node, &mc->provider);
>> +     }
>> +
> 
> Best regards,
> Krzysztof
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ