From: Joao Pinto <Joao.Pinto@synopsys.com>
To: Arnd Bergmann <arnd@arndb.de>, Joao Pinto <Joao.Pinto@synopsys.com>
Cc: <vinholikatti@gmail.com>, <julian.calaby@gmail.com>,
<akinobu.mita@gmail.com>, <hch@infradead.org>,
<mark.rutland@arm.com>, <gbroner@codeaurora.org>,
<subhashj@codeaurora.org>, <CARLOS.PALMINHA@synopsys.com>,
<ijc+devicetree@hellion.org.uk>, <linux-kernel@vger.kernel.org>,
<linux-scsi@vger.kernel.org>, <devicetree@vger.kernel.org>
Subject: Re: [PATCH v10 6/6] add TC G210 pci driver
Date: Mon, 7 Mar 2016 11:03:10 +0000 [thread overview]
Message-ID: <56DD5FEE.8010508@synopsys.com> (raw)
In-Reply-To: <1920822.ETZj8qFg72@wuerfel>
Hi,
On 3/4/2016 9:17 PM, Arnd Bergmann wrote:
> On Friday 04 March 2016 17:22:19 Joao Pinto wrote:
>> This patch adds a glue pci driver for the Synopsys G210 Test Chip.
>>
>> Signed-off-by: Joao Pinto <jpinto@synopsys.com>
>
> Mostly ok, just a few suggestions:
>
>> +
>> +/* Test Chip type expected values */
>> +#define TC_G210_20BIT 20
>> +#define TC_G210_40BIT 40
>> +#define TC_G210_DEFAULTBIT 40
>> +
>> +static int tc_type = TC_G210_DEFAULTBIT;
>> +module_param(tc_type, int, 0);
>> +MODULE_PARM_DESC(tc_type, "Test Chip Type (20 = 20-bit, 40 = 40-bit)");
>>
>
> What is the effect of setting the wrong one here? I was thinking
> it would be best to have the default be 'invalid' and then return
> an error from the probe() function when you neither value is
> set.
You're right. Maybe an TC_G210_20BIT_INV by default and also check if the
inserted value is TC_G210_20BIT or TC_G210_40BIT. if not, then abort the probe.
>
>> +
>> + /* Check Test Chip type and set the specific setup routine */
>> + if (tc_type == TC_G210_20BIT) {
>> + tc_dwc_g210_pci_hba_vops.custom_phy_initialization =
>> + tc_dwc_g210_config_20_bit;
>> + } else if (tc_type == TC_G210_40BIT) {
>> + tc_dwc_g210_pci_hba_vops.custom_phy_initialization =
>> + tc_dwc_g210_config_40_bit;
>> + }
>
> As for the platform driver, I would define two separate structures here,
> and then mark the operations as 'const'.
>
>> +static const struct pci_device_id tc_dwc_g210_pci_tbl[] = {
>> + { PCI_VENDOR_ID_SYNOPSYS, 0xB101, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
>> + { PCI_VENDOR_ID_SYNOPSYS, 0xB102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
>> + { } /* terminate list */
>> +};
>
> Is there any difference between these two IDs?
The Synopsys can be identified by one of these 2 IDs. There is no particular reason.
>
> Arnd
>
Joao
next prev parent reply other threads:[~2016-03-07 11:05 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-04 17:22 [PATCH v10 0/6] add support for DWC UFS Controller Joao Pinto
2016-03-04 17:22 ` [PATCH v10 1/6] fixed typo in ufshcd-pltfrm Joao Pinto
2016-03-04 21:21 ` Arnd Bergmann
2016-03-04 17:22 ` [PATCH v10 2/6] added UFS 2.0 capabilities Joao Pinto
2016-03-04 21:08 ` Arnd Bergmann
2016-03-17 11:52 ` Rob Herring
2016-03-17 12:49 ` [RESEND] [PATCH v11 " Rob Herring
2016-03-29 10:41 ` Winkler, Tomas
2016-03-29 11:08 ` Joao Pinto
2016-03-29 11:33 ` Winkler, Tomas
2016-03-29 11:53 ` Joao Pinto
2016-03-04 17:22 ` [PATCH v10 3/6] added support for DesignWare Controller Joao Pinto
2016-03-04 21:09 ` Arnd Bergmann
2016-03-29 12:15 ` [RESEND] [PATCH v11 " Winkler, Tomas
2016-03-30 9:54 ` Joao Pinto
2016-03-04 17:22 ` [PATCH v10 4/6] added support for Synopsys G210 Test Chip Joao Pinto
2016-03-04 21:10 ` Arnd Bergmann
2016-03-04 17:22 ` [PATCH v10 5/6] add TC G210 platform driver Joao Pinto
2016-03-04 21:12 ` Arnd Bergmann
2016-03-07 10:02 ` Joao Pinto
2016-03-04 17:22 ` [PATCH v10 6/6] add TC G210 pci driver Joao Pinto
2016-03-04 21:17 ` Arnd Bergmann
2016-03-07 11:03 ` Joao Pinto [this message]
[not found] ` <f12dcbcb9b83881a5f71460e2d6e1ab0f1e326d8.1457352207.git.jpinto@synopsys.com>
2016-03-07 12:09 ` [PATCH v11 5/6] add TC G210 platform driver Joao Pinto
2016-03-17 14:55 ` Rob Herring
2016-03-07 12:09 ` [PATCH v11 6/6] add-TC-G210-pci-driver Joao Pinto
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=56DD5FEE.8010508@synopsys.com \
--to=joao.pinto@synopsys.com \
--cc=CARLOS.PALMINHA@synopsys.com \
--cc=akinobu.mita@gmail.com \
--cc=arnd@arndb.de \
--cc=devicetree@vger.kernel.org \
--cc=gbroner@codeaurora.org \
--cc=hch@infradead.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=julian.calaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=subhashj@codeaurora.org \
--cc=vinholikatti@gmail.com \
/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
Powered by JetHome