Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2418190iof; Wed, 8 Jun 2022 04:42:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5k9x8XM1G44ZSJBDFdrolOgia6VTPWahv3+LLZiwGL5v7ldf18D2oRemeqKhz3iPJZ5uz X-Received: by 2002:a63:4d08:0:b0:3fd:8436:edb5 with SMTP id a8-20020a634d08000000b003fd8436edb5mr16747668pgb.427.1654688528416; Wed, 08 Jun 2022 04:42:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654688528; cv=none; d=google.com; s=arc-20160816; b=eVFxZ4h36KgBMUN6ba//oSom4pOta2pW0Kdq0AxEjGr0Xsm/W4dDh9vKwPcVW7wcvf +GDUexMgdkRxhFHGPVHEAQp//gD9I5W3S6m3PO2X0vyRNe1tXrih3fJILyucDV8vTT4b B3eUAGykYXlHXZw66orhjOzS4p66FVZ0xTR+DwR9Bx2hlGqLuf8hS9KRSQTKWzTl1qXE YVzPXIhD5tG5FUp4FPF25EO+BZwqvBbA8JEHXfz6L75WzwBPOurHxqHBFbDkBfamYKt7 7xW1BnHx/MI7pweT2Jg/eL2e/OrqRjM3D9X10UMPuOQH5DZR5N0mlZY1syQ2K7GGszu5 Zl4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=skCklXzRiU5LuHic4h+k55hSDxmfPLpsgI6iQ6tL4lU=; b=IIMYVC40zD27L9CzALlXJWGAqeZ6/HFoJvKlwBnLYhr62DeVPySu7SoKCw5C5Dx5xA Ei7sf/Qy0HKJGygH4kWhJVnnAUJf/cMA4ftFBiVmjfR/Bs1iSWLOot9WVtnUhCXNvjhR psy8SHodxX2JLtf+SglCkdXFQ9ECwXrgVfV6oveUz+E+y/nggU3INePVTRa/fQkQhGt3 lSD3daKbHiO+mrX22HAUOcCK2k90VXbJWlxAU6dDi/Y9C337r3/oh6LnlWBKGxBzgH3U 7F7WYx/aGq5n0T2H/YacVJazXyP+UQZE1AqgdkH3SBmKczfeIfLloeuMX4zopjBYfFci jbUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CDOBevCg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k12-20020a6568cc000000b003fa9370c63asi26610813pgt.434.2022.06.08.04.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 04:42:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CDOBevCg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0465E237958; Wed, 8 Jun 2022 04:10:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237959AbiFHLJv (ORCPT + 99 others); Wed, 8 Jun 2022 07:09:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237875AbiFHLIQ (ORCPT ); Wed, 8 Jun 2022 07:08:16 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48CA520C25C for ; Wed, 8 Jun 2022 04:08:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 70240CE1D6F for ; Wed, 8 Jun 2022 11:08:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAC70C34116; Wed, 8 Jun 2022 11:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654686486; bh=ih26mD8gWYA0ngbk8TzR3WX1e7dsZX0JE4dyVo2c0rs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CDOBevCgDTOEGjAuYjLjPYoJn20fwiamYzo7covq5q2idZLhzzmfhXSeCXMo7XvHW U/W33TUIuDdu0JaB4tlNjq/fs9yQzos7xLoB2zoZaqRPYfejUFy1HxWzy09NJEZdv6 6n9pbWtpWqbpdEXtlMni6PeThUi7UMNSZm02BgJm1OWmHpJmHtfQWnkLSr9CxgT4sh k8OZVqZQthF8dpRLZXNN97PVVWf3nwrpUnQpmn+NNZZz/9UlNza9cfJ5Nq4UD0F14z 5nmwr+YFC1WkjvTXQ6IMrVMAYuhOwyfJZrGCK8rnXwpVKWeBUq2waHB9ii+r171zoF 1PFVsPZ7twH8g== From: Tzung-Bi Shih To: bleung@chromium.org, groeck@chromium.org Cc: chrome-platform@lists.linux.dev, tzungbi@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 15/23] platform/chrome: cros_ec_proto: don't show MKBP version if unsupported Date: Wed, 8 Jun 2022 11:07:26 +0000 Message-Id: <20220608110734.2928245-16-tzungbi@kernel.org> X-Mailer: git-send-email 2.36.1.255.ge46751e96f-goog In-Reply-To: <20220608110734.2928245-1-tzungbi@kernel.org> References: <20220608110734.2928245-1-tzungbi@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 It wrongly showed the following message when it doesn't support MKBP: "MKBP support version 4294967295". Fix it. Reviewed-by: Guenter Roeck Signed-off-by: Tzung-Bi Shih --- Changes from v2: - Add R-b tag. drivers/platform/chrome/cros_ec_proto.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/platform/chrome/cros_ec_proto.c b/drivers/platform/chrome/cros_ec_proto.c index 8a53e989c7e2..efbabdcb31ae 100644 --- a/drivers/platform/chrome/cros_ec_proto.c +++ b/drivers/platform/chrome/cros_ec_proto.c @@ -508,13 +508,13 @@ int cros_ec_query_all(struct cros_ec_device *ec_dev) ret = cros_ec_get_host_command_version_mask(ec_dev, EC_CMD_GET_NEXT_EVENT, &ver_mask); - if (ret < 0 || ver_mask == 0) + if (ret < 0 || ver_mask == 0) { ec_dev->mkbp_event_supported = 0; - else + } else { ec_dev->mkbp_event_supported = fls(ver_mask); - dev_dbg(ec_dev->dev, "MKBP support version %u\n", - ec_dev->mkbp_event_supported - 1); + dev_dbg(ec_dev->dev, "MKBP support version %u\n", ec_dev->mkbp_event_supported - 1); + } /* Probe if host sleep v1 is supported for S0ix failure detection. */ ret = cros_ec_get_host_command_version_mask(ec_dev, -- 2.36.1.255.ge46751e96f-goog