Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27337712rwd; Tue, 4 Jul 2023 01:18:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7D6mzQTAnJ8POKiC9naUmLYkrCO6m4cAJISwhzVChXZJgIinXq409GV5YNY1ZYjOGXtNQ2 X-Received: by 2002:a05:6a20:970e:b0:122:38f5:6242 with SMTP id hr14-20020a056a20970e00b0012238f56242mr6942202pzc.22.1688458680235; Tue, 04 Jul 2023 01:18:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688458680; cv=none; d=google.com; s=arc-20160816; b=QMkxt2Idb65ry5d+Hn55q+eHfQP8kfcWu04uTQvhw0oQE37Ug6lWPLrS9bN8pLes9B Yc+BGWvUWYcsVM0+9w7Is9LOp65HjHfB5OMycKPZ6ab1Mt0bGQiulSFFw8oybHlTapP9 8B5wJRJ9bnGOwlEs+obWAJLaktmlAkVYNc99Gd5LZaoL9F4+PfC1TL9L1aMgaKQBfS4+ moOax7Zx5eDPVo1Ztr5KZW5LbBRuIEv1d+6uiGxxNYK1AAZwi/0g74308uxs+5GWejsp EvbjC0K1j67ySKOXIZDys0KnNXQg7WOoYJi/HLtowAH4kuU4fmeN74Hz5G26gLEXsxSy 2fiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=KyUic+k3lhFGyHcIl3np2CuPrA8HfLweP+3Dqn477ss=; fh=tvYKpW6BdaeWt2RO1oNJhJGRBN88V4W2ciqFVBYGg7Q=; b=vZ7QXkhL5rVmc4z/7eURMlfKmGqDAu5l1/Rhzm0K7r9C78RgFWR+yuyz47OcsY6lim RZUbC7RkFLdJhxb9l/vAKGfOCTp4U9AALWoyrNnYzaxTO5G2gAqIsqhqnbzmk6zUoHE8 ZMd5C3K/aB93GCd4PJUskO+3kHO6r4a6mwJaErG1Tr4rmtKnHNasktN4Ymqtnzkw6Or7 5YZtLTLiQZmGkNBQEsJS8kx7n2xYRIvjtXAbPk6CdP8bhCjwEtjx3CRHaVwWAow754Hp FMC/Vp0DoS4JSBI1ei7AI2++VNZzd1K+jSJoBVefy0u5IMVlT9dJV/tSFpD35bui7piG ud3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=UNmp3wb2; 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=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c8-20020a170902d48800b001b3cf7cb619si2609930plg.62.2023.07.04.01.17.46; Tue, 04 Jul 2023 01:18:00 -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=@canonical.com header.s=20210705 header.b=UNmp3wb2; 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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231435AbjGDIGM (ORCPT + 99 others); Tue, 4 Jul 2023 04:06:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231409AbjGDIGE (ORCPT ); Tue, 4 Jul 2023 04:06:04 -0400 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A732810C1 for ; Tue, 4 Jul 2023 01:05:57 -0700 (PDT) Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id A1A693F328 for ; Tue, 4 Jul 2023 08:05:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1688457954; bh=KyUic+k3lhFGyHcIl3np2CuPrA8HfLweP+3Dqn477ss=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=UNmp3wb2uhYjNFHl0eb63ZRxJTOsqDTaqaW563LyLcJVnrJcBip9hnjNK1mWPJoX8 /9LztpcVHpplf69OzVrP8hZ1iyv2vqYKf06qiv64NxERpGj3ATC8CKaUEoMkVSeTlP MQey4Ns5vZFxMs4PBvIZMAK9LQuU6HZHJapeaODK0oqEZDA1vkSbvDMsWVi5jQ3f1W z/wkbndIK1LaqTPrrl2hw1zQfcX/4pRF+jAWAmGh6mnyexR7OY5gODfTdWPIGbdgJA UczWm5RftFF7/z0M4KX58pO6wPNIWe4BzH6GT8ci61g7o/gRll5xy0A9FXg2scdzq/ ZFwpIJYn6R2GQ== Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-666ec28a20dso4869916b3a.2 for ; Tue, 04 Jul 2023 01:05:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688457953; x=1691049953; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KyUic+k3lhFGyHcIl3np2CuPrA8HfLweP+3Dqn477ss=; b=NVFpcY8fc3FZAOaac+lIWsTDWDdfMg5+ArWIzzL5qS+hUZgLmeySeL+rMjicf59buj KOW1OYfccmyOWyZqoJKtGy6Jw9aRT7Hitl7uHY1C9j6/ah1I9IYk/Zzdnc1k2BJeM9e5 MzbErxoM1VbuOnZdC/C48VOGC33GdA8vKLF4TZrer/WlmJv+Yciw5L5A6gqMbMX03BcP TJVdXEmSSUwzRUZbprRI9mq+vgItZDqVHCbCfB57ETGeFuMH9S2hgVxFkbYoqcLrshju Y3LyqHlzCLr9GnVgdWGS/ejhbKp747qew1ZxczYLr+omkPF8MAPfP6FehHiPBXLyEBcD SDVA== X-Gm-Message-State: ABy/qLZBOzEfB6gMsOde88vNJajGWV6ykNaus9mqdXtAvChr6YsVCg7S eEoUdAeX9GWjLLV62oh8n9E+FVQbj4yik+xQUwy0xOwX1CIXEDulfAC/wqsbsBZNNYqQkHTQtYR nAJM2oWgAV2LckpBji/Oj6/Mc0gVSQYdtKl36UplHAkiX69woAgtzWU7rxQ== X-Received: by 2002:a05:6a00:b93:b0:668:711a:7d93 with SMTP id g19-20020a056a000b9300b00668711a7d93mr9939042pfj.19.1688457953213; Tue, 04 Jul 2023 01:05:53 -0700 (PDT) X-Received: by 2002:a05:6a00:b93:b0:668:711a:7d93 with SMTP id g19-20020a056a000b9300b00668711a7d93mr9939021pfj.19.1688457952804; Tue, 04 Jul 2023 01:05:52 -0700 (PDT) MIME-Version: 1.0 References: <20230703162509.77828-1-koba.ko@canonical.com> <4ec2b7d2-11a5-6ab6-087a-175ed31faca4@web.de> <9c27530e-21f9-15ce-5116-5af5b0c25f53@web.de> In-Reply-To: <9c27530e-21f9-15ce-5116-5af5b0c25f53@web.de> From: Koba Ko Date: Tue, 4 Jul 2023 16:05:41 +0800 Message-ID: Subject: Re: [PATCH v2] EDAC/i10nm: shift exponent is negative To: Markus Elfring Cc: linux-edac@vger.kernel.org, kernel-janitors@vger.kernel.org, LKML , Borislav Petkov , James Morse , Mauro Carvalho Chehab , Robert Richter , Tony Luck Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Tue, Jul 4, 2023 at 3:16=E2=80=AFPM Markus Elfring wrote: > > > As per suggestions, i modified V3. > > could you please take a look > > > > Subject: [PATCH][V3] EDAC/i10nm: shift exponent is negative > > Would you like to put the text =E2=80=9C[PATCH v4] EDAC/i10nm: Fix an ina= ppropriate shift exponent=E2=80=9D > into a subsequent patch? I didn't send V3 so the suggestions could be put in V3. > > I would find further wording variants nicer. > > > > Because failed to read from DIMM, get the negative value for shift > > operation. > > A surprising value was determined after a read failure from a DIMM. > > > =E2=80=A6 > > UBSAN complains this error > > Software analyses pointed a data processing issue out. > > > > `UBSAN: shift-out-of-bounds in drivers/edac/skx_common.c:369:16 > > shift exponent -66 is negative` > > > > when get rows, cols and ranks, the returned error value doesn't be > > handled. > > A special value combination could not be handled so far. > > > > check the return value is EINVAL, if yes, directly return 0 and > > show error message explicitly. > > Check if an invalid value was detected by a call of the function =E2=80= =9Cskx_get_dimm_attr=E2=80=9D. > > * Print a corresponding error message in this case. > > * Return zero then directly from the function =E2=80=9Cskx_get_dimm_info= =E2=80=9D. > > > =E2=80=A6 > @@ -351,6 +351,8 @@ int skx_get_dimm_info(u32 mtr, u32 mcmtr, u32 amap, s= truct dimm_info *dimm, > ranks =3D numrank(mtr); > rows =3D numrow(mtr); > cols =3D imc->hbm_mc ? 6 : numcol(mtr); > + if (ranks =3D=3D -EINVAL || rows =3D=3D -EINVAL || cols =3D=3D -E= INVAL) > + return 0; > =E2=80=A6 > > > Can it be nicer to perform a check for such an error code directly > after each variable assignment? > (May this condition check be split?) > > > > Fixes: 4ec656bdf43a13) EDAC, skx_edac: Add EDAC driver for Skylake > > Please properly apply parentheses and double quotes for this tag. > > See also: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/D= ocumentation/process/submitting-patches.rst?h=3Dv6.4#n145 > > > > V2 -> V3: simplify the summary and add 'Fixes:' > > V1 -> V2: make error-print explicitly > > How do you think about to use more succinct version identifiers > for such descriptions? > > V4: > =E2=80=A6 > > V3: > =E2=80=A6 > > > Regards, > Markus