Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp493849pxb; Thu, 12 Nov 2020 08:43:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/YIqtuEHbBZ36YuT8Zqu8R8O0bsTYnu6EZ9yCrfs8SOvasjBrXzqJvHQUgWWo6CvX3eOk X-Received: by 2002:a17:906:2558:: with SMTP id j24mr98493ejb.329.1605199439751; Thu, 12 Nov 2020 08:43:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605199439; cv=none; d=google.com; s=arc-20160816; b=xR9gxETtG0ffrApLwEoroPvTX3skzxkk70YzlySz1NvwEGv3KGuHGd+1oNhSjknlis 7MJ+ts9HCIbFkEcpucZSAcB2KuzkXF1jHt1i6yuZeixg1M4Jd0bWkentmFUqN7aTZ+fg 8wxEO/M95Kd+weECyIPwWUFqTSKa0561bIqciWVSDYweb8IMdBf160B2Zf9F0klCbmyn eqRNXl+RBbG7sDeBVLPFcIqghm50R5s1/Qko5++BKbPYGPVOZTb+Hqg88Otb0hjnkrMA BO9xfpljt378q3gs3xctwIhKTCb23pj+TdNZ/vOhRvrmE8SGeUli7S5xZ6cs38Rr3IKz wsiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=aZ5hdJoP0CPuA8jmI673CvefM1UaofIP8i+JLYdlvH8=; b=03/F2Md89Z7ILrJhQ+7RNHcRi4mb+DL/n6XhQIQp8FQVxT+DwkbvSar6jEQHND4zJC CY1OvyL7BFfHarU3x4WFW4AxiAwAtGA766MVM5ChV8W2UBau5Tio1IuLX+Bcwvvcq55k kRVaYuDwMLMWpevCzBpuqb84yImsLs/AWwFqClDGO0PFr/D8JzG39ksONtFLV7TJsiKD fD7qCAgA2KNPNBTtVDbEGq7e5yzs/c8hrUI+6F7s/BaVSlkAuH1moQ7pvS/8z8V2Lie7 awP2WR/cz7R7mhdoMrGnxKMdrB8nPSO6788opHVGXUOEcN2VcgWFp7uB9AwnNmz5nGQr 5wZQ== ARC-Authentication-Results: i=1; mx.google.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 j90si4430202edc.189.2020.11.12.08.43.37; Thu, 12 Nov 2020 08:43:59 -0800 (PST) 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; 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 S1728522AbgKLQmR (ORCPT + 99 others); Thu, 12 Nov 2020 11:42:17 -0500 Received: from verein.lst.de ([213.95.11.211]:44266 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728426AbgKLQmR (ORCPT ); Thu, 12 Nov 2020 11:42:17 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 581A567373; Thu, 12 Nov 2020 17:42:13 +0100 (CET) Date: Thu, 12 Nov 2020 17:42:13 +0100 From: Christoph Hellwig To: Ulf Hansson Cc: Christoph Hellwig , =?utf-8?B?5Yav6ZSQ?= , Arnd Bergmann , Greg Kroah-Hartman , Linux Kernel Mailing List , "linux-mmc@vger.kernel.org" Subject: Re: [PATCH 3/3] mmc: rtsx: Add SD Express mode support for RTS5261 Message-ID: <20201112164213.GA16591@lst.de> References: <1600999061-13669-1-git-send-email-rui_feng@realsil.com.cn> <20201023091408.GA5201@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 23, 2020 at 02:12:19PM +0200, Ulf Hansson wrote: > SD spec mentions the write-protect switch on SD cards, while uSD cards > doesn't have one. In general, host drivers implement support for it > via a dedicated GPIO line routed to one of the pins in the SD slot. > > In this SD controller case, which is based upon PCI, it works a bit > differently, as the state of the write protect pin is managed through > the PCI interface. > > If I understand you correctly, you are saying that the controller > should be able to communicate (upwards to the block layer) its known > write protect state for the corresponding NVMe device, during > initialization? I got an answer form a member of the SD commitee, and the answer is: "The SD specification define that case very clearly as following. If card’s access is restricted through one of the SD unique features – PSWD Lock/Unlock, Temporary or Permanent WP (TWP or PWP) or CPRM then if access attempt is done through its NVMe interface the card will restrict the access and respond with Access denied. The access restriction shall be removed through the SD protocol/interface before being able to access the card through the NVMe. That is defined as following in the section 8.1.6 of the SD7.0 onward." Note that if you look at the spec this means only rejecting NVMe commands that write dta for the write protect pin.