diff mbox

[v3,1/8] mfd: intel_soc_pmic_bxtwc: fix TMU interrupt index

Message ID 75e12563a835dc4f8e8dab26ecea46822262604b.1495559980.git.sathyanarayanan.kuppuswamy@linux.intel.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Kuppuswamy Sathyanarayanan May 23, 2017, 5:29 p.m. UTC
From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

TMU interrupts are registered as a separate interrupt chip, and
hence it should start its interrupt index(BXTWC_TMU_IRQ) number
from 0. But currently, BXTWC_TMU_IRQ is defined as part of enum
bxtwc_irqs_level2 and its index value is 11. Since this index
value is used when calculating .num_irqs of regmap_irq_chip_tmu,
it incorrectly reports number of irqs as 12 instead of actual
value of 1.

This patch fixes this issue by creating new enum of tmu irqs and
resetting its starting index to 0.

Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Changes since v1: 
 * Removed code from commit message.

Changes since v2: 
 * Rebased on top of latest release.

Comments

Stephen Rothwell May 31, 2017, 3:38 a.m. UTC | #1
Hi all,

On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
>
> Dear fellow Maintainers,
> 
> Enjoy!
> 
> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
> 
>   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
> 
> for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
> 
>   platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
> 
> ----------------------------------------------------------------
> Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
> 
> ----------------------------------------------------------------
> Kuppuswamy Sathyanarayanan (8):
>       mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips

See my other bug report on this commit ...
Sathyanarayanan Kuppuswamy Natarajan May 31, 2017, 4:27 a.m. UTC | #2
Sorry, its a mistake from my end. It looks like typec wcove driver got
merged recently and I missed to add it to my cleanup patch set.

Lee,

I have created a patch to fix this issue.

Do you want me to send the entire series again with this fix or just
send the fix alone.


On Tue, May 30, 2017 at 8:38 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi all,
>
> On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
>>
>> Dear fellow Maintainers,
>>
>> Enjoy!
>>
>> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
>>
>>   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
>>
>> are available in the git repository at:
>>
>>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
>>
>> for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
>>
>>   platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
>>
>> ----------------------------------------------------------------
>> Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
>>
>> ----------------------------------------------------------------
>> Kuppuswamy Sathyanarayanan (8):
>>       mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
>
> See my other bug report on this commit ...
>
> --
> Cheers,
> Stephen Rothwell
Sathyanarayanan Kuppuswamy Natarajan May 31, 2017, 4:29 a.m. UTC | #3
Hi All,

On Tue, May 30, 2017 at 8:38 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi all,
>
> On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
>>
>> Dear fellow Maintainers,
>>
>> Enjoy!
>>
>> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
>>
>>   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
>>
>> are available in the git repository at:
>>
>>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
>>
>> for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
>>
>>   platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
>>
>> ----------------------------------------------------------------
>> Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
>>
>> ----------------------------------------------------------------
>> Kuppuswamy Sathyanarayanan (8):
>>       mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
>
> See my other bug report on this commit ...

Sorry, its a mistake from my end. It looks like typec wcove driver got
merged recently and I missed to add it to my cleanup patch set.

Lee,

I have created a patch to fix this issue.

Do you want me to send the entire series again with this fix or just
send the fix alone.

>
> --
> Cheers,
> Stephen Rothwell
Lee Jones May 31, 2017, 6:50 a.m. UTC | #4
On Wed, 31 May 2017, Stephen Rothwell wrote:

> Hi all,
> 
> On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
> >
> > Dear fellow Maintainers,
> > 
> > Enjoy!
> > 
> > The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
> > 
> >   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
> > 
> > are available in the git repository at:
> > 
> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
> > 
> > for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
> > 
> >   platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
> > 
> > ----------------------------------------------------------------
> > Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
> > 
> > ----------------------------------------------------------------
> > Kuppuswamy Sathyanarayanan (8):
> >       mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
> 
> See my other bug report on this commit ...

Thanks Stephen.
Lee Jones May 31, 2017, 6:57 a.m. UTC | #5
On Tue, 30 May 2017, Sathyanarayanan Kuppuswamy Natarajan wrote:

> Hi All,
> 
> On Tue, May 30, 2017 at 8:38 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > Hi all,
> >
> > On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
> >>
> >> Dear fellow Maintainers,
> >>
> >> Enjoy!
> >>
> >> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
> >>
> >>   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
> >>
> >> are available in the git repository at:
> >>
> >>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
> >>
> >> for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
> >>
> >>   platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
> >>
> >> ----------------------------------------------------------------
> >> Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
> >>
> >> ----------------------------------------------------------------
> >> Kuppuswamy Sathyanarayanan (8):
> >>       mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
> >
> > See my other bug report on this commit ...
> 
> Sorry, its a mistake from my end. It looks like typec wcove driver got
> merged recently and I missed to add it to my cleanup patch set.
> 
> Lee,
> 
> I have created a patch to fix this issue.
> 
> Do you want me to send the entire series again with this fix or just
> send the fix alone.

This highlights the fact that this patch-set is not actually
bisectable.  To say that, when bisecting if we landed somewhere in the
middle of this set, we would receive build errors.

Ergo, this set is not actually acceptable in its current state.
Please squash all patches where you are a) changing the API (in the
MFD header), then b) transitioning users (child devices) over to it.

Ensure that you do not make any code changes and remember to move all
of the Acks you collected into the squashed patch.  Also, please use
the $SUBJECT lines commonly used by particular subsystems.  For MFD
the format is thus:

  mfd: <device>: Patch description starting with an uppercase character
Lee Jones May 31, 2017, 7:02 a.m. UTC | #6
> Dear fellow Maintainers,
> 
> Enjoy!

... or not!

Please remove these patches from your tree, since they cause build
problems in the USB subsystem.

I have asked Kuppuswamy to squash all un-bisectable patches and
re-submit.  Once in my possession, the plan is to push out another
pull-request.

> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
> 
>   Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
> 
> for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
> 
>   platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
> 
> ----------------------------------------------------------------
> Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
> 
> ----------------------------------------------------------------
> Kuppuswamy Sathyanarayanan (8):
>       mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
>       mfd: intel_soc_pmic_bxtwc: Remove thermal second level irqs
>       thermal: intel_bxt_pmic_thermal: use first level PMIC thermal irq
>       mfd: intel_soc_pmic_bxtwc: Remove second level irq for gpio device
>       gpio: gpio-wcove: use first level PMIC GPIO irq
>       mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
>       mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
>       platform: x86: intel_bxtwc_tmu: remove first level irq unmask
> 
>  drivers/gpio/gpio-wcove.c                |  14 +-
>  drivers/mfd/intel_soc_pmic_bxtwc.c       | 234 ++++++++++++++++++++-----------
>  drivers/platform/x86/intel_bxtwc_tmu.c   |   4 -
>  drivers/thermal/intel_bxt_pmic_thermal.c |   2 +-
>  include/linux/mfd/intel_soc_pmic.h       |   5 +-
>  5 files changed, 174 insertions(+), 85 deletions(-)
> 
> Kind regards,
> Lee
>
Kuppuswamy Sathyanarayanan May 31, 2017, 10:33 p.m. UTC | #7
Hi Lee,


On 05/30/2017 11:57 PM, Lee Jones wrote:
> On Tue, 30 May 2017, Sathyanarayanan Kuppuswamy Natarajan wrote:
>
>> Hi All,
>>
>> On Tue, May 30, 2017 at 8:38 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>>> Hi all,
>>>
>>> On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
>>>> Dear fellow Maintainers,
>>>>
>>>> Enjoy!
>>>>
>>>> The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
>>>>
>>>>    Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
>>>>
>>>> are available in the git repository at:
>>>>
>>>>    git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
>>>>
>>>> for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
>>>>
>>>>    platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
>>>>
>>>> ----------------------------------------------------------------
>>>> Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
>>>>
>>>> ----------------------------------------------------------------
>>>> Kuppuswamy Sathyanarayanan (8):
>>>>        mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
>>> See my other bug report on this commit ...
>> Sorry, its a mistake from my end. It looks like typec wcove driver got
>> merged recently and I missed to add it to my cleanup patch set.
>>
>> Lee,
>>
>> I have created a patch to fix this issue.
>>
>> Do you want me to send the entire series again with this fix or just
>> send the fix alone.
> This highlights the fact that this patch-set is not actually
> bisectable.
Except for the last patch set ( which has fix for typec driver 
compilation issue) that I sent yesterday,
all other patch set versions are bisectable.

The problem was when I first created this patch set, typec wcove driver 
was not merged upstream.
After creating the initial set, I was just improving the patch set and 
forgot to re-check for
child devices that depend of PMIC MFD driver.  Thats why we came across 
this compilation issue.

In future, I will try to avoid these kind of issues. I think adding 
"allyesconfig" and "allmodconfig"
compilation tests to my patch submit criteria should prevent these kind 
of issues.

> To say that, when bisecting if we landed somewhere in the
> middle of this set, we would receive build errors.
>
> Ergo, this set is not actually acceptable in its current state.
> Please squash all patches where you are a) changing the API (in the
> MFD header), then b) transitioning users (child devices) over to it.
>
> Ensure that you do not make any code changes and remember to move all
> of the Acks you collected into the squashed patch.  Also, please use
> the $SUBJECT lines commonly used by particular subsystems.  For MFD
> the format is thus:
>
>    mfd: <device>: Patch description starting with an uppercase character
yes, will include it in next update.
>
Kuppuswamy Sathyanarayanan May 31, 2017, 10:37 p.m. UTC | #8
From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

Following patch set adds chained IRQ support to WCOVE PMIC driver.

Changes since v3:
 * Added fix for typec wcove driver.

Changes since v4:
 * Squashed following two commits, to keep the patch set bisectable.
   usb: typec: typec_wcove: Use charger irq chip to get usbc virq
   mfd: intel_soc_pmic_bxtwc: use chained irqs for second level irq chips

Kuppuswamy Sathyanarayanan (8):
  mfd: intel_soc_pmic_bxtwc: Fix TMU interrupt index
  mfd: intel_soc_pmic_bxtwc: Remove thermal second level irqs
  thermal: intel_bxt_pmic_thermal: Use first level PMIC thermal irq
  mfd: intel_soc_pmic_bxtwc: Remove second level irq for gpio device
  gpio: gpio-wcove: Use first level PMIC GPIO irq
  mfd: intel_soc_pmic_bxtwc: Utilize devm_* functions in driver probe
  mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
  platform/x86: intel_bxtwc_tmu: Remove first level irq unmask

 drivers/gpio/gpio-wcove.c                |  14 +-
 drivers/mfd/intel_soc_pmic_bxtwc.c       | 234 ++++++++++++++++++++-----------
 drivers/platform/x86/intel_bxtwc_tmu.c   |   4 -
 drivers/thermal/intel_bxt_pmic_thermal.c |   2 +-
 drivers/usb/typec/typec_wcove.c          |   2 +-
 include/linux/mfd/intel_soc_pmic.h       |   5 +-
 6 files changed, 175 insertions(+), 86 deletions(-)
Andy Shevchenko June 3, 2017, 1:27 p.m. UTC | #9
On Thu, Jun 1, 2017 at 1:37 AM,
<sathyanarayanan.kuppuswamy@linux.intel.com> wrote:
> From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
>
> Following patch set adds chained IRQ support to WCOVE PMIC driver.

I commented some patches, the rest looks okay.
Please, address and send new version.
Darren Hart June 3, 2017, 5:01 p.m. UTC | #10
On Wed, May 31, 2017 at 03:33:48PM -0700, sathyanarayanan kuppuswamy wrote:
> Hi Lee,
> 
> 
> On 05/30/2017 11:57 PM, Lee Jones wrote:
> > On Tue, 30 May 2017, Sathyanarayanan Kuppuswamy Natarajan wrote:
> > 
> > > Hi All,
> > > 
> > > On Tue, May 30, 2017 at 8:38 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > > > Hi all,
> > > > 
> > > > On Tue, 30 May 2017 09:53:06 +0100 Lee Jones <lee.jones@linaro.org> wrote:
> > > > > Dear fellow Maintainers,
> > > > > 
> > > > > Enjoy!
> > > > > 
> > > > > The following changes since commit 2ea659a9ef488125eb46da6eb571de5eae5c43f6:
> > > > > 
> > > > >    Linux 4.12-rc1 (2017-05-13 13:19:49 -0700)
> > > > > 
> > > > > are available in the git repository at:
> > > > > 
> > > > >    git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/ib-mfd-gpio-thermal-x86-v4.13
> > > > > 
> > > > > for you to fetch changes up to 6aa60f67c11c10540e43bbe5a6377f7a0231501e:
> > > > > 
> > > > >    platform: x86: intel_bxtwc_tmu: remove first level irq unmask (2017-05-30 09:34:08 +0100)
> > > > > 
> > > > > ----------------------------------------------------------------
> > > > > Immutable branch between MFD, GPIO, Thermal and X86 due for the v4.13 merge window
> > > > > 
> > > > > ----------------------------------------------------------------
> > > > > Kuppuswamy Sathyanarayanan (8):
> > > > >        mfd: intel_soc_pmic_bxtwc: Use chained irqs for second level irq chips
> > > > See my other bug report on this commit ...
> > > Sorry, its a mistake from my end. It looks like typec wcove driver got
> > > merged recently and I missed to add it to my cleanup patch set.
> > > 
> > > Lee,
> > > 
> > > I have created a patch to fix this issue.
> > > 
> > > Do you want me to send the entire series again with this fix or just
> > > send the fix alone.
> > This highlights the fact that this patch-set is not actually
> > bisectable.
> Except for the last patch set ( which has fix for typec driver compilation
> issue) that I sent yesterday,
> all other patch set versions are bisectable.
> 
> The problem was when I first created this patch set, typec wcove driver was
> not merged upstream.
> After creating the initial set, I was just improving the patch set and
> forgot to re-check for
> child devices that depend of PMIC MFD driver.  Thats why we came across this
> compilation issue.
> 
> In future, I will try to avoid these kind of issues. I think adding
> "allyesconfig" and "allmodconfig"
> compilation tests to my patch submit criteria should prevent these kind of
> issues.

We do this as well as 32 and 64b for the platform driver tree, I have found it
to be a reasonable sanity test.
diff mbox

Patch

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 8c3cbf6..7cbaf1e 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -95,7 +95,10 @@  enum bxtwc_irqs_level2 {
 	BXTWC_GPIO0_IRQ,
 	BXTWC_GPIO1_IRQ,
 	BXTWC_CRIT_IRQ,
-	BXTWC_TMU_IRQ,
+};
+
+enum bxtwc_irqs_tmu {
+	BXTWC_TMU_IRQ = 0,
 };
 
 static const struct regmap_irq bxtwc_regmap_irqs[] = {