From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 1B533D0E6D8 for ; Mon, 21 Oct 2024 09:42:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 706DA10E468; Mon, 21 Oct 2024 09:42:02 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=linux.dev header.i=@linux.dev header.b="jCucMIuB"; dkim-atps=neutral Received: from out-187.mta0.migadu.com (out-187.mta0.migadu.com [91.218.175.187]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1C5DE10E468 for ; Mon, 21 Oct 2024 09:41:59 +0000 (UTC) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1729503717; 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=S6l9K0VABXE+0LeImmfqPp/nt0looAfEbAGIBgXZDPI=; b=jCucMIuBRLRE4hZMwwRR9BBJT7sIplWy8LiattcyQH+egx1uMiD9e52iFp1QG3SOcil1qQ gNC+9B25VGIAiHtOFBKlgJw8FT7sh7tbcJoFJPfEpR/vO/XqLc6ABIZ4uqyB0wPzelphwG 8Gl/MyQWxKjOkOscJiOMJi9Ul0/4sKk= Date: Mon, 21 Oct 2024 17:41:45 +0800 MIME-Version: 1.0 Subject: Re: drm/lsdc: Request PCI BAR To: Philipp Stanner , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20241021091116.14368-1-pstanner@redhat.com> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Sui Jingfeng In-Reply-To: <20241021091116.14368-1-pstanner@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi,  thanks On 2024/10/21 17:11, Philipp Stanner wrote: > lsdc currently just ioremaps its PCI BAR with pcim_iomap(). Performing > a region regquest additionally can make the driver more robust. > > Replace pcim_iomap() with the managed function pcim_iomap_region() which > performs the request and ioremaps the BAR. > > Signed-off-by: Philipp Stanner Reviewed-by: Sui Jingfeng > --- > drivers/gpu/drm/loongson/lsdc_drv.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/loongson/lsdc_drv.c b/drivers/gpu/drm/loongson/lsdc_drv.c > index adc7344d2f80..592d01b6767e 100644 > --- a/drivers/gpu/drm/loongson/lsdc_drv.c > +++ b/drivers/gpu/drm/loongson/lsdc_drv.c > @@ -230,9 +230,9 @@ lsdc_create_device(struct pci_dev *pdev, > lsdc_gem_init(ddev); > > /* Bar 0 of the DC device contains the MMIO register's base address */ > - ldev->reg_base = pcim_iomap(pdev, 0, 0); > - if (!ldev->reg_base) > - return ERR_PTR(-ENODEV); > + ldev->reg_base = pcim_iomap_region(pdev, 0, "lsdc"); > + if (IS_ERR(ldev->reg_base)) > + return ldev->reg_base; > > spin_lock_init(&ldev->reglock); > -- Best regards, Sui