Hi Zoltan,

On 11/8/2026 8:01 AM, BALATON Zoltan wrote:
On Sun, 8 Nov 2026, Helge Deller wrote:
Hello Balaton,

On 11/8/26 12:43, BALATON Zoltan wrote:
On Fri, 6 Nov 2026, Helge Deller wrote:
From: Helge Deller <[email protected]>

This adds a new driver for the NC53C710 chipset. This drover is based on the lsi53c895a driver, and thus avoids many issues of the existing ncr53c710
driver, which was written from scratch.

There's a typo "drover" above.

Thanks! I'll fix it the next round.

I asked this before but would it be possible to modify lsi53c895a.c
to also emulate the 53c710 too instead of duplicating code?

Maybe. At least in theory: Probably.

This device model is almost the same as the 53c895a or at least a
large part is shared but it's not easy to see that as it uses
different names for the same structures and functions. It would be
better to at least split the reused struct definitions from 53c895a
into a shared header and use that here. Then compare what are the
differences between the functions and see if the common parts could
either be split into a common super class or if the differences are
small enough to just add conditionals in lsi53c895a.c to also emulate 53c710 with most of the code shared instead of duplicated.
Well, this is a lot of work.
And I'm not sure if you gain that much from that exercise.

OK but at least using a common header should not be that much work and would reduce the differences and make the two device models more easily comparable.

If you are a person which really want to know all differences between
those two SCSI chips then this is most likely a very interesting project.
But I fail to see someone who volunteers for this, who has the time and
interest to really do this and who still guarantees he will not break the lsi53c895a.

I'm not sure what is the state of AI usage discussion but might also be a project to try an AI agent with.

Looking at the Linux kernel, there are lots of different drivers driving
all various variants of those SCSI chips. The 710 was one of the earlier
SCSI chips (e.g. ISA bus, no PCI,...) while the 53c895a is a newer chip
for PCI.

That's a diference in inteface but if the chip otherwise is the same or very similar it would be more easily modelled as a super class implementing the SCSI things and two subclasses embedding it one ISADevice and the other PCIDevice with the parts that's specific to the interface belonging to those child classes. That way there would be no code duplication.

In any case if there's code duplication then try not to make it worse by renaming everthing but keep the names and shared structs at least the same so it can be more easily compared and to what's different. That might also come in handy when there's a fix in one device that could be applied to the other too.


Right now, HP-UX (both 9.05 and 10.20) can't boot at all on the HP 715. The new model has been tested extensively, so we're keen to get this working for everyone.

You're right that it's hard to see how the two models relate when the shared pieces don't line up. Before I start, here is what I understand you'll accept for this patch series:

I'll move the shared definitions into a common header:

* request struct
* waiting and message-action enums
* SCSI phase constants
* register-bit defines that are common.

Both drivers will include that header. The 710 driver will use the same names as the 895 for the shared definitions. This enables the two to be compared side by side, and fixes can be carried between them.

The nice part about this approach is that the generated code on the 895 would be identical, when compared properly, so there shouldn't be any behavior changes to test, beyond basic smoke tests.

And we'll make sure the MAINTAINERS entry is correct, so we get proper notification for changes.

This would be the scope of this series: the 710 stays its own device model. If the header shows the remaining differences are small, I’m open to revisiting a common base class later.

Does this address your concern?

Thanks,
Keith


Regards,
BALATON Zoltan

A somewhat complex example of such code sharing is hw/isa/vt82c686.c
which uses a common super class or hw/display/ati.c which has
conditionals to emulate simlar devices. I was thinking about such
code sharing would be possible for these devices too to avoid code
duplication that can diverge in the future.

Yes, generally I prefer code sharing too.
But in this case the 710 is currently only used by the parisc emulation
(and might be used by one or two old historic non-x86 arches maybe too).

Helge




Reply via email to