From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: Brent Taylor <motobud@gmail.com>, <netdev@vger.kernel.org>,
<ath6kl@lists.infradead.org>,
linux-wireless <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ath6kl: Use vmalloc to allocate ar->fw for api1 method
Date: Tue, 22 Dec 2015 11:12:16 +0200 [thread overview]
Message-ID: <87poxy7spb.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <CAFqt6zZfmue6XVVno2Ho8UfEwz1Z3YxFzbcZ9ZMOn5Fe_zJLmQ@mail.gmail.com> (Souptick Joarder's message of "Tue, 22 Dec 2015 14:35:20 +0530")
Souptick Joarder <jrdr.linux@gmail.com> writes:
> Hi Brent,
>
> On Tue, Dec 22, 2015 at 3:23 AM, Brent Taylor <motobud@gmail.com> wrote:
>> On Mon, Dec 21, 2015 at 1:23 PM, Souptick Joarder <jrdr.linux@gmail.com> wrote:
>>> Hi Brent,
>>>
>>> On Tue, Dec 1, 2015 at 11:11 AM, Brent Taylor <motobud@gmail.com> wrote:
>>>
>>>> --- a/drivers/net/wireless/ath/ath6kl/init.c
>>>> +++ b/drivers/net/wireless/ath/ath6kl/init.c
>>>> @@ -673,10 +673,15 @@ static int ath6kl_get_fw(struct ath6kl *ar, const char *filename,
>>>> return ret;
>>>>
>>>> *fw_len = fw_entry->size;
>>>> - *fw = kmemdup(fw_entry->data, fw_entry->size, GFP_KERNEL);
>>>> + if (&ar->fw == fw)
>>>> + *fw = vmalloc(fw_entry->size);
>>>> + else
>>>> + *fw = kmalloc(fw_entry->size, GFP_KERNEL)
>>>
>>> Why vmalloc and kmalloc both are required? can't use either
>>> vmalloc or kmalloc?
>>
>> My original problem was that kmemdup (which uses kmalloc) could not
>> allocate enough memory
>
> If kmemdump ( which uses kmalloc) could not allocate memory then
> using kmalloc again can lead to same problem.
> I guess it will be correct to use
> *fw = vmalloc(fw_entry->size);
> Correct me if i am wrong.
That sounds best. But remember take into account DMA requirements, IIRC
you cannot DMA from vmalloc memory on all platforms.
--
Kalle Valo
next prev parent reply other threads:[~2015-12-22 9:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-01 5:41 [PATCH] ath6kl: Use vmalloc to allocate ar->fw for api1 method Brent Taylor
2015-12-01 5:41 ` Brent Taylor
2015-12-01 13:08 ` Sergei Shtylyov
2015-12-13 0:52 ` Andy Shevchenko
2015-12-21 19:23 ` Souptick Joarder
2015-12-21 21:53 ` Brent Taylor
2015-12-22 9:05 ` Souptick Joarder
2015-12-22 9:12 ` Kalle Valo [this message]
2015-12-29 18:16 ` Souptick Joarder
2015-12-21 22:00 ` Dan Kephart
2015-12-21 22:00 ` Dan Kephart
2015-12-21 22:00 ` Dan Kephart
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=87poxy7spb.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@qca.qualcomm.com \
--cc=ath6kl@lists.infradead.org \
--cc=jrdr.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=motobud@gmail.com \
--cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.