From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 524E413248B; Thu, 15 Feb 2024 15:30:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708011007; cv=none; b=EfEhyn0QRPAo7FhXHoZVw9Roe8cRy4XkUmMoGfa/qvfmGhXEYk31nnKFw4RCPbdgCR5cwzBenFpZyKxyI5CVv0g255e9p9vA7qQSQ1wjE+8gJqtL0vZl4r561srB8Rh7/ny5BGfx2oqAb0hH9HX4NMBuObryuJOh9cztLtEwLl4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708011007; c=relaxed/simple; bh=7FH9+/XxkCRInxPS41Q+8R6DeaJMzhCGWVLPdasdJ4E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qKDn0u2JbrEK0HBeJJsBeD8nJn4q430UsblpVIpppT01yb4Yzut8DSBIPbCCWYBqmi+5UFEGLhQWALx1B9qlVCQ8bjwU/fqlnOSDh7rHeNZByJ6bLhJw3qwYBqrH+flQZB8pZ+qIqZa0s4sIpV6VkU2TMG4RyeC7DWVqgcGjRSg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=fail smtp.mailfrom=kernel.org; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=kernel.org X-IronPort-AV: E=McAfee;i="6600,9927,10984"; a="2229295" X-IronPort-AV: E=Sophos;i="6.06,162,1705392000"; d="scan'208";a="2229295" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2024 07:30:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10984"; a="912180681" X-IronPort-AV: E=Sophos;i="6.06,162,1705392000"; d="scan'208";a="912180681" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2024 07:29:58 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1radgR-00000004pQG-2G9j; Thu, 15 Feb 2024 17:29:55 +0200 Date: Thu, 15 Feb 2024 17:29:55 +0200 From: Andy Shevchenko To: Thomas Richard Cc: Linus Walleij , Bartosz Golaszewski , Tony Lindgren , Haojian Zhuang , Vignesh R , Aaro Koskinen , Janusz Krzysztofik , Andi Shyti , Peter Rosin , Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com Subject: Re: [PATCH v3 05/18] mux: add mux_chip_resume() function Message-ID: References: <20240102-j7200-pcie-s2r-v3-0-5c2e4a3fac1f@bootlin.com> <20240102-j7200-pcie-s2r-v3-5-5c2e4a3fac1f@bootlin.com> Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240102-j7200-pcie-s2r-v3-5-5c2e4a3fac1f@bootlin.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Thu, Feb 15, 2024 at 04:17:50PM +0100, Thomas Richard wrote: > The mux_chip_resume() function restores a mux_chip using the cached state > of each mux. ... > +int mux_chip_resume(struct mux_chip *mux_chip) > +{ > + int global_ret = 0; > + int ret, i; > + > + for (i = 0; i < mux_chip->controllers; ++i) { > + struct mux_control *mux = &mux_chip->mux[i]; > + > + if (mux->cached_state == MUX_CACHE_UNKNOWN) > + continue; > + > + ret = mux_control_set(mux, mux->cached_state); > + if (ret < 0) { > + dev_err(&mux_chip->dev, "unable to restore state\n"); > + if (!global_ret) > + global_ret = ret; Hmm... This will record the first error and continue. > + } > + } > + return global_ret; So here, we actually will get stale data in case there are > 1 failures. > +} -- With Best Regards, Andy Shevchenko