From patchwork Wed Oct 13 08:16:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 12555073 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0322DC433F5 for ; Wed, 13 Oct 2021 08:10:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D423460FDA for ; Wed, 13 Oct 2021 08:10:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238716AbhJMIMi (ORCPT ); Wed, 13 Oct 2021 04:12:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233096AbhJMIMh (ORCPT ); Wed, 13 Oct 2021 04:12:37 -0400 Received: from mail-ua1-x92b.google.com (mail-ua1-x92b.google.com [IPv6:2607:f8b0:4864:20::92b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32FC0C061714 for ; Wed, 13 Oct 2021 01:10:34 -0700 (PDT) Received: by mail-ua1-x92b.google.com with SMTP id i22so2802584ual.10 for ; Wed, 13 Oct 2021 01:10:34 -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=JGTXDSAS1UocWJHKQgiYxu/UT+Lsyfp559+0GLw/U+o=; b=dgIcK9kGjt0sn3zFj8fskOpPrxTPNwZLiL4xATo+nUm9/AZAFC/Cvml782fMqaZE7f dO1/SubbL6dxM/AZKEYH2ZRKzHEOCGC+e/ie1cuNVMGWzYCdjESfN77wesj15lHHVsev OJXvuHo4gtutcYPEQuAUOCsI/3WG0cd4uvxcY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=JGTXDSAS1UocWJHKQgiYxu/UT+Lsyfp559+0GLw/U+o=; b=U0fdQzwGXLr8oqBv9c3z4UyC8yGNIHnqcnE2M7tqHHuXPw1Km2+vPLCMkqAlQJuAgf PFl4DO7V2+r18ul0csIELU7L0Wcvd8TUNKi2JG3+WJaGkp2CWNwpnOba6hTWfTCvS1ut WXam4+O8w1uEePlcnTnIu6zh7vqTwaVqvNJhQYUQxZ9w3n6CexYfkPt0iQi7cLndMJQh y8NOwLtK97RanrZ9PDElwnKss4OHKrF4RHo8Yb4FZvOHj+BhQYMvcmwedtucEPp3LS/V ToNfDCDICYBqOQ5+aNygDUaj/SP1z+afWzDEp1/bKEkZqD2f8yotMDFSzBLI2SMtv42n KInw== X-Gm-Message-State: AOAM5310RCds/6MRihC4H0NNdbGrKsO7x6+KecSbNzRj69miSzR0Tak4 TWSttbecCaf4l/z+8bCUby0SmZsNnm+YFmZL87JkRK5loCwQnP+c34+w6raQiUxJ57ILwjW4NSj JSdLQOTm80DV7Eq0hQqIo5vK1RUy5qm24rt1gSU3PPmJ//Y9lCaocr11vz70WnkFsE7Oip948xS vvTo+AE2y0 X-Google-Smtp-Source: ABdhPJyRvpVfSJ2vrWzRc18Z4mPFuBlSQju16veilcfYuEw+jMp1Q2M5D44rcmNCF58EDLmlHHCWtQ== X-Received: by 2002:a17:903:124f:b0:13e:25e6:f733 with SMTP id u15-20020a170903124f00b0013e25e6f733mr34033206plh.42.1634112622069; Wed, 13 Oct 2021 01:10:22 -0700 (PDT) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id h3sm6356487pfr.98.2021.10.13.01.10.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 01:10:21 -0700 (PDT) From: Sreekanth Reddy To: linux-scsi@vger.kernel.org, martin.petersen@oracle.com Cc: thenzl@redhat.com, sathya.prakash@broadcom.com, stable@vger.kernel.org, Sreekanth Reddy Subject: [PATCH] mpi3mr: Fix duplicate device entries when scan through sysfs Date: Wed, 13 Oct 2021 13:46:56 +0530 Message-Id: <20211013081656.16494-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 When the user scans the devices through 'scan' sysfs using below command then the user will observe duplicate device entries in lsscsi command output. echo "- - -" > /sys/class/scsi_host/host0/scan Fix is to set the shost's max_channel to zero. Cc: stable@vger.kernel.org #v5.14.11+ Signed-off-by: Sreekanth Reddy --- drivers/scsi/mpi3mr/mpi3mr_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index 2197988333fe..3cae8803383b 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -3736,7 +3736,7 @@ mpi3mr_probe(struct pci_dev *pdev, const struct pci_device_id *id) shost->max_lun = -1; shost->unique_id = mrioc->id; - shost->max_channel = 1; + shost->max_channel = 0; shost->max_id = 0xFFFFFFFF; if (prot_mask >= 0)