login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
April
»
28
Re: [PATCH 1/2] MMC: Add support MMCIF for SuperH
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From: Yusuke Goda
Subject:
Re: [PATCH 1/2] MMC: Add support MMCIF for SuperH
Date: Tuesday, April 27, 2010 - 9:54 pm
Hi Andrew Thanks so much for your help. Andrew Morton wrote:
quoted text
> On Tue, 27 Apr 2010 19:15:02 +0900 > Yusuke Goda <yusuke.goda.sx@renesas.com> wrote: > >> MMCIF is MMC Host Interface in SuperH. >> >> ... >> >> +static void sh_mmcif_clock_control(struct sh_mmcif_host *host, unsigned int clk) >> +{ >> + int i; >> + struct sh_mmcif_plat_data *p = host->pd->dev.platform_data; >> + >> + sh_mmcif_bitclr(host, MMCIF_CE_CLK_CTRL, CLK_ENABLE); >> + sh_mmcif_bitclr(host, MMCIF_CE_CLK_CTRL, CLK_CLEAR); >> + >> + if (!clk) >> + return; >> + if (p->sup_pclk && clk == host->clk) { >> + sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_SUP_PCLK); >> + } else { >> + for (i = 1; (unsigned int)host->clk / (1 << i) >= clk; i++) >> + ; > > I suspect this could be clarified. Perhaps > > i = ilog2(__roundup_pow_of_two(host->clk)); > > If that's wrong then include/linux/log2.h has various tools which can > surely be used. If they're not appropriate then please feel free to > propose additions.
OK. I correct it.
quoted text
> >> + sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, (i - 1) << 16); >> + } >> + sh_mmcif_bitset(host, MMCIF_CE_CLK_CTRL, CLK_ENABLE); >> +} >> + >> >> ... >> >> +static int sh_mmcif_error_manage(struct sh_mmcif_host *host) >> +{ >> + u32 state1, state2; >> + int ret, timeout = 10000000; >> + >> + host->sd_error = 0; >> + host->wait_int = 0; >> + >> + state1 = sh_mmcif_readl(host, MMCIF_CE_HOST_STS1); >> + state2 = sh_mmcif_readl(host, MMCIF_CE_HOST_STS2); >> + pr_debug("%s: ERR HOST_STS1 = %08x\n", \ >> + DRIVER_NAME, sh_mmcif_readl(host, MMCIF_CE_HOST_STS1)); >> + pr_debug("%s: ERR HOST_STS2 = %08x\n", \ >> + DRIVER_NAME, sh_mmcif_readl(host, MMCIF_CE_HOST_STS2)); >> + >> + if (state1 & STS1_CMDSEQ) { >> + pr_debug("%s: Forced end of command sequence\n", DRIVER_NAME); >> + sh_mmcif_bitset(host, MMCIF_CE_CMD_CTRL, CMD_CTRL_BREAK); >> + sh_mmcif_bitset(host, MMCIF_CE_CMD_CTRL, ~CMD_CTRL_BREAK); >> + while (1) { >> + timeout--; >> + if (timeout < 0) { >> + pr_err(DRIVER_NAME": Forceed end of " \ >> + "command sequence timeout err\n"); >> + return -EILSEQ; >> + } >> + if (!(sh_mmcif_readl(host, MMCIF_CE_HOST_STS1) >> + & STS1_CMDSEQ)) >> + break; >> + mdelay(1); >> + } >> + sh_mmcif_sync_reset(host); >> + return -EILSEQ; > > Good heavens, what is EILSEQ? > > <googles a bit> > > "An illegal multibyte sequence was found in the input. This > usually means that you have the wrong charactor encoding, for > instance the MicrosoftCorporation version of latin-1 (aka > iso_8859_1(7)) (which has it's own stuff like "smart quotes" in > the reserved bytes) instead of the real latin (or perhaps > utf8(7))." > > Why on earth are driver writers using this in the kernel??? Imagine > the confusion which ensues when this error code propagates all the way > back to some poor user's console. They'll be scrabbling around with > language encodings not even suspecting that their hardware is busted. > > People do this *a lot*. They go grubbing through errno.h and grab > something which looks vaguely appropriate. But it's wrong. > > If your hardware is busted then return -EIO and emit a printk to tell > the operator what broke. > >> + } >> + >> + if (state2 & STS2_CRC_ERR) >> + ret = -EILSEQ; >> + else if (state2 & STS2_TIMEOUT_ERR) >> + ret = -ETIMEDOUT; >> + else >> + ret = -EILSEQ; >> + return ret; >> +}
Thank you. I think that EIO is appropriate. I revise it and send a patch. Thanks, Goda --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[PATCH 1/2] MMC: Add support MMCIF for SuperH
, Yusuke Goda
, (Tue Apr 27, 3:15 am)
Re: [PATCH 1/2] MMC: Add support MMCIF for SuperH
, Andrew Morton
, (Tue Apr 27, 3:02 pm)
Re: [PATCH 1/2] MMC: Add support MMCIF for SuperH
, Yusuke Goda
, (Tue Apr 27, 9:54 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Paul Turner
[tg_shares_up rewrite v4 11/11] sched: update tg->shares after cpu.shares write
Matthew Garrett
Re: [PATCH] Enable speedstep for sonoma processors.
Mauro Carvalho Chehab
Re: [PATCH 1/2] media: Add timberdale video-in driver
Peter Zijlstra
[PATCH 23/30] netvm: skb processing
Greg Kroah-Hartman
[PATCH 21/28] cgroupfs: create /sys/fs/cgroup to mount cgroupfs on
git
:
Jan Hudec
Re: GIT push to sftp (feature request)
Steffen Prohaska
[PATCH 0/4] core.ignorecase
Johannes Schindelin
Re: Git checkout preserve timestamp?
Linus Torvalds
[PATCH 1/7] Make unpack_trees_options bit flags actual bitfields
Johan Herland
Re: What's cooking in git.git (Oct 2010, #01; Wed, 13)
linux-netdev
:
David Miller
Re: [PATCH 1/3] f_phonet: dev_kfree_skb instead of dev_kfree_skb_any in TX callback
Richard Cochran
Re: [PATCH v3 3/3] ptp: Added a clock that uses the eTSEC found on the MPC85xx.
Jan Engelhardt
Re: [PATCH] Fix netfilter xt_time's time_mt()'s use of do_div()
Herbert Xu
Re: [RFC PATCH 00/17] virtual-bus
Jeff Kirsher
Re: [net-next-2.6 PATCH] e1000e: don't inadvertently re-set INTX_DISABLE
git-commits-head
:
Linux Kernel Mailing List
ALSA: hda - Enable beep on Realtek codecs with PCI SSID override
Linux Kernel Mailing List
Use path_put() in a few places instead of {mnt,d}put()
Linux Kernel Mailing List
mv643xx_eth: use sw csum for big packets
Linux Kernel Mailing List
arm: fix HAVE_CLK merge goof
Linux Kernel Mailing List
arm: convert pcm037 platform to use smsc911x
freebsd-current
:
David Wolfskill
"interrupt storm..."; seems associated with an0 NIC
Andriy Gapon
Re: letting glabel recognise a media change
Garrett Cooper
Re: Only display ACPI bootmenu key if ACPI is present
Pyun YongHyeon
CFT: msk(4) Rx checksum offloading support
FreeBSD Tinderbox
[head tinderbox] failure on sparc64/sparc64
Colocation donated by:
Syndicate