[PATCH v3 5/7] KVM: MMU: introduce FNAME(prefetch_gpte)

2012-09-20 Thread Xiao Guangrong
The only difference between FNAME(update_pte) and FNAME(pte_prefetch)
is that the former is allowed to prefetch gfn from dirty logged slot,
so introduce a common function to prefetch spte

Signed-off-by: Xiao Guangrong 
---
 arch/x86/kvm/paging_tmpl.h |   58 ++-
 1 files changed, 24 insertions(+), 34 deletions(-)

diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 6fd1c8b..5b1af72 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -356,33 +356,45 @@ no_present:
return true;
 }

-static void FNAME(update_pte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp,
- u64 *spte, const void *pte)
+static bool
+FNAME(prefetch_gpte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp,
+u64 *spte, pt_element_t gpte, bool no_dirty_log)
 {
-   pt_element_t gpte;
unsigned pte_access;
+   gfn_t gfn;
pfn_t pfn;

-   gpte = *(const pt_element_t *)pte;
if (FNAME(prefetch_invalid_gpte)(vcpu, sp, spte, gpte))
-   return;
+   return false;

pgprintk("%s: gpte %llx spte %p\n", __func__, (u64)gpte, spte);
+
+   gfn = gpte_to_gfn(gpte);
pte_access = sp->role.access & FNAME(gpte_access)(vcpu, gpte, true);
-   pfn = gfn_to_pfn_atomic(vcpu->kvm, gpte_to_gfn(gpte));
+   pfn = pte_prefetch_gfn_to_pfn(vcpu, gfn,
+   no_dirty_log && (pte_access & ACC_WRITE_MASK));
if (is_invalid_pfn(pfn))
-   return;
+   return false;

/*
-* we call mmu_set_spte() with host_writable = true because that
-* vcpu->arch.update_pte.pfn was fetched from get_user_pages(write = 1).
+* we call mmu_set_spte() with host_writable = true because
+* pte_prefetch_gfn_to_pfn always gets a writable pfn.
 */
mmu_set_spte(vcpu, spte, sp->role.access, pte_access, 0, 0,
-NULL, PT_PAGE_TABLE_LEVEL,
-gpte_to_gfn(gpte), pfn, true, true);
+NULL, PT_PAGE_TABLE_LEVEL, gfn, pfn, true, true);

if (likely(!is_noslot_pfn(pfn)))
kvm_release_pfn_clean(pfn);
+
+   return true;
+}
+
+static void FNAME(update_pte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp,
+ u64 *spte, const void *pte)
+{
+   pt_element_t gpte = *(const pt_element_t *)pte;
+
+   FNAME(prefetch_gpte)(vcpu, sp, spte, gpte, false);
 }

 static bool FNAME(gpte_changed)(struct kvm_vcpu *vcpu,
@@ -428,36 +440,14 @@ static void FNAME(pte_prefetch)(struct kvm_vcpu *vcpu, 
struct guest_walker *gw,
spte = sp->spt + i;

for (i = 0; i < PTE_PREFETCH_NUM; i++, spte++) {
-   pt_element_t gpte;
-   unsigned pte_access;
-   gfn_t gfn;
-   pfn_t pfn;
-
if (spte == sptep)
continue;

if (is_shadow_present_pte(*spte))
continue;

-   gpte = gptep[i];
-
-   if (FNAME(prefetch_invalid_gpte)(vcpu, sp, spte, gpte))
-   continue;
-
-   pte_access = sp->role.access & FNAME(gpte_access)(vcpu, gpte,
- true);
-   gfn = gpte_to_gfn(gpte);
-   pfn = pte_prefetch_gfn_to_pfn(vcpu, gfn,
- pte_access & ACC_WRITE_MASK);
-   if (is_invalid_pfn(pfn))
+   if (!FNAME(prefetch_gpte)(vcpu, sp, spte, gptep[i], true))
break;
-
-   mmu_set_spte(vcpu, spte, sp->role.access, pte_access, 0, 0,
-NULL, PT_PAGE_TABLE_LEVEL, gfn,
-pfn, true, true);
-
-   if (likely(!is_noslot_pfn(pfn)))
-   kvm_release_pfn_clean(pfn);
}
 }

-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3 4/7] KVM: MMU: cleanup FNAME(page_fault)

2012-09-20 Thread Xiao Guangrong
Let it return emulate state instead of spte like __direct_map

Signed-off-by: Xiao Guangrong 
---
 arch/x86/kvm/paging_tmpl.h |   31 ---
 1 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 56f8085..6fd1c8b 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -463,21 +463,21 @@ static void FNAME(pte_prefetch)(struct kvm_vcpu *vcpu, 
struct guest_walker *gw,

 /*
  * Fetch a shadow pte for a specific level in the paging hierarchy.
+ * If the guest tries to write a write-protected page, we need to
+ * emulate this operation, return 1 to indicate this case.
  */
-static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
+static int FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
 struct guest_walker *gw,
 int user_fault, int write_fault, int hlevel,
-int *emulate, pfn_t pfn, bool map_writable,
-bool prefault)
+pfn_t pfn, bool map_writable, bool prefault)
 {
-   unsigned access = gw->pt_access;
struct kvm_mmu_page *sp = NULL;
-   int top_level;
-   unsigned direct_access;
struct kvm_shadow_walk_iterator it;
+   unsigned direct_access, access = gw->pt_access;
+   int top_level, emulate = 0;

if (!is_present_gpte(gw->ptes[gw->level - 1]))
-   return NULL;
+   return 0;

direct_access = gw->pte_access;

@@ -541,17 +541,17 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t 
addr,

clear_sp_write_flooding_count(it.sptep);
mmu_set_spte(vcpu, it.sptep, access, gw->pte_access,
-user_fault, write_fault, emulate, it.level,
+user_fault, write_fault, &emulate, it.level,
 gw->gfn, pfn, prefault, map_writable);
FNAME(pte_prefetch)(vcpu, gw, it.sptep);

-   return it.sptep;
+   return emulate;

 out_gpte_changed:
if (sp)
kvm_mmu_put_page(sp, it.sptep);

-   return NULL;
+   return 0;
 }

 /*
@@ -574,8 +574,6 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t 
addr, u32 error_code,
int write_fault = error_code & PFERR_WRITE_MASK;
int user_fault = error_code & PFERR_USER_MASK;
struct guest_walker walker;
-   u64 *sptep;
-   int emulate = 0;
int r;
pfn_t pfn;
int level = PT_PAGE_TABLE_LEVEL;
@@ -639,17 +637,12 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t 
addr, u32 error_code,
kvm_mmu_free_some_pages(vcpu);
if (!force_pt_level)
transparent_hugepage_adjust(vcpu, &walker.gfn, &pfn, &level);
-   sptep = FNAME(fetch)(vcpu, addr, &walker, user_fault, write_fault,
-level, &emulate, pfn, map_writable, prefault);
-   (void)sptep;
-   pgprintk("%s: shadow pte %p %llx emulate %d\n", __func__,
-sptep, *sptep, emulate);
+   r = FNAME(fetch)(vcpu, addr, &walker, user_fault, write_fault,
+level, pfn, map_writable, prefault);

++vcpu->stat.pf_fixed;
kvm_mmu_audit(vcpu, AUDIT_POST_PAGE_FAULT);

-   r = emulate;
-
 out_unlock:
spin_unlock(&vcpu->kvm->mmu_lock);
if (likely(!is_noslot_pfn(pfn)))
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3 3/7] KVM: MMU: do not release pfn in mmu_set_spte

2012-09-20 Thread Xiao Guangrong
It helps us to cleanup release pfn in the later patches

Signed-off-by: Xiao Guangrong 
---
 arch/x86/kvm/mmu.c |   29 ++---
 arch/x86/kvm/paging_tmpl.h |   18 --
 2 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 3e9728b..bc1cda4 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2496,9 +2496,6 @@ static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 
*sptep,
rmap_recycle(vcpu, sptep, gfn);
}
}
-
-   if (!is_error_pfn(pfn))
-   kvm_release_pfn_clean(pfn);
 }

 static void nonpaging_new_cr3(struct kvm_vcpu *vcpu)
@@ -2535,12 +2532,15 @@ static int direct_pte_prefetch_many(struct kvm_vcpu 
*vcpu,
if (ret <= 0)
return -1;

-   for (i = 0; i < ret; i++, gfn++, start++)
+   for (i = 0; i < ret; i++, gfn++, start++) {
mmu_set_spte(vcpu, start, ACC_ALL,
 access, 0, 0, NULL,
 sp->role.level, gfn,
 page_to_pfn(pages[i]), true, true);

+   kvm_release_page_clean(pages[i]);
+   }
+
return 0;
 }

@@ -2858,23 +2858,22 @@ static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t 
v, u32 error_code,
return r;

spin_lock(&vcpu->kvm->mmu_lock);
-   if (mmu_notifier_retry(vcpu, mmu_seq))
+   if (mmu_notifier_retry(vcpu, mmu_seq)) {
+   r = 0;
goto out_unlock;
+   }
+
kvm_mmu_free_some_pages(vcpu);
if (likely(!force_pt_level))
transparent_hugepage_adjust(vcpu, &gfn, &pfn, &level);
r = __direct_map(vcpu, v, write, map_writable, level, gfn, pfn,
 prefault);
-   spin_unlock(&vcpu->kvm->mmu_lock);
-
-
-   return r;

 out_unlock:
spin_unlock(&vcpu->kvm->mmu_lock);
if (likely(!is_noslot_pfn(pfn)))
kvm_release_pfn_clean(pfn);
-   return 0;
+   return r;
 }


@@ -3328,22 +3327,22 @@ static int tdp_page_fault(struct kvm_vcpu *vcpu, gva_t 
gpa, u32 error_code,
return r;

spin_lock(&vcpu->kvm->mmu_lock);
-   if (mmu_notifier_retry(vcpu, mmu_seq))
+   if (mmu_notifier_retry(vcpu, mmu_seq)) {
+   r = 0;
goto out_unlock;
+   }
+
kvm_mmu_free_some_pages(vcpu);
if (likely(!force_pt_level))
transparent_hugepage_adjust(vcpu, &gfn, &pfn, &level);
r = __direct_map(vcpu, gpa, write, map_writable,
 level, gfn, pfn, prefault);
-   spin_unlock(&vcpu->kvm->mmu_lock);
-
-   return r;

 out_unlock:
spin_unlock(&vcpu->kvm->mmu_lock);
if (likely(!is_noslot_pfn(pfn)))
kvm_release_pfn_clean(pfn);
-   return 0;
+   return r;
 }

 static void nonpaging_free(struct kvm_vcpu *vcpu)
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index b400761..56f8085 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -380,6 +380,9 @@ static void FNAME(update_pte)(struct kvm_vcpu *vcpu, struct 
kvm_mmu_page *sp,
mmu_set_spte(vcpu, spte, sp->role.access, pte_access, 0, 0,
 NULL, PT_PAGE_TABLE_LEVEL,
 gpte_to_gfn(gpte), pfn, true, true);
+
+   if (likely(!is_noslot_pfn(pfn)))
+   kvm_release_pfn_clean(pfn);
 }

 static bool FNAME(gpte_changed)(struct kvm_vcpu *vcpu,
@@ -452,6 +455,9 @@ static void FNAME(pte_prefetch)(struct kvm_vcpu *vcpu, 
struct guest_walker *gw,
mmu_set_spte(vcpu, spte, sp->role.access, pte_access, 0, 0,
 NULL, PT_PAGE_TABLE_LEVEL, gfn,
 pfn, true, true);
+
+   if (likely(!is_noslot_pfn(pfn)))
+   kvm_release_pfn_clean(pfn);
}
 }

@@ -544,8 +550,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
 out_gpte_changed:
if (sp)
kvm_mmu_put_page(sp, it.sptep);
-   if (likely(!is_noslot_pfn(pfn)))
-   kvm_release_pfn_clean(pfn);
+
return NULL;
 }

@@ -625,8 +630,10 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t 
addr, u32 error_code,
return r;

spin_lock(&vcpu->kvm->mmu_lock);
-   if (mmu_notifier_retry(vcpu, mmu_seq))
+   if (mmu_notifier_retry(vcpu, mmu_seq)) {
+   r = 0;
goto out_unlock;
+   }

kvm_mmu_audit(vcpu, AUDIT_PRE_PAGE_FAULT);
kvm_mmu_free_some_pages(vcpu);
@@ -640,15 +647,14 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t 
addr, u32 error_code,

++vcpu->stat.pf_fixed;
kvm_mmu_audit(vcpu, AUDIT_POST_PAGE_FAULT);
-   spin_unlock(&vcpu->kvm->mmu_lock);

-   return emulate;
+   r = emulate;

 out_unlock:
spin_unlock(&vcpu->kvm->mmu_lock);
if (likely

[PATCH v3 2/7] KVM: MMU: remove mmu_is_invalid

2012-09-20 Thread Xiao Guangrong
Remove mmu_is_invalid and use is_invalid_pfn instead

Signed-off-by: Xiao Guangrong 
---
 arch/x86/kvm/mmu.c |5 -
 arch/x86/kvm/paging_tmpl.h |4 ++--
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 0f56169..3e9728b 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2700,11 +2700,6 @@ static void transparent_hugepage_adjust(struct kvm_vcpu 
*vcpu,
}
 }

-static bool mmu_invalid_pfn(pfn_t pfn)
-{
-   return unlikely(is_invalid_pfn(pfn));
-}
-
 static bool handle_abnormal_pfn(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn,
pfn_t pfn, unsigned access, int *ret_val)
 {
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 9ce6bc0..b400761 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -370,7 +370,7 @@ static void FNAME(update_pte)(struct kvm_vcpu *vcpu, struct 
kvm_mmu_page *sp,
pgprintk("%s: gpte %llx spte %p\n", __func__, (u64)gpte, spte);
pte_access = sp->role.access & FNAME(gpte_access)(vcpu, gpte, true);
pfn = gfn_to_pfn_atomic(vcpu->kvm, gpte_to_gfn(gpte));
-   if (mmu_invalid_pfn(pfn))
+   if (is_invalid_pfn(pfn))
return;

/*
@@ -446,7 +446,7 @@ static void FNAME(pte_prefetch)(struct kvm_vcpu *vcpu, 
struct guest_walker *gw,
gfn = gpte_to_gfn(gpte);
pfn = pte_prefetch_gfn_to_pfn(vcpu, gfn,
  pte_access & ACC_WRITE_MASK);
-   if (mmu_invalid_pfn(pfn))
+   if (is_invalid_pfn(pfn))
break;

mmu_set_spte(vcpu, spte, sp->role.access, pte_access, 0, 0,
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3 1/7] KVM: MMU: fix release noslot pfn

2012-09-20 Thread Xiao Guangrong
We can not directly call kvm_release_pfn_clean to release the pfn
since we can meet noslot pfn which is used to cache mmio info into
spte

Signed-off-by: Xiao Guangrong 
---
 arch/x86/kvm/mmu.c |6 --
 arch/x86/kvm/paging_tmpl.h |6 --
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index aa0b469..0f56169 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2877,7 +2877,8 @@ static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, 
u32 error_code,

 out_unlock:
spin_unlock(&vcpu->kvm->mmu_lock);
-   kvm_release_pfn_clean(pfn);
+   if (likely(!is_noslot_pfn(pfn)))
+   kvm_release_pfn_clean(pfn);
return 0;
 }

@@ -3345,7 +3346,8 @@ static int tdp_page_fault(struct kvm_vcpu *vcpu, gva_t 
gpa, u32 error_code,

 out_unlock:
spin_unlock(&vcpu->kvm->mmu_lock);
-   kvm_release_pfn_clean(pfn);
+   if (likely(!is_noslot_pfn(pfn)))
+   kvm_release_pfn_clean(pfn);
return 0;
 }

diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index bf8c42b..9ce6bc0 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -544,7 +544,8 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
 out_gpte_changed:
if (sp)
kvm_mmu_put_page(sp, it.sptep);
-   kvm_release_pfn_clean(pfn);
+   if (likely(!is_noslot_pfn(pfn)))
+   kvm_release_pfn_clean(pfn);
return NULL;
 }

@@ -645,7 +646,8 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t 
addr, u32 error_code,

 out_unlock:
spin_unlock(&vcpu->kvm->mmu_lock);
-   kvm_release_pfn_clean(pfn);
+   if (likely(!is_noslot_pfn(pfn)))
+   kvm_release_pfn_clean(pfn);
return 0;
 }

-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3 0/7] KVM: MMU: fix release pfn in mmu code

2012-09-20 Thread Xiao Guangrong
Changlog:
changes from Avi's comments:
 - comment for FNAME(fetch)
 - add annotations (__acquires, __releases) for page_fault_start and
   page_fault_end

changes from Marcelo's comments:
 - remove mmu_is_invalid
 - make release noslot pfn path more readable

The last patch which introduces page_fault_start and page_fault_end is
controversial, i hope we can try it since it wrap the ugly pfn release
path up, but i respect your idea. :)

Release pfn in the mmu code is little special for we allow no-slot pfn
go to spte walk on page fault path, that means, on page fault fail path,
we can not directly call kvm_release_pfn_clean.

This patchset fixes the bug which release no-slot pfn on fail path and
clean up all the paths where kvm_release_pfn_clean is called

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: build failure after merge of the final tree (mfd and battery trees related)

2012-09-20 Thread Stephen Rothwell
Hi all,

After merging the final tree, today's linux-next build (powerpc
allyesconfig) failed like this:

drivers/mfd/88pm860x-core.c: In function 'device_power_init':
drivers/mfd/88pm860x-core.c:982:11: error: too few arguments to function 
'mfd_add_devices'
include/linux/mfd/core.h:100:12: note: declared here

Caused by commit a830d28b48bf ("power_supply: Enable battery-charger for
88pm860x") from the battery tree interacting with commit 55692af5eb58
("mfd: core: Push irqdomain mapping out into devices") from the mfd tree.

I added the following merge-fix patch and can carry it as necessary.

From: Stephen Rothwell 
Date: Fri, 21 Sep 2012 16:41:09 +1000
Subject: [PATCH] power_supply: 88pm860x: fix up for mfd_add_devices() API
 change

Signed-off-by: Stephen Rothwell 
---
 drivers/mfd/88pm860x-core.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index 62311ad..a4dba31 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -979,7 +979,7 @@ static void __devinit device_power_init(struct pm860x_chip 
*chip,
power_devs[3].platform_data = pdata->chg_desc;
power_devs[3].pdata_size = sizeof(*pdata->chg_desc);
ret = mfd_add_devices(chip->dev, 0, &power_devs[3], 1,
- NULL, chip->irq_base);
+ NULL, chip->irq_base, NULL);
if (ret < 0)
dev_err(chip->dev, "Failed to add chg-manager 
subdev\n");
}
-- 
1.7.10.280.gaa39

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpBmOdIA5Ouj.pgp
Description: PGP signature


Re: [PATCH 09/14] userns: Convert binder ipc to use kuids

2012-09-20 Thread Greg Kroah-Hartman
On Thu, Sep 20, 2012 at 05:28:45PM -0700, Eric W. Biederman wrote:
> From: "Eric W. Biederman" 
> 
> Cc: Arve Hjønnevåg 
> Cc: Greg Kroah-Hartman 
> Acked-by: Serge Hallyn 
> Signed-off-by: Eric W. Biederman 

Acked-by: Greg Kroah-Hartman 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] audit: define AUDIT_ARCH_OPENRISC

2012-09-20 Thread Jonas Bonn


On 09/21/2012 12:46 AM, Kees Cook wrote:

When using audit on OpenRISC, an audit arch is needed. This defines
it and fixes a compile-time bug uncovered in linux-next, likely from a
cut/paste from an arch with 64/32-bit modes that defined arch_arch():
arch/openrisc/kernel/ptrace.c:190:2: error: implicit declaration of function 
'audit_arch'

This replaces it with the newly defined AUDIT_ARCH_OPENRISC, since it
is only 32-bit, and currently only operates in big-endian mode.


Looks good.  Will queue it up for 3.7.
Thanks,
Jonas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] clk: fix return value check in of_fixed_clk_setup()

2012-09-20 Thread Wei Yongjun
From: Wei Yongjun 

In case of error, the function clk_register_fixed_rate() returns
ERR_PTR() not NULL pointer. The NULL test in the return value
check should be replaced with IS_ERR().

dpatch engine is used to auto generated this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 drivers/clk/clk-fixed-rate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-fixed-rate.c b/drivers/clk/clk-fixed-rate.c
index f5ec0ee..af78ed6 100644
--- a/drivers/clk/clk-fixed-rate.c
+++ b/drivers/clk/clk-fixed-rate.c
@@ -97,7 +97,7 @@ void __init of_fixed_clk_setup(struct device_node *node)
of_property_read_string(node, "clock-output-names", &clk_name);
 
clk = clk_register_fixed_rate(NULL, clk_name, NULL, CLK_IS_ROOT, rate);
-   if (clk)
+   if (!IS_ERR(clk))
of_clk_add_provider(node, of_clk_src_simple_get, clk);
 }
 EXPORT_SYMBOL_GPL(of_fixed_clk_setup);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: build failure after merge of the akpm tree

2012-09-20 Thread Stephen Rothwell
Hi Andrew,

After merging the akpm tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

fs/compat_binfmt_elf.c:22:53: fatal error: asm/sigframe.h: No such file or 
directory

Caused by commit "coredump: add a new elf note with siginfo of the
signal".  That include file only exists on the x86 and tile architectures.

I have reverted that commit (and "coredump: extend core dump note section
to contain file names of mapped files" and
"coredump-extend-core-dump-note-section-to-contain-file-names-of-mapped-files-checkpatch-fixes"
that follow it) for today.

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgp2L3VNCM2PL.pgp
Description: PGP signature


Re: [PATCH 4/5] PCI/IOV: simplify code by hotplug safe pci_get_domain_bus_and_slot()

2012-09-20 Thread Yinghai Lu
On Thu, Sep 20, 2012 at 7:56 PM, Bjorn Helgaas  wrote:
> This is another thing I'm curious about.  How do you handle this
> situation today (before host bridge hot-add)?
>
> The DMAR I'm not so worried about because as far as I know, there's no
> such thing as a DMAR that's discovered by PCI enumeration.  We should
> discover it via ACPI, and that can happen before we enumerate anything
> behind a host bridge, so I don't really see any ordering problem
> between the DMAR and the PCI devices that would use it.

only need to have pci devices on that root bus scanned, and current intel iommu
maintain one device scope to drhd with pointer to pci device... that
need to be fixed
too.

>
> However, I know there *are* IOAPICs that are enumerated as PCI
> devices, and I don't know whether we can deduce a relationship between
> the IOAPIC and the devices that use it.  Don't we have this problem
> already?  I assume that even without hot-adding a host bridge, we
> might discover a PCI IOAPIC that was present at boot, and we'd have to
> make sure to bind a driver to it before we use any of the PCI devices
> connected to it.  How does that work?

I converted it to acpi way to discover it, and it could handle that case.

will search _GSB and try to get pci device, if there is pci device
will try to get BAR as ioapic base.

http://git.kernel.org/?p=linux/kernel/git/yinghai/linux-yinghai.git;a=blob;f=drivers/pci/ioapic.c;h=504ca93ac692646a7754fff83a04e3d07d98f648;hb=refs/heads/for-x86-irq

something like:

static void handle_ioapic_add(acpi_handle handle, struct pci_dev **pdev,
 u32 *pgsi_base)
{
acpi_status status;
unsigned long long gsb;
struct pci_dev *dev;
u32 gsi_base;
int ret;
char *type;
struct resource r;
struct resource *res = &r;
char objname[64];
struct acpi_buffer buffer = {sizeof(objname), objname};

*pdev = NULL;
*pgsi_base = 0;

status = acpi_evaluate_integer(handle, "_GSB", NULL, &gsb);
if (ACPI_FAILURE(status) || !gsb)
return;

dev = acpi_get_pci_dev(handle);
if (!dev) {
struct acpi_device_info *info;
char *hid = NULL;

status = acpi_get_object_info(handle, &info);
if (ACPI_FAILURE(status))
return;
if (info->valid & ACPI_VALID_HID)
hid = info->hardware_id.string;
if (!hid || strcmp(hid, "ACPI0009")) {
kfree(info);
return;
}
kfree(info);
memset(res, 0, sizeof(*res));
acpi_walk_resources(handle, METHOD_NAME__CRS, setup_res, res);
if (!res->flags)
return;
}

acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer);

gsi_base = gsb;
type = "IOxAPIC";
if (dev) {
ret = pci_enable_device(dev);
if (ret < 0)
goto exit_put;

pci_set_master(dev);

if (dev->class == PCI_CLASS_SYSTEM_PIC_IOAPIC)
type = "IOAPIC";

if (pci_request_region(dev, 0, type))
goto exit_disable;

res = &dev->resource[0];
}

if (acpi_register_ioapic(handle, res->start, gsi_base)) {
if (dev)
goto exit_release;
return;
}

printk(KERN_INFO "%s %s %s at %pR, GSI %u\n",
dev ? dev_name(&dev->dev) : "", objname, type,
res, gsi_base);

*pdev = dev;
*pgsi_base = gsi_base;
return;

exit_release:
pci_release_region(dev, 0);
exit_disable:
pci_disable_device(dev);
exit_put:
pci_dev_put(dev);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Status of arm-soc for 3.7

2012-09-20 Thread Olof Johansson
First, a heads up for those of you who were planning on coming with
late merge requests: Sorry, but we will probably hold off until 3.8.

We'll still take fixes and probably some small updates. But given all
the moves of platform data and other code shuffling in the tree for
this next merge window, merge conflicts and dependencies are stacking
up quickly right now. I don't want things to get out of control in
that area, which means no more major merges.

What's left to deal with is:

* smp_ops branch, since multiplatform depends on it to allow building
more than one platform.

* bcmring removal hasn't been applied yet, it's not really urgent and
the patches were line wrapped and I forgot about it before I merged
multiplatform and, well, it can just wait until 3.8 now.

* vt8500 device tree conversion had some comments on some of the
bindings. Since the pull request has already come in, I'll revisit it
if it looks like it won't be too messy to merge in.

Beyond that, let me know if you have already sent us a merge request
that we have missed.

Some quick stats:

590 non-merge changesets are queued up through 94 branch merges, which
is fewer patches but about the same number of merges as usual:
 1149 files changed, 29520 insertions(+), 35466 deletions(-)

The cleanup branch this release is substantial: 160 patches alone,
with a diffstat of:
 614 files changed, 9769 insertions(+), 20645 deletions(-)


Some highlights (I'm missing lots, but a few are):

One platform removal: pnx4008
One new platform: bcm2835
Lots of DT updates across the board this release. Tegra has removed
all board files and gone DT-only.
We have a new maintainer for KS8695 (Greg Ungerer) and renewed contributions.
Qualcomm has started cleaning out some stale code from the MSM
platforms, and begin device tree enablement for the latest families.
Exynos4 has been converted to pinctrl and gpiolib.
PRISM2 has DT bindings for pinctrl
The first interrupt controller driver has been added to /drivers/irqchip
OMAP internal bus has been added to /drivers/bus
Lots of moves of platform_data contents into include/linux/platform_data
Moves and removal of other mach-*/include files out of the way to
prepare for multiplatform
Initial multiplatform patch series from Rob Herring


Top 15 authors:

Tony Lindgren (46)
Arnd Bergmann (40)
Uwe Kleine-König (37)
Rob Herring (35)
Shawn Guo (33)
Stephen Warren (27)
Fabio Estevam (23)
Stephen Boyd (20)
Bryan Wu (18)
Laxman Dewangan (18)
Linus Walleij (17)
Chao Xie (12)
Afzal Mohammed (10)
Igor Grinberg (9)
Paul Walmsley (9)


-Olof
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ARM: imx: fix the return value check in imx_clk_busy_divider()

2012-09-20 Thread Wei Yongjun
From: Wei Yongjun 

In case of error, the function clk_register() returns ERR_PTR()
no NULL pointer. The NULL test in the return value check should
be replaced with IS_ERR().

dpatch engine is used to auto generated this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 arch/arm/mach-imx/clk-busy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/clk-busy.c b/arch/arm/mach-imx/clk-busy.c
index 1a7a8dd..1ab91b5 100644
--- a/arch/arm/mach-imx/clk-busy.c
+++ b/arch/arm/mach-imx/clk-busy.c
@@ -108,7 +108,7 @@ struct clk *imx_clk_busy_divider(const char *name, const 
char *parent_name,
busy->div.hw.init = &init;
 
clk = clk_register(NULL, &busy->div.hw);
-   if (!clk)
+   if (IS_ERR(clk))
kfree(busy);
 
return clk;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] davinci: fix return value check by using IS_ERR in tnetv107x_devices_init()

2012-09-20 Thread Wei Yongjun
From: Wei Yongjun 

In case of error, the function clk_get() returns ERR_PTR() not
NULL pointer. The NULL test in the error handling should be
replaced with IS_ERR().

dpatch engine is used to auto generated this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 arch/arm/mach-davinci/devices-tnetv107x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-davinci/devices-tnetv107x.c 
b/arch/arm/mach-davinci/devices-tnetv107x.c
index 29b17f7..773ab07 100644
--- a/arch/arm/mach-davinci/devices-tnetv107x.c
+++ b/arch/arm/mach-davinci/devices-tnetv107x.c
@@ -374,7 +374,7 @@ void __init tnetv107x_devices_init(struct 
tnetv107x_device_info *info)
 * complete sample conversion in time.
 */
tsc_clk = clk_get(NULL, "sys_tsc_clk");
-   if (tsc_clk) {
+   if (!IS_ERR(tsc_clk)) {
error = clk_set_rate(tsc_clk, 500);
WARN_ON(error < 0);
clk_put(tsc_clk);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: build failure after merge of the akpm tree

2012-09-20 Thread Stephen Rothwell
Hi Andrew,

After merging the akpm tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

fs/binfmt_elf.c: In function 'fill_files_note':
fs/binfmt_elf.c:1419:2: error: implicit declaration of function 'vmalloc' 
[-Werror=implicit-function-declaration]
fs/binfmt_elf.c:1419:7: warning: assignment makes pointer from integer without 
a cast [enabled by default]
fs/binfmt_elf.c:1437:5: error: implicit declaration of function 'vfree' 
[-Werror=implicit-function-declaration]

Caused by commit "coredump: extend core dump note section to contain file
names of mapped files".  Forgot to include vmalloc.h :-(

I added this patch for today:

From: Stephen Rothwell 
Date: Fri, 21 Sep 2012 16:06:18 +1000
Subject: [PATCH] coredump: using vmalloc requires the inclusion of vmalloc.h

Signed-off-by: Stephen Rothwell 
---
 fs/binfmt_elf.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 0973943..5ac905f 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
1.7.10.280.gaa39

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpn7BqkRQoep.pgp
Description: PGP signature


Re: [PATCH 1/4] usb: phy: add a new driver for usb3 phy

2012-09-20 Thread ABRAHAM, KISHON VIJAY
Hi,

On Wed, Sep 19, 2012 at 8:11 PM, Marc Kleine-Budde  wrote:
> On 09/19/2012 01:30 PM, Kishon Vijay Abraham I wrote:
>> Added a driver for usb3 phy that handles the interaction between usb phy
>> device and dwc3 controller.
>>
>> This also includes device tree support for usb3 phy driver and
>> the documentation with device tree binding information is updated.
>>
>> Currently writing to control module register is taken care in this
>> driver which will be removed once the control module driver is in place.
>>
>> Signed-off-by: Kishon Vijay Abraham I 
>> Signed-off-by: Felipe Balbi 
>> Signed-off-by: Moiz Sonasath 
>> ---
>>  Documentation/devicetree/bindings/usb/usb-phy.txt |   18 +
>>  drivers/usb/phy/Kconfig   |9 +
>>  drivers/usb/phy/Makefile  |1 +
>>  drivers/usb/phy/omap-usb3.c   |  369 
>> +
>>  include/linux/usb/omap_usb.h  |   72 
>>  5 files changed, 469 insertions(+)
>>  create mode 100644 drivers/usb/phy/omap-usb3.c
>>
>> diff --git a/Documentation/devicetree/bindings/usb/usb-phy.txt 
>> b/Documentation/devicetree/bindings/usb/usb-phy.txt
>> index 80d4148..7c5fd89 100644
>> --- a/Documentation/devicetree/bindings/usb/usb-phy.txt
>> +++ b/Documentation/devicetree/bindings/usb/usb-phy.txt
>> @@ -15,3 +15,21 @@ usb2phy@4a0ad080 {
>>   reg = <0x4a0ad080 0x58>,
>> <0x4a002300 0x4>;
>>  };
>> +
>> +OMAP USB3 PHY
>> +
>> +Required properties:
>> + - compatible: Should be "ti,omap-usb3"
>> + - reg : Address and length of the register set for the device. Also
>> +add the address of control module phy power register until a driver for
>> +control module is added
>> +
>> +This is usually a subnode of ocp2scp to which it is connected.
>> +
>> +usb3phy@4a084400 {
>> + compatible = "ti,omap-usb3";
>> + reg = <0x0x4a084400 0x80>,
>> +   <0x4a084800 0x64>,
>> +   <0x4a084c00 0x40>,
>> +   <0x4a002370 0x4>;
>> +};
>> diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
>> index 63c339b..353dc0c 100644
>> --- a/drivers/usb/phy/Kconfig
>> +++ b/drivers/usb/phy/Kconfig
>> @@ -13,6 +13,15 @@ config OMAP_USB2
>> The USB OTG controller communicates with the comparator using this
>> driver.
>>
>> +config OMAP_USB3
>> + tristate "OMAP USB3 PHY Driver"
>> + select USB_OTG_UTILS
>> + help
>> +   Enable this to support the USB3 PHY that is part of SOC. This
>> +   driver takes care of all the PHY functionality apart from comparator.
>> +   The USB OTG controller communicates with the comparator using this
>> +   driver.
>> +
>>  config USB_ISP1301
>>   tristate "NXP ISP1301 USB transceiver support"
>>   depends on USB || USB_GADGET
>> diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
>> index b069f29..973b1e6 100644
>> --- a/drivers/usb/phy/Makefile
>> +++ b/drivers/usb/phy/Makefile
>> @@ -5,6 +5,7 @@
>>  ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
>>
>>  obj-$(CONFIG_OMAP_USB2)  += omap-usb2.o
>> +obj-$(CONFIG_OMAP_USB3)  += omap-usb3.o
>>  obj-$(CONFIG_USB_ISP1301)+= isp1301.o
>>  obj-$(CONFIG_MV_U3D_PHY) += mv_u3d_phy.o
>>  obj-$(CONFIG_USB_EHCI_TEGRA) += tegra_usb_phy.o
>> diff --git a/drivers/usb/phy/omap-usb3.c b/drivers/usb/phy/omap-usb3.c
>> new file mode 100644
>> index 000..4dc84ca
>> --- /dev/null
>> +++ b/drivers/usb/phy/omap-usb3.c
>> @@ -0,0 +1,369 @@
>> +/*
>> + * omap-usb3 - USB PHY, talking to dwc3 controller in OMAP.
>> + *
>> + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License as published by
>> + * the Free Software Foundation; either version 2 of the License, or
>> + * (at your option) any later version.
>> + *
>> + * Author: Kishon Vijay Abraham I 
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
>> + *
>> + */
>> +
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +
>> +static struct usb_dpll_params omap_usb3_dpll_params[NUM_SYS_CLKS] = {
>> + {1250, 5, 4, 20, 0},/* 12 MHz */
>> + {3125, 20, 4, 20, 0},   /* 16.8 MHz */
>> + {1172, 8, 4, 20, 65537},/* 19.2 MHz */
>> + {1250, 12, 4, 20, 0},   /* 26 MHz */
>> + {3125, 47, 4, 20, 92843},   /* 38.4 MHz */
>> +};
>> +
>> +/**
>> + * omap5_usb_phy_power - power on/off the serializer using control module
>> + * @phy: struct omap_usb *
>> + * @on: 0 to off and 1 to on based on powering on or off the PHY
>> + *
>> + * omap_usb3 can call this API to

Re: [PATCH 01/14] userns: Convert loop to use kuid_t instead of uid_t

2012-09-20 Thread Jens Axboe
On 2012-09-21 02:28, Eric W. Biederman wrote:
> From: "Eric W. Biederman" 
> 
> Cc: Signed-off-by: Jens Axboe 
> Acked-by: Serge Hallyn 
> Signed-off-by: Eric W. Biederman 
> ---
>  drivers/block/loop.c |4 ++--
>  include/linux/loop.h |2 +-
>  init/Kconfig |1 -
>  3 files changed, 3 insertions(+), 4 deletions(-)

Thanks Eric, queued for 3.7.

-- 
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2] pwm_backlight: Add device tree support for Low Threshold Brightness

2012-09-20 Thread Philip, Avinash
Hi Stephen,

On Fri, Sep 21, 2012 at 10:46:45, Stephen Warren wrote:
> On 09/20/2012 10:51 PM, Philip, Avinash wrote:
> > Some backlights perform poorly when driven by a PWM with a short
> > duty-cycle. For such devices, the low threshold can be used to specify a
> > lower bound for the duty-cycle and should be chosen to exclude the
> > problematic range.
> > 
> > This patch adds support for an optional low-threshold-brightness
> > property.
> 
> > diff --git 
> > a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt 
> > b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
> 
> >  Optional properties:
> >- pwm-names: a list of names for the PWM devices specified in the
> > "pwms" property (see PWM binding[0])
> > +  - low-threshold-brightness: brightness threshold low level. Low threshold
> > +brightness set to value so that backlight present on low end of
> > +brightness.
> 
> For my education, why not just specify values above this value in the
> brightness-levels array; how do those two interact?

Please find details from 
https://lkml.org/lkml/2012/7/18/284

Thanks
Avinash

> It seems like any
> description of that is missing from the PWM documentation, and would be
> good to have in the DT binding too.
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/7] dw_dmac: get number of channels from hardware if possible

2012-09-20 Thread viresh kumar
On Thu, Sep 20, 2012 at 3:10 PM, viresh kumar  wrote:
> On Thu, Sep 20, 2012 at 3:05 PM, Andy Shevchenko
>  wrote:
>> On Tue, 2012-09-18 at 12:20 +0530, viresh kumar wrote:
>>> > @@ -1392,23 +1396,32 @@ static int __devinit dw_probe(struct 
>>> > platform_device *pdev)
>>> > +   dw_params = dma_raw_readl(regs, DW_PARAMS);
>>>
>>> Is this valid for every SoC implementation. What if this configuration
>>> is not valid
>>> for a particular SoC and it is invalid to access this address? Or this
>>> gives a invalid
>>> value instead of returning 0?
>
>> Actually I didn't get it clearly from the documentation. We have only
>> one test report from Hein until now.
>
> @Shiraz: Can you please verify reading this register from u-boot? This
> is important before we apply this patch to linux-next.

Ok. I have verified from the documentation. This are valid registers for SPEAr.
@Shiraz: No need to check now. :)

--
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] pwm-backlight: Take over maintenance

2012-09-20 Thread Arun MURTHY
> Signed-off-by: Thierry Reding 
> Cc: Arun Murthy 
> Cc: Matthew Garrett 
> Cc: Robert Morell 
> Cc: Dilan Lee 
> Cc: Axel Lin 
> Cc: Mark Brown 
> Cc: Alexandre Courbot 
> Cc: Sachin Kamat 
> Cc: Andrew Morton 
> ---
> Andrew: As previously discussed this patch makes me the new maintainer
> for the pwm-backlight driver. I contacted Richard Purdie and requested his
> Acked-by for this because he's the backlight subsystem maintainer.
> Unfortunately he hasn't answered yet. Looking at the commit log, every
> commit in the last 2+ years has gone through your tree, which seems to be
> reason enough for me to take over this driver but I still wanted to get an
> Acked-by at least from you so that this doesn't look like hijacking. I've also
> Cc'ed a couple of people that have done work on the driver in the past to
> give them a chance to object or send their Acked-by.

Acked-by: Arun Murthy

I hope now the review process will be fast instead of going through Andrew's
tree.
All the Best!
Now I think I can re-start my pwm core driver thread, since I have a maintainer
for this :-)

Thanks and Regards,
Arun R Murthy
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: tidspbridge: fix return value check in dsp_wdt_init()

2012-09-20 Thread Wei Yongjun
From: Wei Yongjun 

In case of error, the function clk_get() returns ERR_PTR()
and never returns NULL pointer. The NULL test in the error
handling should be replaced with IS_ERR().

dpatch engine is used to auto generated this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 drivers/staging/tidspbridge/core/wdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/tidspbridge/core/wdt.c 
b/drivers/staging/tidspbridge/core/wdt.c
index 870f934..268aba2 100644
--- a/drivers/staging/tidspbridge/core/wdt.c
+++ b/drivers/staging/tidspbridge/core/wdt.c
@@ -61,9 +61,9 @@ int dsp_wdt_init(void)
 
dsp_wdt.fclk = clk_get(NULL, "wdt3_fck");
 
-   if (dsp_wdt.fclk) {
+   if (!IS_ERR(dsp_wdt.fclk)) {
dsp_wdt.iclk = clk_get(NULL, "wdt3_ick");
-   if (!dsp_wdt.iclk) {
+   if (IS_ERR(dsp_wdt.iclk)) {
clk_put(dsp_wdt.fclk);
dsp_wdt.fclk = NULL;
ret = -EFAULT;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ufs: fix return value check in ufs_alloc_lastblock()

2012-09-20 Thread Wei Yongjun
From: Wei Yongjun 

In case of error, the function ufs_get_locked_page() returns ERR_PTR()
or NULL pointer. The IS_ERR() test in the error handling should be
replaced with IS_ERR_OR_NULL().

dpatch engine is used to auto generated this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 fs/ufs/truncate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c
index f04f89f..82426ed 100644
--- a/fs/ufs/truncate.c
+++ b/fs/ufs/truncate.c
@@ -391,7 +391,7 @@ static int ufs_alloc_lastblock(struct inode *inode)
 
lastpage = ufs_get_locked_page(mapping, lastfrag >>
   (PAGE_CACHE_SHIFT - inode->i_blkbits));
-   if (IS_ERR(lastpage)) {
+   if (IS_ERR_OR_NULL(lastpage)) {
err = -EIO;
goto out;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/6] xfrm_user info leaks

2012-09-20 Thread Mathias Krause
On Fri, Sep 21, 2012 at 12:09 AM, David Miller  wrote:
> From: Mathias Krause 
> Date: Wed, 19 Sep 2012 23:33:37 +0200
>
>> the following series fixes various info leaks in the xfrm netlink
>> interface. As always, a test case can be supplied on request.
>>
>> Patches 1 to 5 are probably material for stable, too. Patch 6 is just a
>> minor optimization I stumbled across while auditing the code.
>>
>> Please apply!
>
> All applied, and I made sure to use v3 of patch #5 (which you marked
> as 5/7 instead of 5/6 :-)

Sorry for the confusion. Looks like I've to learn a few more git
tricks, so this won't happen again ;)

> Also, these have been queued up for -stable as well.

Thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/4] perf header: Add struct perf_session_env

2012-09-20 Thread Namhyung Kim
From: Namhyung Kim 

The struct perf_session_env will preserve environment information at
the time of perf record.  It can be accessed anytime after parsing a
perf.data file if needed.

Signed-off-by: Namhyung Kim 
---
 tools/perf/util/header.h | 24 
 1 file changed, 24 insertions(+)

diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
index 209dad4fee2b..99bdd3abce59 100644
--- a/tools/perf/util/header.h
+++ b/tools/perf/util/header.h
@@ -58,6 +58,29 @@ struct perf_header;
 int perf_file_header__read(struct perf_file_header *header,
   struct perf_header *ph, int fd);
 
+struct perf_session_env {
+   char*hostname;
+   char*os_release;
+   char*version;
+   char*arch;
+   int nr_cpus_online;
+   int nr_cpus_avail;
+   char*cpu_desc;
+   char*cpuid;
+   unsigned long long  total_mem;
+
+   int nr_cmdline;
+   char*cmdline;
+   int nr_sibling_cores;
+   char*sibling_cores;
+   int nr_sibling_threads;
+   char*sibling_threads;
+   int nr_numa_nodes;
+   char*numa_nodes;
+   int nr_pmu_mappings;
+   char*pmu_mappings;
+};
+
 struct perf_header {
int frozen;
boolneeds_swap;
@@ -67,6 +90,7 @@ struct perf_header {
u64 event_offset;
u64 event_size;
DECLARE_BITMAP(adds_features, HEADER_FEAT_BITS);
+   struct perf_session_env env;
 };
 
 struct perf_evlist;
-- 
1.7.11.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/4] perf header: Use pre-processed session env when printing

2012-09-20 Thread Namhyung Kim
>From now on each feature information is processed and saved in perf
header so that it can be used for printing.  The event desc and branch
stack features are not touched since they're not saved.

Cc: Stephane Eranian 
Cc: Robert Richter 
Signed-off-by: Namhyung Kim 
---
 tools/perf/util/header.c | 279 +--
 1 file changed, 102 insertions(+), 177 deletions(-)

diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 65659c1f8f53..05a6cf532891 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1103,118 +1103,80 @@ static int write_branch_stack(int fd __maybe_unused,
return 0;
 }
 
-static void print_hostname(struct perf_header *ph, int fd, FILE *fp)
+static void print_hostname(struct perf_header *ph, int fd __maybe_unused,
+  FILE *fp)
 {
-   char *str = do_read_string(fd, ph);
-   fprintf(fp, "# hostname : %s\n", str);
-   free(str);
+   fprintf(fp, "# hostname : %s\n", ph->env.hostname);
 }
 
-static void print_osrelease(struct perf_header *ph, int fd, FILE *fp)
+static void print_osrelease(struct perf_header *ph, int fd __maybe_unused,
+   FILE *fp)
 {
-   char *str = do_read_string(fd, ph);
-   fprintf(fp, "# os release : %s\n", str);
-   free(str);
+   fprintf(fp, "# os release : %s\n", ph->env.os_release);
 }
 
-static void print_arch(struct perf_header *ph, int fd, FILE *fp)
+static void print_arch(struct perf_header *ph, int fd __maybe_unused, FILE *fp)
 {
-   char *str = do_read_string(fd, ph);
-   fprintf(fp, "# arch : %s\n", str);
-   free(str);
+   fprintf(fp, "# arch : %s\n", ph->env.arch);
 }
 
-static void print_cpudesc(struct perf_header *ph, int fd, FILE *fp)
+static void print_cpudesc(struct perf_header *ph, int fd __maybe_unused,
+ FILE *fp)
 {
-   char *str = do_read_string(fd, ph);
-   fprintf(fp, "# cpudesc : %s\n", str);
-   free(str);
+   fprintf(fp, "# cpudesc : %s\n", ph->env.cpu_desc);
 }
 
-static void print_nrcpus(struct perf_header *ph, int fd, FILE *fp)
+static void print_nrcpus(struct perf_header *ph, int fd __maybe_unused,
+FILE *fp)
 {
-   ssize_t ret;
-   u32 nr;
-
-   ret = read(fd, &nr, sizeof(nr));
-   if (ret != (ssize_t)sizeof(nr))
-   nr = -1; /* interpreted as error */
-
-   if (ph->needs_swap)
-   nr = bswap_32(nr);
-
-   fprintf(fp, "# nrcpus online : %u\n", nr);
-
-   ret = read(fd, &nr, sizeof(nr));
-   if (ret != (ssize_t)sizeof(nr))
-   nr = -1; /* interpreted as error */
-
-   if (ph->needs_swap)
-   nr = bswap_32(nr);
-
-   fprintf(fp, "# nrcpus avail : %u\n", nr);
+   fprintf(fp, "# nrcpus online : %u\n", ph->env.nr_cpus_online);
+   fprintf(fp, "# nrcpus avail : %u\n", ph->env.nr_cpus_avail);
 }
 
-static void print_version(struct perf_header *ph, int fd, FILE *fp)
+static void print_version(struct perf_header *ph, int fd __maybe_unused,
+ FILE *fp)
 {
-   char *str = do_read_string(fd, ph);
-   fprintf(fp, "# perf version : %s\n", str);
-   free(str);
+   fprintf(fp, "# perf version : %s\n", ph->env.version);
 }
 
-static void print_cmdline(struct perf_header *ph, int fd, FILE *fp)
+static void print_cmdline(struct perf_header *ph, int fd __maybe_unused,
+ FILE *fp)
 {
-   ssize_t ret;
+   int nr, i;
char *str;
-   u32 nr, i;
-
-   ret = read(fd, &nr, sizeof(nr));
-   if (ret != (ssize_t)sizeof(nr))
-   return;
 
-   if (ph->needs_swap)
-   nr = bswap_32(nr);
+   nr = ph->env.nr_cmdline;
+   str = ph->env.cmdline;
 
fprintf(fp, "# cmdline : ");
 
for (i = 0; i < nr; i++) {
-   str = do_read_string(fd, ph);
fprintf(fp, "%s ", str);
-   free(str);
+   str += strlen(str) + 1;
}
fputc('\n', fp);
 }
 
-static void print_cpu_topology(struct perf_header *ph, int fd, FILE *fp)
+static void print_cpu_topology(struct perf_header *ph, int fd __maybe_unused,
+  FILE *fp)
 {
-   ssize_t ret;
-   u32 nr, i;
+   int nr, i;
char *str;
 
-   ret = read(fd, &nr, sizeof(nr));
-   if (ret != (ssize_t)sizeof(nr))
-   return;
-
-   if (ph->needs_swap)
-   nr = bswap_32(nr);
+   nr = ph->env.nr_sibling_cores;
+   str = ph->env.sibling_cores;
 
for (i = 0; i < nr; i++) {
-   str = do_read_string(fd, ph);
fprintf(fp, "# sibling cores   : %s\n", str);
-   free(str);
+   str += strlen(str) + 1;
}
 
-   ret = read(fd, &nr, sizeof(nr));
-   if (ret != (ssize_t)sizeof(nr))
-   return;
-
-   if (ph->needs_swap)
-   nr = bswap_32(nr);
+   nr = ph

[PATCH 4/4] perf header: Remove unused @feat arg from ->process callback

2012-09-20 Thread Namhyung Kim
From: Namhyung Kim 

As the @feat arg is not used anywhere, get rid of it from the signature.

Cc: Stephane Eranian 
Cc: Robert Richter 
Signed-off-by: Namhyung Kim 
---
 tools/perf/util/header.c | 70 
 1 file changed, 35 insertions(+), 35 deletions(-)

diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 05a6cf532891..6aae3290358e 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1580,18 +1580,16 @@ out:
return err;
 }
 
-static int process_tracing_data(struct perf_file_section *section
-   __maybe_unused,
- struct perf_header *ph __maybe_unused,
- int feat __maybe_unused, int fd, void *data)
+static int process_tracing_data(struct perf_file_section *section 
__maybe_unused,
+   struct perf_header *ph __maybe_unused,
+   int fd, void *data)
 {
trace_report(fd, data, false);
return 0;
 }
 
 static int process_build_id(struct perf_file_section *section,
-   struct perf_header *ph,
-   int feat __maybe_unused, int fd,
+   struct perf_header *ph, int fd,
void *data __maybe_unused)
 {
if (perf_header__read_build_ids(ph, fd, section->offset, section->size))
@@ -1600,40 +1598,40 @@ static int process_build_id(struct perf_file_section 
*section,
 }
 
 static int process_hostname(struct perf_file_section *section __maybe_unused,
-   struct perf_header *ph, int feat __maybe_unused,
-   int fd, void *data __maybe_unused)
+   struct perf_header *ph, int fd,
+   void *data __maybe_unused)
 {
ph->env.hostname = do_read_string(fd, ph);
return ph->env.hostname ? 0 : -ENOMEM;
 }
 
 static int process_osrelease(struct perf_file_section *section __maybe_unused,
-struct perf_header *ph, int feat __maybe_unused,
-int fd, void *data __maybe_unused)
+struct perf_header *ph, int fd,
+void *data __maybe_unused)
 {
ph->env.os_release = do_read_string(fd, ph);
return ph->env.os_release ? 0 : -ENOMEM;
 }
 
 static int process_version(struct perf_file_section *section __maybe_unused,
-  struct perf_header *ph, int feat __maybe_unused,
-  int fd, void *data __maybe_unused)
+  struct perf_header *ph, int fd,
+  void *data __maybe_unused)
 {
ph->env.version = do_read_string(fd, ph);
return ph->env.version ? 0 : -ENOMEM;
 }
 
 static int process_arch(struct perf_file_section *section __maybe_unused,
-   struct perf_header *ph, int feat __maybe_unused,
-   int fd, void *data __maybe_unused)
+   struct perf_header *ph, int fd,
+   void *data __maybe_unused)
 {
ph->env.arch = do_read_string(fd, ph);
return ph->env.arch ? 0 : -ENOMEM;
 }
 
 static int process_nrcpus(struct perf_file_section *section __maybe_unused,
- struct perf_header *ph, int feat __maybe_unused,
- int fd, void *data __maybe_unused)
+ struct perf_header *ph, int fd,
+ void *data __maybe_unused)
 {
size_t ret;
u32 nr;
@@ -1659,24 +1657,24 @@ static int process_nrcpus(struct perf_file_section 
*section __maybe_unused,
 }
 
 static int process_cpudesc(struct perf_file_section *section __maybe_unused,
-  struct perf_header *ph, int feat __maybe_unused,
-  int fd, void *data __maybe_unused)
+  struct perf_header *ph, int fd,
+  void *data __maybe_unused)
 {
ph->env.cpu_desc = do_read_string(fd, ph);
return ph->env.cpu_desc ? 0 : -ENOMEM;
 }
 
 static int process_cpuid(struct perf_file_section *section __maybe_unused,
-struct perf_header *ph, int feat __maybe_unused,
-int fd, void *data __maybe_unused)
+struct perf_header *ph,  int fd,
+void *data __maybe_unused)
 {
ph->env.cpuid = do_read_string(fd, ph);
return ph->env.cpuid ? 0 : -ENOMEM;
 }
 
 static int process_total_mem(struct perf_file_section *section __maybe_unused,
-struct perf_header *ph, int feat __maybe_unused,
-int fd, void *data __maybe_unused)
+struct perf_header *ph, int fd,
+void *data __maybe_unused)
 {
uint64_t mem;
size_t ret;
@@ -1706,7 +1704,8 @@ perf_evlist_

[PATCH 0/4] perf header: Save and reuse feature information in header (v4)

2012-09-20 Thread Namhyung Kim
Hi,

Currently the perf header information is used only at initial setup
time and discarded.  If it's saved we could reuse the information for
various purpose in the future.

Thanks,
Namhyung


v3 -> v4:
 * rename perf_header_info to perf_session_env (Arnaldo)

v2 -> v3:
 * patch 1-3 in v2 merged into tip
 * rebased on current acme/perf/core

v1 -> v2:
 * not touch EVENT_DESC feature handling
 * split out struct perf_header_info
 * simplify multi-string handling
 * add some cleanup patches

Namhyung Kim (4):
  perf header: Add struct perf_session_env
  perf header: Add ->process callbacks to most of features
  perf header: Use pre-processed session env when printing
  perf header: Remove unused @feat arg from ->process callback

 tools/perf/util/header.c | 547 +--
 tools/perf/util/header.h |  24 +++
 2 files changed, 408 insertions(+), 163 deletions(-)

-- 
1.7.11.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/4] perf header: Add ->process callbacks to most of features

2012-09-20 Thread Namhyung Kim
>From now on each feature information is processed and saved in perf
header so that it can be used wherever needed.  The BRANCH_STACK
feature is an exception since it needs nothing to be done.

Cc: Stephane Eranian 
Cc: Robert Richter 
Signed-off-by: Namhyung Kim 
---
 tools/perf/util/header.c | 318 +--
 1 file changed, 307 insertions(+), 11 deletions(-)

diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index acbf6336199e..65659c1f8f53 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -22,6 +22,7 @@
 #include "cpumap.h"
 #include "pmu.h"
 #include "vdso.h"
+#include "strbuf.h"
 
 static bool no_buildid_cache = false;
 
@@ -1673,6 +1674,99 @@ static int process_build_id(struct perf_file_section 
*section,
return 0;
 }
 
+static int process_hostname(struct perf_file_section *section __unused,
+   struct perf_header *ph,
+   int feat __unused, int fd, void *data __used)
+{
+   ph->env.hostname = do_read_string(fd, ph);
+   return ph->env.hostname ? 0 : -ENOMEM;
+}
+
+static int process_osrelease(struct perf_file_section *section __unused,
+struct perf_header *ph,
+int feat __unused, int fd, void *data __used)
+{
+   ph->env.os_release = do_read_string(fd, ph);
+   return ph->env.os_release ? 0 : -ENOMEM;
+}
+
+static int process_version(struct perf_file_section *section __unused,
+  struct perf_header *ph,
+  int feat __unused, int fd, void *data __used)
+{
+   ph->env.version = do_read_string(fd, ph);
+   return ph->env.version ? 0 : -ENOMEM;
+}
+
+static int process_arch(struct perf_file_section *section __unused,
+   struct perf_header *ph,
+   int feat __unused, int fd, void *data __used)
+{
+   ph->env.arch = do_read_string(fd, ph);
+   return ph->env.arch ? 0 : -ENOMEM;
+}
+
+static int process_nrcpus(struct perf_file_section *section __unused,
+ struct perf_header *ph,
+ int feat __unused, int fd, void *data __used)
+{
+   size_t ret;
+   u32 nr;
+
+   ret = read(fd, &nr, sizeof(nr));
+   if (ret != sizeof(nr))
+   return -1;
+
+   if (ph->needs_swap)
+   nr = bswap_32(nr);
+
+   ph->env.nr_cpus_online = nr;
+
+   ret = read(fd, &nr, sizeof(nr));
+   if (ret != sizeof(nr))
+   return -1;
+
+   if (ph->needs_swap)
+   nr = bswap_32(nr);
+
+   ph->env.nr_cpus_avail = nr;
+   return 0;
+}
+
+static int process_cpudesc(struct perf_file_section *section __unused,
+  struct perf_header *ph,
+  int feat __unused, int fd, void *data __used)
+{
+   ph->env.cpu_desc = do_read_string(fd, ph);
+   return ph->env.cpu_desc ? 0 : -ENOMEM;
+}
+
+static int process_cpuid(struct perf_file_section *section __unused,
+struct perf_header *ph,
+int feat __unused, int fd, void *data __used)
+{
+   ph->env.cpuid = do_read_string(fd, ph);
+   return ph->env.cpuid ? 0 : -ENOMEM;
+}
+
+static int process_total_mem(struct perf_file_section *section __unused,
+struct perf_header *ph,
+int feat __unused, int fd, void *data __used)
+{
+   uint64_t mem;
+   size_t ret;
+
+   ret = read(fd, &mem, sizeof(mem));
+   if (ret != sizeof(mem))
+   return -1;
+
+   if (ph->needs_swap)
+   mem = bswap_64(mem);
+
+   ph->env.total_mem = mem;
+   return 0;
+}
+
 static struct perf_evsel *
 perf_evlist__find_by_index(struct perf_evlist *evlist, int idx)
 {
@@ -1723,6 +1817,208 @@ process_event_desc(struct perf_file_section *section 
__maybe_unused,
return 0;
 }
 
+static int process_cmdline(struct perf_file_section *section __unused,
+  struct perf_header *ph,
+  int feat __unused, int fd, void *data __used)
+{
+   size_t ret;
+   char *str;
+   u32 nr, i;
+   struct strbuf sb;
+
+   ret = read(fd, &nr, sizeof(nr));
+   if (ret != sizeof(nr))
+   return -1;
+
+   if (ph->needs_swap)
+   nr = bswap_32(nr);
+
+   ph->env.nr_cmdline = nr;
+   strbuf_init(&sb, 128);
+
+   for (i = 0; i < nr; i++) {
+   str = do_read_string(fd, ph);
+   if (!str)
+   goto error;
+
+   /* include a NULL character at the end */
+   strbuf_add(&sb, str, strlen(str) + 1);
+   free(str);
+   }
+   ph->env.cmdline = strbuf_detach(&sb, NULL);
+   return 0;
+
+error:
+   strbuf_release(&sb);
+   return -1;
+}
+
+static int process_cpu_topology(struct perf_file_section *section __unused,
+  

Re: [PATCH 0/5] charger-manager: Update charger-manager to support various charging conditions

2012-09-20 Thread Anton Vorontsov
On Tue, Aug 21, 2012 at 05:05:59PM +0900, Chanwoo Choi wrote:
[...]
> Chanwoo Choi (5):
>   charger-manager: Disable battery charging when charger cable is
> detached
>   charger-manager: Use replacement variable to check state of battery
>   charger-manager: Add support sysfs entry for charger
>   charger-manager: Check fully charged state of battery periodically
>   charger-manager: Support limit of maximum possible duration for
> charging/discharging

Thanks a lot for your work!

Patches 1-2 and 4-5 applied. Patch 3 failed to build, so I guess
it will need some fixes and resend.

Cheers,
Anton.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] pwm_backlight: Add device tree support for Low Threshold Brightness

2012-09-20 Thread Stephen Warren
On 09/20/2012 10:51 PM, Philip, Avinash wrote:
> Some backlights perform poorly when driven by a PWM with a short
> duty-cycle. For such devices, the low threshold can be used to specify a
> lower bound for the duty-cycle and should be chosen to exclude the
> problematic range.
> 
> This patch adds support for an optional low-threshold-brightness
> property.

> diff --git 
> a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt 
> b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt

>  Optional properties:
>- pwm-names: a list of names for the PWM devices specified in the
> "pwms" property (see PWM binding[0])
> +  - low-threshold-brightness: brightness threshold low level. Low threshold
> +brightness set to value so that backlight present on low end of
> +brightness.

For my education, why not just specify values above this value in the
brightness-levels array; how do those two interact? It seems like any
description of that is missing from the PWM documentation, and would be
good to have in the DT binding too.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/5] charger-manager: Add support sysfs entry for charger

2012-09-20 Thread Anton Vorontsov
On Tue, Aug 21, 2012 at 05:06:49PM +0900, Chanwoo Choi wrote:
> This patch add support sysfs entry for each charger(regulator).
> Charger-manager use one or more chargers for charging battery but
> some charger isn't necessary on specific scenario. So, if some charger
> isn't needed, can disable specific charger through 'externally_control'
> entry while system is on state and confirm the information(name, state)
> of charger.
> 
> the list of added sysfs entry
> - /sys/class/power_supply/battery/chargers/charger.[index]/name
> : show name of charger(regulator)
> - /sys/class/power_supply/battery/chargers/charger.[index]/state
> : show either enabled or disabled state of charger
> - /sys/class/power_supply/battery/chargers/charger.[index]/externally_control

The API looks sane.

For the future, you might want to get rid of the 'name', and instead
just point to a regulator device (via a sysfs symlink). I.e.

/sys/class/power_supply/battery/chargers/charger.[index]/device
would be a symlink to the regulator device.

But for the time being, I guess it's OK as is (although I wouldn't
mind if it'll use the symlink from the start. :-)

[...]
>   for (j = 0 ; j < charger->num_cables ; j++) {
>   struct charger_cable *cable = &charger->cables[j];
> @@ -1287,6 +1386,71 @@ static int charger_manager_probe(struct 
> platform_device *pdev)
>   cable->charger = charger;
>   cable->cm = cm;
>   }
> +
[...]
> + charger->attr_g.attrs = charger->attrs;
> +
> + sysfs_attr_init(&cable->attr_name.attr);

Notice that 'cable' is declared in the 'for' loop above,
so this doesn't compile for me:

  CHECK   drivers/power/charger-manager.c
drivers/power/charger-manager.c:1559:17: error: undefined identifier 'cable'
drivers/power/charger-manager.c:1564:17: error: undefined identifier 'cable'
drivers/power/charger-manager.c:1569:17: error: undefined identifier 'cable'
  CC  drivers/power/charger-manager.o
drivers/power/charger-manager.c: In function ‘charger_manager_probe’:
drivers/power/charger-manager.c:1559:3: error: ‘cable’ undeclared (first use in 
this function)
drivers/power/charger-manager.c:1559:3: note: each undeclared identifier is 
reported only once for each function it appears in
make[1]: *** [drivers/power/charger-manager.o] Error 1

Also:
- Please adhere to the codingstyle, there should be no spaces
  before ';' in the for loop statement.
- If possible, please consider splitting _probe routine, it is more
  than 300 lines long nowadays.

Thanks,
Anton.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 4/5] charger-manager: Check fully charged state of battery periodically

2012-09-20 Thread Anton Vorontsov
On Tue, Aug 21, 2012 at 05:06:52PM +0900, Chanwoo Choi wrote:
> This patch check periodically fully charged state of battery to protect
> overcharge and overheat. If battery is fully charged, stop charging
> and check droped voltage with 'fullbatt_vchkdrop_ms' period. When voltage
> of battery is more droped than 'fullbatt_vchkdrop_uV' voltage,
> charger-manager will restart charging for battery.
> 
> Signed-off-by: Chanwoo Choi 
> Signed-off-by: Myungjoo Ham 
> Signed-off-by: Kyungmin Park 
> ---

Applied, thank you.

There were some minor issues, but I fixed them up:

[...]
> + } else if (!cm->emergency_stop
> + && is_ext_pwr_online(cm) && !cm->charger_enabled) {

Wrong && placement (should have been on the previous line).

> + fullbatt_vchk(&cm->fullbatt_vchk_work.work);
> +
> + /*
> +  * Check whether fully charged state to protect overcharge
> +  * if charger-manager is charging for battery.
> +  */
> + } else if (!cm->emergency_stop
> + && is_full_charged(cm) && cm->charger_enabled) {

Ditto.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 5/5] charger-manager: Support limit of maximum possible duration for charging/discharging

2012-09-20 Thread Anton Vorontsov
On Tue, Aug 21, 2012 at 05:06:57PM +0900, Chanwoo Choi wrote:
> This patch check maximum possible duration of charging/discharging.
> 
> If whole charging duration exceed 'desc->charging_max_duration_ms',
> cm stop charging to prevent overcharge/overheat. And if discharging
> duration exceed, charger cable is attached, after full-batt,
> cm start charging to maintain fully charged state for battery.
> 
> Signed-off-by: Chanwoo Choi 
> Signed-off-by: Myungjoo Ham 
> Signed-off-by: Kyungmin Park 
> ---

Applied, thanks!

But fyi:

[...]
> + if (!desc->charging_max_duration_ms
> + && !desc->discharging_max_duration_ms)

&& should have been on the previous line, plus the second line
should have been indented with one more tab. I fixed it up.

[...]
> + if (!desc->charging_max_duration_ms
> + || !desc->discharging_max_duration_ms) {

Ditto.

> + dev_info(&pdev->dev, "Cannot limit charging duration"
> + " checking mechanism to prevent "
> + " overcharge/overheat and control"

Thanks,
Anton.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] pwm_backlight: Add device tree support for Low Threshold Brightness

2012-09-20 Thread Philip, Avinash
Some backlights perform poorly when driven by a PWM with a short
duty-cycle. For such devices, the low threshold can be used to specify a
lower bound for the duty-cycle and should be chosen to exclude the
problematic range.

This patch adds support for an optional low-threshold-brightness
property.

Signed-off-by: Philip, Avinash 
---
Changes since v1:
- Updated commit message.
- Changes to low-threshold-brightness.
- Merged example section to original.

:100644 100644 1e4fc72... 5baebff... M  
Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
:100644 100644 995f016... 29e6fe1... M  drivers/video/backlight/pwm_bl.c
 .../bindings/video/backlight/pwm-backlight.txt |4 
 drivers/video/backlight/pwm_bl.c   |5 +
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git 
a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt 
b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
index 1e4fc72..5baebff 100644
--- a/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
+++ b/Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
@@ -14,6 +14,9 @@ Required properties:
 Optional properties:
   - pwm-names: a list of names for the PWM devices specified in the
"pwms" property (see PWM binding[0])
+  - low-threshold-brightness: brightness threshold low level. Low threshold
+brightness set to value so that backlight present on low end of
+brightness.
 
 [0]: Documentation/devicetree/bindings/pwm/pwm.txt
 
@@ -25,4 +28,5 @@ Example:
 
brightness-levels = <0 4 8 16 32 64 128 255>;
default-brightness-level = <6>;
+   low-threshold-brightness = <50>;
};
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 995f016..29e6fe1 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -143,6 +143,11 @@ static int pwm_backlight_parse_dt(struct device *dev,
 
data->dft_brightness = value;
data->max_brightness--;
+
+   ret = of_property_read_u32(node, "low-threshold-brightness",
+  &value);
+   if (!ret)
+   data->lth_brightness = value;
}
 
/*
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)

2012-09-20 Thread Thanasis
on 09/21/2012 02:20 AM Francois Romieu wrote the following:

> 
> Thanasis, can you narrow down a bit the failing revision ?

Sure, let me know how to do it please.
FWIW , attached full lspci -k output.

00:00.0 Host bridge: Intel Corporation Mobile 945GSE Express Memory Controller 
Hub (rev 03)
Subsystem: Acer Incorporated [ALI] Device 015b
Kernel driver in use: agpgart-intel
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GSE Express 
Integrated Graphics Controller (rev 03)
Subsystem: Acer Incorporated [ALI] Device 015b
Kernel driver in use: i915
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML 
Express Integrated Graphics Controller (rev 03)
Subsystem: Acer Incorporated [ALI] Device 015b
00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio 
Controller (rev 02)
Subsystem: Acer Incorporated [ALI] Device 015b
Kernel driver in use: HDA Intel
00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 
02)
Kernel driver in use: pcieport
00:1c.1 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 2 (rev 
02)
Kernel driver in use: pcieport
00:1c.2 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 3 (rev 
02)
Kernel driver in use: pcieport
00:1c.3 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 4 (rev 
02)
Kernel driver in use: pcieport
00:1d.0 USB controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller 
#1 (rev 02)
Subsystem: Acer Incorporated [ALI] Device 015b
Kernel driver in use: uhci_hcd
00:1d.1 USB controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller 
#2 (rev 02)
Subsystem: Acer Incorporated [ALI] Device 015b
Kernel driver in use: uhci_hcd
00:1d.2 USB controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller 
#3 (rev 02)
Subsystem: Acer Incorporated [ALI] Device 015b
Kernel driver in use: uhci_hcd
00:1d.3 USB controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller 
#4 (rev 02)
Subsystem: Acer Incorporated [ALI] Device 015b
Kernel driver in use: uhci_hcd
00:1d.7 USB controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller 
(rev 02)
Subsystem: Acer Incorporated [ALI] Device 015b
Kernel driver in use: ehci_hcd
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge 
(rev 02)
Subsystem: Acer Incorporated [ALI] Device 015b
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7-M Family) SATA 
Controller [IDE mode] (rev 02)
Subsystem: Acer Incorporated [ALI] Device 015b
Kernel driver in use: ata_piix
00:1f.3 SMBus: Intel Corporation N10/ICH 7 Family SMBus Controller (rev 02)
Subsystem: Acer Incorporated [ALI] Device 015b
Kernel driver in use: i801_smbus
01:00.0 System peripheral: JMicron Technology Corp. SD/MMC Host Controller
Subsystem: Acer Incorporated [ALI] Device 015b
Kernel driver in use: sdhci-pci
01:00.2 SD Host controller: JMicron Technology Corp. Standard SD Host Controller
Subsystem: Acer Incorporated [ALI] Device 015b
01:00.3 System peripheral: JMicron Technology Corp. MS Host Controller
Subsystem: Acer Incorporated [ALI] Device 015b
Kernel driver in use: jmb38x_ms
01:00.4 System peripheral: JMicron Technology Corp. xD Host Controller
Subsystem: Acer Incorporated [ALI] Device 015b
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E 
PCI Express Fast Ethernet controller (rev 02)
Subsystem: Acer Incorporated [ALI] Device 015b
Kernel driver in use: r8169
03:00.0 Ethernet controller: Atheros Communications Inc. AR242x / AR542x 
Wireless Network Adapter (PCI-Express) (rev 01)
Subsystem: Foxconn International, Inc. Device e008
Kernel driver in use: ath5k
04:00.0 System peripheral: JMicron Technology Corp. SD/MMC Host Controller
Subsystem: Acer Incorporated [ALI] Device 015b
Kernel driver in use: sdhci-pci
04:00.2 SD Host controller: JMicron Technology Corp. Standard SD Host Controller
Subsystem: Acer Incorporated [ALI] Device 015b
04:00.3 System peripheral: JMicron Technology Corp. MS Host Controller
Subsystem: Acer Incorporated [ALI] Device 015b
Kernel driver in use: jmb38x_ms
04:00.4 System peripheral: JMicron Technology Corp. xD Host Controller
Subsystem: Acer Incorporated [ALI] Device 015b


RE: [RFC/PATCH 2/2] block: Adding ROW scheduling algorithm

2012-09-20 Thread Tanya Brokhman
Hi Jan

> There seems to a bug with ROW. After about 43 hours of continued
> operation, programs (./configure was what I ran at the time this
> happened) first become slow, then got stuck in D state within a minute.
Ctrl-
> C/Z worked at first, soon not, then these messages appeared in dmesg.
> 
> [319952.630605] row: forced dispatching is broken (nr_sorted=17), please
> report this [319952.631174] row: forced dispatching is broken
(nr_sorted=17),
> please report this

Thank you very much for reporting this! 
We're now at the testing phase as well. We didn't encounter the bug you
observed but I'll look into it. Thanks again.

Thanks,
Tanya Brokhman
---
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] hppfs: fix the return value of get_inode()

2012-09-20 Thread Wei Yongjun
From: Wei Yongjun 

In case of error, the function get_inode() returns ERR_PTR().
But the users hppfs_lookup() and hppfs_fill_super() use NULL
test for check the return value, not IS_ERR(), so we'd better
change the return value of get_inode() to NULL instead of
ERR_PTR().

dpatch engine is used to generated this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun 
---
 fs/hppfs/hppfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c
index c1dffe4..31b1e85 100644
--- a/fs/hppfs/hppfs.c
+++ b/fs/hppfs/hppfs.c
@@ -674,7 +674,7 @@ static struct inode *get_inode(struct super_block *sb, 
struct dentry *dentry)
 
if (!inode) {
dput(dentry);
-   return ERR_PTR(-ENOMEM);
+   return NULL;
}
 
if (S_ISDIR(dentry->d_inode->i_mode)) {


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] pwm_backlight: Add device tree support for Low Threshold Brightness

2012-09-20 Thread Philip, Avinash
On Wed, Sep 19, 2012 at 12:14:25, Thierry Reding wrote:
> On Wed, Aug 01, 2012 at 06:51:21AM +, Philip, Avinash wrote:
> > On Mon, Jul 30, 2012 at 12:28:05, Thierry Reding wrote:
> > > On Wed, Jul 25, 2012 at 05:54:02PM +0530, Philip, Avinash wrote:
> > > > Low Threshold Brightness should be configured to have a linear relation
> > > > in brightness scale. This patch adds device tree support for low
> > > > threshold brightness as optional one for pwm_backlight.
> > > 
> > > I think this should be more explicit as to why this is required, perhaps
> > > something like this:
> > > 
> > >   Some backlights perform poorly when driven by a PWM with a short
> > >   duty-cycle. For such devices, the low threshold can be used to
> > >   specify a lower bound for the duty-cycle and should be chosen to
> > >   exclude the problematic range.
> > > 
> > >   This patch adds support for an optional low-threshold-brightness
> > >   property.
[snip]
> 
> I think you never sent an updated patch or maybe I missed it. But I
> noticed that this patch has now ended up in Andrew's tree without the
> comments being addressed. Can you please follow up?

I will send a revised patch.

Thanks
Avinash

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 23/26] raid1: use bio_alloc_pages()

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 05:48:27PM -0700, Tejun Heo wrote:
> On Mon, Sep 10, 2012 at 05:22:34PM -0700, Kent Overstreet wrote:
> > Signed-off-by: Kent Overstreet 
> > CC: Jens Axboe 
> > CC: NeilBrown 
> 
> I think it's better to merge this and the previous patch.  It's not
> like we're converting a lot of users.

Ok, will do.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2] smb347_charger: fix battery status reporting logic for charger faults

2012-09-20 Thread Pallala, Ramakrishna
> On Wed, Sep 19, 2012 at 10:37:34AM +0300, Mika Westerberg wrote:
> > On Tue, Sep 18, 2012 at 09:58:07PM +0530, Ramakrishna Pallala wrote:
> > > This patch checks for charger status register for determining the
> > > battery charging status and reports Discharing/Charging/Not
> > > Charging/Full accordingly.
> > >
> > > This patch also adds the interrupt support for Safety Timer Expiration.
> > > This interrupt is helpful in debugging the cause for charger fault.
> > >
> > > Resending this patch because previous patch missed Anton's attention
> 
> Not that it missed my attention, it's just that I'm in "apply-mode"
> only 3-4 times per dev cycle. So, patches may lay in my "battery"
> folder for some time.
> 
> That's mostly because I have somewhat limited time, but also that way I can
> collect Acks and give other folks a chance to take a look at the patches.  :-)
> 
> But if you suspect the patch missed my attention (which also happens
> sometimes), it's totally fine to resend it or ping me, as you did.
> 
> > > Signed-off-by: Ramakrishna Pallala 
> >
> > Acked-by: Mika Westerberg 
> 
> Applied, thank you guys!

Got it Thanks :-)


Re: [PATCH v2 22/26] block: Add bio_alloc_pages()

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 05:47:11PM -0700, Tejun Heo wrote:
> On Mon, Sep 10, 2012 at 05:22:33PM -0700, Kent Overstreet wrote:
> > +   bio_for_each_segment_all(bv, bio, i) {
> > +   bv->bv_page = alloc_page(gfp_mask);
> > +   if (!bv->bv_page) {
> > +   while (bv-- != bio->bi_io_vec)
> > +   __free_page(bv->bv_page);
> 
> I don't know.  I feel stupid.  I think it's because the loop variable
> changes between loop condition test and actual body of loop.  How
> about the following?  It is pointing to the member of the same array
> so I think it's not even violating pointer comparison rules.
> 
>   while (--bv >= bio->bi_io_vec)
>   __free_page(bv->bv_page);

I can't remember why I did it that way, but I think I like yours better
- I'll change it.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 15/16] memcg/sl[au]b: shrink dead caches

2012-09-20 Thread JoonSoo Kim
Hi Glauber.

2012/9/18 Glauber Costa :
> diff --git a/mm/slub.c b/mm/slub.c
> index 0b68d15..9d79216 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -2602,6 +2602,7 @@ redo:
> } else
> __slab_free(s, page, x, addr);
>
> +   kmem_cache_verify_dead(s);
>  }

As far as u know, I am not a expert and don't know anything about memcg.
IMHO, this implementation may hurt system performance in some case.

In case of memcg is destoried, remained kmem_cache is marked "dead".
After it is marked,
every free operation to this "dead" kmem_cache call
kmem_cache_verify_dead() and finally call kmem_cache_shrink().
kmem_cache_shrink() do invoking kmalloc and flush_all() and taking a
lock for online node and invoking kfree.
Especially, flush_all() may hurt performance largely, because it call
has_cpu_slab() against all the cpus.

And I know some other case it can hurt system performance.
But, I don't mention it, because above case is sufficient to worry.

And, I found one case that destroying memcg's kmem_cache don't works properly.
If we destroy memcg after all object is freed, current implementation
doesn't destroy kmem_cache.
kmem_cache_destroy_work_func() check "cachep->memcg_params.nr_pages == 0",
but in this case, it return false, because kmem_cache may have
cpu_slab, and cpu_partials_slabs.
As we already free all objects, kmem_cache_verify_dead() is not invoked forever.
I think that we need another kmem_cache_shrink() in
kmem_cache_destroy_work_func().

I don't convince that I am right, so think carefully my humble opinion.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC/PATCH 2/2] block: Adding ROW scheduling algorithm

2012-09-20 Thread Jan Engelhardt

On Wednesday 2012-09-19 07:29, Jan Engelhardt wrote:
>On Monday 2012-08-06 18:35, Jeff Moyer wrote:
>>Tatyana Brokhman writes:
>>
>>> This patch adds the implementation of a new scheduling algorithm - ROW.
>>> The policy of this algorithm is to prioritize READ requests over WRITE
>>> as much as possible without starving the WRITE requests.
>>
>>Perhaps you could start off by describing the workload, and describing
>>why the existing I/O schedulers do not perform well.

There seems to a bug with ROW. After about 43 hours of continued
operation, programs (./configure was what I ran at the time this
happened) first become slow, then got stuck in D state within a
minute. Ctrl-C/Z worked at first, soon not, then these messages
appeared in dmesg.

[319952.630605] row: forced dispatching is broken (nr_sorted=17), please report
this
[319952.631174] row: forced dispatching is broken (nr_sorted=17), please report
this
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/4] perf tools: configure shell path at compile time

2012-09-20 Thread David Ahern

On 9/20/12 4:13 PM, Irina Tirdea wrote:

From: Irina Tirdea 

Shell path /bin/sh is hardcoded in various places in perf. Android has a
different folder structure and does not have /bin/sh.

Set the shell path at compile time in the Makefile by setting PERF_SHELL_PATH.
By default it is set to /bin/sh.


code change below uses PERF_SHELL_DIR; it's not a directory so 
PERF_SHELL_PATH per the above comment is better.


David




Signed-off-by: Irina Tirdea 
---
  tools/perf/Makefile |6 +-
  tools/perf/builtin-help.c   |2 +-
  tools/perf/builtin-script.c |   12 ++--
  3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index eab4a36..9021a1f 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -828,7 +828,11 @@ $(OUTPUT)builtin-help.o: builtin-help.c 
$(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFL
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
'-DPERF_HTML_PATH="$(htmldir_SQ)"' \
'-DPERF_MAN_PATH="$(mandir_SQ)"' \
-   '-DPERF_INFO_PATH="$(infodir_SQ)"' $<
+   '-DPERF_INFO_PATH="$(infodir_SQ)"' \
+   '-DPERF_SHELL_DIR="/bin/sh"' $<
+
+$(OUTPUT)builtin-script.o: builtin-script.c $(OUTPUT)PERF-CFLAGS
+   $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DPERF_SHELL_DIR='"/bin/sh"' $<

  $(OUTPUT)builtin-timechart.o: builtin-timechart.c $(OUTPUT)common-cmds.h 
$(OUTPUT)PERF-CFLAGS
$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) \
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 25c8b94..a1d9703 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -171,7 +171,7 @@ static void exec_man_cmd(const char *cmd, const char *page)
  {
struct strbuf shell_cmd = STRBUF_INIT;
strbuf_addf(&shell_cmd, "%s %s", cmd, page);
-   execl("/bin/sh", "sh", "-c", shell_cmd.buf, NULL);
+   execl(PERF_SHELL_DIR, "sh", "-c", shell_cmd.buf, NULL);
warning("failed to exec '%s': %s", cmd, strerror(errno));
  }

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 1be843a..4cc2c96 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1326,7 +1326,7 @@ int cmd_script(int argc, const char **argv, const char 
*prefix __maybe_unused)
goto out;
}

-   __argv[j++] = "/bin/sh";
+   __argv[j++] = PERF_SHELL_DIR;
__argv[j++] = rec_script_path;
if (system_wide)
__argv[j++] = "-a";
@@ -1337,7 +1337,7 @@ int cmd_script(int argc, const char **argv, const char 
*prefix __maybe_unused)
__argv[j++] = argv[i];
__argv[j++] = NULL;

-   execvp("/bin/sh", (char **)__argv);
+   execvp(PERF_SHELL_DIR, (char **)__argv);
free(__argv);
exit(-1);
}
@@ -1353,7 +1353,7 @@ int cmd_script(int argc, const char **argv, const char 
*prefix __maybe_unused)
}

j = 0;
-   __argv[j++] = "/bin/sh";
+   __argv[j++] = PERF_SHELL_DIR;
__argv[j++] = rep_script_path;
for (i = 1; i < rep_args + 1; i++)
__argv[j++] = argv[i];
@@ -1361,7 +1361,7 @@ int cmd_script(int argc, const char **argv, const char 
*prefix __maybe_unused)
__argv[j++] = "-";
__argv[j++] = NULL;

-   execvp("/bin/sh", (char **)__argv);
+   execvp(PERF_SHELL_DIR, (char **)__argv);
free(__argv);
exit(-1);
}
@@ -1390,7 +1390,7 @@ int cmd_script(int argc, const char **argv, const char 
*prefix __maybe_unused)
goto out;
}

-   __argv[j++] = "/bin/sh";
+   __argv[j++] = PERF_SHELL_DIR;
__argv[j++] = script_path;
if (system_wide)
__argv[j++] = "-a";
@@ -1398,7 +1398,7 @@ int cmd_script(int argc, const char **argv, const char 
*prefix __maybe_unused)
__argv[j++] = argv[i];
__argv[j++] = NULL;

-   execvp("/bin/sh", (char **)__argv);
+   execvp(PERF_SHELL_DIR, (char **)__argv);
free(__argv);
exit(-1);
}



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


mm: frontswap: fix a wrong if condition in frontswap_shrink

2012-09-20 Thread Zhenzhong Duan
pages_to_unuse is set to 0 to unuse all frontswap pages
But that doesn't happen since a wrong condition in frontswap_shrink
cancels it.

Signed-off-by: Zhenzhong Duan 
---
 mm/frontswap.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/frontswap.c b/mm/frontswap.c
index 6b3e71a..db2a86f 100644
--- a/mm/frontswap.c
+++ b/mm/frontswap.c
@@ -275,7 +275,7 @@ static int __frontswap_shrink(unsigned long target_pages,
if (total_pages <= target_pages) {
/* Nothing to do */
*pages_to_unuse = 0;
-   return 0;
+   return 1;
}
total_pages_to_unuse = total_pages - target_pages;
return __frontswap_unuse_pages(total_pages_to_unuse, pages_to_unuse, 
type);
@@ -302,7 +302,7 @@ void frontswap_shrink(unsigned long target_pages)
spin_lock(&swap_lock);
ret = __frontswap_shrink(target_pages, &pages_to_unuse, &type);
spin_unlock(&swap_lock);
-   if (ret == 0 && pages_to_unuse)
+   if (ret == 0)
try_to_unuse(type, true, pages_to_unuse);
return;
 }
-- 
1.7.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


KGTP (Linux debugger and tracer) 20120920 release (add LKM plugin and per cpu TSV update)

2012-09-20 Thread Hui Zhu
Hi guys,

KGTP is a flexible , lightweight and realtime Linux debugger and tracer.
To use it, you don't need patch or rebuild the Linux kernel. Just
build KGTP module and insmod it is OK.

It makes Linux Kernel supply a GDB remote debug interface. Then GDB in
current machine or remote machine can debug and trace Linux through
GDB tracepoint and some other functions without stopping the Linux
Kernel.
And even if the board doesn't have GDB on it and doesn't have
interface for remote debug. It can debug the Linux Kernel using
offline debug (See
http://code.google.com/p/kgtp/wiki/HOWTO#/sys/kernel/debug/gtpframe_and_offline_debug).
KGTP supports X86-32, X86-64, MIPS and ARM.
KGTP is tested on Linux kernel 2.6.18 to upstream.
And it can work with Android (See
http://code.google.com/p/kgtp/wiki/HowToUseKGTPinAndroid).

Please go to http://code.google.com/p/kgtp/wiki/HOWTO or
http://code.google.com/p/kgtp/wiki/HOWTO (Chinese) to get more info
about howto use KGTP.

Now, KGTP 20120920 release.
You can get the package for it from
http://kgtp.googlecode.com/files/kgtp_20120920.tar.bz2
or
svn co https://kgtp.googlecode.com/svn/tags/20120920

The main change of this release is:
C plugin support.  With this function, you can dynamic add new
function to KGTP with LKM.
To get more info about it.  Please goto
http://code.google.com/p/kgtp/wiki/HOWTO#How_to_add_plugin_in_C

Per_cpu trace state variables function was updated.  The usage and
format was changed.  This change make it more easy to be used.  And I
also update the doc to make it more clear.  Please goto
http://code.google.com/p/kgtp/wiki/HOWTO#Per_cpu_trace_state_variables
get it.

Please goto http://code.google.com/p/kgtp/wiki/UPDATE get more info
about this release.

According to the comments of Christoph, Geoff and Andi.  I make lite
patch for review.  Please goto https://lkml.org/lkml/2012/5/9/90 to
see it.

Thanks,
Hui
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the battery tree with the mfd tree

2012-09-20 Thread Stephen Rothwell
Hi Anton,

Today's linux-next merge of the battery tree got a conflict in
include/linux/mfd/88pm860x.h between commit a70abacb06b8 ("mfd: 88pm860x:
Use REG resource in regulator") from the mfd tree and commit a830d28b48bf
("power_supply: Enable battery-charger for 88pm860x") from the battery
tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc include/linux/mfd/88pm860x.h
index d515e5c,b7c5a3c..000
--- a/include/linux/mfd/88pm860x.h
+++ b/include/linux/mfd/88pm860x.h
@@@ -359,22 -460,8 +440,23 @@@ struct pm860x_platform_data 
struct pm860x_rtc_pdata *rtc;
struct pm860x_touch_pdata   *touch;
struct pm860x_power_pdata   *power;
+   struct charger_desc *chg_desc;
 -  struct regulator_init_data  *regulator;
 +  struct regulator_init_data  *buck1;
 +  struct regulator_init_data  *buck2;
 +  struct regulator_init_data  *buck3;
 +  struct regulator_init_data  *ldo1;
 +  struct regulator_init_data  *ldo2;
 +  struct regulator_init_data  *ldo3;
 +  struct regulator_init_data  *ldo4;
 +  struct regulator_init_data  *ldo5;
 +  struct regulator_init_data  *ldo6;
 +  struct regulator_init_data  *ldo7;
 +  struct regulator_init_data  *ldo8;
 +  struct regulator_init_data  *ldo9;
 +  struct regulator_init_data  *ldo10;
 +  struct regulator_init_data  *ldo12;
 +  struct regulator_init_data  *ldo_vibrator;
 +  struct regulator_init_data  *ldo14;
  
unsigned short  companion_addr; /* I2C address of companion chip */
int i2c_port;   /* Controlled by GI2C or PI2C */


pgpnh89shEGfb.pgp
Description: PGP signature


Re: [PATCH 1/4] module: add syscall to load module from fd

2012-09-20 Thread Mimi Zohar
On Fri, 2012-09-21 at 12:22 +1000, James Morris wrote:
> On Thu, 20 Sep 2012, Kees Cook wrote:
> 
> > Earlier proposals for appending signatures to kernel modules would not be
> > useful in Chrome OS, since it would involve adding an additional set of
> > keys to our kernel and builds for no good reason: we already trust the
> > contents of our root filesystem. We don't need to verify those kernel
> > modules a second time. Having to do signature checking on module loading
> > would slow us down and be redundant. All we need to know is where a
> > module is coming from so we can say yes/no to loading it.
> 
> Just out of interest, has anyone else expressed interest in using this 
> feature?

I'm not so interested in this particular use case, but am interested in
using the new syscall's file descriptor for measuring/appraising a
kernel module's integrity.

thanks,

Mimi


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/4] module: add syscall to load module from fd

2012-09-20 Thread Kees Cook
On Thu, Sep 20, 2012 at 7:22 PM, James Morris  wrote:
> On Thu, 20 Sep 2012, Kees Cook wrote:
>
>> Earlier proposals for appending signatures to kernel modules would not be
>> useful in Chrome OS, since it would involve adding an additional set of
>> keys to our kernel and builds for no good reason: we already trust the
>> contents of our root filesystem. We don't need to verify those kernel
>> modules a second time. Having to do signature checking on module loading
>> would slow us down and be redundant. All we need to know is where a
>> module is coming from so we can say yes/no to loading it.
>
> Just out of interest, has anyone else expressed interest in using this
> feature?

Yes, in the earlier threads, Mimi spoke up in favor of it as a
possible path for IMA to do signature checking. She sent patches that
updated the LSM hooks to include callback to IMA that were sent to the
lsm list:
http://marc.info/?l=linux-security-module&m=134739023306344&w=2

Serge and Eric both Acked the new hooks too.

-Kees

-Kees

-- 
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH rcu] Move TINY_RCU quiescent state out of extended quiescent state

2012-09-20 Thread Paul E. McKenney
On Fri, Sep 21, 2012 at 10:08:56AM +0800, Li Zhong wrote:
> TINY_RCU's rcu_idle_enter_common() invokes rcu_sched_qs() in order
> to inform the RCU core of the quiescent state implied by idle entry.
> Of course, idle is also an extended quiescent state, so that the call
> to rcu_sched_qs() speeds up RCU's invoking of any callbacks that might
> be queued.  This speed-up is important when entering into dyntick-idle
> mode -- if there are no further scheduling-clock interrupts, the callbacks
> might never be invoked, which could result in a system hang.
> 
> However, processing callbacks does event tracing, which in turn
> implies RCU read-side critical sections, which are illegal in extended
> quiescent states.  This patch therefore moves the call to rcu_sched_qs()
> so that it precedes the point at which we set the new value of 
> rcu_dynticks_nesting, which may indicate RCU is in an extended quiescent
> state. 

Thank you, Zhong.  Queued, as those checking the SOBs below might
guess.  ;-)

Thanx, paul

> Signed-off-by: Li Zhong 
> Signed-off-by: Paul E. McKenney 
> ---
>  kernel/rcutiny.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
> index 2e073a2..e4c6a59 100644
> --- a/kernel/rcutiny.c
> +++ b/kernel/rcutiny.c
> @@ -75,9 +75,9 @@ static void rcu_idle_enter_common(long long newval)
> current->pid, current->comm,
> idle->pid, idle->comm); /* must be idle task! */
>   }
> + rcu_sched_qs(0); /* implies rcu_bh_qsctr_inc(0) */
>   barrier();
>   rcu_dynticks_nesting = newval;
> - rcu_sched_qs(0); /* implies rcu_bh_qsctr_inc(0) */
>  }
> 
>  /*
> -- 
> 1.7.9.5
> 
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] module: add finit_module syscall to asm-generic

2012-09-20 Thread Rusty Russell
Arnd Bergmann  writes:

> On Thursday 20 September 2012, Kees Cook wrote:
>> 
>> This adds the finit_module syscall to the generic syscall list.
>> 
>> Signed-off-by: Kees Cook 
>> ---
>> This depends on the finit_module patchset in Rusty's tree, based on
>> https://lkml.org/lkml/2012/9/7/559
>
> Acked-by: Arnd Bergmann 
>
> Please queue this along with the other patches.

OK, I'm still holding them back from linux-next due to the question of
signatures & the new syscall.  But I expect we'll resign ourselves to an
appended signature, and they'll be fine as-is.

Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 4/5] PCI/IOV: simplify code by hotplug safe pci_get_domain_bus_and_slot()

2012-09-20 Thread Bjorn Helgaas
On Thu, Sep 20, 2012 at 7:51 PM, Yinghai Lu  wrote:
> On Thu, Sep 20, 2012 at 4:59 PM, Bjorn Helgaas  wrote:
>> On Thu, Sep 20, 2012 at 2:38 PM, Yinghai Lu  wrote:
>>> in that case, VFs  are stopped before PF, so they are not in device
>>> tree anymore.
>>> so pci_get_domain_bus_and_slot will not find those VFs.
>>>
>>> So the reference to PF is not released. Also vit_bus may not be released 
>>> too.
>>>
>>> So you have to rework
>>> pci_get_domain_bus_and_slot to make it work on pci devices get stopped 
>>> only.
>>>
>>> or just drop this from the tree.
>>
>> pci_find_bus() is a broken interface (because there's no reference
>> counting or safety with respect to hot-plug), and if the design
>> depends on it, that means the design is broken, too.  I don't think
>> reworking pci_get_domain_bus_and_slot() is the right answer.
>>
>> It's not clear to me why we need the split between stopping and
>> removing devices.  That split leads to these zombie devices that have
>> been stopped and are no longer findable by bus_find_device() (which is
>> used by pci_get_domain_bus_and_slot()), but still "exist" in some
>> fashion until they're removed.  It's unreasonable for random PCI and
>> driver code to have to worry about that zombie state.
>
> That is not zombie state. that is driver unloaded, and not in /sys, /proc.
> that pci device only can be found under bus->devices.

It doesn't matter whether we call this a "zombie state" or just refer
to it as "devices not in /sys & /proc but still in bus->devices."  The
point is that this state is not very useful, and code outside the PCI
core should not have to know that it exists.

> just like we have pci_device_add and pci_bus_add_device
> or acpi add and acpi start.

The fact that ACPI drivers have both .add() and .start() methods is
another artifact of poor design, in my opinion.  No other subsystem
has that split, as far as I know.  The ACPI split exists because of a
messed-up ACPI hotplug implementation.  That doesn't mean we should
copy it.

>> I'm not happy about either reverting Jiang's patch or splitting
>> stop/remove again.  It complicates the design and the code.  I'll
>> apply them because they're regressions, and we don't have time for
>> redesign before 3.7.  But I encourage you to think about how to do
>> this more cleanly.
>
> That will need to redesign sriov implementation.

That's right.  If we can improve the situation by redesigning, that's
what we should do.  The present situation, where we keep adding
special cases because "that's the way the rest of the system works" is
not sustainable in the long term.

> Also that pci root bus add/start, stop/remove will need special
> sequence to make ioapic
> and dmar to be started early before normal pci device drivers and
> stopped after normal pci device drivers.

This is another thing I'm curious about.  How do you handle this
situation today (before host bridge hot-add)?

The DMAR I'm not so worried about because as far as I know, there's no
such thing as a DMAR that's discovered by PCI enumeration.  We should
discover it via ACPI, and that can happen before we enumerate anything
behind a host bridge, so I don't really see any ordering problem
between the DMAR and the PCI devices that would use it.

However, I know there *are* IOAPICs that are enumerated as PCI
devices, and I don't know whether we can deduce a relationship between
the IOAPIC and the devices that use it.  Don't we have this problem
already?  I assume that even without hot-adding a host bridge, we
might discover a PCI IOAPIC that was present at boot, and we'd have to
make sure to bind a driver to it before we use any of the PCI devices
connected to it.  How does that work?

Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the md tree with the tree

2012-09-20 Thread Stephen Rothwell
Hi Neil,

Today's linux-next merge of the md tree got a conflict in fs/bio.c
between commit 4363ac7c13a9 ("block: Implement support for WRITE SAME")
from the block tree and commit 368e564836d3 ("block: makes bio_split
support bio without data") from the md tree.

I fixed it up (I think - see below) and can carry the fix as necessary
(no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/bio.c
index f855e0e,dbb7a6c..000
--- a/fs/bio.c
+++ b/fs/bio.c
@@@ -1485,20 -1511,19 +1485,21 @@@ struct bio_pair *bio_split(struct bio *
bp->bio2.bi_size -= first_sectors << 9;
bp->bio1.bi_size = first_sectors << 9;
  
-   bp->bv1 = bi->bi_io_vec[0];
-   bp->bv2 = bi->bi_io_vec[0];
- 
-   if (bio_is_rw(bi)) {
-   bp->bv2.bv_offset += first_sectors << 9;
-   bp->bv2.bv_len -= first_sectors << 9;
-   bp->bv1.bv_len = first_sectors << 9;
-   }
+   if (bi->bi_vcnt != 0) {
+   bp->bv1 = bi->bi_io_vec[0];
+   bp->bv2 = bi->bi_io_vec[0];
 -  bp->bv2.bv_offset += first_sectors << 9;
 -  bp->bv2.bv_len -= first_sectors << 9;
 -  bp->bv1.bv_len = first_sectors << 9;
++  if (bio_is_rw(bi)) {
++  bp->bv2.bv_offset += first_sectors << 9;
++  bp->bv2.bv_len -= first_sectors << 9;
++  bp->bv1.bv_len = first_sectors << 9;
++  }
  
-   bp->bio1.bi_io_vec = &bp->bv1;
-   bp->bio2.bi_io_vec = &bp->bv2;
+   bp->bio1.bi_io_vec = &bp->bv1;
+   bp->bio2.bi_io_vec = &bp->bv2;
  
-   bp->bio1.bi_max_vecs = 1;
-   bp->bio2.bi_max_vecs = 1;
+   bp->bio1.bi_max_vecs = 1;
+   bp->bio2.bi_max_vecs = 1;
+   }
  
bp->bio1.bi_end_io = bio_pair_end_1;
bp->bio2.bi_end_io = bio_pair_end_2;


pgpfkFSiOFuw3.pgp
Description: PGP signature


linux-next: manual merge of the md tree with the block tree

2012-09-20 Thread Stephen Rothwell
Hi Neil,

Today's linux-next merge of the md tree got a conflict in
drivers/md/raid0.c between commit 4363ac7c13a9 ("block: Implement support
for WRITE SAME") from the block tree and commit c9264cda8f11 ("md: raid 0
supports TRIM") from the md tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc drivers/md/raid0.c
index a9e4fa9,1a8e5e3..000
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@@ -422,7 -431,7 +431,8 @@@ static int raid0_run(struct mddev *mdde
if (md_check_no_bitmap(mddev))
return -EINVAL;
blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
 +  blk_queue_max_write_same_sectors(mddev->queue, mddev->chunk_sectors);
+   blk_queue_max_discard_sectors(mddev->queue, mddev->chunk_sectors);
  
/* if private is not null, we are here after takeover */
if (mddev->private == NULL) {


pgpWAvXrKom72.pgp
Description: PGP signature


Re: [PATCH V3] perf: Fix parallel build

2012-09-20 Thread Namhyung Kim
On Thu, 20 Sep 2012 21:31:44 -0500, Eric Sandeen wrote:
> Parallel builds of perf were failing for me on a 32p box, with:
>
> * new build flags or prefix
> util/pmu.l:7:23: error: pmu-bison.h: No such file or directory
>
> ...
>
> make: *** [util/pmu-flex.o] Error 1
> make: *** Waiting for unfinished jobs
>
> This can pretty quickly be seen by adding a sleep in front of
> the bison calls in tools/perf/Makefile and running make -j4 on a
> smaller box i.e.:
>
>   sleep 10; $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o 
> $(OUTPUT)util/pmu-bison.c
>
> Adding the following dependencies fixes it for me.
>
> Signed-off-by: Eric Sandeen 

Reviewed-by: Namhyung Kim 

Thanks for fixing this!
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] clk: Add devm_clk_{register,unregister}()

2012-09-20 Thread Stephen Boyd
On 09/18/12 23:05, Stephen Boyd wrote:
> +void devm_clk_unregister(struct device *dev, struct clk *clk)
> +{
> + WARN_ON(devres_destroy(dev, devm_clk_release, devm_clk_match, clk));

Hm... I guess this needs to be devres_release() instead of destroy. Can
you squash this in or should I resend for the few character change?

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 6852809..f02f4fe 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1509,7 +1509,7 @@ static int devm_clk_match(struct device *dev, void *res, 
void *data)
  */
 void devm_clk_unregister(struct device *dev, struct clk *clk)
 {
-   WARN_ON(devres_destroy(dev, devm_clk_release, devm_clk_match, clk));
+   WARN_ON(devres_release(dev, devm_clk_release, devm_clk_match, clk));
 }
 EXPORT_SYMBOL(devm_clk_unregister);
 

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 0/2] do not disable sg when packet requires no checksum

2012-09-20 Thread David Miller
From: Ed Cashin 
Date: Wed, 19 Sep 2012 18:46:07 -0700

> This two-part patchset replaces an earlier net-only patch that
> added an explicit check for the AoE protocol to harmonize_features
> in net/core/dev.c.
> 
> Following the suggestions of Ben Hutchings, this patchset makes
> the decision in the network layer protocol agnostic instead of
> using ETH_P_AOE as a special case.  It relies on fresh skbs being
> CHECKSUM_NONE but makes that explicit with an assertion.
> 
> Ed L. Cashin (2):
>   aoe: assert AoE packets marked as requiring no checksum
>   net: do not disable sg for packets requiring no checksum

Applied and queued up for -stable, thanks Ed.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V3] perf: Fix parallel build

2012-09-20 Thread Eric Sandeen
Parallel builds of perf were failing for me on a 32p box, with:

* new build flags or prefix
util/pmu.l:7:23: error: pmu-bison.h: No such file or directory

...

make: *** [util/pmu-flex.o] Error 1
make: *** Waiting for unfinished jobs

This can pretty quickly be seen by adding a sleep in front of
the bison calls in tools/perf/Makefile and running make -j4 on a
smaller box i.e.:

sleep 10; $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o 
$(OUTPUT)util/pmu-bison.c

Adding the following dependencies fixes it for me.

Signed-off-by: Eric Sandeen 
---

V2: Fix other bison dependency caught by Namhyung Kim , 
thanks.
V3: Add $(OUTPUT) to generated deps, thanks again.

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 35655c3..01325cd 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -221,13 +221,13 @@ export PERL_PATH
 FLEX = flex
 BISON= bison
 
-$(OUTPUT)util/parse-events-flex.c: util/parse-events.l
+$(OUTPUT)util/parse-events-flex.c: util/parse-events.l 
$(OUTPUT)util/parse-events-bison.c
$(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h 
$(PARSER_DEBUG_FLEX) -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c
 
 $(OUTPUT)util/parse-events-bison.c: util/parse-events.y
$(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) 
-o $(OUTPUT)util/parse-events-bison.c
 
-$(OUTPUT)util/pmu-flex.c: util/pmu.l
+$(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c
$(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t 
util/pmu.l > $(OUTPUT)util/pmu-flex.c
 
 $(OUTPUT)util/pmu-bison.c: util/pmu.y


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/4] module: add syscall to load module from fd

2012-09-20 Thread James Morris
On Thu, 20 Sep 2012, Kees Cook wrote:

> Earlier proposals for appending signatures to kernel modules would not be
> useful in Chrome OS, since it would involve adding an additional set of
> keys to our kernel and builds for no good reason: we already trust the
> contents of our root filesystem. We don't need to verify those kernel
> modules a second time. Having to do signature checking on module loading
> would slow us down and be redundant. All we need to know is where a
> module is coming from so we can say yes/no to loading it.

Just out of interest, has anyone else expressed interest in using this 
feature?



-- 
James Morris

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 10/10] ARM: msm: Migrate to common clock framework

2012-09-20 Thread Stephen Boyd
Move the existing clock code in mach-msm to the common clock
framework. We lose our capability to set the rate of and enable a
clock through debugfs. This is ok though because the debugfs
features are mainly used for testing and development of new clock
code.

To maintain compatibility with the original MSM clock code we
make a wrapper for clk_reset() that calls the struct msm_clk
specific reset function. This is necessary for the usb and sdcc
devices on MSM until a better suited API is made available.

Cc: Saravana Kannan 
Cc: Mike Turquette 
Signed-off-by: Stephen Boyd 
---
 arch/arm/Kconfig|   1 +
 arch/arm/mach-msm/Makefile  |   1 -
 arch/arm/mach-msm/clock-debug.c | 123 --
 arch/arm/mach-msm/clock-pcom.c  | 118 ++---
 arch/arm/mach-msm/clock-pcom.h  |  30 
 arch/arm/mach-msm/clock.c   | 146 ++--
 arch/arm/mach-msm/clock.h   |  46 +++-
 arch/arm/mach-msm/devices-msm7x00.c |   2 +-
 arch/arm/mach-msm/devices-msm7x30.c |   2 +-
 arch/arm/mach-msm/devices-qsd8x50.c |   2 +-
 10 files changed, 108 insertions(+), 363 deletions(-)
 delete mode 100644 arch/arm/mach-msm/clock-debug.c

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 433e9b8..2809213 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -727,6 +727,7 @@ config ARCH_MSM
select GENERIC_CLOCKEVENTS
select ARCH_REQUIRE_GPIOLIB
select CLKDEV_LOOKUP
+   select COMMON_CLK
help
  Support for Qualcomm MSM/QSD based systems.  This runs on the
  apps processor of the MSM/QSD and depends on a shared memory
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 3dbae74..700d77b 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -1,6 +1,5 @@
 obj-y += io.o timer.o
 obj-y += clock.o
-obj-$(CONFIG_DEBUG_FS) += clock-debug.o
 
 obj-$(CONFIG_MSM_VIC) += irq-vic.o
 obj-$(CONFIG_MSM_IOMMU) += devices-iommu.o
diff --git a/arch/arm/mach-msm/clock-debug.c b/arch/arm/mach-msm/clock-debug.c
deleted file mode 100644
index c4b34d7..000
--- a/arch/arm/mach-msm/clock-debug.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2007-2010, Code Aurora Forum. All rights reserved.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include "clock.h"
-
-static int clock_debug_rate_set(void *data, u64 val)
-{
-   struct clk *clock = data;
-   int ret;
-
-   ret = clk_set_rate(clock, val);
-   if (ret != 0)
-   printk(KERN_ERR "clk_set%s_rate failed (%d)\n",
-   (clock->flags & CLK_MIN) ? "_min" : "", ret);
-   return ret;
-}
-
-static int clock_debug_rate_get(void *data, u64 *val)
-{
-   struct clk *clock = data;
-   *val = clk_get_rate(clock);
-   return 0;
-}
-
-DEFINE_SIMPLE_ATTRIBUTE(clock_rate_fops, clock_debug_rate_get,
-   clock_debug_rate_set, "%llu\n");
-
-static int clock_debug_enable_set(void *data, u64 val)
-{
-   struct clk *clock = data;
-   int rc = 0;
-
-   if (val)
-   rc = clock->ops->enable(clock->id);
-   else
-   clock->ops->disable(clock->id);
-
-   return rc;
-}
-
-static int clock_debug_enable_get(void *data, u64 *val)
-{
-   struct clk *clock = data;
-
-   *val = clock->ops->is_enabled(clock->id);
-
-   return 0;
-}
-
-DEFINE_SIMPLE_ATTRIBUTE(clock_enable_fops, clock_debug_enable_get,
-   clock_debug_enable_set, "%llu\n");
-
-static int clock_debug_local_get(void *data, u64 *val)
-{
-   struct clk *clock = data;
-
-   *val = clock->ops->is_local(clock->id);
-
-   return 0;
-}
-
-DEFINE_SIMPLE_ATTRIBUTE(clock_local_fops, clock_debug_local_get,
-   NULL, "%llu\n");
-
-static struct dentry *debugfs_base;
-
-int __init clock_debug_init(void)
-{
-   debugfs_base = debugfs_create_dir("clk", NULL);
-   if (!debugfs_base)
-   return -ENOMEM;
-   return 0;
-}
-
-int __init clock_debug_add(struct clk *clock)
-{
-   char temp[50], *ptr;
-   struct dentry *clk_dir;
-
-   if (!debugfs_base)
-   return -ENOMEM;
-
-   strncpy(temp, clock->dbg_name, ARRAY_SIZE(temp)-1);
-   for (ptr = temp; *ptr; ptr++)
-   *ptr = tolower(*ptr);
-
-   clk_dir = debugfs_create_dir(temp, debugfs_base);
-   if (!clk_dir)
-   return -ENOME

[PATCH 05/10] ARM: msm: Remove custom clk_set_flags() API

2012-09-20 Thread Stephen Boyd
Nobody is using this API upstream and it's just contributing
cruft. Remove it so the MSM clock API is closer to the generic
struct clock API.

Cc: Saravana Kannan 
Signed-off-by: Stephen Boyd 
---
 arch/arm/mach-msm/clock-pcom.c   | 10 --
 arch/arm/mach-msm/clock.c|  8 
 arch/arm/mach-msm/clock.h|  6 --
 arch/arm/mach-msm/include/mach/clk.h |  3 ---
 4 files changed, 27 deletions(-)

diff --git a/arch/arm/mach-msm/clock-pcom.c b/arch/arm/mach-msm/clock-pcom.c
index a52c970..bb75f8e 100644
--- a/arch/arm/mach-msm/clock-pcom.c
+++ b/arch/arm/mach-msm/clock-pcom.c
@@ -85,15 +85,6 @@ static int pc_clk_set_max_rate(unsigned id, unsigned rate)
return (int)id < 0 ? -EINVAL : 0;
 }
 
-static int pc_clk_set_flags(unsigned id, unsigned flags)
-{
-   int rc = msm_proc_comm(PCOM_CLKCTL_RPC_SET_FLAGS, &id, &flags);
-   if (rc < 0)
-   return rc;
-   else
-   return (int)id < 0 ? -EINVAL : 0;
-}
-
 static unsigned pc_clk_get_rate(unsigned id)
 {
if (msm_proc_comm(PCOM_CLKCTL_RPC_RATE, &id, NULL))
@@ -130,7 +121,6 @@ struct clk_ops clk_ops_pcom = {
.set_rate = pc_clk_set_rate,
.set_min_rate = pc_clk_set_min_rate,
.set_max_rate = pc_clk_set_max_rate,
-   .set_flags = pc_clk_set_flags,
.get_rate = pc_clk_get_rate,
.is_enabled = pc_clk_is_enabled,
.round_rate = pc_clk_round_rate,
diff --git a/arch/arm/mach-msm/clock.c b/arch/arm/mach-msm/clock.c
index d9145df..5fac2df 100644
--- a/arch/arm/mach-msm/clock.c
+++ b/arch/arm/mach-msm/clock.c
@@ -121,14 +121,6 @@ struct clk *clk_get_parent(struct clk *clk)
 }
 EXPORT_SYMBOL(clk_get_parent);
 
-int clk_set_flags(struct clk *clk, unsigned long flags)
-{
-   if (clk == NULL || IS_ERR(clk))
-   return -EINVAL;
-   return clk->ops->set_flags(clk->id, flags);
-}
-EXPORT_SYMBOL(clk_set_flags);
-
 /* EBI1 is the only shared clock that several clients want to vote on as of
  * this commit. If this changes in the future, then it might be better to
  * make clk_min_rate handle the voting or make ebi1_clk_set_min_rate more
diff --git a/arch/arm/mach-msm/clock.h b/arch/arm/mach-msm/clock.h
index 2c007f6..a25ff58 100644
--- a/arch/arm/mach-msm/clock.h
+++ b/arch/arm/mach-msm/clock.h
@@ -21,11 +21,6 @@
 #include 
 #include 
 
-#define CLKFLAG_INVERT 0x0001
-#define CLKFLAG_NOINVERT   0x0002
-#define CLKFLAG_NONEST 0x0004
-#define CLKFLAG_NORESET0x0008
-
 #define CLK_FIRST_AVAILABLE_FLAG   0x0100
 #define CLKFLAG_AUTO_OFF   0x0200
 #define CLKFLAG_MIN0x0400
@@ -39,7 +34,6 @@ struct clk_ops {
int (*set_rate)(unsigned id, unsigned rate);
int (*set_min_rate)(unsigned id, unsigned rate);
int (*set_max_rate)(unsigned id, unsigned rate);
-   int (*set_flags)(unsigned id, unsigned flags);
unsigned (*get_rate)(unsigned id);
unsigned (*is_enabled)(unsigned id);
long (*round_rate)(unsigned id, unsigned rate);
diff --git a/arch/arm/mach-msm/include/mach/clk.h 
b/arch/arm/mach-msm/include/mach/clk.h
index e8d3842..5f1c37d 100644
--- a/arch/arm/mach-msm/include/mach/clk.h
+++ b/arch/arm/mach-msm/include/mach/clk.h
@@ -34,7 +34,4 @@ int clk_set_max_rate(struct clk *clk, unsigned long rate);
 /* Assert/Deassert reset to a hardware block associated with a clock */
 int clk_reset(struct clk *clk, enum clk_reset_action action);
 
-/* Set clock-specific configuration parameters */
-int clk_set_flags(struct clk *clk, unsigned long flags);
-
 #endif
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 08/10] ARM: msm: Prepare clk_get() users in mach-msm for clock-pcom driver

2012-09-20 Thread Stephen Boyd
In the near future we'll be moving clock-pcom to a platform
driver, in which case these two users of clk_get() in mach-msm
need to be updated. Have board-trout-panel.c make the proc_comm
call directly so that we don't have to port this board specific
code to the driver right now and reorder the initcall order of
dma.c so that it initializes after the clock driver probes but
before any drivers use dma APIs.

Signed-off-by: Stephen Boyd 
---
 arch/arm/mach-msm/Makefile|  9 ++---
 arch/arm/mach-msm/board-trout-panel.c | 19 +++
 arch/arm/mach-msm/dma.c   |  5 ++---
 3 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
index 17519fa..3dbae74 100644
--- a/arch/arm/mach-msm/Makefile
+++ b/arch/arm/mach-msm/Makefile
@@ -5,12 +5,15 @@ obj-$(CONFIG_DEBUG_FS) += clock-debug.o
 obj-$(CONFIG_MSM_VIC) += irq-vic.o
 obj-$(CONFIG_MSM_IOMMU) += devices-iommu.o
 
-obj-$(CONFIG_ARCH_MSM7X00A) += dma.o irq.o
-obj-$(CONFIG_ARCH_MSM7X30) += dma.o
-obj-$(CONFIG_ARCH_QSD8X50) += dma.o sirc.o
+obj-$(CONFIG_ARCH_MSM7X00A) += irq.o
+obj-$(CONFIG_ARCH_QSD8X50) += sirc.o
 
 obj-$(CONFIG_MSM_PROC_COMM) += proc_comm.o clock-pcom.o vreg.o
 
+obj-$(CONFIG_ARCH_MSM7X00A) += dma.o
+obj-$(CONFIG_ARCH_MSM7X30) += dma.o
+obj-$(CONFIG_ARCH_QSD8X50) += dma.o
+
 obj-$(CONFIG_MSM_SMD) += smd.o smd_debug.o
 obj-$(CONFIG_MSM_SMD) += last_radio_log.o
 obj-$(CONFIG_MSM_SCM) += scm.o scm-boot.o
diff --git a/arch/arm/mach-msm/board-trout-panel.c 
b/arch/arm/mach-msm/board-trout-panel.c
index 89bf6b4..0be703b 100644
--- a/arch/arm/mach-msm/board-trout-panel.c
+++ b/arch/arm/mach-msm/board-trout-panel.c
@@ -7,7 +7,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -19,6 +18,7 @@
 
 #include "board-trout.h"
 #include "proc_comm.h"
+#include "clock-pcom.h"
 #include "devices.h"
 
 #define TROUT_DEFAULT_BACKLIGHT_BRIGHTNESS 255
@@ -170,7 +170,6 @@ static struct mddi_table mddi_toshiba_init_table[] = {
 #define INTMASK_VWAKEOUT (1U << 0)
 
 
-static struct clk *gp_clk;
 static int trout_new_backlight = 1;
 static struct vreg *vreg_mddi_1v5;
 static struct vreg *vreg_lcm_2v85;
@@ -273,18 +272,14 @@ int __init trout_init_panel(void)
} else {
uint32_t config = PCOM_GPIO_CFG(27, 1, GPIO_OUTPUT,
GPIO_NO_PULL, GPIO_8MA);
+   uint32_t id = P_GP_CLK;
+   uint32_t rate = 1920;
+
msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &config, 0);
 
-   gp_clk = clk_get(NULL, "gp_clk");
-   if (IS_ERR(gp_clk)) {
-   printk(KERN_ERR "trout_init_panel: could not get gp"
-  "clock\n");
-   gp_clk = NULL;
-   }
-   rc = clk_set_rate(gp_clk, 1920);
-   if (rc)
-   printk(KERN_ERR "trout_init_panel: set clock rate "
-  "failed\n");
+   msm_proc_comm(PCOM_CLKCTL_RPC_SET_RATE, &id, &rate);
+   if (id < 0)
+   pr_err("trout_init_panel: set clock rate failed\n");
}
 
rc = platform_device_register(&msm_device_mdp);
diff --git a/arch/arm/mach-msm/dma.c b/arch/arm/mach-msm/dma.c
index 354b91d..37a4ddd 100644
--- a/arch/arm/mach-msm/dma.c
+++ b/arch/arm/mach-msm/dma.c
@@ -258,6 +258,7 @@ static int __init msm_init_datamover(void)
clk = clk_get(NULL, "adm_clk");
if (IS_ERR(clk))
return PTR_ERR(clk);
+   clk_prepare(clk);
msm_dmov_clk = clk;
ret = request_irq(INT_ADM_AARM, msm_datamover_irq_handler, 0, 
"msmdatamover", NULL);
if (ret)
@@ -265,6 +266,4 @@ static int __init msm_init_datamover(void)
disable_irq(INT_ADM_AARM);
return 0;
 }
-
-arch_initcall(msm_init_datamover);
-
+module_init(msm_init_datamover);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 07/10] ARM: msm: Remove clock-7x30.h include file

2012-09-20 Thread Stephen Boyd
This file is not used outside of the two users in the clock-7x30
array. Those two clocks are virtual "source" clocks that don't
really need to exist outside of the clock driver. Let's remove
them from the array, since they're not doing anything anyway, and
then remove the clock-7x30.h include file along with it.

Cc: Saravana Kannan 
Signed-off-by: Stephen Boyd 
---
 arch/arm/mach-msm/clock-7x30.h  | 155 
 arch/arm/mach-msm/devices-msm7x30.c |   2 -
 2 files changed, 157 deletions(-)
 delete mode 100644 arch/arm/mach-msm/clock-7x30.h

diff --git a/arch/arm/mach-msm/clock-7x30.h b/arch/arm/mach-msm/clock-7x30.h
deleted file mode 100644
index 1410445..000
--- a/arch/arm/mach-msm/clock-7x30.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef __ARCH_ARM_MACH_MSM_CLOCK_7X30_H
-#define __ARCH_ARM_MACH_MSM_CLOCK_7X30_H
-
-enum {
-   L_7X30_NONE_CLK = -1,
-   L_7X30_ADM_CLK,
-   L_7X30_I2C_CLK,
-   L_7X30_I2C_2_CLK,
-   L_7X30_QUP_I2C_CLK,
-   L_7X30_UART1DM_CLK,
-   L_7X30_UART1DM_P_CLK,
-   L_7X30_UART2DM_CLK,
-   L_7X30_UART2DM_P_CLK,
-   L_7X30_EMDH_CLK,
-   L_7X30_EMDH_P_CLK,
-   L_7X30_PMDH_CLK,
-   L_7X30_PMDH_P_CLK,
-   L_7X30_GRP_2D_CLK,
-   L_7X30_GRP_2D_P_CLK,
-   L_7X30_GRP_3D_SRC_CLK,
-   L_7X30_GRP_3D_CLK,
-   L_7X30_GRP_3D_P_CLK,
-   L_7X30_IMEM_CLK,
-   L_7X30_SDC1_CLK,
-   L_7X30_SDC1_P_CLK,
-   L_7X30_SDC2_CLK,
-   L_7X30_SDC2_P_CLK,
-   L_7X30_SDC3_CLK,
-   L_7X30_SDC3_P_CLK,
-   L_7X30_SDC4_CLK,
-   L_7X30_SDC4_P_CLK,
-   L_7X30_MDP_CLK,
-   L_7X30_MDP_P_CLK,
-   L_7X30_MDP_LCDC_PCLK_CLK,
-   L_7X30_MDP_LCDC_PAD_PCLK_CLK,
-   L_7X30_MDP_VSYNC_CLK,
-   L_7X30_MI2S_CODEC_RX_M_CLK,
-   L_7X30_MI2S_CODEC_RX_S_CLK,
-   L_7X30_MI2S_CODEC_TX_M_CLK,
-   L_7X30_MI2S_CODEC_TX_S_CLK,
-   L_7X30_MI2S_M_CLK,
-   L_7X30_MI2S_S_CLK,
-   L_7X30_LPA_CODEC_CLK,
-   L_7X30_LPA_CORE_CLK,
-   L_7X30_LPA_P_CLK,
-   L_7X30_MIDI_CLK,
-   L_7X30_MDC_CLK,
-   L_7X30_ROTATOR_IMEM_CLK,
-   L_7X30_ROTATOR_P_CLK,
-   L_7X30_SDAC_M_CLK,
-   L_7X30_SDAC_CLK,
-   L_7X30_UART1_CLK,
-   L_7X30_UART2_CLK,
-   L_7X30_UART3_CLK,
-   L_7X30_TV_CLK,
-   L_7X30_TV_DAC_CLK,
-   L_7X30_TV_ENC_CLK,
-   L_7X30_HDMI_CLK,
-   L_7X30_TSIF_REF_CLK,
-   L_7X30_TSIF_P_CLK,
-   L_7X30_USB_HS_SRC_CLK,
-   L_7X30_USB_HS_CLK,
-   L_7X30_USB_HS_CORE_CLK,
-   L_7X30_USB_HS_P_CLK,
-   L_7X30_USB_HS2_CLK,
-   L_7X30_USB_HS2_CORE_CLK,
-   L_7X30_USB_HS2_P_CLK,
-   L_7X30_USB_HS3_CLK,
-   L_7X30_USB_HS3_CORE_CLK,
-   L_7X30_USB_HS3_P_CLK,
-   L_7X30_VFE_CLK,
-   L_7X30_VFE_P_CLK,
-   L_7X30_VFE_MDC_CLK,
-   L_7X30_VFE_CAMIF_CLK,
-   L_7X30_CAMIF_PAD_P_CLK,
-   L_7X30_CAM_M_CLK,
-   L_7X30_JPEG_CLK,
-   L_7X30_JPEG_P_CLK,
-   L_7X30_VPE_CLK,
-   L_7X30_MFC_CLK,
-   L_7X30_MFC_DIV2_CLK,
-   L_7X30_MFC_P_CLK,
-   L_7X30_SPI_CLK,
-   L_7X30_SPI_P_CLK,
-   L_7X30_CSI0_CLK,
-   L_7X30_CSI0_VFE_CLK,
-   L_7X30_CSI0_P_CLK,
-   L_7X30_CSI1_CLK,
-   L_7X30_CSI1_VFE_CLK,
-   L_7X30_CSI1_P_CLK,
-   L_7X30_GLBL_ROOT_CLK,
-
-   L_7X30_AXI_LI_VG_CLK,
-   L_7X30_AXI_LI_GRP_CLK,
-   L_7X30_AXI_LI_JPEG_CLK,
-   L_7X30_AXI_GRP_2D_CLK,
-   L_7X30_AXI_MFC_CLK,
-   L_7X30_AXI_VPE_CLK,
-   L_7X30_AXI_LI_VFE_CLK,
-   L_7X30_AXI_LI_APPS_CLK,
-   L_7X30_AXI_MDP_CLK,
-   L_7X30_AXI_IMEM_CLK,
-   L_7X30_AXI_LI_ADSP_A_CLK,
-   L_7X30_AXI_ROTATOR_CLK,
-
-   L_7X30_NR_CLKS
-};
-
-struct clk_ops;
-extern struct clk_ops clk_ops_7x30;
-
-struct clk_ops *clk_7x30_is_local(uint32_t id);
-int clk_7x30_init(void);
-
-void pll_enable(uint32_t pll);
-void pll_disable(uint32_t pll);
-
-extern int internal_pwr_rail_ctl_auto(unsigned rail_id, bool enable);
-
-#define CLK_7X30(clk_name, clk_id, clk_dev, clk_flags) {   \
-   .con_id = clk_name, \
-   .dev_id = clk_dev, \
-   .clk = &(struct clk){ \
-   .id = L_7X30_##clk_id, \
-   .remote_id = P_##clk_id, \
-   .flags = clk_flags, \
-   .dbg_name = #clk_id, \
-   }, \
-   }
-
-#define CLK_7X30S(clk_name, l_id, r_id, clk_dev, clk_flags) {  \
-   .con_id = clk_name, \
-   .dev_id = clk_dev, \
-   .clk = &(struct c

[PATCH 09/10] ARM: msm: Make proc_comm clock control into a platform driver

2012-09-20 Thread Stephen Boyd
To move closer to the generic struct clock framework move the
proc_comm based clock code to a platform driver. The data
describing the struct clks still live in the devices-$ARCH file,
but the clock initialization is done at driver binding time.

Cc: Saravana Kannan 
Signed-off-by: Stephen Boyd 
---
 arch/arm/mach-msm/board-halibut.c  |  2 +-
 arch/arm/mach-msm/board-msm7x30.c  |  2 +-
 arch/arm/mach-msm/board-qsd8x50.c  |  2 +-
 arch/arm/mach-msm/board-trout.c|  3 +--
 arch/arm/mach-msm/clock-pcom.c | 23 +--
 arch/arm/mach-msm/clock-pcom.h |  5 +
 arch/arm/mach-msm/clock.c  |  2 +-
 arch/arm/mach-msm/clock.h  |  3 +++
 arch/arm/mach-msm/devices-msm7x00.c| 12 ++--
 arch/arm/mach-msm/devices-msm7x30.c| 11 +--
 arch/arm/mach-msm/devices-qsd8x50.c| 11 +--
 arch/arm/mach-msm/devices.h| 15 +++
 arch/arm/mach-msm/include/mach/board.h |  5 -
 13 files changed, 65 insertions(+), 31 deletions(-)

diff --git a/arch/arm/mach-msm/board-halibut.c 
b/arch/arm/mach-msm/board-halibut.c
index 6ce542e..3c8cfe4 100644
--- a/arch/arm/mach-msm/board-halibut.c
+++ b/arch/arm/mach-msm/board-halibut.c
@@ -59,6 +59,7 @@ static struct platform_device smc91x_device = {
 };
 
 static struct platform_device *devices[] __initdata = {
+   &msm_clock_7x01a,
&msm_device_uart3,
&msm_device_smd,
&msm_device_nand,
@@ -90,7 +91,6 @@ static void __init halibut_fixup(struct tag *tags, char 
**cmdline,
 static void __init halibut_map_io(void)
 {
msm_map_common_io();
-   msm_clock_init(msm_clocks_7x01a, msm_num_clocks_7x01a);
 }
 
 static void __init halibut_init_late(void)
diff --git a/arch/arm/mach-msm/board-msm7x30.c 
b/arch/arm/mach-msm/board-msm7x30.c
index effa6f4..22e267e 100644
--- a/arch/arm/mach-msm/board-msm7x30.c
+++ b/arch/arm/mach-msm/board-msm7x30.c
@@ -89,6 +89,7 @@ struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] 
= {
 };
 
 static struct platform_device *devices[] __initdata = {
+   &msm_clock_7x30,
 #if defined(CONFIG_SERIAL_MSM) || defined(CONFIG_MSM_SERIAL_DEBUGGER)
 &msm_device_uart2,
 #endif
@@ -115,7 +116,6 @@ static void __init msm7x30_init(void)
 static void __init msm7x30_map_io(void)
 {
msm_map_msm7x30_io();
-   msm_clock_init(msm_clocks_7x30, msm_num_clocks_7x30);
 }
 
 static void __init msm7x30_init_late(void)
diff --git a/arch/arm/mach-msm/board-qsd8x50.c 
b/arch/arm/mach-msm/board-qsd8x50.c
index b16b71a..4d5d7ef 100644
--- a/arch/arm/mach-msm/board-qsd8x50.c
+++ b/arch/arm/mach-msm/board-qsd8x50.c
@@ -89,6 +89,7 @@ static struct msm_otg_platform_data msm_otg_pdata = {
 };
 
 static struct platform_device *devices[] __initdata = {
+   &msm_clock_8x50,
&msm_device_uart3,
&msm_device_smd,
&msm_device_otg,
@@ -171,7 +172,6 @@ static void __init qsd8x50_init_mmc(void)
 static void __init qsd8x50_map_io(void)
 {
msm_map_qsd8x50_io();
-   msm_clock_init(msm_clocks_8x50, msm_num_clocks_8x50);
 }
 
 static void __init qsd8x50_init_irq(void)
diff --git a/arch/arm/mach-msm/board-trout.c b/arch/arm/mach-msm/board-trout.c
index 4ba0800..c8352e7 100644
--- a/arch/arm/mach-msm/board-trout.c
+++ b/arch/arm/mach-msm/board-trout.c
@@ -36,6 +36,7 @@
 extern int trout_init_mmc(unsigned int);
 
 static struct platform_device *devices[] __initdata = {
+   &msm_clock_7x01a,
&msm_device_uart3,
&msm_device_smd,
&msm_device_nand,
@@ -93,8 +94,6 @@ static void __init trout_map_io(void)
/* route UART3 to the "H2W" extended usb connector */
writeb(0x80, TROUT_CPLD_BASE + 0x00);
 #endif
-
-   msm_clock_init(msm_clocks_7x01a, msm_num_clocks_7x01a);
 }
 
 static void __init trout_init_late(void)
diff --git a/arch/arm/mach-msm/clock-pcom.c b/arch/arm/mach-msm/clock-pcom.c
index bb75f8e..7c4c60a 100644
--- a/arch/arm/mach-msm/clock-pcom.c
+++ b/arch/arm/mach-msm/clock-pcom.c
@@ -14,8 +14,9 @@
  */
 
 #include 
-#include 
-#include 
+#include 
+#include 
+
 #include 
 
 #include "proc_comm.h"
@@ -126,3 +127,21 @@ struct clk_ops clk_ops_pcom = {
.round_rate = pc_clk_round_rate,
.is_local = pc_clk_is_local,
 };
+
+static int __devinit msm_clock_pcom_probe(struct platform_device *pdev)
+{
+   struct pcom_clk_pdata *pdata = pdev->dev.platform_data;
+   msm_clock_init(pdata->lookup, pdata->num_lookups);
+   return 0;
+}
+
+static struct platform_driver msm_clock_pcom_driver = {
+   .probe  = msm_clock_pcom_probe,
+   .driver = {
+   .name   = "msm-clock-pcom",
+   .owner  = THIS_MODULE,
+   },
+};
+module_platform_driver(msm_clock_pcom_driver);
+
+MODULE_LICENSE("GPL v2");
diff --git a/arch/arm/mach-msm/clock-pcom.h b/arch/arm/mach-msm/clock-pcom.h
index 974d003..87406a3 100644
--- a/arch/arm/mach-msm/clock-pcom.h
+++ b/arch/arm/mach-msm/clock-pcom.h
@@ -123,6 +123,1

[PATCH 03/10] msm: iommu: Convert to clk_prepare/unprepare

2012-09-20 Thread Stephen Boyd
Add calls to clk_prepare and unprepare so that MSM can migrate to
the common clock framework. We never unprepare the clocks until
driver remove because the clocks are enabled and disabled in irq
context. Finer grained power management is possible in the future
via runtime power management techniques.

Signed-off-by: Stephen Boyd 
---
 drivers/iommu/msm_iommu_dev.c | 17 ++---
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/iommu/msm_iommu_dev.c b/drivers/iommu/msm_iommu_dev.c
index 8e8fb07..d344f6a 100644
--- a/drivers/iommu/msm_iommu_dev.c
+++ b/drivers/iommu/msm_iommu_dev.c
@@ -160,7 +160,7 @@ static int msm_iommu_probe(struct platform_device *pdev)
goto fail;
}
 
-   ret = clk_enable(iommu_pclk);
+   ret = clk_prepare_enable(iommu_pclk);
if (ret)
goto fail_enable;
 
@@ -170,7 +170,7 @@ static int msm_iommu_probe(struct platform_device *pdev)
if (clk_get_rate(iommu_clk) == 0)
clk_set_min_rate(iommu_clk, 1);
 
-   ret = clk_enable(iommu_clk);
+   ret = clk_prepare_enable(iommu_clk);
if (ret) {
clk_put(iommu_clk);
goto fail_pclk;
@@ -261,7 +261,7 @@ fail_clk:
clk_put(iommu_clk);
}
 fail_pclk:
-   clk_disable(iommu_pclk);
+   clk_disable_unprepare(iommu_pclk);
 fail_enable:
clk_put(iommu_pclk);
 fail:
@@ -275,8 +275,11 @@ static int msm_iommu_remove(struct platform_device *pdev)
 
drv = platform_get_drvdata(pdev);
if (drv) {
-   if (drv->clk)
+   if (drv->clk) {
+   clk_unprepare(drv->clk);
clk_put(drv->clk);
+   }
+   clk_unprepare(drv->pclk);
clk_put(drv->pclk);
memset(drv, 0, sizeof(*drv));
kfree(drv);
@@ -314,14 +317,14 @@ static int msm_iommu_ctx_probe(struct platform_device 
*pdev)
INIT_LIST_HEAD(&ctx_drvdata->attached_elm);
platform_set_drvdata(pdev, ctx_drvdata);
 
-   ret = clk_enable(drvdata->pclk);
+   ret = clk_prepare_enable(drvdata->pclk);
if (ret)
goto fail;
 
if (drvdata->clk) {
-   ret = clk_enable(drvdata->clk);
+   ret = clk_prepare_enable(drvdata->clk);
if (ret) {
-   clk_disable(drvdata->pclk);
+   clk_disable_unprepare(drvdata->pclk);
goto fail;
}
}
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 00/10] Convert MSM to common clock framework

2012-09-20 Thread Stephen Boyd
This patchset moves the existing MSM clock code and affected drivers to the
common clock framework. A prerequisite of moving to the common clock
framework is to use clk_prepare() and clk_enable() so the first
few patches migrate drivers to that call (clk_prepare() is a no-op on MSM
right now). It also removes some custom clock APIs that MSM provides
and finally moves the proc_comm clock code to the common struct clock.

This patch series will be used as the foundation of the MSM 8660/8960
clock code that I plan to send out soon.

These patches have one dependency on the devm_clk_register() function
which I already posted to the list[1]. They're based on linux-next-20120917.

Stephen Boyd (10):
  usb: otg: msm: Convert to clk_prepare/unprepare
  msm_sdcc: Convert to clk_prepare/unprepare
  msm: iommu: Convert to clk_prepare/unprepare
  msm: iommu: Use clk_set_rate() instead of clk_set_min_rate()
  ARM: msm: Remove custom clk_set_flags() API
  ARM: msm: Remove custom clk_set_{max,min}_rate() API
  ARM: msm: Remove clock-7x30.h include file
  ARM: msm: Prepare clk_get() users in mach-msm for clock-pcom driver
  ARM: msm: Make proc_comm clock control into a platform driver
  ARM: msm: Migrate to common clock framework

 arch/arm/Kconfig   |   1 +
 arch/arm/mach-msm/Makefile |  10 +-
 arch/arm/mach-msm/board-halibut.c  |   2 +-
 arch/arm/mach-msm/board-msm7x30.c  |   2 +-
 arch/arm/mach-msm/board-qsd8x50.c  |   2 +-
 arch/arm/mach-msm/board-trout-panel.c  |  19 ++--
 arch/arm/mach-msm/board-trout.c|   3 +-
 arch/arm/mach-msm/clock-7x30.h | 155 --
 arch/arm/mach-msm/clock-debug.c| 130 --
 arch/arm/mach-msm/clock-pcom.c | 149 ++---
 arch/arm/mach-msm/clock-pcom.h |  31 +++---
 arch/arm/mach-msm/clock.c  | 166 +
 arch/arm/mach-msm/clock.h  |  51 +++---
 arch/arm/mach-msm/devices-msm7x00.c|  12 ++-
 arch/arm/mach-msm/devices-msm7x30.c|  13 ++-
 arch/arm/mach-msm/devices-qsd8x50.c|  11 ++-
 arch/arm/mach-msm/devices.h|  15 +--
 arch/arm/mach-msm/dma.c|   5 +-
 arch/arm/mach-msm/include/mach/board.h |   5 -
 arch/arm/mach-msm/include/mach/clk.h   |   9 --
 drivers/iommu/msm_iommu_dev.c  |  20 ++--
 drivers/mmc/host/msm_sdcc.c|  14 ++-
 drivers/usb/otg/msm_otg.c  |  38 
 23 files changed, 222 insertions(+), 641 deletions(-)
 delete mode 100644 arch/arm/mach-msm/clock-7x30.h
 delete mode 100644 arch/arm/mach-msm/clock-debug.c

[1] https://lkml.org/lkml/2012/9/19/28

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 04/10] msm: iommu: Use clk_set_rate() instead of clk_set_min_rate()

2012-09-20 Thread Stephen Boyd
Calling clk_set_min_rate() is no better than just calling
clk_set_rate() because MSM clock code already takes care of
calling the min_rate ops if the clock really needs
clk_set_min_rate() called on it.

Signed-off-by: Stephen Boyd 
---
 drivers/iommu/msm_iommu_dev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iommu/msm_iommu_dev.c b/drivers/iommu/msm_iommu_dev.c
index d344f6a..9144a6b 100644
--- a/drivers/iommu/msm_iommu_dev.c
+++ b/drivers/iommu/msm_iommu_dev.c
@@ -29,7 +29,6 @@
 
 #include 
 #include 
-#include 
 
 struct iommu_ctx_iter_data {
/* input */
@@ -168,7 +167,7 @@ static int msm_iommu_probe(struct platform_device *pdev)
 
if (!IS_ERR(iommu_clk)) {
if (clk_get_rate(iommu_clk) == 0)
-   clk_set_min_rate(iommu_clk, 1);
+   clk_set_rate(iommu_clk, 1);
 
ret = clk_prepare_enable(iommu_clk);
if (ret) {
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 02/10] msm_sdcc: Convert to clk_prepare/unprepare

2012-09-20 Thread Stephen Boyd
Add calls to clk_prepare and unprepare so that MSM can migrate to
the common clock framework.

Signed-off-by: Stephen Boyd 
---
 drivers/mmc/host/msm_sdcc.c | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 1d14cda..10cc05b 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1269,10 +1269,18 @@ msmsdcc_probe(struct platform_device *pdev)
goto clk_put;
}
 
+   ret = clk_prepare(host->pclk);
+   if (ret)
+   goto clk_put;
+
+   ret = clk_prepare(host->clk);
+   if (ret)
+   goto clk_unprepare_p;
+
/* Enable clocks */
ret = msmsdcc_enable_clocks(host);
if (ret)
-   goto clk_put;
+   goto clk_unprepare;
 
host->pclk_rate = clk_get_rate(host->pclk);
host->clk_rate = clk_get_rate(host->clk);
@@ -1387,6 +1395,10 @@ msmsdcc_probe(struct platform_device *pdev)
free_irq(host->stat_irq, host);
  clk_disable:
msmsdcc_disable_clocks(host, 0);
+ clk_unprepare:
+   clk_unprepare(host->clk);
+ clk_unprepare_p:
+   clk_unprepare(host->pclk);
  clk_put:
clk_put(host->clk);
  pclk_put:
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 01/10] usb: otg: msm: Convert to clk_prepare/unprepare

2012-09-20 Thread Stephen Boyd
Add calls to clk_prepare and unprepare so that MSM can migrate to
the common clock framework.

Cc: Felipe Balbi 
Signed-off-by: Stephen Boyd 
---
 drivers/usb/otg/msm_otg.c | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/usb/otg/msm_otg.c b/drivers/usb/otg/msm_otg.c
index 9f5fc90..2ae0639 100644
--- a/drivers/usb/otg/msm_otg.c
+++ b/drivers/usb/otg/msm_otg.c
@@ -514,13 +514,13 @@ static int msm_otg_suspend(struct msm_otg *motg)
motg->pdata->otg_control == OTG_PMIC_CONTROL)
writel(readl(USB_PHY_CTRL) | PHY_RETEN, USB_PHY_CTRL);
 
-   clk_disable(motg->pclk);
-   clk_disable(motg->clk);
+   clk_disable_unprepare(motg->pclk);
+   clk_disable_unprepare(motg->clk);
if (motg->core_clk)
-   clk_disable(motg->core_clk);
+   clk_disable_unprepare(motg->core_clk);
 
if (!IS_ERR(motg->pclk_src))
-   clk_disable(motg->pclk_src);
+   clk_disable_unprepare(motg->pclk_src);
 
if (motg->pdata->phy_type == SNPS_28NM_INTEGRATED_PHY &&
motg->pdata->otg_control == OTG_PMIC_CONTROL) {
@@ -552,12 +552,12 @@ static int msm_otg_resume(struct msm_otg *motg)
return 0;
 
if (!IS_ERR(motg->pclk_src))
-   clk_enable(motg->pclk_src);
+   clk_prepare_enable(motg->pclk_src);
 
-   clk_enable(motg->pclk);
-   clk_enable(motg->clk);
+   clk_prepare_enable(motg->pclk);
+   clk_prepare_enable(motg->clk);
if (motg->core_clk)
-   clk_enable(motg->core_clk);
+   clk_prepare_enable(motg->core_clk);
 
if (motg->pdata->phy_type == SNPS_28NM_INTEGRATED_PHY &&
motg->pdata->otg_control == OTG_PMIC_CONTROL) {
@@ -1468,7 +1468,7 @@ static int __init msm_otg_probe(struct platform_device 
*pdev)
if (IS_ERR(motg->pclk_src))
goto put_clk;
clk_set_rate(motg->pclk_src, INT_MAX);
-   clk_enable(motg->pclk_src);
+   clk_prepare_enable(motg->pclk_src);
} else
motg->pclk_src = ERR_PTR(-ENOENT);
 
@@ -1511,8 +1511,8 @@ static int __init msm_otg_probe(struct platform_device 
*pdev)
goto free_regs;
}
 
-   clk_enable(motg->clk);
-   clk_enable(motg->pclk);
+   clk_prepare_enable(motg->clk);
+   clk_prepare_enable(motg->pclk);
 
ret = msm_hsusb_init_vddcx(motg, 1);
if (ret) {
@@ -1532,7 +1532,7 @@ static int __init msm_otg_probe(struct platform_device 
*pdev)
}
 
if (motg->core_clk)
-   clk_enable(motg->core_clk);
+   clk_prepare_enable(motg->core_clk);
 
writel(0, USB_USBINTR);
writel(0, USB_OTGSC);
@@ -1579,8 +1579,8 @@ static int __init msm_otg_probe(struct platform_device 
*pdev)
 free_irq:
free_irq(motg->irq, motg);
 disable_clks:
-   clk_disable(motg->pclk);
-   clk_disable(motg->clk);
+   clk_disable_unprepare(motg->pclk);
+   clk_disable_unprepare(motg->clk);
 ldo_exit:
msm_hsusb_ldo_init(motg, 0);
 vddcx_exit:
@@ -1593,7 +1593,7 @@ put_core_clk:
clk_put(motg->pclk);
 put_pclk_src:
if (!IS_ERR(motg->pclk_src)) {
-   clk_disable(motg->pclk_src);
+   clk_disable_unprepare(motg->pclk_src);
clk_put(motg->pclk_src);
}
 put_clk:
@@ -1643,12 +1643,12 @@ static int __devexit msm_otg_remove(struct 
platform_device *pdev)
if (cnt >= PHY_SUSPEND_TIMEOUT_USEC)
dev_err(phy->dev, "Unable to suspend PHY\n");
 
-   clk_disable(motg->pclk);
-   clk_disable(motg->clk);
+   clk_disable_unprepare(motg->pclk);
+   clk_disable_unprepare(motg->clk);
if (motg->core_clk)
-   clk_disable(motg->core_clk);
+   clk_disable_unprepare(motg->core_clk);
if (!IS_ERR(motg->pclk_src)) {
-   clk_disable(motg->pclk_src);
+   clk_disable_unprepare(motg->pclk_src);
clk_put(motg->pclk_src);
}
msm_hsusb_ldo_init(motg, 0);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 06/10] ARM: msm: Remove custom clk_set_{max,min}_rate() API

2012-09-20 Thread Stephen Boyd
There are no users of this API anymore so let's just remove it.
If a need arises in the future we can extend the common clock API
to handle it.

Cc: Saravana Kannan 
Signed-off-by: Stephen Boyd 
---
 arch/arm/mach-msm/clock-debug.c  |  9 +
 arch/arm/mach-msm/clock.c| 12 
 arch/arm/mach-msm/include/mach/clk.h |  6 --
 3 files changed, 1 insertion(+), 26 deletions(-)

diff --git a/arch/arm/mach-msm/clock-debug.c b/arch/arm/mach-msm/clock-debug.c
index 4886404..c4b34d7 100644
--- a/arch/arm/mach-msm/clock-debug.c
+++ b/arch/arm/mach-msm/clock-debug.c
@@ -25,14 +25,7 @@ static int clock_debug_rate_set(void *data, u64 val)
struct clk *clock = data;
int ret;
 
-   /* Only increases to max rate will succeed, but that's actually good
-* for debugging purposes so we don't check for error. */
-   if (clock->flags & CLK_MAX)
-   clk_set_max_rate(clock, val);
-   if (clock->flags & CLK_MIN)
-   ret = clk_set_min_rate(clock, val);
-   else
-   ret = clk_set_rate(clock, val);
+   ret = clk_set_rate(clock, val);
if (ret != 0)
printk(KERN_ERR "clk_set%s_rate failed (%d)\n",
(clock->flags & CLK_MIN) ? "_min" : "", ret);
diff --git a/arch/arm/mach-msm/clock.c b/arch/arm/mach-msm/clock.c
index 5fac2df..8d07b25 100644
--- a/arch/arm/mach-msm/clock.c
+++ b/arch/arm/mach-msm/clock.c
@@ -97,18 +97,6 @@ long clk_round_rate(struct clk *clk, unsigned long rate)
 }
 EXPORT_SYMBOL(clk_round_rate);
 
-int clk_set_min_rate(struct clk *clk, unsigned long rate)
-{
-   return clk->ops->set_min_rate(clk->id, rate);
-}
-EXPORT_SYMBOL(clk_set_min_rate);
-
-int clk_set_max_rate(struct clk *clk, unsigned long rate)
-{
-   return clk->ops->set_max_rate(clk->id, rate);
-}
-EXPORT_SYMBOL(clk_set_max_rate);
-
 int clk_set_parent(struct clk *clk, struct clk *parent)
 {
return -ENOSYS;
diff --git a/arch/arm/mach-msm/include/mach/clk.h 
b/arch/arm/mach-msm/include/mach/clk.h
index 5f1c37d..fd4f4a7 100644
--- a/arch/arm/mach-msm/include/mach/clk.h
+++ b/arch/arm/mach-msm/include/mach/clk.h
@@ -25,12 +25,6 @@ enum clk_reset_action {
 
 struct clk;
 
-/* Rate is minimum clock rate in Hz */
-int clk_set_min_rate(struct clk *clk, unsigned long rate);
-
-/* Rate is maximum clock rate in Hz */
-int clk_set_max_rate(struct clk *clk, unsigned long rate);
-
 /* Assert/Deassert reset to a hardware block associated with a clock */
 int clk_reset(struct clk *clk, enum clk_reset_action action);
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V2] perf: Fix parallel build

2012-09-20 Thread Eric Sandeen
On 9/20/12 9:07 PM, Namhyung Kim wrote:
> Hi again,
> 
> On Thu, 20 Sep 2012 20:12:50 -0500, Eric Sandeen wrote:
>> -$(OUTPUT)util/parse-events-flex.c: util/parse-events.l
>> +$(OUTPUT)util/parse-events-flex.c: util/parse-events.l 
>> util/parse-events-bison.c
> 
> I realized that the generated *-bison.c files should have $(OUTPUT)
> prefix since they can be under another directory than *.[ly] files.
> 
> 
>>  $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h 
>> $(PARSER_DEBUG_FLEX) -t util/parse-events.l > 
>> $(OUTPUT)util/parse-events-flex.c
>>  
>>  $(OUTPUT)util/parse-events-bison.c: util/parse-events.y
>>  $(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) 
>> -o $(OUTPUT)util/parse-events-bison.c
>>  
>> -$(OUTPUT)util/pmu-flex.c: util/pmu.l
>> +$(OUTPUT)util/pmu-flex.c: util/pmu.l util/pmu-bison.c
> 
> Ditto.

Sorry.  Too long since I worked on Makefiles :(

V3 soon ;)

-Eric

> Thanks,
> Namhyung
> 
> 
>>  $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t 
>> util/pmu.l > $(OUTPUT)util/pmu-flex.c
>>  
>>  $(OUTPUT)util/pmu-bison.c: util/pmu.y

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v6 1/6] thermal: add generic cpufreq cooling implementation

2012-09-20 Thread jonghwa3 . lee
Hi, Amit,
On 2012년 08월 16일 20:41, Amit Daniel Kachhap wrote:

>  diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
>  new file mode 100644
>  index 000..66cbd52
>  --- /dev/null
>  +++ b/drivers/thermal/cpu_cooling.c
>  @@ -0,0 +1,586 @@

>  +/**
>  + * cpufreq_cooling_register - function to create cpufreq cooling device.
>  + * @clip_cpus: cpumask of cpus where the frequency constraints will happen.
>  + */
>  +struct thermal_cooling_device *cpufreq_cooling_register(
>  +   struct cpumask *clip_cpus)
>  +{
>  +   struct thermal_cooling_device *cool_dev;
>  +   struct cpufreq_cooling_device *cpufreq_dev = NULL;
>  +   unsigned int cpufreq_dev_count = 0, min = 0, max = 0;
>  +   char dev_name[THERMAL_NAME_LENGTH];
>  +   int ret = 0, id = 0, i;
>  +   struct cpufreq_policy policy;
>  +   ret = get_idr(&cpufreq_idr,&cpufreq_dev->id);
>  +   if (ret) {
>  +   kfree(cpufreq_dev);
>  +   return ERR_PTR(-EINVAL);
>  +   }
>  +
>  +   sprintf(dev_name, "thermal-cpufreq-%d", cpufreq_dev->id);
>  +
>  +   cool_dev = thermal_cooling_device_register(dev_name, cpufreq_dev,
>  +&cpufreq_cooling_ops);
>  +   if (!cool_dev) {
>  +   release_idr(&cpufreq_idr, cpufreq_dev->id);
>  +   kfree(cpufreq_dev);
>  +   return ERR_PTR(-EINVAL);
>  +   }
>  +   cpufreq_dev->id = id;


Why is this needed? Should every cpufreq_dev instance's id be same for
zero? It looks odd. And it also has problem which can be occurred when
it release id during unregistering cpufreq_dev. I think it should keep
the idr value taken before.


>  1.7.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: Davicom DM9000C driver

2012-09-20 Thread Michael Chen
Dear Arnd and Linux Expert,

First of all, appreciate you all for your efforts on our DM9000C driver. 

Davicom Semiconductor Inc. is a fabless IC design house, located in Taiwan.
DM9000C is 10/100Mbps Ethernet IC with ISA-like interface.

Meanwhile, to facilitate the coming works with you efficiently, the key
members at Davicom side will be:
Mr. Allen Huang, PM
Mr. Russell Liu, Sr. FAE
Mr. Joseph Chang, Sr. Software Manager

Look forward to your guidance to make our product driver conform Linux.

Thanks.

BR,
Michael Chen
Director
Davicom Semiconductor Inc.
www.davicom.com.tw

-Original Message-
From: Arnd Bergmann [mailto:a...@arndb.de] 
Sent: Thursday, September 20, 2012 7:03 PM
To: Jonathan Corbet
Cc: Allen Huang ("黃偉格"); linux-kernel@vger.kernel.org; 'Michael Chen';
'Charles'; 'Joseph Chang'
Subject: Re: Davicom DM9000C driver

On Thursday 20 September 2012, Arnd Bergmann wrote:
> On Wednesday 19 September 2012, Jonathan Corbet wrote:
> > On Wed, 19 Sep 2012 13:58:08 +0800
> > Allen Huang (黃偉格)   wrote:
> > 
> > > I'm Allen Huang from Davicom. We are hereby opensourcing the linux
> > > driver for our DM9000C. 
> > 
> > That is great, but please read the development process documentation on
> > how best to submit something like this.  We would much rather see a
patch
> > (inline, not as an attachment) to facilitate the review.
> 
> More importantly, the patch should be against the version that is
> already present in the kernel as drivers/net/ethernet/davicom/dm9000.c,
> which appears to be mostly the same as the version that is submitted
> here.
> 
> So while all the comments on the driver are valuable, they also apply
> to the code we already have since 2005.

For fun, I've also tracked down the version that the new submission is
branched from, it's 2.6.29 with a small number of bug fixes that
are in later version. Here is the diff against the 2.6.29 version
of the driver. There are a few changes to the PHY handling that
are not also upstream in 3.6. It's probably worth submitting them
separately with a good explanation why they are required.

Arnd

diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 254ec62..2cd4f0b 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -17,6 +17,13 @@
  * Additional updates, Copyright:
  * Ben Dooks 
  * Sascha Hauer 
+ *  
+ * 2010.07.20 V_R1 1.Write PHY Reg27 = 0xE100
+ *  2.Just
enable PHY once after GPIO setting in dm9000_init_dm9000()
+ *  3.Remove
power down PHY in dm9000_shutdown()
+ * 2010.07.20 V_R2 1.Delay 20ms after PHY power on
+ *  2.Reset PHY
after PHY power on in dm9000_init_dm9000()
+ * 2012.06.05 KT2.6.31_R2 1. Add the solution to fix the power-on FIFO data
bytes shift issue! (Wr NCR 0x03)
  */
 
 #include 
@@ -25,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -45,7 +53,7 @@
 #define DM9000_PHY 0x40/* PHY address 0x01 */
 
 #define CARDNAME   "dm9000"
-#define DRV_VERSION"1.31"
+#define DRV_VERSION"2.6.31"
 
 /*
  * Transmit timeout, default 5 seconds.
@@ -126,6 +134,10 @@ typedef struct board_info {
u32 msg_enable;
 } board_info_t;
 
+static void
+dm9000_phy_write(struct net_device *dev,
+int phyaddr_unused, int reg, int value);
+
 /* debug code */
 
 #define dm9000_dbg(db, lev, msg...) do {   \
@@ -556,6 +568,18 @@ static void dm9000_show_carrier(board_info_t *db,
dev_info(db->dev, "%s: link down\n", ndev->name);
 }
 
+
+static unsigned char dm9000_type_to_char(enum dm9000_type type)
+{
+   switch (type) {
+   case TYPE_DM9000E: return 'e';
+   case TYPE_DM9000A: return 'a';
+   case TYPE_DM9000B: return 'b';
+   }
+
+   return '?';
+}
+
 static void
 dm9000_poll_work(struct work_struct *w)
 {
@@ -563,8 +587,11 @@ dm9000_poll_work(struct work_struct *w)
board_info_t *db = container_of(dw, board_info_t, phy_poll);
struct net_device *ndev = db->ndev;
 
-   if (db->flags & DM9000_PLATF_SIMPLE_PHY &&
-   !(db->flags & DM9000_PLATF_EXT_PHY)) {
+//JJ2
+// if (db->flags & DM9000_PLATF_SIMPLE_PHY &&
+// !(db->flags & DM9000_PLATF_EXT_PHY)) {
+//  =
+   if(1){  
unsigned nsr = dm9000_read_locked(db, DM9000_NSR);
unsigned old_carrier = netif_carrier_ok(ndev) ? 1 : 0;
unsigned new_carrier;
@@ -572,6 +599,12 @@ dm9000_poll_work(struct work_struct *w)
new_carrier = (nsr & NSR_LINKST) ? 1 : 0;
 
if (old_carrier != new_carrier) {
+   
+   if (new_carrier)
+ printk(KERN_INFO "[dm9000%c %s Ethernet Driver,
V%s]: Link-Up!!\n",dm9000_type_to_char(db->type),

Re: [PATCH V2] perf: Fix parallel build

2012-09-20 Thread Namhyung Kim
Hi again,

On Thu, 20 Sep 2012 20:12:50 -0500, Eric Sandeen wrote:
> -$(OUTPUT)util/parse-events-flex.c: util/parse-events.l
> +$(OUTPUT)util/parse-events-flex.c: util/parse-events.l 
> util/parse-events-bison.c

I realized that the generated *-bison.c files should have $(OUTPUT)
prefix since they can be under another directory than *.[ly] files.


>   $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h 
> $(PARSER_DEBUG_FLEX) -t util/parse-events.l > 
> $(OUTPUT)util/parse-events-flex.c
>  
>  $(OUTPUT)util/parse-events-bison.c: util/parse-events.y
>   $(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) 
> -o $(OUTPUT)util/parse-events-bison.c
>  
> -$(OUTPUT)util/pmu-flex.c: util/pmu.l
> +$(OUTPUT)util/pmu-flex.c: util/pmu.l util/pmu-bison.c

Ditto.

Thanks,
Namhyung


>   $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t 
> util/pmu.l > $(OUTPUT)util/pmu-flex.c
>  
>  $(OUTPUT)util/pmu-bison.c: util/pmu.y
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mm: fix NR_ISOLATED_[ANON|FILE] mismatch

2012-09-20 Thread Johannes Weiner
On Fri, Sep 21, 2012 at 08:24:08AM +0900, Minchan Kim wrote:
> On Thu, Sep 20, 2012 at 11:41:11AM -0400, Johannes Weiner wrote:
> > On Thu, Sep 20, 2012 at 08:51:56AM +0900, Minchan Kim wrote:
> > > From: Minchan Kim 
> > > Date: Thu, 20 Sep 2012 08:39:52 +0900
> > > Subject: [PATCH] mm: revert 0def08e3, mm/mempolicy.c: check return code of
> > >  check_range

[...]

> From: Minchan Kim 
> Date: Fri, 21 Sep 2012 08:17:37 +0900
> Subject: [PATCH] mm: enhance comment and bug check
> 
> This patch updates comment and bug check.
> It can be fold into [1].
> 
> [1] mm-revert-0def08e3-mm-mempolicyc-check-return-code-of-check_range.patch
> 
> Cc: KOSAKI Motohiro 
> Suggested-by: Johannes Weiner 
> Signed-off-by: Minchan Kim 

Thanks!  To the patch and this update:

Acked-by: Johannes Weiner 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH rcu] Move TINY_RCU quiescent state out of extended quiescent state

2012-09-20 Thread Li Zhong
TINY_RCU's rcu_idle_enter_common() invokes rcu_sched_qs() in order
to inform the RCU core of the quiescent state implied by idle entry.
Of course, idle is also an extended quiescent state, so that the call
to rcu_sched_qs() speeds up RCU's invoking of any callbacks that might
be queued.  This speed-up is important when entering into dyntick-idle
mode -- if there are no further scheduling-clock interrupts, the callbacks
might never be invoked, which could result in a system hang.

However, processing callbacks does event tracing, which in turn
implies RCU read-side critical sections, which are illegal in extended
quiescent states.  This patch therefore moves the call to rcu_sched_qs()
so that it precedes the point at which we set the new value of 
rcu_dynticks_nesting, which may indicate RCU is in an extended quiescent
state. 

Signed-off-by: Li Zhong 
Signed-off-by: Paul E. McKenney 
---
 kernel/rcutiny.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
index 2e073a2..e4c6a59 100644
--- a/kernel/rcutiny.c
+++ b/kernel/rcutiny.c
@@ -75,9 +75,9 @@ static void rcu_idle_enter_common(long long newval)
  current->pid, current->comm,
  idle->pid, idle->comm); /* must be idle task! */
}
+   rcu_sched_qs(0); /* implies rcu_bh_qsctr_inc(0) */
barrier();
rcu_dynticks_nesting = newval;
-   rcu_sched_qs(0); /* implies rcu_bh_qsctr_inc(0) */
 }
 
 /*
-- 
1.7.9.5



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] ACPI: Reorder IPMI driver before any other ACPI drivers

2012-09-20 Thread Corey Minyard

On 09/20/2012 08:26 PM, Matthew Garrett wrote:

On Thu, Sep 20, 2012 at 08:19:48PM -0500, Corey Minyard wrote:

On 09/20/2012 04:46 PM, Matthew Garrett wrote:

Drivers may make calls that require the ACPI IPMI driver to have been
initialised already, so make sure that it appears earlier in the build
order.

The IPMI driver uses the ACPI namespace as an option to know the
address and characteristics of the device.  Does that still work?

Yes, the ACPI interpreter is initialised earlier than the IPMI driver
discovery.


Cool, I'm good with these, then.

Thanks,

-corey
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net-next] net1080: Neaten netdev_dbg use

2012-09-20 Thread David Miller
From: Joe Perches 
Date: Thu, 20 Sep 2012 17:10:23 -0700

> Remove unnecessary temporary variable and #ifdef DEBUG block.
> 
> Signed-off-by: Joe Perches 

Applied, thanks Joe.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Subject: [PATCH] drivers-core: move device_pm_remove behind bus_remove_device

2012-09-20 Thread Zhang, LongX
From: LongX Zhang 

device_pm_remove will call pm_runtime_remove which would disable
runtime PM of the device. After that pm_runtime_get* or
pm_runtime_put* will be ingored. So if we disable the runtime PM
before device really be removed, drivers' _remove callback may
access HW even pm_runtime_get* fails. That is bad.

Signed-off-by: LongX Zhang 
---
 drivers/base/core.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 5e6e00b..81ea7f2 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1169,7 +1169,6 @@ void device_del(struct device *dev)
if (dev->bus)
blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
 BUS_NOTIFY_DEL_DEVICE, dev);
-   device_pm_remove(dev);
dpm_sysfs_remove(dev);
if (parent)
klist_del(&dev->p->knode_parent);
@@ -1194,6 +1193,7 @@ void device_del(struct device *dev)
device_remove_file(dev, &uevent_attr);
device_remove_attrs(dev);
bus_remove_device(dev);
+   device_pm_remove(dev);
driver_deferred_probe_del(dev);
 
/*
-- 
1.7.10

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 4/5] PCI/IOV: simplify code by hotplug safe pci_get_domain_bus_and_slot()

2012-09-20 Thread Yinghai Lu
On Thu, Sep 20, 2012 at 4:59 PM, Bjorn Helgaas  wrote:
> On Thu, Sep 20, 2012 at 2:38 PM, Yinghai Lu  wrote:
>> in that case, VFs  are stopped before PF, so they are not in device
>> tree anymore.
>> so pci_get_domain_bus_and_slot will not find those VFs.
>>
>> So the reference to PF is not released. Also vit_bus may not be released too.
>>
>> So you have to rework
>> pci_get_domain_bus_and_slot to make it work on pci devices get stopped 
>> only.
>>
>> or just drop this from the tree.
>
> pci_find_bus() is a broken interface (because there's no reference
> counting or safety with respect to hot-plug), and if the design
> depends on it, that means the design is broken, too.  I don't think
> reworking pci_get_domain_bus_and_slot() is the right answer.
>
> It's not clear to me why we need the split between stopping and
> removing devices.  That split leads to these zombie devices that have
> been stopped and are no longer findable by bus_find_device() (which is
> used by pci_get_domain_bus_and_slot()), but still "exist" in some
> fashion until they're removed.  It's unreasonable for random PCI and
> driver code to have to worry about that zombie state.

That is not zombie state. that is driver unloaded, and not in /sys, /proc.
that pci device only can be found under bus->devices.

just like we have pci_device_add and pci_bus_add_device
or acpi add and acpi start.

Splitting stop and remove should be more clean than mixing stop and remove.

>
> I'll revert this patch for now to fix the regression.  Of course, that
> means we will still have the old problem of using the unsafe
> pci_find_bus().
>
>> BTW, Bjorn,
>> for the similar reason,  you need to apply
>> http://git.kernel.org/?p=linux/kernel/git/yinghai/linux-yinghai.git;a=commitdiff;h=e5a50aa3dfca1331c7c783412b1524bea06d2752
>> ...
>> the reason is:
>>
>> We stop all VFs at first , stop PF
>> before we stop PF, we can not remove VFs,
>>
>> otherwise virtfn_remove does not work properly to remove reference and
>> virtfn bus while can not find vf.
>
> I'll apply this one, too, for now.  I put them both on the
> pci/yinghai-revert-pci_find_bus-and-remove-cleanup branch.  Let me
> know if that's not what you expected.

Yes, they are good.

>
> I'm not happy about either reverting Jiang's patch or splitting
> stop/remove again.  It complicates the design and the code.  I'll
> apply them because they're regressions, and we don't have time for
> redesign before 3.7.  But I encourage you to think about how to do
> this more cleanly.

That will need to redesign sriov implementation.

Also that pci root bus add/start, stop/remove will need special
sequence to make ioapic
and dmar to be started early before normal pci device drivers and
stopped after normal pci device drivers.

-Yinghai
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC 3/3] PCI/PM: Disable PME poll for PCIe devices

2012-09-20 Thread Huang Ying
On Thu, 2012-09-20 at 21:31 +0200, Rafael J. Wysocki wrote:
> On Monday, September 17, 2012, Huang Ying wrote:
> > PME poll is not necessary for PCIe devices, because PCIe devices use
> > in-band PME message and IRQ on PCIe port to report PME.
> 
> Alas, not all of them as it turns out and even if they do, it doesn't
> work for some of them. That's why we've added the PCIe devices polling
> (quite recently, for that matter).
> 
> If you'd spent some time on some proper research regarding that (like browsing
> the changelogs of git commits modifying the relevant part of 
> drivers/pci/pci.c),
> you'd have known that already.
> 
> And that actually is quite important, because I don't have to remember every
> single PM-related change we're making in the PCI layer.  I _incidentally_ do
> remember this one, but that may not happen next time.  Please do the research
> _before_ proposing changes of this kind.

Sorry.  I should have done more research before sending the patch out.
Will do more research next time.

Best Regards,
Huang Ying


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH V2] poweroff: fix bug in orderly_poweroff

2012-09-20 Thread Feng Hong
Hi, Serge, Andrew,

Will following an acceptable change log ?

/
orderly_poweroff is trying to poweroff platform by two steps:
step 1: Call user space application to poweroff
step 2: If user space poweroff fail, then do a force power off if force param 
is set.
The bug here is, step 1 is always successful with param UMH_NO_WAIT, which obey
the design goal of orderly_poweroff.

We have two choices here:
UMH_WAIT_EXEC which means wait for the exec, but not the process;
UMH_WAIT_PROC which means wait for the process to complete.
we need to trade off the two choices:

If using UMH_WAIT_EXEC, there is potential issue comments by Serge E. Hallyn: 
The exec will
have started, but may for whatever (very unlikely) reason fail.

If using UMH_WAIT_PROC, there is potential issue comments by Eric W. Biederman: 
If the caller
is not running in a kernel thread then we can easily get into a case where the 
user space caller
will block waiting for us when we are waiting for the user space caller.

Thanks for their excellent ideas, based on the above discussion, we finally 
choose UMH_WAIT_EXEC,
which is much more safe, if the user application really fails, we just complain 
the application
itself, it seems a better choice here.
//

--
Best Regards,
Feng Hong
Application Processor Software Engnieer 
Marvell Technology (Shanghai) Ltd


-Original Message-
From: Andrew Morton [mailto:a...@linux-foundation.org] 
Sent: 2012年9月21日 8:25
To: Feng Hong
Cc: Serge E. Hallyn; gorcu...@openvz.org; keesc...@chromium.org; 
serge.hal...@canonical.com; ebied...@xmission.com; linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] poweroff: fix bug in orderly_poweroff

On Thu, 20 Sep 2012 17:16:35 -0700
Feng Hong  wrote:

> I am just a graduate and it's my first time to send a patch to
> opensource, so thank you very much for reminding me the "changelog
> affairs", it seems this patch has been added to -mm tree as attached
> mail, and I have no chance to change the comments, right ?  Then I must
> remember this and be careful next time.  Thanks again for reminding me!

It depends.  If the person who committed the patch was using a git tree
then it can be difficult for them to alter a changelog.

But the -mm tree is not mastered in git (for this and other reasons),
and I alter changelogs all the time.  So please feel free to send
replacement text and I shall copy-n-paste that text straight into the patch.



Re: [PATCH] [V2]power: battery: Generic battery driver using IIO

2012-09-20 Thread Anton Vorontsov
On Tue, Sep 18, 2012 at 11:33:20PM +0530, anish kumar wrote:
> From: anish kumar 
> 
> In last version:
> Addressed concerns raised by lars:
> a. made the adc_bat per device.
> b. get the IIO channel using hardcoded channel names.
> c. Minor issues related to gpio_is_valid and some code
>refactoring.
> 
> In V1:
> Addressed concerns raised by Anton:
> a. changed the struct name to gab(generic adc battery).
> b. Added some functions to neaten the code.
> c. Some minor coding guidelines changes.
> d. Used the latest function introduce by lars:
>iio_read_channel_processed to streamline the code.
> 
> In V2:
> Addressed concerns by lars:
> a. No need of allocating memory for channels.Make it array.
> b. Code restructring, coding style and following kernel guidelines changes
>suggested by him.
> 
> Signed-off-by: anish kumar 
> ---

OK, the code turns into a nicely looking driver, congratulations!

I noticed that patch depends on iio_read_channel_processed(), so it will
have to go via IIO tree. But I'll happily give you my ack, once the final
bits are fixed...

The biggest issues is that the patch is missing Kconfig and Makefile
entries. :-)

And some cosmetic stuff down below...

>  drivers/power/generic-adc-battery.c   |  429 
> +
>  include/linux/power/generic-adc-battery.h |   28 ++
>  2 files changed, 457 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/power/generic-adc-battery.c
>  create mode 100644 include/linux/power/generic-adc-battery.h
> 
> diff --git a/drivers/power/generic-adc-battery.c 
> b/drivers/power/generic-adc-battery.c
> new file mode 100644
> index 000..746a210
> --- /dev/null
> +++ b/drivers/power/generic-adc-battery.c
> @@ -0,0 +1,429 @@
> +/*
> + * Generic battery driver code using IIO
> + * Copyright (C) 2012, Anish Kumar 
> + * based on jz4740-battery.c
> + * based on s3c_adc_battery.c
> + *
> + * This file is subject to the terms and conditions of the GNU General Public
> + * License.  See the file COPYING in the main directory of this archive for
> + * more details.
> + *
> + */
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define JITTER_DEFAULT 10 /* hope 10ms is enough */
> +
> +enum gab_chan_type {
> + VOLTAGE = 0,
> + CURRENT,
> + POWER,
> + MAX_CHAN_TYPE

These are still in the global namespace. Please prefix them with
GAB_.

> +};
> +
> +/*
> + * gab_chan_name suggests the standard channel names for commonly used
> + * channel types.
> + */
> +static const char *const gab_chan_name[] = {
> + [VOLTAGE]   = "voltage",
> + [CURRENT]   = "current",
> + [POWER] = "power",
> +};
> +
> +struct gab {
> + struct power_supply psy;
> + struct iio_channel  *channel[MAX_CHAN_TYPE];
> + struct gab_platform_data*pdata;
> + struct delayed_work bat_work;
> + int level;
> + int status;
> + int cable_plugged:1;

This gives me:

CHECK   drivers/power/generic-adc-battery.c
drivers/power/generic-adc-battery.c:53:32: error: dubious one-bit signed 
bitfield

You can just use 'bool' instead of 'int'.

> +};
> +
> +struct gab *to_generic_bat(struct power_supply *psy)
> +{
> + return  container_of(psy, struct gab, psy);

No need for double whitespace.

> +}
> +
> +static void gab_ext_power_changed(struct power_supply *psy)
> +{
> + struct gab *adc_bat;
> + adc_bat = to_generic_bat(psy);

This can be merged into one line.

struct gab *adc_bat = to_generic_bat(psy);

> +
> + schedule_delayed_work(&adc_bat->bat_work,
> + msecs_to_jiffies(0));

This will fit into one line.

> +}
> +
> +static const enum power_supply_property gab_props[] = {
> + POWER_SUPPLY_PROP_STATUS,
> + POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
> + POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN,
> + POWER_SUPPLY_PROP_CHARGE_NOW,
> + POWER_SUPPLY_PROP_VOLTAGE_NOW,
> + POWER_SUPPLY_PROP_CURRENT_NOW,
> + POWER_SUPPLY_PROP_TECHNOLOGY,
> + POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
> + POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
> + POWER_SUPPLY_PROP_MODEL_NAME,
> +};
> +
> +/*
> + * This properties are set based on the received platform data and this
> + * should correspond one-to-one with enum chan_type.
> + */
> +static const enum power_supply_property gab_dyn_props[] = {
> + POWER_SUPPLY_PROP_VOLTAGE_NOW,
> + POWER_SUPPLY_PROP_CURRENT_NOW,
> + POWER_SUPPLY_PROP_POWER_NOW,
> +};
> +
> +static bool gab_charge_finished(struct gab *adc_bat)
> +{
> + struct gab_platform_data *pdata = adc_bat->pdata;
> + bool ret = gpio_get_value(pdata->gpio_charge_finished);
> + bool inv = pdata->gpio_inverted;
> +
> + if (!gpio_is_valid(pdata->gpio_charge_finished))
> + return false;
> + return ret ^ inv;
> +}
> +
> +static int gab_get_status(struct gab *adc_bat)
>

Re: kernel BUG at kernel/sched/core.c:1465!

2012-09-20 Thread Michael Wang
On 09/20/2012 08:58 PM, Borislav Petkov wrote:
> On Thu, Sep 20, 2012 at 02:38:47PM +0800, Michael Wang wrote:
>> Could you please try below patch and see whether the new WARNING
>> appear or not?
>>
>> And cc Tejun Heo  since wq_worker_sleeping() doesn't
>> work as it's introduced...
> 
> Ok, now that you mentioned workqueues, I remember the powernow-k8
> workaround from Tejun a couple of days ago and looking at Linus' tree
> from today, he actually merged a fix for exactly that:
> 
> commit c5c473e29c641380aef4a9d1f9c39de49219980f
> Merge: 925a6f0bf8bd 6889125b8b4e
> Author: Linus Torvalds 
> Date:   Wed Sep 19 11:00:07 2012 -0700
> 
> Merge branch 'for-3.6-fixes' of 
> git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
> 
> Pull workqueue / powernow-k8 fix from Tejun Heo:
>  "This is the fix for the bug where cpufreq/powernow-k8 was tripping
>   BUG_ON() in try_to_wake_up_local() by migrating workqueue worker to a
>   different CPU.
> 
> and this is exactly the same BUG_ON I'm hitting. and powernowk8_target
> is in the stack trace so it has to be the same issue.
> 
> I'll update my tree to latest Linus and retest.

Happen to see the problem solved.

Regards,
Michael Wang

> 
> Thanks for pointing this out.
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: build failure after merge of the final tree (net-next tree related)

2012-09-20 Thread Stephen Rothwell
Hi Dave,

On Thu, 20 Sep 2012 17:36:22 +1000 Stephen Rothwell  
wrote:
>
> After merging the final tree, today's linux-next build (powerpc
> allyesconfig) failed like this:
> 
> drivers/net/ethernet/i825xx/znet.c: In function 'hardware_init':
> drivers/net/ethernet/i825xx/znet.c:868:2: error: implicit declaration of 
> function 'isa_virt_to_bus' [-Werror=implicit-function-declaration]
> 
> Caused by commit 1d3ff76759b7 ("i825xx: znet: fix compiler warnings when
> building a 64-bit kernel").  Is there some Kconfig dependency missing 
> (CONFIG_ISA)?
> 
> I have reverted that commit for today.

Today, I have added the following merge fix patch instead of reverting the
above (just until PowerPC can be fixed one way or the other).  I don't
know if you want to put this into the net-next tree, but it may be a
reasonable temporary measure.

From: Stephen Rothwell 
Date: Fri, 21 Sep 2012 11:32:09 +1000
Subject: [PATCH] i825xx: znet: temporarily disable on PPC

due to build problems

Signed-off-by: Stephen Rothwell 
---
 drivers/net/ethernet/i825xx/Kconfig |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/i825xx/Kconfig 
b/drivers/net/ethernet/i825xx/Kconfig
index fed5080..9fce38b 100644
--- a/drivers/net/ethernet/i825xx/Kconfig
+++ b/drivers/net/ethernet/i825xx/Kconfig
@@ -151,6 +151,7 @@ config SUN3_82586
 config ZNET
tristate "Zenith Z-Note support (EXPERIMENTAL)"
depends on EXPERIMENTAL && ISA_DMA_API
+   depends on !PPC
---help---
  The Zenith Z-Note notebook computer has a built-in network
  (Ethernet) card, and this is the Linux driver for it. Note that the
-- 
1.7.10.280.gaa39

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpdoLLQvO0kM.pgp
Description: PGP signature


linux-next: manual merge of the net-next tree with the net tree

2012-09-20 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the net-next tree got a conflict in 
drivers/net/usb/qmi_wwan.c between commit 9db273f45686 ("net: qmi_wwan: adding 
Huawei E367, ZTE MF683 and Pantech P4200") from the net tree and commit 
bd877e489126 ("net: qmi_wwan: use a single bind function for all device types") 
from the net-next tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc drivers/net/usb/qmi_wwan.c
index 3543c9e,e7b53f0..000
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@@ -366,21 -353,17 +353,21 @@@ static const struct usb_device_id produ
},
  
/* 2. Combined interface devices matching on class+protocol */
 +  {   /* Huawei E367 and possibly others in "Windows mode" */
 +  USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 
USB_CLASS_VENDOR_SPEC, 1, 7),
 +  .driver_info= (unsigned long)&qmi_wwan_info,
 +  },
{   /* Huawei E392, E398 and possibly others in "Windows mode" */
USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 
USB_CLASS_VENDOR_SPEC, 1, 17),
-   .driver_info= (unsigned long)&qmi_wwan_shared,
+   .driver_info= (unsigned long)&qmi_wwan_info,
},
 -  {   /* Pantech UML290 */
 -  USB_DEVICE_AND_INTERFACE_INFO(0x106c, 0x3718, 
USB_CLASS_VENDOR_SPEC, 0xf0, 0xff),
 +  {   /* Pantech UML290, P4200 and more */
 +  USB_VENDOR_AND_INTERFACE_INFO(0x106c, USB_CLASS_VENDOR_SPEC, 
0xf0, 0xff),
-   .driver_info= (unsigned long)&qmi_wwan_shared,
+   .driver_info= (unsigned long)&qmi_wwan_info,
},
{   /* Pantech UML290 - newer firmware */
 -  USB_DEVICE_AND_INTERFACE_INFO(0x106c, 0x3718, 
USB_CLASS_VENDOR_SPEC, 0xf1, 0xff),
 +  USB_VENDOR_AND_INTERFACE_INFO(0x106c, USB_CLASS_VENDOR_SPEC, 
0xf1, 0xff),
-   .driver_info= (unsigned long)&qmi_wwan_shared,
+   .driver_info= (unsigned long)&qmi_wwan_info,
},
  
/* 3. Combined interface devices matching on interface number */


pgpFwQcgU0opt.pgp
Description: PGP signature


[PATCH] backlight: platform-lcd: Add support for device tree based probe

2012-09-20 Thread Jingoo Han
This patch adds the of_match_table to platform-lcd driver to be
probed when platform-lcd device node is found in the device tree.

Cc: Richard Purdie 
Signed-off-by: Jingoo Han 
---
 drivers/video/backlight/platform_lcd.c |9 +
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/video/backlight/platform_lcd.c 
b/drivers/video/backlight/platform_lcd.c
index b667234..574d5ee 100644
--- a/drivers/video/backlight/platform_lcd.c
+++ b/drivers/video/backlight/platform_lcd.c
@@ -145,6 +145,14 @@ static SIMPLE_DEV_PM_OPS(platform_lcd_pm_ops, 
platform_lcd_suspend,
platform_lcd_resume);
 #endif
 
+#ifdef CONFIG_OF
+static const struct of_device_id platform_lcd_of_match[] = {
+   { .compatible = "platform-lcd" },
+   {},
+};
+MODULE_DEVICE_TABLE(of, platform_lcd_of_match);
+#endif
+
 static struct platform_driver platform_lcd_driver = {
.driver = {
.name   = "platform-lcd",
@@ -152,6 +160,7 @@ static struct platform_driver platform_lcd_driver = {
 #ifdef CONFIG_PM
.pm = &platform_lcd_pm_ops,
 #endif
+   .of_match_table = of_match_ptr(platform_lcd_of_match),
},
.probe  = platform_lcd_probe,
.remove = __devexit_p(platform_lcd_remove),
-- 
1.7.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] ACPI: Reorder IPMI driver before any other ACPI drivers

2012-09-20 Thread Matthew Garrett
On Thu, Sep 20, 2012 at 08:19:48PM -0500, Corey Minyard wrote:
> On 09/20/2012 04:46 PM, Matthew Garrett wrote:
> >Drivers may make calls that require the ACPI IPMI driver to have been
> >initialised already, so make sure that it appears earlier in the build
> >order.
> 
> The IPMI driver uses the ACPI namespace as an option to know the
> address and characteristics of the device.  Does that still work?

Yes, the ACPI interpreter is initialised earlier than the IPMI driver 
discovery.

-- 
Matthew Garrett | mj...@srcf.ucam.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] Add a core driver for SI476x MFD

2012-09-20 Thread andrey.smir...@convergeddevices.net
On 09/13/2012 11:44 PM, Hans Verkuil wrote:
> Hi Andrey!
>
> Thanks for posting this driver. One request for the future: please split this
> patch up in smaller pieces: one for each c source for example. That makes it
> easier to review.

Will do for next version.

> +
> +/**
> + * __core_send_command() - sends a command to si476x and waits its
> + * response
> + * @core:si476x_device structure for the device we are
> + *communicating with
> + * @command:  command id
> + * @args: command arguments we are sending
> + * @argn: actual size of @args
> + * @response: buffer to place the expected response from the device
> + * @respn:actual size of @response
> + * @usecs:amount of time to wait before reading the response (in
> + *usecs)
> + *
> + * Function returns 0 on succsess and negative error code on
> + * failure
> + */
> +static int __core_send_command(struct si476x_core *core,
> + const u8 command,
> + const u8 args[],
> + const int argn,
> + u8 resp[],
> + const int respn,
> + const int usecs)
> +{
> + struct i2c_client *client = core->client;
> + int err;
> + u8  data[CMD_MAX_ARGS_COUNT + 1];
> +
> + if (argn > CMD_MAX_ARGS_COUNT) {
> + err = -ENOMEM;
> + goto exit;
> Why goto exit? There is no clean up after the exit label, so just return
> immediately. Ditto for all the other goto exit's in this function.

To have only just on point of exit from the function that's just
personal coding style preference.
There are no technical reasons behind that, I can change that.

>
>> +}
>> +
>> +if (!client->adapter) {
>> +err = -ENODEV;
>> +goto exit;
>> +}
>> +
>> +/* First send the command and its arguments */
>> +data[0] = command;
>> +memcpy(&data[1], args, argn);
>> +DBG_BUFFER(&client->dev, "Command:\n", data, argn + 1);
>> +
>> +err = si476x_i2c_xfer(core, SI476X_I2C_SEND, (char *) data, argn + 1);
>> +if (err != argn + 1) {
>> +dev_err(&core->client->dev,
>> +"Error while sending command 0x%02x\n",
>> +command);
>> +err = (err >= 0) ? -EIO : err;
>> +goto exit;
>> +}
>> +/* Set CTS to zero only after the command is send to avoid
>> + * possible racing conditions when working in polling mode */
>> +atomic_set(&core->cts, 0);
>> +
>> +if (!wait_event_timeout(core->command,
>> +atomic_read(&core->cts),
>> +usecs_to_jiffies(usecs) + 1))
>> +dev_warn(&core->client->dev,
>> + "(%s) [CMD 0x%02x] Device took too much time to 
>> answer.\n",
>> + __func__, command);
>> +
>> +/*
>> +  When working in polling mode, for some reason the tuner will
>> +  report CTS bit as being set in the first status byte read,
>> +  but all the consequtive ones will return zros until the
>> +  tuner is actually completed the POWER_UP command. To
>> +  workaround that we wait for second CTS to be reported
>> + */
>> +if (unlikely(!core->client->irq && command == CMD_POWER_UP)) {
>> +if (!wait_event_timeout(core->command,
>> +atomic_read(&core->cts),
>> +usecs_to_jiffies(usecs) + 1))
>> +dev_warn(&core->client->dev,
>> + "(%s) Power up took too much time.\n",
>> + __func__);
>> +}
>> +
>> +/* Then get the response */
>> +err = si476x_i2c_xfer(core, SI476X_I2C_RECV, resp, respn);
>> +if (err != respn) {
>> +dev_err(&core->client->dev,
>> +"Error while reading response for command 0x%02x\n",
>> +command);
>> +err = (err >= 0) ? -EIO : err;
>> +goto exit;
>> +}
>> +DBG_BUFFER(&client->dev, "Response:\n", resp, respn);
>> +
>> +err = 0;
>> +
>> +if (resp[0] & SI476X_ERR) {
>> +dev_err(&core->client->dev, "Chip set error flag\n");
>> +err = si476x_core_parse_and_nag_about_error(core);
>> +goto exit;
>> +}
>> +
>> +if (!(resp[0] & SI476X_CTS))
>> +err = -EBUSY;
>> +exit:
>> +return err;
>> +}
>> +
>> +#define CORE_SEND_COMMAND(core, cmd, args, resp, timeout)   \
>> +__core_send_command(core, cmd, args,\
>> +ARRAY_SIZE(args),   \
>> +resp, ARRAY_SIZE(resp), \
>> +timeout)
>> +
>> +
>> +static int __cmd_tune_seek_freq(struct si476x_core *core,
>> +uint8_t cmd,
>> +   

Re: [PATCH 1/2] ACPI: Reorder IPMI driver before any other ACPI drivers

2012-09-20 Thread Corey Minyard

On 09/20/2012 04:46 PM, Matthew Garrett wrote:

Drivers may make calls that require the ACPI IPMI driver to have been
initialised already, so make sure that it appears earlier in the build
order.


The IPMI driver uses the ACPI namespace as an option to know the address 
and characteristics of the device.  Does that still work?


-corey



Signed-off-by: Matthew Garrett 
---
  drivers/acpi/Makefile | 5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index 47199e2..82422fe 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -47,6 +47,10 @@ acpi-y   += video_detect.o
  endif
  
  # These are (potentially) separate modules

+
+# IPMI may be used by other drivers, so it has to initialise before them
+obj-$(CONFIG_ACPI_IPMI)+= acpi_ipmi.o
+
  obj-$(CONFIG_ACPI_AC) += ac.o
  obj-$(CONFIG_ACPI_BUTTON) += button.o
  obj-$(CONFIG_ACPI_FAN)+= fan.o
@@ -70,6 +74,5 @@ processor-y   += processor_idle.o 
processor_thermal.o
  processor-$(CONFIG_CPU_FREQ)  += processor_perflib.o
  
  obj-$(CONFIG_ACPI_PROCESSOR_AGGREGATOR) += acpi_pad.o

-obj-$(CONFIG_ACPI_IPMI)+= acpi_ipmi.o
  
  obj-$(CONFIG_ACPI_APEI)		+= apei/


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 00/22] lp8727_charger: clean up code

2012-09-20 Thread Anton Vorontsov
On Fri, Aug 31, 2012 at 09:22:39AM +, Kim, Milo wrote:
> LP8727 driver should be fixed for several reasons.
> 
> (a) Need to clean up _probe() and _remove()
> (b) Not secure code when the platform data is NULL
> (c) Improved the interrupt handling
> (d) Lots of definitions should be unique.
> (e) Others...
> 
> Patch v2.
> These patches are submitted more separately.

Nice! All 22 applied, thank you so much!

Anton.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH V2] perf: Fix parallel build

2012-09-20 Thread Eric Sandeen
Parallel builds of perf were failing for me on a 32p box, with:

* new build flags or prefix
util/pmu.l:7:23: error: pmu-bison.h: No such file or directory

...

make: *** [util/pmu-flex.o] Error 1
make: *** Waiting for unfinished jobs

This can pretty quickly be seen by adding a sleep in front of
the bison calls in tools/perf/Makefile and running make -j4 on a
smaller box i.e.:

sleep 10; $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o 
$(OUTPUT)util/pmu-bison.c

Adding the following dependencies fixes it for me.

Signed-off-by: Eric Sandeen 
---

V2: Fix other bison dependency caught by Namhyung Kim , 
thanks.

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 35655c3..8d883de 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -221,13 +221,13 @@ export PERL_PATH
 FLEX = flex
 BISON= bison
 
-$(OUTPUT)util/parse-events-flex.c: util/parse-events.l
+$(OUTPUT)util/parse-events-flex.c: util/parse-events.l 
util/parse-events-bison.c
$(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/parse-events-flex.h 
$(PARSER_DEBUG_FLEX) -t util/parse-events.l > $(OUTPUT)util/parse-events-flex.c
 
 $(OUTPUT)util/parse-events-bison.c: util/parse-events.y
$(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) 
-o $(OUTPUT)util/parse-events-bison.c
 
-$(OUTPUT)util/pmu-flex.c: util/pmu.l
+$(OUTPUT)util/pmu-flex.c: util/pmu.l util/pmu-bison.c
$(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t 
util/pmu.l > $(OUTPUT)util/pmu-flex.c
 
 $(OUTPUT)util/pmu-bison.c: util/pmu.y

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] perf: Fix parallel build

2012-09-20 Thread Eric Sandeen
On 9/20/12 7:24 PM, Namhyung Kim wrote:
> Hi Eric,
> 
> On Thu, 20 Sep 2012 18:53:01 -0500, Eric Sandeen wrote:
>> Parallel builds of perf were failing for me on a 32p box, with:
>>
>> * new build flags or prefix
>> util/pmu.l:7:23: error: pmu-bison.h: No such file or directory
>>
>> ...
>>
>> make: *** [util/pmu-flex.o] Error 1
>> make: *** Waiting for unfinished jobs
>>
>> This can pretty quickly be seen by adding a sleep in front of
>> the bison call in tools/perf/Makefile and running make -j4 on a
>> smaller box:
>>
>>  sleep 10; $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o 
>> $(OUTPUT)util/pmu-bison.c
>>
>> Adding the following dependency fixes it for me:
>>
>> Signed-off-by: Eric Sandeen 
>> ---
>>
>> diff --git a/tools/perf/Makefile b/tools/perf/Makefile
>> index bad726a..6c389d9 100644
>> --- a/tools/perf/Makefile
>> +++ b/tools/perf/Makefile
>> @@ -219,7 +219,7 @@ $(OUTPUT)util/parse-events-flex.c: util/parse-events.l
>>  $(OUTPUT)util/parse-events-bison.c: util/parse-events.y
>>  $(QUIET_BISON)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) 
>> -o $(OUTPUT)util/parse-events-bison.c
>>  
>> -$(OUTPUT)util/pmu-flex.c: util/pmu.l
>> +$(OUTPUT)util/pmu-flex.c: util/pmu.l util/pmu-bison.c
>>  $(QUIET_FLEX)$(FLEX) --header-file=$(OUTPUT)util/pmu-flex.h -t 
>> util/pmu.l > $(OUTPUT)util/pmu-flex.c
>>  
>>  $(OUTPUT)util/pmu-bison.c: util/pmu.y
> 
> I guess the $(OUTPUT)util/parse-events-flex.c: line has the same
> problem.  Could you check and submit a patch for that too?
> 
> Thanks,
> Namhyung
> 

Whoops you are right, will resent V2 shortly, thanks.

-Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] pda_power: remove ac_draw_failed goto and label

2012-09-20 Thread Paul Parsons

A previous patch added the ac_draw_failed goto and label to
pda_power_probe(). The goto would be invoked after a failed call to
regulator_get().

However the way ac_draw is used - always after a check for NULL -
suggests that a failed call to regulator_get() was not fatal.

This patch removes the ac_draw_failed goto and label, partly reverting
the previous patch.

This patch also removes the assignment of an error code to ret after a
failed call to regulator_get(), since the error code is now never used.

Signed-off-by: Paul Parsons 
Cc: Philipp Zabel 
---
 drivers/power/pda_power.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c
index d3be834d..7df7c5f 100644
--- a/drivers/power/pda_power.c
+++ b/drivers/power/pda_power.c
@@ -284,9 +284,7 @@ static int pda_power_probe(struct platform_device *pdev)
ac_draw = regulator_get(dev, "ac_draw");
if (IS_ERR(ac_draw)) {
dev_dbg(dev, "couldn't get ac_draw regulator\n");
-   ret = PTR_ERR(ac_draw);
ac_draw = NULL;
-   goto ac_draw_failed;
}

update_status();
@@ -416,7 +414,6 @@ ac_supply_failed:
regulator_put(ac_draw);
ac_draw = NULL;
}
-ac_draw_failed:
if (pdata->exit)
pdata->exit(dev);
 init_failed:
--
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 21/26] block: Convert some code to bio_for_each_segment_all()

2012-09-20 Thread Kent Overstreet
On Thu, Sep 20, 2012 at 05:38:32PM -0700, Tejun Heo wrote:
> On Mon, Sep 10, 2012 at 05:22:32PM -0700, Kent Overstreet wrote:
> > A few places in the code were either open coding or using the wrong
> > version - fix.
> > 
> > Signed-off-by: Kent Overstreet 
> > CC: Jens Axboe 
> > CC: NeilBrown 
> > ---
> > --- a/drivers/md/raid1.c
> > +++ b/drivers/md/raid1.c
> > @@ -921,7 +921,7 @@ static void alloc_behind_pages(struct bio *bio, struct 
> > r1bio *r1_bio)
> > if (unlikely(!bvecs))
> > return;
> >  
> > -   bio_for_each_segment(bvec, bio, i) {
> > +   bio_for_each_segment_all(bvec, bio, i) {
> 
> I don't get this conversion.  Why is this necessary?

Not necessary, just a consistency thing - this bio is a clone that md
owns (and the clone was trimmed, so we know bi_idx is 0).

Also, it wasn't an issue here but after the patch that introduces the
bvec iter it's no longer possible to modify the biovec through
bio_for_each_segment_all() - it doesn't increment a pointer to the
current bvec, you pass in a struct bio_vec (not a pointer) which is
updated with what the current biovec would be (taking into account
bi_bvec_done and bi_size).

So because of that it is IMO more worthwhile to be consistent about
bio_for_each_segment()/bio_for_each_segment_all() usage.

Suppose I should stick all that in the patch description.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 23/26] raid1: use bio_alloc_pages()

2012-09-20 Thread Tejun Heo
On Mon, Sep 10, 2012 at 05:22:34PM -0700, Kent Overstreet wrote:
> Signed-off-by: Kent Overstreet 
> CC: Jens Axboe 
> CC: NeilBrown 

I think it's better to merge this and the previous patch.  It's not
like we're converting a lot of users.

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 22/26] block: Add bio_alloc_pages()

2012-09-20 Thread Tejun Heo
On Mon, Sep 10, 2012 at 05:22:33PM -0700, Kent Overstreet wrote:
> + bio_for_each_segment_all(bv, bio, i) {
> + bv->bv_page = alloc_page(gfp_mask);
> + if (!bv->bv_page) {
> + while (bv-- != bio->bi_io_vec)
> + __free_page(bv->bv_page);

I don't know.  I feel stupid.  I think it's because the loop variable
changes between loop condition test and actual body of loop.  How
about the following?  It is pointing to the member of the same array
so I think it's not even violating pointer comparison rules.

while (--bv >= bio->bi_io_vec)
__free_page(bv->bv_page);

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] ARM: OMAP: hwmod: revise deassert sequence

2012-09-20 Thread Paul Walmsley
Hi

On Wed, 22 Aug 2012, Omar Ramirez Luna wrote:

> For a reset sequence to complete cleanly, a module needs its
> associated clocks to be enabled, otherwise the timeout check
> in prcm code can print a false failure (failed to hardreset)
> that occurs because the clocks aren't powered ON and the status
> bit checked can't transition without them.
> 
> Signed-off-by: Omar Ramirez Luna 

Queued for 3.7, with the same caveats mentioned regarding patch 1.


- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2] ARM: OMAP: hwmod: partially un-reset hwmods might not be properly enabled

2012-09-20 Thread Paul Walmsley
Hi Omar

On Wed, 22 Aug 2012, Omar Ramirez Luna wrote:

> Some IP blocks might not be using/controlling more than one
> reset line, this check loosens the restriction to fully use
> hwmod framework for those drivers.
> 
> E.g.: ipu has reset lines: mmu_cache, cpu0 and cpu1.
> - As of now cpu1 is not used and hence (with previous check) the
>   IP block isn't fully enabled by hwmod code.
> - Usually ipu and dsp processors configure their mmu module first
>   and then enable the processors, this involves:
> * Deasserting mmu reset line, and enabling the module.
> * Deasserting cpu0 reset line, and enabling the processor.
>   The ones portrayed in this example are controlled through
>   rproc_fw_boot in drivers/remoteproc/remoteproc_core.c
> 
> While at it, prevent _omap4_module_disable if all the hardreset
> lines on an IP block are not under reset.
> 
> This will allow the driver to:
>   a. Deassert the reset line.
>   b. Enable the hwmod through runtime PM default callbacks.
>   c. Do its usecase.
>   d. Disable hwmod through runtime PM.
>   e. Assert the reset line.
> 
> Signed-off-by: Omar Ramirez Luna 

Well, I don't think this is the right long-term solution, but I'd like to 
see this moving forward.  So this one has been queued for 3.7.  Hopefully 
we can figure out the right thing once the PRM driver is ready (which will 
handle the low-level hard resets).


- Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   3   4   5   6   7   >