linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
To: Geoff Levand <geoff@infradead.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	 Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH 1/1] powerpc/ps3: Fix error return code in ps3_register_devices()
Date: Mon, 24 May 2021 09:40:17 +0800	[thread overview]
Message-ID: <4ba8b7d8-0bd1-a40c-51a9-9447956ca12c@huawei.com> (raw)
In-Reply-To: <71764790-4be0-d177-37fc-a2d91d47a0da@infradead.org>



On 2021/5/24 4:15, Geoff Levand wrote:
> Hi,
> 
> On 5/20/21 5:20 AM, Michael Ellerman wrote:
>> Zhen Lei <thunder.leizhen@huawei.com> writes:
>>> When call ps3_start_probe_thread() failed, further initialization should
>>> be stopped and the returned error code should be propagated.
> ...
>>> --- a/arch/powerpc/platforms/ps3/device-init.c
>>>  
>>>  	result = ps3_start_probe_thread(PS3_BUS_TYPE_STORAGE);
>>> +	if (result < 0)
>>> +		return result;
>>
>> If you bail out here you skip:
>>
>>>  	ps3_register_vuart_devices();
>>
>> Which I suspect means there will be no console output?
>>
>> Presumably the system won't boot if the probe thread fails, but it might
>> at least print an oops, whereas if we return we might get nothing at
>> all. Though I'm just guessing, I don't know this code that well.
> 
> That probe is for the storage devices (PS3_BUS_TYPE_STORAGE).
> 
> There are cases where the system is usable even if the storage
> devices are not available, for example, when using an NFS root
> filesystem.
> 
> ps3_start_probe_thread was made to be quite verbose on error
> to make up for it's return value not being checked.

So should we delete the local variable 'result' and ignore the return value?
- result = ps3_start_probe_thread(PS3_BUS_TYPE_STORAGE);
- (void)ps3_start_probe_thread(PS3_BUS_TYPE_STORAGE);

> 
>> Anyway please leave this code alone unless you're willing to test your
>> changes, or at least provide a more thorough justification for them.
> 
> Agreed, this change should not be merged.
> 
> -Geoff
> 
> .
> 


      reply	other threads:[~2021-05-24  1:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18  6:58 [PATCH 1/1] powerpc/ps3: Fix error return code in ps3_register_devices() Zhen Lei
2021-05-20 12:20 ` Michael Ellerman
2021-05-23 20:15   ` Geoff Levand
2021-05-24  1:40     ` Leizhen (ThunderTown) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ba8b7d8-0bd1-a40c-51a9-9447956ca12c@huawei.com \
    --to=thunder.leizhen@huawei.com \
    --cc=benh@kernel.crashing.org \
    --cc=geoff@infradead.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).