11 Aug, 2010

40 commits

  • After 97e7449a7ad: "autofs4: fix indirect mount pending expire race" we no
    longer assumed that "ino" can be null. The other null checks got removed
    but this was one was missed.

    Signed-off-by: Dan Carpenter
    Cc: Ian Kent
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Carpenter
     
  • Check return value of put_user() and return -EFAULT if it failed.
    Original comment "We did a get user...so assuming mem is ok...is this
    bad?" is incorrect because memory can be read only.

    Signed-off-by: Kulikov Vasiliy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kulikov Vasiliy
     
  • If (len > reslen) we must not call copy_to_user() since kernel buffer is
    smaller than we want to copy. Similar code in this file is correct, so
    this bug was a typo.

    Signed-off-by: Kulikov Vasiliy
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kulikov Vasiliy
     
  • Add a mutex_unlock missing on the error path.

    The semantic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression E1;
    @@

    * mutex_lock(E1,...);

    * mutex_unlock(E1,...);
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • Signed-off-by: Pablo Castillo
    Signed-off-by: Stanislaw Gruszka
    Tested-by: Gregg Lebovitz
    Cc: Maxim Levitsky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pablo Castillo
     
  • P4080 ESDHC controller does not support 1.8V and 3.0V voltage. but the
    host controller capabilities register wrongly set the bits. This patch
    adds the workaround to correct the weird voltage setting bits. Only 3.3V
    voltage is supported for P4080 ESDHC controller.

    Signed-off-by: Roy Zang
    Cc: Jerry Huang
    Cc: Benjamin Herrenschmidt
    Cc: Kumar Gala
    Cc: Grant Likely
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roy Zang
     
  • Signed-off-by: Roy Zang
    Cc: Jerry Huang
    Cc: Benjamin Herrenschmidt
    Cc: Kumar Gala
    Cc: Grant Likely
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roy Zang
     
  • Add auto CMD12 command support for eSDHC driver. This is needed by P4080
    and P1022 for block read/write. Manual asynchronous CMD12 abort operation
    causes protocol violations on these silicons.

    Signed-off-by: Jerry Huang
    Signed-off-by: Roy Zang
    Cc: Benjamin Herrenschmidt
    Cc: Kumar Gala
    Cc: Grant Likely
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jerry Huang
     
  • This patch adds support for regulator API to sdhci core driver.
    Regulators can be used to disable power in suspended state to reduce
    dissipated energy.

    Signed-off-by: Marek Szyprowski
    Signed-off-by: Kyungmin Park
    Acked-by: Mark Brown
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marek Szyprowski
     
  • On some Samsung SoCs not all SDHCI controllers have card detect (CD) line.
    For some embedded designs it is not even needed, because ususally the
    device (like SDIO flash memory or wifi controller) is permanently wired to
    the controller. There are also systems which have a card detect line
    connected to some of the external interrupt lines or the presence of the
    card depends on some other actions (like enabling a power regulator).

    This patch adds support for all these cases. The following card detection
    methods are possible:

    1. internal sdhci host card detect line
    2. external event
    3. external gpio interrupt
    4. no card detect line, controller will poll for the card
    5. no card detect line, card is permanently wired to the controller
    (once detected host won't poll it any more)

    By default, all existing code would use method #1, what is compatible with
    the previous version of the driver.

    In case of external event, two callbacks must be provided in platdata:
    ext_cd_init and ext_cd_cleanup. Both of them get a callback to a function
    that notifies the s3c-sdhci host contoller as their argument. That
    callback function should be called from the even dispatcher to let host
    notice the card insertion/removal.

    In case of external gpio interrupt, a gpio pin number must be provided in
    platdata (ext_cd_gpio parameter), as well as the information about the
    polarity of that gpio pin (ext_cd_gpio_invert). By default
    (ext_cd_gpio_invert == 0) gpio value 0 means 'card has been removed', but
    this can be changed to 'card has been removed' when ext_cd_gpio_invert ==
    1.

    This patch adds all required changes to sdhci-s3c driver.

    Signed-off-by: Marek Szyprowski
    Signed-off-by: Kyungmin Park
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marek Szyprowski
     
  • This patch enables SDHCI_QUIRK_NO_HISPD_BIT on Samsung SDHCI driver. This
    solves detection problems with some external SD cards. This change has
    been tested on S5PC100 and S5PC110. It has no inpact on driver speed.

    Signed-off-by: Kyungmin Park
    Signed-off-by: Marek Szyprowski
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marek Szyprowski
     
  • S3C SDHCI host controller can change the source for generating mmc clock.
    By default host bus clock is used, what causes some problems on machines
    with 133MHz bus, because the SDHCI divider cannot be as high get proper
    clock value for identification mode. This is not a problem for the
    controller, because it can generate lower frequencies from other clock
    sources. This patch changes sdhci driver to use get_min_clock() call if
    it has been provided.

    This fixes the flood of the following warnings on Samsung S5PV210 SoCs:
    mmc0: Minimum clock frequency too high for identification mode

    Signed-off-by: Marek Szyprowski
    Signed-off-by: Kyungmin Park
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marek Szyprowski
     
  • On Samsung's SDMMC hosts the timeout clock is derivied from the SD Clock
    which is set dynamically. So checked SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK
    quirk and removed 'sdhci_s3c_get_timeout_clk' callback which doesn't need
    any more.

    Signed-off-by: Hyuk Lee
    Signed-off-by: Kukjin Kim
    Cc: Ben Dooks
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hyuk Lee
     
  • If other informative interrupts are enabled for the DMA channel used by
    hsmmc, those are incorrectly treated as block completion. This patch lets
    only the block completion interrupt to be processed.

    Signed-off-by: Venkatraman S
    Acked-by: Madhusudhan Chikkature
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Venkatraman S
     
  • CONFIG_MMC_MSM7X00A_RESUME_IN_WQ and CONFIG_MMC_EMBEDDED_SDIO don't exist
    in Kconfig and is never defined anywhere else, therefore removing all
    references for it from the source code.

    Signed-off-by: Christian Dietrich
    Acked-by: David Brown
    Cc: Daniel Walker
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christian Dietrich
     
  • Pandora has TI WL1251 attached on MMC3, which is non-standard SDIO chip.
    Make use MMC_QUIRK_NONSTD_SDIO to tell SDIO core about it.

    Signed-off-by: Grazvydas Ignotas
    Cc: Adrian Hunter
    Cc: Tony Lindgren
    Cc: Bob Copeland
    Cc: Kalle Valo
    Cc: Madhusudhan Chikkature
    Cc: Kishore Kadiyala
    Cc: Russell King
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Grazvydas Ignotas
     
  • This will allow us to set up special cards in machine drivers just after
    they are detected by MMC core.

    Signed-off-by: Grazvydas Ignotas
    Cc: Adrian Hunter
    Cc: Tony Lindgren
    Cc: Bob Copeland
    Cc: Kalle Valo
    Cc: Madhusudhan Chikkature
    Cc: Kishore Kadiyala
    Cc: Russell King
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Grazvydas Ignotas
     
  • There are some chips (like TI WL12xx series) that can be interfaced over
    SDIO but don't support the SDIO specification, meaning that they are
    missing CIA (Common I/O Area) with all it's registers. Current Linux SDIO
    implementation relies on those registers to identify and configure the
    card, so non-standard cards can not function and cause lots of warnings
    from the core when it reads invalid data from non-existent registers.

    After this patch, init_card() host callback can now set new quirk
    MMC_QUIRK_NONSTD_SDIO, which means that SDIO core should not try to access
    any standard SDIO registers and rely on init_card() to fill all SDIO
    structures instead. As those cards are usually embedded chips, all the
    required information can be obtained from machine board files by the host
    driver when it's called through init_card() callback.

    Signed-off-by: Grazvydas Ignotas
    Cc: Adrian Hunter
    Cc: Tony Lindgren
    Cc: Bob Copeland
    Cc: Kalle Valo
    Cc: Madhusudhan Chikkature
    Cc: Kishore Kadiyala
    Cc: Russell King
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Grazvydas Ignotas
     
  • There's nothing special, just SoC-specific ops and quirks.

    Signed-off-by: Anton Vorontsov
    Cc: Ben Dooks
    Cc: Richard R?jfors
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     
  • Due to build system limitations, intermediate and final objects can't have
    the same names. And as we're going to start building SoC-specific
    objects, let's rename the module to sdhci-platform, into which we'll link
    sdhci-pltfm and SoC-specifc objects.

    There should be no issue in renaming as the driver uses modalias
    mechanism.

    This is exactly the same approach as in sdhci-of driver.

    Signed-off-by: Anton Vorontsov
    Cc: Ben Dooks
    Cc: Richard R?jfors
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     
  • Sometimes want to place SoC-specific parts alongside with the generic
    driver, and to do so, we have to switch the driver over to the module
    device table matching.

    Note that drivers/mmc/host/sdhci-pltfm.h is so far empty, but it'll hold
    SoC-specific driver data handlers soon.

    Signed-off-by: Anton Vorontsov
    Cc: Ben Dooks
    Cc: Richard R?jfors
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     
  • This patch improves low speeds for SD cards.

    OMAP-MMC controller's can support maximum bus width of '8'. when bus
    width is mentioned as "8" in controller data,the SD stack will check
    whether bus width is "4" and if not it will set bus width to "1" and there
    by degrading performance. This patch fixes the issue and improves the
    performance of SD cards.

    Signed-off-by: Kishore Kadiyala
    Signed-off-by: Venkatraman S
    Signed-off-by: Nishanth Menon
    Acked-by: Madhusudhan Chikkature
    Tested-by: Jarkko Nikula
    Cc: Adrian Hunter
    Cc: Matt Fleming
    Cc: Tony Lindgren
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kishore Kadiyala
     
  • A non-zero value of SEC_COUNT does not indicate that the card is sector
    addressed. According to the MMC specification, cards with a density
    greater than 2GiB are sector addressed.

    Acked-by: Linus Walleij
    Signed-off-by: Hanumath Prasad
    Signed-off-by: Rabin Vincent
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hanumath Prasad
     
  • Some host controllers can set mmc->caps before sdhci_add_host().

    Signed-off-by: Kyungmin Park
    Cc: Grant Likely
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kyungmin Park
     
  • Some host controllers such as s5pc110 support the WIDE8 feature.

    Signed-off-by: Kyungmin Park
    Cc: Grant Likely
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kyungmin Park
     
  • When using QUIRK_NONSTANDARD_CLOCK, it checks the set_clock() function
    which is not used actually. So delete it.

    Signed-off-by: Kyungmin Park
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kyungmin Park
     
  • The current way of disabling it is not well tested by vendor and has all
    kinds of bugs that show up on resume from ram/disk. A very good example
    is a dead SDHCI controller.

    Old way of disabling is still supported by continuing to use
    CONFIG_MMC_RICOH_MMC.

    Based on 'http://list.drzeus.cx/pipermail/sdhci-devel/2007-December/002085.html'
    Therefore most of the credit for this goes to Andrew de Quincey

    Signed-off-by: Maxim Levitsky
    Cc: Andrew de Quincey
    Acked-by: Philip Langdale
    Cc: "Rafael J. Wysocki"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Maxim Levitsky
     
  • If you don't use CONFIG_MMC_UNSAFE_RESUME, as soon as you attempt to
    suspend, the card will be removed, therefore this patch doesn't change the
    behavior of this option.

    However the removal will be done by pm notifier, which runs while
    userspace is still not frozen and thus can freely use del_gendisk, without
    the risk of deadlock which would happen otherwise.

    Card detect workqueue is now disabled while userspace is frozen, Therefore
    if you do use CONFIG_MMC_UNSAFE_RESUME, and remove the card during
    suspend, the removal will be detected as soon as userspace is unfrozen,
    again at the moment it is safe to call del_gendisk.

    Tested with and without CONFIG_MMC_UNSAFE_RESUME with suspend and hibernate.

    [akpm@linux-foundation.org: clean up function prototype]
    [akpm@linux-foundation.org: fix CONFIG_PM-n linkage, small cleanups]
    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Maxim Levitsky
    Cc: David Brownell
    Cc: Alan Stern
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Maxim Levitsky
     
  • Signed-off-by: Michal Miroslaw
    Cc: Adrian Hunter
    Cc: Chris Ball
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Miroslaw
     
  • This series adds support for SD combo cards to MMC/SD driver stack.

    SD combo consists of SD memory and SDIO parts in one package. Since the
    parts have a separate SD command sets, after initialization, they can be
    treated as independent cards on one bus.

    Changes are divided into two patches. First is just moving initialization
    code around so that SD memory part init can be called from SDIO init.
    Second patch is a proper change enabling SD memory along SDIO. I tried to
    move as much no-op changes to the first patch so that it's easier to
    follow the required changes to initialization flow for SDIO cards.

    This is based on Simplified SDIO spec v.2.00. The init sequence is
    slightly modified to follow current SD memory init implementation.
    Command sequences, assuming SD memory and SDIO indeed ignore unknown
    commands, are the same as before for both parts.

    This patch:

    Prepare for SD-combo (IO+mem) support by splitting SD memory
    card init and related functions.

    Signed-off-by: Michal Miroslaw
    Cc: Adrian Hunter
    Cc: Chris Ball
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Miroslaw
     
  • The eMMC spec 4.4 and 4.3 + additional feature chips has CSD structure
    version 3 and version 3 have to check the CSD_STRUCTURE byte in the
    EXT_CSD register.

    Also fix EXT_CSD revision message.

    [akpm@linux-foundation.org: fix comment, per Chris Ball]
    Signed-off-by: Kyungmin Park
    Cc: Adrian Hunter
    Cc: Chris Ball
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kyungmin Park
     
  • Use kmalloc() to allocate fdmem if possible.

    vmalloc() is used as a fallback solution for fdmem allocation. A new
    helper function __free_fdtable() is introduced to reduce the lines of
    code.

    A potential bug, vfree() a memory allocated by kmalloc(), is fixed.

    [akpm@linux-foundation.org: use __GFP_NOWARN, uninline alloc_fdmem() and free_fdmem()]
    Signed-off-by: Changli Gao
    Cc: Alexander Viro
    Cc: Jiri Slaby
    Cc: "Paul E. McKenney"
    Cc: Alexey Dobriyan
    Cc: Ingo Molnar
    Cc: Peter Zijlstra
    Cc: Avi Kivity
    Cc: Tetsuo Handa
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Changli Gao
     
  • Signed-off-by: Dmitry Torokhov
    Acked-by: Arnd Bergmann
    Acked-by: John Kacur
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dmitry Torokhov
     
  • The O_* bit numbers are defined in 20+ arch/*, and can silently overlap.
    Add a compile time check to ensure the uniqueness as suggested by David
    Miller.

    Signed-off-by: Wu Fengguang
    Cc: David Miller
    Cc: Stephen Rothwell
    Cc: Al Viro
    Cc: Christoph Hellwig
    Cc: Eric Paris
    Cc: Roland Dreier
    Cc: Jamie Lokier
    Cc: Andreas Schwab
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wu Fengguang
     
  • Improve the description of fget_light(), which is currently incorrect
    about needing a prior refcnt (judging by the way it is actually used).

    Signed-off-by: Tony Battersby
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tony Battersby
     
  • Add to so that types are explicitly
    defined:
    linux/virtio_9p.h:15: found __[us]{8,16,32,64} type without #include

    Signed-off-by: Randy Dunlap
    Cc: Eric Van Hensbergen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Signed-off-by: Andy Shevchenko
    Cc: Adaptec OEM Raid Solutions
    Cc: "James E.J. Bottomley"
    Cc: James Smart
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     
  • Use memdup_user when user data is immediately copied into the
    allocated region.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    position p;
    identifier l1,l2;
    @@

    - to = \(kmalloc@p\|kzalloc@p\)(size,flag);
    + to = memdup_user(from,size);
    if (
    - to==NULL
    + IS_ERR(to)
    || ...) {

    }
    - if (copy_from_user(to, from, size) != 0) {
    -
    - }
    //

    Signed-off-by: Julia Lawall
    Cc: Doug Gilbert
    Cc: Boaz Harrosh
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Julia Lawall
     
  • A couple of scsi drivers define a BIT() macro, duplicating the one in
    bitops.h.

    Cc: Jing Huang
    Cc: Robert Love
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • bnx2i should depend on NET since it selects SCSI_ISCSI_ATTRS, which
    depends on NET.

    Also move the dependencies together.

    The "depends" change fixes multiple build errors when CONFIG_NET is
    not enabled:
    ERROR: "skb_trim" [drivers/scsi/scsi_transport_iscsi.ko] undefined!
    ERROR: "netlink_kernel_create" [drivers/scsi/scsi_transport_iscsi.ko] undefined!
    ERROR: "netlink_kernel_release" [drivers/scsi/scsi_transport_iscsi.ko] undefined!
    ERROR: "skb_pull" [drivers/scsi/scsi_transport_iscsi.ko] undefined!
    ERROR: "init_net" [drivers/scsi/scsi_transport_iscsi.ko] undefined!
    ERROR: "__alloc_skb" [drivers/scsi/scsi_transport_iscsi.ko] undefined!
    ERROR: "netlink_broadcast" [drivers/scsi/scsi_transport_iscsi.ko] undefined!
    ERROR: "kfree_skb" [drivers/scsi/scsi_transport_iscsi.ko] undefined!
    ERROR: "skb_put" [drivers/scsi/scsi_transport_iscsi.ko] undefined!

    Signed-off-by: Randy Dunlap
    Cc: Anil Veerabhadrappa
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap