public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Evgeny Novikov <novikov@ispras.ru>
To: Guenter Roeck <linux@roeck-us.net>,
	"madhuparnabhowmik10@gmail.com" <madhuparnabhowmik10@gmail.com>
Cc: "ldv-project@linuxtesting.org" <ldv-project@linuxtesting.org>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"wim@linux-watchdog.org" <wim@linux-watchdog.org>
Subject: Re: [ldv-project] [PATCH] drivers: watchdog: rdc321x_wdt: Fix race condition bugs
Date: Fri, 07 Aug 2020 21:30:58 +0300	[thread overview]
Message-ID: <507311596824581@mail.yandex.ru> (raw)
In-Reply-To: <20200807162141.GA41980@roeck-us.net>

07.08.2020, 19:21, "Guenter Roeck" <linux@roeck-us.net>:
> On Fri, Aug 07, 2020 at 04:59:02PM +0530, madhuparnabhowmik10@gmail.com wrote:
>>  From: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>>
>>  In rdc321x_wdt_probe(), rdc321x_wdt_device.queue is initialized
>>  after misc_register(), hence if ioctl is called before its
>>  initialization which can call rdc321x_wdt_start() function,
>>  it will see an uninitialized value of rdc321x_wdt_device.queue,
>>  hence initialize it before misc_register().
>>  Also, rdc321x_wdt_device.default_ticks is accessed in reset()
>>  function called from write callback, thus initialize it before
>>  misc_register().
>>
>>  Found by Linux Driver Verification project (linuxtesting.org).
>>
>>  Signed-off-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
>
> Having said that ... this is yet another potentially obsolete driver.
> You are really wasting your (and, fwiw, my) time.

Static analysis tools are not aware about obsolete drivers.
It would be great if there will be some formal way to filter them out.
Maybe some file will enumerate all obsolete drivers, or there will be
something within their source code, or something else.

-- 
Best regards,
Evgeny Novikov

>
> Florian, any thoughts if support for this chip can/should be deprecated
> or even removed ?
>
> Guenter
>
>>  ---
>>   drivers/watchdog/rdc321x_wdt.c | 5 ++---
>>   1 file changed, 2 insertions(+), 3 deletions(-)
>>
>>  diff --git a/drivers/watchdog/rdc321x_wdt.c b/drivers/watchdog/rdc321x_wdt.c
>>  index 57187efeb86f..f0c94ea51c3e 100644
>>  --- a/drivers/watchdog/rdc321x_wdt.c
>>  +++ b/drivers/watchdog/rdc321x_wdt.c
>>  @@ -231,6 +231,8 @@ static int rdc321x_wdt_probe(struct platform_device *pdev)
>>
>>           rdc321x_wdt_device.sb_pdev = pdata->sb_pdev;
>>           rdc321x_wdt_device.base_reg = r->start;
>>  + rdc321x_wdt_device.queue = 0;
>>  + rdc321x_wdt_device.default_ticks = ticks;
>>
>>           err = misc_register(&rdc321x_wdt_misc);
>>           if (err < 0) {
>>  @@ -245,14 +247,11 @@ static int rdc321x_wdt_probe(struct platform_device *pdev)
>>                                   rdc321x_wdt_device.base_reg, RDC_WDT_RST);
>>
>>           init_completion(&rdc321x_wdt_device.stop);
>>  - rdc321x_wdt_device.queue = 0;
>>
>>           clear_bit(0, &rdc321x_wdt_device.inuse);
>>
>>           timer_setup(&rdc321x_wdt_device.timer, rdc321x_wdt_trigger, 0);
>>
>>  - rdc321x_wdt_device.default_ticks = ticks;
>>  -
>>           dev_info(&pdev->dev, "watchdog init success\n");
>>
>>           return 0;
>>  --
>>  2.17.1
>
> _______________________________________________
> ldv-project mailing list
> ldv-project@linuxtesting.org
> http://linuxtesting.org/cgi-bin/mailman/listinfo/ldv-project

  parent reply	other threads:[~2020-08-07 18:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07 11:29 [PATCH] drivers: watchdog: rdc321x_wdt: Fix race condition bugs madhuparnabhowmik10
2020-08-07 16:21 ` Guenter Roeck
2020-08-07 18:08   ` Florian Fainelli
2020-08-07 18:19     ` Guenter Roeck
2020-08-07 19:08     ` Guenter Roeck
2020-08-07 20:09       ` Florian Fainelli
2020-08-07 23:23         ` Guenter Roeck
2020-08-08  0:41           ` Florian Fainelli
2020-08-08  4:58             ` Guenter Roeck
2020-08-07 18:30   ` Evgeny Novikov [this message]
2020-08-07 19:00     ` [ldv-project] " Guenter Roeck

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=507311596824581@mail.yandex.ru \
    --to=novikov@ispras.ru \
    --cc=f.fainelli@gmail.com \
    --cc=ldv-project@linuxtesting.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=madhuparnabhowmik10@gmail.com \
    --cc=wim@linux-watchdog.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox