Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2372967lqb; Mon, 27 May 2024 18:45:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXFzYOhGLScaPeyquE3eeNCAbkXqZJUk3b+kYBWSboKUJtNA/Oq2blHV8DTgWOW3wt1qUX8yz4GCYCtlT55xACBqoXI8xkFFvLckpSk1g== X-Google-Smtp-Source: AGHT+IFvX/p/LhAZ9HYbraNBIsUDPD9kM+Szd9zMr1PnZaaoUe3A2QpPTPphPvSSv3ZsViwqoMI9 X-Received: by 2002:a17:907:950a:b0:a62:15a5:cabc with SMTP id a640c23a62f3a-a62646d5e4amr913306166b.44.1716860725034; Mon, 27 May 2024 18:45:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716860725; cv=pass; d=google.com; s=arc-20160816; b=KyDdS9qfn977PkB6/ja9X9zFcSjGvPtyaJOWW3R0j2zA8iyjj0P0yDb///xmomRXMA UjQglnLLMYuzvMGGLWqmIvbrToRDEVWk/JA7HfnLrFkPLKT1of1jl9ztkfL0i4cMfkNE JO98wsnMEtTWOQK+bfqUUHZldxDZYMYEtHWfXLTRuVoncHSTKda06ah1dkksytobbDd+ kX2mRF7HhJWuXqUWx2ofZVHXn14qRBWFGr+rlG7hau2CkFwPYYSDq4OD14ZqOlbzDaWB cWNZkOUjaGr3GxYVyb6v6n7qrHse6lkHLIQgd4ddtTvpQSzMpUM5L9Xw/daxw+1/qik6 opdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=4WZuzBn8quBWeOsvE1Lk2Z6AJ5TaLj0Zv5xeM9jkRkY=; fh=WK8cdXTzEnVkaljbNhmfybEHpKu6pNsSTA1dle9+egk=; b=jah7IHUMe9WHZ+BLdxGu7kakkNZ/IYDWi8IcVNhKK11NwEGls5xjQMZtCscMGyIDHq ug/U1fLukNsLC6inYPwI+uVxuy6RqdBEgzAZmX1B+3xKrTAb4IKJBBE6T++en6LBfeJP bKVeGN4KzklrDdBOI6YHLYw73ehWhsXIe/JDx3OebQWvN4ngY+Usa3gxlboswgodnhEz b9hvM2eo5uEfhBz/CfolaeVgCjH30kyM2wyw+qQkxeaE4MOeyccUb27rmMz/uZa/Y/4I ktPTq0Aa2M8DapQmcNnaL6zvhLmTcCnHfvrdygjhNmx0SDq8BuC3IPyL2De9kdVvvl1G LKAg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=g1DKFIhj; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-191623-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191623-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a630d02e919si122797866b.878.2024.05.27.18.45.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 18:45:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191623-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=g1DKFIhj; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-191623-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191623-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 97A581F22704 for ; Tue, 28 May 2024 01:45:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F4A8BE5D; Tue, 28 May 2024 01:45:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g1DKFIhj" Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 557E03D60; Tue, 28 May 2024 01:45:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716860716; cv=none; b=in0CKILietXkGFHUUreG9rdd3B0S+hUrjnbGi83piV1BjcBoA1Oq036i6HCzYoQ+cebrW+l5BZJCZEfrk2XRWAVgBuxf3ZZN8VCUdb3vCkfkPm1IT3eeKY40ki6+U7W87ssrxYXTVf3LTMp/O0vDigfaVdWWAJOsgT//n7/bI78= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716860716; c=relaxed/simple; bh=bCKDcQ86F3DZ6K1S7gKsoFLSTbjjXxjIz9TmVB+IQSA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=sdON4r1bH0uP6gkxUdPne/FVsnxjCMWIW1cBqsJxMhYLjfRrkO+0pebKJrrn/8RQgZ7ZVxqY9xThvTomd1q8uN7FzaDS+ZLNthyQh6tdQSbnMG0ruABvc8az/DBAJPeQiHKJqwhBsIXjgQGInT0104BLPin3McPIom0P7/xcfb0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=g1DKFIhj; arc=none smtp.client-ip=209.85.216.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2bdf3f4d5ffso210917a91.3; Mon, 27 May 2024 18:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716860715; x=1717465515; 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=4WZuzBn8quBWeOsvE1Lk2Z6AJ5TaLj0Zv5xeM9jkRkY=; b=g1DKFIhj5R2BmvlGneb7D5VUuNLPXXvXfZtwxIyiR+AKrlkfeK4eRjcjgxJF69YIAI +O+b5ApfRd2FCwr2zyHHtt5uPiquqF+XNRHHhdLKEaaF8GPDihyKwkm4/myD077/fpS3 XgkFioeQVgrIK5lgdTzoGpq1gNmESQHCOVsEBjK2mNBM5CIaFiN6cbaDf2yy1Ik3j8Bo wtaBv8yHglkd/RrPfY33j+xneG8nz/NaVKo0D5D2lIQcVm7gsdm/iFLIuAJ06FuU9LIW DtBYIruU6hXxOYuGTz9ncgm26fgaGnOdlH/kjn4tEBAwoBaw1KwwnU9o7Uft7x2EBLVF RoXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716860715; x=1717465515; 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=4WZuzBn8quBWeOsvE1Lk2Z6AJ5TaLj0Zv5xeM9jkRkY=; b=sOUvCodQ40TdhrbaIAp7d3fAw7XFGBptreV6Mi/Dt+KgXZo1wAEw9IHAMCbX4k4Ows YWPc8Le2CDrUx+QU8gv6uaHE24HcVxr1LVlvpVS2OBYPQZwQr2LV29SkLJFDkD3E73Ej /zju65MSiUXIvwMtX4eMcBq6rFLdPNlESU6Y4oJ8khmAuWdgRbnVBtiGBLExR6O37Ztb 2GFOpfNt0MInk59jOxS0sz+4pd0b05j5RWILRBb3jvsd2w7v7xdjIP/Af8+dIoPvW5Kc A/h8MFqgkcxc8X9VIgfQQo2iFZhHtQvvunK62WRODFy/qms8GuhMudJV81KxiLn42tVI 7BJQ== X-Forwarded-Encrypted: i=1; AJvYcCWkQ8cq/G5nGBBduqRvHBi4XEV9Z7b5EVNWhoi5VkuJkA4sDX2+BXex4vrRRnV1LtISLAPzP1aRdV0YOGnCRwD91tnBOAySXSr8y+bMNjBSBC5RNDdumpjCYMsdYbThrl5E X-Gm-Message-State: AOJu0Yz0F7fIUEQUBWNS4sMpIckc66Hgpp+sED5kA00qNp9SONjnTn13 KdI/cs9c/CSjT9NiQn9AMM8S4fRULPHzUWpgDYrUU9c/HJdMG8vYHZvPvOV+pCol574yuHF/vyE jNUJ4id7VS7aqLvcji1/jW+w+e8rqqzmXmBufKQ99 X-Received: by 2002:a17:90a:bc85:b0:2b2:6ede:5ce0 with SMTP id 98e67ed59e1d1-2bf5f70f2d7mr9067767a91.39.1716860714620; Mon, 27 May 2024 18:45:14 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240527012018.351223-1-zhouzhouyi@gmail.com> In-Reply-To: From: Zhouyi Zhou Date: Tue, 28 May 2024 09:45:03 +0800 Message-ID: Subject: Re: [PATCH] drm/radeon/r100: enhance error handling in r100_cp_init_microcode To: =?UTF-8?Q?Christian_K=C3=B6nig?= Cc: alexander.deucher@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, chris@chrisdown.name, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, rcu@vger.kernel.org, lance@osuosl.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Fix some error in my previous email On Tue, May 28, 2024 at 9:36=E2=80=AFAM Zhouyi Zhou = wrote: > > Thanks for reviewing the patch > > On Mon, May 27, 2024 at 3:58=E2=80=AFPM Christian K=C3=B6nig > wrote: > > > > Am 27.05.24 um 03:20 schrieb Zhouyi Zhou: > > > In r100_cp_init_microcode, if rdev->family don't match any of > > > if statement, fw_name will be NULL, which will cause > > > gcc (11.4.0 powerpc64le-linux-gnu) complain: > > > > > > In function =E2=80=98r100_cp_init_microcode=E2=80=99, > > > inlined from =E2=80=98r100_cp_init=E2=80=99 at drivers/gpu/drm/r= adeon/r100.c:1136:7: > > > ./include/linux/printk.h:457:44: warning: =E2=80=98%s=E2=80=99 direct= ive argument is null [-Wformat-overflow=3D] > > > 457 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##_= _VA_ARGS__) > > > > > > Above warning is emitted during the rcutorture test in > > > in PPC VM of Opensource Lab of Oregon State Univerisity. > > > > > > Enhance error handling in r100_cp_init_microcode, let r100_cp_init_mi= crocode > > > return with -EINVAL when none of chip families is matched. > > > > > > Signed-off-by: Zhouyi Zhou > > > > > --- > > > drivers/gpu/drm/radeon/r100.c | 7 +++++++ > > > 1 file changed, 7 insertions(+) > > > > > > diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r= 100.c > > > index 0b1e19345f43..4f8a1bdd9365 100644 > > > --- a/drivers/gpu/drm/radeon/r100.c > > > +++ b/drivers/gpu/drm/radeon/r100.c > > > @@ -1055,6 +1055,11 @@ static int r100_cp_init_microcode(struct radeo= n_device *rdev) > > > (rdev->family =3D=3D CHIP_RV570)) { > > > DRM_INFO("Loading R500 Microcode\n"); > > > fw_name =3D FIRMWARE_R520; > > > + } else { > > > + pr_err("radeon_cp: Failed to load firmware \"%d\"\n", > > > + rdev->family); > > > + err =3D -EINVAL; > > > + goto out; > > > } > > > > > > err =3D request_firmware(&rdev->me_fw, fw_name, rdev->dev); > > > @@ -1067,6 +1072,8 @@ static int r100_cp_init_microcode(struct radeon= _device *rdev) > > > release_firmware(rdev->me_fw); > > > rdev->me_fw =3D NULL; > > > } > > > + > > > +out: > > > > That looks superfluous, just return -EINVAL directly in the else case a= bove. > > > > Apart from that this is for ~15year old hardware. I'm a bit reluctant > > adding code for something that old even when this change here looks > > harmless. > > > > Is there a plan to complain about that in an automated checker? If yes > > then the change is probably justified, if no then I would rather not do= it. > The warning is emitted when I invoke following commands in ubuntu > 22.04 (ppc64le) > linux$make allmodconfig > linux$make drivers/gpu/drm/radeon/r100.o (a quick alternative to 'make -j= $nproc) the command should be make -j(number of CPUs in my machine), please don't i= nvoke 'make -j$nproc' which is my mistake, this command is very dangerous, and make my machine hung ;-( Sorry for the trouble Thanks again Zhouyi > But everything is OK when I invoke following commands in ubuntu 22.04 (pp= c64le) > linux$make allmodconfig LLVM=3D1 > linux$make drivers/gpu/drm/radeon/r100.o LLVM=3D1 > > And I can't reproduce the warning in the x86 environment, so I guess > this phenomenon > is toolchain related ;-) > > Thanks again > Regards, > Zhouyi > > > > Regards, > > Christian. > > > > > return err; > > > } > > > > >