All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
To: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
	Stefan Christ <s.christ-guT5V/WYfQezQB+pC5nmwQ@public.gmane.org>
Cc: linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 0/6] Implement I2C restart handler
Date: Tue, 5 Jul 2016 08:41:04 -0700	[thread overview]
Message-ID: <577BD510.1070506@roeck-us.net> (raw)
In-Reply-To: <20160705145839.GA3641@tetsubishi>

On 07/05/2016 07:58 AM, Wolfram Sang wrote:
> Hi,
>
>> this is a request for feedback about a lockdep-warning-free I2C
>> restart_handler.  I would like to know whether someone had the problem already
>> and how the best and mainline friendliest solution looks like.
>> I have an embedded board with the PMIC chip DA9063 that is also used as a
>> voltage regulator for DVFS. For a clean reboot/reset of the system I have to
>> set the bit nSHUTDOWN in the PMIC via I2C. The restart_handler call chain
>> is of type
>>
>>      static ATOMIC_NOTIFIER_HEAD(restart_handler_list);
>>
>> So any code running as a restart_handler cannot (should not) wait, for other
>> locks. When you use i2c_transfer/regmap you get lockdep warnings like [1].
>
> Yes, this problem has come up occasionally. And it is not only about
> sleeping. IRQs are disabled, too.
>
> My idea was to introduce master_xfer_irqless or similar to struct
> i2c_algorithm. I even discussed this shortly with Mark Brown how to
> interact with regmap; but this was too long ago, so I forgot what we
> agreed on :(
>
>> Any comments?
>
> I just skimmed very lightly over the patchset. Yet, seeing an I2C client
> messing directly with 'struct adapter' breaks so many abstractions, it
> hits my instant-NACK nerve ;)
>

My NACK would be for two other reasons: First, for bypassing the watchdog core
for handling the minimum time between heartbeats, second for bypassing
the watchdog core to implement a reboot handler. Both are inadequately
or not at all explained.

Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux@roeck-us.net>
To: Wolfram Sang <wsa@the-dreams.de>, Stefan Christ <s.christ@phytec.de>
Cc: linux-watchdog@vger.kernel.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH 0/6] Implement I2C restart handler
Date: Tue, 5 Jul 2016 08:41:04 -0700	[thread overview]
Message-ID: <577BD510.1070506@roeck-us.net> (raw)
In-Reply-To: <20160705145839.GA3641@tetsubishi>

On 07/05/2016 07:58 AM, Wolfram Sang wrote:
> Hi,
>
>> this is a request for feedback about a lockdep-warning-free I2C
>> restart_handler.  I would like to know whether someone had the problem already
>> and how the best and mainline friendliest solution looks like.
>> I have an embedded board with the PMIC chip DA9063 that is also used as a
>> voltage regulator for DVFS. For a clean reboot/reset of the system I have to
>> set the bit nSHUTDOWN in the PMIC via I2C. The restart_handler call chain
>> is of type
>>
>>      static ATOMIC_NOTIFIER_HEAD(restart_handler_list);
>>
>> So any code running as a restart_handler cannot (should not) wait, for other
>> locks. When you use i2c_transfer/regmap you get lockdep warnings like [1].
>
> Yes, this problem has come up occasionally. And it is not only about
> sleeping. IRQs are disabled, too.
>
> My idea was to introduce master_xfer_irqless or similar to struct
> i2c_algorithm. I even discussed this shortly with Mark Brown how to
> interact with regmap; but this was too long ago, so I forgot what we
> agreed on :(
>
>> Any comments?
>
> I just skimmed very lightly over the patchset. Yet, seeing an I2C client
> messing directly with 'struct adapter' breaks so many abstractions, it
> hits my instant-NACK nerve ;)
>

My NACK would be for two other reasons: First, for bypassing the watchdog core
for handling the minimum time between heartbeats, second for bypassing
the watchdog core to implement a reboot handler. Both are inadequately
or not at all explained.

Guenter


  reply	other threads:[~2016-07-05 15:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-05 13:22 [PATCH 0/6] Implement I2C restart handler Stefan Christ
2016-07-05 13:22 ` Stefan Christ
2016-07-05 13:22 ` [RFC 1/6] watchdog: da9063_wdt: don't trigger watchdog too fast Stefan Christ
2016-07-05 15:33   ` Guenter Roeck
     [not found]     ` <577BD34F.7000804-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2016-07-06  8:42       ` Stefan Christ
2016-07-06  8:42         ` Stefan Christ
2016-07-05 13:22 ` [RFC 2/6] watchdog: da9063_wdt: use delayed work to trigger Stefan Christ
2016-07-05 13:22 ` [RFC 3/6] i2c-imx: add blocking xfer function Stefan Christ
     [not found] ` <1467724943-13416-1-git-send-email-s.christ-guT5V/WYfQezQB+pC5nmwQ@public.gmane.org>
2016-07-05 13:22   ` [RFC 4/6] i2c-core: add possibility to block an adapter for a single user Stefan Christ
2016-07-05 13:22     ` Stefan Christ
2016-07-05 13:22   ` [RFC 6/6] watchdog: da9063_wdt: add schedule-free and race-free restart handler Stefan Christ
2016-07-05 13:22     ` Stefan Christ
2016-07-05 15:37     ` Guenter Roeck
2016-07-05 13:22 ` [RFC 5/6] mfd: da9063: save i2c_client for later use Stefan Christ
2016-07-05 14:58 ` [PATCH 0/6] Implement I2C restart handler Wolfram Sang
2016-07-05 15:41   ` Guenter Roeck [this message]
2016-07-05 15:41     ` Guenter Roeck
2016-07-06  9:18   ` Stefan Christ
2016-07-06  9:18     ` Stefan Christ
2016-07-06 14:16     ` Wolfram Sang
2016-07-06 14:16       ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=577BD510.1070506@roeck-us.net \
    --to=linux-0h96xk9xttrk1umjsbkqmq@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=s.christ-guT5V/WYfQezQB+pC5nmwQ@public.gmane.org \
    --cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.