Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp939249rdb; Fri, 20 Oct 2023 04:10:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGE8ZA/HA9aCOVOo0XUrmI1Y828c6X1nW1MGYyojZAIk6eGjk2J+GpWqWp9yjyRlzm+YraI X-Received: by 2002:a05:6a21:6d9b:b0:163:11b2:1068 with SMTP id wl27-20020a056a216d9b00b0016311b21068mr1689591pzb.42.1697800200945; Fri, 20 Oct 2023 04:10:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697800200; cv=none; d=google.com; s=arc-20160816; b=f5AkOMXTaggmTD/vN/8NN4u4RKVBrujoF/+lj9yXVHrmz3NeT4MSJhIPfL4uRcytLT Evtt1ID3QkoPZ6DelYM8whfuGYLVwbvY8SdT1pixWtoGTfL6GK4tbNK3krCGhdxSuPEh z2fMFNjJ2nqsZx+syEiFm23VRyys1R3nsPZivJrOAHUOjDPmvy2yQgkGg2G9QJzt9hch G8ZYWCavJKQg4XpUMWG2BL9bHBl1fXJB5Paumbs883mn4UPZbvSiGmA760yYV5sfdoTE BCaDSrfMifOqnzUz0WJp5aerVI/wATxRiUpEHptc1wBvuI2l1EnF6JhyWOIiHJ+KUjz6 uoUQ== 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=1Ar9JWuEzTg4nm/OuetjJgNewztnGTgqrst37S6ZFCQ=; fh=zJJRk5+BZN/TWwsTxHGhtfo1q7KKcftHMHW7XAPRPOQ=; b=byWLQCVLJoC+rOlNUslnWfAYL61u0dmz7FsXIx7SGQlAQtP/k+zJIzuB8B5XTr/hJT mfLGSrVQq0ilocCV/zZhQB+ObS1zlvUPksQecHDf4yyzM1W2n8+2+SHHAV/z4OeGkSkR FvZiLbZCukY4XfIgQmhXZ0yz4uGyVEe6SIontG3XjzlDdTDiAJpD1smju+VFd5ljyTqW pdMBPCiQ8ce9/4xccbWpUtwLaEzZyFp8BSHyvxUnz/YKz3ryCJkBtB3Y6NL+w6yp8k6/ oWvuUPmUCRrDY9O33lwzeIbBw7/r1Nws+IPXH569OSfGcjqfTLyjNl0godHtMvsD6Phv qacA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=efksqlHR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id a15-20020a170902eccf00b001b8a67f1c10si1648323plh.468.2023.10.20.04.10.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 04:10:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=efksqlHR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 8133282DEE5F; Fri, 20 Oct 2023 04:09:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376927AbjJTLJw (ORCPT + 99 others); Fri, 20 Oct 2023 07:09:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376945AbjJTLJv (ORCPT ); Fri, 20 Oct 2023 07:09:51 -0400 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AFC4119 for ; Fri, 20 Oct 2023 04:09:50 -0700 (PDT) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-5a7d9d357faso7215177b3.0 for ; Fri, 20 Oct 2023 04:09:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697800189; x=1698404989; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=1Ar9JWuEzTg4nm/OuetjJgNewztnGTgqrst37S6ZFCQ=; b=efksqlHRQYmnm1fGTWhS97xSeSSUQfnOkQBMNMXjnyIXAbtD4z5F/NITbpS575M2wu AG7Pk0uC/VXIV0mNVBW7WtZFRYDQAFKoFSX/Yh/GYE/5I8grkJt8QC4yRgVtP+m5+Hoz YOpcW4ICx686I7XXfJLEpWKZReJKzP9mGRBXjgTqixOnkDL6AFfKSjK+qYequq5ox+wM ZZWEZQ7dBpZq9nSXk5Lrzg0WsOXNSFEH+IiQb8RmMb/FzDDN6oDrYKMpcewHz7qewrEo Rv4/JIlqff6DC0H+MGj3JH+Srj7yq6QCBM7mAMlbfrMhao9SgIUbmbwYwxfYiAOWvV76 +hCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697800189; x=1698404989; h=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=1Ar9JWuEzTg4nm/OuetjJgNewztnGTgqrst37S6ZFCQ=; b=iQ0iBqdqsmOH4GEy7nEI0X5B9iCiWUjkdVXeoZRBndy+UNoGpNmJA9ILlNhRUoVXqx mIopJSdMy7Gv9eFy5/WF04MApd/3XgqJRDF0usEDCL36IKofxO0I4kY8BGWoFnkL54X8 CkaLzYLuGNJkYlYXkhInH6U+rNR+0yEC+L/rxLZduq7Wi9MFYt0fo7Hj3G9Xa2mRTbcT 0xdYZZItO9VxUJJjupGsDIkxeHHz1NGj6sQHZEXhcCrjc/CLnpHAfEF0DrhxSt0j+e/T 842aa4yfwY2ZOmmH4y4E1FRnNpVhwAZtChQfqaRNSyF4Y2R+dulKJ8DXvnFAvmLm7whG +m4g== X-Gm-Message-State: AOJu0Yxk5enlwCsbdd7uHe8Kmnmdboru/n6cciW9HpKXXwYAc6y3vf13 czQHXdj4PLrmBBuklYAPWnbUPpgN7MiKQdMkps8zOw== X-Received: by 2002:a5b:64d:0:b0:d9a:f0e8:480 with SMTP id o13-20020a5b064d000000b00d9af0e80480mr1156584ybq.65.1697800189328; Fri, 20 Oct 2023 04:09:49 -0700 (PDT) MIME-Version: 1.0 References: <20231020034547.suggwoefx5kauek4@vireshk-i7> <20231020105658.4zjfuiawwyrtnssu@vireshk-i7> In-Reply-To: <20231020105658.4zjfuiawwyrtnssu@vireshk-i7> From: Ulf Hansson Date: Fri, 20 Oct 2023 13:09:13 +0200 Message-ID: Subject: Re: [PATCH 1/2] OPP: Use _set_opp_level() for single genpd case To: Viresh Kumar 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 Content-Type: text/plain; charset="UTF-8" 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 fry.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 (fry.vger.email [0.0.0.0]); Fri, 20 Oct 2023 04:09:58 -0700 (PDT) On Fri, 20 Oct 2023 at 12:57, Viresh Kumar wrote: > > 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. I understand - and it makes perfect sense to me too! > > 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 ? Honestly, I don't know yet. But I am certainly willing to help. Allow me to have a closer look and see if I can propose a way forward. Kind regards Uffe