Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1863834imn; Mon, 1 Aug 2022 03:03:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vppAP/v2PJNYNIkZXsZMMEFP86KxVbKztrom4/ogkwjp6r0DRWXeXpP9op7uWMd3wFuEWt X-Received: by 2002:a17:906:2bc7:b0:72f:dc70:a3c6 with SMTP id n7-20020a1709062bc700b0072fdc70a3c6mr12053298ejg.645.1659348223736; Mon, 01 Aug 2022 03:03:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659348223; cv=none; d=google.com; s=arc-20160816; b=oVFZ+JhP9mr+pUpjpsw45HwV7ZT2TSadA8sAjVU16Ws5qJ+e09Qo/bB/LJzpGxuXmd KKM5Od1N03T0FDzmLFFK0vz6xByREPnkcTFn1Lk8tyw3vIZ1uXm5I+w0nzN3Ua49Be3F YTUsH887lZJ17iXgno9Y7Gy/O20dncMXOgRIiUKg6AM15tONjZDKKBDN0/8aiu8IN6Hx JzyYy+cJKZWVsa3sYoF7a6/KEGePLmzk+lf1HDFuDYCZFhPi2zcfbW+shEKipA3UF3oV RT+yOrVdBaKoFReoOabCYSvPUsKkzAy/suOTa1WO7I+8WXnpeNxSYGbJHjgvYYXg+RY/ NLIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Afp8FUD7Ek0MnxgDfmSmKaUslh6+V7F3FKE45E7vdmo=; b=G+8eVsF3gNs3h0hcMfngA7GREwD/0aW2Rk1ZB5/clP5hFBujiNw+JLg+wvkr01Khks bnNGIteKGB9xJ5QAg+mgybLUM4fLZ9shcrvWFRBuXtsxA3lRGzKKTLdp1nz922Tx66ey hcqbAHZyks+pjKf+1/jFcMFBfPMKvd5ayi3E9umTYLOD9eTft4PHDE1uY2ljkLBLDvqE R6uhaIwgfmQUhp62REYHBICZF4R0cZPqdfGumBw5nkspj9oSD4il1HOhWUxEPF/7UsBe rsWw1eyEzjnm9pkzUCPcsKc1E8WSbu4hFKzOeWFhTQtUZREiyQ3HWarq0H2YVYWswD4+ OhWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iCK4V6VD; 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 i13-20020a0564020f0d00b0043d4810ad3asi5680510eda.221.2022.08.01.03.03.17; Mon, 01 Aug 2022 03:03:43 -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=iCK4V6VD; 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 S230433AbiHAJwI (ORCPT + 99 others); Mon, 1 Aug 2022 05:52:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230399AbiHAJwH (ORCPT ); Mon, 1 Aug 2022 05:52:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2C68F23BEB for ; Mon, 1 Aug 2022 02:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659347525; 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=Afp8FUD7Ek0MnxgDfmSmKaUslh6+V7F3FKE45E7vdmo=; b=iCK4V6VDe1V5lbJkg+u5wJZKonO110i6Phw4mfyDYTvg2Ogr1Xxc8+6hAKlVnpKaVdBHZ7 WVAXS/NOfFe2UaS5UIZ32niFgdO6Kv9Av5+1XCBCBS8NXw+QjsmWPqNwavLxlltztf4vQO VGjWys79t/PhDoQ0Ra0gT9NIi9pU9L8= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-600-d5f5IE1VNqOGNsdrEiCbZA-1; Mon, 01 Aug 2022 05:52:03 -0400 X-MC-Unique: d5f5IE1VNqOGNsdrEiCbZA-1 Received: by mail-ed1-f70.google.com with SMTP id o2-20020a056402438200b0043d552deb2aso3090030edc.0 for ; Mon, 01 Aug 2022 02:52:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Afp8FUD7Ek0MnxgDfmSmKaUslh6+V7F3FKE45E7vdmo=; b=tB3moQZPXez8MNbT5gHz8w+WOfO1xq4r4glqNTU2HVeo1cjRgUlCFoHUjjzGqvCYrk YzxUBD+ri+XyVsL6nuQDoCHQ3jfpeca90efoC+LhJL+Al1SV23atOajsqM3O2dzWwZhA sHK/QlW5ZkyiwvxrVmvJZ1GL4KhU4inufo+rQOEHI84SA8ppOLgJqIvs0k5OZZlTimcv IS7vAMiwjFNEtOcHAID8xbnekJ8VA/cv/A6XYg9fd81yVRJBRITKjpZT5trxl4oRDyb9 DwxL9CyhjB3DajQPsi9efzaWrEpASUJ0drlky0YUlrfQD8RAU6kOaJzQzJ5xLcn8CGQF 7fFg== X-Gm-Message-State: ACgBeo2trcB5pR5xSNOYojdFZhTCwOes8sDqbEsJtVi7v3+QOtAUQIBB gqpXBeXbKJIPYeJOTMsDWdOfGI5dbzL6sBThZjVyQ8b+IngKvPTMem3q2sQrhPlfLbjkVrpWYbs 1p5ZHspv/qaD7v38htUuQ3Pdu X-Received: by 2002:a17:907:7355:b0:730:664f:91f with SMTP id dq21-20020a170907735500b00730664f091fmr5115008ejc.400.1659347522606; Mon, 01 Aug 2022 02:52:02 -0700 (PDT) X-Received: by 2002:a17:907:7355:b0:730:664f:91f with SMTP id dq21-20020a170907735500b00730664f091fmr5114995ejc.400.1659347522428; Mon, 01 Aug 2022 02:52:02 -0700 (PDT) Received: from [10.40.98.142] ([78.108.130.194]) by smtp.gmail.com with ESMTPSA id fg7-20020a1709069c4700b007304d084c5esm1890371ejc.166.2022.08.01.02.52.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Aug 2022 02:52:01 -0700 (PDT) Message-ID: <98f1509a-2386-7c8f-cf53-cdb93990aa74@redhat.com> Date: Mon, 1 Aug 2022 11:52:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v2 01/10] mfd: intel_soc_pmic: Fix an error handling path in intel_soc_pmic_i2c_probe() Content-Language: en-US To: Andy Shevchenko Cc: Andy Shevchenko , Lee Jones , Linux Kernel Mailing List , Lee Jones , Andy Shevchenko , Christophe JAILLET References: <20220731201258.11262-1-andriy.shevchenko@linux.intel.com> <9b9abdf0-7cd5-df51-adbf-2225291f0dd2@redhat.com> From: Hans de Goede In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE 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 Hi, 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: > > ... > >>>> err_del_irq_chip: >>>> + pwm_remove_table(crc_pwm_lookup, ARRAY_SIZE(crc_pwm_lookup)); >>>> regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data); >>>> return ret; >>> >>> 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 (*). Regards, Hans *) 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.