[PATCH 1/2] [RESEND] ps3: vuart: fix error path locking - Kernel

This is a discussion on [PATCH 1/2] [RESEND] ps3: vuart: fix error path locking - Kernel ; This stray down would cause a permanent sleep which doesn't seem correct. The other uses of this semaphore appear fairly mutex like it's even initialized with init_MUTEX() .. So here a patch for removing this one down(). Signed-off-by: Geoff Levand ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: [PATCH 1/2] [RESEND] ps3: vuart: fix error path locking

  1. [PATCH 1/2] [RESEND] ps3: vuart: fix error path locking

    This stray down would cause a permanent sleep which doesn't seem correct.
    The other uses of this semaphore appear fairly mutex like it's even initialized
    with init_MUTEX() .. So here a patch for removing this one down().

    Signed-off-by: Geoff Levand
    Signed-off-by: Daniel Walker

    ---
    drivers/ps3/ps3-vuart.c | 1 -
    1 file changed, 1 deletion(-)

    Index: linux-2.6.23/drivers/ps3/ps3-vuart.c
    ================================================== =================
    --- linux-2.6.23.orig/drivers/ps3/ps3-vuart.c
    +++ linux-2.6.23/drivers/ps3/ps3-vuart.c
    @@ -1072,7 +1072,6 @@ static int ps3_vuart_probe(struct ps3_sy
    if (result) {
    dev_dbg(&dev->core, "%s:%d: drv->probe failed\n",
    __func__, __LINE__);
    - down(&vuart_bus_priv.probe_mutex);
    goto fail_probe;
    }


    --
    --
    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/

  2. [PATCH 2/2] [RESEND] driver base: memory: semaphore to mutex

    Signed-off-by: Daniel Walker

    ---
    drivers/base/memory.c | 7 ++++---
    include/linux/memory.h | 5 ++---
    mm/memory_hotplug.c | 2 +-
    3 files changed, 7 insertions(+), 7 deletions(-)

    Index: linux-2.6.23/drivers/base/memory.c
    ================================================== =================
    --- linux-2.6.23.orig/drivers/base/memory.c
    +++ linux-2.6.23/drivers/base/memory.c
    @@ -20,6 +20,7 @@
    #include
    #include
    #include
    +#include
    #include
    #include

    @@ -220,7 +221,7 @@ static int memory_block_change_state(str
    unsigned long to_state, unsigned long from_state_req)
    {
    int ret = 0;
    - down(&mem->state_sem);
    + mutex_lock(&mem->state_mutex);

    if (mem->state != from_state_req) {
    ret = -EINVAL;
    @@ -232,7 +233,7 @@ static int memory_block_change_state(str
    mem->state = to_state;

    out:
    - up(&mem->state_sem);
    + mutex_unlock(&mem->state_mutex);
    return ret;
    }

    @@ -357,7 +358,7 @@ static int add_memory_block(unsigned lon

    mem->phys_index = __section_nr(section);
    mem->state = state;
    - init_MUTEX(&mem->state_sem);
    + mutex_init(&mem->state_mutex);
    mem->phys_device = phys_device;

    ret = register_memory(mem, section, NULL);
    Index: linux-2.6.23/include/linux/memory.h
    ================================================== =================
    --- linux-2.6.23.orig/include/linux/memory.h
    +++ linux-2.6.23/include/linux/memory.h
    @@ -18,8 +18,7 @@
    #include
    #include
    #include
    -
    -#include
    +#include

    struct memory_block {
    unsigned long phys_index;
    @@ -30,7 +29,7 @@ struct memory_block {
    * created long after the critical areas during
    * initialization.
    */
    - struct semaphore state_sem;
    + struct mutex state_mutex;
    int phys_device; /* to which fru does this belong? */
    void *hw; /* optional pointer to fw/hw data */
    int (*phys_callback)(struct memory_block *);
    Index: linux-2.6.23/mm/memory_hotplug.c
    ================================================== =================
    --- linux-2.6.23.orig/mm/memory_hotplug.c
    +++ linux-2.6.23/mm/memory_hotplug.c
    @@ -209,7 +209,7 @@ int online_pages(unsigned long pfn, unsi
    /*
    * This doesn't need a lock to do pfn_to_page().
    * The section can't be removed here because of the
    - * memory_block->state_sem.
    + * memory_block->state_mutex.
    */
    zone = page_zone(pfn_to_page(pfn));
    pgdat_resize_lock(zone->zone_pgdat, &flags);

    --
    --
    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/

+ Reply to Thread