From patchwork Mon Jul 26 11:54:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 487198 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=-18.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,MIME_NO_TEXT, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 40831C4338F for ; Mon, 26 Jul 2021 11:48:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2573360F38 for ; Mon, 26 Jul 2021 11:48:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233451AbhGZLHo (ORCPT ); Mon, 26 Jul 2021 07:07:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233570AbhGZLHl (ORCPT ); Mon, 26 Jul 2021 07:07:41 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B3AEC061757 for ; Mon, 26 Jul 2021 04:48:09 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id n10so11353802plf.4 for ; Mon, 26 Jul 2021 04:48:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:mime-version; bh=VCYyoAV3bMIz1OuGDYFczYhys8rL7kYCMHI9ZyJaboA=; b=GxJYk2RPwsCaWQeO5ZKvm+yIjLjtNyJV9twkel/YYtfEGJXVB8vzSlYvveUOCJpQt7 28h5Bd+faC7Y+xVLdpvVHWQTywcrHbje5KWltmvUuoD5XZJeGS8mZLkE37/2UGTQnfXf tQpWFGfAwfMCGXk63tHvCemaZJcHkE2Cx1YeY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=VCYyoAV3bMIz1OuGDYFczYhys8rL7kYCMHI9ZyJaboA=; b=MtDogAQkQtigzZ55K5NdfDQw34MIu2oPd+kXczmKAdXv+8c4dxFBhAHojwJ97gV01I wHnbDm8YHQkps8wsg/hjWrc6rJQ1vZGXpYV+wBuXg/TRuUlX6I2pwEWQKHJx1RXZ9SV0 JvBahn1dyUkTFxnSCAtTr+UxucbKqRrnFh3T7KPX2jvV02DQqxrvXsL9eCND8TNFjoqj 9+iEAinhSJNlnescvSMbhBufHF5yEBy+VqI3F8U9E8Ng4yEQ3kEnARwMg6IaZXM+2NOP ZE4HxW9Rdcrohny167jZcKjn+rtsW6pzTnx4w2bwSNTSNaiqEE8fjYmIaumIobC34oUm tGBg== X-Gm-Message-State: AOAM532tyndZtd0tntGDn/pBJ0TzPq+ZnI6RbiuWDm67M4kTTNjmDDwX getdiSV0dKvyfQ87XYnNPkxdqGgt2ecZlHnMcbmOnjTvaCobrxLW4GfA770d0lvELOD669chB7v egYTuXjEjDMt9yl4DBeDZ/uZgFb9gu/8fLRX911yKLUvpw9t9Vj+t9atYDxTCn/yNtIgXONhDTo GX9PDvPGagMHY= X-Google-Smtp-Source: ABdhPJzTO103eHt3n7ivFixhxKiMwyPw8Jx6r84oJxVM4HFNI/Ss8NtqmdXEW3xKx+dpo6bVWMPzsA== X-Received: by 2002:a17:90a:688f:: with SMTP id a15mr17064231pjd.84.1627300088536; Mon, 26 Jul 2021 04:48:08 -0700 (PDT) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id g9sm44042329pfr.133.2021.07.26.04.48.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 04:48:07 -0700 (PDT) From: Sreekanth Reddy To: linux-scsi@vger.kernel.org, martin.petersen@oracle.com Cc: sathya.prakash@broadcom.com, thenzl@redhat.com, Sreekanth Reddy Subject: [PATCH] scsi: Don't print target alloc failed print for ENXIO Date: Mon, 26 Jul 2021 17:24:02 +0530 Message-Id: <20210726115402.1936-1-sreekanth.reddy@broadcom.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Don't print 'target allocation failed' message if the driver returns -ENXIO error value for target_alloc callback function. Driver returns -ENXIO value if corresponding H:C:T:L entry is empty. Removing this print reduces the scan time if the user issues SCAN_WILD_CARD scan operation through sysfs parameter on a host with a lot of empty H:C:T:L entries. Signed-off-by: Sreekanth Reddy --- drivers/scsi/scsi_scan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index b059bf2b61d4..5b6996a2401b 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -475,7 +475,8 @@ static struct scsi_target *scsi_alloc_target(struct device *parent, error = shost->hostt->target_alloc(starget); if(error) { - dev_printk(KERN_ERR, dev, "target allocation failed, error %d\n", error); + if (error != -ENXIO) + dev_err(dev, "target allocation failed, error %d\n", error); /* don't want scsi_target_reap to do the final * put because it will be under the host lock */ scsi_target_destroy(starget);