Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp636998pxb; Tue, 5 Apr 2022 16:49:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHknGF/3x7Dqh6n+4CW+fr9x9j7+kWCfMaeuB9Jd5wpw+Gj1hd8WzIu8oUi+VAoETgQYFU X-Received: by 2002:a05:6a00:300d:b0:4fa:8327:88c7 with SMTP id ay13-20020a056a00300d00b004fa832788c7mr6178924pfb.16.1649202598597; Tue, 05 Apr 2022 16:49:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649202598; cv=none; d=google.com; s=arc-20160816; b=az9HZgH9bpbXYlHvxc3gw/xbLswg7u3PoEDaj9JZ1pa6TKGsD9SMTJHJVpLvMcCsUX zyGRHFvK/hbwNAXIjVSvcOnnYwzc8LhWdjDVcc03CMQpx1M2ZznOwtfEkNfmLH41Rpg4 88wAcbmRBgFqhsBrlJ/cumybOP97md23Yxo9Mva/Le0nDrvbuGVr9bWwq90RCw7ewLgR OX1feb0Hct5JmE1no7paIeI6tbcTD1wW7IWvH3vBOrqjzhBsAItF/sXsrf4y5Z1C+naq ZOdQlDIuAsK107vkgvAg7EuTB+ICNNlosklClProqpP4BiKbIV9gKoDBLDsYarcI1S2B RT/Q== 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=7P7ahuRI3Xow0K7N/w1skULDfAa20Efkcw/oVmB7lHc=; b=LUz2HOnz7GiYhX0ZiJLsyVBfYcfna5QVir0Jnr2WobIuA/KQ29yNgzGXZAEuX/vXrN idSC1xnu16A+BPOClyf36hEpkqCD5U/GIEFioiFcp3adgZbuoxvyjRrLrzl2BgOdBCPi s0xkz7Yr1doNo/ihzZv9B3J4zvj0x1cFYDZPPIjV9dvGd1VCMM1EgPy+dzB5VFEwhsOo d763AqUtU7yh3dRJIEpZBk6ySeERC0Cze8oHLWLvdX5CAQZxdbMF7JbkaWCJcysovwms eIUZc7da2rb7oVzCpn8rGg9IU2Cu4HbL80lIzeSZFjjgM7X8g0CRRrirMi/vdtXxgHx8 fI3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aKykuR0y; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i24-20020a631318000000b003995ad9a355si4062701pgl.545.2022.04.05.16.49.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:49:58 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aKykuR0y; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9118D1162B2; Tue, 5 Apr 2022 16:34:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385587AbiDEMdi (ORCPT + 99 others); Tue, 5 Apr 2022 08:33:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235550AbiDEJCP (ORCPT ); Tue, 5 Apr 2022 05:02:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 092E365A9; Tue, 5 Apr 2022 01:54:09 -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 B1F39B81BD9; Tue, 5 Apr 2022 08:54:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CE9FC385A1; Tue, 5 Apr 2022 08:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649148846; bh=v4eLI41AdyjQ9o5HFb27oHRebt+0z8LfrZY/WbHi8qo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aKykuR0y6J9mdPyDZU4DgrFcrQ/1i4gVfAkGXBFovk1u0bcRtZOKHOUaYUGLBp3Iu LMdDV69aPJ1R50/Jnm7r11rltSxLabBTdftCRfFVR/oWf1g5U4sjBlBkmxrkEo5o1L UQj+CO6NuJhfCACX7kf7dETtxRYseqbcw0hyz1RM= 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.16 0501/1017] drm/amd/pm: enable pm sysfs write for one VF mode Date: Tue, 5 Apr 2022 09:23:34 +0200 Message-Id: <20220405070409.170939495@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@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=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 d31719b3418f..8744bda59474 100644 --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c @@ -2123,8 +2123,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