[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+1k2cEFBn-TbtOY59+1Rrb2FgEjioiwQUQ+QbmYEM5KPnvHjQ@mail.gmail.com>
Date: Tue, 10 Mar 2015 01:34:14 +0100
From: Thorsten Bschorr <thorsten@...horr.de>
To: David Fries <david@...es.net>
Cc: "??????? ???????" <zbr@...emap.net>,
Jonathan ALIBERT <jonathan.alibert@...il.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Avoid null-pointer access in w1/slaves/w1_therm
> It looks like your patch runs into dead locks problems:
>
> I have a cron job reading my sensors. If I read the sensors on another
> thread (e.g. via cat), the 2nd thread can produce a dead lock:
>
> * thread 1 has bus & sl lock
> * thread 1 drops bus lock, keeps sl locks and sleeps
> * thread 2 get bus lock, waits for sl lock
> * thread 1 returns from sleep, waits for bus lock, but this is help by thread 2
Aquiring sl lock before the bus lock prevents this dead lock (no
change of locking-order).
With search enabled, removing a device by w1_search_process_cb then
also worked as intended:
Mar 10 01:29:04 pi kernel: [ 924.870893] w1_therm_remove_slave about
to lock faily_data->lock
Mar 10 01:29:04 pi kernel: [ 924.870935] w1_therm_remove_slave
unlocked faily_data->lock
Mar 10 01:29:04 pi kernel: [ 924.871115] w1_therm_remove_slave about
to lock faily_data->lock
Mar 10 01:29:05 pi kernel: [ 925.151242] start sleep d117a600 refcnt 1 **
Mar 10 01:29:05 pi kernel: [ 925.151277] end sleep d117a600 refcnt 0 **
Mar 10 01:29:11 pi kernel: [ 931.295344] w1_slave_driver
10-000802cc045a: Read failed CRC check
Mar 10 01:29:11 pi kernel: [ 931.295437] w1_therm_remove_slave
unlocked faily_data->lock
** I get the ref-cnt before and after the sleep and only log if they differ.
But I am unable to judge if mobing the sl lock at the beginning of
w1_slave_show can cause dead locks in other scenarios.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists