Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp757792rwl; Fri, 24 Mar 2023 01:18:07 -0700 (PDT) X-Google-Smtp-Source: AKy350ZlN/fMezsoMkAqE8p65y8nwTdZEi/bPgkAgLaF3M0/jw6bmUi6+Y7a+oKpBsChXjhCGjEd X-Received: by 2002:a62:1d95:0:b0:627:e577:4326 with SMTP id d143-20020a621d95000000b00627e5774326mr1672770pfd.17.1679645887499; Fri, 24 Mar 2023 01:18:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679645887; cv=none; d=google.com; s=arc-20160816; b=KvEuhPtC+EKSRblTJN63mhMEhniH63lTVy+vNSJZwyDwUlVPGeDfWM87b/yYIUfYz6 BB2/33otqeaM8/8x2vI01lFmS5DrByj5XgqCcVdRIwFDHW0nh9thtDuD03eNVT0qfrPc wpIFGSdBWpVWJhFUXis2RErG1w74BOX23mlPYvWrIOm76Z39Ym/w8D2Q8ADXnciW75Wl QgzWq7pNbGeth/fylqVukzZ7VToWgIEmIaRsi+U2tqchED5pcAxpXDZ39K/N6yxmbqtK LgBX0v8fT86lyAP0aUYKLdu7Cx0sX2BY+YSj39aE17v1VOl7fl+9gLL1Mk7kH6y1PR+y hLNw== 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=Et+I6m2/3M3ihrXodAsozWva/ZYQ4ukUjISIAm7jl7w=; b=E0y8d1ubjwTLV2UWAwlBZDvFIUfZkDSLrURy7lWzOCKRdQSryyfbm3wOlhkeXZe2zC nVKjdA7oqxhKWADwLb5JGcgekfWj0CNBcRodZ1H64ms/fILZ5TB+QxyDDUj/t3DIe0T2 PNCDtJN27ljr0q/QFlv/nwSRiR5nTqxlni5uGZ3yQpnvTtaU3H17pPbnbARv1pfyaLl/ cEiM4uIHLidbFFM2Lth3xrC+pWROWZAjouZgCMWLhbgmdwjnADRcYAvIlFptJw2aLbg/ Y1UuzYwZAxHxnryQS12ymhuxAcrlEBvyFUepdpD5q8hNcVCjbw3V+3XOUYO0bPWvzyQA R+WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=7uTrwDQ1; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j16-20020a056a00235000b0059d96ba730dsi21418248pfj.110.2023.03.24.01.17.54; Fri, 24 Mar 2023 01:18:07 -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=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=7uTrwDQ1; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229600AbjCXIAK (ORCPT + 99 others); Fri, 24 Mar 2023 04:00:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231301AbjCXIAJ (ORCPT ); Fri, 24 Mar 2023 04:00:09 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC6241E1E8 for ; Fri, 24 Mar 2023 01:00:06 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id v4-20020a05600c470400b003ee4f06428fso405194wmo.4 for ; Fri, 24 Mar 2023 01:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1679644805; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Et+I6m2/3M3ihrXodAsozWva/ZYQ4ukUjISIAm7jl7w=; b=7uTrwDQ1t1lwRIveny17vL0ua24bvr+rukAwV8ZAU/Bh/9eHLfPnqzJcagHhJ77xc1 R12KpmviwRpqJ4y6Y7xZIAjO5cSmC7a20FEkkQ031zyw3mgdRfGkV9F4b0WXVo//BDWb pv33ubHZsRu1o5S6esuayqgduq2qg1o1BR+zc4rnXRk4R7JxDuvuyoUZvrWGQggjnFpg HFKdo01a2yCcEWZbpylOeM49mBx2kRTMZIlUJ8Acg29QyPuKSkobnONi1GVPP8xdXPtk SS+d9gHTVyKvmxTlJaUNIYst+zO15RsLKQpmIe06ziCZcvuCWRJgRKMT0WC97EwRPFTv UW5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679644805; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Et+I6m2/3M3ihrXodAsozWva/ZYQ4ukUjISIAm7jl7w=; b=CKzipGYsLWNYj+xU4PcUKNtOSkgKZmVTo8darP1J7wb2Bizxc66H6foyH5V2YAPxuF qXsM9Vh8T6Z9o1xi+/VQ4Om1w3gFt8dGHyvG2t7dbrABWnxtvAPGNTz8s0bzG47GNM5O H2RcbnIXyAL1oXD/k9RIhDjU4VvOhzoJak2y9E5/N7t/OS5jt6qQfDFR9X/YD/ZHc0vH eENWIBlb/1oBFL2z+YUcuwKd1xp8zrb4K5DWVzqdPYVBWm72x6NNEMANzLHp+ktOpPSV pTEywsUvqBiaXu6ol47iVjqV4/g8LMvLliuYtRdUxa5xJ6UNt80QQZoMIzv+kC3j/Zmr BgDA== X-Gm-Message-State: AO0yUKWbZHG/CHJt/+OQ1c3NwOIeekMFSqqxp3efzkCBzrHXOzdITxP9 oV7fqfWgQ1WYvsVuLw3pO7+O/g== X-Received: by 2002:a7b:c409:0:b0:3ea:f6c4:305e with SMTP id k9-20020a7bc409000000b003eaf6c4305emr1653541wmi.38.1679644804698; Fri, 24 Mar 2023 01:00:04 -0700 (PDT) Received: from [192.168.1.91] ([85.68.201.192]) by smtp.gmail.com with ESMTPSA id c18-20020a7bc852000000b003ed2c0a0f37sm4082775wml.35.2023.03.24.01.00.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Mar 2023 01:00:04 -0700 (PDT) Message-ID: <3d684dec-338a-085f-3ef1-1642e5067fb2@baylibre.com> Date: Fri, 24 Mar 2023 09:00:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH INTERNAL v1 3/3] regulator: tps6594-regulator: Add driver for TI TPS6594 regulators Content-Language: en-US To: Mark Brown Cc: Esteban Blanc , linus.walleij@linaro.org, lgirdwood@gmail.com, a.zummo@towertech.it, alexandre.belloni@bootlin.com, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-rtc@vger.kernel.org, jpanis@baylibre.com References: <20230224133129.887203-1-eblanc@baylibre.com> <20230224133129.887203-4-eblanc@baylibre.com> From: jerome Neanne In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 23/03/2023 12:38, Mark Brown wrote: > On Thu, Mar 23, 2023 at 10:12:21AM +0100, jerome Neanne wrote: > >>> This would be simpler and you wouldn't need this lookup function if the >>> regulator descriptions included their IRQ names, then you could just >>> request the interrupts while registering the regulators. > >> I changed the code to follow your recommendations then now in case of a >> multiphase buck, only one set of interrupt is requested. > >> buck2, buck3, buck4 are not associated to a regulator device because buck1 >> registers control all the multiphase bucks (only one logic regulator). >> Consequently the mapping for the associated interrupts does not occur. >> I'm not sure it's the right option. >> Do you suggest to keep it like that for multiphase? >> Is it better to request all the interrupts anyway and map it to the same >> rdev? > > Do the other interrupts do anything useful for this configuration? With > a lot of hardware the whole control interface gets merged into one which > includes the interrupts. > Discussed the point with TI in //. In case of multiphase buck ex: buck12 All the control is delegated to buck1 registers but there is still a possibility that an interrupt triggers on buck2 (overcurrent typically). I slightly changed the logic so that all the interrupts are registered even in multiphase mode. In that case interrupts for buck2 are attached to rdev buck12. >>>> + error = devm_request_threaded_irq(tps->dev, irq, NULL, >>>> + tps6594_regulator_irq_handler, >>>> + IRQF_ONESHOT, >>>> + irq_type->irq_name, >>>> + &irq_data[i]); >>>> + if (error) { >>>> + dev_err(tps->dev, "failed to request %s IRQ %d: %d\n", >>>> + irq_type->irq_name, irq, error); >>>> + return error; >>>> + } > >>> This leaks all previously requested interrupts. > >> I'm not sure to understand this sentence correctly. You mean all the >> interrupts already requested are still allocated after the error occurs? > > Yes, I'd either not registered the devm or thought there was some other > interrupt wasn't devm. All the interrupts are requested with devm, then should be fine.