14 Oct, 2015

1 commit


20 Oct, 2014

1 commit


31 Aug, 2013

1 commit


06 Aug, 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
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Jingoo Han
     

05 Apr, 2013

1 commit


27 Mar, 2012

2 commits

  • The first 3 arguments of 'mtd_device_parse_register()' are pointers,
    but many callers pass '0' instead of 'NULL'. Fix this globally. Thanks
    to coccinelle for making it easy to do with the following semantic patch:

    @@
    expression mtd, types, parser_data, parts, nr_parts;
    @@
    (
    -mtd_device_parse_register(mtd, 0, parser_data, parts, nr_parts)
    +mtd_device_parse_register(mtd, NULL, parser_data, parts, nr_parts)
    |
    -mtd_device_parse_register(mtd, types, 0, parts, nr_parts)
    +mtd_device_parse_register(mtd, types, NULL, parts, nr_parts)
    |
    -mtd_device_parse_register(mtd, types, parser_data, 0, nr_parts)
    +mtd_device_parse_register(mtd, types, parser_data, NULL, nr_parts)
    )

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Artem Bityutskiy
     
  • This patch is part of a set which fixes unnecessary flash erase and write errors
    resulting from the MTD CFI driver turning off vpp while an erase is in progress.
    This patch allows physmap_set_vpp() calls to be nested by adding a reference
    counter.

    omap1_set_vpp() already used a reference counter. Since it is called from
    physmap_set_vpp(), omap1_set_vpp() can now be simplified.

    simtec_nor_vpp() already disabled hard interrupts. Since it is called from
    physmap_set_vpp(), simtec_nor_vpp() can now be simplified.

    Signed-off-by: Paul Parsons
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Paul Parsons
     

10 Jan, 2012

4 commits


11 Sep, 2011

2 commits

  • Replace custom invocations of parse_mtd_partitions and mtd_device_register
    with common mtd_device_parse_register call. This would bring: standard
    handling of all errors, fallback to default partitions, etc.

    Artem: tweaked the patch

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Artem Bityutskiy

    Dmitry Eremin-Solenikov
     
  • physmap_configure() and physmap_set_partitions() have no users in kernel.
    Out of kernel users should have been converted to regular platform device
    long ago. Drop support for this obsolete API.

    Signed-off-by: Dmitry Eremin-Solenikov
    Signed-off-by: Artem Bityutskiy

    Dmitry Eremin-Solenikov
     

28 May, 2011

1 commit

  • * git://git.infradead.org/mtd-2.6: (97 commits)
    mtd: kill CONFIG_MTD_PARTITIONS
    mtd: remove add_mtd_partitions, add_mtd_device and friends
    mtd: convert remaining users to mtd_device_register()
    mtd: samsung onenand: convert to mtd_device_register()
    mtd: omap2 onenand: convert to mtd_device_register()
    mtd: txx9ndfmc: convert to mtd_device_register()
    mtd: tmio_nand: convert to mtd_device_register()
    mtd: socrates_nand: convert to mtd_device_register()
    mtd: sharpsl: convert to mtd_device_register()
    mtd: s3c2410 nand: convert to mtd_device_register()
    mtd: ppchameleonevb: convert to mtd_device_register()
    mtd: orion_nand: convert to mtd_device_register()
    mtd: omap2: convert to mtd_device_register()
    mtd: nomadik_nand: convert to mtd_device_register()
    mtd: ndfc: convert to mtd_device_register()
    mtd: mxc_nand: convert to mtd_device_register()
    mtd: mpc5121_nfc: convert to mtd_device_register()
    mtd: jz4740_nand: convert to mtd_device_register()
    mtd: h1910: convert to mtd_device_register()
    mtd: fsmc_nand: convert to mtd_device_register()
    ...

    Fixed up trivial conflicts in
    - drivers/mtd/maps/integrator-flash.c: removed in ARM tree
    - drivers/mtd/maps/physmap.c: addition of afs partition probe type
    clashing with removal of CONFIG_MTD_PARTITIONS

    Linus Torvalds
     

25 May, 2011

1 commit


21 May, 2011

2 commits

  • The set_vpp() method provided by physmap passes a map_info back to
    the platform code, which has little relevance as far as the platform
    is concerned (this parameter is completely unused).

    Instead, pass the platform_device, which can be used in the pismo
    driver to retrieve some important information in a nicer way, instead
    of the hack that was in place.

    The empty set_vpp function in board-at572d940hf_ek.c is left untouched,
    as the board/SoC is scheduled for removal.

    Cc: Andrew Victor
    Cc: Nicolas Ferre
    Acked-by: Jean-Christophe PLAGNIOL-VILLARD
    Cc: Philipp Zabel
    Cc: Eric Miao
    Cc: Ben Dooks
    Acked-by: Artem Bityutskiy
    Acked-by: David Woodhouse
    Signed-off-by: Marc Zyngier
    Signed-off-by: Russell King

    Marc Zyngier
     
  • In the process of moving platforms away from integrator-flash
    (aka armflash), add to physmap the few features that make
    armflash unique:

    - optionnal probing for the AFS partition type
    - init() and exit() methods, used by Integrator to control
    write access to the various onboard programmable components

    Signed-off-by: Marc Zyngier
    Acked-by: Catalin Marinas
    Acked-by: Artem Bityutskiy
    Acked-by: David Woodhouse
    Signed-off-by: Russell King

    Marc Zyngier
     

11 Mar, 2011

1 commit


08 Aug, 2010

1 commit

  • There are three reasons to add this support:
    1. users probably know the interface type of their flashs, then probe
    can be faster if they give the right type in platform data since wrong
    types will not be detected.
    2. sometimes, detecting can cause destory to system. For example, for
    kernel XIP, detecting can cause NOR enter a mode instructions can not
    be fetched right, which will make kernel crash.
    3. For a new probe which is not listed in the rom_probe_types, if users
    assign it in board files, physmap can still probe it.

    Signed-off-by: Barry Song
    Signed-off-by: Mike Frysinger
    Signed-off-by: David Woodhouse

    Barry Song
     

02 Aug, 2010

1 commit


20 Apr, 2010

1 commit

  • If the default Kconfig values are used with MTD_PHYSMAP_COMPAT you end
    up with a resource where end < start. This causes __request_resource to
    return a conflict which then returns an -EBUSY error code. The current
    physmap.c code just assumes that the platfom_device_register will always
    succeed.

    Catch this failure during the physmap_init and propogate the error.

    Signed-off-by: H Hartley Sweeten
    Reported-by: Randy Dunlap
    Signed-off-by: David Woodhouse

    H Hartley Sweeten
     

30 Nov, 2009

1 commit


21 Oct, 2009

1 commit

  • Commit 4b56ffcacee937a85bf39e14872dd141e23ee85f ("mtd: Fix kernel NULL
    pointer dereference in physmap.c") introduced a couple of bugs.

    It neglected to run the loop of map_destroy() calls in
    physmap_flash_remove(), if !info->cmtd, which would happen if that
    function was called to clean up errors during probe.

    It also failed to compile if CONFIG_MTD_PARTITIONS was not defined.

    Reported-By: Atsushi Nemoto
    Signed-off-by: H Hartley Sweeten
    Signed-off-by: David Woodhouse

    H Hartley Sweeten
     

20 Oct, 2009

1 commit

  • During the probe for physmap platform flash devices there are a
    number error exit conditions that all do a goto err_out which
    then calls physmap_flash_remove(). In that function one of the
    cleanup steps is:

    #ifdef CONFIG_MTD_CONCAT
    if (info->cmtd != info->mtd[0])
    mtd_concat_destroy(info->cmtd);
    #endif

    This test will succeed since info->cmtd == NULL and info->mtd[0] is
    valid.

    Fix this by exiting the remove function when info->cmtd == NULL.

    Also, cleanup the #ifdef CONFIG_MTD_PARTITIONS stuff by using
    mtd_has_partitions().

    Signed-off-by: H Hartley Sweeten
    Signed-off-by: David Woodhouse

    H Hartley Sweeten
     

26 May, 2009

1 commit


04 Apr, 2009

1 commit

  • Follow-on patch to the previous driver model patch for the MTD
    framework. This one makes various MTD drivers connect to the
    driver model tree, so /sys/devices/virtual/mtd/* nodes are no
    longer present ... mostly drivers used on boards I have handy.

    Based on a patch from Kay Sievers.

    Signed-off-by: David Brownell
    Signed-off-by: David Woodhouse

    David Brownell
     

11 Mar, 2009

1 commit

  • commit e480814f138cd5d78a8efe397756ba6b6518fdb6 ("[MTD] [MAPS] physmap:
    fix wrong free and del_mtd_{partition,device}") introduces a NULL pointer
    dereference in physmap_flash_remove when called from the error path in
    physmap_flash_probe (if map_probe failed).

    Call del_mtd_{partition,device} only if info->cmtd was not NULL.

    Reported-by: pHilipp Zabel
    Signed-off-by: Atsushi Nemoto
    Cc: David Woodhouse
    Cc: "Rafael J. Wysocki"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Atsushi Nemoto
     

14 Feb, 2009

1 commit

  • commit 176bf2e0f10ecf1d20a97db3bd5bb2e6ba0b5668 ("physmap: fix leak of
    memory returned by parse_mtd_partitions") deals with a memory leak and
    frees the pointer array of mtd_partition after the call to
    add_mtd_partitions(). the problem is that mtd_table[x]->name still points
    to the freed memory.

    Aldo physmap_flash_remove() should call del_mtd_partitions() or
    del_mtd_device() only once.

    Signed-off-by: Atsushi Nemoto
    Reported-by: Matthias Kaehlcke
    Tested-by: Matthias Kaehlcke
    Signed-off-by: Andrew Morton
    Signed-off-by: David Woodhouse

    Atsushi Nemoto
     

05 Jan, 2009

1 commit


23 Dec, 2008

1 commit


11 Dec, 2008

2 commits

  • The mtd partition parser returns an allocated pointer array of
    mtd_partition. The caller must free it. The array is used only for
    add_mtd_partitions(), so free it just after the call.

    Signed-off-by: Atsushi Nemoto
    Cc: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: David Woodhouse

    Atsushi Nemoto
     
  • The current method for always showing physmap compat address, size, and
    width is a bit confusing. If length is set to 0, then the address and
    width are still shown but silently unused. The physmap code itself
    already has logic which sets compat based on length, so just pull that out
    and into the Kconfig to make everything clear.

    Signed-off-by: Mike Frysinger
    Cc: Bryan Wu
    Signed-off-by: Andrew Morton
    Signed-off-by: David Woodhouse

    Mike Frysinger
     

26 Nov, 2008

1 commit


25 Jul, 2008

2 commits


05 Jun, 2008

1 commit

  • Once upon a time, the MTD repository was using CVS.

    This patch therefore removes all usages of the no longer updated CVS
    keywords from the MTD code.

    This also includes code that printed them to the user.

    Signed-off-by: Adrian Bunk
    Signed-off-by: David Woodhouse

    Adrian Bunk
     

22 Apr, 2008

1 commit

  • Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform modalias is
    prefixed with "platform:". Add MODULE_ALIAS() to the hotpluggable MTD mapping
    platform drivers, to re-enable auto loading.

    NOTE oddness with physmap ... it's a legacy driver in some configs, which
    means it can't always support hotplugging. (Not that most of these mapping
    drivers would often be used as modules...)

    [dbrownell@users.sourceforge.net: bugfix, more drivers, registration fixes]
    Signed-off-by: Kay Sievers
    Signed-off-by: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: David Woodhouse

    Kay Sievers
     

29 Mar, 2008

1 commit

  • # reboot
    ...
    [ 42.351266] Flash device refused suspend due to active operation (state 0)
    [ 42.358195] Unable to handle kernel NULL pointer dereference at virtual address 00000078
    [ 42.360060] pgd = c7d9c000
    [ 42.362769] [00000078] *pgd=a7d8d031, *pte=00000000, *ppte=00000000
    [ 42.372902] Internal error: Oops: 17 [#1]
    [ 42.376911] Modules linked in:
    [ 42.379980] CPU: 0 Not tainted (2.6.25-rc2-10642-ge8f2594-dirty #73)
    [ 42.380000] PC is at physmap_flash_shutdown+0x28/0x54
    ...
    [ 42.380000] Backtrace:
    [ 42.380000] [] (physmap_flash_shutdown+0x0/0x54) from [] (platform_drv_shutdown+0x20/0x24)
    [ 42.380000] r5:28121969 r4:c0229e08
    [ 42.380000] [] (platform_drv_shutdown+0x0/0x24) from [] (device_shutdown+0x60/0x88)
    [ 42.380000] [] (device_shutdown+0x0/0x88) from [] (kernel_restart_prepare+0x2c/0x3c)
    [ 42.380000] r4:00000000
    [ 42.380000] [] (kernel_restart_prepare+0x0/0x3c) from [] (kernel_restart+0x14/0x48)
    [ 42.380000] [] (kernel_restart+0x0/0x48) from [] (sys_reboot+0xe8/0x1f8)
    [ 42.380000] r4:01234567
    [ 42.380000] [] (sys_reboot+0x0/0x1f8) from [] (ret_fast_syscall+0x0/0x2c)
    [ 42.380000] r7:00000058 r6:00000004 r5:00000001 r4:00000000
    [ 42.380000] Code: 0a000009 e7953004 e1a00003 e1a0e00f (e593f078)
    [ 42.650051] ---[ end trace 6d6c26a0fc3141de ]---
    Segmentation fault
    INIT: no more processes left in this runlevel

    While looping for mtd[i]s, we should stop at the mtd[i] == NULL.

    This patch also removes unnecessary "if (info)" checks:
    suspend/resume/shutdown ops are executed only if probe() is succeeded, so info
    is guaranteed to be !NULL.

    Signed-off-by: Anton Vorontsov
    Cc: David Brownell
    Cc: David Woodhouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Vorontsov
     

07 Feb, 2008

1 commit


03 Feb, 2008

1 commit

  • This patch extends the physmap mapping driver to support multiple
    resources for non-identical NOR chips that will be concatenated together
    when selected.

    This is needed for example for Intel 48F4400 512MBit chips, since they
    consist of 2 single different NOR chips with different geometries. The
    first (lower) one has botton boot sectors and the 2nd (upper) has top
    boot sectors. This currently isn't handled correctly by calling the
    physmap driver once with only one resource covering both chips in one
    memory region. The same geometrie is used for both chips.

    With this patch the following resource structure can be used to
    describe the 48F4400 chip correctly:

    static struct resource board_nor_resource[] = {
    [0] = {
    .start = 0xf8000000,
    .end = 0xfbffffff,
    .flags = IORESOURCE_MEM,
    },
    [1] = {
    .start = 0xfc000000,
    .end = 0xffffffff,
    .flags = IORESOURCE_MEM,
    }
    };

    Signed-off-by: Stefan Roese
    Signed-off-by: David Woodhouse

    Stefan Roese