From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754095AbdBPJwX (ORCPT ); Thu, 16 Feb 2017 04:52:23 -0500 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:35175 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753221AbdBPJwT (ORCPT ); Thu, 16 Feb 2017 04:52:19 -0500 Message-ID: <1487238737.2377.3.camel@pengutronix.de> Subject: Re: [PATCH] reset: fix shared reset triggered_count decrement on error From: Philipp Zabel To: Jerome Brunet Cc: Martin Blumenstingl , linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org Date: Thu, 16 Feb 2017 10:52:17 +0100 In-Reply-To: <1487182551-31517-1-git-send-email-jbrunet@baylibre.com> References: <1487182551-31517-1-git-send-email-jbrunet@baylibre.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2017-02-15 at 19:15 +0100, Jerome Brunet wrote: > For a shared reset, when the reset is successful, the triggered_count is > incremented when trying to call the reset callback, so that another device > sharing the same reset line won't trigger it again. If the reset has not > been triggered successfully, the trigger_count should be decremented. > > The code does the opposite, and decrements the trigger_count on success. > As a consequence, another device sharing the reset will be able to trigger > it again. > > Fixed be removing negation in from of the error code of the reset function. > > Fixes: 7da33a37b48f ("reset: allow using reset_control_reset with shared reset") > > Signed-off-by: Jerome Brunet > --- > Hi Philipp, > > I found this issue while testing your patch [0] > It fixes a regression we have been having with usb. On meson-gxbb > platforms, usb0 and usb1 share the same reset line. Martin had > reports that usb0 recently got broken. In fact usb1 was able to > trigger the reset again because the issue mentioned above. Thanks, applied with Martin's Acked-by. I'll send a pull request for this later today. regards Philipp