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 X-Spam-Level: X-Spam-Status: No, score=-7.8 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1885DC54FD0 for ; Thu, 23 Apr 2020 07:37:25 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E4376208E4 for ; Thu, 23 Apr 2020 07:37:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nZzzMniS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E4376208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B1EE96E348; Thu, 23 Apr 2020 07:36:43 +0000 (UTC) Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4F1016EA19 for ; Wed, 22 Apr 2020 15:21:48 +0000 (UTC) Received: by mail-pg1-x542.google.com with SMTP id r4so1247765pgg.4 for ; Wed, 22 Apr 2020 08:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HG3yYEiNc0envK1euxexUufAAl4nbvpE6zokSUWiokM=; b=nZzzMniSbj02OzHpHPqt7kEflsYgvSeEH9cTwn32djvqykD4v7ut2HI16jk3LX5r1m iGJjGN6nX4/mbNsBmDdw0/GVUxyLLmkkigSgSw1+asfeW49OyLUMk/Dt2QmHRTAgKHTS B1kmamcknz9dE0f2mrkp6MSfyryWNo0kaB9qEPmQzlI9ASonUsbSIQSf1XI+oK/44n8+ FxFctYO1yg0MQxAHmqMb+igSj2MkWzVBP2KAG2cplRraTSkWMjMmFTPEuI59rtJ4YIn1 NTPLjH6j4PDkayI4MHAtVfOe0VCbXyJou0UJcCJXkRbUUmTbwVZ9Lqwbh95+amDK5ISD SoJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=HG3yYEiNc0envK1euxexUufAAl4nbvpE6zokSUWiokM=; b=ETtGfLcAbGEkA20fp4XGM23OmRszvnFc+/lxkhV1vXpkKU7A0hUtC4+60jwyDUhRvS yBczY9/37RtMUZwl0Z0cMxwgvhI6lrak2Ub2Ogv/Xm9GnrAWhlQsheTZYx7pSNPwu8U6 pCsZStoxsCrr/hNd4jrEYOUrXS6BAXxB/gtVLiQCvAdv48dmHuRp/WIo3Vyqf0W0Q20Z hfEaQ1K7H6/ShzzucWBx1IU9AjBTGo2LFB8UpJ+w+4jINpDrGokAj5saU7dszCqF5Uu+ 2YzYjCJFhvYppUVykCqe7gPiXesADmkJiqPD9iEO0ACorBwT2oJ67IiFpBx46f+8tbvV edJg== X-Gm-Message-State: AGi0PuZhFsIxLtlXkCFSQL/lvVwH2bv2fcxDjtJ3sHIvF/+9MHSZ+y6Y dxm6jhIM1QAbBgptNxcrVyo= X-Google-Smtp-Source: APiQypLh7oHfDORxCtqZwJwOyMBu9z4t1h/pwGHqNs7EvgsRntlz9Au3nusIGydC3+aAKxF7K73PSA== X-Received: by 2002:a63:d40a:: with SMTP id a10mr25840974pgh.53.1587568907934; Wed, 22 Apr 2020 08:21:47 -0700 (PDT) Received: from localhost ([89.208.244.140]) by smtp.gmail.com with ESMTPSA id 79sm5468092pgd.62.2020.04.22.08.21.46 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Apr 2020 08:21:47 -0700 (PDT) Date: Wed, 22 Apr 2020 23:21:42 +0800 From: Dejin Zheng To: Andy Shevchenko Subject: Re: [PATCH v1] drm/bochs: fix an issue of ioremap() leak Message-ID: <20200422152142.GA26943@nuc8i5> References: <20200421164543.16605-1-zhengdejin5@gmail.com> <20200422135215.GA25950@nuc8i5> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Mailman-Approved-At: Thu, 23 Apr 2020 07:36:39 +0000 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: , Cc: David Airlie , Linux Kernel Mailing List , dri-devel , virtualization@lists.linux-foundation.org, kraxel@redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, Apr 22, 2020 at 05:40:51PM +0300, Andy Shevchenko wrote: > On Wed, Apr 22, 2020 at 4:52 PM Dejin Zheng wrote: > > > > On Tue, Apr 21, 2020 at 08:24:24PM +0300, Andy Shevchenko wrote: > > > On Tue, Apr 21, 2020 at 7:45 PM Dejin Zheng wrote: > > > > > > > > It forgot to call bochs_hw_fini() to release related resources when > > > > bochs_pci_probe() fail. eg: io virtual address get by ioremap(). > > > > > > Good start, although I think the best is to switch this driver to use > > > pcim_*() functions and drop tons of legacy code. > > > > > Andy, thanks for your encouragement, I think we might be able to fix this > > issue first, after that, drop tons of legacy code by pcim_*() functions. > > Do you think it is ok? > > It's really up to maintainer. I'm not the one here. > Thanks Andy. Hi Gerd: I am a newbie, andy gave me some directions to submit the patch, eg: check ioremap leak. At this time, I found that the bochs driver may have similar problems, so I submitted this patch, then, Andy said the best is to switch this driver to use pcim _ * () functions and drop tons of legacy code. I think we might be able to fix this issue first, after that, drop tons of legacy code by pcim_*() functions. Can you give me some suggestions? thank you very much! BR, Dejin > > > > Fixes: 81da8c3b8d3df6 ("drm/bochs: add drm_driver.release callback.") > > > > CC: Andy Shevchenko > > > > Signed-off-by: Dejin Zheng > > > > --- > > > > drivers/gpu/drm/bochs/bochs_drv.c | 1 + > > > > 1 file changed, 1 insertion(+) > > > > > > > > diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c > > > > index addb0568c1af..210a60135c8a 100644 > > > > --- a/drivers/gpu/drm/bochs/bochs_drv.c > > > > +++ b/drivers/gpu/drm/bochs/bochs_drv.c > > > > @@ -138,6 +138,7 @@ static int bochs_pci_probe(struct pci_dev *pdev, > > > > return ret; > > > > > > > > err_unload: > > > > + bochs_hw_fini(dev); > > > > bochs_unload(dev); > > > > err_free_dev: > > > > drm_dev_put(dev); > > > > -- > > > > 2.25.0 > > > > > > > > > > > > > -- > > > With Best Regards, > > > Andy Shevchenko > > > > -- > With Best Regards, > Andy Shevchenko _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel