Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp423802rwr; Wed, 3 May 2023 00:08:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6FN+StqoIpuU3qy1WzGQUkHhsAaLdj60DAM9JwJyNfA/OnuFqH1qsL35C/KE1bgeawQGqB X-Received: by 2002:a05:6a00:140f:b0:641:39cb:1716 with SMTP id l15-20020a056a00140f00b0064139cb1716mr18848188pfu.20.1683097705830; Wed, 03 May 2023 00:08:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683097705; cv=none; d=google.com; s=arc-20160816; b=jFsdFFHel9LqeHJMn+8MG7HASg1DiEc2713pSSWHSu673qo87stbLdffNcqblX0qgs 0dsDbYccoUJk8zOWtbNCCwDVfVAbpvOjPoodND7nCDrDfUnEewxFGiqB+gIKUJQE4qZq oBeMnBwV/X3tBopo3Ub5Ub5rU58puIhDhkKJ9VmQh+4iyhogLHDACnXi4ygNp1GN7lWe h/JznxUsheulRkS7KLurGTJyaak8y9ULXheLCOdfXBZP4zhned/BhkNnzsyqmwozKOTp oQ30khrv03ie0xWAIJ7cZzA2j1EMnoELyCSBz4MHQfds3spx4bEv88iZ03y/qQVsTTy8 uM+w== 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 :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=7rMfnngKbDMIXDY+jqrxZcVKh/6Dg/PieczSvFQViZc=; b=jxm34LeacdoKD7HhUIofADZf1XQfym4hDx2vxVBUIyfQKlmotoYUpsJk82neINV3jf zaG1TZQ0P8hC4EMZnUqdTg0wI3ZiviWY8vegEqOqa/PEUlkFmgl5jFUHVUSAgt+1aqkk u4Q0wFw+BBD0Ac44hR+lMJEepRctZYN7aP4PqCBA1T3ai6ZOZvN+uHyCPnOwXnYKvv+c E1B7zVBZjFkDvtvh8WY8wqNLL7XQ/wMMgE6bsyIDn7gdHVobcnPc7AChfwiOwbnxBMUp bd3/BOvHccg1vjlmN+SMOf4ADmkmKsSkT/jsV7y1Jli6ZJptI3MVb0LZ1gGrz/KbCNlG ZsDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dPuuL+SC; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i22-20020aa796f6000000b0063d2b810fc6si32784275pfq.305.2023.05.03.00.08.11; Wed, 03 May 2023 00:08:25 -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=@redhat.com header.s=mimecast20190719 header.b=dPuuL+SC; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229638AbjECHGi (ORCPT + 99 others); Wed, 3 May 2023 03:06:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbjECHGg (ORCPT ); Wed, 3 May 2023 03:06:36 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C4DA269D for ; Wed, 3 May 2023 00:05:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683097551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7rMfnngKbDMIXDY+jqrxZcVKh/6Dg/PieczSvFQViZc=; b=dPuuL+SC/rNBXFKH/J0qrHF504mUhafKpdgfCvZT4ACUkMYu7mLxAM2PveyY1W48Ux8FvF JPArAi42jEIOW2NZsJnn5+x4BCd/Nafs7y5E+ww44tLbrmcvxfu592110H31DJGqUl7ziN 1bf7jfTBHqpMGuUW30sAkW5wUbhPdLw= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-653-mniL6UkhMSCAhZb4v_VLmw-1; Wed, 03 May 2023 03:05:49 -0400 X-MC-Unique: mniL6UkhMSCAhZb4v_VLmw-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3f3fe24912cso1158785e9.0 for ; Wed, 03 May 2023 00:05:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683097548; x=1685689548; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7rMfnngKbDMIXDY+jqrxZcVKh/6Dg/PieczSvFQViZc=; b=dOtruhwfu/59jhKt6MYc9BE8DSlOk2XN36tjBTzHwZda1K1ZlvxoQ1kKwaCDMdANbV +B6BLPW2O4skCEVsSrgEdqu0DmnxxK00Ofr3jC+98N0a8Aqiw2L3VPhaikD/L2b3WahR ps4yCKw9IkfNvGXLwjIqiXwbHzNllNS/7cCAdi33K9nrz+mwAe44P89gEuoV+GUaoSPI kwsEt20/aiaAJqRJfmi8d46MV25u1v7FNAS6Ul5eZ5ioaXExAx3353wMzmSSspsnWzPg 6qRE+dZ/VytgBBkOQMrlOeB7DCsefK5njCfU+VB+9VMBIS+Xv6BxNWlZ92zR+dYUc21e LdfQ== X-Gm-Message-State: AC+VfDxckXU2aZXONPvogUAuHnjq1RoTNfuIG09/wENOCn/+6rg+4M2s OA0ktv/3QkJhDvcbrhDJgP4lWCcVJvov4jwtCHaUnv2uEAwRKhLYeS6zHq9kfGzDEo49yJaFG4P XucSP1b8atFit+iTXSzr2nBU1 X-Received: by 2002:a7b:c3c8:0:b0:3f1:745a:784 with SMTP id t8-20020a7bc3c8000000b003f1745a0784mr14058986wmj.23.1683097548667; Wed, 03 May 2023 00:05:48 -0700 (PDT) X-Received: by 2002:a7b:c3c8:0:b0:3f1:745a:784 with SMTP id t8-20020a7bc3c8000000b003f1745a0784mr14058969wmj.23.1683097548261; Wed, 03 May 2023 00:05:48 -0700 (PDT) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id t15-20020a1c770f000000b003ee63fe5203sm908356wmi.36.2023.05.03.00.05.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 00:05:47 -0700 (PDT) From: Javier Martinez Canillas To: Geert Uytterhoeven , Dmitry Torokhov Cc: Brendan Higgins , David Gow , linux-input@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/2] Input: tests - miscellaneous fixes In-Reply-To: References: <878re6y9s8.fsf@minerva.mail-host-address-is-not-set> Date: Wed, 03 May 2023 09:05:46 +0200 Message-ID: <875y99yjw5.fsf@minerva.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 Geert Uytterhoeven writes: > Hi Dmitry, > > On Tue, May 2, 2023 at 7:05=E2=80=AFPM Dmitry Torokhov > wrote: >> On Tue, May 02, 2023 at 06:31:51PM +0200, Javier Martinez Canillas wrote: >> > Geert Uytterhoeven writes: >> > > On Tue, May 2, 2023 at 12:17=E2=80=AFPM Geert Uytterhoeven >> > > wrote: >> > >> This patch series fixes a crash in the new input selftest, and make= s the >> > >> test available when the KUnit framework is modular. >> > >> >> > >> Unfortunately test 3 still fails for me (tested on Koelsch (R-Car M= 2-W) >> > >> and ARAnyM): >> > >> >> > >> KTAP version 1 >> > >> # Subtest: input_core >> > >> 1..3 >> > >> input: Test input device as /devices/virtual/input/input1 >> > >> ok 1 input_test_polling >> > >> input: Test input device as /devices/virtual/input/input2 >> > >> ok 2 input_test_timestamp >> > >> input: Test input device as /devices/virtual/input/input3 >> > >> # input_test_match_device_id: ASSERTION FAILED at # drivers= /input/tests/input_test.c:99 >> > >> Expected input_match_device_id(input_dev, &id) to be true, = but is false >> > >> not ok 3 input_test_match_device_id >> > >> # input_core: pass:2 fail:1 skip:0 total:3 >> > >> # Totals: pass:2 fail:1 skip:0 total:3 >> > >> not ok 1 input_core >> > > >> > > Adding more debug code shows that it's the test on evbit [1] in >> > > input_match_device_id() that fails. >> > > Looking at your input_test_match_device_id(), I think you expect >> > > the checks for the various bitmaps to be gated by >> > > "if (id->flags & INPUT_DEVICE_ID_MATCH_EVBIT)", like is done for the >> > > other checks? >> > > >> > > [1] https://elixir.bootlin.com/linux/latest/source/drivers/input/inp= ut.c#L1021 >> > > >> > >> > That's correct. In input_test_init(), the input dev is marked as capab= le >> > of emitting EV_KEY BTN_LEFT and BTN_RIGHT. The goal of that test was to >> > check this. >> > >> > That is, check if matches by the input dev capabilities in which case = the >> > __set_bit(EV_KEY, ...) would make the match true and __set_bit(EV_ABS,= ..) >> > would make the condition false. >> > >> > But maybe I misunderstood how the input_set_capability() and __set_bit= () >> > functions work ? >> > >> > I'll take a look to this tomorrow, thanks a lot for your report! >> >> Unfortunately (?) INPUT_DEVICE_ID_MATCH_*BIT have never had any effect, >> the kernel always used bitmaps when matching (with the assumption that >> if one does not care about given bitmap they can simply pass empty one), >> so I think what we need to change is: >> >> diff --git a/drivers/input/tests/input_test.c b/drivers/input/tests/inpu= t_test.c >> index 8b8ac3412a70..0540225f0288 100644 >> --- a/drivers/input/tests/input_test.c >> +++ b/drivers/input/tests/input_test.c >> @@ -87,7 +87,7 @@ static void input_test_timestamp(struct kunit *test) >> static void input_test_match_device_id(struct kunit *test) >> { >> struct input_dev *input_dev =3D test->priv; >> - struct input_device_id id; >> + struct input_device_id id =3D { 0 }; >> >> /* >> * Must match when the input device bus, vendor, product, version >> >> to avoid having garbage in the match data. > > Thanks, that did the trick! 3/3 tests pass. > Oh, silly me. Are you going to post that as a proper patch ? --=20 Best regards, Javier Martinez Canillas Core Platforms Red Hat