Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3489795pxp; Tue, 8 Mar 2022 15:47:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzcOLo77Cyz5+zPJexFhAJcJo0RytZl+Cr1QBqLfMejVp1cIYTkTeY+AAAOzM+LkBnYmqHt X-Received: by 2002:a05:6a00:16d6:b0:4bf:325:de2f with SMTP id l22-20020a056a0016d600b004bf0325de2fmr20877776pfc.7.1646783231776; Tue, 08 Mar 2022 15:47:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646783231; cv=none; d=google.com; s=arc-20160816; b=vXk7KsuFtXTYz6KStpJ7/XCSqS4vLq30dkj7P6O5kjPOAHW+7uj5yIbT/auDhHllaT Yzz8k2Vz3FUUGgwnCp3qma29QfIJLwymuLFpAsB5M84NMuhk4K3TtptqCsYVTGxeIX2Y Ci08+wyqLw+PJbsKHCcxdNG+D/jDFBAzwIrC4Kk8kQvZnW30uUvk/0U4NpVFCJUhi9j3 Q1dgjwqw331ZvXJQjIxoPSTnIo6r1CgHemdEmunOcB4kKsWYKu73Ry1I32vqmC1AWALq EqFwXxFEJ6SePaJ69ZnFNnmfsgQtL+t0xSQ/5v+fIttZKwFJjv9bZZPrn7l0UGieD7Y3 ZGyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:mime-version :dkim-signature; bh=dr9s0/aBCglOTnR8EG3bSxaTvIl2jybWyOsb5Ha4FcU=; b=cBFnujMl6aUbb/rRG+lLOYAXzJXn5B5VpUwv+O5Us1BOkgWEAIv2/vHh4Iv80Kj25J hRaqBS/WxqdTdmfv6sHEhEM3uCYWp5elqzAfGas20HMC7XoyfbtQPv/cbGByI9/pxVsY ir4LXeG2cLsqqIOwAFcKCB8ySF5EhHFZ7LQOwwYgpo2e2lrtmOF9yl0H77Id9f1enB6p z0MxQQxpFxsnwFHBeSzX6shQm+n58NmnQFJlBqPcdsWMKHF0BjHAZAi+v6sxIdTStoyj VjsrCSypZHVQReUJn7wCTjbVuXju3kN0EZDyz1ZdblcIrq9JQ/1yIKHnRnH0S5K5GPcZ loOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PSkaBDSc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e5-20020a656bc5000000b0037523228ec2si254250pgw.303.2022.03.08.15.47.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 15:47:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PSkaBDSc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6DE92C2E66; Tue, 8 Mar 2022 15:28:12 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346726AbiCHMSs (ORCPT + 99 others); Tue, 8 Mar 2022 07:18:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235162AbiCHMSr (ORCPT ); Tue, 8 Mar 2022 07:18:47 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6692C24090; Tue, 8 Mar 2022 04:17:50 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id m2so10927822pll.0; Tue, 08 Mar 2022 04:17:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=dr9s0/aBCglOTnR8EG3bSxaTvIl2jybWyOsb5Ha4FcU=; b=PSkaBDSc6grc6PHIEsor63W0fjW3myNhfSTd6Li5v2oYVoT9oAVdfi/xaBzdZGEDIE j6RovrxKJjj7RZUvqqJIe8/CQ5PTFbFKU2H4FDXkplqhc1AWHsigaZHmdUk2h/1tyHyu sWocJccy9EgKPU8zDWaST/iX1CCTGM0GRsaVMuq7+V7k5wvaF+ydROOeRyAm5x4LZdlA uTFhr1hspElL8g1HiPOYFNEqG6g33Z3frdiHxA0ANBMf4G4RlYiWXLzGo63VxqT1Hp4B AIbSwRAFFgfmmlRLoM2bU+3VxaCa7HC3kxCJr7SzZqf2wCwIWJcZtSiajLZJ/fEngN1D jG4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=dr9s0/aBCglOTnR8EG3bSxaTvIl2jybWyOsb5Ha4FcU=; b=PQGhJZJ2lL2Jx7hOWxAzBV4+3j1b59L+4IDp8qz7fdcUAZE2WfpmW0JpIkStuBLmi2 CZHqvabVqP0H6skI/E9IqbaPmOCwzHlEeJPtAPeH/pZcpQtJUkAzXMzP3MfsNTtV0i9k WpPupgowSpBK/t3D7W539hFMDWjifrYxo/UDSlADqW/2z0yuvCV0U/U+uWfLx5G5UIzD upGuH7WbXJn3QtYW64y17aQPz/Qp5QlfWMu79IGMZhDBZSVfv+miM7JmR6AArXGFbAyk Bb5rYSxjhAJhch/WJhvOIp9IAu/bvf4smTnlC7Cxt5LZjsoxrL2SzlhTn34wmffK9PXd y4Pw== X-Gm-Message-State: AOAM531Ys7lQH9vZ1WeSJtbja4rNHCirBTCxFySLhG1QchHdWeeGTJxp D1UeSgyiOtYfwpKD2a1u0gJH86qDlcABlHwHBA== X-Received: by 2002:a17:90a:5407:b0:1bf:43ce:f11b with SMTP id z7-20020a17090a540700b001bf43cef11bmr4291512pjh.31.1646741869517; Tue, 08 Mar 2022 04:17:49 -0800 (PST) MIME-Version: 1.0 From: Zheyu Ma Date: Tue, 8 Mar 2022 20:17:38 +0800 Message-ID: Subject: [BUG] scsi: sym53c8xx_2: warning in ___free_dma_mem_cluster() To: willy@infradead.org, jejb@linux.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I found a bug when proing the sym53c8xx driver. When the initialization process fails on sym_find_frimware(), the driver frees the related resources, which cause a warning in kernel. The following log reveals it: [ 3.736968] WARNING: CPU: 6 PID: 1 at kernel/dma/mapping.c:528 dma_free_attrs+0xf1/0x110 [ 3.737503] Modules linked in: [ 3.737503] CPU: 6 PID: 1 Comm: swapper/0 Not tainted 5.16.0-rc1+ #31 [ 3.737503] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 [ 3.737503] RIP: 0010:dma_free_attrs+0xf1/0x110 [ 3.737503] Call Trace: [ 3.737503] [ 3.737503] ___free_dma_mem_cluster+0x18e/0x6a0 [ 3.737503] __sym_mfree_dma+0x2ec/0x740 [ 3.737503] sym_hcb_free+0x147/0x6e0 [ 3.737503] sym_attach+0xec1/0x1380 [ 3.737503] sym2_probe+0x852/0xab0 [ 3.737503] ? sym_log_bus_error+0x140/0x140 [ 3.737503] local_pci_probe+0x13f/0x210 [ 3.737503] pci_device_probe+0x34c/0x6d0 [ 3.737503] ? pci_uevent+0x470/0x470 [ 3.737503] really_probe+0x24c/0x8d0 [ 3.737503] __driver_probe_device+0x1b3/0x280 [ 3.737503] driver_probe_device+0x50/0x380 [ 3.737503] __driver_attach+0x416/0x580 [ 3.737503] ? driver_attach+0x40/0x40 [ 3.737503] bus_for_each_dev+0x10d/0x160 [ 3.737503] bus_add_driver+0x2f7/0x520 [ 3.737503] driver_register+0x2e9/0x3e0 [ 3.737503] sym2_init+0x16a/0x1fa [ 3.737503] ? pqi_init+0x174/0x174 [ 3.737503] do_one_initcall+0x10c/0x260 [ 3.737503] ? pqi_init+0x174/0x174 [ 3.737503] ? do_initcall_level+0x133/0x133 [ 3.737503] ? parse_args+0x19e/0x940 [ 3.737503] ? lock_is_held_type+0xe2/0x140 [ 3.737503] do_initcall_level+0x103/0x133 [ 3.737503] do_initcalls+0x46/0x76 [ 3.737503] kernel_init_freeable+0x292/0x396 [ 3.737503] ? rest_init+0x240/0x240 [ 3.737503] kernel_init+0x14/0x1b0 [ 3.737503] ? rest_init+0x240/0x240 [ 3.737503] ret_from_fork+0x22/0x30 Regards, Zheyu Ma