Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp216341rdd; Tue, 9 Jan 2024 01:38:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEWw3AOZzr91jPiPtVkciIc9pWCRlkGhxIdJWWuoYFftnY4siQhOauFciDAL4lnR+BBywGq X-Received: by 2002:a17:906:1cd:b0:a27:6d96:e835 with SMTP id 13-20020a17090601cd00b00a276d96e835mr309203ejj.121.1704793098800; Tue, 09 Jan 2024 01:38:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704793098; cv=none; d=google.com; s=arc-20160816; b=ThMZjnfeMokBIUpIsIsU99nw2J1HOdCjo4+YECts1yPrZd7sXwiFSeLqv0Ps+vZk74 XMd9NqQWUPyUA7f+49VdKse2P90GdXXVVqbG/UtfmEBcmgTARqozxqwUtBKQtiYaV9qo r2JfLViBlqmbmDuK/5YiAFHKOYn9N9vzazECV2XptJAYwn2yZGvqNgQ238y01IUv5hzh /lcJ65AdcPUdX2HPRRWoUw29ux1hO7j+9z0PbmLPsdI3v4orlYso9paPCu+n/GPFVk/j /4JQVlA7btBuygpF6ELLT0WP4z1EJJ/F38jiyB/v9q8w4uNNM172IcnL6/f8DkJXOaMC 5qpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=Ky5q4Lye4xDM1EU7ISSxxpSTjWDC6pdqfZjOsW+ZzgY=; fh=sekf5XfmB3iKqewT83w0Lii2FqNcOJ54HM+RUGOL87Q=; b=N1rt9dKDAFNb7c0H5cyh5H2V1AtluGJtLxA3jgHLgPVigz1CBwqQfnNktYib/9GRRb 0D0WQ6ZCTgT+yPsOtkWOsxwwn3aU859+664yzsr0Vz5qXvm4a6NlkHv+3U3aBM5XrmBs EkoNfOKdqkEnyEICnGCJKXiwy89JDidse5Wus7zOgxFLW21GWsx7/O1lSX6VyGlZKJ5W Qh07zEKlY96Xsr8DET9lUB4s1dbB85OSKjPVyQkhW+9ZHPyX5sFrDpKWr4ogBjfnvYWM gPTJLayVZn6O7JAcS5wEY0iLFQvlhOWU25x1wtm7gjiA1uRJ3ULVdq0uLT0n07Iq6tbe RwFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L+lFp5EM; spf=pass (google.com: domain of linux-kernel+bounces-20674-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20674-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g18-20020a170906199200b00a27873a068fsi647066ejd.30.2024.01.09.01.38.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 01:38:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20674-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=L+lFp5EM; spf=pass (google.com: domain of linux-kernel+bounces-20674-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20674-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 334FA1F244F4 for ; Tue, 9 Jan 2024 09:38:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B2B4C33CFE; Tue, 9 Jan 2024 09:38:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="L+lFp5EM" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0668235EFC for ; Tue, 9 Jan 2024 09:38:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704793082; 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=Ky5q4Lye4xDM1EU7ISSxxpSTjWDC6pdqfZjOsW+ZzgY=; b=L+lFp5EMAHkSe5GhHIXcs3Tv3nYVkO5pjnVtd6zNOg+1HV379WH4At7S95gB73imojxpQ9 lqdnr4hjqopfz+lZv6rzKLJLy7u3GzV174gW34HO21h6tqxWy4VlEVjEDQ80p4gIDSRbPG EfakmV85qIr4L7x5zq5h0iugi2SQgV8= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-504-llCnPQgNNVC6Qc2zUdI76w-1; Tue, 09 Jan 2024 04:38:01 -0500 X-MC-Unique: llCnPQgNNVC6Qc2zUdI76w-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-4299cbf080bso2699111cf.0 for ; Tue, 09 Jan 2024 01:38:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704793080; x=1705397880; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Ky5q4Lye4xDM1EU7ISSxxpSTjWDC6pdqfZjOsW+ZzgY=; b=sYHBqlcQL9RisvoRRu90bH6rH9kOJssiZWXYErxYgZgXuxhkPSH/2BYEgcm+F4bRam j/EPfZvR6WpYto5aeNP89qYlxuumNogx5ird4gZ6Pnstpfp+ajsjFR50X1w4ZeY/6ftY 9yZchtcmu0aeFV7mRqNwN578NfOWposh4yqXzt/T7GJ2GlPm/0WIoLg/O7MXRnHcc0K8 VaADNJbXkfmNHeygb53r4FTrgr3HlhNdWlR4pgzNijhECLTjq2vQjTm3Y3aQovhIyma5 U7phhGi5L1+jT/F0JkouWw0EjnssFCDgwNBZqH36xPLh5GS1bSX4OlSwPYxIeM6zVoJ+ FWYg== X-Gm-Message-State: AOJu0Yw/fqq4BKfx/BQ6KPUQf2M/YHAJaZ76nM62avHK6jkZSBF5M2zS 03NUZAlpD9yIY0NzmShiozPhdOyWMrbIa4BwcYEBqKw6z7BCgLxF/TsqPfJWtbxxSZEApGBIZaf E72vDmBArs9qYt563kMDGt2ZSxyhDe8vs X-Received: by 2002:ac8:7e96:0:b0:429:7bf4:f6df with SMTP id w22-20020ac87e96000000b004297bf4f6dfmr11145563qtj.4.1704793080548; Tue, 09 Jan 2024 01:38:00 -0800 (PST) X-Received: by 2002:ac8:7e96:0:b0:429:7bf4:f6df with SMTP id w22-20020ac87e96000000b004297bf4f6dfmr11145547qtj.4.1704793080276; Tue, 09 Jan 2024 01:38:00 -0800 (PST) Received: from pstanner-thinkpadt14sgen1.remote.csb (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id g8-20020ac84808000000b0042987870887sm708466qtq.10.2024.01.09.01.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 01:38:00 -0800 (PST) Message-ID: Subject: Re: [PATCH v2 1/2] platform_device: add devres function region-reqs From: Philipp Stanner To: Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= Cc: dri-devel@lists.freedesktop.org, Fabio Estevam , Daniel Vetter , "Rafael J. Wysocki" , Takashi Iwai , Greg Kroah-Hartman , Sascha Hauer , Maarten Lankhorst , linux-kernel@vger.kernel.org, Maxime Ripard , Mark Brown , NXP Linux Team , Thomas Zimmermann , Laurentiu Palcu , David Gow , Shawn Guo , David Airlie , Pengutronix Kernel Team , linux-arm-kernel@lists.infradead.org, Lucas Stach Date: Tue, 09 Jan 2024 10:37:56 +0100 In-Reply-To: References: <20240108092042.16949-2-pstanner@redhat.com> <20240108092042.16949-3-pstanner@redhat.com> <404aea6b7bb7874064153044f04f3b8f6fccb97b.camel@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Yo! On Mon, 2024-01-08 at 12:46 +0100, Uwe Kleine-K=C3=B6nig wrote: > On Mon, Jan 08, 2024 at 10:45:31AM +0100, Philipp Stanner wrote: > > On Mon, 2024-01-08 at 10:37 +0100, Uwe Kleine-K=C3=B6nig wrote: > > > Other than that I indifferent if this is a good idea. There are > > > so many > > > helpers around these functions ... > >=20 > > Around which, the devres functions in general? There are, but > > that's > > kind of the point, unless we'd want everyone to call into the > > lowest > > level region-request functions with their own devres callbacks. > >=20 > > In any case: What would your suggestion be, should parties who > > can't > > (without restructuring very large parts of their code) ioremap() > > and > > request() simultaneously just not use devres? See my patch #2 > > Or is there another way to reach that goal that I'm not aware of? >=20 > This wasn't a constructive feedback unfortunately and more a feeling > than a measurable criticism. To actually improve the state, maybe > first > check what helpers are actually there, how they are used and if they > are > suitable to what they are used for. >=20 > Having many helpers is a hint that the usage is complicated. Is that > because the situation is complicated, or is this just a big pile of > inconsistency that can be simplified and consolidated? I thought about that and tend to believe that you are right in this case. The reason being that there'd be very few callers to such a wrapper. We have the functions for doing pure requests and pure ioremaps, so that should be sufficient. I think we can do sth like this in the rare cases where someone needs to request without (immediately) mapping: struct dcss_dev *dcss_dev_create(struct device *dev, bool hdmi_output) { struct platform_device *pdev =3D to_platform_device(dev); int ret; struct resource *res; struct dcss_dev *dcss; const struct dcss_type_data *devtype; resource_size_t res_len; devtype =3D of_device_get_match_data(dev); if (!devtype) { dev_err(dev, "no device match found\n"); return ERR_PTR(-ENODEV); } res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { dev_err(dev, "cannot get memory resource\n"); return ERR_PTR(-EINVAL); } res_len =3D res->end - res->start; if (!devm_request_mem_region(pdev->dev, res->start, res_len, "dcss")) { dev_err(dev, "cannot request memory region\n"); return ERR_PTR(-EBUSY); } And then do the associated devm_ioremap()s where they're needed. So I'd 'close' this patch series and handle it entirely through my dcss patch-series. Thx for the feedback P. >=20 > Also I think there are helpers that take a resource type parameter > (as > your function) and others hard code it in the function name. Maybe > unifying that would be nice, too. >=20 > Best regards > Uwe >=20