From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4003:c06::243; helo=mail-oi0-x243.google.com; envelope-from=masahisa.kojima@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-oi0-x243.google.com (mail-oi0-x243.google.com [IPv6:2607:f8b0:4003:c06::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6C5F22111003F for ; Mon, 18 Jun 2018 18:09:45 -0700 (PDT) Received: by mail-oi0-x243.google.com with SMTP id c128-v6so16618677oig.11 for ; Mon, 18 Jun 2018 18:09:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hc6GgVTrdeXKGogw9NjwLEQ/n+fT8fmH9cTdTrFNSsY=; b=iHxfU9/zCnC2WUQ3/vmjm/NF9j6Ttn1jvrdEBVHzJkfKWtFL7HSYAl8anETVl6EslY /KvDCdKZ5gW/RA9GT7E9ezOssQ06KVmERpQEc914fGyJ3KL0eByEyjIKlNnXrFc67sPj P9JEYz0mSnOmYjxxC1QVLJTODm5aotG0M6YVI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hc6GgVTrdeXKGogw9NjwLEQ/n+fT8fmH9cTdTrFNSsY=; b=tsOzeRidhfa1/uQLlmuGj/UVgjyz/QmqykxCmFijQh0bvrohkx+opwc88rPcCwyRVw xwfeGDSE6mtjU5rkkIiRoYzLj5FXvCEuMQA8FoY59woCBLX4MKqM+7cNg2k5uovJpDtB cx1RFTQFxZAPH4KTTUeq7ranjpKiV1mF1Dn1QGymUEqdDVqX1z0oDH/H4JeAUjpU23Kr ZNQKtpt8qY5GeZYOtsH5hstro1v4XA5itG2w6pMAt7jZXisFXZ2vAkzwSxwiVrsuwvyl lWIlMmGX/6d6s3gBkyzPcBZD5LdYecnQW5UffKhSmovnzwu7DTBKYn/C+a+pWNf5h85i tc/g== X-Gm-Message-State: APt69E0w8AnjtfJusaQs+9+NFmf5BPlWpOGJvCBQvhk6l04bwYQwT2r4 lu6LTWb3k6VhzAozeNN2DUqOvAn54D4dTwdq+VYeWw== X-Google-Smtp-Source: ADUXVKJJofQbLDWgnoHgBQF1KrEPhLfk5TzmXVXc+exGdXzYBf89uM9R5VdVzU6Epoir8R6OzpVxY0BFeV148fI5eJ0= X-Received: by 2002:aca:aa54:: with SMTP id t81-v6mr8566370oie.30.1529370584362; Mon, 18 Jun 2018 18:09:44 -0700 (PDT) MIME-Version: 1.0 References: <20180618123155.2141-1-masahisa.kojima@linaro.org> In-Reply-To: From: Masahisa Kojima Date: Tue, 19 Jun 2018 10:09:33 +0900 Message-ID: To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, Leif Lindholm , Yoshitoyo Osaki Subject: Re: [PATCH] Silicon/NXP/Pcf8563RealTimeClockLib: add rtc device initialization X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2018 01:09:45 -0000 Content-Type: text/plain; charset="UTF-8" Hi Ard, This issue can be divided into following two issues. 1) Assertion occurs during boot time in DEBUG build, it depends on the uninitialized RTC device state(~70%) 2) SetTime() fails if GetTime() fails For issue 1), we should update pcf8563 driver, ignore retrieved data and return error when the VL bit is 1. For issue 2), it is better to update shell command as your comment. But situation is a little complicated. UEFI shell command can only set DATE or TIME separately. To set DATE, current procedure is like following. 1) GetTime(retrieve both DATE and TIME) 2) update only DATE 3) Write back to RTC both DATE and TIME So, current uefi shell can not set DATE/TIME without GetTime(). One possible solution is adding new command to set both DATE and TIME. But it will change user experience and I'm not sure it is acceptable. What do you think? Regards, Masahisa On Tue, 19 Jun 2018 at 08:56, Masahisa Kojima wrote: > > On Tue, 19 Jun 2018 at 00:51, Ard Biesheuvel wrote: > > > > On 18 June 2018 at 16:29, Masahisa Kojima wrote: > > > Hi Ard, > > > > > > Thank you for comment. > > > > > >> Wouldn't it be better to return EFI_DEVICE_ERROR in this case? > > > > > > It is first option I come up with to fix this issue. > > > But edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/TimeDate.c::CheckAndSetTime() > > > performs GetTime()->update with user specified time->SetTime(), > > > If GetTime() failes, SetTime() never called and user can not set time. > > > # It really depends on the RTC device, we failed to set time in 70% devices. > > > > > > Another place to perform this dummy time/date setting is inside of > > > LibRtcInitialize(). > > > Current error occurs in setting time, and I prefer to add this process > > > in GetTime(). > > > > > > > I think we should fix the shell command instead. Setting the time > > should be possible even if getting the time file, precisely for > > situations like this one. > > OK, I agree with you.