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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C07DFC001DC for ; Wed, 26 Jul 2023 07:22:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231640AbjGZHWn (ORCPT ); Wed, 26 Jul 2023 03:22:43 -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: 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