Skip to contentSkip to conversation

pmic: Fix pfuze100 bit definitions

PATCH New Marek Vasut 4 participants 11 messages Nov 25, 2015 – Nov 26, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pmic: Fix pfuze100 bit definitions

The following patch changed the PFUZE100 swbst register bit definitions and broke PMIC configuration on multiple boards, at least on the novena and gw_ventana. This patch fixes it.

commit 8fa46350a4c7dca7710362f6c871098557b934ad

Author: Peng Fan <[email protected]>
Date:   Fri Aug 7 16:43:45 2015 +0800

power: regulator: add pfuze100 support

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Tim Harvey <[email protected]>
Cc Vagrant Cascadian <[email protected]>
---
 include/power/pfuze100_pmic.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/power/pfuze100_pmic.h +4 -4
index 41cb710..cc019a9 100644
@@ -215,10 +215,10 @@ enum {
 #define SWBST_VOL_MASK	0x3
 #define SWBST_MODE_MASK	0xC
 #define SWBST_MODE_SHIFT 0x2
-#define SWBST_MODE_OFF	0
-#define SWBST_MODE_PFM	1
-#define SWBST_MODE_AUTO	2
-#define SWBST_MODE_APS	3
+#define SWBST_MODE_OFF	(0 << 2)
+#define SWBST_MODE_PFM	(1 << 2)
+#define SWBST_MODE_AUTO	(2 << 2)
+#define SWBST_MODE_APS	(3 << 2)
 
 /*
  * Regulator Mode Control
Signature · 1 line
2.6.2
#1 lore raw

PATCH 1/1 pmic: Fix pfuze100 bit definitions

Quoted 16 lines · Marek Vasut

The following patch changed the PFUZE100 swbst register bit definitions and broke PMIC configuration on multiple boards, at least on the novena and gw_ventana. This patch fixes it.

commit 8fa46350a4c7dca7710362f6c871098557b934ad

Author: Peng Fan <[email protected]>
Date:   Fri Aug 7 16:43:45 2015 +0800

power: regulator: add pfuze100 support

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Tim Harvey <[email protected]>
Cc Vagrant Cascadian <[email protected]>
Quoted 3 lines
---
 include/power/pfuze100_pmic.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Tested on a Novena PVT2-A, fixes USB support.

live well,
vagrant

Quoted 21 lines
include/power/pfuze100_pmic.h +4 -4
index 41cb710..cc019a9 100644
@@ -215,10 +215,10 @@ enum {
 #define SWBST_VOL_MASK	0x3
 #define SWBST_MODE_MASK	0xC
 #define SWBST_MODE_SHIFT 0x2
-#define SWBST_MODE_OFF	0
-#define SWBST_MODE_PFM	1
-#define SWBST_MODE_AUTO	2
-#define SWBST_MODE_APS	3
+#define SWBST_MODE_OFF	(0 << 2)
+#define SWBST_MODE_PFM	(1 << 2)
+#define SWBST_MODE_AUTO	(2 << 2)
+#define SWBST_MODE_APS	(3 << 2)
 
 /*
  * Regulator Mode Control
Signature · 1 line
2.6.2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151125/9e1987da/attachment.sig>

#2 lore raw

PATCH 1/1 pmic: Fix pfuze100 bit definitions

In reply to Marek Vasut

Hi Marek,

Quoted 26 lines · Marek Vasut

The following patch changed the PFUZE100 swbst register bit definitions and broke PMIC configuration on multiple boards, at least on the novena and gw_ventana. This patch fixes it.

commit 8fa46350a4c7dca7710362f6c871098557b934ad

Author: Peng Fan <[email protected]>
Date:   Fri Aug 7 16:43:45 2015 +0800

power: regulator: add pfuze100 support

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Tim Harvey <[email protected]>
Cc Vagrant Cascadian <[email protected]>

---
include/power/pfuze100_pmic.h | 8 ++++----

1 file changed, 4 insertions(+), 4 deletions(-)
include/power/pfuze100_pmic.h +0 -0
index 41cb710..cc019a9 100644
@@ -215,10 +215,10 @@ enum {
 #define SWBST_VOL_MASK	0x3

include/power/pfuze100_pmic.h enum { · line 221

Quoted 10 lines
include/power/pfuze100_pmic.h +4 -4
 #define SWBST_MODE_MASK	0xC
 #define SWBST_MODE_SHIFT 0x2
-#define SWBST_MODE_OFF	0
-#define SWBST_MODE_PFM	1
-#define SWBST_MODE_AUTO	2
-#define SWBST_MODE_APS	3
+#define SWBST_MODE_OFF	(0 << 2)
+#define SWBST_MODE_PFM	(1 << 2)
+#define SWBST_MODE_AUTO	(2 << 2)
+#define SWBST_MODE_APS	(3 << 2)

Can we use "(SWBST_MODE_AUTO << SWBST_MODE_SHIFT)" in the board code, but not revert this?

Thanks,
Peng.

Quoted 6 lines
include/power/pfuze100_pmic.h +0 -0
 /*
 * Regulator Mode Control
Signature · 1 line
2.6.2
#3 lore raw

PATCH 1/1 pmic: Fix pfuze100 bit definitions

Quoted 34 lines · Peng Fan

Hi Marek,

Quoted 31 lines · Marek Vasut

The following patch changed the PFUZE100 swbst register bit definitions and broke PMIC configuration on multiple boards, at least on the novena and gw_ventana. This patch fixes it.

commit 8fa46350a4c7dca7710362f6c871098557b934ad

Author: Peng Fan <[email protected]>
Date:   Fri Aug 7 16:43:45 2015 +0800

power: regulator: add pfuze100 support

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Tim Harvey <[email protected]>
Cc Vagrant Cascadian <[email protected]>

---

include/power/pfuze100_pmic.h | 8 ++++----

1 file changed, 4 insertions(+), 4 deletions(-)
include/power/pfuze100_pmic.h +0 -0
index 41cb710..cc019a9 100644
@@ -215,10 +215,10 @@ enum {
 
 #define SWBST_VOL_MASK	0x3
 #define SWBST_MODE_MASK	0xC
 #define SWBST_MODE_SHIFT 0x2
 
Quoted 11 lines

include/power/pfuze100_pmic.h enum { · line 221

Quoted 8 lines
include/power/pfuze100_pmic.h +4 -4
-#define SWBST_MODE_OFF	0
-#define SWBST_MODE_PFM	1
-#define SWBST_MODE_AUTO	2
-#define SWBST_MODE_APS	3
+#define SWBST_MODE_OFF	(0 << 2)
+#define SWBST_MODE_PFM	(1 << 2)
+#define SWBST_MODE_AUTO	(2 << 2)
+#define SWBST_MODE_APS	(3 << 2)

Can we use "(SWBST_MODE_AUTO << SWBST_MODE_SHIFT)" in the board code, but not revert this?

I undid the breakage introduced by the aforementioned patch. If you want to update all the boards which use these macros and then drop the bitshift, patch is welcome, but that's beyond the scope of this fix.

Best regards,
Marek Vasut

#4 lore raw

PATCH 1/1 pmic: Fix pfuze100 bit definitions

Quoted 47 lines · Marek Vasut
Quoted 34 lines · Peng Fan

Hi Marek,

Quoted 31 lines · Marek Vasut

The following patch changed the PFUZE100 swbst register bit definitions and broke PMIC configuration on multiple boards, at least on the novena and gw_ventana. This patch fixes it.

commit 8fa46350a4c7dca7710362f6c871098557b934ad

Author: Peng Fan <[email protected]>
Date:   Fri Aug 7 16:43:45 2015 +0800

power: regulator: add pfuze100 support

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Tim Harvey <[email protected]>
Cc Vagrant Cascadian <[email protected]>

---

include/power/pfuze100_pmic.h | 8 ++++----

1 file changed, 4 insertions(+), 4 deletions(-)
include/power/pfuze100_pmic.h +0 -0
index 41cb710..cc019a9 100644
@@ -215,10 +215,10 @@ enum {
 
 #define SWBST_VOL_MASK	0x3
 #define SWBST_MODE_MASK	0xC
 #define SWBST_MODE_SHIFT 0x2
 
Quoted 11 lines

include/power/pfuze100_pmic.h enum { · line 221

Quoted 8 lines
include/power/pfuze100_pmic.h +4 -4
-#define SWBST_MODE_OFF	0
-#define SWBST_MODE_PFM	1
-#define SWBST_MODE_AUTO	2
-#define SWBST_MODE_APS	3
+#define SWBST_MODE_OFF	(0 << 2)
+#define SWBST_MODE_PFM	(1 << 2)
+#define SWBST_MODE_AUTO	(2 << 2)
+#define SWBST_MODE_APS	(3 << 2)

Can we use "(SWBST_MODE_AUTO << SWBST_MODE_SHIFT)" in the board code, but not revert this?

Quoted 3 lines

I undid the breakage introduced by the aforementioned patch. If you want to update all the boards which use these macros and then drop the bitshift, patch is welcome, but that's beyond the scope of this fix.

Hmm. My original patch is that bit shift not included into "mode", the user need to do bitshift by itself. I'll check the pfuze100_regulator driver.

If "mode" needs to include the bit shift, then patch is ok and

Regards,
Peng.

Quoted 3 lines

Best regards,
Marek Vasut

#5 lore raw

PATCH 1/1 pmic: Fix pfuze100 bit definitions

In reply to Marek Vasut

Hello Marek,

Quoted 4 lines · Marek Vasut

The following patch changed the PFUZE100 swbst register bit definitions and broke PMIC configuration on multiple boards, at least on the novena and gw_ventana. This patch fixes it.

Ok we missed this in the review. But as I can see it broken only the two boards, you mentioned.

Quoted 26 lines

commit 8fa46350a4c7dca7710362f6c871098557b934ad

Author: Peng Fan <[email protected]>
Date:   Fri Aug 7 16:43:45 2015 +0800

power: regulator: add pfuze100 support

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Tim Harvey <[email protected]>
Cc Vagrant Cascadian <[email protected]>
---
  include/power/pfuze100_pmic.h | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
include/power/pfuze100_pmic.h +0 -1
index 41cb710..cc019a9 100644
@@ -215,10 +215,10 @@ enum {
  #define SWBST_VOL_MASK	0x3
  #define SWBST_MODE_MASK	0xC
  #define SWBST_MODE_SHIFT 0x2
-#define SWBST_MODE_OFF	0

include/power/pfuze100_pmic.h enum { · line 224

Quoted 10 lines
include/power/pfuze100_pmic.h +4 -3
-#define SWBST_MODE_PFM	1
-#define SWBST_MODE_AUTO	2
-#define SWBST_MODE_APS	3
+#define SWBST_MODE_OFF	(0 << 2)
+#define SWBST_MODE_PFM	(1 << 2)
+#define SWBST_MODE_AUTO	(2 << 2)
+#define SWBST_MODE_APS	(3 << 2)
 
  /*
   * Regulator Mode Control

The intentions are good, but this patch fixes one thing and breaks the another one, I would prefer avoid this.

'git grep -n SWBST_MODE'

As I can see, you can fix the issue for multiple boards by update only two lines in those two boards, which you mentioned.

So why you moving back those definitions, since they are now used in more places?

The line suggested by Peng is good enough to call it 'fix' for your boards:

(SWBST_MODE_AUTO << SWBST_MODE_SHIFT)

Best regards,

Signature · 4 lines
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
[email protected]
#6 lore raw

PATCH 1/1 pmic: Fix pfuze100 bit definitions

Quoted 1 line · Przemyslaw Marczak

Hello Marek,

Hi,

Quoted 56 lines · Marek Vasut
Quoted 3 lines

The following patch changed the PFUZE100 swbst register bit definitions and broke PMIC configuration on multiple boards, at least on the novena and gw_ventana. This patch fixes it.

Ok we missed this in the review. But as I can see it broken only the two boards, you mentioned.

Quoted 38 lines

commit 8fa46350a4c7dca7710362f6c871098557b934ad

Author: Peng Fan <[email protected]>
Date:   Fri Aug 7 16:43:45 2015 +0800

power: regulator: add pfuze100 support

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Tim Harvey <[email protected]>
Cc Vagrant Cascadian <[email protected]>

---

  include/power/pfuze100_pmic.h | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/include/power/pfuze100_pmic.h index 41cb710..cc019a9 100644

include/power/pfuze100_pmic.h +4 -4
@@ -215,10 +215,10 @@ enum {
 
  #define SWBST_VOL_MASK	0x3
  #define SWBST_MODE_MASK	0xC
  #define SWBST_MODE_SHIFT 0x2
 
-#define SWBST_MODE_OFF	0
-#define SWBST_MODE_PFM	1
-#define SWBST_MODE_AUTO	2
-#define SWBST_MODE_APS	3
+#define SWBST_MODE_OFF	(0 << 2)
+#define SWBST_MODE_PFM	(1 << 2)
+#define SWBST_MODE_AUTO	(2 << 2)
+#define SWBST_MODE_APS	(3 << 2)
 

/*

Quoted 1 line

* Regulator Mode Control

The intentions are good, but this patch fixes one thing and breaks the another one, I would prefer avoid this.

'git grep -n SWBST_MODE'

As I can see, you can fix the issue for multiple boards by update only two lines in those two boards, which you mentioned.

Quoted 6 lines

So why you moving back those definitions, since they are now used in more places?

The line suggested by Peng is good enough to call it 'fix' for your boards:

(SWBST_MODE_AUTO << SWBST_MODE_SHIFT)

OK, so instead of fixing the patch which introduced a bug, we're supposed to be fixing the fallout from that. I cannot say I'm very happy with this sort of handling of a bug and with the testing this particular change received.

Besides, seeing how this patch already needed another patch to make it complete and how it now needs more patches to fix the boards which it broke, I am really disappointed.

Best regards,
Marek Vasut

#7 lore raw

PATCH 1/1 pmic: Fix pfuze100 bit definitions

Hello Marek,

Quoted 64 lines · Marek Vasut
Quoted 1 line · Przemyslaw Marczak

Hello Marek,

Hi,

Quoted 59 lines · Marek Vasut
Quoted 3 lines

The following patch changed the PFUZE100 swbst register bit definitions and broke PMIC configuration on multiple boards, at least on the novena and gw_ventana. This patch fixes it.

Ok we missed this in the review. But as I can see it broken only the two boards, you mentioned.

Quoted 38 lines

commit 8fa46350a4c7dca7710362f6c871098557b934ad

Author: Peng Fan <[email protected]>
Date:   Fri Aug 7 16:43:45 2015 +0800

power: regulator: add pfuze100 support

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Tim Harvey <[email protected]>
Cc Vagrant Cascadian <[email protected]>

---

   include/power/pfuze100_pmic.h | 8 ++++----
   1 file changed, 4 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/include/power/pfuze100_pmic.h index 41cb710..cc019a9 100644

include/power/pfuze100_pmic.h +4 -4
@@ -215,10 +215,10 @@ enum {
 
   #define SWBST_VOL_MASK	0x3
   #define SWBST_MODE_MASK	0xC
   #define SWBST_MODE_SHIFT 0x2
 
-#define SWBST_MODE_OFF	0
-#define SWBST_MODE_PFM	1
-#define SWBST_MODE_AUTO	2
-#define SWBST_MODE_APS	3
+#define SWBST_MODE_OFF	(0 << 2)
+#define SWBST_MODE_PFM	(1 << 2)
+#define SWBST_MODE_AUTO	(2 << 2)
+#define SWBST_MODE_APS	(3 << 2)
 

/*

Quoted 1 line

* Regulator Mode Control

The intentions are good, but this patch fixes one thing and breaks the another one, I would prefer avoid this.

'git grep -n SWBST_MODE'

As I can see, you can fix the issue for multiple boards by update only two lines in those two boards, which you mentioned.

So why you moving back those definitions, since they are now used in more places?

Quoted 8 lines
Quoted 3 lines

The line suggested by Peng is good enough to call it 'fix' for your boards:

(SWBST_MODE_AUTO << SWBST_MODE_SHIFT)

OK, so instead of fixing the patch which introduced a bug, we're supposed to be fixing the fallout from that. I cannot say I'm very happy with this sort of handling of a bug and with the testing this particular change received.

You are right, the mentioned patch breaks your boards, and we missed this in the review as I mentioned - sorry for that.

But for now, there is also other code based on those definitions, so you can not just revert only this particular change and ignore the rest - because it breaks the new code? Should we all work in this way?

As a custodian I'm not able to test everything, especially when I don't have the hardware for it. Moreover I trust people who are working for this project and I can imagine that they test the code.

Quoted 3 lines

Besides, seeing how this patch already needed another patch to make it complete and how it now needs more patches to fix the boards which it broke, I am really disappointed.

I can't understand what is the problem. You send new patch with two simple lines - it fixes your issue and doesn't break the existing PMIC driver. I think, this is what we need here.

Quoted 5 lines

Best regards,
Marek Vasut

Best regards,

Signature · 4 lines
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com
#8 lore raw

PATCH 1/1 pmic: Fix pfuze100 bit definitions

Quoted 1 line · Przemyslaw Marczak

Hello Marek,

Hi,

Quoted 75 lines · Marek Vasut
Quoted 67 lines · Przemyslaw Marczak
Quoted 1 line

Hello Marek,

Hi,

Quoted 62 lines · Marek Vasut
Quoted 3 lines

The following patch changed the PFUZE100 swbst register bit definitions and broke PMIC configuration on multiple boards, at least on the novena and gw_ventana. This patch fixes it.

Ok we missed this in the review. But as I can see it broken only the two boards, you mentioned.

Quoted 38 lines

commit 8fa46350a4c7dca7710362f6c871098557b934ad

Author: Peng Fan <[email protected]>
Date:   Fri Aug 7 16:43:45 2015 +0800

power: regulator: add pfuze100 support

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Tim Harvey <[email protected]>
Cc Vagrant Cascadian <[email protected]>

---

   include/power/pfuze100_pmic.h | 8 ++++----
   1 file changed, 4 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/include/power/pfuze100_pmic.h index 41cb710..cc019a9 100644

include/power/pfuze100_pmic.h +4 -4
@@ -215,10 +215,10 @@ enum {
 
   #define SWBST_VOL_MASK	0x3
   #define SWBST_MODE_MASK	0xC
   #define SWBST_MODE_SHIFT 0x2
 
-#define SWBST_MODE_OFF	0
-#define SWBST_MODE_PFM	1
-#define SWBST_MODE_AUTO	2
-#define SWBST_MODE_APS	3
+#define SWBST_MODE_OFF	(0 << 2)
+#define SWBST_MODE_PFM	(1 << 2)
+#define SWBST_MODE_AUTO	(2 << 2)
+#define SWBST_MODE_APS	(3 << 2)
 

/*

Quoted 1 line

* Regulator Mode Control

The intentions are good, but this patch fixes one thing and breaks the another one, I would prefer avoid this.

'git grep -n SWBST_MODE'

As I can see, you can fix the issue for multiple boards by update only two lines in those two boards, which you mentioned.

So why you moving back those definitions, since they are now used in more places?

The line suggested by Peng is good enough to call it 'fix' for your boards:

Quoted 6 lines
Quoted 1 line

(SWBST_MODE_AUTO << SWBST_MODE_SHIFT)

OK, so instead of fixing the patch which introduced a bug, we're supposed to be fixing the fallout from that. I cannot say I'm very happy with this sort of handling of a bug and with the testing this particular change received.

Quoted 6 lines

You are right, the mentioned patch breaks your boards, and we missed this in the review as I mentioned - sorry for that.

But for now, there is also other code based on those definitions, so you can not just revert only this particular change and ignore the rest - because it breaks the new code? Should we all work in this way?

This is even worse then -- the patch adds code which uses the changed macros, but doesn't fix the existing users. This should not happen again and it'd be very nice if the author actually checked when digging in /include and changing some macros there if this might affect someone.

Quoted 3 lines

As a custodian I'm not able to test everything, especially when I don't have the hardware for it. Moreover I trust people who are working for this project and I can imagine that they test the code.

I don't expect you to test anything in this case, other but possibly compile testing the stuff, don't get me wrong.

Quoted 7 lines
Quoted 3 lines

Besides, seeing how this patch already needed another patch to make it complete and how it now needs more patches to fix the boards which it broke, I am really disappointed.

I can't understand what is the problem. You send new patch with two simple lines - it fixes your issue and doesn't break the existing PMIC driver. I think, this is what we need here.

I did that. And unfortunatelly, it turns out we have really no other option now, than to fix the boards. Sigh ...

#9 lore raw

PATCH 1/1 pmic: Fix pfuze100 bit definitions

Hello Marek,

Quoted 83 lines · Marek Vasut
Quoted 1 line · Przemyslaw Marczak

Hello Marek,

Hi,

Quoted 78 lines · Marek Vasut
Quoted 67 lines · Przemyslaw Marczak
Quoted 1 line

Hello Marek,

Hi,

Quoted 62 lines · Marek Vasut
Quoted 3 lines

The following patch changed the PFUZE100 swbst register bit definitions and broke PMIC configuration on multiple boards, at least on the novena and gw_ventana. This patch fixes it.

Ok we missed this in the review. But as I can see it broken only the two boards, you mentioned.

Quoted 38 lines

commit 8fa46350a4c7dca7710362f6c871098557b934ad

Author: Peng Fan <[email protected]>
Date:   Fri Aug 7 16:43:45 2015 +0800

power: regulator: add pfuze100 support

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Tim Harvey <[email protected]>
Cc Vagrant Cascadian <[email protected]>

---

    include/power/pfuze100_pmic.h | 8 ++++----
    1 file changed, 4 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/include/power/pfuze100_pmic.h index 41cb710..cc019a9 100644

include/power/pfuze100_pmic.h +4 -4
@@ -215,10 +215,10 @@ enum {
 
    #define SWBST_VOL_MASK	0x3
    #define SWBST_MODE_MASK	0xC
    #define SWBST_MODE_SHIFT 0x2
 
-#define SWBST_MODE_OFF	0
-#define SWBST_MODE_PFM	1
-#define SWBST_MODE_AUTO	2
-#define SWBST_MODE_APS	3
+#define SWBST_MODE_OFF	(0 << 2)
+#define SWBST_MODE_PFM	(1 << 2)
+#define SWBST_MODE_AUTO	(2 << 2)
+#define SWBST_MODE_APS	(3 << 2)
 

/*

Quoted 1 line

* Regulator Mode Control

The intentions are good, but this patch fixes one thing and breaks the another one, I would prefer avoid this.

'git grep -n SWBST_MODE'

As I can see, you can fix the issue for multiple boards by update only two lines in those two boards, which you mentioned.

So why you moving back those definitions, since they are now used in more places?

The line suggested by Peng is good enough to call it 'fix' for your boards:

Quoted 6 lines
Quoted 1 line

(SWBST_MODE_AUTO << SWBST_MODE_SHIFT)

OK, so instead of fixing the patch which introduced a bug, we're supposed to be fixing the fallout from that. I cannot say I'm very happy with this sort of handling of a bug and with the testing this particular change received.

You are right, the mentioned patch breaks your boards, and we missed this in the review as I mentioned - sorry for that.

Quoted 9 lines
Quoted 3 lines

But for now, there is also other code based on those definitions, so you can not just revert only this particular change and ignore the rest - because it breaks the new code? Should we all work in this way?

This is even worse then -- the patch adds code which uses the changed macros, but doesn't fix the existing users. This should not happen again and it'd be very nice if the author actually checked when digging in /include and changing some macros there if this might affect someone.

Ok, but as you could check in this example, even recompile all boards with such kind of 'new patch' - will not tell you what is wrong, because it doesn't break the build...

Quoted 11 lines
Quoted 3 lines

As a custodian I'm not able to test everything, especially when I don't have the hardware for it. Moreover I trust people who are working for this project and I can imagine that they test the code.

I don't expect you to test anything in this case, other but possibly compile testing the stuff, don't get me wrong.

Quoted 4 lines
Quoted 3 lines

Besides, seeing how this patch already needed another patch to make it complete and how it now needs more patches to fix the boards which it broke, I am really disappointed.

Quoted 7 lines
Quoted 3 lines

I can't understand what is the problem. You send new patch with two simple lines - it fixes your issue and doesn't break the existing PMIC driver. I think, this is what we need here.

I did that. And unfortunatelly, it turns out we have really no other option now, than to fix the boards. Sigh ...

But isn't this also an important part of our job?

I don't know why we discuss about this...

Found bug? Can fix?
Then send a patch and don't blame the people for a bugs - it's natural. Don't cry if got a comments - this is the Open Source project:)

I hope you don't get me wrong.

Have a nice weekend! - I'm starting it right now:)

Best regards,

Signature · 4 lines
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com
#10 lore raw

PATCH 1/1 pmic: Fix pfuze100 bit definitions

Quoted 1 line · Przemyslaw Marczak

Hello Marek,

Hi,

Quoted 88 lines · Marek Vasut
Quoted 87 lines · Przemyslaw Marczak
Quoted 1 line

Hello Marek,

Hi,

Quoted 81 lines · Marek Vasut
Quoted 67 lines · Przemyslaw Marczak
Quoted 1 line

Hello Marek,

Hi,

Quoted 62 lines · Marek Vasut
Quoted 3 lines

The following patch changed the PFUZE100 swbst register bit definitions and broke PMIC configuration on multiple boards, at least on the novena and gw_ventana. This patch fixes it.

Ok we missed this in the review. But as I can see it broken only the two boards, you mentioned.

Quoted 38 lines

commit 8fa46350a4c7dca7710362f6c871098557b934ad

Author: Peng Fan <[email protected]>
Date:   Fri Aug 7 16:43:45 2015 +0800

power: regulator: add pfuze100 support

Cc Fabio Estevam <[email protected]>
Cc Peng Fan <[email protected]>
Cc Przemyslaw Marczak <[email protected]>
Cc Tim Harvey <[email protected]>
Cc Vagrant Cascadian <[email protected]>

---

    include/power/pfuze100_pmic.h | 8 ++++----
    1 file changed, 4 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/include/power/pfuze100_pmic.h index 41cb710..cc019a9 100644

include/power/pfuze100_pmic.h +4 -4
@@ -215,10 +215,10 @@ enum {
 
    #define SWBST_VOL_MASK	0x3
    #define SWBST_MODE_MASK	0xC
    #define SWBST_MODE_SHIFT 0x2
 
-#define SWBST_MODE_OFF	0
-#define SWBST_MODE_PFM	1
-#define SWBST_MODE_AUTO	2
-#define SWBST_MODE_APS	3
+#define SWBST_MODE_OFF	(0 << 2)
+#define SWBST_MODE_PFM	(1 << 2)
+#define SWBST_MODE_AUTO	(2 << 2)
+#define SWBST_MODE_APS	(3 << 2)
 

/*

Quoted 1 line

* Regulator Mode Control

The intentions are good, but this patch fixes one thing and breaks the another one, I would prefer avoid this.

'git grep -n SWBST_MODE'

As I can see, you can fix the issue for multiple boards by update only two lines in those two boards, which you mentioned.

So why you moving back those definitions, since they are now used in more places?

The line suggested by Peng is good enough to call it 'fix' for your boards:

Quoted 6 lines
Quoted 1 line

(SWBST_MODE_AUTO << SWBST_MODE_SHIFT)

OK, so instead of fixing the patch which introduced a bug, we're supposed to be fixing the fallout from that. I cannot say I'm very happy with this sort of handling of a bug and with the testing this particular change received.

You are right, the mentioned patch breaks your boards, and we missed this in the review as I mentioned - sorry for that.

But for now, there is also other code based on those definitions, so you can not just revert only this particular change and ignore the rest - because it breaks the new code? Should we all work in this way?

Quoted 8 lines
Quoted 4 lines

This is even worse then -- the patch adds code which uses the changed macros, but doesn't fix the existing users. This should not happen again and it'd be very nice if the author actually checked when digging in /include and changing some macros there if this might affect someone.

Ok, but as you could check in this example, even recompile all boards with such kind of 'new patch' - will not tell you what is wrong, because it doesn't break the build...

Yeah

Quoted 18 lines
Quoted 11 lines
Quoted 3 lines

As a custodian I'm not able to test everything, especially when I don't have the hardware for it. Moreover I trust people who are working for this project and I can imagine that they test the code.

I don't expect you to test anything in this case, other but possibly compile testing the stuff, don't get me wrong.

Quoted 4 lines
Quoted 3 lines

Besides, seeing how this patch already needed another patch to make it complete and how it now needs more patches to fix the boards which it broke, I am really disappointed.

Quoted 6 lines
Quoted 3 lines

I can't understand what is the problem. You send new patch with two simple lines - it fixes your issue and doesn't break the existing PMIC driver. I think, this is what we need here.

I did that. And unfortunatelly, it turns out we have really no other option now, than to fix the boards. Sigh ...

Quoted 6 lines

But isn't this also an important part of our job?

I don't know why we discuss about this...

Found bug? Can fix?
Then send a patch and don't blame the people for a bugs - it's natural.

I already did that, but it seems to be about time to re-state that if you dig in /include, then you should check thoroughly if your change cannot have some sort of side-effects.

Quoted 1 line

Don't cry if got a comments - this is the Open Source project:)

Please, educate me more on this topic :)

Quoted 1 line

I hope you don't get me wrong.

DTTO.

Quoted 1 line

Have a nice weekend! - I'm starting it right now:)

You as well, cheers!