From patchwork Tue Jan 9 10:20:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13514729 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE7CAC47073 for ; Tue, 9 Jan 2024 10:21:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0HTKJUnP+H5qBBtetw1E69c4h3Vqu7/4yZT2VyDSlwM=; b=aM6agqVuU/lsKo xbg51FSyhZ6GPn86XL7T1Xc0S5iKBL1UCR3rO5sZA9rUkCFcJSZJDxt0STyHdBUyqQTcxh3prznqs oLDrxjI1X239FIDfGbE7feKLlCss0JVz7dwB368uW1PHgG8Z4ytr/VrK5hnDDDpD1xVZjZuME/Sb3 cGD99faEArzIbtOzEb2eiTh1J6jf6uiwJr9/ADWZ+fwGMNGbEyk20V6Kv+QAgakWkRhAFioPBfcGl lP4k1B/WY+k5QwXctw6aeFInZcRwLmT/5uOH1V9Rs+jpYV9f3OIeIGOSXV5ua6lOs/00aGZsCUvzV w46Clqes8PpxzB9kERYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rN9E7-007bmu-1w; Tue, 09 Jan 2024 10:20:55 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rN9E3-007bkN-2h for linux-arm-kernel@lists.infradead.org; Tue, 09 Jan 2024 10:20:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704795646; 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=wy/M3ANrToiVi10PzVfO4hUq8Am1qDGx7AcrnHuqv94=; b=cU6/wYbnryY2YxvswXnZJRHOwJxdyyRxYTXONgkuQQo6gFoppp+wIe4npBrQcez3AZZkVs lTZM9box8n+PXIArf2PS+TLozBhwz1aDhg2I6pWqCnX0UFjd8YNUp7hOAeSTHLbemIvrFd DJ4DKfbCPmsDHMdjR6WUxIl2mmoCzG4= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-593-c02-6D1GPDid8Qk70JTylg-1; Tue, 09 Jan 2024 05:20:45 -0500 X-MC-Unique: c02-6D1GPDid8Qk70JTylg-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-680b74cba78so8063746d6.1 for ; Tue, 09 Jan 2024 02:20:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704795645; x=1705400445; 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=wy/M3ANrToiVi10PzVfO4hUq8Am1qDGx7AcrnHuqv94=; b=lHjnYIpSFFKxHJppJLC4g3KgikyE0Jj+idGQLEpVnbS7nWlcPWKiyVQKBtfmQNXSFe HW9VSwzNBUng6J6gcLiOd27BilUATyYZJSqCUlAS0XSJoSy131Zw3dcwnj416QiNd/VB WOF8uucc7H4lP6lcIc0udEzNnYrZNQHPa7deA9r8eh7OGYymSFhl+WEJ+9qDBCm8XZUJ VJshKlew2iwbwmsWwQq7/OezXInj6KvLEzewPwY31o+ctawaOzUaDVnfEg6Z2Whv2zBa ak7apKfnZS/uekr0EtbOJZXL+0SdMgxCiHEAAnnOYjrZ/x18hEsXvNfWgT1U9fWbCYqs NmfQ== X-Gm-Message-State: AOJu0YzXPEZBzpPuIdR2OKME6nrQuAOBuqxXy+JaRRL3g5tq/k8kLqQJ IyUikjdy41BXBy/OFxd/cw3/CmOy4Z+aMt0oF9jyitdDFi4gG03Ti8l7R04lmnYCUbIFdfuaIk7 BwgLFYCmO9LZ95H1YHOfR4uCZb3xh/CrbgEjA55gXLk8= X-Received: by 2002:a05:620a:410a:b0:783:52a:25a0 with SMTP id j10-20020a05620a410a00b00783052a25a0mr10759991qko.3.1704795645167; Tue, 09 Jan 2024 02:20:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGRJB76EgsOKxHrFXwYwzcFBNOSiztF/miafI4SjzA6CTawNFc6YBCvLUeclZxtDzc8bkApsQ== X-Received: by 2002:a05:620a:410a:b0:783:52a:25a0 with SMTP id j10-20020a05620a410a00b00783052a25a0mr10759982qko.3.1704795644878; Tue, 09 Jan 2024 02:20:44 -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 m24-20020ae9e018000000b00783217607d6sm679695qkk.115.2024.01.09.02.20.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 02:20:44 -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 v2 1/2] drm/dcss: request memory region Date: Tue, 9 Jan 2024 11:20:31 +0100 Message-ID: <20240109102032.16165-2-pstanner@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240109102032.16165-1-pstanner@redhat.com> References: <20240109102032.16165-1-pstanner@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240109_022051_941757_B074A2C0 X-CRM114-Status: GOOD ( 12.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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..1f93313c89b7 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(pdev->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);