From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::142; helo=mail-it1-x142.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it1-x142.google.com (mail-it1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (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 7EA362119EF2A for ; Tue, 18 Dec 2018 08:29:41 -0800 (PST) Received: by mail-it1-x142.google.com with SMTP id i145so5040549ita.4 for ; Tue, 18 Dec 2018 08:29:41 -0800 (PST) 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=YYGroiA8CHDPb/N8Qrhf296hO6Dns3ILozazvB/8dZo=; b=IRWQs5bfPxe0F6xqGE7FDYuT4UFENIqTV89j7FFpVGpOIPVOBb2WCAndcU8hN+LuMs CiVB7PqNdSGrb3ka8QNPk6c6sqUqN9XYKjnjnlEFzJM78VZNu8MxqD9NtAiz/vI4onIz urbI9LmRPk2uBgsA9iOARkhXL3OZf0z0u1eY8= 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=YYGroiA8CHDPb/N8Qrhf296hO6Dns3ILozazvB/8dZo=; b=gfw++VeRzWL/a2idsYNr+jdEJ75nIIPGi8YlFEE6iodL8ccuHFaTde95MNiNBZBfC4 hWHCsLBi50D01+RTTMxLqmMjUaAs3FA4NpaE/9v4Cl60rz3qfxL8qu4CDlKLkmwKspO5 YUW7PqAxLq6OZN9fSvodfrTE/3nbXzAayR3cbiBuJvf5PDeFNJIkvRL1bkgvr0UM8cTf cKOSXxsJpX8hSeJD6xtvPmtuyCdTx+OGY4q8mo/Hhy7DUg1rtvIHClYnAXyhu9GL0bTS V0JC8DhCxTVEPdN7NiPzMFg6k2XRgH0mWGS388zeOIPGBHlmrvy/TOgoVDnbxEBtHzFF sGqQ== X-Gm-Message-State: AA+aEWYEm5lpANAVgpcwGd27PMbfy4R6pMmlKao7OcM5Ca0zONDYw+t0 fo0hAi6RIAp6eT/kVYslfgtSiC+rQT+F5k0j5VTNew== X-Google-Smtp-Source: AFSGD/U6CMBgwgSUTYgsq0D9LlwBdWfNo0B6Z/2jlmsZk+U/CcjvUED2LT8/8UfgId3ISr2vLBBADRjjZeBS+XydyIE= X-Received: by 2002:a24:edc4:: with SMTP id r187mr3191457ith.158.1545150580691; Tue, 18 Dec 2018 08:29:40 -0800 (PST) MIME-Version: 1.0 References: <20181218131015.20062-1-ard.biesheuvel@linaro.org> <20181218131015.20062-3-ard.biesheuvel@linaro.org> <20181218133955.avtfxupuaoj2a6iv@bivouac.eciton.net> In-Reply-To: <20181218133955.avtfxupuaoj2a6iv@bivouac.eciton.net> From: Ard Biesheuvel Date: Tue, 18 Dec 2018 17:29:29 +0100 Message-ID: To: Leif Lindholm Cc: "edk2-devel@lists.01.org" , Sami Mujawar , Thomas Panakamattam Abraham , Meenakshi Aggarwal , Udit Kumar , Matteo Carlini , Nariman Poushin Subject: Re: [PATCH 2/4] ArmPlatformPkg/SP805WatchdogDxe: switch to interrupt mode X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2018 16:29:41 -0000 Content-Type: text/plain; charset="UTF-8" On Tue, 18 Dec 2018 at 14:39, Leif Lindholm wrote: > > On Tue, Dec 18, 2018 at 02:10:12PM +0100, Ard Biesheuvel wrote: > > The SP805 watchdog driver doesn't implement the PI watchdog protocol > > fully, but always simply resets the system if the watchdog time runs > > out. > > > > However, the hardware does support the intended usage model, as long > > as the SP805 is wired up correctly. So let's implement interrupt based > > mode involving a handler that is registered by the DXE core and invoked > > when the watchdog runs out. In the interrupt handler, we invoke the > > notify function if one was registered, or call the ResetSystem() > > runtime service otherwise (as per the UEFI spec) > > The only question mark from my end is - what happens when the > interrupt isn't wired up correctly? Would it be worth to bail out and > refuse to register the driver if PcdSP805WatchdogInterrupt is set to > 0? > > Thomas? > I have left the code in place that enables the hard reset, but the timeout is double the programmed value (since the countdown timer is restarted on an interrupt, and the hard reset is generated when it reaches zero the second time) This should cover both the miswired interrupt scenario, and the scenario where ResetSystem() (or the handler) gets stuck and never returns.