Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1058649rdb; Wed, 24 Jan 2024 03:46:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IFaYSzXcXs6XhbLu2K+9yYYOVSQI2TU5kyoH0QzuLIdMxMLBq9NYZsMeUy6vUWaFvzsk3vO X-Received: by 2002:a05:6820:1a56:b0:596:3aaf:3eca with SMTP id br22-20020a0568201a5600b005963aaf3ecamr1034883oob.18.1706096779615; Wed, 24 Jan 2024 03:46:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706096779; cv=pass; d=google.com; s=arc-20160816; b=AbG4Kn8MejMODHV6YG9LSEBu2AjuJ1cvfSnpLQ1nQwWxJ/LABencNSJncwU5sQ8pjx r1ebXnvs7a3gyh2NqzALiLHiCuQhzY5ysVf2jiV9HI6HCSyRu6GiixoMrRyhK+El+vm6 BlSM+NGMWxtZWLrI5SxaXSTUBaswIyq510d9e9S2cOo0xzDcWhDY8tEc1MpGefik2G01 RZBCTY3lJxXks5+I6hVmP5pPW0g3A1GUOqdtBAbscNC87/lkBcZu1J4zhGznGh3grraj 3bFjd9/wxd/dR7UWhJPeeT1MESiuwBdCoMbFwPtDj6lp/hZI22Drj7opPeV6j3qVd3yS br/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=kaA2C5PYtumt01jPaH2L+2eGuFjEsntK8inT+e3/Q88=; fh=g22iwF/tQ7KEyU2Eaaz93BAqdBRzkhxRXDKkS7gYmyw=; b=vlh/SVCy0LV3vqyXlZ4j4SrcIp6ByYJWoYRHxSWDDy21PR8ndKshgx1hq3hezR2Y0X 9bA81uYQ4pl9wUBCVuZ7i166tztybBtOvfHQYJCxzK1GwxDfaYgWw0Xp56VlDdecuZTV NdgaeShw52hL/OOD4QLa97emVk88s1qL+HCYiVdUXXTSiggwb1tlQK+eQhW39nj6Gfao ferWN8rIwPzgHqiqb1UBIxiv8u5TrnubexKhraMX4in5WwhRPMBC+1J13UqNRmbs45fd f4BkXxPCQGGpderJdo1xD255WEBJEinj9/H5uSZ6ZiDL5FRWMoJsMU27APsZGTnrjIQK 2KNg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BRlvjSSp; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-36841-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36841-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id n7-20020a63e047000000b005cf8d935c1bsi11619507pgj.786.2024.01.24.03.46.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 03:46:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36841-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BRlvjSSp; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-36841-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36841-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 68FABB21DE5 for ; Wed, 24 Jan 2024 11:20:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A61051B596; Wed, 24 Jan 2024 11:19:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BRlvjSSp" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 4F4D21AAD8 for ; Wed, 24 Jan 2024 11:19:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706095183; cv=none; b=d4pT3HJYqzeBVzqiAk+JNN7dMTUcFxojAcKGuoy1/nT8UpF0XD9AsjPK8Ul7GzeArzvPNDaAKlxbYtJEpyTNqwXNZX34I6NHou8ecd4PfideMmBFgWTUAHo7V5dkzoEfnKrnWOUGT5fNQsfAKLhGc/kjAUKii+mmt/4IUoXaifY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706095183; c=relaxed/simple; bh=ZlHGhgWv/S/iK0qXLDDd+AjHFKwwp6EfyvIOkaVhQWY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eT5sm3ls5EF2L6CEYAM48FJgd070XXVBu1gqxedjIsJhqDWKsZqpnOpoY0sSzy6oM3vchsIfTmXdXd5767TSI5YcDDYgOO2aMsmDscxCIXuaQi+5hrwtdOHcR71vd4HANdbTyr9833MNOGJxy7/O8Z3KCEciZn3ASKfO157kYSs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=BRlvjSSp; arc=none smtp.client-ip=170.10.129.124 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=1706095181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kaA2C5PYtumt01jPaH2L+2eGuFjEsntK8inT+e3/Q88=; b=BRlvjSSpUGe0W674rHgQHvwHH5lHul/+DRxtnB/BtQLqaJe3ANusMpKSAGzpNJRqmHrkTa BI/k4UdGTrIkAAY1AvY0rthbu52g+M46t6UQ5K1He06zfl+eocnp1ycVxe05cyUMwtX7MH W68P1wi6UoRFbwW+ocsk5Cm2XOSHPkY= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-395-CVTuqjVuPkee69zOqPbDfQ-1; Wed, 24 Jan 2024 06:19:39 -0500 X-MC-Unique: CVTuqjVuPkee69zOqPbDfQ-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-68517c60b0eso2771246d6.1 for ; Wed, 24 Jan 2024 03:19:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706095179; x=1706699979; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kaA2C5PYtumt01jPaH2L+2eGuFjEsntK8inT+e3/Q88=; b=NHhogPOSfrTfhGUCwBP4yeh0BXB6a07O8A5K8sjoZGJTLkiqU08QEvAIGj2Bx7/WZz u4eFshnmvbo51ERQt7fSQ5+QM1z4RtpVETnkYl735jfHjG3nIFcNgOOODwDVMM9zDBsz UINAL67CBWGjiLEl2m9DG5fhkbIx3QoaWCXAF6Fi018MdkUT+ForTFyn5wUstAsdY5DW msKkWZoHm3yCEAmYKIrZlx+Tp8yG2U+6USPCpnpa10Lu+UoHZ/6ZsjH8XK/ASOPvbegJ h+pZWSgOgpV76n6jbv5azLNidBxg0tmikZaySmJgbslagvtOhCkkhPJQ/ZftiWOcA88H yf3A== X-Gm-Message-State: AOJu0YyG66wOrmtyYntK+PCUwxEC0DT0ALRlwbM10P6+EqoD3kIyq6EB n7/dx8ka0shHOWvQWBrHmXBWGsftyo0ePX+6Sy91kdi5Ouxko1H15SSKdnS3KKiJhblOiBojuxi FOvRXimZ37913p8aW7T+X5G9m5eEh4tJmsj4nGVea6Ubly2OS/KfQZu67TPoO7Q== X-Received: by 2002:a05:6214:1d26:b0:685:2465:5b49 with SMTP id f6-20020a0562141d2600b0068524655b49mr1899682qvd.5.1706095179185; Wed, 24 Jan 2024 03:19:39 -0800 (PST) X-Received: by 2002:a05:6214:1d26:b0:685:2465:5b49 with SMTP id f6-20020a0562141d2600b0068524655b49mr1899657qvd.5.1706095178867; Wed, 24 Jan 2024 03:19:38 -0800 (PST) Received: from pstanner-thinkpadt14sgen1.muc.redhat.com (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id ql3-20020a056214540300b00686aa6dbcbfsm1027016qvb.81.2024.01.24.03.19.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 03:19:38 -0800 (PST) From: Philipp Stanner To: Laurentiu Palcu , Lucas Stach , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: NXP Linux Team , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Philipp Stanner Subject: [PATCH v4 1/2] drm/imx/dcss: request memory region Date: Wed, 24 Jan 2024 12:19:04 +0100 Message-ID: <20240124111904.18261-3-pstanner@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240124111904.18261-2-pstanner@redhat.com> References: <20240124111904.18261-2-pstanner@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The driver's memory regions are currently just ioremap()ed, but not reserved through a request. That's not a bug, but having the request is a little more robust. Implement the region-request through the corresponding managed devres-function. Signed-off-by: Philipp Stanner Reviewed-by: Laurentiu Palcu --- drivers/gpu/drm/imx/dcss/dcss-dev.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c index 4f3af0dfb344..d448bf1c205e 100644 --- a/drivers/gpu/drm/imx/dcss/dcss-dev.c +++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c @@ -170,6 +170,7 @@ struct dcss_dev *dcss_dev_create(struct device *dev, bool hdmi_output) struct resource *res; struct dcss_dev *dcss; const struct dcss_type_data *devtype; + resource_size_t res_len; devtype = of_device_get_match_data(dev); if (!devtype) { @@ -183,6 +184,12 @@ struct dcss_dev *dcss_dev_create(struct device *dev, bool hdmi_output) return ERR_PTR(-EINVAL); } + res_len = res->end - res->start; + if (!devm_request_mem_region(dev, res->start, res_len, "dcss")) { + dev_err(dev, "cannot request memory region\n"); + return ERR_PTR(-EBUSY); + } + dcss = kzalloc(sizeof(*dcss), GFP_KERNEL); if (!dcss) return ERR_PTR(-ENOMEM); -- 2.43.0