Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp931914rdb; Fri, 20 Oct 2023 03:57:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzxjArvajZujGrm0DEerFA+p2AsOAiDF3CXVwGVTnl01iptluQqQoIbZWOlGkhvb+Yp/2x X-Received: by 2002:a05:6871:722:b0:1e9:8b12:89aa with SMTP id f34-20020a056871072200b001e98b1289aamr1594175oap.26.1697799465949; Fri, 20 Oct 2023 03:57:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697799465; cv=none; d=google.com; s=arc-20160816; b=KDHGDQKMFUPpMSct1FPzR149WIqBfd2py7tuIHmPBnKz1vl80f4dUxGAdN7czAOhd+ tKQQa+fJv4AYDN3VDJgCM5MWqQuR2wkJw4WAbspYIZhzXQBUeS7cU7ZL8i4vs5XqVdEI nu0nI7MGGQd52DoB6NMOVf3F6N7Xy2Ubv9wRwlyyPJrM+9bH6goO/TDwrhaOQulX4vpb fpg6f/GukfdI9Ihahhf3XAfJYuKNtput0eQxqElTDHyCnz4vE8PPzDoNm+0W2nCjklqf nOVCJrpmXJaGLvfeKG9LjqXCzKwwZ5U7PBZV71VciObS38hSyl8ypbdXxvdfPIEnet1t eJ+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Imp0xFQ/yJOyVxr8PrpKhW4JYo+eLZzmDsYbFLZ1k+s=; fh=5XTnUzlQXsGVkho5v3w8+4MESdUzxSMTWxIXgidQgXg=; b=GJsQkh273bl9ht0qA8yEyFnMpIvwpys0qPx0to73sHrJDaIcNlenZK5e5ITpzE3o4w 1Yx+Ezr77X/KSSNg5IecasOCFmkPyBHebWJQLUmEzK+cgLS5YEmwQGc5SN33m8/q6w1Z Trrf5FrLScYgqNDUGrqVrlF+JecGM9qK/+aWYOcOZAICRMTb7Jgvl3ixZOivNRAaw1L/ /S4HCvFhzN/KzN++zref1nBGexWYwmTRb0Yr99LZRKEZLjrRbp6CTnIyMOLf3uOwiUKD rL7Do4eTxrwTrrdeFvpcLcgW6KrPNtmT/Et6b3FKtgpq/I38k20uokJL4OI0q/hZJm5v jhDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pkonPC9i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id x189-20020a6363c6000000b00578ea9a0b93si1606522pgb.890.2023.10.20.03.57.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:57:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pkonPC9i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id E230D834A9E3; Fri, 20 Oct 2023 03:57:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377153AbjJTK5a (ORCPT + 99 others); Fri, 20 Oct 2023 06:57:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377161AbjJTK5U (ORCPT ); Fri, 20 Oct 2023 06:57:20 -0400 Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com [IPv6:2607:f8b0:4864:20::c29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCA4B171A for ; Fri, 20 Oct 2023 03:57:01 -0700 (PDT) Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-581edcde26cso363645eaf.1 for ; Fri, 20 Oct 2023 03:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697799421; x=1698404221; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Imp0xFQ/yJOyVxr8PrpKhW4JYo+eLZzmDsYbFLZ1k+s=; b=pkonPC9ijxgQN1day7EynnL1wLxfp5i3PeQGzUJN4TzXkS3VO4RpM2L1OYNgPiMQwN ntr+NYeHhcOZsSLpTWQru+zL+uiXM8p/hzYrTDWuYWDJD5r/f2Onutpf/927mGH3Oram TyZO7LhBHdpNPtBx00in+HUWvamtWv+f9NyCXv2wci6mfYEziixr4Bi8hCY0L5Pq6FW+ SahjlpEG0yiG+IYH3b+DFv2dRVBeP9U2JME+LZghab9WcMslgS63j1i1GqO3g2E2zmy9 u+R13NC0vt8ggZKzaRF9KcwglVS2Ev2BP57a1WAR4Sr8ziKMEgaknL9uC35+oRVJniJf kACw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697799421; x=1698404221; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Imp0xFQ/yJOyVxr8PrpKhW4JYo+eLZzmDsYbFLZ1k+s=; b=t4Zqg3jcavnnlM1bCyIcFUsldsUFKnp1Ba5xLBySGOZN7FwVHT7mrhwcMWMe5mQru4 ZaegybO3vIavpq1rTwf+hUTTf7F0ZKQUhZxm7j8FepYwoDSOZ87njWMMSFDCPJgdDiKe eqIvg4pIr8VEchIfJFnWA8la7SDd++6MLC8HO7OnlDMvLNFwFOAPdKLe4dz1SC521yPj 3s6cqpqcv2UXf4tV6LOOiYhNgzWni+9zKJXAAPE0U3GmMWfLeDVVSXrxYsT1Ud0ZoUtk FnWUQ4JOyr5ZlqH4VjOa3rZ4cKzYK5GU9X6ERctWVGX5nnYBhx25GnFdY+v9DxT1lPzP VoYw== X-Gm-Message-State: AOJu0YwlXk/7mspTHF3NwQPestr+qWI81xlb/CpRonRbmBGyheIRQr0p lbslCsXAXiawCrul6GjwxqxZvA== X-Received: by 2002:a05:6358:50cc:b0:157:a791:53cc with SMTP id m12-20020a05635850cc00b00157a79153ccmr1362170rwm.32.1697799420917; Fri, 20 Oct 2023 03:57:00 -0700 (PDT) Received: from localhost ([122.172.80.14]) by smtp.gmail.com with ESMTPSA id k25-20020aa79739000000b006884844dfcdsm1263112pfg.55.2023.10.20.03.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:57:00 -0700 (PDT) Date: Fri, 20 Oct 2023 16:26:58 +0530 From: Viresh Kumar To: Ulf Hansson Cc: Viresh Kumar , Nishanth Menon , Stephen Boyd , linux-pm@vger.kernel.org, Vincent Guittot , "Rafael J. Wysocki" , Stephan Gerhold , Konrad Dybcio , Manivannan Sadhasivam , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] OPP: Use _set_opp_level() for single genpd case Message-ID: <20231020105658.4zjfuiawwyrtnssu@vireshk-i7> References: <20231020034547.suggwoefx5kauek4@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 20 Oct 2023 03:57:42 -0700 (PDT) On 20-10-23, 12:02, Ulf Hansson wrote: > For the single PM domain case, consumer drivers are often not able to > use dev_pm_opp_set_config(). That's because the PM domain has already > been attached from some of the generic buses, through > dev_pm_domain_attach(). > > In this case, as dev_pm_opp_set_config() ends up trying to attach > again, via dev_pm_domain_attach_by_name() it would receive > "ERR_PTR(-EEXIST)". > > Or maybe I didn't quite understand your point? So the thing is that I _really_ want to call dev_pm_opp_set_opp() for each OPP we want to configure, primary or required. For example, the required OPP may want to do more than just performance state and we aren't touching them right now. Now, in order to call dev_pm_opp_set_opp() for any device, we need a device pointer and an OPP table associated with it. I can take care of it for the multi genpd case as there are extra device structures (which we get from dev_pm_domain_attach_by_name()), but there is no clean way out for single PM domain devices, unless they also call dev_pm_opp_set_config() to get a virtual structure. This is why I had to get this hackish code in place to make it work with the recursive calls to dev_pm_opp_set_opp(), where I could just reuse the opp-level thing for the primary device. How do you suggest we take care of this now ? -- viresh