From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 7A14A1E376E for ; Mon, 20 Jan 2025 14:42:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737384165; cv=none; b=XXLgD0+wjT8VixQxeFET8+6Yw4GfOXw50iFOWaSRVjXZN/qluPEeAO07j7drufNyd3cr0vkohKre3YOY7AhXq+gsYZ4fElV3A9H79d8lLtQx5UxtXwaxLZYfU6Ysevq4VmP9oiesmY5J+4iormF/jJrHva1Ec7tsrmHP1TD5HxY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737384165; c=relaxed/simple; bh=yhNMmRHwaPtY56JPwVuoTf7guzyjw2K9tdr9pmIASpE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WnEEerzszA0KKfu+/XUpS/3U1rP+c3x4pwlG3KIAM3BD39z/yeUmT936uQjhFNQDGoEjpliszzDzbvtLKDXciITHtoCQuPB/mp3mgoNFEFzZO5Hvo6bXYEws+bCTMGzsJ1U7yuu33K5F89eU+qukuV2rK6zBE1PnOhP95NYLLY4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org; spf=fail smtp.mailfrom=beagleboard.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b=ZxpxfFnt; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b="ZxpxfFnt" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2161eb94cceso55410855ad.2 for ; Mon, 20 Jan 2025 06:42:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1737384163; x=1737988963; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=1DL/LfAjdhqLi0qoG6XycGJsPsDTNLI3ZmKQkMuPUZk=; b=ZxpxfFntN4LC08BemqbP/j+Iwo/+fb/J69hz/b7yM91h78eKVGqrZHI7BUyvxUkm7G UMwqHD2ZVAH1+B93tlwmasD/Vv7eQCfvA+UE7d1Ft8bm9waKlLIP1sWRYY+xlJYSGO2v 0O5nqzDqOvpyP2xUiIJrvFZfy7ldbqf7F0G3JR2XXf5PzkF0TG2sZKvd4KvMBKgyjZ6j r5tMPCxFoup3siEnwy9oGkx8anTRAgKDATOcIYvGMT/YYTt140v7Z1zAMPbzrKhn5S9/ bYg2HTGx6DDcvUwzGfjKD3oT6P7tsWLva4DpxCJpTTKjK79aqlH/9gFRpY9wE8CJLJ9h G/TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737384163; x=1737988963; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1DL/LfAjdhqLi0qoG6XycGJsPsDTNLI3ZmKQkMuPUZk=; b=szxjRsXypp9Q3VcuTHDakmcQW3bctr2U34lRyJen8qrb+7jyG0NzKVzJkuzBTPm1Jg IFk5Hr0GHUGYc+TPs6oqo7HCv41qLa9523umX95cOwnxG4jSUfxqEZq40WCWlZS+Hoxe K+XaegagX0YS601TPvCB7ecg6MPwVZXOj/0yc3SozYqR1R6a04QvEx8OAY0KMXvADikD cF8gbtW14ZMQ9w3lp/IzpnIDhTIJ8uzlqlqTTyKTAUbqOYwGo0e33kTVLqoR6Q9RnZKF Voh8zeReeaYj1Lp3U7JhhDHN4cYchXdW+HyPYjhuhhO/o8+GLsTcnG9q5YS301zw0tMz cf1A== X-Forwarded-Encrypted: i=1; AJvYcCXEXE2Zs8uSidqV4Xxj42g9Oop+ZU/OkTofYQKHK5zdQGptrTY8niJPgS6lNilmB96DX2/H1U3AWqFC3xI=@vger.kernel.org X-Gm-Message-State: AOJu0YwWKNj0cVgfjAImrmTuA1tVmuJNP71VFe41Iy4vD/QsXTY6JSbG VGjiSRACibN4Qqbyror37oZDqE8N2b5Pyse6odupcVCDGut2cvpY/RcxDOFf0Q== X-Gm-Gg: ASbGnct0yeG466+uuw7qXpbQt3fUgNmvtmZ3dQ+cMvpWbE4jCWjGOetq2S5xVddULpz t/XeFrv2LMj7703Px3cMBbo0oJWa2VLzJ5t7dHQUVPI2KwDptmJJUxWZ5DmX28KryuS7nJO7/jp GU/MIs2Ry9ZPNHlCHsNV7s0Q8lJ1zM1U5ljZioHhdMcV56HrlF/33KBXzaoxwGjoyY+nznt6Wru 1UUs8unaoSL/H5SXvgO80Xg2DJmQLIQ6D+CTPqTBPHXGjXJzua3AjHiTwXwdx54MfXGNE2bP5Uu mQ== X-Google-Smtp-Source: AGHT+IEBHFjylTbf1r6JuOv5CVwZB6FLvp8bmRQqpkxykKHF5cDxQnDncmyoZxk8itl5q9xqoe0a/Q== X-Received: by 2002:a05:6a20:3d89:b0:1db:d738:f2ff with SMTP id adf61e73a8af0-1eb2144d6e7mr23720046637.2.1737384162776; Mon, 20 Jan 2025 06:42:42 -0800 (PST) Received: from [172.16.119.211] ([103.15.228.94]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72dab84998asm7265600b3a.83.2025.01.20.06.42.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jan 2025 06:42:42 -0800 (PST) Message-ID: <3b92676e-b970-4e0c-aeaa-b28faf5ff39c@beagleboard.org> Date: Mon, 20 Jan 2025 20:12:36 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] greybus: gb-beagleplay: Add error handling for gb_greybus_init To: Wentao Liang , gregkh@linuxfoundation.org Cc: elder@kernel.org, johan@kernel.org, lee@kernel.org, francesco.dolcini@toradex.com, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org References: <20250120140547.1460-1-vulab@iscas.ac.cn> Content-Language: en-US From: Ayush Singh In-Reply-To: <20250120140547.1460-1-vulab@iscas.ac.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/20/25 19:35, Wentao Liang wrote: > Add error handling for the gb_greybus_init(bg) function call > during the firmware reflash process to maintain consistency > in error handling throughout the codebase. If initialization > fails, log an error and return FW_UPLOAD_ERR_RW_ERROR. > > Fixes: 0cf7befa3ea2 ("greybus: gb-beagleplay: Add firmware upload API") > Signed-off-by: Wentao Liang > --- > drivers/greybus/gb-beagleplay.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/greybus/gb-beagleplay.c b/drivers/greybus/gb-beagleplay.c > index 473ac3f2d382..da31f1131afc 100644 > --- a/drivers/greybus/gb-beagleplay.c > +++ b/drivers/greybus/gb-beagleplay.c > @@ -912,7 +912,9 @@ static enum fw_upload_err cc1352_prepare(struct fw_upload *fw_upload, > cc1352_bootloader_reset(bg); > WRITE_ONCE(bg->flashing_mode, false); > msleep(200); > - gb_greybus_init(bg); > + if (gb_greybus_init(bg) < 0) > + return dev_err_probe(&bg->sd->dev, FW_UPLOAD_ERR_RW_ERROR, > + "Failed to initialize greybus"); > gb_beagleplay_start_svc(bg); > return FW_UPLOAD_ERR_FW_INVALID; > } Looks good to me. Reviewed-by: Ayush Singh