linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guan Yung Tseng <guan.yung.tseng@ni.com>
To: <gregkh@linuxfoundation.org>, <hch@infradead.org>
Cc: <linux-serial@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"Guan Yung Tseng" <guan.yung.tseng@ni.com>
Subject: [PATCH v2] 8250_pci.c: Update NI specific devices class to multi serial
Date: Tue, 22 Jan 2019 17:19:42 +0800	[thread overview]
Message-ID: <1548148782-3414-1-git-send-email-guan.yung.tseng@ni.com> (raw)

On, Jan 14, 2019 at 10:10:05PM +0800, Guan Yung Tseng wrote:
>> Modified NI devices class to PCI_CLASS_COMMUNICATION_MULTISERIAL.
>> The reason of doing this is because all NI multi port serial cards
>> use PCI_CLASS_COMMUNICATION_OTHER class and thus fail the
>> serial_pci_is_class_communication test added in the commit 7d8905d06405
>> ("serial: 8250_pci: Enable device after we check black list").
>> 
>> Signed-off-by: Guan Yung Tseng <guan.yung.tseng@ni.com>
>> ---
>>  drivers/tty/serial/8250/8250_pci.c | 20 ++++++++++++++++++++
>>  1 file changed, 20 insertions(+)
>> 
>> diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
>> index 4986b4a..0949db1 100644
>> --- a/drivers/tty/serial/8250/8250_pci.c
>> +++ b/drivers/tty/serial/8250/8250_pci.c
>> @@ -663,6 +663,13 @@ static int pci_xircom_init(struct pci_dev *dev)
>>  	return 0;
>>  }
>>  
>> +static int pci_ni_probe(struct pci_dev *dev)
>> +{
>> +	dev->class = PCI_CLASS_COMMUNICATION_MULTISERIAL << 8 |
>> +			(dev->class & 0xff);

>
> As Christoph said, this looks really odd.  This field comes from the
> PCI structure on the device, it should not be modified by the kernel.
> 
> Unless the device is broken and needs to be fixed up in the kernel?
> 
> Also, you have sent 2 different patches here for this type of issue, are
> both needed?  If so, please resend both of them as a patch series, with
> more explainations in this one as to why you are modifying this field.
> 
> I've dropped all pending patches from you from my queue now.
> 

Hi Christoph and Greg,

Sorry for the confusion sending 2 different patches to solve the same
issue. I should have wait for your response before sending antoher
patch to solve the similar issue.

For some historical reason, NI serial devices use
PCI_CLASS_COMMUNICATION_OTHER class code. Yes, I understand that
the class code should read from config space instead modified from
kernel. But these devices are shipped to the market for many years.
That's why I am trying to fix the problem in the kernel.

I will send another simple patch again to fix the problem.

             reply	other threads:[~2019-01-22  9:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22  9:19 Guan Yung Tseng [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-01-15 10:10 [PATCH v2] 8250_pci.c: Update NI specific devices class to multi serial Guan Yung Tseng
2019-01-15 13:31 ` Christoph Hellwig

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=1548148782-3414-1-git-send-email-guan.yung.tseng@ni.com \
    --to=guan.yung.tseng@ni.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@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;
as well as URLs for NNTP newsgroup(s).