Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1880075imn; Mon, 1 Aug 2022 03:44:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR75Xs7YKdANdFeY3tA8mXHnxUckLFEH4Z161r0ZJMILjPjPjxPhCgtapCiQy3aelb29VdUV X-Received: by 2002:a63:87c1:0:b0:40d:289e:8637 with SMTP id i184-20020a6387c1000000b0040d289e8637mr3825287pge.362.1659350668514; Mon, 01 Aug 2022 03:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659350668; cv=none; d=google.com; s=arc-20160816; b=WeKdI1pP2Q1uzM3tzNPXilFCmWsJTVEtWaz7ElfbHSNOkD7cknZr59ulDFrglSwG9w cn0qEjX9yA2CwsnkArKuLWmn9l5ASPJT1u/Nc0NNhBiP3Hqqug9TXuCdRaFsXuODNzRB kdIMST+5ahw8Jc1foDk/PjYuKm9TIrku4m5xd+cWaw6to49NEJAtO+h+cINTQh6SYuUk 8HgqgTd7YT929appFRXX/f63qrFGrF6HItbM1l2sdehaR9GjLN6tkFO4lsK1hV99Aq9l sW6xiGvEmH62WXQbhdnjrMmGcHUiSdKKv29i34GfvCG6XRm5ab6dRZyPqQ42dKOTbE0p GaFg== 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:from:in-reply-to :references:mime-version:dkim-signature; bh=2oZgFsPbP564TnDAd19aoDFaT2m873cI3rCH0wJnmfE=; b=GKQkTS/2ilsrz7i/OpwcKN0+tabmvrPv67sAZPuB3tm5hSWSqc16bIyaQ6lVxEH6la S79Pt4FbADA2YrkyscSA0mDOx0aPxGlqIA7lR/B/sDhNWtbQPozI4KJqvp3a6S4YBPre B4iIzmCXh3/5DJzkqgTGubzZFKaqteLkr5uOXbcv0wlDil9AOhpwWhBXKTbY/ha7/mEI J+TKjR1SAFe/7Yc8XHZICxam97eYtVZMVdPbNlPxI28N/Yzb1Dhn9Lqzf23FsQ49DjDJ w0RmwL1/DU4HCLRnDe4AtzW2fsH5VabipDsqwgmHUHLRxxDz5k/xc7RrbkEaGphGNs7t /1ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="T0/nFJyd"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c16-20020a056a00249000b0051c3fd6df1esi12430122pfv.154.2022.08.01.03.44.13; Mon, 01 Aug 2022 03:44:28 -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=@gmail.com header.s=20210112 header.b="T0/nFJyd"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230428AbiHAKjL (ORCPT + 99 others); Mon, 1 Aug 2022 06:39:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbiHAKjK (ORCPT ); Mon, 1 Aug 2022 06:39:10 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AF67371A9 for ; Mon, 1 Aug 2022 03:39:09 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id f22so2173215edc.7 for ; Mon, 01 Aug 2022 03:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=2oZgFsPbP564TnDAd19aoDFaT2m873cI3rCH0wJnmfE=; b=T0/nFJyd/jtsmY0hN2oVp9DiTm/fU355tgbDbA42S79k/lP0BupKWI9zsli3nsDV0z oWKsEwIjYGE1f+qW7dPs28qwzPSWBpXna87hAmpyLAck/Y15ADxdPwzrsH2Sh5+tVYm2 Cx4EuGe1ER3vhue1nbXAc9xiNxPVPpQXx1Z4SrQc4rN+bW3AtMZotC3sp84QH5DBzFR5 XbX4GTXbOGCY6F0IXxKcfluqA6/cUy75gmL21K+4HbqQEkss2XPmIpaxYiLbDq5R888J HCaVoEqirpS97wtYEQdc+SJ8CVDxM7Zf+5aT12XhQjX8giM6s13wX2fB10lOydANqOOh 01lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=2oZgFsPbP564TnDAd19aoDFaT2m873cI3rCH0wJnmfE=; b=TejgyRD9sM7VTzykUyEEl/jIWUtfhX2+4juy50SxKSZahXd+dwl1gdOobsWRPpmyza OcjWwMmIQVJITxdyqZQKTJ/KEnnoIgO3k1pEtnYJ0JUFC9HwsGnASAgT+f4xWGc00bhW 6Xw2wAET+6dOYjYi91tZkiTOOhPlng9/aZXA1jX7ug/LNhwn1CXrlXfSyYIohcxzg5/c AkRwiK26SB/sFI0Cr75KJzU4HMMrA8WQGyE0Vg+vn+g1wBYthTlpW87OMcm30KQc0+3w kuY9fi4FsuOB/kTYNli1PnhNbKbdF1YGkWqE3ptpr7N5mo/NH9VP/2lexrGI32zcXu3J A6TA== X-Gm-Message-State: AJIora9mqOlmTXnhQz60oz38UEMLYEFgvigaFvg1zOrJiwrsauUsrQrP 8O0+Nz7LuOgAnebAPz8GPoLv+31T4ka4CJ3FCOo= X-Received: by 2002:a05:6402:501d:b0:437:e000:a898 with SMTP id p29-20020a056402501d00b00437e000a898mr15348291eda.265.1659350347520; Mon, 01 Aug 2022 03:39:07 -0700 (PDT) MIME-Version: 1.0 References: <20220731201258.11262-1-andriy.shevchenko@linux.intel.com> <9b9abdf0-7cd5-df51-adbf-2225291f0dd2@redhat.com> <98f1509a-2386-7c8f-cf53-cdb93990aa74@redhat.com> In-Reply-To: <98f1509a-2386-7c8f-cf53-cdb93990aa74@redhat.com> From: Andy Shevchenko Date: Mon, 1 Aug 2022 12:38:30 +0200 Message-ID: Subject: Re: [PATCH v2 01/10] mfd: intel_soc_pmic: Fix an error handling path in intel_soc_pmic_i2c_probe() To: Hans de Goede Cc: Andy Shevchenko , Lee Jones , Linux Kernel Mailing List , Lee Jones , Andy Shevchenko , Christophe JAILLET Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 On Mon, Aug 1, 2022 at 11:52 AM Hans de Goede wrote: > On 8/1/22 11:29, Andy Shevchenko wrote: > > On Mon, Aug 1, 2022 at 11:14 AM Andy Shevchenko > > wrote: > >> On Mon, Aug 1, 2022 at 10:43 AM Hans de Goede wrote: > >>> On 7/31/22 22:12, Andy Shevchenko wrote: ... > >>> Note alternatively we could just move the pwm_add_table() to just before the "return 0", > >>> there is no strict ordering between adding the mfd devices and the pwm_add_table() > >>> (the pwm device only becomes available after the pwm-driver has bound to the mfd > >>> instantiated platform device which happens later). > > > > Just to be sure... How is it guaranteed that that happens later? > > Ah you are right, it could happen immediately if the driver is builtin and > has already registered (if the PWM driver is a module, as it is on Fedora, > then the driver will only bind once the module is loaded). > > Regardless there are no ordering guarantees between the probe() function of > intel_soc_pmic and the consumer of the PWM device, so the consumer must > be prepared to deal with the lookup not being present yet when its probe() > function runs (*). Would be nice to have, but isn't it the issue with all lookup tables so far, e.g. consumers of GPIO ones are also affected the very same way? > *) ATM this is actually an unsolved problem and this works only because the PMIC > drivers are builtin and i915, which consumes the PWM for backlight control > is a module. Swapping the order does not impact this. Even so, I think we can't change order right now because the issue is much broader. -- With Best Regards, Andy Shevchenko