Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp789957rwr; Thu, 27 Apr 2023 08:10:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7wFBGPFcoAcfzrbHw3hW2fbcqMu0eqHI9tWnV8GslriSDHE6HtZi8OSbDPiKMVgzwFmJTv X-Received: by 2002:a05:6a20:748a:b0:f1:c0a1:8035 with SMTP id p10-20020a056a20748a00b000f1c0a18035mr2655645pzd.0.1682608241630; Thu, 27 Apr 2023 08:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682608241; cv=none; d=google.com; s=arc-20160816; b=x42lGn2gNrlkhbx7o/vV2cJNOtRjWXkaoEvbrQbXa8A6ZTK8PpgdWHOvGgMYckaj8/ sTf3QGjHwKRVe8BztjJFm+A9VrrwMD1y1dQ2zOc9mliO1AR8FeHyfkpqCc4Zifs+oGbH OjnCXy+SY+va9JVpdoE4IBBpY2s+45vHTV6oVhlwJfwDobkePhbcWFu9vmQ9z+uzvOyn R4w2Flb1Ioukj7Z/jRMfqcsAcy6aY/AyMAyyB3LGyM1Z5CIadFABYPr4NS4PQKE8u1Fb ZPPL7yD3EIDHiHFf//dorv6k/9Z7AbZvO+BRP1olS+9HhNFl2NcAsGI2uvzIO4pCPAlZ Xg8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RBD7FOyF9waifK2SZQUn00xF8/pqBv1wiS74KCipAk0=; b=TZErtEjKmHY/an3Z5GIJBF13XFV9L35hcC7v/IuzTgwdAVM0DQzjCU+sw7SO0AST9I 0mTkbgDlMehqNWpBHxYGJ4FwIZT4BJl1l/LoIlyUHNDB2z/zqqKSzrlW62DDh9DwYusH vdqCnWtlVu71SKHgWjYldO7MejY0BHdCTwc7FsbEuO+ZUTvWWBwEq4fOUz3e5ekgk3CV hef6YPqp7yoZvjEvNOfDrx9MSoH+2rXoRKGbwPhAzhC8qCSvn+dfmhbHYIHFAQUrZEmT ODQqRwECb0AMWVrHja/ISQbinp/6cHN9fd2BOK6l/EDPLWA349oZTWgmHj5lEd+mG0so //Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=umA7rf5a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l185-20020a6391c2000000b0051fc46e23fesi14381163pge.126.2023.04.27.08.10.26; Thu, 27 Apr 2023 08:10:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=umA7rf5a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244048AbjD0PHV (ORCPT + 99 others); Thu, 27 Apr 2023 11:07:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243404AbjD0PHT (ORCPT ); Thu, 27 Apr 2023 11:07:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C513E2726; Thu, 27 Apr 2023 08:07:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5FC5863925; Thu, 27 Apr 2023 15:07:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD476C433EF; Thu, 27 Apr 2023 15:07:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682608037; bh=ulSYfIm/Xn1w4SJK9Tdg8qvteSnavwAKqwgP2KV+nys=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=umA7rf5axnH/KTHkq7Hwa3KkLBl3zqEU7DEZDeAXcN4AZH2EwTAknJBGiEXKNtrt2 XCHQgb12tgqSsvatcrAKwzk31ZjJFdGE52gvi9S60biI7W9rLaKRdY4+gBdlJaJ8Yh /8lTpFPM9InRu6rGXIucZt76eljc4CBzmscmAh1oVfcCzZjAPnhjswRvkoMs6fiRHk ch9hqCBqneRsL7kSoMfgKkheUOvmLekJg36aPeQtadfceexHSIsyIUNM3g52gIr6Jt 5M8zBz68Sega5dcSGOF1ZRfj5LpRZgoZyD+5IYdxClRala8UNhiis4mzx5jvsLn06G mkCyJMu3K7tyw== Date: Thu, 27 Apr 2023 16:07:12 +0100 From: Lee Jones To: Ilpo =?iso-8859-1?Q?J=E4rvinen?= Cc: Xu Yilun , Wu Hao , Tom Rix , Moritz Fischer , linux-fpga@vger.kernel.org, Jean Delvare , Guenter Roeck , Russ Weight , linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org Subject: Re: [PATCH v3 4/4] mfd: intel-m10-bmc: Manage access to MAX 10 fw handshake registers Message-ID: <20230427150712.GV50521@google.com> References: <20230417092653.16487-1-ilpo.jarvinen@linux.intel.com> <20230417092653.16487-5-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230417092653.16487-5-ilpo.jarvinen@linux.intel.com> X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 17 Apr 2023, Ilpo Järvinen wrote: > On some MAX 10 cards, the BMC firmware is not available to service > handshake registers during secure update erase and write phases at > normal speeds. This problem affects at least hwmon driver. When the MAX > 10 hwmon driver tries to read the sensor values during a secure update, > the reads are slowed down (e.g., reading all D5005 sensors takes ~24s > which is magnitudes worse than the normal <0.02s). > > Manage access to the handshake registers using a rw semaphore and a FW > state variable to prevent accesses during those secure update phases > and return -EBUSY instead. > > If handshake_sys_reg_nranges == 0, don't update bwcfw_state as it is not > used. This avoids the locking cost. > > Co-developed-by: Russ Weight > Signed-off-by: Russ Weight > Co-developed-by: Xu Yilun > Signed-off-by: Xu Yilun > Signed-off-by: Ilpo Järvinen > --- > drivers/fpga/intel-m10-bmc-sec-update.c | 17 +++++-- > drivers/mfd/intel-m10-bmc-core.c | 67 ++++++++++++++++++++++++- > drivers/mfd/intel-m10-bmc-spi.c | 14 ++++++ > include/linux/mfd/intel-m10-bmc.h | 28 +++++++++++ > 4 files changed, 121 insertions(+), 5 deletions(-) Applied, thanks -- Lee Jones [李琼斯]