Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3301098rwi; Fri, 28 Oct 2022 19:40:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7pD1WdxVDJj/Gzz53eGGbOWD6vWBzAt/iJVBAGwnA+wO4ZVFW3SGBgxcTLlMnCL6XkSDxa X-Received: by 2002:a63:9:0:b0:461:f0b6:759a with SMTP id 9-20020a630009000000b00461f0b6759amr2287800pga.153.1667011205136; Fri, 28 Oct 2022 19:40:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667011205; cv=none; d=google.com; s=arc-20160816; b=II7iJRBsLNk3I49m2Mxt4/xLRWmLt6mCF8RLZQtclYinbOhZhAypHkD4jj2Ey5tww4 jxiI8T0ArezfB6tt0HyMtR4uj0cYbYLrjfjL8NEYSnnDgQNLmKvZmYGZXjvzsGD/irmz r4oJAYF/Llx06zibXeA9U4eJP3sq8i+n3DZ1zpqBN7MRoE8su+ddUtZEurWMYhouBeKN rCenE1NKe4bFWz+O3rV0XbSCqR66QKvePyaqrouqs/x/zgRFVtOD7AwlluB+pGg554lr YhmbCShR26h/6//oT53EyLfAF6xQAX1OiEUa7H8lFc6ThWzDscpBrLXcCuJgodCo3RLZ VApw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=h3PXA8WoOqJtml0iT1uGTlbTfROvdqqMfllOBdYkx2Q=; b=EAcTSxlVwX+24f3dmjj3Tb3ie5O1wgfdm6Md9q0rTN+f0x+cfQfb5/Nvp07fLVj4t9 FQ6OT3fZH3hFsCyKQZ5Avh0GU8hI9MbZS7lYplk2pg7Lhnp1tpsZxqdvVWokQ8pf2lgS Sx4JU+Hv6QLv0S769vY5N/M6Q8XfV8nl4hEg4rrQeGavr8ID4RxFjgB843Xt9viAWNwv pGg19pmtorToqfa1kPKNBFv18q03BzwQvG4Hx0uFmdZK2Zz4X44RHonchqFn646JEd1T SDkZcmEoDlIfBvzkrMht7dTXOB3YKtbuTaMvd7+4IOuBBzqqLsW1mJR9sB9Rm1eVV/l9 6v+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=awzLlZFL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q66-20020a634345000000b004597ddac1fasi461911pga.533.2022.10.28.19.39.48; Fri, 28 Oct 2022 19:40:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=awzLlZFL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229544AbiJ2BvB (ORCPT + 99 others); Fri, 28 Oct 2022 21:51:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbiJ2Bu7 (ORCPT ); Fri, 28 Oct 2022 21:50:59 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D96615A326 for ; Fri, 28 Oct 2022 18:50:58 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id c2so6282889plz.11 for ; Fri, 28 Oct 2022 18:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=h3PXA8WoOqJtml0iT1uGTlbTfROvdqqMfllOBdYkx2Q=; b=awzLlZFLVHNDXNPpXryI3mhfCeEtMv9n9YbmejLI6z5ubPPBOoUyQjDs4m59Db1BCx V2T3OEUC9/Da8SmDIj1XzAOTLlL0BGTuEGFqEpR/RYMplpUZYo+vg5GuxbjCXdkGYT8m 1UQDY8BmvQpBexYvVRZpsIB6ICCdGHebIt7FE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=h3PXA8WoOqJtml0iT1uGTlbTfROvdqqMfllOBdYkx2Q=; b=klg9Z+JweZwPrDB9ml6K0MQod5O+VkrK2lj4AvWhsIEHibte3eS08tZPNzQNFbkNOh tCRy02I0ST3obPQ3a4Diy/iU2PKGZv0/9FS9lJaA2v7xOrRXA6exbCukmjHt2WX8GK+V xAZKtOzgB5p4NoQZj+oBz690gUyNSn/O3UWQwiNrNpmcY4GVMUFC8INvxzP658PS3/Fs Xnt/RxDNh/c3UUzyvu5ZiyzAhM/7G90CpK6Wc05eOgqqzMIKMBH6hzm0067/LSR/PBul tgEQt2dvVLHtS5K9iqC7nPQ4nsYCEqEyubzUP0d4KeYR9xls1KP5zHrd5JnJ5CpQbrBk Rvig== X-Gm-Message-State: ACrzQf31b3ZnFS46sYammxpbwhezCbrie85CqqkbiR8OYjwJp3MFOSrZ xy8xeunUDVjBI7FJ7c77alZ0vg== X-Received: by 2002:a17:903:2645:b0:185:480a:85d2 with SMTP id je5-20020a170903264500b00185480a85d2mr2049552plb.144.1667008257609; Fri, 28 Oct 2022 18:50:57 -0700 (PDT) Received: from google.com ([2620:15c:9d:2:65f9:c180:249c:190f]) by smtp.gmail.com with ESMTPSA id q8-20020a17090a304800b00212daa68b7csm84981pjl.44.2022.10.28.18.50.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 18:50:57 -0700 (PDT) Date: Fri, 28 Oct 2022 18:50:54 -0700 From: Brian Norris To: Guenter Roeck Cc: Alessandro Zummo , Alexandre Belloni , Benson Leung , linux-rtc@vger.kernel.org, chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rtc: cros-ec: Limit RTC alarm range if needed Message-ID: References: <20221029005400.2712577-1-linux@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221029005400.2712577-1-linux@roeck-us.net> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 28, 2022 at 05:54:00PM -0700, Guenter Roeck wrote: > RTC chips on some older Chromebooks can only handle alarms less than 24 > hours in the future. Attempts to set an alarm beyond that range fails. > The most severe impact of this limitation is that suspend requests fail > if alarmtimer_suspend() tries to set an alarm for more than 24 hours > in the future. > > Try to set the real-time alarm to just below 24 hours if setting it to > a larger value fails to work around the problem. While not perfect, it > is better than just failing the call. A similar workaround is already > implemented in the rtc-tps6586x driver. > > Drop error messages in cros_ec_rtc_get() and cros_ec_rtc_set() since the > calling code also logs an error and to avoid spurious error messages if > setting the alarm ultimately succeeds. > > Cc: Brian Norris > Signed-off-by: Guenter Roeck Reviewed-by: Brian Norris Tested-by: Brian Norris