Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp12574566rwd; Fri, 23 Jun 2023 07:56:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4mw2SoLcekn/AhtGRBXKq6fGvO6U3CbU8OMJXlOPup91x6rWbYX93YdbJt0NwJFVRAwwWX X-Received: by 2002:a9d:6b89:0:b0:6b5:ee8f:73ab with SMTP id b9-20020a9d6b89000000b006b5ee8f73abmr5458137otq.30.1687532160860; Fri, 23 Jun 2023 07:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687532160; cv=none; d=google.com; s=arc-20160816; b=KBtxnfkqN7JwoROEy7nuvhliNX2cO1M5AonJrPFHKZsyFuH+lO1/FWYstE47GEq9ri M2nKaAUXvU/CVumd/Edir6eHf8e0nMozxo8sa9/fPUeVA9NL9ble1SeKqgOj4LHCuJS0 Ix5Brj4e+FOtVEP8u2XhAnUp3TnPS9zj5mcIFE7ch+QRw540V4LgJnuAOuAoui68Oj0z deCzOMc624iVazV7rmrIM1nA3lOdL+QzlvkEBtvZ+2PGiaHLttkNem0bQYKHFdr+MRPT 7/RzhHw153BXc1BgKGa5d9pVsKBpYpVsZr9zwMTT104HF8ooHa236FMoffn/z8nDzFIO 2QZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=qvYcNbfi4wk90r7Zdnr2h6ux5+kUHoVt3BT8r4OvZZ8=; b=a6kbn/RFJQ+r3CMv3iVaA5t8rOyG8BLrzG3B30/AZZqoPj0jk9Gwzmld845KZ7OTLx a9RcqvIGzi4OG08LYBFPcrcJJpJBoRSdQSNFprR+lPTighLBp3sTUcPHr60AwsQ2np1p vEgInT2cFfqrKNPSe7s3f/2zvfyprhQKQWfr3FfbmZ6huAO+LeDF9v8ZwlFZNTJANU+Q 5fc2x3ypV8lOmo+BpmTROoBAe91PUi/CNPJSMcMuSOK7ZtMoaVyO7c2GJwzB1OostdnA zio3bQS7+d5guVri/bVs0L5HwbDPuQWl/rILaGR7MsKii49T0h0q74FYmXX5jz6cYkf2 quXg== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u71-20020a63854a000000b0053f32b910c1si9065230pgd.700.2023.06.23.07.55.48; Fri, 23 Jun 2023 07:56:00 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229469AbjFWOp3 convert rfc822-to-8bit (ORCPT + 99 others); Fri, 23 Jun 2023 10:45:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231393AbjFWOow (ORCPT ); Fri, 23 Jun 2023 10:44:52 -0400 Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58E231997; Fri, 23 Jun 2023 07:44:10 -0700 (PDT) Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2b46d945510so1899441fa.1; Fri, 23 Jun 2023 07:44:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687531448; x=1690123448; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZiwtYNSOh0NeHU7WEn4N3VuCjNo0G26bDf11cTSsZno=; b=ZIVtQEvIiRiIG17zavSMNhQAXGJLlM9rcfAd/qXy/9YbTEVoF86N27i9OX6GJo9Hl/ MjooJIHnpIT80SIwXj5xrKIK27lvrNvWcsHWi2FOxiJC5STYDCCSrOYWck2WQhFl1rrt 3JkmT+Z4pC4K/YlLUnRF3V1C9CJja5Vq1FoNDaiZCectWFBz23LmwHlMAxL9D20Wy249 hHSlYTHBb0V9wpYvc/8/LzZoVURGhof69QpmRBlDH5XloIW172xDsVQ/kkcuqUgb7sLM bnvfp9heR2rVGCZVM+N3kRrNNlA1R3/kMMDKFPisw3cm2IUGKTsjCv+kFeSDd+TToxAT tDkQ== X-Gm-Message-State: AC+VfDxQWmKB2BBHxZo3Z8aBFnaPt/We2FaGi7RYPr+yjZYApWrTCAWB 7c3ymC1swUZuE0ubGAG7svdjLK53BCnOXRce65JNs8kFYWY= X-Received: by 2002:a2e:b804:0:b0:2b4:5bc8:3f1a with SMTP id u4-20020a2eb804000000b002b45bc83f1amr12642496ljo.2.1687531448363; Fri, 23 Jun 2023 07:44:08 -0700 (PDT) MIME-Version: 1.0 References: <20230621151652.79579-1-andriy.shevchenko@linux.intel.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Fri, 23 Jun 2023 16:43:55 +0200 Message-ID: Subject: Re: [PATCH v2 1/2] ACPI: platform: Ignore SMB0001 only when it has resources To: Andy Shevchenko Cc: "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, acpica-devel@lists.linuxfoundation.org, Len Brown , Andi Shyti , Robert Moore , Michael Brunner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 Thu, Jun 22, 2023 at 8:19 PM Andy Shevchenko wrote: > > On Thu, Jun 22, 2023 at 05:53:13PM +0200, Rafael J. Wysocki wrote: > > On Wed, Jun 21, 2023 at 5:16 PM Andy Shevchenko > > wrote: > > > > > > After switching i2c-scmi driver to be a plaform one, it stopped > > > > "platform" > > > > > being enumerated on number of Kontron platforms, because it's > > > listed in the forbidden_id_list. > > > > > > To resolve the situation, split the list to generic one and > > > another that holds devices that has to be skipped if and only > > > > "have" > > > > > if they have bogus resources attached (_CRS method returns some). > > Thanks for the typo fixes! > > ... > > > > +static const struct acpi_device_id forbidden_id_with_resourses[] = { > > > > I don't quite like this name and the driver_data field could be used > > to indicate the need to check the resources. > > Okay, something like > > /* Check if the device has resources provided by _CRS method */ > #define ACPI_PLATFORM_CHECK_RES BIT(0) > > ? Could be, but this is specific to forbidden_ids_list[]. Maybe ACPI_ALLOW_WO_RESOURCES or similar. > > > + {"SMB0001", 0}, /* ACPI SMBUS virtual device */ > > > + { } > > > +}; > > ... > > > > +static int acpi_platform_resource_count(struct acpi_resource *ares, void *data) > > > +{ > > > + int *count = data; > > > + > > > + *count = *count + 1; > > > > Why not (*count)++? > > Can be that way, I just copied'n'pasted from the existing code. > > > > + return 1; > > > +} BTW, this doesn't need to increment the count even. It could just terminate the walk on the first valid resource found and tell the caller to return true in that case.