Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp704586pxb; Tue, 5 Apr 2022 19:32:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyg+XzlTAFAu63D0X+GmGvN0vrkmo6ZmqIwyMI7arLxb35tqnM2PXC0MOT5w6WwhanzacVM X-Received: by 2002:a05:6a00:1a89:b0:4fa:b21d:2cd with SMTP id e9-20020a056a001a8900b004fab21d02cdmr6521274pfv.62.1649212376568; Tue, 05 Apr 2022 19:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649212376; cv=none; d=google.com; s=arc-20160816; b=oVSlBaYYejdLL0ezDTUNvgumNWjPz7Gv5wTXXLlPwwcjOBgAuAM72v4SwE0pZ0O70K N+DtwGMU8MkqbJSnJZMBHdQxq+DOS30pNLNQPs6/TtOjGyGQ5OxNDQJ8Fpb93eRERGLf Jx6vHrc7Fj9yYalCnZov8amolFCwZolRFgWqfePEHRo2Rio7JdHyPwAzwm3ugnudqXEI yFv9vdEtDdoABx4fZfUzd4w2vxcZQy9wIkE2wwR7j6VMPTd1DO/hwe5xOBH46aUNNXUg GmYoacqAxLu6ZPYaQv7wDA9bZh0sxKTahDQSA8Ij3q+PdCFYtRpLva71WXWtfRvFd2zy 2+mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=j7QqhGqh+vOj30M54QjC57ZacasEaZCPGtATaTTVnn4=; b=NH/x0ljTUOUcsoQZCAdwIdUiWaXNvH4j9oM0Y59egY4nN8Int1tojH+LIytOWiKxCY A25p/hTbuS4BaEe08vaQbJ1pts0sTqlJ/kC4172UXtf+b6OUpO3Y8HoJK2wzv9W2ibOT p5g50M+PztIi9u1ccd3uogH9PQ6JhAzJbShoZrstZSkMyEt/0qgC9ZAkh6jiPzTD+Yzw H2+Ow1NvpIJfglJ/N7cSbpDxEdH1OaXHBa1Nd+cB7oIgBeD3jQNDTKTcs72yHukcq+GJ GIaC4uHz0FVP6CCs6brxInsNYX9Qi0+KmoYLtNWdsvgkPBanwaSb6+Xq0y0x8TLKVRiU rmCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t0pboeJE; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x4-20020a63db44000000b003862e2ae4f3si160213pgi.352.2022.04.05.19.32.42; Tue, 05 Apr 2022 19:32:56 -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=@linuxfoundation.org header.s=korg header.b=t0pboeJE; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234836AbiDEI71 (ORCPT + 99 others); Tue, 5 Apr 2022 04:59:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236781AbiDEIRC (ORCPT ); Tue, 5 Apr 2022 04:17:02 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FB69ADD64; Tue, 5 Apr 2022 01:04:38 -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 ams.source.kernel.org (Postfix) with ESMTPS id 7DAF0B81BB6; Tue, 5 Apr 2022 08:04:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E98E0C385A6; Tue, 5 Apr 2022 08:04:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649145858; bh=PXuFf0IbjBV3uj1gU1sJ2tocw8L0iqRTTtJJ7qbANXg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t0pboeJEe+DngftCK4BE33LZcDZuh5gQPkoj/XYKVLxDPV7/sGiDDl3t7Ea7mdn9L 8cng8TUEKlvltynLoFZVHdTE2zOl7yXOQbyAbgfl4SMzOXEeZgf3mEG33gQG51iBDY WMiPli26oWuU10YeB/H6TwQ+WN2Y/JL8xCOMJAls= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yiqing Yao , Monk Liu , Alex Deucher , Sasha Levin Subject: [PATCH 5.17 0548/1126] drm/amd/pm: enable pm sysfs write for one VF mode Date: Tue, 5 Apr 2022 09:21:35 +0200 Message-Id: <20220405070423.718090872@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 From: Yiqing Yao [ Upstream commit e610941c45bad75aa839af015c27d236ab6749e5 ] [why] pm sysfs should be writable in one VF mode as is in passthrough [how] do not remove write access on pm sysfs if device is in one VF mode Fixes: 11c9cc95f818 ("amdgpu/pm: Make sysfs pm attributes as read-only for VFs") Signed-off-by: Yiqing Yao Reviewed-by: Monk Liu Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c index 48cc009d9bdf..dc910003f3ca 100644 --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c @@ -2134,8 +2134,8 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_ } } - /* setting should not be allowed from VF */ - if (amdgpu_sriov_vf(adev)) { + /* setting should not be allowed from VF if not in one VF mode */ + if (amdgpu_sriov_vf(adev) && !amdgpu_sriov_is_pp_one_vf(adev)) { dev_attr->attr.mode &= ~S_IWUGO; dev_attr->store = NULL; } -- 2.34.1