From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6347C6FA8E for ; Tue, 20 Sep 2022 13:38:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231226AbiITNiO (ORCPT ); Tue, 20 Sep 2022 09:38:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231209AbiITNiM (ORCPT ); Tue, 20 Sep 2022 09:38:12 -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 A36B21408C for ; Tue, 20 Sep 2022 06:38:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663681088; 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=5ptul5F+oi+h41DyVRco1I/MopxWAXfTqNQ2MFX3lkw=; b=aSEFEdqrgeDCK4bMzYmyGj2o482uidpLYcPZmq5Fz2vHlfM4iAGfuMexO9DY/HhlfwyKE/ 4eBuzT5Ed5rpOsdT95EHjBRoJdvnxgmQ1ZOMUC6wZ/U8IawOFE5Rx9/moNdQ45mYOO7X74 V6jX9o3UREW8NQti2/dWy6KsM859d08= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-597-ZBuT30GVMqW6MXHcxCp_wQ-1; Tue, 20 Sep 2022 09:38:07 -0400 X-MC-Unique: ZBuT30GVMqW6MXHcxCp_wQ-1 Received: by mail-qt1-f199.google.com with SMTP id fy20-20020a05622a5a1400b0035bef08641dso1821730qtb.18 for ; Tue, 20 Sep 2022 06:38:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date; bh=5ptul5F+oi+h41DyVRco1I/MopxWAXfTqNQ2MFX3lkw=; b=tFowbvfWTe6LxNpbiRWlyA4nlPwbsKBFtOxAHtEl/NvSvjLL2bzyPewDNV4OBxwdKS TL132eRa4Y6BAQvKe8X48poG+eEMI69yAE6TuPATv+lQikRJrwlH+8w6zroSKTaDyuCM Fpje349ROUs79/jlh79sbPCKE/VlOVBfQ7TwRoOVWbmzjFYO4LkH/kwBSPQ4PXNUUiit Al1frsaSDZcY4eIqu6eWLyUeavSozoRKNKBz1HNfJewYQ5rG9/HwRGHgEHnG0mjT0tOO 4cViYFWFY1HSDNiG1H1ejFO8lrk+umqxbAAlSREwQYamoJMBpaurlYruPz3z/hVKzsP0 UXsQ== X-Gm-Message-State: ACrzQf3wat0ENcAuOwazuPEaRb8pLbZS+UBLewy/Qr2AADQcz9OaayRY C3ZDlwTIZn401P6X1SLYi6ePaFs0nXWfPJwqyY1xBznFaNDMMsIHiQWTjOLxQolItGZfPb1+mzZ FPPLhoCVlbuEpq9PsLa67l4COgA== X-Received: by 2002:ac8:59c8:0:b0:35c:e115:b18d with SMTP id f8-20020ac859c8000000b0035ce115b18dmr11456584qtf.123.1663681085598; Tue, 20 Sep 2022 06:38:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6E77qWjrb4O7Hq4zvnJnGvSPaIHOB3HS5izLjI11yyG3poqQh+gGyGGwkM2TfWtP/1afoIQg== X-Received: by 2002:ac8:59c8:0:b0:35c:e115:b18d with SMTP id f8-20020ac859c8000000b0035ce115b18dmr11456440qtf.123.1663681083862; Tue, 20 Sep 2022 06:38:03 -0700 (PDT) Received: from gerbillo.redhat.com (146-241-114-90.dyn.eolo.it. [146.241.114.90]) by smtp.gmail.com with ESMTPSA id bj7-20020a05620a190700b006b9c6d590fasm148570qkb.61.2022.09.20.06.38.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 06:38:03 -0700 (PDT) Message-ID: Subject: Re: [PATCH net-next 3/6] net: ipa: move and redefine ipa_version_valid() From: Paolo Abeni To: Alex Elder , davem@davemloft.net, edumazet@google.com, kuba@kernel.org Cc: mka@chromium.org, evgreen@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 20 Sep 2022 15:37:59 +0200 In-Reply-To: References: <20220910011131.1431934-1-elder@linaro.org> <20220910011131.1431934-4-elder@linaro.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Tue, 2022-09-20 at 07:50 -0500, Alex Elder wrote: > On 9/20/22 3:29 AM, Paolo Abeni wrote: > > On Fri, 2022-09-09 at 20:11 -0500, Alex Elder wrote: > > > Move the definition of ipa_version_valid(), making it a static > > > inline function defined together with the enumerated type in > > > "ipa_version.h". Define a new count value in the type. > > > > > > Rename the function to be ipa_version_supported(), and have it > > > return true only if the IPA version supplied is explicitly supported > > > by the driver. > > > > I'm wondering if the above is going to cause regressions with some IPA > > versions suddenly not probed anymore by the module? > > That is a really good observation. > > The way versions are handled is a little bit inconsistent. The > code is generally written in such a way that *any* version could > be used (between a certain minimum and maximum, currently 3.0-4.11). > In other words, the *intent* in the code is to make it so that > quirks and features that are version-specific are handled the right > way, even if we do not (yet) support it. > > So for example the inline macro rsrc_grp_encoded() returns the > mask to use to specify an endpoint's assigned resource group. > IPA v4.7 uses one bit, whereas others use two or three bits. > We don't "formally" support IPA v4.7, because I (or someone > else) haven't set up a Device Tree file and "IPA config data" > to test it on real hardware. Still, rsrc_grp_encoded() returns > the right value for IPA v4.7, even though it won't be needed > until IPA v4.7 is tested and declared supported. > > The intent is to facilitate adding support for IPA v4.7 (and > others). In principle one could simply try it out and it should > work, but in reality it is unlikely to be that easy. > > Finally, as mentioned, to support a version (such as 4.7) we > need to create "ipa_data-v4.7.c", which defines a bunch of > things that are version-specific. Because those definitions > are missing, no IPA v4.7 hardware will be matched by the > ipa_match[] table. > > So the answer to your question is that currently none of the > unsupported versions will successfully probe anyway. > > > Additionally there are a few places checking for the now unsupported > > version[s], I guess that check could/should be removed? e.g. > > ipa_reg_irq_suspend_en_ee_n_offset(), > > ipa_reg_irq_suspend_info_ee_n_offset() > > ... > > I'm a fan of removing unused code like this, but I really would > like to actually support these other IPA versions, and I hope > the code is close to ready for that. I would just need to get > some hardware to test it with (and it needs to rise to the top > of my priority list...). > > Does this make sense to you? Yes, very clear and detailed explaination, thanks! I'm ok with the series in the current form. Cheers, Paolo