Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp448143rwr; Thu, 20 Apr 2023 01:30:20 -0700 (PDT) X-Google-Smtp-Source: AKy350YiW9439jXVB/FcuAOSyPtZN0dNHE3eBRQp5bzeOYC6eujZ9a9W5aF/PeYIKn/aFa0VSZN9 X-Received: by 2002:a05:6a20:3ca4:b0:ee:444a:ce1a with SMTP id b36-20020a056a203ca400b000ee444ace1amr607024pzj.30.1681979420473; Thu, 20 Apr 2023 01:30:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681979420; cv=none; d=google.com; s=arc-20160816; b=XXo4y2Qq127NlTR8jrT/H/G1KNTvqQicS1DddCsWUeoKeLw0zBMWpggUjjbwcBjZhm G7kj1RUyPyQL6gbe4+NcRbqIdfBhjn5pBULM9t7+ClOsreGj8E0yLrIklamGWilWm2qW EcnYcKwVw0nO1Ai/VXlLX1SbS3mBWxuUsqAS8sCLs5l+Pojb/FhfyJnhurdEYZlD16Ng 8WgO7hTVRtOXAF4q7/85iB9v0zjmTx8VRllepWkfgfgv+bFj+f19MXL04KAV58WYckKI bnhIyDENJe2USbqXPMHOad7YdWOtVunSvhJrVWhr3XQSmrqj1TF+4DANoypIunCC1NQw plKg== 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=Q4aDcRHOXfKvhU0xQUydlKK8iwIbkvgYLHgvPJTT5bw=; b=l1LmR1YJDcGZt42K3hhPbQNhN/na0I7dNKBXFU05bs9deJ8WS/feDMe2lcUtfRVdzd SrHamIiNgICweHhEHkdMhFlKsglNzl6hxeIV6cQ2iLtns/z3QkYrTq6bu+4b6izctxEH BRHKoVGwu84l3QUjv0UHKz3R0rXg7FpskM4HgKkx/cLrWssBJ7Gs9t83nSvwwHA3XOvt bgVzYn56H/k77xl5BO5U6EjWux9/D9lel/mYCOsYMqynQlzQtz5WqZo8j/f0KTeufeoC aGS0J9WAWDcVaXWs02cH9YNVy9DiDvrSSQ2WiWXzSE4Bw2qpZlUk64J7v+e4PepRR/7u mBvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cQE1FGXc; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q22-20020aa79836000000b0063b54679d0dsi1143631pfl.44.2023.04.20.01.30.07; Thu, 20 Apr 2023 01:30:20 -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=@intel.com header.s=Intel header.b=cQE1FGXc; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234153AbjDTIHF (ORCPT + 99 others); Thu, 20 Apr 2023 04:07:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233822AbjDTIHE (ORCPT ); Thu, 20 Apr 2023 04:07:04 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 755C513E; Thu, 20 Apr 2023 01:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681978023; x=1713514023; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=IWgTUakXo/so+EUi19BYPXwPdQE5MJLPRo4AH1Tqv8E=; b=cQE1FGXcUVrkTgHsGSiISeQ0nqDmYKpsqGdNvNYemb9tG+C+/Rl5+hfx g/q3wJYommZ+9B2aSmF7YNofc2EC7Z/TlR1ikEY3hnAsHl1MziEfAade2 BUZ4v0Qk3bZOpjV/uWytXTQYwJkLstWRW7Cwk7ispJnzl77zBLXt+DXo+ f2qHnkjn22mCXKXNAEolK8cFBiPOR4/r3uWF10EJYfc7V7roZ6SPAsy0+ uybKe16+o8O5A6SJuLyuJ92w8v618NTtGOvSAcfxGPB4Cs2f1L267ZnQa amoZRZPjupPEFY+iqvMVB0VL7MKL0WYV6XodXZvkRVkJoitXmFC2NJfju w==; X-IronPort-AV: E=McAfee;i="6600,9927,10685"; a="334494756" X-IronPort-AV: E=Sophos;i="5.99,212,1677571200"; d="scan'208";a="334494756" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2023 01:07:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10685"; a="722283330" X-IronPort-AV: E=Sophos;i="5.99,212,1677571200"; d="scan'208";a="722283330" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by orsmga008.jf.intel.com with ESMTP; 20 Apr 2023 01:06:59 -0700 Date: Fri, 21 Apr 2023 00:07:30 +0800 From: Xu Yilun To: Ilpo =?iso-8859-1?Q?J=E4rvinen?= Cc: Wu Hao , Tom Rix , Moritz Fischer , linux-fpga@vger.kernel.org, Lee Jones , 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: 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230417092653.16487-5-ilpo.jarvinen@linux.intel.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,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 2023-04-17 at 12:26:53 +0300, 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 Reviewed-by: Xu Yilun Hi Lee: Could the fpga part also been applied to mfd tree when everyone is good? Thanks, Yilun > --- > 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(-)