From mboxrd@z Thu Jan 1 00:00:00 1970 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=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 2B5D9C433E0 for ; Tue, 30 Jun 2020 09:56:15 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E888D20675 for ; Tue, 30 Jun 2020 09:56:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RDZTpJVx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E888D20675 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.vnet.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YBgfj9+WXFqRLwN7zVswAkWJAOcs/Zfghdb1YIWs1Cs=; b=RDZTpJVxgi9XdgWR5ky0yZyTc 8x2L3b6vjHPUyS8SDnFOyse2zM0JMwGpRpo92vcYhJ4YmwajmQ8F2Vjx3g+SRAzuZJdRkYH4ZG1Ui Ht9Mdob3v4SK4CkjbH78wiicORXNuxKZbMaBxMnBDML+Ns/6aMqy5IAIIf5okgdYWbI6FOSv6py5N nRwXReH34iVGA6Hh7QTvhC7dlSy6A2+uqVTCEPdjK/t+5RGqNwQBUF0Q8GG7a8BsuuQKVBtidi2T+ BO6qDqOB9ucjQGwBwvafbVBc+kp9ilbwnw0cOsmmhcdXYbUUolgtjvXC4GuPT4UTlVwYtje6bgHk6 F20gKUAzw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqCyO-0003GC-4r; Tue, 30 Jun 2020 09:54:40 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqCyL-0003G0-50 for linux-arm-kernel@lists.infradead.org; Tue, 30 Jun 2020 09:54:38 +0000 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05U9We9Q129076; Tue, 30 Jun 2020 05:54:28 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 31ydjxe07b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 05:54:28 -0400 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 05U9gtGQ169936; Tue, 30 Jun 2020 05:54:28 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 31ydjxe073-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 05:54:28 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 05U9ogZj000843; Tue, 30 Jun 2020 09:54:27 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma01dal.us.ibm.com with ESMTP id 31wwr94q9b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 09:54:27 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 05U9sNxG10486368 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Jun 2020 09:54:23 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 86585136051; Tue, 30 Jun 2020 09:54:25 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3E77B13604F; Tue, 30 Jun 2020 09:54:25 +0000 (GMT) Received: from ltc.linux.ibm.com (unknown [9.16.170.189]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 30 Jun 2020 09:54:25 +0000 (GMT) MIME-Version: 1.0 Date: Tue, 30 Jun 2020 11:54:24 +0200 From: haver To: Lee Jones Subject: Re: [PATCH 17/20] misc: genwqe: card_base: Do not pass unused argument 'fatal_err' In-Reply-To: <20200630091020.GJ1179328@dell> References: <20200629140442.1043957-1-lee.jones@linaro.org> <20200629140442.1043957-18-lee.jones@linaro.org> <016718c7218cf811897cc32cf9476222@linux.vnet.ibm.com> <20200630091020.GJ1179328@dell> Message-ID: <235f96392b5a2f06b4410e9532b1322b@linux.vnet.ibm.com> X-Sender: haver@linux.vnet.ibm.com User-Agent: Roundcube Webmail/1.0.1 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-06-30_03:2020-06-30, 2020-06-29 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 impostorscore=0 phishscore=0 mlxlogscore=999 malwarescore=0 priorityscore=1501 spamscore=0 mlxscore=0 cotscore=-2147483648 bulkscore=0 suspectscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006300067 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joerg-Stephan Vogt , arnd@arndb.de, gregkh@linuxfoundation.org, Frank Haverkamp , Michael Jung , linux-kernel@vger.kernel.org, Michael Ruettger , linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020-06-30 11:10, Lee Jones wrote: > On Tue, 30 Jun 2020, haver wrote: > >> On 2020-06-29 16:04, Lee Jones wrote: >> > 'fatal_err' is taken as an argument to a static function which is only >> > invoked once. During this invocation 'fatal_err' is not set. There >> > doesn't appear to be a good reason to keep it around. >> > >> > Also fixes the following W=1 kernel build warning: >> > >> > drivers/misc/genwqe/card_base.c:588: warning: Function parameter or >> > member 'fatal_err' not described in 'genwqe_recover_card' >> > >> > Cc: Michael Jung >> > Cc: Michael Ruettger >> > Cc: Frank Haverkamp >> > Cc: Joerg-Stephan Vogt >> > Signed-off-by: Lee Jones >> > --- >> > drivers/misc/genwqe/card_base.c | 18 +++--------------- >> > 1 file changed, 3 insertions(+), 15 deletions(-) >> > >> > diff --git a/drivers/misc/genwqe/card_base.c >> > b/drivers/misc/genwqe/card_base.c >> > index bceebf49de2d5..809a6f46f6de3 100644 >> > --- a/drivers/misc/genwqe/card_base.c >> > +++ b/drivers/misc/genwqe/card_base.c >> > @@ -569,30 +569,18 @@ static int genwqe_stop(struct genwqe_dev *cd) >> > >> > /** >> > * genwqe_recover_card() - Try to recover the card if it is possible >> > - * >> > - * If fatal_err is set no register access is possible anymore. It is >> > - * likely that genwqe_start fails in that situation. Proper error >> > - * handling is required in this case. >> > + * @cd: GenWQE device information >> > * >> > * genwqe_bus_reset() will cause the pci code to call genwqe_remove() >> > * and later genwqe_probe() for all virtual functions. >> > */ >> > -static int genwqe_recover_card(struct genwqe_dev *cd, int fatal_err) >> > +static int genwqe_recover_card(struct genwqe_dev *cd) >> > { >> > int rc; >> > struct pci_dev *pci_dev = cd->pci_dev; >> > >> > genwqe_stop(cd); >> > >> > - /* >> > - * Make sure chip is not reloaded to maintain FFDC. Write SLU >> > - * Reset Register, CPLDReset field to 0. >> > - */ >> > - if (!fatal_err) { >> > - cd->softreset = 0x70ull; >> > - __genwqe_writeq(cd, IO_SLC_CFGREG_SOFTRESET, cd->softreset); >> > - } >> > - >> > rc = genwqe_bus_reset(cd); >> > if (rc != 0) { >> > dev_err(&pci_dev->dev, >> > @@ -958,7 +946,7 @@ static int genwqe_health_thread(void *data) >> > >> > cd->card_state = GENWQE_CARD_FATAL_ERROR; >> > >> > - rc = genwqe_recover_card(cd, 0); >> > + rc = genwqe_recover_card(cd); >> > if (rc < 0) { >> > /* FIXME Card is unusable and needs unbind! */ >> > goto fatal_error; >> >> I think this one I want to keep. Since fatal_err is 0, !fatal_error is >> 1 and >> the register write is actually executed. > > Ah yes, good catch. > > What if we *always* did instead then? I knew you would ask that ;-). > >> I also want to keep the parameter even though it is only used with 0. >> The >> register bit causes a less drastic recovery, but if we would discover >> that >> that is not working ok, we rather discard the debug data we get in >> this case >> instead of letting the recovery fail. I think it does not hurt to keep >> it. > > I'm not 100% against it, but it is dead code. > >> Maybe you can add a comment? > > If you really want to keep it, I can just update the kerneldoc > instead. I prefer that option. I want to indicate that there are two possible ways to recover on a problem. If we delete the currently not exploited parameter, this information gets lost. Regards Frank _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel