Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp218092ybh; Tue, 14 Jul 2020 23:34:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKOSOIFu1F0r7PYK+IO8nBeKK4HHmHyMv9lLgr45xAnf6s51HV2TwxuhNSjOhz+eNtcuOJ X-Received: by 2002:a17:906:2b54:: with SMTP id b20mr7832036ejg.366.1594794854781; Tue, 14 Jul 2020 23:34:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594794854; cv=none; d=google.com; s=arc-20160816; b=U/CYtLUgJXRAhd9p1oNiDHh636YdctGtvbAwpX9Ob4YLzwI4ZCRE6/EaOmEal94Vir dD/SX5LAa8ugRTrkoqs39jWwqDx6AeALbgGsHyr/4V+mQYwWjTQBGuRUgLJCl5Z5hyty VOmj1f/FkTxg0XeBdY4BhQlnypoutavJDWqWEi/TbEJ4wbnsT54kGxNbJqFn1bPinkxf eV99/BvxHWZU4duMNXn7DleIT9JZkHEzsG0jyOmsN4DBe/OcHWPsjicgdl/DGvOED003 EFiReq7b79NF+26RstXV+rV0lA6/8L+sXfCEJw7NAGoBVDT7YTt4OfAB7xKJ2fm115jY zU2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=XltbK9J78KHesM1F1OCc3vXGyhRc9/MBn/JKRUdD08w=; b=ttZm9nhc2RbKn9g5OTYryS5ciYthIRpt6fiCti5CRYH6LgerX0byDi1nndArLNZjXM cGpFUXZvLZsy+CfVs3+miES2qHu3ZUNOh7UY6rZmSLyteKejPvi/nPfTcL5S1XM0IfGl tyelYrJQRIiT27X1x2CN+Lom0G7q+4NJOjv29IA93+wfNPj9p1f7uMoPAkdGkh4csEHc SWZVqP0ZcIv9eDLdGzGBcYxPydjVpiWIt1+SvVY2vTk1yt0W2bZey16nGM6zyseLzLEQ UmPnZYLVsH3c0e2w0FflI9qeB3B5dgWVUulauEk3Hd53fp8ykgHCvfOSFvGpdUAcSQQ0 RCEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="uYCgmJ/s"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q26si651662ejc.433.2020.07.14.23.33.51; Tue, 14 Jul 2020 23:34:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="uYCgmJ/s"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728428AbgGOG3s (ORCPT + 99 others); Wed, 15 Jul 2020 02:29:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725823AbgGOG3s (ORCPT ); Wed, 15 Jul 2020 02:29:48 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10A20C061755 for ; Tue, 14 Jul 2020 23:29:48 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id j18so4120931wmi.3 for ; Tue, 14 Jul 2020 23:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=XltbK9J78KHesM1F1OCc3vXGyhRc9/MBn/JKRUdD08w=; b=uYCgmJ/s1xgjsepLdk/ioryRZvNZTY9AYC2MrIsI8SZN0drSwGjzm65Qzb1lmJCZQn jZ5mzb/8LnYUgU8tbkx3BE+kHu4Vq86l1wujZX/beam+LCPilqImWdE5Q4Ook+e5flkr pu8wSO5mDqhRpIigaGDEVRQGvWzD7RRddOf9LGeficCslERoHuEZo/77MrUusm62rBWu kmw+7srmhY17wTzW7og5M/7p4IjFGdAreXLOg5y9nLgySfUeRlhWnGgq5JDh3NRIELJg fYNhwEvTm79YoOsBhW2uUXKHs1HdunEJMuFka2UAj/3yk22TTzLpfdtxJ2YLWou+vSls SE/g== 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:content-transfer-encoding :in-reply-to; bh=XltbK9J78KHesM1F1OCc3vXGyhRc9/MBn/JKRUdD08w=; b=G3SVPIqwomwj1fQ5Tqmh4KM48u0j6nIP84NPrIBPWNA1ShzU3Af/2jF+hjda5KaYWs NOl2jCRFsKItDaM0Kyn1ibHO4eW2GAaeLv4n7wjQdSp/i1OUOdvh/uzekbcpHL89usRp 34wOMtPVrMxFz5yFgVa4wVNk0QFp0UhMRwgHVeMwb254rzxhsIIFoT71HNwy43lNtEwi L4V+fcMVlzhBS6CHBVwSoA6oHwSyJl1XP3nTepWAjKCADBMVJ1sKXKDrDVRXRy21MORq LE0NwuSm38myyPjbQ/r0wl5pxS1L52lF0INu3RNlijnWGE97+Zh8FELMsut7qmVqHyY3 oONA== X-Gm-Message-State: AOAM5334j6LzmD18d3Nrg1iAsPzJoH5YEiJhrdVUawUZFXow73DYHUTR iR+wRhfXkOLa5AUoPObJotjT5yfcYZg= X-Received: by 2002:a1c:3546:: with SMTP id c67mr7205866wma.102.1594794586771; Tue, 14 Jul 2020 23:29:46 -0700 (PDT) Received: from dell ([2.31.163.61]) by smtp.gmail.com with ESMTPSA id p4sm1787729wrx.63.2020.07.14.23.29.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2020 23:29:46 -0700 (PDT) Date: Wed, 15 Jul 2020 07:29:44 +0100 From: Lee Jones To: James Bottomley Cc: Hannes Reinecke , martin.petersen@oracle.com, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, Hannes Reinecke Subject: Re: [PATCH v2 24/24] scsi: aic7xxx: aic79xx_osm: Remove set but unused variabes 'saved_scsiid' and 'saved_modes' Message-ID: <20200715062944.GM1398296@dell> References: <20200713080001.128044-1-lee.jones@linaro.org> <20200713080001.128044-25-lee.jones@linaro.org> <559e47de-fa26-9ae5-a3c5-4adeae606309@suse.de> <1594741430.4545.15.camel@linux.ibm.com> <20200714213951.GL1398296@dell> <1594767794.14804.21.camel@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1594767794.14804.21.camel@linux.ibm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Jul 2020, James Bottomley wrote: > On Tue, 2020-07-14 at 22:39 +0100, Lee Jones wrote: > > On Tue, 14 Jul 2020, James Bottomley wrote: > > > > > On Tue, 2020-07-14 at 09:46 +0200, Hannes Reinecke wrote: > > > > On 7/13/20 10:00 AM, Lee Jones wrote: > > > > > Haven't been used since 2006. > > > > > > > > > > Fixes the following W=1 kernel build warning(s): > > > > > > > > > > drivers/scsi/aic7xxx/aic79xx_osm.c: In function > > > > > ‘ahd_linux_queue_abort_cmd’: > > > > > drivers/scsi/aic7xxx/aic79xx_osm.c:2155:17: warning: variable > > > > > ‘saved_modes’ set but not used [-Wunused-but-set-variable] > > > > > drivers/scsi/aic7xxx/aic79xx_osm.c:2148:9: warning: variable > > > > > ‘saved_scsiid’ set but not used [-Wunused-but-set-variable] > > > > > > > > > > Cc: Hannes Reinecke > > > > > Signed-off-by: Lee Jones > > > > > --- > > > > > drivers/scsi/aic7xxx/aic79xx_osm.c | 4 ---- > > > > > 1 file changed, 4 deletions(-) > > > > > > > > > > diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c > > > > > b/drivers/scsi/aic7xxx/aic79xx_osm.c > > > > > index 3782a20d58885..140c4e74ddd7e 100644 > > > > > --- a/drivers/scsi/aic7xxx/aic79xx_osm.c > > > > > +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c > > > > > @@ -2141,14 +2141,12 @@ ahd_linux_queue_abort_cmd(struct > > > > > scsi_cmnd > > > > > *cmd) > > > > > u_int saved_scbptr; > > > > > u_int active_scbptr; > > > > > u_int last_phase; > > > > > - u_int saved_scsiid; > > > > > u_int cdb_byte; > > > > > int retval; > > > > > int was_paused; > > > > > int paused; > > > > > int wait; > > > > > int disconnected; > > > > > - ahd_mode_state saved_modes; > > > > > unsigned long flags; > > > > > > > > > > pending_scb = NULL; > > > > > @@ -2239,7 +2237,6 @@ ahd_linux_queue_abort_cmd(struct > > > > > scsi_cmnd > > > > > *cmd) > > > > > goto done; > > > > > } > > > > > > > > > > - saved_modes = ahd_save_modes(ahd); > > > > > ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI); > > > > > last_phase = ahd_inb(ahd, LASTPHASE); > > > > > saved_scbptr = ahd_get_scbptr(ahd); > > > > > @@ -2257,7 +2254,6 @@ ahd_linux_queue_abort_cmd(struct > > > > > scsi_cmnd > > > > > *cmd) > > > > > * passed in command. That command is currently > > > > > active on > > > > > the > > > > > * bus or is in the disconnected state. > > > > > */ > > > > > - saved_scsiid = ahd_inb(ahd, SAVED_SCSIID); > > > > > if (last_phase != P_BUSFREE > > > > > && SCB_GET_TAG(pending_scb) == active_scbptr) { > > > > > > > > > > > > > > > > > > Reviewed-by: Hannes Reinecke > > > > > > Hey, you don't get to do that ... I asked you to figure out why > > > we're missing an ahd_restore_modes(). Removing the > > > ahd_save_modes() is cosmetic: it gets rid of a warning but doesn't > > > fix the problem. I'd rather keep the warning until the problem is > > > fixed and the problem is we need a mode save/restore around the > > > ahd_set_modes() which is only partially implemented in this > > > function. > > > > I had a look. Traced it back to the dawn of time (time == Git), then > > delved even further back by downloading and trawling through ~10-15 > > tarballs. It looks as though drivers/scsi/aic7xxx/aic79xx_osm.c was > > upstreamed in v2.5.60, nearly 20 years ago. 'saved_modes' has been > > unused since at least then. If no one has complained in 2 decades, > > I'd say it probably isn't an issue worth perusing. > > Well, we have what looks like a fix now. The reason it matters is that > if the bus is not in AHD_MODE_SCSI when the routine is called, it ends > up being in a wrong state when the routine exits, so you abort one > command and screw up another. Ultimately I bet escalation to bus reset > fixes it, so everything appears to work, but it might have worked a lot > better if the original mode were restored. > > This is error handling code, so most installations run just fine > without ever invoking it. Understood. Obviously a *real* fix is better than this warning suppression one. I was just explaining that, try as I might, I couldn't find any non-broken code to use to use as a reference to author a proper fix for this. This being the first mail in my inbox, so I don't know if the proper fix you reference above was a) sent as a patch and/or b) sent to me, but it's great news that you have one either way. Please drop this patch. -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog