Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1305554

Re: [PATCH V11 3/7] dma: add Qualcomm Technologies HIDMA management driver

From Sinan Kaya <okaya@codeaurora.org>
Newsgroups linux.kernel
Subject Re: [PATCH V11 3/7] dma: add Qualcomm Technologies HIDMA management driver
Date 2016-01-10 14:20 +0100
Message-ID <qPo4y-4DC-3@gated-at.bofh.it> (permalink)
References <qN0SJ-48F-3@gated-at.bofh.it> <qN0SJ-48F-5@gated-at.bofh.it> <qNicW-79x-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


>> +
>> +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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V11 0/7] dma: add Qualcomm Technologies HIDMA driver Sinan Kaya <okaya@codeaurora.org> - 2016-01-04 01:10 +0100
  [PATCH V11 5/7] dma: qcom_hidma: implement lower level hardware interface Sinan Kaya <okaya@codeaurora.org> - 2016-01-04 01:10 +0100
    Re: [PATCH V11 5/7] dma: qcom_hidma: implement lower level hardware interface Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-01-04 20:10 +0100
      Re: [PATCH V11 5/7] dma: qcom_hidma: implement lower level hardware  interface Sinan Kaya <okaya@codeaurora.org> - 2016-01-10 15:10 +0100
  [PATCH V11 3/7] dma: add Qualcomm Technologies HIDMA management driver Sinan Kaya <okaya@codeaurora.org> - 2016-01-04 01:10 +0100
    Re: [PATCH V11 3/7] dma: add Qualcomm Technologies HIDMA management driver Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-01-04 19:40 +0100
      Re: [PATCH V11 3/7] dma: add Qualcomm Technologies HIDMA management  driver Vinod Koul <vinod.koul@intel.com> - 2016-01-05 05:50 +0100
      Re: [PATCH V11 3/7] dma: add Qualcomm Technologies HIDMA management  driver Sinan Kaya <okaya@codeaurora.org> - 2016-01-10 14:20 +0100
  [PATCH V11 1/7] dma: qcom_bam_dma: move to qcom directory Sinan Kaya <okaya@codeaurora.org> - 2016-01-04 01:10 +0100
  [PATCH V11 7/7] dma: qcom_hidma: add support for object hierarchy Sinan Kaya <okaya@codeaurora.org> - 2016-01-04 01:10 +0100
  [PATCH V11 4/7] dma: add Qualcomm Technologies HIDMA channel driver Sinan Kaya <okaya@codeaurora.org> - 2016-01-04 01:10 +0100
    Re: [PATCH V11 4/7] dma: add Qualcomm Technologies HIDMA channel driver Andy Shevchenko <andy.shevchenko@gmail.com> - 2016-01-04 19:50 +0100
      Re: [PATCH V11 4/7] dma: add Qualcomm Technologies HIDMA channel  driver Sinan Kaya <okaya@codeaurora.org> - 2016-01-05 15:10 +0100
  Re: [PATCH V11 0/7] dma: add Qualcomm Technologies HIDMA driver Sinan Kaya <okaya@codeaurora.org> - 2016-01-04 01:10 +0100
    Re: [PATCH V11 0/7] dma: add Qualcomm Technologies HIDMA driver Vinod Koul <vinod.koul@intel.com> - 2016-01-04 04:40 +0100
      Re: [PATCH V11 0/7] dma: add Qualcomm Technologies HIDMA driver Sinan Kaya <okaya@codeaurora.org> - 2016-01-04 05:00 +0100
  [PATCH V11 2/7] dma: hidma: Add Device Tree support Sinan Kaya <okaya@codeaurora.org> - 2016-01-04 01:10 +0100
  [PATCH V11 6/7] dma: qcom_hidma: add debugfs hooks Sinan Kaya <okaya@codeaurora.org> - 2016-01-04 01:10 +0100

csiph-web