public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Runa Guo-oc <RunaGuo-oc@zhaoxin.com>,
	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
Subject: Re: [PATCH] Signed-off-by: Runa Guo-oc <RunaGuo-oc@zhaoxin.com>
Date: Mon, 26 Jun 2023 21:40:24 +0900	[thread overview]
Message-ID: <330d93ee-b4b6-2397-2b7c-eb4d99676f87@kernel.org> (raw)
In-Reply-To: <70853f13-f74e-d9bb-89f7-4c804f1fa8a4@zhaoxin.com>

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 <RunaGuo-oc@zhaoxin.com>
>>> ---
>>>  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


  reply	other threads:[~2023-06-26 12:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16  7:49 [PATCH] Signed-off-by: Runa Guo-oc <RunaGuo-oc@zhaoxin.com> Runa Guo-oc
2023-06-16  8:34 ` Damien Le Moal
2023-06-26 11:29   ` Runa Guo-oc
2023-06-26 12:40     ` Damien Le Moal [this message]
2023-06-27  7:17       ` Runa Guo-oc
2023-06-27  8:02         ` Damien Le Moal
2023-06-27  8:51           ` Runa Guo-oc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=330d93ee-b4b6-2397-2b7c-eb4d99676f87@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=CobeChen@zhaoxin.com \
    --cc=LeoLiu@zhaoxin.com \
    --cc=RunaGuo-oc@zhaoxin.com \
    --cc=RunaGuo@zhaoxin.com \
    --cc=TimGuo@zhaoxin.com \
    --cc=TonyWWang@zhaoxin.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox