Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1220026lqo; Sat, 11 May 2024 12:50:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV/Re4qO0ff8h7fcml5SMOzdTeZuzIIuEp8ZWKEa+GxXfEi/BI2htV+wWBrwpHv39/CaSK3Vd2wDTs761YYmPJA2EytjN/IrvssoOxGfA== X-Google-Smtp-Source: AGHT+IG4mQlDpCA/W/EIZw7oi4a6GXWWjuNwdgrzieYGFBH9MamDEL4ZWcAoSoSLAjdutM3WWHe+ X-Received: by 2002:a05:6a00:2e9c:b0:6ed:41f3:cd06 with SMTP id d2e1a72fcca58-6f4e0298a79mr7822009b3a.7.1715457021867; Sat, 11 May 2024 12:50:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715457021; cv=pass; d=google.com; s=arc-20160816; b=dcl1mo+mcrDkgYJyWk+1KQbhPD6gwndLRd+3m6xr7Gk4PG4Uh4mfSnknzK76RkJG8l 0y1Y1yynnGvgef03rfAReDHDOARE56Rr/JYbdHi2DsMCUX+M6hLwGnvdcCkvMYtf9uPs k5EZ6V87A7CF0uHAfY4YjhChAQLxnSXo1o1xW1T5rQRtX5/2wYzNg0+jnZqt7IxNFKAK 4e376q7hP/jZSBzbZ7TflQ6j3xo//LUSL1I/Tn+9TZsZ/3z9/a0J4bDXljK9Bp5vkWzu 9HQSGwuZLEB38fgK1Hiqr4ynX8k9SbYOGt71rmxPeZ8vXWyuBuD15I2sSoyN+zWs2kuD PRIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=F3s0BYtwV5QP2poIgqh39ZmRBGGeeft/DMBZxm9dZ+c=; fh=fPGN2RRUuLQM58AU2nNCQNOOyTtCvx2a2VcaX1IcN48=; b=vEbESGXszR89DifsuQabS4KCr3zzdSLu5X+tG2FTydswWgEb5y1RzoqTtQUykeGhW6 Pgis7scjuLToWaKMgIKfRJFfdUSLGd7WtAoLRYAxzst28+Z+uSnR/2fJj+u/COkCi4V3 7liTPiLxKvpecrK4n5taYChVKsHnR/ggpZgX7gise7Nq9W9BYqHY6Z0GnrKcJkRw0I1z 9h8ULZpoN4eoWWC733DcAg6Tds0RXvMCU6fDwH8x3OAbOWMWGTcERtYiy3zz68Zdk8t9 56nCuPb2qrMCdznFMD7tQ78WVfFxAhrRVkXui6WgepmXkbRY3IfM8lRbe1bTv/FbJxl0 iDXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UarpGMWe; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-176716-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176716-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-63413d72e88si6089461a12.855.2024.05.11.12.50.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 12:50:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176716-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UarpGMWe; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-176716-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176716-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 7FDB0281D12 for ; Sat, 11 May 2024 19:50:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 131B32032D; Sat, 11 May 2024 19:50:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UarpGMWe" Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B10CE57D for ; Sat, 11 May 2024 19:50:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715457014; cv=none; b=A9ICdLgyMn8Vs2M9QXigCQdDbm1fAmYANgdB5nhCn/rrhaI+IvlSULgeNdDf2Plp5hTflPYYT7syqHcIEeYKMSn5jrm7WDom77hPwOmKeWXJmJElIhaTzsgQlWnADOMopkAT9OT7GEOtA3PvIjD+o5i+b65TqMJv4f9q4o566bM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715457014; c=relaxed/simple; bh=msAa4ThmS8hfyYYGhv7dJYNyuAiFPDgAPlDKrrH68wE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=szXu3UnxZbcjOfH1cl76Sr/HL/dOQhsW9woplJQ9oHDOYjYGF7TKCjZoeNFnQ+LUPWHaeuAmcs9N6RAc0GkQeQ22HAk9Sj92jPF7GVPA1HHLByhSI9wVNzm1QDqm9Rn+aWFEv8ERVR78uXAa43CWtUhRr0G3BMqaoZaDTmkKRzg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=UarpGMWe; arc=none smtp.client-ip=209.85.219.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f177.google.com with SMTP id 3f1490d57ef6-de462f3d992so3280993276.2 for ; Sat, 11 May 2024 12:50:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715457010; x=1716061810; 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=F3s0BYtwV5QP2poIgqh39ZmRBGGeeft/DMBZxm9dZ+c=; b=UarpGMWenC64SyI18dVsfmSUsmA6ux3QGhmPJ0gYkbrqnvs5Lbs1Xl70BS6JYamykJ +tArF1BPEY66iZiWLWzlh51Ksgu6o0lLyPecNpN23ve59P6KfvHZGA4JjMfAkw8LZFiT qv5MJoNmdaYHUV/54L5p2vNsxewoK/NFx41yp9mq3k/funBNqLFsNEag7xIP/FHZ9lvf C2wjgjtzl8yMfVEC3HlzLzdesQHRH4ZwhPsCm3bk7Tjseljr58MrRzc0/+C+ZvvmfcCb eBN0rZEveVMzDBE0neBq2RUblRvqbnscRqVQmU6UITj1jF1g1Aa8NsjUtfSdVH5cQhCr ln5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715457010; x=1716061810; 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=F3s0BYtwV5QP2poIgqh39ZmRBGGeeft/DMBZxm9dZ+c=; b=wH4CH0BFY5DQmRsHfkWER+ZnpfL6nKaxH/ZD8NBfevay3U63hCB/gZyJzkbY24RZB+ SVJ6TTPI1MfcdB8lB4cts4i1wB5EvhEP/Rcg9vGAQvuRUWlpUF+3Vvfj/CQuQ5lRY4Ir 3VRYGWXAEbCCzD8USB4n2UafMLLR0CAgLsBfrGXrhQ6qTIHHwW35arf2X2SBt1VQMCAe 6LvJknppB868ndW+FBmO/APHYUhIYkCfwYoMMYzF7nfE50C3IYLMuEF19safnBSw0rKm KH/jvMemYbHoQu10zfno+c9q+e70IA4xU6Kg7ZAW/hbKenLpbag9pp0xXDSTU7ipSiNj mr3w== X-Forwarded-Encrypted: i=1; AJvYcCWb+YXZ/m0P5iRrgYpTcYydXKADNLTTAftqd2YQL+bAYmzzTpARWLRw+GM1MoP2bo7WJmw/X57k3Q8ByLyMyLTQZa6E45Pweqykitrw X-Gm-Message-State: AOJu0Yw6QX6zkrQ/p+qABBC/4i17ZB7z7BfTZNpLZIhaTWu/P1flCsc/ Jn7Gpy0be1gbXGWa2zyq7gFcv0/iII/Mg4cIAM9Gzg/rocSjrCGEsGXQt2eM8onZeIgAfJm2ENm XL7tZYB/OVmEL2pudMTUjZvbY4vJ+CLQJRe+k1Q== X-Received: by 2002:a25:b1a3:0:b0:dee:5cb6:483c with SMTP id 3f1490d57ef6-dee5cb64977mr4069754276.49.1715457010482; Sat, 11 May 2024 12:50:10 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240511-msm-adreno-memory-region-v1-1-d73970717d42@gmail.com> In-Reply-To: <20240511-msm-adreno-memory-region-v1-1-d73970717d42@gmail.com> From: Dmitry Baryshkov Date: Sat, 11 May 2024 22:49:59 +0300 Message-ID: Subject: Re: [PATCH] drm/msm/adreno: request memory region To: Kiarash Hajian Cc: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Sat, 11 May 2024 at 22:35, Kiarash Hajian wrote: > > 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: Kiarash Hajian > --- > drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c > index 8bea8ef26f77..aa83cb461a75 100644 > --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c > +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c > @@ -636,9 +636,9 @@ static void a6xx_gmu_rpmh_init(struct a6xx_gmu *gmu) > > err: > if (!IS_ERR_OR_NULL(pdcptr)) > - iounmap(pdcptr); > + devm_iounmap(&pdev->dev,pdcptr); > if (!IS_ERR_OR_NULL(seqptr)) > - iounmap(seqptr); > + devm_iounmap(&pdev->dev,seqptr); Is there any reason to keep devm_iounmap calls? IMO with the devres management in place, there should be no need to unmap them manually. > } > > /* > @@ -1503,7 +1503,7 @@ static void __iomem *a6xx_gmu_get_mmio(struct platform_device *pdev, > return ERR_PTR(-EINVAL); > } > > - ret = ioremap(res->start, resource_size(res)); > + ret = devm_ioremap_resource(&pdev->dev, res); > if (!ret) { > DRM_DEV_ERROR(&pdev->dev, "Unable to map the %s registers\n", name); > return ERR_PTR(-EINVAL); > @@ -1646,7 +1646,7 @@ int a6xx_gmu_wrapper_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node) > dev_pm_domain_detach(gmu->cxpd, false); > > err_mmio: > - iounmap(gmu->mmio); > + devm_iounmap(gmu->dev ,gmu->mmio); > > /* Drop reference taken in of_find_device_by_node */ > put_device(gmu->dev); > @@ -1825,9 +1825,9 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node) > dev_pm_domain_detach(gmu->cxpd, false); > > err_mmio: > - iounmap(gmu->mmio); > + devm_iounmap(gmu->dev ,gmu->mmio); > if (platform_get_resource_byname(pdev, IORESOURCE_MEM, "rscc")) > - iounmap(gmu->rscc); > + devm_iounmap(gmu->dev ,gmu->rscc); > free_irq(gmu->gmu_irq, gmu); > free_irq(gmu->hfi_irq, gmu); > > > --- > base-commit: cf87f46fd34d6c19283d9625a7822f20d90b64a4 > change-id: 20240511-msm-adreno-memory-region-2bcb1c958621 > > Best regards, > -- > Kiarash Hajian > -- With best wishes Dmitry