linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: okaya@codeaurora.org (Sinan Kaya)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V11 3/7] dma: add Qualcomm Technologies HIDMA management driver
Date: Sun, 10 Jan 2016 08:14:11 -0500	[thread overview]
Message-ID: <56925923.6080007@codeaurora.org> (raw)
In-Reply-To: <CAHp75Vd49-1H+1dkDmJzLpVhov1g+uJV+YiTBC9Xd3hVTmwRVg@mail.gmail.com>


>> +
>> +static int set_priority(struct hidma_mgmt_dev *mdev, unsigned int i, u64 val)
>> +{
>> +       u64 tmp;
>> +       int rc;
>> +
>> +       if (i > mdev->dma_channels)
> 
> Shouldn't be >= ? I somehow missed that.
>
Corrected.

 
>> +               return -EINVAL;
>> +
>> +       tmp = mdev->priority[i];
>> +       mdev->priority[i] = val;
>> +       rc = hidma_mgmt_setup(mdev);
>> +       if (rc)
>> +               mdev->priority[i] = tmp;
>> +       return rc;
>> +}
>> +
>> +static int set_weight(struct hidma_mgmt_dev *mdev, unsigned int i, u64 val)
>> +{
>> +       u64 tmp;
>> +       int rc;
>> +
>> +       if (i > mdev->dma_channels)
> 
> Ditto.
OK

> 
>> +               return -EINVAL;
>> +
>> +       tmp = mdev->weight[i];
>> +       mdev->weight[i] = val;
>> +       rc = hidma_mgmt_setup(mdev);
>> +       if (rc)
>> +               mdev->weight[i] = tmp;
>> +       return rc;
>> +}
>> +

>> +
>> +int hidma_mgmt_init_sys(struct hidma_mgmt_dev *mdev)
>> +{
>> +       unsigned int i;
>> +       int rc;
>> +       int required;
>> +       struct kobject *chanops;
>> +
>> +       required = sizeof(*mdev->chroots) * mdev->dma_channels;
>> +       mdev->chroots = devm_kmalloc(&mdev->pdev->dev, required, GFP_KERNEL);
>> +       if (!mdev->chroots)
>> +               return -ENOMEM;
>> +
>> +       chanops = kobject_create_and_add("chanops", &mdev->pdev->dev.kobj);
>> +       if (!chanops)
>> +               return -ENOMEM;
>> +
>> +       /* create each channel directory here */
>> +       for (i = 0; i < mdev->dma_channels; i++) {
>> +               char name[10];
> 
> I would make this bigger just in case i comes bigger by some reason.
> 16 or 20 looks reasonable.
> 
made 20



-- 
Sinan Kaya
Qualcomm Technologies, Inc. on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

  parent reply	other threads:[~2016-01-10 13:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04  0:06 [PATCH V11 0/7] dma: add Qualcomm Technologies HIDMA driver Sinan Kaya
2016-01-04  0:06 ` [PATCH V11 1/7] dma: qcom_bam_dma: move to qcom directory Sinan Kaya
2016-01-04  0:06 ` [PATCH V11 2/7] dma: hidma: Add Device Tree support Sinan Kaya
2016-01-04  0:06 ` [PATCH V11 3/7] dma: add Qualcomm Technologies HIDMA management driver Sinan Kaya
2016-01-04 18:37   ` Andy Shevchenko
2016-01-05  4:46     ` Vinod Koul
2016-01-10 13:14     ` Sinan Kaya [this message]
2016-01-04  0:06 ` [PATCH V11 4/7] dma: add Qualcomm Technologies HIDMA channel driver Sinan Kaya
2016-01-04 18:43   ` Andy Shevchenko
2016-01-05 14:05     ` Sinan Kaya
2016-01-04  0:06 ` [PATCH V11 5/7] dma: qcom_hidma: implement lower level hardware interface Sinan Kaya
2016-01-04 19:01   ` Andy Shevchenko
2016-01-10 14:03     ` Sinan Kaya
2016-01-04  0:06 ` [PATCH V11 6/7] dma: qcom_hidma: add debugfs hooks Sinan Kaya
2016-01-04  0:06 ` [PATCH V11 7/7] dma: qcom_hidma: add support for object hierarchy Sinan Kaya
2016-01-04  0:09 ` [PATCH V11 0/7] dma: add Qualcomm Technologies HIDMA driver Sinan Kaya
2016-01-04  3:36   ` Vinod Koul
2016-01-04  3:51     ` Sinan Kaya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56925923.6080007@codeaurora.org \
    --to=okaya@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).