Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2079526rdb; Mon, 9 Oct 2023 11:46:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEn9d3hGXnW51gCxmH2T5+HTYYp85XpTdPlC4uqiSfr0vrCBL21iZM/YnZ/qksoZ/m1F+LN X-Received: by 2002:a17:902:d902:b0:1c6:1901:ed26 with SMTP id c2-20020a170902d90200b001c61901ed26mr12575942plz.69.1696877200004; Mon, 09 Oct 2023 11:46:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696877199; cv=none; d=google.com; s=arc-20160816; b=XADoKCCU9YwMdf7ufD2beUm+lI33I98okrr7pK/F+hUovosk9Jby4e4KvCuYp27jR2 2kSgrZpl8Vfuw3Fnqq1oIZ7lDWJ2aAZJiSS6LuhbcEYyp0TyCJvNmhZGOZwQGs5v0FPh uaQVsODiS4L+FYxbHSvcI7/nsg29elElNayWfh9S4FPWwk4kimq2Rf2wWoV5jaWrNjwW ZOpu9vxunQj4l0BpurxwWvxPTDGLcNrL79DFac11gXkcJs4mfZaNx+yU5Ejv9M+luISL msJIUbChKGuBE0AbFXS/A/73dwyfPyoSIH4F2ZISE+WEuLwxyHuPr7EyPizEUX3+S4JB cbDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=hO3LUe5ofUhhf/JzpF6obyH/g5xq6HG7iuNZoAV8g0A=; fh=JnrpcfbLzode4V3y01lUGVwcsy2+qLxH4hVeugnMfKk=; b=OYxoQ8X7tQBmwH74vuwpkY3cjkq3Gw7wOSn4zvewmzGNsX4NWOQf6uxKrhtQzviOYL khi9ndYqeC77N1d4iia4U/ahZ4QeO46PzyD0JSX6Rn8ZO44LcspxA9XBKpyVdAEr+LmX uOvpvbdu5MfUz3fA1rH2fU76ayLsU9m4HW4cuwyej3DYE5HaqyzcAD5ZDIzfwlOwOtYf 3rTm/zGC+AlXI/tivkkWqjWa1mMmqOJEbSHaC/cu4PBw+mNGcIC2gtG3WNGhciRsiBmY bCVuzBr+xsA0oJ7S0J71ZA/LqAV7fwd0Ce/ctGzug+yuorLX1EaeSROdtzipkWNKz8va 6WVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mqeC56XK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id u1-20020a170902e5c100b001c3da86939csi10831834plf.546.2023.10.09.11.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 11:46:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mqeC56XK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id AFC978026DCC; Mon, 9 Oct 2023 11:46:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378148AbjJISqJ (ORCPT + 99 others); Mon, 9 Oct 2023 14:46:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378120AbjJISqH (ORCPT ); Mon, 9 Oct 2023 14:46:07 -0400 Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A667A6 for ; Mon, 9 Oct 2023 11:46:06 -0700 (PDT) Received: by mail-ot1-x32f.google.com with SMTP id 46e09a7af769-6c4e38483d2so3465839a34.1 for ; Mon, 09 Oct 2023 11:46:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696877165; x=1697481965; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hO3LUe5ofUhhf/JzpF6obyH/g5xq6HG7iuNZoAV8g0A=; b=mqeC56XKMg1n3zpHXSKbrhwTHY+FxOjFy7Dcj3wdPDM/FcYCI6tCwkMN10mhgGE+03 c9s9Hyd8qGBV8Abz5HO/59LDzK69T2u+RxgbHO4MAqPNhCkdarWZju56RI9BxlpDK9PZ KZYo4WmGx0ZqZxZzpA1VjFE+VJhS1mOw790E1dAGmBOA4d4X/3XENSkglj7d/ZNdf902 civaTk5Gvywnx9Vc/uRz9rCCXNaY+iiDMVL1aftHudYGTVHcUBcK9NInivS6K9n7pXhF TZ95y8YlzGJVXv1r4C1keWmbtE0HyN5f6ICg6EpgNtFwtPvE23vL88MJsC+WPVl/r292 b8vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696877165; x=1697481965; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hO3LUe5ofUhhf/JzpF6obyH/g5xq6HG7iuNZoAV8g0A=; b=ooXs/vUqcIisjM7E1RBCHbGVE5WPKXMc7CzBlj+mkeNIKmktB37Oy8WlDzpn+ywMMm P9ul+Cfx67gijqkUvJqZQQr4YPlt08Kqw7ltZDcp7E5T+ByNVup8xmjUOs7wsxJ+ky+Z 8SsyNbP43ELjYMmCt+xzrg+tgBTq7Gn69k36Skjq8Ui78ZS+VK+kvvlH7cJCBwLDNDX/ qcV/7t9WW+wE6cXIsqBts90z74W/SJv9n3852fXyJtx/n9dJ/LxvZqhc4a8B60Wu/A+9 wERqldqAufzjVxJAtzqgAqzKOVURsAgDzxSgNnekXVuA0HIo1iodoFgRenM4qfrK7DzU p9Ig== X-Gm-Message-State: AOJu0Yxhe/fvrt3tvY945JggzEmi5+Sxcs6ZYGPtzWXAlsZwTmfgJPWn 2s2VMyAq0OGIS74QL2dLE4ZEpLTpKbINv3WWcSQ= X-Received: by 2002:a05:6871:451:b0:1dc:ddcd:876f with SMTP id e17-20020a056871045100b001dcddcd876fmr19133264oag.41.1696877165351; Mon, 09 Oct 2023 11:46:05 -0700 (PDT) MIME-Version: 1.0 References: <20231008064649.3184677-1-uwu@icenowy.me> In-Reply-To: From: Alex Deucher Date: Mon, 9 Oct 2023 14:45:54 -0400 Message-ID: Subject: Re: [PATCH] drm/amdgpu: fix SI failure due to doorbells allocation To: "Sharma, Shashank" Cc: Icenowy Zheng , "Deucher, Alexander" , "Koenig, Christian" , "Pan, Xinhui" , David Airlie , Daniel Vetter , "Yadav, Arvind" , "dri-devel@lists.freedesktop.org" , "amd-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 09 Oct 2023 11:46:25 -0700 (PDT) Applied. Thanks! On Mon, Oct 9, 2023 at 5:27=E2=80=AFAM Sharma, Shashank wrote: > > [AMD Official Use Only - General] > > Reviewed-by: Shashank Sharma > > Regards > Shashank > -----Original Message----- > From: Icenowy Zheng > Sent: Sunday, October 8, 2023 8:47 AM > To: Deucher, Alexander ; Koenig, Christian ; Pan, Xinhui ; David Airlie ; Daniel Vetter ; Sharma, Shashank ; Yadav, Arvind > Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux= -kernel@vger.kernel.org; Icenowy Zheng > Subject: [PATCH] drm/amdgpu: fix SI failure due to doorbells allocation > > SI hardware does not have doorbells at all, however currently the code wi= ll try to do the allocation and thus fail, makes SI AMDGPU not usable. > > Fix this failure by skipping doorbells allocation when doorbells count is= zero. > > Fixes: 54c30d2a8def ("drm/amdgpu: create kernel doorbell pages") > Signed-off-by: Icenowy Zheng > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c b/drivers/g= pu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c > index d0249ada91d30..599aece42017a 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell_mgr.c > @@ -142,6 +142,10 @@ int amdgpu_doorbell_create_kernel_doorbells(struct a= mdgpu_device *adev) > int r; > int size; > > + /* SI HW does not have doorbells, skip allocation */ > + if (adev->doorbell.num_kernel_doorbells =3D=3D 0) > + return 0; > + > /* Reserve first num_kernel_doorbells (page-aligned) for kernel o= ps */ > size =3D ALIGN(adev->doorbell.num_kernel_doorbells * sizeof(u32),= PAGE_SIZE); > > -- > 2.39.1 >