lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141204184210.GA1530@pathfinder>
Date:	Thu, 4 Dec 2014 10:42:10 -0800
From:	"David E. Box" <david.e.box@...ux.intel.com>
To:	Jarkko Nikula <jarkko.nikula@...ux.intel.com>
Cc:	wsa@...-dreams.de, jdelvare@...e.de, arnd@...db.de,
	maxime.ripard@...e-electrons.com, dianders@...omium.org,
	u.kleine-koenig@...gutronix.de,
	laurent.pinchart+renesas@...asonboard.com,
	boris.brezillon@...e-electrons.com, andrew@...n.ch,
	sjg@...omium.org, markus.mayer@...aro.org,
	jacob.jun.pan@...ux.intel.com, max.schwarz@...ine.de,
	mika.westerberg@...ux.intel.com, skuribay@...ox.com,
	Romain.Baeriswyl@...lis.com, wenkai.du@...el.com,
	chiau.ee.chew@...el.com, alan@...ux.intel.com,
	linux-kernel@...r.kernel.org, linux-i2c@...r.kernel.org
Subject: Re: [PATCH V3 1/2] i2c-designware: Add i2c bus locking support

On Thu, Dec 04, 2014 at 09:59:11AM +0200, Jarkko Nikula wrote:
> Hi
> 
> On 12/02/2014 02:09 AM, David E. Box wrote:
> >Adds support for acquiring and releasing a hardware bus lock in the i2c
> >designware core transfer function. This is needed for i2c bus controllers
> >that are shared with but not controlled by the kernel.
> >
> >Signed-off-by: David E. Box <david.e.box@...ux.intel.com>
> >---
> >  drivers/i2c/busses/i2c-designware-core.c    | 11 +++++++++++
> >  drivers/i2c/busses/i2c-designware-core.h    |  6 ++++++
> >  drivers/i2c/busses/i2c-designware-platdrv.c | 18 +++++++++++++-----
> >  3 files changed, 30 insertions(+), 5 deletions(-)
> >
> ...
> >diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> >index a743115..afdff3b 100644
> >--- a/drivers/i2c/busses/i2c-designware-platdrv.c
> >+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> >@@ -261,10 +261,16 @@ static int dw_i2c_probe(struct platform_device *pdev)
> >  		return r;
> >  	}
> >-	pm_runtime_set_autosuspend_delay(&pdev->dev, 1000);
> >-	pm_runtime_use_autosuspend(&pdev->dev);
> >-	pm_runtime_set_active(&pdev->dev);
> >-	pm_runtime_enable(&pdev->dev);
> >+	i2c_dw_eval_lock_support(dev);
> i2c_dw_eval_lock_support() is added in the next patch.
> >+
> >+	if (dev->pm_runtime_disabled) {
> >+		pm_runtime_forbid(&pdev->dev);
> >+	} else {
> >+		pm_runtime_set_autosuspend_delay(&pdev->dev, 1000);
> >+		pm_runtime_use_autosuspend(&pdev);
> >+		pm_runtime_set_active(&pdev->dev);
> >+		pm_runtime_enable(&pdev->dev);
> >+	}
> >  	return 0;
> >  }
> >@@ -314,7 +320,9 @@ static int dw_i2c_resume(struct device *dev)
> >  	struct dw_i2c_dev *i_dev = platform_get_drvdata(pdev);
> >  	clk_prepare_enable(i_dev->clk);
> >-	i2c_dw_init(i_dev);
> >+
> >+	if (!i_dev->pm_runtime_disabled)
> >+		i2c_dw_init(i_dev);
> Should there be similar conditional call or locking around
> i2c_dw_init() and i2c_dw_disable_int() also in dw_i2c_probe()?
> 

Timely reply. Around i2c_dw_init(), yes. I just discovered this as the source
of a recent hang that's occuring in the loop in __i2c_dw_enable().
The hange occurs very infrequently and only, so far, when not built in. A
block around i2c_dw_disable_int() would make sense as well as a precaution.

Dave
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ