Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16107736rwd; Mon, 26 Jun 2023 06:00:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4sUrGyXyJpLefLjqPa8Op2V7eg1mJnIY4syuT+epYQmXAUqfnMhVbEzuYSiM9uv6BHGfRb X-Received: by 2002:a17:90b:3141:b0:259:548b:d394 with SMTP id ip1-20020a17090b314100b00259548bd394mr19800516pjb.28.1687784454088; Mon, 26 Jun 2023 06:00:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687784454; cv=none; d=google.com; s=arc-20160816; b=jH8mI6ZSq1i5qa2Du6zmkiUsMpdKGaftSlhxA4N/1pbMQ3EfuOwte3bv5dA5BFiAq0 vrFwHue0/d1AkmGkhF2VkQJhvSYh1SLBTpbbqj2cD9O8kv5gOH5BSDeIonkFC9nPzs1d w1sN0Z0kalNsfZLOIfOcBoBif5mqRhSTN2Hsjh1xhtzuq6IYGTwoNuDoBKS0a+JugdAg XjDU/nrheYxZ2j+BTtSK4fIAOkGIDTEHmFlr2ojYCzRJL7n7jLIH5SYuwmED85F+bQpZ bRRyYbWewkjIesw/X0fbnwvouJ0L+p0PmMbA+5X+xwjMGasz0UNP9NkseAOwu3AcocSL g6cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=rQn06EuJ4jPeyoDQGsXqDrOeiT9SfgNmxTAi5qRod34=; fh=EQ6TQu1I8uxNL0iwzphQxbYaDCZ26nKvdmX0t75Yc2E=; b=dpCu7X8dLblW2236hYAeZP8rdBcZQ65J3Y2JbUQSlZa01qjdpdJeRpnQA2hVaomTYe 8ROFEa8X3yTbhX0h3mZLoFDpwk0X6UYx4pUB3J9W1/eOrlW3vJ+l3GlHvhiSTv8sNci7 /S8tw6fV6KBm91hlvagee4lAo/Htpvb//odHmoiM7McHJvDa9GoxODQoVFmv2nTvVHEX 2gFBNkfxZONmNMtJ7dwt/aMsfjq3tcBLMa/fp0Cj+4Kvh0kL/I+ORwBbhBhp46WcXpOp mGpxXTZgN5/YKrkb519JreucnlQmBbNvlVEO9hNzO0uqH3+22X/1kOcL+IZUN+vpIagL eWZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aF585ll2; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n1-20020a17090a2c8100b002563c39f342si5031560pjd.110.2023.06.26.06.00.41; Mon, 26 Jun 2023 06:00:54 -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=@kernel.org header.s=k20201202 header.b=aF585ll2; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229731AbjFZMka (ORCPT + 99 others); Mon, 26 Jun 2023 08:40:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbjFZMk3 (ORCPT ); Mon, 26 Jun 2023 08:40:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43E0A10B; Mon, 26 Jun 2023 05:40:27 -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 D24B860E88; Mon, 26 Jun 2023 12:40:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54FDAC433C8; Mon, 26 Jun 2023 12:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687783226; bh=wQ6Z/RpCgi70OuvzNQeJd1tpKawWzkWK8jQrKXYxy2g=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=aF585ll2jwU6U4JhXNmIBLhtu+HU25IlH7ZKu8FEqDjjEMPowz7borSneEWXW2bnb tFLS8MpXqz4ZyhQ5cpIDlDqqmeacUD5SNxExbvglLRvPejcCox1GR5sX4Z8/9/5QzS 2A9V/ksfnAHU1chizpsw2ljN75OOISfsZMOFBkfiOAuJz30gSJCFOsZsHvwqv12NaW oYAMcAc/TWnppC7wnphkrYYClQYp6/OuVe2H10u96hinIBQ9LtU89f7XC7EuyZucYI lnAcdOWt+6Ozez/723wKCqBzk958Hlyqr+QDDrgsn/oOPtwlO2+Mi1RdigGK1lXEdl ydPCjrLEaaO6Q== Message-ID: <330d93ee-b4b6-2397-2b7c-eb4d99676f87@kernel.org> Date: Mon, 26 Jun 2023 21:40:24 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] Signed-off-by: Runa Guo-oc Content-Language: en-US To: Runa Guo-oc , linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org Cc: CobeChen@zhaoxin.com, TimGuo@zhaoxin.com, TonyWWang@zhaoxin.com, LeoLiu@zhaoxin.com, RunaGuo@zhaoxin.com References: <1686901766-4928-1-git-send-email-RunaGuo-oc@zhaoxin.com> <70853f13-f74e-d9bb-89f7-4c804f1fa8a4@zhaoxin.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <70853f13-f74e-d9bb-89f7-4c804f1fa8a4@zhaoxin.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 6/26/23 20:29, Runa Guo-oc wrote: > On 2023/6/16 16:34, Damien Le Moal wrote: >> On 6/16/23 16:49, Runa Guo-oc wrote: >>> [PATCH] ata:sata_zhaoxin: Add support for ZhaoXin Serial ATA >> >> Broken patch: the email subject is your SoB instead of the above line, which >> should not be part of the message (it should be the subject). Please reformat >> and resend. >> > > Okay. > >>> >>> Add ZhaoXin Serial ATA support for ZhaoXin CUPs. >> >> What is "ZhaoXin" ? > > Zhaoxin is a Chinese company that has mastered the core technology > of independent general-purpose processors and its system platform chips, > and is committed to providing users with efficient, compatible and secure > independent general-purpose processors, chipsets and other products. > for more information, you can visit here: https://www.zhaoxin.com/. A company marketing message is not very informative, technically speaking. What is this chipset and on what board/machine can it be found ? That is the more relevant information we need in this commit message. > >> And what is "CUPs" ? Please spell this out. >> > > Yes, this is a spelling error. > >>> >>> Signed-off-by: Runa Guo-oc >>> --- >>> drivers/ata/Kconfig | 8 + >>> drivers/ata/Makefile | 1 + >>> drivers/ata/sata_zhaoxin.c | 384 +++++++++++++++++++++++++++++++++++++++++++++ >>> 3 files changed, 393 insertions(+) >>> create mode 100644 drivers/ata/sata_zhaoxin.c >>> >>> diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig >>> index 42b51c9..ae327f3 100644 >>> --- a/drivers/ata/Kconfig >>> +++ b/drivers/ata/Kconfig >>> @@ -553,6 +553,14 @@ config SATA_VITESSE >>> >>> If unsure, say N. >>> >>> +config SATA_ZHAOXIN >>> + tristate "ZhaoXin SATA support" Same here. If ZhaoXin is only a company name, we need also a chipset model to be informative regarding which HW this driver serves. >>> + depends on PCI >>> + help >>> + This option enables support for ZhaoXin Serial ATA. >>> + >>> + If unsure, say N. >>> + >>> comment "PATA SFF controllers with BMDMA" >>> >>> config PATA_ALI >>> diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile >>> index 20e6645..4b84669 100644 >>> --- a/drivers/ata/Makefile >>> +++ b/drivers/ata/Makefile >>> @@ -45,6 +45,7 @@ obj-$(CONFIG_SATA_SIL) += sata_sil.o >>> obj-$(CONFIG_SATA_SIS) += sata_sis.o >>> obj-$(CONFIG_SATA_SVW) += sata_svw.o >>> obj-$(CONFIG_SATA_ULI) += sata_uli.o >>> +obj-$(CONFIG_SATA_ZHAOXIN) += sata_zhaoxin.o >> >> Please sort this alphabetically. >> > > Like this? > obj-$(CONFIG_SATA_VITESSE) += sata_vsc.o > obj-$(CONFIG_SATA_ZHAOXIN) += sata_zhaoxin.o Yes. >>> + >>> + ata_link_err(link, "COMRESET success (errno=%d) ap=%d link %d\n", >>> + rc, link->ap->port_no, link->pmp); >>> + } else { >>> + ata_link_err(link, "COMRESET failed (errno=%d) ap=%d link %d\n", >>> + rc, link->ap->port_no, link->pmp); >> >> Reverse the if condition and exit early for this case. That will make the >> function code nicer. And you can drop the error message as well since >> sata_std_hardreset() prints one. >> > > Yes, I agree with your. I'll adjust the above codes like these? > > if(!rc || rc == -EAGAIN){ > struct ata_port *ap = link->ap; > int pmp = link->pmp; > int tmprc; > if(pmp){ > ap->ops->sff_dev_select(ap,pmp); > tmprc=ata_sff_wait_ready(&ap->link,deadline); > }else > tmprc=ata_sff_wait_ready(link,deadline); > > if(tmprc) > ata_link_err(link,"COMRESET failed for > wait(errno=%d)\n",rc); > > ata_link_err(link,"COMRESET success (errno=%d) ap=%d > link%d\n", > rc,link->ap->port_no,link->pmp); > You did not understand my point. Doing: rc = sata_std_hardreset(link, class, deadline); if (rc && rc != -EAGAIN) { ata_link_err(link, "COMRESET failed (errno=%d) ap=%d link %d\n", rc, link->ap->port_no, link->pmp); return rc; } /* rc == 0 || rc == -EAGAIN case */ ... Makes the code much nicer. [...] >>> +MODULE_AUTHOR("Yanchen:YanchenSun@zhaoxin.com"); >>> +MODULE_DESCRIPTION("SCSI low-level driver for ZX SATA controllers"); >> >> This is not a scsi driver... >> > > I treat it as a scsi driver for the following reasons, which may be not > accurate. > 1, IO path: vfs->fs->block layer->scsi layer->this driver; > 2, Extracted from the following link: > "SCSI Lower level drivers (LLDs) are variously called host bus adapter > (HBA) drivers and host drivers (HD)." Again, this is not a scsi driver. Even if in Linux all ATA drives seat under the scsi layer, this is an ATA subsytem driver for an ATA drive. Not SCSI. -- Damien Le Moal Western Digital Research