Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp127421iob; Thu, 12 May 2022 20:36:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPXNNlfevlD+31tDhEOOKhSMWRKLtWK8V4wRNyr77CVbD6Bp9mT6lkslD1LNjpACmTSCgn X-Received: by 2002:a17:902:bf4c:b0:15c:3d1b:8a47 with SMTP id u12-20020a170902bf4c00b0015c3d1b8a47mr2683322pls.118.1652413017030; Thu, 12 May 2022 20:36:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652413017; cv=none; d=google.com; s=arc-20160816; b=i1wNpRDZQoYG5kMEhojxY7ftKv6VTthrwG+T7wSEj6Uv/I24nmjPHqYvmHDReGyqbk 6gXSh1vhl+iSr243xSCOzTwnI3uY1kYEFBY/pwNc1JVxJe6ELqKHt5IYsYpJp8IKdAgU U/FapQw8xl6m1WX0VtWz/5rdYmyyqexL1aisQdd6C1pNQDLs6KdbcEmGryrhn4OVeEvf HTZZ9KgXtVDhtsgwNMJ61WrNwlOq/LQmUJq6EqQ2D8pwrx2O3W3k+LEpCoZuqseEbRL8 XbgD3sMJO2rXPYbJukzARfymTxodxtJ0+r4/J3JST+qCAUaTXkyCeAUy0Cd9SBR5dsJ4 eGSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:user-agent:from :references:in-reply-to:mime-version:dkim-signature; bh=Zhd0MG3OMKsxCCS0DxHYWS6OhXTHRYI9udewsQ9wKKA=; b=veMkMTrT88tkdu8lIG/PQrk9Y5GUkDaCWw5+4S/IhZujdbJbdVJZQ59uJOwO4Q/I4K br4sHxfskj1hvBodKkwZw+sK1AROpCZ3glk8O+sXomcrC5P7GzEBhFhQpRWguQLGLJCR CnkcAIHJgCJqHZEcpC5cabgf7jjvPb8l/mLi4+30QH9+pHW5unD1CjDFm50akH+iuWz4 SD8Is9Ac/gYlCAbDZwMhvTqt+MwGVzmu5U+9tsvkALx+iP5rGjcfHC2TmnXl+mZXjTts gmhCoaegwM+Ur9mOrKs+Q82LWnOihkopjeCEsfJxGsxOdpZv41wPi6R0RGQLACgorBkV +R3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="a5lZ//ec"; 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 q4-20020a170902b10400b0015862deeb9dsi1680392plr.117.2022.05.12.20.36.45; Thu, 12 May 2022 20:36:57 -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="a5lZ//ec"; 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 S1357827AbiELS6H (ORCPT + 99 others); Thu, 12 May 2022 14:58:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357798AbiELS6E (ORCPT ); Thu, 12 May 2022 14:58:04 -0400 Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1364C719DD for ; Thu, 12 May 2022 11:58:04 -0700 (PDT) Received: by mail-ot1-x331.google.com with SMTP id i25-20020a9d6259000000b00605df9afea7so3357755otk.1 for ; Thu, 12 May 2022 11:58:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc; bh=Zhd0MG3OMKsxCCS0DxHYWS6OhXTHRYI9udewsQ9wKKA=; b=a5lZ//ec8iMYjwZDAFJviLOlhtuK/zOhkJ8yY1fP9EOuCDN7H/DKHGYMZLTVmLaSbH 7zDVMTp4gtAb4CDJ1R3EfmEKDkhQHR8HOMF8u/8PtjJUzecXveh/v9O18YV7oMq+yfQB 7+9QKdmKM/AnFBuJIvt9RolrCx3FNraGV4Zl4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc; bh=Zhd0MG3OMKsxCCS0DxHYWS6OhXTHRYI9udewsQ9wKKA=; b=gcsTs6VpQDLUKKzOOaQ2nXhXVGU7o40MGRX3PAuP6YISOL5Ohe8gLsDTpriF0HX5nj O4L4ywHauwZt7ncC3xf7pIeD8ke3YuBOz0CWCufwsGBpOp0V1XZxyMND3VyPudYl/B3B WSGABluPWDQ7JQiA26JlYHvLxUZqyb5WDqwDLUcVtXNQwuZBr847c+sqmkdM1cCBo/KR dPq3uH29B9hrLsbT0/FLqpLErG4NAxBLkGLwbwPEg9ifVH5Eg1OgOcF5YnWZ3PsgB45n LisO2UkArGXzvvDba72SAEx8zI51Rc+WskpK5+CYzhxWkUvO3rHPMBDli87vTvzQFudy PbQQ== X-Gm-Message-State: AOAM530v+FJShd6K5ebknyWbWWNADUw9VzUe+Xal8SN8XcZtfcoFlrLY lRJKDEYKhUs210YGRexYAx8P20adRDelX7SHeFeg1Q== X-Received: by 2002:a05:6830:13ce:b0:606:702b:87f0 with SMTP id e14-20020a05683013ce00b00606702b87f0mr535356otq.159.1652381883398; Thu, 12 May 2022 11:58:03 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 12 May 2022 11:58:02 -0700 MIME-Version: 1.0 In-Reply-To: References: <20220429233112.2851665-1-swboyd@chromium.org> <20220429233112.2851665-2-swboyd@chromium.org> From: Stephen Boyd User-Agent: alot/0.10 Date: Thu, 12 May 2022 11:58:02 -0700 Message-ID: Subject: Re: [PATCH v2 1/2] dt-bindings: google,cros-ec-keyb: Introduce switches only compatible To: Dmitry Torokhov Cc: Doug Anderson , LKML , patches@lists.linux.dev, chrome-platform@lists.linux.dev, Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, Benson Leung , Guenter Roeck , Hsin-Yi Wang , "Joseph S. Barrera III" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.7 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,T_SCC_BODY_TEXT_LINE 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 Quoting Dmitry Torokhov (2022-05-12 03:22:30) > Hi Stephen, > > Sorry for the delay with my response. > > On Mon, May 02, 2022 at 01:41:33PM -0700, Stephen Boyd wrote: > > Quoting Dmitry Torokhov (2022-05-02 10:43:06) > > > On Mon, May 2, 2022 at 10:00 AM Doug Anderson wrote: > > > > > > > > That goes against the recently landed commit 4352e23a7ff2 ("Input: > > > > cros-ec-keyb - only register keyboard if rows/columns exist") but > > > > perhaps we should just _undo_ that that since it landed pretty > > > > recently and say that the truly supported way to specify that you only > > > > have keyboards/switches is with the compatible. > > > > > > > > What do you think? > > > > > > I am sorry, I am still confused on what exactly we are trying to solve > > > here? Having a device with the new device tree somehow run an older > > > kernel and fail? Why exactly do we care about this case? > > > > Yes, we're trying to solve the problem where a new device tree is used > > with an older kernel because it doesn't have the driver patch to only > > create an input device for the matrix when rows/columns properties are > > present. Otherwise applying that devicetree patch to an older kernel > > will break bisection. > > Well, my recommendation here would be: "do not do that". How exactly > will you get new DTS into a device with older kernel, and why would you > do that? It's about easing the transition to a new programming model of the driver. We could "not do that" and consciously decide to only use new DTBs with new kernels. Or we could take this multiple compatible approach and things work with all combinations. I'd like to make transitions smooth so introducing a second compatible string is the solution for that. Another "what if" scenario is that the rows/columns properties should have been required per the DT binding all along. If they were required to begin with, I wouldn't have been able to make them optional without introducing a new compatible string that the schema keyed off of to figure out that they're optional sometimes. > > > > > > > We have > > > implemented the notion that without rows/columns properties we will > > > not be creating input device for the matrix portion, all older devices > > > should have it defined, so the newer driver is compatible with them... > > > > > > > Agreed, that solves half the problem. This new compatible eases > > integration so that devicetrees can say they're compatible with the old > > binding that _requires_ the rows/column properties. By making the driver > > change we loosened that requirement, but the binding should have been > > making the properties required at the start because it fails to bind > > otherwise. > > > > My interpretation of what Doug is saying is that we should maintain that > > requirement that rows/columns exists if the original compatible > > google,cros-ec-keyb is present and use the new compatible to indicate > > that there are switches. Combining the two compatibles means there's > > switches and a matrix keyboard, having only the switches compatible > > means only switches, and having only the keyboard compatible means only > > matrix keyboard. > > > > It sounds OK to me. > > Have we solved module loading in the presence of multiple compatibles? > IIRC we only ever try to load module on the first compatible, so you'd > be breaking autoloading cros-ec-keyb on these older kernels. I think the > cure that is being proposed is worse than the disease. > The first compatible is still cros-ec-keyb in the driver though? Or you mean the first compatible in the node? I'm not aware of this problem at all but I can certainly test out a fake node and module and see if it gets autoloaded.