Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4479832pxv; Tue, 20 Jul 2021 04:51:51 -0700 (PDT) X-Received: by 2002:a05:6638:2516:: with SMTP id v22mr23979859jat.144.1626781671351; Tue, 20 Jul 2021 04:47:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkHaFpPrMt8cLCZTaOHxl1qfdNI44AhVnVThfUEEnDnQHAU1mm+UFPI3Bf/Rp42p4TJF4/ X-Received: by 2002:a05:6638:2516:: with SMTP id v22mr23979683jat.144.1626781668138; Tue, 20 Jul 2021 04:47:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1626781668; cv=pass; d=google.com; s=arc-20160816; b=PUYmN7CY8L4R0tXxa7ddlP3R103HR0j7DLG6YSY6y2wZmHQlfeljx2GfpN3FknEKKo kBpM0Q3/DwTVbl1M0MWBtCfegJlOyuxxipL+wZgSSxobW2QSjqIzdXthLNePtDy0lPex /CXiHHM2lyAFhWdGQ8nlLc14veHf6DUepc77fu4/+HaZdIhZgwonynjVN2esougE6TAx G+oKIHc6o6wYvJXNr7eZYv/t+CaYy2pY2zYnW2rWkiizD5R8+AT9WRwAag8la7C9hsv7 n3fi4fg+gUWeReY202cJoW7Xn63QplIu1wsZ+joWlw0PDbnFrUdMECDihI1sZPsHTaed l6Ng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=Wcj6SQ5VdmWqnYXmb2U1Wwb4JXW0OB1nel6HJTeLZZ0=; b=o03xFkdmPmc3VJCnqSLN+jWjqpWOoLJxo4k6kecXYr2GQOq/ZMKEv2H2OsYc9FAFDv jG/1sjcScsv6b6JIxcCOS+373iiFH3yNI58g6TeYkCKODw6tksQ/wBePhE3pm5FP4Yjj pT8bpObrgmjvyvMhhPNmXQafnT4l/1wh7maZ2Lko+cQOQYwDEuOzScQC2eB3fj+nzXFk E8xVijvCmOwDjj4UHxqbv8NB+GuA18jM+bwG3U+q57Wkhvry5s8GhlJd92+YPdCx6dKX i6W/KaeOkt3DJWlkaNX0qZnKqckoG6ElEgt4qqUnjV2nJAmLFNCxQEi+MQkxGJCP+Q7C uGdg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@towerbridgetechnology.onmicrosoft.com header.s=selector2-towerbridgetechnology-onmicrosoft-com header.b=Gf3HsXQj; arc=pass (i=1 spf=pass spfdomain=bayhubtech.com dkim=pass dkdomain=bayhubtech.com dmarc=pass fromdomain=bayhubtech.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r3si811785jan.7.2021.07.20.04.47.37; Tue, 20 Jul 2021 04:47:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@towerbridgetechnology.onmicrosoft.com header.s=selector2-towerbridgetechnology-onmicrosoft-com header.b=Gf3HsXQj; arc=pass (i=1 spf=pass spfdomain=bayhubtech.com dkim=pass dkdomain=bayhubtech.com dmarc=pass fromdomain=bayhubtech.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237648AbhGTLGC (ORCPT + 99 others); Tue, 20 Jul 2021 07:06:02 -0400 Received: from mail-sn1anam02on2129.outbound.protection.outlook.com ([40.107.96.129]:35952 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234685AbhGTLCv (ORCPT ); Tue, 20 Jul 2021 07:02:51 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mVXuwnEFw6iNf2dEDLB5RedJEhUQ56SRHvr1V5SSxmfW3XMmHE7593iGf7s2gfCI/xOI7BR4YvI/p/P8Q4DR96OeMnaZjnQzMwwMfCi2/e4f/TWvk6fFzTRGk/Zhh9PoKa3TRqmJ0FE7VURwk5OZY/zr2T9cqOsK2S0FxQxI9xgcLJhYZCa+ODMEbv5kedF9KJs76nJeTzi92dQxWe3QOWnBnNW+IpJURtn5XXTGZN3ViSAXzW3kFduAcddTojcfhjrQPq5trsB6TuNBV4hFQYMECCtiq6NAFWpjbp7cPLC+K3WAsDHlvXkunzl3ObYWAe1FWJqUB7E9+30S+0D94A== 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=Wcj6SQ5VdmWqnYXmb2U1Wwb4JXW0OB1nel6HJTeLZZ0=; b=fl9wajNSolwjLiYpjw1QJTdM5FI1gkJZQuAY+wmjSRINRjZFnNSkeebfUfqpejqxz5k5zDV5HNqYLLvTr7N7Y/u3mhIl3xTRojjLG0C63dyl+vTeRz4H9Jp7yACoe0odcDZnFOh30Ux1mD0qr2/YyO14PCwoiiR0oy1hZd0JM+697mQ+9eqA3UD8Zww3a2W/1q8TD6GJNAqOzazfSbkXI3+EixdcvErE6q20Q0ewuwAXhKfeTJblug0vJgWHHTmj2NX/Z/MKZyaqWpo5cNDweOsLKNweiuUwWTw7HZbIY8QwLMFRM6To6WBLd4CpYYcAFprzrzgV5Fokp+ptssG9fw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bayhubtech.com; dmarc=pass action=none header.from=bayhubtech.com; dkim=pass header.d=bayhubtech.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=towerbridgetechnology.onmicrosoft.com; s=selector2-towerbridgetechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Wcj6SQ5VdmWqnYXmb2U1Wwb4JXW0OB1nel6HJTeLZZ0=; b=Gf3HsXQjjzNHRT8+5eYTqsopOkdNsj8SxdshQI+8uUpKLurCzPdSOVTKstH25cRdm607xWKUDHNK238ctdx8EOoeFLPOAcmrIwFKOur+HZNF0fJvTRV9rHUW7j3lXl6iDamv0BIzP+E57Cng2UbVRIVbhprmBW6PYciENM5DC2I= Received: from SN6PR16MB2480.namprd16.prod.outlook.com (2603:10b6:805:d2::17) by SN1PR16MB2398.namprd16.prod.outlook.com (2603:10b6:802:27::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.31; Tue, 20 Jul 2021 11:43:21 +0000 Received: from SN6PR16MB2480.namprd16.prod.outlook.com ([fe80::c967:1927:1aeb:a5c]) by SN6PR16MB2480.namprd16.prod.outlook.com ([fe80::c967:1927:1aeb:a5c%3]) with mapi id 15.20.4331.034; Tue, 20 Jul 2021 11:43:21 +0000 From: "Chevron Li (WH)" To: "adrian.hunter@intel.com" , "ulf.hansson@linaro.org" , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "Shaper Liu (WH)" , "Xiaoguang Yu (WH)" , "Shirley Her (SC)" Subject: =?gb2312?B?u9i4tDogW1BBVENIIFYxIDEvMV1tbWM6c2RoY2ktYmF5aHViOmZpeCBRdWFs?= =?gb2312?Q?comm_sd_host_845_SD_card_compatibility_issue?= Thread-Topic: [PATCH V1 1/1]mmc:sdhci-bayhub:fix Qualcomm sd host 845 SD card compatibility issue Thread-Index: AQHXeEyqesdCbfGVHEqOsL9YWdZICatLxjYg Date: Tue, 20 Jul 2021 11:43:20 +0000 Message-ID: References: <20210714010742.4707-1-chevron.li@bayhubtech.com> In-Reply-To: <20210714010742.4707-1-chevron.li@bayhubtech.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=bayhubtech.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b6422ef1-d375-4e4d-fb55-08d94b739316 x-ms-traffictypediagnostic: SN1PR16MB2398: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:154; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: a4bNVFosacbpMMBgp5q4cTfUaBVgQMAf7apJ/7ECn9HepPffUA3nwMjFVAnEG4H5RBhUsHPEsqrulq7NRWX05ynmA+evGsWkVdwdfIsjpyDhmIk/2FPi+9DsqB+tNh1JLWQ4zW6UQiueX7dotVGG+Z4DBnaeEdtloN7QPSi71iXCgm/uhhttxEH4i+fOS9CTK7nbpGgWlZBcnShMHadpY3EOLS4W99u6fiAaWA2SlcGmLE62A3bGQawc49EW5HCBVC2fmmbIWnsyM3FC0gp9zgPAIu4VMcbInP0WZcIT7Jt0K1Konfe/J7U1ipaHaEHYdNdj3J00lC7onnRvjXl/YRFQQGQqYMgcbG85Vy+MIuW7Trj2VvEEqEx5ER75+GxQZBcw6YB5O+8Ba/JGsP+r4N8RJ15yVafnNs7LlV03ypo7ISMWhke4I18pxMZd4ERO5Wwl9iE7p6TwCtPKAxdLIhwWm+rHlQMX+lVIV/y++y4A/IwREeR6U9gTAnEGOFag9NR8+OJLeuerXqRZidAACEq7X0uEIJ/9nN3TYjFrE7PsDEBEurjE92ayHqwRNuIuTWlOzq//aEse+HcxZdBta1+pQZCWGpA6a1jQSO0tUkLLl7CiMDihZ/byjO/13h0UWynf2/MRdEArmbFJRvCHj6lQTBxmldwDASEo+868+0V5eczfs1i7TP9IrnoqyX0D32gYUFZ1b/hCFMBdIZ4YlLAv3rMSMHnG7ajuGmA5BPk= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR16MB2480.namprd16.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(376002)(136003)(39830400003)(396003)(346002)(38100700002)(54906003)(224303003)(2906002)(55016002)(9686003)(30864003)(316002)(86362001)(110136005)(52536014)(5660300002)(107886003)(83380400001)(66476007)(4326008)(66946007)(8936002)(478600001)(26005)(66446008)(71200400001)(7696005)(122000001)(6506007)(186003)(64756008)(66556008)(33656002)(76116006)(2004002)(38070700004)(579004)(559001)(569008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?gb2312?B?MURCclp2QllzRW9ML3UxeE5CSVRrYWVKOWVCOWYxNDZIWE50clpIbThIQlFH?= =?gb2312?B?cVVLY1F0bGhKRGZIbkR1ZTFtM1VCeUs1enNCdjRZbU1kWGZMRm9BVGVJRGVj?= =?gb2312?B?aEsxZzhzNVhxbE5UdXRkbTQzdzVIZ2N3VWVUNHVvbS8rUy9tcmIzcXNjSDZK?= =?gb2312?B?TWNONVdUVGMxZ2hTSnEyS25Fa0Z0S3k1M2RoRUJWeU4vd1ZNNXArTG5yeTlK?= =?gb2312?B?SXR3MDNIREl6SkFvWWVUbTk2ZUFSb2lEQk9zcTI4MjVoakNDSzB0WHlMSWFB?= =?gb2312?B?TmY5Z3lCU1dkTmYvUGo1YUt3MUhXRmY3cGJXZERrN0JKczRNR0l2UEdvQWxB?= =?gb2312?B?cUNRbzNzU1pJTTV4Ny9MRndEdG1hRnJIQVlCL1VGT0grLzVvNmJHbHdaYUxS?= =?gb2312?B?R0lHaUNheGNuTlhSL1VGdVQrOHBPVlNXMEo5UlgySGJmajB6d0lCYTRrUkhQ?= =?gb2312?B?OHRQLzFpeGVvR2grR1VuUmJlWW9wVEtxMGhPR05Ybk5MeDUrdkg2TGg5cU03?= =?gb2312?B?ZW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UR3dmUr?= =?gb2312?B?VTZiQkM1Y1BFS0o4aEQwSzlFYVhTLzhZTUtzZUF0NWZiVVlaR0JlZEJwSm1L?= =?gb2312?B?OWZEWndNTjhLWXRrUHpxOHdGRmxDSWc0QjBONlBYeDVycTQyZzE4bUUvSXlh?= =?gb2312?B?UG9WSG9OTG13SUh4Z1JUZGJVbzZTRGYyc3VLQWxGM2ZBWTlyVXMwK1AzaGtD?= =?gb2312?B?dFE1VmFtd1RsbGNmTU43SHlEb2FlaFpveHN3L1lONW0rRUNiL3A5SUtvSitR?= =?gb2312?B?Vk9wdy9tbEFkUzZoN2ZOS2VyVUdrYktzbEJvMFVYL2NuZWVjSU9NWmFndmxT?= =?gb2312?Q?Xdd82aLQerg2BgePKZR0tiJi9wCBlYIQLEoPDfP?= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: bayhubtech.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR16MB2480.namprd16.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6422ef1-d375-4e4d-fb55-08d94b739316 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2021 11:43:20.7996 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0a7aae2b-8f2e-44df-ba2f-42de7f93c642 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Q/qrjMn6ArVljBzABOe8TaACr8kNDxfZkBi24egFiBbaBMw+QnvoAesgt3sBI1zpnPY2Bx1NOJflhLIqw4+hCyYpUb4IyPGYvdUZiYardcE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR16MB2398 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SGksIEFkcmlhbiZVbGYsDQoNCkNhbiB5b3UgZ2l2ZSBzb21lIGNvbW1lbnRzIGZvciB0a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QlicmVhazsNCisJCX0NCisJfQ0KKwlyZXR1cm4gY250Ow0KK30NCisNCitp bnQgZ2V0X2xlZnRfb25lX3NlbChpbnQgYmFzZSkNCit7DQorCWlmIChiYXNlID09IDApDQorCQly ZXR1cm4gMHhhOw0KKwllbHNlDQorCQlyZXR1cm4gYmFzZSAtIDE7DQorfQ0KKw0KK2ludCBnZXRf cmlnaHRfb25lX3NlbChpbnQgYmFzZSkNCit7DQorCWlmIChiYXNlID09IDB4YSkNCisJCXJldHVy biAweDA7DQorCWVsc2UNCisJCXJldHVybiBiYXNlICsgMTsNCit9DQorDQoraW50IGdldF9kaWYo aW50IHgsIGludCB5KQ0KK3sNCisJaW50IGRpZiA9IDA7DQorDQorCWlmICh5ID4geCkNCisJCWRp ZiA9IHkgLSB4Ow0KKwllbHNlDQorCQlkaWYgPSB4IC0geTsNCisNCisJcmV0dXJuIGRpZjsNCit9 DQorDQorc3RhdGljIGludCB1cGRhdGVfc2VsYihzdHJ1Y3Qgc2RoY2lfaG9zdCAqaG9zdCwgaW50 IHRhcmdldF9zZWxiKQ0KK3sNCisJcmV0dXJuIHRhcmdldF9zZWxiOw0KK30NCisNCitzdGF0aWMg aW50IGdnY19nZXRfMTBjYXNlXzBfaW5kZXgodTMyIHZhbCkNCit7DQorCWludCBpID0gMDsNCisN CisJZm9yIChpID0gMDsgaSA8IFRVTklOR19QSEFTRV9TSVpFOyBpKyspIHsNCisJCWlmIChHRVRf SURYX1ZBTFVFKHZhbCwgaSkgPT0gMA0KKwkJICAgICYmIEdFVF9JRFhfVkFMVUUodmFsLA0KKwkJ CQkgICAgIFRSVU5JTkdfUklOR19JRFgoaSArIFRVTklOR19QSEFTRV9TSVpFIC0NCisJCQkJCQkg ICAgICAxKSkpIHsNCisJCQlyZXR1cm4gaTsNCisJCX0NCisJfQ0KKw0KKwlyZXR1cm4gLTE7DQor fQ0KKw0KK3N0YXRpYyB1MzIgZ2djX2dldF8wMWNhc2VfMF9pbmRleCh1MzIgdmFsKQ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wlpZiAoIWNsb2NrKSB7DQorCQlob3N0LT5tbWMtPmFjdHVhbF9jbG9jayA9 IG1zbV9iYXlodWJfaG9zdC0+Y2xrX3JhdGUgPSAwOw0KKwkJZ290byBvdXQ7DQorCX0NCisNCisJ c2RoY2lfbXNtX2JheWh1Yl9oY19zZWxlY3RfbW9kZShob3N0KTsNCisNCisJbXNtX2JheWh1Yl9z ZXRfY2xvY2tfcmF0ZV9mb3JfYnVzX21vZGUoaG9zdCwgY2xvY2spOw0KK291dDoNCisJX19zZGhj aV9tc21fYmF5aHViX3NldF9jbG9jayhob3N0LCBjbG9jayk7DQorfQ0KKw0KKy8qKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKlwNCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoNCisgKiBNU00gQ29tbWFuZCBRdWV1 ZSBFbmdpbmUgKENRRSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICoNCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICoNCitcKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovDQorDQor c3RhdGljIHUzMiBzZGhjaV9tc21fYmF5aHViX2NxZV9pcnEoc3RydWN0IHNkaGNpX2hvc3QgKmhv c3QsIHUzMiBpbnRtYXNrKQ0KK3sNCisJaW50IGNtZF9lcnJvciA9IDA7DQorCWludCBkYXRhX2Vy cm9yID0gMDsNCisNCisJaWYgKCFzZGhjaV9jcWVfaXJxKGhvc3QsIGludG1hc2ssICZjbWRfZXJy b3IsICZkYXRhX2Vycm9yKSkNCisJCXJldHVybiBpbnRtYXNrOw0KKw0KKw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