18 Jul, 2016

1 commit

  • As reported by Dan in his report in [1], there is a potential NULL
    pointer derefence if these conditions are met :
    - there is no platform_data provided, ie. host->pdata = NULL

    Fix this by only using the platform data ro_invert when a gpio for
    read-only is provided by the platform data.

    This doesn't appear yet as every pxa board provides a platform_data, and
    calls pxa_set_mci_info() with a non NULL pointer.

    [1] [bug report] mmc: pxamci: fix card detect with slot-gpio API.
    The commit fd546ee6a7dc ("mmc: pxamci: fix card detect with slot-gpio
    API") from Sep 26, 2015, leads to the following static checker warning:

    drivers/mmc/host/pxamci.c:809 pxamci_probe()
    warn: variable dereferenced before check 'host->pdata' (see line 798)

    Fixes: fd546ee6a7dc ("mmc: pxamci: fix card detect with slot-gpio API")
    Reported-by: Dan Carpenter
    Signed-off-by: Robert Jarzmik
    Signed-off-by: Ulf Hansson

    Robert Jarzmik
     

29 Feb, 2016

1 commit


08 Feb, 2016

1 commit

  • When the gpio driver is probed after the mmc one, the read/write gpio
    and card detection one return -EPROBE_DEFER. Unfortunately, the memory
    region remains requested, and upon the next probe, the probe will fail
    anyway with -EBUSY.

    Fix this by releasing the memory resource upon probe failure.

    More broadly, this patch uses devm_*() primitives whenever possible in
    the probe function.

    Signed-off-by: Robert Jarzmik
    Signed-off-by: Ulf Hansson

    Robert Jarzmik
     

02 Feb, 2016

1 commit

  • The commit fixing the conversion of pxamci to slot-gpio API fixed the
    inverted the logic of the read-only gpio. Unfortunately, the commit was
    tested on a non-inverted gpio, and not on the inverted one. And the fix
    did work partially, by luck.

    This is the remaining missing part of the fix, trivial but still necessary.

    Fixes: Fixes: 26d49fe71953 ("mmc: pxamci: fix read-only gpio detection polarity")
    Reported-by: Andrea Adami
    Tested-by: Andrea Adami
    Signed-off-by: Robert Jarzmik
    Cc: stable@vger.kernel.org
    Signed-off-by: Ulf Hansson

    Robert Jarzmik
     

09 Nov, 2015

1 commit


29 Sep, 2015

1 commit

  • Move pxamci to mmc slot-gpio API to fix interrupt request.

    It fixes the case where the card detection is on a gpio expander, on I2C
    for example on zylonite board. In this case, the card detect netsted
    interrupt is called from a threaded interrupt. The request_irq() fails,
    because a hard irq cannot be a nested interrupt from a threaded
    interrupt (set __setup_irq()).

    This was tested on zylonite and mioa701 boards.

    Signed-off-by: Robert Jarzmik
    Cc: Petr Cvek
    Signed-off-by: Ulf Hansson

    Robert Jarzmik
     

17 Aug, 2015

1 commit

  • Switch over pxamci to dmaengine. This prepares the devicetree full
    support of pxamci.

    This was successfully tested on a PXA3xx board, as well as PXA27x.

    Signed-off-by: Daniel Mack
    [adapted to pxa-dma]
    Signed-off-by: Robert Jarzmik
    Signed-off-by: Ulf Hansson

    Daniel Mack
     

09 Sep, 2014

2 commits


31 Oct, 2013

1 commit

  • Suspend and resume of cards are handled by the protocol layer and
    consequently the mmc_suspend|resume_host APIs are marked as deprecated.

    While moving away from using the deprecated APIs, there are nothing
    left to be done for the suspend and resume callbacks, so remove them.

    Signed-off-by: Ulf Hansson
    Signed-off-by: Chris Ball

    Ulf Hansson
     

31 Jul, 2013

1 commit


24 Jul, 2013

1 commit

  • The em_x270_mci_setpower() and em_x270_usb_hub_init() functions
    call regulator_enable(), which may return an error that must
    be checked.

    This changes the em_x270_usb_hub_init() function to bail out
    if it fails, and changes the pxamci_platform_data->setpower
    callback so that the a failed em_x270_mci_setpower call
    can be propagated by the pxamci driver into the mmc core.

    Signed-off-by: Arnd Bergmann
    Cc: Mike Rapoport
    Cc: Paul Gortmaker
    Cc: Mark Brown
    Cc: Haojian Zhuang
    Acked-by: Chris Ball
    [olof: fixed order of regulator_enable() and test in em_x270_usb_hub_init]
    Signed-off-by: Olof Johansson

    Arnd Bergmann
     

27 May, 2013

1 commit

  • The driver core clears the driver data to NULL after device_release
    or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
    (device-core: Ensure drvdata = NULL when no driver is bound).
    Thus, it is not needed to manually clear the device driver data to NULL.

    Signed-off-by: Jingoo Han
    Acked-by: Sonic Zhang
    Acked-by: Seungwon Jeon
    Acked-by: Shawn Guo
    Acked-by: Adrian Hunter
    Acked-by: Haojian Zhuang
    Acked-by: Jaehoon Chung
    Acked-by: Viresh Kumar
    Acked-by: Tony Prisk
    Signed-off-by: Chris Ball

    Jingoo Han
     

29 Nov, 2012

1 commit

  • CONFIG_HOTPLUG is going away as an option so __devinit is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: Chris Ball
    Cc: Manuel Lauss
    Cc: "Michał Mirosław"
    Cc: Jarkko Lavinen
    Cc: Venkatraman S
    Cc: Ian Molton
    Cc: Bruce Chang
    Cc: Harald Welte
    Cc: Pierre Ossman
    Acked-by: Ludovic Desroches
    Acked-by: Viresh Kumar
    Acked-by: Guennadi Liakhovetski
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     

10 Oct, 2012

1 commit

  • Pull MMC updates from Chris Ball:
    "Core:
    - Add DT properties for card detection (broken-cd, cd-gpios,
    non-removable)
    - Don't poll non-removable devices
    - Fixup/rework eMMC sleep mode/"power off notify" feature
    - Support eMMC background operations (BKOPS). To set the one-time
    programmable fuse that enables bkops on an eMMC that doesn't
    already have it set, you can use the "mmc bkops enable" command in:

    git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git

    Drivers:
    - atmel-mci, dw_mmc, pxa-mci, dove, s3c, spear: Add device tree
    support
    - bfin_sdh: Add support for the controller in bf60x
    - dw_mmc: Support Samsung Exynos SoCs
    - eSDHC: Add ADMA support
    - sdhci: Support testing a cd-gpio (from slot-gpio) instead of
    presence bit
    - sdhci-pltfm: Support broken-cd DT property
    - tegra: Convert to only supporting DT (mach-tegra has gone DT-only)"

    * tag 'mmc-merge-for-3.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (67 commits)
    mmc: core: Fixup broken suspend and eMMC4.5 power off notify
    mmc: sdhci-spear: Add clk_{un}prepare() support
    mmc: sdhci-spear: add device tree bindings
    mmc: sdhci-s3c: Add clk_(enable/disable) in runtime suspend/resume
    mmc: core: Replace MMC_CAP2_BROKEN_VOLTAGE with test for fixed regulator
    mmc: sdhci-pxav3: Use sdhci_get_of_property for parsing DT quirks
    mmc: dt: Support "broken-cd" property in sdhci-pltfm
    mmc: sdhci-s3c: fix the wrong number of max bus clocks
    mmc: sh-mmcif: avoid oops on spurious interrupts
    mmc: sh-mmcif: properly handle MMC_WRITE_MULTIPLE_BLOCK completion IRQ
    mmc: sdhci-s3c: Fix crash on module insertion for second time
    mmc: sdhci-s3c: Enable only required bus clock
    mmc: Revert "mmc: dw_mmc: Add check for IDMAC configuration"
    mmc: mxcmmc: fix bug that may block a data transfer forever
    mmc: omap_hsmmc: Pass on the suspend failure to the PM core
    mmc: atmel-mci: AP700x PDC is not connected to MCI
    mmc: atmel-mci: DMA can be used with other controllers
    mmc: mmci: use clk_prepare_enable and clk_disable_unprepare
    mmc: sdhci-s3c: Add device tree support
    mmc: dw_mmc: add support for exynos specific implementation of dw-mshc
    ...

    Linus Torvalds
     

14 Sep, 2012

1 commit

  • Platform data for device drivers should be defined in
    include/linux/platform_data/*.h, not in the architecture
    and platform specific directories.

    This moves such data out of the pxa include directories

    Signed-off-by: Arnd Bergmann
    Acked-by: Mark Brown
    Acked-by: Greg Kroah-Hartman
    Acked-by: Nicolas Pitre
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Igor Grinberg
    Acked-by: Jeff Garzik
    Acked-by: Marek Vasut
    Acked-by: Robert Jarzmik
    Acked-by: Paul Parsons
    Acked-by: Vinod Koul
    Acked-By: Stefan Schmidt
    Cc: Eric Miao
    Cc: Haojian Zhuang
    Cc: Daniel Ribeiro
    Cc: Harald Welte
    Cc: Philipp Zabel
    Cc: Tomas Cech
    Cc: Sergey Lapin
    Cc: Jonathan Cameron
    Cc: Dan Williams
    Cc: Dmitry Torokhov
    Cc: Chris Ball
    Cc: David Woodhouse
    Cc: Samuel Ortiz
    Cc: Alan Stern
    Cc: Florian Tobias Schandinat
    Cc: Liam Girdwood
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Cc: Guennadi Liakhovetski
    Cc: Artem Bityutskiy
    Cc: openezx-devel@lists.openezx.org

    Arnd Bergmann
     

05 Sep, 2012

1 commit


12 Jan, 2012

1 commit

  • This patch converts the drivers in drivers/mmc/host/* to use the
    module_platform_driver() macro which makes the code smaller and a bit
    simpler.

    Signed-off-by: Axel Lin
    Acked-by: "Michał Mirosław"
    Acked-by: David Brown
    Acked-by: Viresh Kumar
    Acked-by: Guennadi Liakhovetski
    Acked-by: Sascha Hauer
    Acked-by: Wolfram Sang
    Acked-by: Anton Vorontsov
    Signed-off-by: Chris Ball

    Axel Lin
     

27 Oct, 2011

1 commit


23 Oct, 2010

2 commits

  • After discovering a problem in regulator reference counting I took Mark
    Brown's advice to move the reference count into the MMC core by making the
    regulator status a member of struct mmc_host.

    I took this opportunity to also implement NULL versions of
    the regulator functions so as to rid the driver code from
    some ugly #ifdef CONFIG_REGULATOR clauses.

    Signed-off-by: Linus Walleij
    Reviewed-by: Mark Brown
    Cc: Liam Girdwood
    Cc: Tony Lindgren
    Cc: Adrian Hunter
    Cc: Robert Jarzmik
    Cc: Sundar Iyer
    Cc: Daniel Mack
    Cc: Pierre Ossman
    Cc: Matt Fleming
    Cc: David Brownell
    Cc: Russell King
    Cc: Eric Miao
    Cc: Cliff Brake
    Cc: Jarkko Lavinen
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Chris Ball

    Linus Walleij
     
  • We have deprecated the distinction between hardware and physical
    segments in the block layer. Consolidate the two limits into one in
    drivers/mmc/.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: Chris Ball

    Martin K. Petersen
     

28 May, 2010

1 commit

  • Even though many mmc host drivers pass a pm_message_t argument to
    mmc_suspend_host() that argument isn't used the by MMC core. As host
    drivers are converted to dev_pm_ops they'll have to construct
    pm_message_t's (as they won't be passed by the PM subsystem any more) just
    to appease the mmc suspend interface.

    We might as well just delete the unused paramter.

    Signed-off-by: Matt Fleming
    Acked-by: Anton Vorontsov
    Acked-by: Michal Miroslaw ZZ
    Acked-by: Sascha Sommer
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matt Fleming
     

11 May, 2010

1 commit

  • delay_detect in HZ is confusing, convert it to be millisecond based. And
    thus remove those unnecessary call to msecs_to_jiffies() at runtime for
    this field. Other constants are converted assuming HZ == 100, which are
    basically true for those platforms.

    The assignment in csb726.c was incorrect, and is fixed in this patch as
    a result.

    Signed-off-by: Eric Miao
    Acked-by: Robert Jarzmik
    Acked-by: Marc Zyngier
    Acked-by: Marek Vasut
    Acked-by: Mike Rapoport
    Acked-by: Daniel Mack

    Eric Miao
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

16 Dec, 2009

1 commit


07 Dec, 2009

1 commit


02 Dec, 2009

1 commit

  • mmc_remove_host() will cause the mmc core to switch off the bus power by
    eventually calling pxamci_set_ios(). This function uses the regulator or
    the GPIO which have been freed already.

    This causes the following Oops on module unload.

    [ 49.519649] Unable to handle kernel paging request at virtual address 30303a70
    [ 49.526878] pgd = c7084000
    [ 49.529563] [30303a70] *pgd=00000000
    [ 49.533136] Internal error: Oops: 5 [#1]
    [ 49.537025] last sysfs file: /sys/devices/platform/pxa27x-ohci/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/scsi_level
    [ 49.547471] Modules linked in: pxamci(-) eeti_ts
    [ 49.552061] CPU: 0 Not tainted (2.6.32-rc8 #322)
    [ 49.557001] PC is at regulator_is_enabled+0x3c/0xbc
    [ 49.561846] LR is at regulator_is_enabled+0x30/0xbc
    [ 49.566691] pc : [] lr : [] psr: 60000013
    [ 49.566702] sp : c7083e70 ip : 30303a30 fp : 00000000
    [ 49.578093] r10: c705e200 r9 : c7082000 r8 : c705e2e0
    [ 49.583280] r7 : c7061340 r6 : c7061340 r5 : c7083e70 r4 : 00000000
    [ 49.589759] r3 : c04dc434 r2 : c04dc434 r1 : c03eecea r0 : 00000047
    [ 49.596241] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
    [ 49.603329] Control: 0000397f Table: a7084018 DAC: 00000015
    [ 49.609031] Process rmmod (pid: 1101, stack limit = 0xc7082278)
    [ 49.614908] Stack: (0xc7083e70 to 0xc7084000)
    [ 49.619238] 3e60: c7082000 c703c4f8 c705ea00 c04f4074
    [ 49.627366] 3e80: 00000000 c705e3a0 ffffffff c0247ddc c70361a0 00000000 c705e3a0 ffffffff
    [ 49.635499] 3ea0: c705e200 bf006400 c78c4f00 c705e200 c705e3a0 ffffffff c705e200 ffffffff
    [ 49.643633] 3ec0: c04d8ac8 c02476d0 ffffffff c0247c60 c705e200 c0248678 c705e200 c0249064
    [ 49.651765] 3ee0: ffffffff bf006204 c04d8ad0 c04d8ad0 c04d8ac8 bf007490 00000880 c00440c4
    [ 49.659898] 3f00: 0000b748 c01c5708 bf007490 c01c44c8 c04d8ac8 c04d8afc bf007490 c01c4570
    [ 49.668031] 3f20: bf007490 bf00750c c04f4258 c01c37a4 00000000 bf00750c c7083f44 c007b014
    [ 49.676162] 3f40: 4000d000 6d617870 08006963 00000001 00000000 c7085000 00000001 00000000
    [ 49.684287] 3f60: 4000d000 c7083f8c 00000001 bea01a54 00005401 c7ab1400 c00440c4 00082000
    [ 49.692420] 3f80: bf00750c 00000880 c7083f8c 00000000 4000cfa8 00000000 00000880 bea01cc8
    [ 49.700552] 3fa0: 00000081 c0043f40 00000000 00000880 bea01cc8 00000880 00000006 00000000
    [ 49.708677] 3fc0: 00000000 00000880 bea01cc8 00000081 00000097 0000cca4 0000b748 00000000
    [ 49.716802] 3fe0: 4001a4f0 bea01cc0 00018bf4 4001a4fc 20000010 bea01cc8 a063e021 a063e421
    [ 49.724958] [] (regulator_is_enabled+0x3c/0xbc) from [] (mmc_regulator_set_ocr+0x14/0xd8)
    [ 49.734836] [] (mmc_regulator_set_ocr+0x14/0xd8) from [] (pxamci_set_ios+0xd8/0x17c [pxamci])
    [ 49.745044] [] (pxamci_set_ios+0xd8/0x17c [pxamci]) from [] (mmc_power_off+0x50/0x58)
    [ 49.754555] [] (mmc_power_off+0x50/0x58) from [] (mmc_detach_bus+0x68/0xc4)
    [ 49.763207] [] (mmc_detach_bus+0x68/0xc4) from [] (mmc_stop_host+0xd4/0x1bc)
    [ 49.771944] [] (mmc_stop_host+0xd4/0x1bc) from [] (mmc_remove_host+0xc/0x20)
    [ 49.780681] [] (mmc_remove_host+0xc/0x20) from [] (pxamci_remove+0xc8/0x174 [pxamci])
    [ 49.790211] [] (pxamci_remove+0xc8/0x174 [pxamci]) from [] (platform_drv_remove+0x1c/0x24)
    [ 49.800164] [] (platform_drv_remove+0x1c/0x24) from [] (__device_release_driver+0x7c/0xc4)
    [ 49.810110] [] (__device_release_driver+0x7c/0xc4) from [] (driver_detach+0x60/0x8c)
    [ 49.819535] [] (driver_detach+0x60/0x8c) from [] (bus_remove_driver+0x90/0xcc)
    [ 49.828452] [] (bus_remove_driver+0x90/0xcc) from [] (sys_delete_module+0x1d8/0x254)
    [ 49.837891] [] (sys_delete_module+0x1d8/0x254) from [] (ret_fast_syscall+0x0/0x28)
    [ 49.847145] Code: eb06c53a e596c030 e1a0500d e59f106c (e59c0040)
    [ 49.853566] ---[ end trace b5fa66a00cea142f ]---

    Signed-off-by: Daniel Mack
    Reported-by: Sven Neumann
    Cc: Pierre Ossman
    Cc: linux-mmc@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: stable@kernel.org
    Signed-off-by: Eric Miao

    Daniel Mack
     

01 Dec, 2009

1 commit


12 Oct, 2009

1 commit


10 Sep, 2009

2 commits


03 Jul, 2009

1 commit


14 Jun, 2009

1 commit

  • Changes pxamci.c to use the regulator subsystem. Uses the regulator case
    CONFIG_REGULATOR is defined and a matching is regulator is provided, or
    falls back to pdata->setpower otherwise. A warning is displayed case
    both a valid regulator and pdata is set, and the regulator is used.

    Signed-off-by: Daniel Ribeiro
    Acked-by: Eric Miao
    Signed-off-by: Pierre Ossman

    Daniel Ribeiro
     

09 Mar, 2009

1 commit

  • 1. Driver code where pxa_request_dma() is called will most likely
    reference DMA registers as well, and it is really unnecessary
    to include pxa-regs.h just for this. Move the definitions into
    and make relevant drivers include it instead of
    .

    2. Introduce DMAC_REGS_VIRT as the virtual address base for these
    DMA registers. This allows later processors to re-use the same
    IP while registers may start at different I/O address.

    Signed-off-by: Eric Miao

    Eric Miao
     

03 Feb, 2009

2 commits


01 Jan, 2009

1 commit


30 Nov, 2008

1 commit

  • When ISA_DMA_API is unset, we're not implementing the ISA DMA API,
    so there's no point in publishing the prototypes via asm/dma.h, nor
    including the machine dependent parts of that API.

    This allows us to remove a lot of mach/dma.h files which don't contain
    any useful code. Unfortunately though, some platforms put their own
    private non-ISA definitions into mach/dma.h, so we leave these behind
    and fix the appropriate #include statments.

    Signed-off-by: Russell King

    Russell King
     

29 Nov, 2008

1 commit


27 Nov, 2008

1 commit