Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3549519ybv; Mon, 10 Feb 2020 01:58:55 -0800 (PST) X-Google-Smtp-Source: APXvYqweriINpGax1p2B2fzBMHAhs7nPPm2D8Q6kXRmebZiDNGye1YAPy2d9IKEJOCE0D8vBjAQd X-Received: by 2002:a9d:6a48:: with SMTP id h8mr461331otn.264.1581328735305; Mon, 10 Feb 2020 01:58:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1581328735; cv=pass; d=google.com; s=arc-20160816; b=haDvsylyl/MkPcrSDax3fZYJEypSeGlFSywJ79XTLIjRfgcydpypM+cD/nSl5sWp/A dcsWXtRsuf9gxwxfIKgJTaJTEWjz38OnnWTPBBp+QniwGPg23HibtDrXVAX34TGM4SLN x8YVTJq0QOx4hPrI7mpt+Z5teW9ntLCZAgMWZWBlWCKo9NplJeTtgOItw9Mf4mVFK/qM hf8YLaYlys53P0w6X+UIfuN8LvTX67KyruQ5gIzgfUy3H+8537aR3ZImgxhXcIPECiiJ cUKsD4LdnFzpDrJO/YH2+6B6yMMgnY5u9KSa0xis0VMYDD4SToUlBhk+tko0+Z8UvmJO sBYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:mime-version:references:in-reply-to :message-id:date:subject:cc:from:dkim-signature:dkim-signature; bh=Ffk8csaGWAEw0OFLormV0A9G4oo/pPKffEVNCiclfRg=; b=rx6gNJ2hx/4E42z+IdTda42SWQ9TzUG+eX12Rsoe9M5dSM2/KPFOIMz8nrJJo9vzfn qNO8HpdTzget2fvhFq9zb9XUtoJF3t9tKBIFKri7O8tjKKTf/f/euSTv0CuIksktMNtq NidZWkN7hvM4mlC+sUX3J/F0QLN+1lFOrtQZ9Ag4M+gCry+3aK0s59i2hTPebGxAehyE iGJywBxl4VFSay0EO6VOOUpCPV5Cc5y7yvSo9RvshP1bjzBd5LiEBikM5KgvqucvDaqk 1ocjZ6aBeH1XO+x/6nWB0zcEwfb52j1PuJAtQ6yDjbGGG1xSInTtsZs/1Xa2azMmrtKE I6kA== ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@cadence.com header.s=proofpoint header.b=jiN0tKNG; dkim=pass header.i=@cadence.com header.s=selector2 header.b=GEsSEGep; arc=pass (i=1 spf=pass spfdomain=cadence.com dmarc=pass fromdomain=cadence.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cadence.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 9si8100773ois.90.2020.02.10.01.58.44; Mon, 10 Feb 2020 01:58:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@cadence.com header.s=proofpoint header.b=jiN0tKNG; dkim=pass header.i=@cadence.com header.s=selector2 header.b=GEsSEGep; arc=pass (i=1 spf=pass spfdomain=cadence.com dmarc=pass fromdomain=cadence.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cadence.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727530AbgBJJ5K (ORCPT + 99 others); Mon, 10 Feb 2020 04:57:10 -0500 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]:10990 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726118AbgBJJ5J (ORCPT ); Mon, 10 Feb 2020 04:57:09 -0500 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01A9qjYl013001; Mon, 10 Feb 2020 01:56:43 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=Ffk8csaGWAEw0OFLormV0A9G4oo/pPKffEVNCiclfRg=; b=jiN0tKNGojQ5lZdqRXe1hjV9oiTWA6VTi5N/IaWzJn9PH9qP+kxs3SEBAYwQr21oYoXg VmItGfVHbg012pKk+T5J3OKyoKqWIWJZIr+XuUY2vJp5KPeRiRWoTNq474B9YsEFe7uE dwtApoCgoZrSC3J01Q9WDAZbU679cgZLZxrTRSBx/pizcgyZO5yY68rDVh17C+vqj43f /Th9lMR2STBPI3FartMZkpzKEbqRuCS5pyVaDurgCTjR2k28TJFPQKz2wypcDzc+0HX6 m6ufgTMzBQFsC/eBzVgzgcMw7Z0G4T38Z5oD4jYaS1qBVdmB8dSMA2zdrX+l+MYW726s 3g== Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2105.outbound.protection.outlook.com [104.47.70.105]) by mx0a-0014ca01.pphosted.com with ESMTP id 2y1tmpna16-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Feb 2020 01:56:43 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fgek0OA9Fn8E9QwwOJ4w6gnWXyhFZdV+6R6oQW/YOJIvRiEv+H1VPEfzInuT3VAEcrNXUNBRS/zhh3HcUwne8r0PfSNvRBli3rwNYtq7uQz+vZuSHEHdNqGu/VrkNOdcxO7OBMxWFGQN8I0jZ31dZQW3OZ1hs05a4JNmMcLqiqEq36GZGIZ0TKtzkxDB14PjFRFdFVuTrfMrtF5AvgAWPSmCD077KbEo+kAPHBA7atwL4gpDj2uWP90Tc8lQLZnZvLpk2sJ3M2Crz/i0wGv2O9hDANpvbzJtNafD0wTDq+D7GkcDIUOEWIhmxSBWX2R6ruqnb8bKxbURUbiwRKLSBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ffk8csaGWAEw0OFLormV0A9G4oo/pPKffEVNCiclfRg=; b=Y8oZwc/CMmg5tfzrRjRJD2nod+cLepM+IZQYZxUJjDQc648V4FmxdDCi9dWdiftAvZdUbe7lALYzh+0cSsOrRXR69PG/jiLoGZWNA6OsBXymjbXKt6Rv+MIxyLomaP7kW5ztBnImmzwa/93nTw3JXNRt6hXLBFUAz2c2vvZM/Wnl1fnLbcetQ23wwK5HIb6pI6S4T8yVEz2tCvaXL8CJgsnMOx2eLgSmQiOGB/TuMV6ynOV3FsvKneA0dVjImibrQpNxTe2qsKmhO18MS8+lqWHJp9zMU4J/xS+trxTEUITNGQq+SIA5pa2EypAypGzocIp9JQjBoBVfAJTzoAjIcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 158.140.1.28) smtp.rcpttodomain=nod.at smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ffk8csaGWAEw0OFLormV0A9G4oo/pPKffEVNCiclfRg=; b=GEsSEGepyUwBs40tYyN9I3SMbZkqR3G6gr1eh/caBrW7uNJAvepUqVdvP0cEqstK8IGyfEyeK+CiuyQg3ICubLremVkH6WR+5L94AcQ20llEHyB+zTPuLlcYXaIKPpjtZ9dDeZdiIfjPmv5Glnpsf0e0pqXlICBRM1peq2Y7kE4= Received: from BYAPR07CA0047.namprd07.prod.outlook.com (2603:10b6:a03:60::24) by MN2PR07MB6944.namprd07.prod.outlook.com (2603:10b6:208:1a6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21; Mon, 10 Feb 2020 09:56:39 +0000 Received: from DM6NAM12FT065.eop-nam12.prod.protection.outlook.com (2a01:111:f400:fe59::208) by BYAPR07CA0047.outlook.office365.com (2603:10b6:a03:60::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2707.21 via Frontend Transport; Mon, 10 Feb 2020 09:56:39 +0000 Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 158.140.1.28 as permitted sender) receiver=protection.outlook.com; client-ip=158.140.1.28; helo=sjmaillnx1.cadence.com; Received: from sjmaillnx1.cadence.com (158.140.1.28) by DM6NAM12FT065.mail.protection.outlook.com (10.13.179.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.10 via Frontend Transport; Mon, 10 Feb 2020 09:56:38 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id 01A9uXCe010151 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Mon, 10 Feb 2020 01:56:35 -0800 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 10 Feb 2020 10:56:33 +0100 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 10 Feb 2020 10:56:33 +0100 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 01A9uXAj030258; Mon, 10 Feb 2020 10:56:33 +0100 Received: (from piotrs@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 01A9uXCo030257; Mon, 10 Feb 2020 10:56:33 +0100 From: Piotr Sroka CC: Kazuhiro Kasai , Piotr Sroka , Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut , Vignesh Raghavendra , , Subject: [PATCH 2/4] mtd: rawnand: cadence: fix calculating avaialble oob size Date: Mon, 10 Feb 2020 10:55:26 +0100 Message-ID: <1581328530-29966-2-git-send-email-piotrs@cadence.com> X-Mailer: git-send-email 2.4.5 In-Reply-To: <1581328530-29966-1-git-send-email-piotrs@cadence.com> References: <1581328530-29966-1-git-send-email-piotrs@cadence.com> MIME-Version: 1.0 Content-Type: text/plain X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:158.140.1.28;IPV:CAL;SCL:-1;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(136003)(396003)(346002)(376002)(39860400002)(36092001)(189003)(199004)(356004)(6666004)(7636002)(36756003)(5660300002)(4326008)(109986005)(70586007)(2616005)(70206006)(426003)(186003)(2906002)(8936002)(26826003)(336012)(478600001)(26005)(246002)(86362001)(54906003)(42186006)(8676002)(316002)(266003);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR07MB6944;H:sjmaillnx1.cadence.com;FPR:;SPF:Pass;LANG:en;PTR:corp.Cadence.COM;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d4262be7-e959-4fd0-87e3-08d7ae0f85a3 X-MS-TrafficTypeDiagnostic: MN2PR07MB6944: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-Forefront-PRVS: 03094A4065 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Aac77gRf7gOnWBcGP6oOzyYvbY3BUsY1GWvYD+mtRf70IbgMPaPYLSIzOV1GEA6RzBIAOsrg1MK3seIZYb8Q1/+RYehJcsfH0VZr0ntgwaBQHDCeuczjOtXM+2Hcb60roFWBizvrSZYJ9g5QaRx9ms1jYjLfSMZvvmCOkRTUdIlYYTRxAGIMWCWOMvtQr/Lk+zP+aibtEszJJHOuIINJ8TPvsaO5Tj9RSAmaLf/a/jsk5g33BrDI9n6cyFpRArtglLVRq93LCB/uus+uJfkqkSSRaPmUtRX/b52v77OlA1r+WN52eBtZOu0og8Xdy9kgy+Z/2iTBGYdrp2NSkKd2Clmu+A/9rFa93zyHb12mrQXA823UDEjKxPWRb3UvZ5enP+VWz8D3pC4Fb9FIWzR3C/cN1Uaqgt70LVbC1uv+idjNcu4Hyidw5u1MzmW/4PQzXOisbgOF2zvJc7ElkYxUXDoA4EvjD2ZIfa27dIPjcq6Yg3d4ukpNRK2AGihsSI2HDJsbltXxznvPCK27HFCsDQ== X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2020 09:56:38.4954 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d4262be7-e959-4fd0-87e3-08d7ae0f85a3 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[158.140.1.28];Helo=[sjmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR07MB6944 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-10_02:2020-02-07,2020-02-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 impostorscore=0 lowpriorityscore=0 mlxlogscore=788 spamscore=0 priorityscore=1501 bulkscore=0 phishscore=0 mlxscore=0 suspectscore=0 clxscore=1015 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002100077 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Previously ecc_sector size was used for calculation but its value was not yet known. Signed-off-by: Piotr Sroka --- drivers/mtd/nand/raw/cadence-nand-controller.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/cadence-nand-controller.c b/drivers/mtd/nand/raw/cadence-nand-controller.c index 5063a8b493a4..2ebfd0934739 100644 --- a/drivers/mtd/nand/raw/cadence-nand-controller.c +++ b/drivers/mtd/nand/raw/cadence-nand-controller.c @@ -2595,7 +2595,7 @@ int cadence_nand_attach_chip(struct nand_chip *chip) { struct cdns_nand_ctrl *cdns_ctrl = to_cdns_nand_ctrl(chip->controller); struct cdns_nand_chip *cdns_chip = to_cdns_nand_chip(chip); - u32 ecc_size = cdns_chip->sector_count * chip->ecc.bytes; + u32 ecc_size; struct mtd_info *mtd = nand_to_mtd(chip); int ret; @@ -2634,6 +2634,7 @@ int cadence_nand_attach_chip(struct nand_chip *chip) /* Error correction configuration. */ cdns_chip->sector_size = chip->ecc.size; cdns_chip->sector_count = mtd->writesize / cdns_chip->sector_size; + ecc_size = cdns_chip->sector_count * chip->ecc.bytes; cdns_chip->avail_oob_size = mtd->oobsize - ecc_size; -- 2.17.1