From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 433EC3B6368 for ; Tue, 7 Apr 2026 13:15:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775567704; cv=none; b=OdA0OX+Y2PJjeblKjIWaLRQcdNq/PVmFXafe+CE7vkYkdO7V3fcTqXboIWk5fnDp3Ni/wagxjUjVuEqB3QByANukxGnwUQSfbmlpfZNsdbo3zasQ/dCxNg2GAL1YOZTXRwWMxnjnKzJaPEHcyJm6wlVc9O90Yy17waJACB6YMAk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775567704; c=relaxed/simple; bh=DF92KS7lR8TG5SktVvEPsLa9rP8Xq/XSF2frVXwEcDQ=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=TGkLqUivUk38LA3reKRIu17ME3f/R7nuXKd+ooi0FcfhOapwDduFRZ6JOynUJBN91CuUTxpKpzIOn19xzyg5lMb0Gmza8+bitdtAJORPNAixu0iCymsh1sEAlCgTMAqgj4YkRHI7gjngxgEqOBnVVGiQNsaA86bDn0Hxzw6h8kk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MTdbOMJf; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MTdbOMJf" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-43cf7c58bb3so171955f8f.3 for ; Tue, 07 Apr 2026 06:15:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775567702; x=1776172502; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=uJvui/baQIu/txwJ5Ha20q2FY1f9Fze38J+v8nYikoA=; b=MTdbOMJfQ535jCQ+aiD+tMAPmx/VsEXx+6Y0bcx0sIxiTol37cEMuxS6culODqZQca ishbncW9tdovM9HTjasVIE6hCKx17mnpVx6CBUttgtJJESn9EXe2Wf3ruwAmgq3dGn8E DUKLk89UtUZrcq8O9kgqKq51u7HnamzEgce9iIdh3NKsogWIEEVdpVw0oZL52uqdPsOh QJoEwGwXgK6Gjcg8gJ7OnfVV3i1yZNqtc/845lVodh0KqMhRNjYlOcsj2Ti70YYcgYxF vygk2WzLzi9ZmMi4bDgHRAh7NFwB60PCfIae4nuE78VYSMY+u8P9KPCNEChZi+6JYLDE VXDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775567702; x=1776172502; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uJvui/baQIu/txwJ5Ha20q2FY1f9Fze38J+v8nYikoA=; b=bCO1QN1zq6XddkzOSdSmFCCAZR3FK+e0FlJbL9M8/hYlzXwJiwCu65DM3+8Jx6n/+v 4eNXJMpXmySB6WYGFpcS2WhhiWi0PXAYblDIO5p1eaPf4VUR6HZTjF7syhbLZzEGOxm8 0NG/SaRBWvzsP8Tx3mKXQ3s3vpzSJ8TruhEhysJJdQTDELa+VOo2DxlrNdetXIXqrfAT tVn+WFQFjS42A1Ri7XMX5azsaflhiTeVzYBwLoYcwxa4KYEEdcptV/FroZ68JSajzTaH tqmpSDII9f+PmDprcktVwnF1yGVnOi2pZ5CFPYjYJpcQ07Zy+EhJI5MG1Wfp0QfPCx+I sIiw== X-Gm-Message-State: AOJu0YzRJTiP2Dh4aqEQKUUft1w3EiOE2gP99n3TMbIgiySgo6cMgdGQ nuajzVl3t16AYvgNejMpP2mThm/EIW6zAPHjxl6EWEeR8C+VgKAeD6rM X-Gm-Gg: AeBDiesTaGmwuLdYmeStTW8VuMcYcoo+w6ZyKGz5Ljzi+8PkZ2E1ttL4p9xAn2pCcjO eIn7ktb6xPhHWaSo/x3nLi1y1seGGYVyd8T5bBaWpUkQDmgf/r+x2gq79tbPEu+s3biRJNCf0TV yCcdXQpZnOYvOMgnzlH/81BdSMvtw05slJQC5yrU6pi+5Oh29JxNlhijH4vZe+vfiy5mpYjcgG5 8cj0B5i8oQLB3sUy8RzKN2ymv8XbhY1z23GzYLYQux+1Jc2TsyG7xh007DZlVqaWpNeNpUmKeN3 UQ/7G7eXG9x5Z/3vQf3NQ+tsf0juIo2zZqxfWLRhL0yNzwBoPd2JSZpZGnMBGCtDWCAMHgyJghm tu/40/fN17iC5+Or/mdqaoXEbnlYg1IO70hIzXMn6ULMzwX7HtOfqHWG6qlOgcorSCFtFxWCS8N rfp61PZAsf9IWU2VlsEbsydCSTF7B06VJGBQ0blIBFyaER34QQL48LZ/pnHKcXSpDAtQ== X-Received: by 2002:a05:6000:26c3:b0:43c:ff6f:d5c with SMTP id ffacd0b85a97d-43d29262a74mr12097140f8f.2.1775567701402; Tue, 07 Apr 2026 06:15:01 -0700 (PDT) Received: from [128.93.82.131] (wifi-pro-82-131.paris.inria.fr. [128.93.82.131]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43d1e2a6f1esm47942710f8f.2.2026.04.07.06.15.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Apr 2026 06:15:01 -0700 (PDT) Message-ID: <0746a585-710c-4bf0-b54a-41573d56a2e5@gmail.com> Date: Tue, 7 Apr 2026 15:15:00 +0200 Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Thomas Fourier Subject: Re: [PATCH net] can: sja1000: Fix pci_iounmap() buffer To: Marc Kleine-Budde Cc: stable@vger.kernel.org, Vincent Mailhol , Wolfgang Grandegger , "David S. Miller" , linux-can@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260330154236.98665-2-fourier.thomas@gmail.com> <20260401-effective-piculet-of-will-704d4d-mkl@pengutronix.de> Content-Language: en-US, fr In-Reply-To: <20260401-effective-piculet-of-will-704d4d-mkl@pengutronix.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 01/04/2026 12:59, Marc Kleine-Budde wrote: > The cleanup functions in this driver are a mess. kvaser_pci_del_chan() > should only delete one channel, but it deletes all. It also unmaps the > iomem, which belongs into kvaser_pci_remove_one(). I'm not quite sure because kvaser_pci_init_one() allocs and registers all channels, so kvaser_pci_remove_one() should too? > What about switching the driver to pcim_enable_device(), > pcim_request_region(), pcim_iomap() functions instead? I can write a second patch to do so, this would for sure solve the problem. Should I? I have no way to test it. > When called from kvaser_pci_remove_one(), "dev" points to the master > dev, which uses priv->reg_base without an offset, as it's board->channel > is "0", right? I think you are right, the normal path is fine, but not in the error paths for devices with channel other than 0. Regards, Thomas > When called from the error path of kvaser_pci_add_chan(), things go > wrong, and in the error path of kvaser_pci_init_one(), the pci mem is > unmapped again. > > regards, > Marc >