public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: merez@codeaurora.org
Cc: Jaehoon Chung <jh80.chung@samsung.com>,
	Minchan Kim <minchan@kernel.org>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Konstantin Dorfman <kdorfman@codeaurora.org>,
	Ulf Hansson <ulf.hansson@stericsson.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Per FORLIN <per.forlin@stericsson.com>,
	"svenkatr@ti.com" <svenkatr@ti.com>,
	Saugata Das <saugata.das@linaro.org>,
	Hanumath Prasad <hanumath.prasad@stericsson.com>,
	Sebastian Rasmussen <sebras@gmail.com>,
	"Dong, Chuanxiao" <chuanxiao.dong@intel.com>
Subject: Re: [PATCH v11] mmc: support BKOPS feature for eMMC
Date: Mon, 27 Aug 2012 18:21:44 -0400	[thread overview]
Message-ID: <87ehmsyo07.fsf@octavius.laptop.org> (raw)
In-Reply-To: <5d379475a64b20988a535fa01213d62a.squirrel@www.codeaurora.org> (merez@codeaurora.org's message of "Tue, 31 Jul 2012 07:01:18 -0700 (PDT)")

Hi,

On Tue, Jul 31 2012, merez@codeaurora.org wrote:
>>> 512 byte stack? Isn't it really a problem?
>> How about this?
>>
>> +int mmc_read_bkops_status(struct mmc_card *card)
>> +{
>> +	int err;
>> +	u8 *ext_csd;
>> +
>> +	ext_csd = kmalloc(512, GFP_KERNEL);
>> +	if (!ext_csd) {
>> +		pr_err("%s: could not allocate a buffer to "
>> +			"receive the ext_csd.\n", mmc_hostname(card->host));
>> +		return -ENOMEM;
>> +	}
>> +
>> +	mmc_claim_host(card->host);
>> +	err = mmc_send_ext_csd(card, ext_csd);
>> +	mmc_release_host(card->host);
>> +	if (err)
>> +		goto out;
>> +
>> +	card->ext_csd.raw_bkops_status = ext_csd[EXT_CSD_BKOPS_STATUS];
>> +	card->ext_csd.raw_exception_status = ext_csd[EXT_CSD_EXP_EVENTS_STATUS];
>> +out:
>> +	kfree(ext_csd);
>> +	return err;
>> +}
>> +EXPORT_SYMBOL(mmc_read_bkops_status);
>
> I'm not sure it would be a good idea to allocate the buffer every time the
> ext_csd is read since with the periodic BKOPs we might do it more often to
> see if there is a need for BKOPs.
> How about keeping the buffer in the card structure?

It's a little large for that, but it would be worth it if we really do
use it regularly.  Perhaps go with the kmalloc option for now, add a
comment explaining that we should consider storing the entire ext_csd
in mmc_card later, and revisit it when the periodic bkops support is
submitted and we know how often we need to read the status?

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

  parent reply	other threads:[~2012-08-27 22:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-24  1:56 [PATCH v11] mmc: support BKOPS feature for eMMC Jaehoon Chung
2012-07-24 13:39 ` S, Venkatraman
2012-07-29  2:33 ` Minchan Kim
2012-07-30  9:00   ` Jaehoon Chung
2012-07-31 14:01     ` merez
2012-08-03  2:26       ` Jaehoon Chung
2012-08-27 22:21       ` Chris Ball [this message]
2012-09-15  3:40         ` Chris Ball
2012-09-15  4:01           ` Jaehoon Chung
  -- strict thread matches above, loose matches on Subject: below --
2012-07-24 17:53 merez

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=87ehmsyo07.fsf@octavius.laptop.org \
    --to=cjb@laptop.org \
    --cc=adrian.hunter@intel.com \
    --cc=chuanxiao.dong@intel.com \
    --cc=hanumath.prasad@stericsson.com \
    --cc=jh80.chung@samsung.com \
    --cc=kdorfman@codeaurora.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=merez@codeaurora.org \
    --cc=minchan@kernel.org \
    --cc=per.forlin@stericsson.com \
    --cc=saugata.das@linaro.org \
    --cc=sebras@gmail.com \
    --cc=svenkatr@ti.com \
    --cc=ulf.hansson@stericsson.com \
    /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