Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2861836lqp; Mon, 25 Mar 2024 11:17:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUI1RpNUlbyB5U+k4eqIHtlqaAPbpxdvn4CpO0yExXUx6X+mkmtLujwyU7DERpDwtJPhJjfZruHSU0hdi1TD+rOUTR/1LvINHMrfvw0+Q== X-Google-Smtp-Source: AGHT+IEtx4wZuhIs0fLxy+0XA9A0iwgcDklaCsEeG//nVDdiVavMD6/Te9HiS37ltm+Z+zwkLaTg X-Received: by 2002:a05:620a:1a1d:b0:78a:437c:a14e with SMTP id bk29-20020a05620a1a1d00b0078a437ca14emr10323483qkb.0.1711390635171; Mon, 25 Mar 2024 11:17:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711390635; cv=pass; d=google.com; s=arc-20160816; b=NzzU1AeFUAq0wd5vXsPHg00CM+vDZPt58ZcDm6ms5MJs1TUT4gn9xtAnj7f6hyC5IC KokDpsCjzDUkLBT30oWtdE/EsOEnH1om64UchsmTqs/z5Wan5oFpVc3WgmPP5+gCzM8t /k2JRx81oQnyHX7TH8jJxA2Kyi5S5QggfOiipZl81E6rvF1wACqyNIU89DNw1YO55ZiI Zhd7uAc9nUQIJTncISg1S2fSMuxKMfZnFYp5DLoeCQSofVE0mlU/GmKIvOlIaAD3sHuR jmGk3eRS4TgsFHaVYsN3N/JnIu7zxv6gMkzb4eRrCAGqEmXhmFfyOZHllR4hlYameTyk rEdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date; bh=rFkvZ3nuFTJVNQhhxo044zTlANuCqdLeuPqLThG8ld0=; fh=2w1+lYYWmlsepgenmRQ+IoRKCE/8EmW+j9NeCA4ErGw=; b=Vxhbu72PrcX34CQNlD3SYc+MpQUdCjkrQV0HOMi+uqSepG32KNt/KO/rEkc6FDfJ7R hleO7+EtzwCVZ0zTuWYCW1dfsynu/aqe4CpGOzV7adDmyAbpEr8iA+TDXK9u55H7jUQr HAxOf3ZRIt1GlO6/jME/kWjvy5AmUVyn6WMrPBaISKbP9vcp8F0t5yzwOUKUX51cEdRG lPXeeWfJTb4MOQxLU4cG3v1otg+9PVSJGp8Frkya/y1ItquooGU56Wz95XTuZ9x/mANj H4zYUBfTOKHtlCptnlwYNxxcVn51/n/ZAqipTle7yoD4q1LTT1vMGektMcCCNnnibrpQ 3WQw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-117633-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117633-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z1-20020ae9e601000000b00789fc9196dcsi5876394qkf.557.2024.03.25.11.17.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 11:17:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-117633-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-117633-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-117633-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CC8651C3AE9C for ; Mon, 25 Mar 2024 18:17:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 722311401E; Mon, 25 Mar 2024 17:46:18 +0000 (UTC) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (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 5DA578F48; Mon, 25 Mar 2024 17:46:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711388777; cv=none; b=n7t3NFYKlUeOtk4n6EXOX6g5JCCy1/adEIPvydhiMRTdtz5ne96QYyTD0D6gBMaFv7OpErFpSz9AjrKJ5HiHacmPpGhGNa6pZLGNXwKbLZUMUiYvUflZHvac726xiJI7WYFRSm9zEvT1jB/EdsQzTe20UWdQaxOwNkzyheplFS8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711388777; c=relaxed/simple; bh=ZJ8ukYnDZoEFr9eoi9abepsnBhzy11uF5svrMsTITIE=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pYCNqqfWJMsHrBqYUi2aJj/X+sTBJRFGsUe+GMB+fT9+zx0eOPS6f2dq8cv6rguuaiS2iwjEhW6nrmjNVmhcaJp7xOm4zcnZdoB1w9WD0bxvJkoOYrab2PwTUtb+fjFodIa15I9ziR+dDOOc6Driiz3rDW/Ok7rNOdoLafegO28= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=Huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4V3KxS3XGnz67mnJ; Tue, 26 Mar 2024 01:41:48 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id 0428B1400DC; Tue, 26 Mar 2024 01:46:13 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 25 Mar 2024 17:46:12 +0000 Date: Mon, 25 Mar 2024 17:46:11 +0000 From: Jonathan Cameron To: Ira Weiny CC: Dave Jiang , Fan Ni , "Navneet Singh" , Dan Williams , Davidlohr Bueso , Alison Schofield , Vishal Verma , , , Subject: Re: [PATCH 05/26] cxl/core: Simplify cxl_dpa_set_mode() Message-ID: <20240325174611.00006e0c@Huawei.com> In-Reply-To: <20240324-dcd-type2-upstream-v1-5-b7b00d623625@intel.com> References: <20240324-dcd-type2-upstream-v1-0-b7b00d623625@intel.com> <20240324-dcd-type2-upstream-v1-5-b7b00d623625@intel.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml100002.china.huawei.com (7.191.160.241) To lhrpeml500005.china.huawei.com (7.191.163.240) On Sun, 24 Mar 2024 16:18:08 -0700 Ira Weiny wrote: > cxl_dpa_set_mode() checks the mode for validity two times, once outside > of the DPA RW semaphore and again within. The function is not in a > critical path. Prior to Dynamic Capacity the extra check was not much > of an issue. The addition of DC modes increases the complexity of > the check. > > Simplify the mode check before adding the more complex DC modes. > > Signed-off-by: Ira Weiny Nice. Maybe drag this earlier in series so it could potentially be picked up as a cleanup? Same with patch 2 potentially. If Dave is fine with doing that sort of precursor patches going earlier, it will save carrying quite so many in this series for future versions (and make it look less terrifying :) Reviewed-by: Jonathan Cameron