Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp703834rwb; Wed, 26 Jul 2023 01:07:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlHqHNW6pb8KnO2rocAHQRswLX8r4jb8HkT1PFe9g2yc45UuHSbb85itGaRiq0MFyOrxyx6A X-Received: by 2002:a05:6a20:dd9a:b0:134:5c75:3d23 with SMTP id kw26-20020a056a20dd9a00b001345c753d23mr1257973pzb.18.1690358827938; Wed, 26 Jul 2023 01:07:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690358827; cv=none; d=google.com; s=arc-20160816; b=j98px8Mpz3zRU9lbHQIvGX4CJIg6d6kFShTtXFQxl6uARljrVSPBDyRntvh0+cqr+a Gb/yZW96ioINfBd86gTywA+u6Q3ZOQCeSzEe8/gP7vsXxxrtHt6ZKWqs8EQEXjup52rz 5lLNQk1HJd58rDJAXQaD9LI8o0QeRYpCMVY5G4mjyqTL6gN1ON5CFeA1hOm6tNvFtfwX jYiF9QPql8+oBJG6Bco6dIx3fhnO65C2+3rgSKrg//1hmy000S2isFIjyCYqlsjk46Pm lDeR08eMUHcbpSWdqf7PWjISJzsdG5qDflybGOYvDCGCnZsYpWHDC/RuPPrVPOgqpRTR ozhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=uupD7+3BNKQK/PxzP1k461bkRqXKmgYE9MQ99EHF76Y=; fh=976+vEpcapO6EyVQok6DxV0ov74ZWRFpoMh5RY1/Icc=; b=EIPIwKXojkK27Jq0wFrwc1b6T7TdyvpSW8Y7t9sE6eKYYkt34NcATEosNvW/QBgm/L lI7ioR8xhzfNI0TuonX513oQWuzNcGHOY6xxXyIT1lp6BaGStp5GFqQBh42RlkU5wuXC cQlSWIpbwpFdVGsoCA4/4VY0vBn73KomSWZC2xYTGmquBKxYSjTIpRlGC8P0f3k0X959 SOQ4AkyZzLE00h9hkwfrA0ul5plgndsKDuYcPwGXYAYdkDa6QEP0UZ+9YbjMdPT91SIr yZBchOPyKiyyEphPUxuhGpEEMSdbhQNX0AQtxUWQ42PFEd+9950PSZSd3D0TXGbhtQOa hM2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PchRafcD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h184-20020a6383c1000000b00563e7aa7e3asi584745pge.873.2023.07.26.01.06.55; Wed, 26 Jul 2023 01:07:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PchRafcD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231636AbjGZHWk (ORCPT + 99 others); Wed, 26 Jul 2023 03:22:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231531AbjGZHWL (ORCPT ); Wed, 26 Jul 2023 03:22:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A12C54C24; Wed, 26 Jul 2023 00:18:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 263F161536; Wed, 26 Jul 2023 07:18:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F35DC433C8; Wed, 26 Jul 2023 07:18:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1690355903; bh=Lmm+4McdjfF7XNhSI+TigH314Z3lKfBItXi5XhHhA/E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PchRafcDVLFtMd90/7z41tLGON8pwMw//Ta/zKZvcxeiFlRP9ksoiI/+R4p0SltvF i/SIjUOr7es2D3cNbuDA0Pd3t5ySWrJ2CCdmvs/EZ/FJZcTk6dmCwvc1qnasOrYRpb LoUpVwyga+unCQAYm7VPDB0zoVI+KvX1mTSnnjJ0= Date: Wed, 26 Jul 2023 09:18:15 +0200 From: Greg KH To: liulongfang Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] USB:bugfix a controller halt error Message-ID: <2023072629-unblended-perky-4732@gregkh> References: <20230721100015.27124-1-liulongfang@huawei.com> <2023072153-module-wannabe-5637@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 On Wed, Jul 26, 2023 at 02:44:01PM +0800, liulongfang wrote: > On 2023/7/21 19:08, Greg KH Wrote: > > On Fri, Jul 21, 2023 at 06:00:15PM +0800, liulongfang wrote: > >> On systems that use ECC memory. The ECC error of the memory will > >> cause the USB controller to halt. It causes the usb_control_msg() > >> operation to fail. > > > > Why does ECC memory matter here? > > > > This is a test conducted under a special test scenario. > ECC memory errors are caused by some test tools. What memory is failing, and why does just this single check matter in the whole kernel? If hardware is broken, and failing, it's not the job of the kernel to protect against that, is it? Shouldn't the ECC memory controller have properly notified the kernel of the fault and reset the machine because it is now in an undetermined state? > > Are you sure this is correct? How was this tested? Seems to me that > > this will still return "success" if this code path ever happens, what am > > You are right. I made a patch error here. The code modification should be like this: > if (r < 0) { > retval = r; > kfree(buf); > goto fail; > } This means that you didn't test this change at all, so I don't really think it is needed :( thanks, greg k-h